aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/svcutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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