291{
292 int iRet = 0;
296 DWORD dwRequiredSize = 0;
298
302
303
308 0,
309 &dwRequiredSize);
311 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
312 if (dwRequiredSize == 0)
313 {
314 skip(
"Required size is null; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
315 return 1;
316 }
317
318
321 {
322 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
323 return 2;
324 }
325
326
331 dwRequiredSize,
332 &dwRequiredSize);
333 ok(bError,
"bError = %u, expected TRUE\n", bError);
335 {
336 skip(
"QueryServiceConfig2A returned an error; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
338 return 3;
339 }
340
341
345 ok(lRet ==
ERROR_SUCCESS,
"RegOpenKeyExA failed with 0x%08lx\n", lRet);
347 {
348 skip(
"No regkey; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
350 return 4;
351 }
352
354 {
356 {
359
360
362 ok(dwRet ==
ERROR_SUCCESS,
"RegReadStringA returned 0x%08lx\n", dwRet);
363 ok(lpszDescription !=
NULL,
"lpszDescription is null, expected non-null\n");
364
365
366 if (lpszDescription)
368 else
369 iRet = 0;
370
371 ok(iRet == 0,
"Retrieved descriptions are different !\n");
372
373
374
376
377 break;
378 }
379
381 {
387
388
390 "FailureActions",
392 &dwType,
394 &dwRequiredSize);
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");
398
400 if (lpFailureActions2 ==
NULL)
401 {
402 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
403 break;
404 }
405
407 "FailureActions",
410 (
LPBYTE)lpFailureActions2,
411 &dwRequiredSize);
412 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExA returned 0x%08lx\n", lRet);
413 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
414
415
418
419
420 ok(lpFailureActions1->
dwResetPeriod == lpFailureActions2->
dwResetPeriod,
"lpFailureActions1->dwResetPeriod != lpFailureActions2->dwResetPeriod\n");
421#ifndef _M_AMD64
422 ok(lpFailureActions1->
cActions == lpFailureActions2->
cActions,
"lpFailureActions1->cActions != lpFailureActions2->cActions\n");
423#endif
424
425
427 {
429
430 if (lpFailureActions1->
cActions > 0 &&
432 {
434 {
435 ok(lpFailureActions1->
lpsaActions[
i].
Type == lpFailureActions2->
lpsaActions[
i].
Type ,
"lpFailureActions1->lpsaActions[%lu].Type != lpFailureActions2->lpsaActions[%lu].Type\n" ,
i,
i);
437 }
438 }
439 }
440
441
442
443
444 if (lpFailureActions1->
lpRebootMsg && lpRebootMessage)
446 else
447 iRet = 0;
448
449 ok(iRet == 0,
"Retrieved reboot messages are different !\n");
450
451
452 if (lpFailureActions1->
lpCommand && lpFailureCommand)
454 else
455 iRet = 0;
456
457 ok(iRet == 0,
"Retrieved commands are different !\n");
458
459
460
461 if (lpRebootMessage)
463
464 if (lpFailureCommand)
466
468
469 break;
470 }
471
472 default:
474 break;
475 }
476
478
480
481 return 0;
482}
static DWORD RegReadStringA(HKEY hKey, LPSTR lpValueName, LPSTR *lpValue)
int strcmp(const char *String1, const char *String2)
#define RegCloseKey(hKey)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define ERROR_INSUFFICIENT_BUFFER
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)
#define HeapFree(x, y, z)
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
BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwInfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
STRSAFEAPI StringCbPrintfA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszFormat,...)
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE
#define SERVICE_CONFIG_DESCRIPTION
struct _SERVICE_FAILURE_ACTIONSA * LPSERVICE_FAILURE_ACTIONSA
struct _SC_ACTION * LPSC_ACTION
struct _SERVICE_DESCRIPTIONA * LPSERVICE_DESCRIPTIONA
#define SERVICE_CONFIG_FAILURE_ACTIONS