10#define TESTING_SERVICEW L"Spooler"
11#define TESTING_SERVICEA "Spooler"
103 DWORD dwRequiredSize = 0;
118 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
119 if (dwRequiredSize == 0)
121 skip(
"Required size is null; cannot proceed with QueryConfig2W --> %lu test\n",
dwInfoLevel);
129 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
140 ok(bError,
"bError = %u, expected TRUE\n", bError);
143 skip(
"QueryServiceConfig2W returned an error; cannot proceed with QueryConfig2W --> %lu test\n",
dwInfoLevel);
152 ok(lRet ==
ERROR_SUCCESS,
"RegOpenKeyExW failed with 0x%08lx\n", lRet);
155 skip(
"No regkey; cannot proceed with QueryConfig2W --> %lu test\n",
dwInfoLevel);
169 ok(dwRet ==
ERROR_SUCCESS,
"RegReadStringW returned 0x%08lx\n", dwRet);
170 ok(lpszDescription !=
NULL,
"lpszDescription is null, expected non-null\n");
178 ok(iRet == 0,
"Retrieved descriptions are different !\n");
202 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExW returned 0x%08lx\n", lRet);
203 ok(dwType ==
REG_BINARY,
"dwType = %lu, expected REG_BINARY\n", dwType);
204 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
207 if (lpFailureActions2 ==
NULL)
209 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
217 (
LPBYTE)lpFailureActions2,
219 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExW returned 0x%08lx\n", lRet);
220 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
227 ok(lpFailureActions1->
dwResetPeriod == lpFailureActions2->
dwResetPeriod,
"lpFailureActions1->dwResetPeriod != lpFailureActions2->dwResetPeriod\n");
229 ok(lpFailureActions1->
cActions == lpFailureActions2->
cActions,
"lpFailureActions1->cActions != lpFailureActions2->cActions\n");
236 if (lpFailureActions1->
cActions > 0 &&
241 ok(lpFailureActions1->
lpsaActions[
i].
Type == lpFailureActions2->
lpsaActions[
i].
Type ,
"lpFailureActions1->lpsaActions[%lu].Type != lpFailureActions2->lpsaActions[%lu].Type\n" ,
i,
i);
250 if (lpFailureActions1->
lpRebootMsg && lpRebootMessage)
255 ok(iRet == 0,
"Retrieved reboot messages are different !\n");
258 if (lpFailureActions1->
lpCommand && lpFailureCommand)
263 ok(iRet == 0,
"Retrieved commands are different !\n");
270 if (lpFailureCommand)
296 DWORD dwRequiredSize = 0;
311 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
312 if (dwRequiredSize == 0)
314 skip(
"Required size is null; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
322 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
333 ok(bError,
"bError = %u, expected TRUE\n", bError);
336 skip(
"QueryServiceConfig2A returned an error; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
345 ok(lRet ==
ERROR_SUCCESS,
"RegOpenKeyExA failed with 0x%08lx\n", lRet);
348 skip(
"No regkey; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
362 ok(dwRet ==
ERROR_SUCCESS,
"RegReadStringA returned 0x%08lx\n", dwRet);
363 ok(lpszDescription !=
NULL,
"lpszDescription is null, expected non-null\n");
371 ok(iRet == 0,
"Retrieved descriptions are different !\n");
395 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExA returned 0x%08lx\n", lRet);
396 ok(dwType ==
REG_BINARY,
"dwType = %lu, expected REG_BINARY\n", dwType);
397 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
400 if (lpFailureActions2 ==
NULL)
402 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
410 (
LPBYTE)lpFailureActions2,
412 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExA returned 0x%08lx\n", lRet);
413 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
420 ok(lpFailureActions1->
dwResetPeriod == lpFailureActions2->
dwResetPeriod,
"lpFailureActions1->dwResetPeriod != lpFailureActions2->dwResetPeriod\n");
422 ok(lpFailureActions1->
cActions == lpFailureActions2->
cActions,
"lpFailureActions1->cActions != lpFailureActions2->cActions\n");
430 if (lpFailureActions1->
cActions > 0 &&
435 ok(lpFailureActions1->
lpsaActions[
i].
Type == lpFailureActions2->
lpsaActions[
i].
Type ,
"lpFailureActions1->lpsaActions[%lu].Type != lpFailureActions2->lpsaActions[%lu].Type\n" ,
i,
i);
444 if (lpFailureActions1->
lpRebootMsg && lpRebootMessage)
449 ok(iRet == 0,
"Retrieved reboot messages are different !\n");
452 if (lpFailureActions1->
lpCommand && lpFailureCommand)
457 ok(iRet == 0,
"Retrieved commands are different !\n");
464 if (lpFailureCommand)
487 SC_HANDLE hScm =
NULL;
488 SC_HANDLE hService =
NULL;
495 skip(
"No service control manager; cannot proceed with QueryServiceConfig2W test\n");
503 ok(hService !=
NULL,
"Failed to open service handle, error=0x%08lx\n",
GetLastError());
506 skip(
"Service not found; cannot proceed with QueryServiceConfig2W test\n");
528 SC_HANDLE hScm =
NULL;
529 SC_HANDLE hService =
NULL;
536 skip(
"No service control manager; cannot proceed with QueryServiceConfig2A test\n");
544 ok(hService !=
NULL,
"Failed to open service handle, error=0x%08lx\n",
GetLastError());
547 skip(
"Service not found; cannot proceed with QueryServiceConfig2A test\n");
static void Test_QueryServiceConfig2A(void)
static DWORD RegReadStringA(HKEY hKey, LPSTR lpValueName, LPSTR *lpValue)
static void Test_QueryServiceConfig2W(void)
static int QueryConfig2A(SC_HANDLE hService, LPCSTR serviceName, DWORD dwInfoLevel)
static int QueryConfig2W(SC_HANDLE hService, LPCWSTR serviceName, DWORD dwInfoLevel)
static DWORD RegReadStringW(HKEY hKey, LPWSTR lpValueName, LPWSTR *lpValue)
int strcmp(const char *String1, const char *String2)
#define RegCloseKey(hKey)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define HeapFree(x, y, z)
static void cleanup(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwInfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
BOOL WINAPI QueryServiceConfig2W(SC_HANDLE hService, DWORD dwInfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCbPrintfA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszFormat,...)
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE
#define SERVICE_CONFIG_DESCRIPTION
#define SC_MANAGER_CONNECT
struct _SERVICE_DESCRIPTIONW * LPSERVICE_DESCRIPTIONW
struct _SERVICE_FAILURE_ACTIONSA * LPSERVICE_FAILURE_ACTIONSA
struct _SC_ACTION * LPSC_ACTION
struct _SERVICE_DESCRIPTIONA * LPSERVICE_DESCRIPTIONA
#define SERVICE_CONFIG_FAILURE_ACTIONS
#define QueryServiceConfig2
struct _SERVICE_FAILURE_ACTIONSW * LPSERVICE_FAILURE_ACTIONSW
#define SERVICE_QUERY_CONFIG