aboutsummaryrefslogtreecommitdiff
path: root/src/wcautil/inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wcautil/inc')
-rw-r--r--src/wcautil/inc/wcautil.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/wcautil/inc/wcautil.h b/src/wcautil/inc/wcautil.h
index 8139a7ca..982173f4 100644
--- a/src/wcautil/inc/wcautil.h
+++ b/src/wcautil/inc/wcautil.h
@@ -6,14 +6,22 @@
6extern "C" { 6extern "C" {
7#endif 7#endif
8 8
9#include "dutilsources.h"
10
9#define WIXAPI __stdcall 11#define WIXAPI __stdcall
10#define ExitTrace WcaLogError 12#ifndef DUTIL_SOURCE_DEFAULT
13#define DUTIL_SOURCE_DEFAULT DUTIL_SOURCE_EXTERNAL
14#endif
11 15
12#include "dutil.h" 16#include "dutil.h"
13 17
14#define MessageExitOnLastError(x, e, s, ...) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ExitTrace(x, "%s", s, __VA_ARGS__); WcaErrorMessage(e, x, MB_OK, -1, __VA_ARGS__); goto LExit; } } 18#define MessageExitOnLastErrorSource(d, x, e, s, ...) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ExitTraceSource(d, x, "%s", s, __VA_ARGS__); WcaErrorMessage(e, x, MB_OK, -1, __VA_ARGS__); goto LExit; } }
15#define MessageExitOnFailure(x, e, s, ...) if (FAILED(x)) { ExitTrace(x, "%s", s, __VA_ARGS__); WcaErrorMessage(e, x, INSTALLMESSAGE_ERROR | MB_OK, -1, __VA_ARGS__); goto LExit; } 19#define MessageExitOnFailureSource(d, x, e, s, ...) if (FAILED(x)) { ExitTraceSource(d, x, "%s", s, __VA_ARGS__); WcaErrorMessage(e, x, INSTALLMESSAGE_ERROR | MB_OK, -1, __VA_ARGS__); goto LExit; }
16#define MessageExitOnNullWithLastError(p, x, e, s, ...) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, "%s", s, __VA_ARGS__); WcaErrorMessage(e, x, MB_OK, -1, __VA_ARGS__); goto LExit; } 20#define MessageExitOnNullWithLastErrorSource(d, p, x, e, s, ...) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTraceSource(d, x, "%s", s, __VA_ARGS__); WcaErrorMessage(e, x, MB_OK, -1, __VA_ARGS__); goto LExit; }
21
22#define MessageExitOnLastError(x, e, s, ...) MessageExitOnLastErrorSource(DUTIL_SOURCE_DEFAULT, x, e, s, __VA_ARGS__)
23#define MessageExitOnFailure(x, e, s, ...) MessageExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, e, s, __VA_ARGS__)
24#define MessageExitOnNullWithLastError(p, x, e, s, ...) MessageExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, e, s, __VA_ARGS__)
17 25
18// Generic action enum. 26// Generic action enum.
19typedef enum WCA_ACTION 27typedef enum WCA_ACTION
@@ -101,6 +109,11 @@ void __cdecl WcaLogError(
101 __in LPCSTR szMessage, 109 __in LPCSTR szMessage,
102 ... 110 ...
103 ); 111 );
112void WIXAPI WcaLogErrorArgs(
113 __in HRESULT hr,
114 __in LPCSTR szMessage,
115 __in va_list args
116 );
104 117
105UINT WIXAPI WcaProcessMessage( 118UINT WIXAPI WcaProcessMessage(
106 __in INSTALLMESSAGE eMessageType, 119 __in INSTALLMESSAGE eMessageType,