aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/svcutil.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-03-02 14:19:14 -0600
committerSean Hall <r.sean.hall@gmail.com>2021-03-02 15:40:02 -0600
commit10ebf674da5df9224e4eddd3545518434c5b455b (patch)
treeea1f4063edd46e9942eab94dd7adb2f75c6c589e /src/dutil/svcutil.cpp
parent3bbf1347b900ec115a12faf8f46965c9b7649696 (diff)
downloadwix-10ebf674da5df9224e4eddd3545518434c5b455b.tar.gz
wix-10ebf674da5df9224e4eddd3545518434c5b455b.tar.bz2
wix-10ebf674da5df9224e4eddd3545518434c5b455b.zip
Update rest of dutil to use their own source with the Exit* macros.
Fix some CA warnings.
Diffstat (limited to 'src/dutil/svcutil.cpp')
-rw-r--r--src/dutil/svcutil.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/dutil/svcutil.cpp b/src/dutil/svcutil.cpp
index 9da2b5b3..1a39bfee 100644
--- a/src/dutil/svcutil.cpp
+++ b/src/dutil/svcutil.cpp
@@ -2,6 +2,21 @@
2 2
3#include "precomp.h" 3#include "precomp.h"
4 4
5
6// Exit macros
7#define SvcExitOnLastError(x, s, ...) ExitOnLastErrorSource(DUTIL_SOURCE_SVCUTIL, x, s, __VA_ARGS__)
8#define SvcExitOnLastErrorDebugTrace(x, s, ...) ExitOnLastErrorDebugTraceSource(DUTIL_SOURCE_SVCUTIL, x, s, __VA_ARGS__)
9#define SvcExitWithLastError(x, s, ...) ExitWithLastErrorSource(DUTIL_SOURCE_SVCUTIL, x, s, __VA_ARGS__)
10#define SvcExitOnFailure(x, s, ...) ExitOnFailureSource(DUTIL_SOURCE_SVCUTIL, x, s, __VA_ARGS__)
11#define SvcExitOnRootFailure(x, s, ...) ExitOnRootFailureSource(DUTIL_SOURCE_SVCUTIL, x, s, __VA_ARGS__)
12#define SvcExitOnFailureDebugTrace(x, s, ...) ExitOnFailureDebugTraceSource(DUTIL_SOURCE_SVCUTIL, x, s, __VA_ARGS__)
13#define SvcExitOnNull(p, x, e, s, ...) ExitOnNullSource(DUTIL_SOURCE_SVCUTIL, p, x, e, s, __VA_ARGS__)
14#define SvcExitOnNullWithLastError(p, x, s, ...) ExitOnNullWithLastErrorSource(DUTIL_SOURCE_SVCUTIL, p, x, s, __VA_ARGS__)
15#define SvcExitOnNullDebugTrace(p, x, e, s, ...) ExitOnNullDebugTraceSource(DUTIL_SOURCE_SVCUTIL, p, x, e, s, __VA_ARGS__)
16#define SvcExitOnInvalidHandleWithLastError(p, x, s, ...) ExitOnInvalidHandleWithLastErrorSource(DUTIL_SOURCE_SVCUTIL, p, x, s, __VA_ARGS__)
17#define SvcExitOnWin32Error(e, x, s, ...) ExitOnWin32ErrorSource(DUTIL_SOURCE_SVCUTIL, e, x, s, __VA_ARGS__)
18#define SvcExitOnGdipFailure(g, x, s, ...) ExitOnGdipFailureSource(DUTIL_SOURCE_SVCUTIL, g, x, s, __VA_ARGS__)
19
5/******************************************************************** 20/********************************************************************
6SvcQueryConfig - queries the configuration of a service 21SvcQueryConfig - queries the configuration of a service
7 22
@@ -21,16 +36,16 @@ extern "C" HRESULT DAPI SvcQueryConfig(
21 if (ERROR_INSUFFICIENT_BUFFER == er) 36 if (ERROR_INSUFFICIENT_BUFFER == er)
22 { 37 {
23 pConfig = static_cast<QUERY_SERVICE_CONFIGW*>(MemAlloc(cbConfig, TRUE)); 38 pConfig = static_cast<QUERY_SERVICE_CONFIGW*>(MemAlloc(cbConfig, TRUE));
24 ExitOnNull(pConfig, hr, E_OUTOFMEMORY, "Failed to allocate memory to get configuration."); 39 SvcExitOnNull(pConfig, hr, E_OUTOFMEMORY, "Failed to allocate memory to get configuration.");
25 40
26 if (!::QueryServiceConfigW(sch, pConfig, cbConfig, &cbConfig)) 41 if (!::QueryServiceConfigW(sch, pConfig, cbConfig, &cbConfig))
27 { 42 {
28 ExitWithLastError(hr, "Failed to read service configuration."); 43 SvcExitWithLastError(hr, "Failed to read service configuration.");
29 } 44 }
30 } 45 }
31 else 46 else
32 { 47 {
33 ExitOnWin32Error(er, hr, "Failed to query service configuration."); 48 SvcExitOnWin32Error(er, hr, "Failed to query service configuration.");
34 } 49 }
35 } 50 }
36 51