aboutsummaryrefslogtreecommitdiff
path: root/src/stub/stub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stub/stub.cpp')
-rw-r--r--src/stub/stub.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/stub/stub.cpp b/src/stub/stub.cpp
index 2f09eede..d3ace1f3 100644
--- a/src/stub/stub.cpp
+++ b/src/stub/stub.cpp
@@ -3,6 +3,16 @@
3#include "precomp.h" 3#include "precomp.h"
4 4
5 5
6static void CALLBACK BurnTraceError(
7 __in_z LPCSTR szFile,
8 __in int iLine,
9 __in REPORT_LEVEL rl,
10 __in UINT source,
11 __in HRESULT hrError,
12 __in_z __format_string LPCSTR szFormat,
13 __in va_list args
14 );
15
6int WINAPI wWinMain( 16int WINAPI wWinMain(
7 __in HINSTANCE hInstance, 17 __in HINSTANCE hInstance,
8 __in_opt HINSTANCE /* hPrevInstance */, 18 __in_opt HINSTANCE /* hPrevInstance */,
@@ -30,6 +40,8 @@ int WINAPI wWinMain(
30 L"feclient.dll", // unsafely loaded by DecryptFile(). 40 L"feclient.dll", // unsafely loaded by DecryptFile().
31 }; 41 };
32 42
43 DutilInitialize(&BurnTraceError);
44
33 // Best effort attempt to get our file handle as soon as possible. 45 // Best effort attempt to get our file handle as soon as possible.
34 hr = PathForCurrentProcess(&sczPath, NULL); 46 hr = PathForCurrentProcess(&sczPath, NULL);
35 if (SUCCEEDED(hr)) 47 if (SUCCEEDED(hr))
@@ -60,5 +72,23 @@ LExit:
60 ReleaseFileHandle(hEngineFile); 72 ReleaseFileHandle(hEngineFile);
61 ReleaseStr(sczPath); 73 ReleaseStr(sczPath);
62 74
75 DutilUninitialize();
76
63 return FAILED(hr) ? (int)hr : (int)dwExitCode; 77 return FAILED(hr) ? (int)hr : (int)dwExitCode;
64} 78}
79
80static void CALLBACK BurnTraceError(
81 __in_z LPCSTR /*szFile*/,
82 __in int /*iLine*/,
83 __in REPORT_LEVEL /*rl*/,
84 __in UINT source,
85 __in HRESULT hrError,
86 __in_z __format_string LPCSTR szFormat,
87 __in va_list args
88 )
89{
90 if (DUTIL_SOURCE_DEFAULT == source)
91 {
92 LogErrorStringArgs(hrError, szFormat, args);
93 }
94}