diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-07-01 21:38:54 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-07-01 21:50:44 +1000 |
commit | 992ca1b24e981fa42eab8cbd8e170819deb34ea7 (patch) | |
tree | 5e5eed9f5d08ce379523876388ef32f8ba42fa1d /src | |
parent | f0fde07fde0b7e786d495982d85e97e926f56ebe (diff) | |
download | wix-992ca1b24e981fa42eab8cbd8e170819deb34ea7.tar.gz wix-992ca1b24e981fa42eab8cbd8e170819deb34ea7.tar.bz2 wix-992ca1b24e981fa42eab8cbd8e170819deb34ea7.zip |
Update wixstdba to show theme load errors.
Diffstat (limited to 'src')
-rw-r--r-- | src/wixstdba/wixstdba.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/wixstdba/wixstdba.cpp b/src/wixstdba/wixstdba.cpp index 727c8cb0..a96f1738 100644 --- a/src/wixstdba/wixstdba.cpp +++ b/src/wixstdba/wixstdba.cpp | |||
@@ -5,6 +5,16 @@ | |||
5 | static HINSTANCE vhInstance = NULL; | 5 | static HINSTANCE vhInstance = NULL; |
6 | static IBootstrapperApplication* vpApplication = NULL; | 6 | static IBootstrapperApplication* vpApplication = NULL; |
7 | 7 | ||
8 | static void CALLBACK WixstdbaTraceError( | ||
9 | __in_z LPCSTR szFile, | ||
10 | __in int iLine, | ||
11 | __in REPORT_LEVEL rl, | ||
12 | __in UINT source, | ||
13 | __in HRESULT hrError, | ||
14 | __in_z __format_string LPCSTR szFormat, | ||
15 | __in va_list args | ||
16 | ); | ||
17 | |||
8 | extern "C" BOOL WINAPI DllMain( | 18 | extern "C" BOOL WINAPI DllMain( |
9 | IN HINSTANCE hInstance, | 19 | IN HINSTANCE hInstance, |
10 | IN DWORD dwReason, | 20 | IN DWORD dwReason, |
@@ -35,6 +45,8 @@ extern "C" HRESULT WINAPI BootstrapperApplicationCreate( | |||
35 | HRESULT hr = S_OK; | 45 | HRESULT hr = S_OK; |
36 | IBootstrapperEngine* pEngine = NULL; | 46 | IBootstrapperEngine* pEngine = NULL; |
37 | 47 | ||
48 | DutilInitialize(&WixstdbaTraceError); | ||
49 | |||
38 | hr = BalInitializeFromCreateArgs(pArgs, &pEngine); | 50 | hr = BalInitializeFromCreateArgs(pArgs, &pEngine); |
39 | ExitOnFailure(hr, "Failed to initialize Bal."); | 51 | ExitOnFailure(hr, "Failed to initialize Bal."); |
40 | 52 | ||
@@ -52,6 +64,7 @@ extern "C" void WINAPI BootstrapperApplicationDestroy() | |||
52 | { | 64 | { |
53 | ReleaseNullObject(vpApplication); | 65 | ReleaseNullObject(vpApplication); |
54 | BalUninitialize(); | 66 | BalUninitialize(); |
67 | DutilUninitialize(); | ||
55 | } | 68 | } |
56 | 69 | ||
57 | 70 | ||
@@ -64,6 +77,8 @@ extern "C" HRESULT WINAPI DncPrereqBootstrapperApplicationCreate( | |||
64 | { | 77 | { |
65 | HRESULT hr = S_OK; | 78 | HRESULT hr = S_OK; |
66 | 79 | ||
80 | DutilInitialize(&WixstdbaTraceError); | ||
81 | |||
67 | BalInitialize(pEngine); | 82 | BalInitialize(pEngine); |
68 | 83 | ||
69 | hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); | 84 | hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); |
@@ -78,6 +93,7 @@ extern "C" void WINAPI DncPrereqBootstrapperApplicationDestroy() | |||
78 | { | 93 | { |
79 | ReleaseNullObject(vpApplication); | 94 | ReleaseNullObject(vpApplication); |
80 | BalUninitialize(); | 95 | BalUninitialize(); |
96 | DutilUninitialize(); | ||
81 | } | 97 | } |
82 | 98 | ||
83 | 99 | ||
@@ -90,6 +106,8 @@ extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( | |||
90 | { | 106 | { |
91 | HRESULT hr = S_OK; | 107 | HRESULT hr = S_OK; |
92 | 108 | ||
109 | DutilInitialize(&WixstdbaTraceError); | ||
110 | |||
93 | BalInitialize(pEngine); | 111 | BalInitialize(pEngine); |
94 | 112 | ||
95 | hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); | 113 | hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); |
@@ -104,4 +122,23 @@ extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy() | |||
104 | { | 122 | { |
105 | ReleaseNullObject(vpApplication); | 123 | ReleaseNullObject(vpApplication); |
106 | BalUninitialize(); | 124 | BalUninitialize(); |
125 | DutilUninitialize(); | ||
126 | } | ||
127 | |||
128 | static void CALLBACK WixstdbaTraceError( | ||
129 | __in_z LPCSTR /*szFile*/, | ||
130 | __in int /*iLine*/, | ||
131 | __in REPORT_LEVEL /*rl*/, | ||
132 | __in UINT source, | ||
133 | __in HRESULT hrError, | ||
134 | __in_z __format_string LPCSTR szFormat, | ||
135 | __in va_list args | ||
136 | ) | ||
137 | { | ||
138 | // BalLogError currently uses the Exit... macros, | ||
139 | // so if expanding the scope need to ensure this doesn't get called recursively. | ||
140 | if (DUTIL_SOURCE_THMUTIL == source) | ||
141 | { | ||
142 | BalLogErrorArgs(hrError, szFormat, args); | ||
143 | } | ||
107 | } | 144 | } |