290{
291 int iRet = 0;
295 DWORD dwRequiredSize = 0;
297
301
302
307 0,
308 &dwRequiredSize);
310 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
311 if (dwRequiredSize == 0)
312 {
313 skip(
"Required size is null; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
314 return 1;
315 }
316
317
320 {
321 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
322 return 2;
323 }
324
325
330 dwRequiredSize,
331 &dwRequiredSize);
332 ok(bError,
"bError = %u, expected TRUE\n", bError);
334 {
335 skip(
"QueryServiceConfig2A returned an error; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
337 return 3;
338 }
339
340
344 ok(lRet ==
ERROR_SUCCESS,
"RegOpenKeyExA failed with 0x%08lx\n", lRet);
346 {
347 skip(
"No regkey; cannot proceed with QueryConfig2A --> %lu test\n",
dwInfoLevel);
349 return 4;
350 }
351
353 {
355 {
358
359
361 ok(dwRet ==
ERROR_SUCCESS,
"RegReadStringA returned 0x%08lx\n", dwRet);
362 ok(lpszDescription !=
NULL,
"lpszDescription is null, expected non-null\n");
363
364
365 if (lpszDescription)
367 else
368 iRet = 0;
369
370 ok(iRet == 0,
"Retrieved descriptions are different !\n");
371
372
373
375
376 break;
377 }
378
380 {
386
387
389 "FailureActions",
391 &dwType,
393 &dwRequiredSize);
394 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExA returned 0x%08lx\n", lRet);
395 ok(dwType ==
REG_BINARY,
"dwType = %lu, expected REG_BINARY\n", dwType);
396 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
397
399 if (lpFailureActions2 ==
NULL)
400 {
401 skip(
"Cannot allocate %lu bytes of memory\n", dwRequiredSize);
402 break;
403 }
404
406 "FailureActions",
409 (
LPBYTE)lpFailureActions2,
410 &dwRequiredSize);
411 ok(lRet ==
ERROR_SUCCESS,
"RegQueryValueExA returned 0x%08lx\n", lRet);
412 ok(dwRequiredSize != 0,
"dwRequiredSize is zero, expected non-zero\n");
413
414
417
418
419 ok(lpFailureActions1->
dwResetPeriod == lpFailureActions2->
dwResetPeriod,
"lpFailureActions1->dwResetPeriod != lpFailureActions2->dwResetPeriod\n");
420 ok(lpFailureActions1->
cActions == lpFailureActions2->
cActions,
"lpFailureActions1->cActions != lpFailureActions2->cActions\n");
421
422
424 {
426
427 if (lpFailureActions1->
cActions > 0 &&
429 {
431 {
432 ok(lpFailureActions1->
lpsaActions[
i].
Type == lpFailureActions2->
lpsaActions[
i].
Type ,
"lpFailureActions1->lpsaActions[%lu].Type != lpFailureActions2->lpsaActions[%lu].Type\n" ,
i,
i);
434 }
435 }
436 }
437
438
439
440
441 if (lpFailureActions1->
lpRebootMsg && lpRebootMessage)
443 else
444 iRet = 0;
445
446 ok(iRet == 0,
"Retrieved reboot messages are different !\n");
447
448
449 if (lpFailureActions1->
lpCommand && lpFailureCommand)
451 else
452 iRet = 0;
453
454 ok(iRet == 0,
"Retrieved commands are different !\n");
455
456
457
458 if (lpRebootMessage)
460
461 if (lpFailureCommand)
463
465
466 break;
467 }
468
469 default:
471 break;
472 }
473
475
477
478 return 0;
479}
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