60 pChangeServiceConfig2A = (
void*)
GetProcAddress(hadvapi32,
"ChangeServiceConfig2A");
61 pChangeServiceConfig2W = (
void*)
GetProcAddress(hadvapi32,
"ChangeServiceConfig2W");
62 pEnumServicesStatusExA= (
void*)
GetProcAddress(hadvapi32,
"EnumServicesStatusExA");
63 pEnumServicesStatusExW= (
void*)
GetProcAddress(hadvapi32,
"EnumServicesStatusExW");
64 pGetSecurityInfo = (
void *)
GetProcAddress(hadvapi32,
"GetSecurityInfo");
65 pQueryServiceConfig2A= (
void*)
GetProcAddress(hadvapi32,
"QueryServiceConfig2A");
66 pQueryServiceConfig2W= (
void*)
GetProcAddress(hadvapi32,
"QueryServiceConfig2W");
67 pQueryServiceStatusEx= (
void*)
GetProcAddress(hadvapi32,
"QueryServiceStatusEx");
68 pQueryServiceObjectSecurity = (
void*)
GetProcAddress(hadvapi32,
"QueryServiceObjectSecurity");
69 pNotifyServiceStatusChangeW = (
void*)
GetProcAddress(hadvapi32,
"NotifyServiceStatusChangeW");
103 "Expected RPC_S_SERVER_UNAVAILABLE or RPC_S_INVALID_NET_ADDR, got %d\n",
GetLastError());
124 CHAR displayname[4096];
130 ok(!svc_handle,
"Expected failure\n");
139 ok(!svc_handle,
"Expected failure\n");
142 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
149 ok(!svc_handle,
"Expected failure\n");
158 skip(
"Not enough rights to get a handle to the service\n");
177 skip(
"displayname equals servicename\n");
184 ok(!svc_handle,
"Expected failure\n");
194 SC_HANDLE
scm_handle, svc_handle1, svc_handle2;
198 static const CHAR servicename [] =
"Winetest";
217 svc_handle1 =
CreateServiceA(
NULL,
NULL,
NULL, 0, 0, 0, 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
218 ok(!svc_handle1,
"Expected failure\n");
225 svc_handle1 =
CreateServiceA(
scm_handle,
NULL,
NULL, 0, 0, 0, 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
226 ok(!svc_handle1,
"Expected failure\n");
229 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
233 svc_handle1 =
CreateServiceA(
scm_handle, servicename,
NULL, 0, 0, 0, 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
234 ok(!svc_handle1,
"Expected failure\n");
237 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
241 svc_handle1 =
CreateServiceA(
scm_handle,
NULL,
NULL, 0, 0, 0, 0,
pathname,
NULL,
NULL,
NULL,
NULL,
NULL);
242 ok(!svc_handle1,
"Expected failure\n");
245 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
249 svc_handle1 =
CreateServiceA(
scm_handle, servicename,
NULL, 0, 0, 0, 0,
pathname,
NULL,
NULL,
NULL,
NULL,
NULL);
250 ok(!svc_handle1,
"Expected failure\n");
255 svc_handle1 =
CreateServiceA(
scm_handle,
empty,
NULL, 0, 0, 0, 0,
pathname,
NULL,
NULL,
NULL,
NULL,
NULL);
256 ok(!svc_handle1,
"Expected failure\n");
260 svc_handle1 =
CreateServiceA(
scm_handle, servicename,
NULL, 0, 0, 0, 0,
empty,
NULL,
NULL,
NULL,
NULL,
NULL);
261 ok(!svc_handle1,
"Expected failure\n");
272 skip(
"Not enough rights to get a handle to the manager\n");
280 svc_handle1 =
CreateServiceA(
scm_handle,
empty,
NULL, 0, 0, 0, 0,
pathname,
NULL,
NULL,
NULL,
NULL,
NULL);
281 ok(!svc_handle1,
"Expected failure\n");
285 svc_handle1 =
CreateServiceA(
scm_handle, servicename,
NULL, 0, 0, 0, 0,
empty,
NULL,
NULL,
NULL,
NULL,
NULL);
286 ok(!svc_handle1,
"Expected failure\n");
290 svc_handle1 =
CreateServiceA(
scm_handle,
empty,
NULL, 0, 0, 0, 0,
empty,
NULL,
NULL,
NULL,
NULL,
NULL);
291 ok(!svc_handle1,
"Expected failure\n");
300 ok(!svc_handle1,
"Expected failure\n");
311 ok(!svc_handle1,
"Expected failure\n");
318 ok(!svc_handle1,
"Expected failure\n");
327 ok(!svc_handle1,
"Expected failure\n");
329 "Expected ERROR_INVALID_PARAMETER or ERROR_INVALID_SERVICE_ACCOUNT, got %d\n",
GetLastError());
338 ok(!svc_handle1,
"Expected failure\n");
345 ok(!svc_handle1,
"Expected failure\n");
352 ok(!svc_handle1,
"Expected failure\n");
359 spooler_exists =
TRUE;
364 ok(!svc_handle1,
"Expected failure\n");
368 skip(
"Spooler service doesn't exist\n");
379 skip(
"Could not retrieve a displayname for the Spooler service\n");
384 ok(!svc_handle1,
"Expected failure for display name '%s'\n",
display);
386 "Expected ERROR_DUPLICATE_SERVICE_NAME, got %d\n",
GetLastError());
390 skip(
"Could not retrieve a displayname (Spooler service doesn't exist)\n");
404 ok(!
ret,
"Expected failure\n");
406 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
436 ok(!
ret,
"Expected failure\n");
438 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
445 CHAR displayname[4096];
447 DWORD displaysize, tempsize, tempsizeW;
448 static const CHAR deadbeef[] =
"Deadbeef";
449 static const WCHAR spoolerW[] = {
'S',
'p',
'o',
'o',
'l',
'e',
'r',0};
450 static const WCHAR deadbeefW[] = {
'D',
'e',
'a',
'd',
'b',
'e',
'e',
'f',0};
451 static const WCHAR abcW[] = {
'A',
'B',
'C',0};
452 static const CHAR servicename[] =
"Winetest";
459 ok(!
ret,
"Expected failure\n");
461 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
467 ok(!
ret,
"Expected failure\n");
470 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
473 displaysize =
sizeof(displayname);
475 ok(!
ret,
"Expected failure\n");
478 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
484 ok(!
ret,
"Expected failure\n");
486 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
490 ok(!
ret,
"Expected failure\n");
492 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
493 todo_wine ok(displaysize == 1,
"Service size expected 1, got %d\n", displaysize);
496 strcpy(displayname,
"ABC");
498 ok(!
ret,
"Expected failure\n");
500 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
501 todo_wine ok(displaysize == 15,
"Service size expected 15, got %d\n", displaysize);
502 ok(displayname[0] == 0,
"Service name not empty\n");
507 ok(!
ret,
"Expected failure\n");
509 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
510 ok(displaysize == 15,
"Service size expected 15, got %d\n", displaysize);
514 strcpy(displayname,
"ABC");
516 ok(!
ret,
"Expected failure\n");
518 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
519 todo_wine ok(displaysize == 1,
"Service size expected 1, got %d\n", displaysize);
520 ok(displayname[0] ==
'A',
"Service name changed\n");
525 ok(!
ret,
"Expected failure\n");
526 ok(displaysize == 2,
"Service size expected 2, got %d\n", displaysize);
528 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
532 strcpy(displayname,
"ABC");
534 ok(!
ret,
"Expected failure\n");
536 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
537 todo_wine ok(displaysize == 1,
"Service size expected 1, got %d\n", displaysize);
538 ok(displayname[0] == 0,
"Service name not empty\n");
543 ok(!
ret,
"Expected failure\n");
544 ok(displaysize == 2,
"Service size expected 2, got %d\n", displaysize);
546 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
550 strcpy(displayname,
"ABC");
552 ok(!
ret,
"Expected failure\n");
554 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
555 todo_wine ok(displaysize == 2,
"Service size expected 2, got %d\n", displaysize);
556 ok(displayname[0] == 0,
"Service name not empty\n");
561 ok(!
ret,
"Expected failure\n");
562 ok(displaysize == 2,
"Service size expected 2, got %d\n", displaysize);
564 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
571 skip(
"Spooler service doesn't exist\n");
581 ok(!
ret,
"Expected failure\n");
583 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
584 tempsize = displaysize;
588 ok(!
ret,
"Expected failure\n");
590 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
591 ok(displaysize == tempsize,
"Buffer size mismatch (%d vs %d)\n", tempsize, displaysize);
595 displaysize = (tempsize / 2);
597 ok(!
ret,
"Expected failure\n");
598 ok(displaysize == tempsize,
"Expected the needed buffersize\n");
600 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
607 displaysize = (tempsize / 2) + 1;
610 ok(displaysize == ((tempsize / 2) + 1),
"Expected no change for the needed buffer size\n");
614 displaysize = tempsize;
617 ok(displaysize == tempsize,
"Expected no change for the needed buffer size\n");
621 displaysize = tempsize * 2;
625 ok(displaysize == tempsize * 2,
"Expected no change for the needed buffer size\n");
626 ok(
strlen(displayname) == tempsize/2,
627 "Expected the buffer to be twice the length of the string\n") ;
633 ok(!
ret,
"Expected failure\n");
635 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
639 tempsizeW = displaysize;
640 displaysize = tempsizeW / 2;
642 ok(!
ret,
"Expected failure\n");
643 ok(displaysize == tempsizeW,
"Expected the needed buffersize\n");
645 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
649 displaysize = tempsizeW;
651 ok(!
ret,
"Expected failure\n");
652 ok(displaysize == tempsizeW,
"Expected the needed buffersize\n");
654 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
658 displaysize = tempsizeW + 1;
661 ok(displaysize == tempsizeW,
"Expected the needed buffersize\n");
663 "Expected the buffer to be the length of the string\n") ;
664 ok(tempsize / 2 == tempsizeW,
665 "Expected the needed buffersize (in bytes) to be the same for the A and W call\n");
676 skip(
"Not enough rights to get a handle to the manager\n");
695 ok(!
ret,
"Expected failure\n");
696 ok(displaysize ==
strlen(servicename) * 2,
697 "Expected the displaysize to be twice the size of the servicename\n");
699 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
703 tempsize = displaysize;
704 displaysize = (tempsize / 2);
706 ok(!
ret,
"Expected failure\n");
707 ok(displaysize == tempsize,
"Expected the needed buffersize\n");
709 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
716 "Expected displayname to be %s, got %s\n", servicename, displayname);
732 CHAR servicename[4096];
733 CHAR displayname[4096];
734 WCHAR servicenameW[4096];
736 DWORD servicesize, displaysize, tempsize;
738 static const CHAR deadbeef[] =
"Deadbeef";
739 static const WCHAR deadbeefW[] = {
'D',
'e',
'a',
'd',
'b',
'e',
'e',
'f',0};
740 static const WCHAR abcW[] = {
'A',
'B',
'C',0};
746 ok(!
ret,
"Expected failure\n");
748 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
755 ok(!
ret,
"Expected failure\n");
758 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
759 todo_wine ok(servicesize == 1,
"Service size expected 1, got %d\n", servicesize);
765 ok(!
ret,
"Expected failure\n");
768 "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
769 todo_wine ok(servicesize == 200,
"Service size expected 1, got %d\n", servicesize);
774 ok(!
ret,
"Expected failure\n");
776 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
777 todo_wine ok(servicesize == 1,
"Service size expected 1, got %d\n", servicesize);
780 strcpy(servicename,
"ABC");
782 ok(!
ret,
"Expected failure\n");
784 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
785 todo_wine ok(servicesize == 15,
"Service size expected 15, got %d\n", servicesize);
786 ok(servicename[0] == 0,
"Service name not empty\n");
791 ok(!
ret,
"Expected failure\n");
793 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
794 ok(servicesize == 15,
"Service size expected 15, got %d\n", servicesize);
795 ok(servicenameW[0] == 0,
"Service name not empty\n");
798 strcpy(servicename,
"ABC");
800 ok(!
ret,
"Expected failure\n");
802 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
803 todo_wine ok(servicesize == 1,
"Service size expected 1, got %d\n", servicesize);
804 ok(servicename[0] ==
'A',
"Service name changed\n");
809 ok(!
ret,
"Expected failure\n");
810 ok(servicesize == 2,
"Service size expected 2, got %d\n", servicesize);
812 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
813 ok(servicenameW[0] ==
'A',
"Service name changed\n");
816 strcpy(servicename,
"ABC");
818 ok(!
ret,
"Expected failure\n");
820 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
821 todo_wine ok(servicesize == 1,
"Service size expected 1, got %d\n", servicesize);
822 ok(servicename[0] == 0,
"Service name not empty\n");
827 ok(!
ret,
"Expected failure\n");
828 ok(servicesize == 2,
"Service size expected 2, got %d\n", servicesize);
830 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
831 ok(servicenameW[0] ==
'A',
"Service name changed\n");
834 strcpy(servicename,
"ABC");
836 ok(!
ret,
"Expected failure\n");
838 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
839 todo_wine ok(servicesize == 2,
"Service size expected 2, got %d\n", servicesize);
840 ok(servicename[0] == 0,
"Service name not empty\n");
845 ok(!
ret,
"Expected failure\n");
846 ok(servicesize == 2,
"Service size expected 2, got %d\n", servicesize);
848 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
849 ok(servicenameW[0] == 0,
"Service name not empty\n");
855 skip(
"Spooler service doesn't exist\n");
869 ok(!
ret,
"Expected failure\n");
871 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
875 tempsize = servicesize;
881 ok(
strlen(servicename) == tempsize/2,
882 "Expected the buffer to be twice the length of the string\n") ;
884 ok(servicesize == (tempsize * 2),
885 "Expected servicesize not to change if buffer not insufficient\n") ;
895 ok(
strlen(servicename) == tempsize/2,
896 "Expected the buffer to be twice the length of the string\n") ;
898 "Expected servicesize not to change if buffer not insufficient\n") ;
904 ok(!
ret,
"Expected failure\n");
906 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
907 ok(servicenameW[0] == 0,
"Buffer not empty\n");
923 ok(!
ret,
"Expected failure\n");
925 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
935 skip(
"Spooler service doesn't exist\n");
942 ok(!
ret,
"Expected failure\n");
949 ok(!
ret,
"Expected failure\n");
951 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
966 if (!pQueryServiceStatusEx)
968 win_skip(
"QueryServiceStatusEx not available\n" );
979 ok(!
ret,
"Expected failure\n");
981 "Expected ERROR_INVALID_LEVEL, got %d\n",
GetLastError());
993 ok(!
ret,
"Expected failure\n");
995 "Needed buffersize is wrong : %d\n", needed);
997 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
1005 ok(!
ret,
"Expected failure\n");
1007 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
1016 ok(!
ret,
"Expected failure\n");
1018 "Needed buffersize is wrong : %d\n", needed);
1020 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
1028 ok(!
ret,
"Expected failure\n");
1030 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
1045 "Expect a process id for this running service\n");
1048 "Expect no process id for this stopped service\n");
1053 ok(!
ret,
"Expected failure\n");
1068 DWORD neededW, returnedW;
1069 DWORD tempneeded, tempreturned, missing;
1070 DWORD servicecountactive, servicecountinactive;
1079 ok(!
ret,
"Expected failure\n");
1081 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
1085 ok(!
ret,
"Expected failure\n");
1087 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
1095 ok(!
ret,
"Expected failure\n");
1102 ok(!
ret,
"Expected failure\n");
1108 returned = 0xdeadbeef;
1111 ok(!
ret,
"Expected failure\n");
1112 ok(returned == 0xdeadbeef,
"Expected no change to the number of services variable\n");
1117 returned = 0xdeadbeef;
1120 ok(!
ret,
"Expected failure\n");
1121 ok(returned == 0xdeadbeef,
"Expected no change to the number of services variable\n");
1127 needed = 0xdeadbeef;
1130 ok(!
ret,
"Expected failure\n");
1131 ok(needed == 0xdeadbeef ||
broken(needed != 0xdeadbeef),
1132 "Expected no change to the needed buffer variable\n");
1137 needed = 0xdeadbeef;
1140 ok(!
ret,
"Expected failure\n");
1141 ok(needed == 0xdeadbeef ||
broken(needed != 0xdeadbeef),
1142 "Expected no change to the needed buffer variable\n");
1148 needed = 0xdeadbeef;
1149 returned = 0xdeadbeef;
1152 ok(!
ret,
"Expected failure\n");
1153 ok(needed == 0 ||
broken(needed != 0),
1154 "Expected needed buffer size to be set to 0, got %d\n", needed);
1155 ok(returned == 0,
"Expected number of services to be set to 0, got %d\n", returned);
1157 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1159 needed = 0xdeadbeef;
1160 returned = 0xdeadbeef;
1163 ok(!
ret,
"Expected failure\n");
1164 ok(needed == 0 ||
broken(needed != 0),
1165 "Expected needed buffer size to be set to 0, got %d\n", needed);
1166 ok(returned == 0 ||
broken(returned != 0),
1167 "Expected number of services to be set to 0, got %d\n", returned);
1169 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1172 needed = 0xdeadbeef;
1173 returned = 0xdeadbeef;
1176 ok(!
ret,
"Expected failure\n");
1177 ok(needed == 0 ||
broken(needed != 0),
1178 "Expected needed buffer size to be set to 0, got %d\n", needed);
1179 ok(returned == 0,
"Expected number of services to be set to 0, got %d\n", returned);
1181 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1183 needed = 0xdeadbeef;
1184 returned = 0xdeadbeef;
1187 ok(!
ret,
"Expected failure\n");
1188 ok(needed == 0 ||
broken(needed != 0),
1189 "Expected needed buffer size to be set to 0, got %d\n", needed);
1190 ok(returned == 0 ||
broken(returned != 0),
1191 "Expected number of services to be set to 0, got %d\n", returned);
1193 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1196 needed = 0xdeadbeef;
1197 returned = 0xdeadbeef;
1200 ok(!
ret,
"Expected failure\n");
1201 ok(needed == 0 ||
broken(needed != 0),
1202 "Expected needed buffer size to be set to 0, got %d\n", needed);
1203 ok(returned == 0,
"Expected number of services to be set to 0, got %d\n", returned);
1205 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1207 needed = 0xdeadbeef;
1208 returned = 0xdeadbeef;
1211 ok(!
ret,
"Expected failure\n");
1212 ok(needed == 0 ||
broken(needed != 0),
1213 "Expected needed buffer size to be set to 0, got %d\n", needed);
1214 ok(returned == 0 ||
broken(returned != 0),
1215 "Expected number of services to be set to 0, got %d\n", returned);
1217 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1220 needed = 0xdeadbeef;
1221 returned = 0xdeadbeef;
1224 ok(!
ret,
"Expected failure\n");
1225 ok(needed == 0 ||
broken(needed != 0),
1226 "Expected needed buffer size to be set to 0, got %d\n", needed);
1227 ok(returned == 0,
"Expected number of services to be set to 0, got %d\n", returned);
1229 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
1231 needed = 0xdeadbeef;
1232 returned = 0xdeadbeef;
1235 ok(!
ret,
"Expected failure\n");
1236 ok(needed == 0 ||
broken(needed != 0),
1237 "Expected needed buffer size to be set to 0, got %d\n", needed);
1238 ok(returned == 0 ||
broken(returned != 0),
1239 "Expected number of services to be set to 0, got %d\n", returned);
1241 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
1248 needed = 0xdeadbeef;
1249 returned = 0xdeadbeef;
1252 ok(!
ret,
"Expected failure\n");
1253 ok(needed != 0xdeadbeef && needed > 0,
"Expected the needed buffer size for this one service\n");
1254 ok(returned == 0,
"Expected no service returned, got %d\n", returned);
1259 neededW = 0xdeadbeef;
1260 returnedW = 0xdeadbeef;
1263 ok(!
ret,
"Expected failure\n");
1264 ok(neededW != 0xdeadbeef && neededW > 0,
"Expected the needed buffer size for this one service\n");
1265 ok(neededW == needed,
"Expected needed buffersize to be the same for A- and W-calls\n");
1266 ok(returnedW == 0,
"Expected no service returned, got %d\n", returnedW);
1271 tempneeded = needed;
1276 needed = 0xdeadbeef;
1277 returned = 0xdeadbeef;
1282 ok(needed == 0,
"Expected needed buffer to be 0 as we are done\n");
1283 ok(returned != 0xdeadbeef && returned > 0,
"Expected some returned services\n");
1287 tempreturned = returned;
1291 neededW = 0xdeadbeef;
1292 returnedW = 0xdeadbeef;
1297 ok(neededW == 0,
"Expected needed buffer to be 0 as we are done\n");
1298 ok(returnedW != 0xdeadbeef && returnedW > 0,
"Expected some returned services\n");
1304 needed = 0xdeadbeef;
1305 returned = 0xdeadbeef;
1309 ok(!
ret,
"Expected failure\n");
1310 ok(needed != 0xdeadbeef && needed > 0,
"Expected the needed buffer size for this one service\n");
1311 ok(returned < tempreturned,
"Expected fewer services to be returned\n");
1317 needed = 0xdeadbeef;
1318 returned = 0xdeadbeef;
1323 ok(!
ret,
"Expected failure\n");
1324 ok(needed != 0xdeadbeef && needed > 0,
"Expected the needed buffer size for this one service\n");
1325 ok(returned < tempreturned,
"Expected fewer services to be returned\n");
1326 todo_wine ok(resume,
"Expected a resume handle\n");
1331 missing = tempreturned - returned;
1333 needed = 0xdeadbeef;
1334 returned = 0xdeadbeef;
1339 ok(needed == 0,
"Expected needed buffer to be 0 as we are done\n");
1340 ok(returned == missing,
"Expected %u services to be returned\n", missing);
1341 ok(resume == 0,
"Expected the resume handle to be 0\n");
1358 &needed, &returned,
NULL);
1361 needed, &needed, &returned,
NULL);
1364 servicecountactive = returned;
1368 &needed, &returned,
NULL);
1371 needed, &needed, &returned,
NULL);
1374 servicecountinactive = returned;
1378 &needed, &returned,
NULL);
1381 needed, &needed, &returned,
NULL);
1385 ok(returned == (servicecountactive + servicecountinactive),
1386 "Something wrong in the calculation\n");
1394 NULL, 0, &needed, &returned,
NULL);
1400 for (
i = 0;
ret &&
i < returned;
i++)
1405 ok(
services[
i].lpServiceName[0],
"Expected a service name\n");
1414 servicecountinactive--;
1416 servicecountactive--;
1421 ok(servicecountactive == 0,
"Active services mismatch %u\n", servicecountactive);
1422 ok(servicecountinactive == 0,
"Inactive services mismatch %u\n", servicecountinactive);
1427 if (!pEnumServicesStatusExA)
1429 win_skip(
"EnumServicesStatusExA not available\n" );
1436 ok(!
ret,
"Expected failure\n");
1438 "Expected ERROR_INVALID_LEVEL, got %d\n",
GetLastError());
1443 ok(!
ret,
"Expected failure\n");
1445 "Expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
1453 ok(!
ret,
"Expected failure\n");
1459 needed = 0xdeadbeef;
1462 ok(!
ret,
"Expected failure\n");
1463 ok(needed == 0xdeadbeef ||
broken(needed != 0xdeadbeef),
1464 "Expected no change to the needed buffer variable\n");
1470 returned = 0xdeadbeef;
1473 ok(!
ret,
"Expected failure\n");
1474 ok(returned == 0xdeadbeef,
"Expected no change to the number of services variable\n");
1480 needed = 0xdeadbeef;
1481 returned = 0xdeadbeef;
1484 ok(!
ret,
"Expected failure\n");
1485 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1486 ok(needed == 0 ||
broken(needed != 0),
1487 "Expected needed buffer size to be set to 0, got %d\n", needed);
1489 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1492 needed = 0xdeadbeef;
1493 returned = 0xdeadbeef;
1497 ok(!
ret,
"Expected failure\n");
1498 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1499 ok(needed == 0 ||
broken(needed != 0),
1500 "Expected needed buffer size to be set to 0, got %d\n", needed);
1502 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1505 needed = 0xdeadbeef;
1506 returned = 0xdeadbeef;
1510 ok(!
ret,
"Expected failure\n");
1511 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1512 ok(needed == 0 ||
broken(needed != 0),
1513 "Expected needed buffer size to be set to 0, got %d\n", needed);
1515 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1518 needed = 0xdeadbeef;
1519 returned = 0xdeadbeef;
1522 &returned,
NULL,
"deadbeef_group");
1523 ok(!
ret,
"Expected failure\n");
1524 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1525 ok(needed == 0 ||
broken(needed != 0),
1526 "Expected needed buffer size to be set to 0, got %d\n", needed);
1528 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1531 needed = 0xdeadbeef;
1532 returned = 0xdeadbeef;
1536 ok(!
ret,
"Expected failure\n");
1537 ok(needed == 0 ||
broken(needed != 0),
1538 "Expected needed buffer size to be set to 0, got %d\n", needed);
1539 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1541 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
1546 needed = 0xdeadbeef;
1547 returned = 0xdeadbeef;
1550 NULL, 0, &needed, &returned,
NULL,
"deadbeef_group");
1551 ok(!
ret,
"Expected failure\n");
1552 ok(needed == 0 ||
broken(needed != 0),
1553 "Expected needed buffer size to be set to 0, got %d\n", needed);
1554 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1556 "Expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
1563 needed = 0xdeadbeef;
1564 returned = 0xdeadbeef;
1567 NULL, 0, &needed, &returned,
NULL,
"deadbeef_group");
1568 ok(!
ret,
"Expected failure\n");
1569 ok(returned == 0,
"Expected number of service to be set to 0, got %d\n", returned);
1570 ok(needed == 0,
"Expected needed buffer size to be set to 0, got %d\n", needed);
1572 "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n",
GetLastError());
1579 needed = 0xdeadbeef;
1580 returned = 0xdeadbeef;
1584 ok(!
ret,
"Expected failure\n");
1585 ok(returned == 0,
"Expected no service returned, got %d\n", returned);
1586 ok(needed != 0xdeadbeef && needed > 0,
"Expected the needed buffer size\n");
1591 neededW = 0xdeadbeef;
1594 ok(!
ret,
"Expected failure\n");
1595 ok(neededW == needed,
"Expected needed buffersize to be the same for A- and W-calls\n");
1598 tempneeded = needed;
1603 needed = 0xdeadbeef;
1604 returned = 0xdeadbeef;
1609 ok(needed == 0,
"Expected needed buffer to be 0 as we are done\n");
1610 ok(returned == tempreturned,
"Expected the same number of service from this function\n");
1614 tempreturned = returned;
1619 needed = 0xdeadbeef;
1620 returned = 0xdeadbeef;
1624 ok(!
ret,
"Expected failure\n");
1625 ok(needed != 0xdeadbeef && needed > 0,
"Expected the needed buffer size\n");
1626 ok(returned < tempreturned,
"Expected fewer services to be returned\n");
1632 needed = 0xdeadbeef;
1633 returned = 0xdeadbeef;
1638 ok(!
ret,
"Expected failure\n");
1639 ok(needed != 0xdeadbeef && needed > 0,
"Expected the needed buffer size\n");
1640 ok(returned < tempreturned,
"Expected fewer services to be returned\n");
1641 todo_wine ok(resume,
"Expected a resume handle\n");
1646 missing = tempreturned - returned;
1648 needed = 0xdeadbeef;
1649 returned = 0xdeadbeef;
1654 ok(needed == 0,
"Expected needed buffer to be 0 as we are done\n");
1655 ok(returned == missing,
"Expected %u services to be returned\n", missing);
1656 ok(resume == 0,
"Expected the resume handle to be 0\n");
1666 (
BYTE*)exservices, needed, &needed, &returned,
NULL,
NULL);
1669 servicecountactive = returned;
1676 (
BYTE*)exservices, needed, &needed, &returned,
NULL,
NULL);
1679 servicecountinactive = returned;
1686 (
BYTE*)exservices, needed, &needed, &returned,
NULL,
NULL);
1690 ok(returned == (servicecountactive + servicecountinactive),
1691 "Something wrong in the calculation\n");
1696 ok(!
ret,
"Expected failure\n");
1703 for (
i = 0;
i < returned;
i++)
1708 ok(exservices[
i].lpServiceName[0],
"Expected a service name\n");
1719 "This driver shouldn't have an associated process id\n");
1727 ok(
status.dwProcessId > 0,
"Expected a process id for this running service (%s)\n",
1730 servicecountactive--;
1735 ok(
status.dwProcessId == 0,
"Service %s state %u shouldn't have an associated process id\n",
1738 servicecountinactive--;
1744 ok(servicecountactive == 0,
"Active services mismatch %u\n", servicecountactive);
1745 ok(servicecountinactive == 0,
"Inactive services mismatch %u\n", servicecountinactive);
1758 ok(!
ret,
"Expected failure\n");
1775 DWORD given, needed;
1776 static const CHAR servicename [] =
"Winetest";
1777 static const CHAR displayname [] =
"Winetest dummy service";
1778 static const CHAR displayname2[] =
"Winetest dummy service (2)";
1780 static const CHAR dependencies[] =
"Master1\0Master2\0+MasterGroup1\0";
1783 static const CHAR localsystem [] =
"LocalSystem";
1790 skip(
"Not enough rights to get a handle to the manager\n");
1812 trace(
"Deletion probably didn't work last time\n");
1817 skip(
"Not enough rights to open the service\n");
1825 skip(
"Not enough rights to create the service\n");
1832 if ((svc_handle !=
NULL) && (pGetSecurityInfo !=
NULL))
1834 PSID sidOwner, sidGroup;
1843 &sidGroup, &
dacl, &sacl, &pSD);
1845 ok(retval ==
ERROR_SUCCESS,
"Expected GetSecurityInfo to succeed: result %d\n", retval);
1849 ok(retval ==
ERROR_SUCCESS,
"Expected GetSecurityInfo to succeed: result %d\n", retval);
1854 ok(retval ==
ERROR_SUCCESS,
"Expected GetSecurityInfo to succeed: result %d\n", retval);
1861 ok(
error == 0xdeadbeef,
"Unexpected last error %d\n",
error);
1864 win_skip(
"A NULL security descriptor in GetSecurityInfo results in an exception on NT4.\n");
1870 ok(!bret,
"Expected QueryServiceObjectSecurity to fail: result %d\n", bret);
1873 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
error);
1877 ok(bret,
"Expected QueryServiceObjectSecurity to succeed: result %d\n", bret);
1895 ok(!
ret,
"Expected failure\n");
1905 config->lpDisplayName,
"Expected all string struct members to be non-NULL\n");
1907 "Expected SERVICE_INTERACTIVE_PROCESS | SERVICE_WIN32_OWN_PROCESS, got %d\n",
config->dwServiceType);
1912 ok(
config->dwTagId == 0,
"Expected 0, got %d\n",
config->dwTagId);
1916 ok(!
memcmp(
config->lpDependencies, dependencies,
sizeof(dependencies)),
"Wrong string\n");
1918 ok(!
strcmp(
config->lpServiceStartName, localsystem),
"Expected 'LocalSystem', got '%s'\n",
config->lpServiceStartName);
1919 ok(!
strcmp(
config->lpDisplayName, displayname),
"Expected '%s', got '%s'\n", displayname,
config->lpDisplayName);
1929 config->lpDisplayName,
"Expected all string struct members to be non-NULL\n");
1931 "Expected SERVICE_INTERACTIVE_PROCESS | SERVICE_WIN32_OWN_PROCESS, got %d\n",
config->dwServiceType);
1935 ok(!
strcmp(
config->lpLoadOrderGroup,
"TestGroup2"),
"Expected 'TestGroup2', got '%s'\n",
config->lpLoadOrderGroup);
1936 ok(
config->dwTagId == 0,
"Expected 0, got %d\n",
config->dwTagId);
1937 ok(!
strcmp(
config->lpServiceStartName, localsystem),
"Expected 'LocalSystem', got '%s'\n",
config->lpServiceStartName);
1938 ok(!
strcmp(
config->lpDisplayName, displayname2),
"Expected '%s', got '%s'\n", displayname2,
config->lpDisplayName);
1961 static const CHAR servicename [] =
"Winetest";
1962 static const CHAR displayname [] =
"Winetest dummy service";
1964 static const CHAR dependencies[] =
"Master1\0Master2\0+MasterGroup1\0";
1967 static const CHAR description_empty[] =
"";
1968 static const WCHAR descriptionW [] = {
'D',
'e',
's',
'c',
'r',
'i',
'p',
't',
'i',
'o',
'n',
'W',0};
1969 static const WCHAR descriptionW_empty[] = {0};
1971 if(!pQueryServiceConfig2A)
1973 win_skip(
"function QueryServiceConfig2A not present\n");
1983 skip(
"Not enough rights to get a handle to the manager\n");
2002 trace(
"Deletion probably didn't work last time\n");
2008 skip(
"Not enough rights to open the service\n");
2017 skip(
"Not enough rights to create the service\n");
2030 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2035 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2040 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2045 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2047 "expected error ERROR_INVALID_ADDRESS or ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
2051 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2057 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2064 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2071 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2075 if(!pChangeServiceConfig2A)
2077 win_skip(
"function ChangeServiceConfig2A not present\n");
2083 ok(
ret,
"ChangeServiceConfig2A failed\n");
2092 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2098 ok(!
ret,
"expected QueryServiceConfig2A to fail\n");
2103 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2109 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2113 if(!pQueryServiceConfig2W)
2115 win_skip(
"function QueryServiceConfig2W not present\n");
2122 ok(!
ret,
"expected QueryServiceConfig2W to fail\n");
2128 ok(
ret,
"expected QueryServiceConfig2W to succeed\n");
2132 ok(
ret,
"expected ChangeServiceConfig2A to succeed\n");
2136 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2142 ok(
ret,
"expected ChangeServiceConfig2A to succeed\n");
2146 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2152 ok(
ret,
"expected ChangeServiceConfig2A to succeed\n");
2156 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2158 "expected lpDescription to be null, got %s\n", pConfig->
lpDescription);
2162 ok(
ret,
"expected ChangeServiceConfig2W to succeed\n");
2166 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2172 ok(
ret,
"expected ChangeServiceConfig2W to succeed\n");
2176 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2182 ok(
ret,
"expected ChangeServiceConfig2W to succeed\n");
2186 ok(
ret,
"expected QueryServiceConfig2A to succeed\n");
2192 (
LPBYTE)&preshutdown_info,
sizeof(preshutdown_info), &needed);
2196 win_skip(
"SERVICE_CONFIG_PRESHUTDOWN_INFO not supported\n");
2200 ok(needed ==
sizeof(preshutdown_info),
"needed = %d\n", needed);
2207 (
LPVOID)&preshutdown_info);
2211 (
LPBYTE)&preshutdown_info,
sizeof(preshutdown_info), &needed);
2213 ok(needed ==
sizeof(preshutdown_info),
"needed = %d\n", needed);
2239 ok(!
ret,
"%s: StartServiceA() should have failed\n",
name);
2241 if (pQueryServiceStatusEx)
2254 ok(!
ret,
"%s: StartServiceA() should have failed\n",
name);
2255 ok(le2 == le1,
"%s: the second try should yield the same error: %u != %u\n",
name, le1, le2);
2257 status.dwCurrentState = 0xdeadbeef;
2260 ok(!
ret,
"%s: ControlService() should have failed\n",
name);
2264 "%s: should be stopped state=%x\n",
name,
status.dwCurrentState);
2269#define PHASE_STOPPED 1
2270#define PHASE_RUNNING 2
2282 switch (
data->phase)
2286 "Got wrong notification status: %u\n",
data->notify.dwNotificationStatus);
2288 "Got wrong service state: 0x%x\n",
data->notify.ServiceStatus.dwCurrentState);
2290 "Got wrong notification triggered: 0x%x\n",
data->notify.dwNotificationTriggered);
2295 "Got wrong notification status: %u\n",
data->notify.dwNotificationStatus);
2297 "Got wrong service state: 0x%x\n",
data->notify.ServiceStatus.dwCurrentState);
2299 "Got wrong notification triggered: 0x%x\n",
data->notify.dwNotificationTriggered);
2315 if(!pNotifyServiceStatusChangeW){
2316 win_skip(
"No NotifyServiceStatusChangeW\n");
2322 ok(
svc !=
NULL && svc2 !=
NULL,
"Failed to open service\n");
2336 ok(dr ==
ERROR_SUCCESS,
"NotifyServiceStatusChangeW failed: %u\n", dr);
2340 ok(
data.was_called ==
TRUE,
"APC wasn't called\n");
2350 ok(dr ==
ERROR_SUCCESS,
"NotifyServiceStatusChangeW failed: %u\n", dr);
2354 ok(
data.was_called ==
TRUE,
"APC wasn't called\n");
2361 ok(dr ==
ERROR_SUCCESS,
"NotifyServiceStatusChangeW failed: %u\n", dr);
2377 ok(
data.was_called ==
FALSE,
"APC should not have been called\n");
2385 ok(
data.was_called ==
TRUE,
"APC wasn't called\n");
2394 ok(dr ==
ERROR_SUCCESS,
"NotifyServiceStatusChangeW failed: %u\n", dr);
2402 ok(dr == 0,
"Got wrong SleepEx result: %u\n", dr);
2403 ok(
data.was_called ==
FALSE,
"APC should not have been called\n");
2416 static const char servicename[] =
"Winetest";
2418 const char* displayname;
2425 skip(
"Not enough rights to get a handle to the manager\n");
2445 displayname =
"Winetest Disabled Service";
2453 skip(
"Not enough rights to create the service\n");
2462 displayname =
"Winetest Bad Path";
2463 ret =
ChangeServiceConfigA(svc_handle,
SERVICE_NO_CHANGE,
SERVICE_DEMAND_START,
SERVICE_NO_CHANGE,
"c:\\no_such_file.exe",
NULL,
NULL,
NULL,
NULL,
NULL, displayname);
2472 win_skip(
"Skip some service start/stop tests on NT4\n");
2478 skip(
"ROSTESTS-151: Skipping service start timeout tests because they take too long. This is not a bug!\n");
2483 displayname =
"Winetest Exit Service";
2484 ret =
ChangeServiceConfigA(svc_handle,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
cmd,
NULL,
NULL,
NULL,
NULL,
NULL, displayname);
2491 displayname =
"Winetest Service";
2492 ret =
ChangeServiceConfigA(svc_handle,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
cmd,
NULL,
NULL,
NULL,
NULL,
NULL, displayname);
2511 SC_HANDLE
scm_handle, svc_handle1, svc_handle2, svc_handle3, svc_handle4, svc_handle5;
2512 static const CHAR servicename [] =
"Winetest";
2521 skip(
"Not enough rights to get a handle to the manager\n");
2563 ok(!svc_handle5,
"Expected failure\n");
2565 "Expected ERROR_SERVICE_MARKED_FOR_DELETE, got %d\n",
GetLastError());
2671 win_skip(
"OpenSCManagerA is not implemented, we are most likely on win9x\n");
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
static SC_HANDLE scm_handle
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
void account(int argc, const char *argv[])
void user(int argc, const char *argv[])
VOID WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI GetUserNameA(LPSTR lpszName, LPDWORD lpSize)
static const WCHAR empty[]
#define ERROR_INVALID_ADDRESS
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define GetEnvironmentVariableA(x, y, z)
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
static void cleanup(void)
static const WCHAR descriptionW[]
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
static const WCHAR displaynameW[]
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLsizei bufsize
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
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define sprintf(buf, format,...)
static void test_get_servicekeyname(void)
static const CHAR spooler[]
static void test_open_scm(void)
static void test_get_displayname(void)
static PSECURITY_DESCRIPTOR
static SECURITY_INFORMATION
static void test_servicenotify(SC_HANDLE scm_handle, const char *servicename)
static CHAR selfname[MAX_PATH]
static void test_open_svc(void)
static void test_close(void)
static void CALLBACK notify_cb(void *user)
static void test_query_svc(void)
static void test_refcount(void)
static void test_sequence(void)
static DWORD try_start_stop(SC_HANDLE svc_handle, const char *name, DWORD is_nt4)
static void run_service(void)
static void test_create_delete_svc(void)
static void test_start_stop(void)
static void test_enum_svc(void)
static void test_queryconfig2(void)
static DWORD WINAPI ctrl_handler(DWORD ctl, DWORD type, void *data, void *user)
static SERVICE_NOTIFYW *static void init_function_pointers(void)
#define STANDARD_RIGHTS_READ
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI DeleteService(SC_HANDLE hService)
BOOL WINAPI StartServiceA(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCSTR *lpServiceArgVectors)
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI GetServiceDisplayNameW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, LPWSTR lpDisplayName, LPDWORD lpcchBuffer)
BOOL WINAPI GetServiceKeyNameA(SC_HANDLE hSCManager, LPCSTR lpDisplayName, LPSTR lpServiceName, LPDWORD lpcchBuffer)
BOOL WINAPI GetServiceDisplayNameA(SC_HANDLE hSCManager, LPCSTR lpServiceName, LPSTR lpDisplayName, LPDWORD lpcchBuffer)
BOOL WINAPI QueryServiceConfigA(SC_HANDLE hService, LPQUERY_SERVICE_CONFIGA lpServiceConfig, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
BOOL WINAPI ChangeServiceConfigA(SC_HANDLE hService, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCSTR lpBinaryPathName, LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCSTR lpDependencies, LPCSTR lpServiceStartName, LPCSTR lpPassword, LPCSTR lpDisplayName)
BOOL WINAPI EnumServicesStatusA(SC_HANDLE hSCManager, DWORD dwServiceType, DWORD dwServiceState, LPENUM_SERVICE_STATUSA lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle)
SC_HANDLE WINAPI CreateServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, LPCSTR lpDisplayName, DWORD dwDesiredAccess, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCSTR lpBinaryPathName, LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCSTR lpDependencies, LPCSTR lpServiceStartName, LPCSTR lpPassword)
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
BOOL WINAPI GetServiceKeyNameW(SC_HANDLE hSCManager, LPCWSTR lpDisplayName, LPWSTR lpServiceName, LPDWORD lpcchBuffer)
BOOL WINAPI EnumServicesStatusW(SC_HANDLE hSCManager, DWORD dwServiceType, DWORD dwServiceState, LPENUM_SERVICE_STATUSW lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle)
BOOL WINAPI StartServiceCtrlDispatcherA(const SERVICE_TABLE_ENTRYA *lpServiceStartTable)
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExA(LPCSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
int winetest_get_mainargs(char ***pargv)
SERVICE_STATUS_PROCESS ServiceStatusProcess
DWORD dwPreshutdownTimeout
DWORD dwServiceSpecificExitCode
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
DWORD WINAPI GetLastError(void)
#define WAIT_IO_COMPLETION
#define ERROR_INVALID_LEVEL
#define ERROR_SERVICE_MARKED_FOR_DELETE
#define ERROR_INVALID_SERVICE_ACCOUNT
#define ERROR_SERVICE_NOT_ACTIVE
#define ERROR_SERVICE_DOES_NOT_EXIST
#define ERROR_DUPLICATE_SERVICE_NAME
#define ERROR_ALREADY_REGISTERED
#define ERROR_SERVICE_EXISTS
#define ERROR_SERVICE_DISABLED
#define RPC_S_SERVER_UNAVAILABLE
#define ERROR_SERVICE_REQUEST_TIMEOUT
#define RPC_S_INVALID_NET_ADDR
#define ERROR_DATABASE_DOES_NOT_EXIST
#define SERVICE_STATE_ALL
struct _SERVICE_DESCRIPTIONA SERVICE_DESCRIPTIONA
#define SERVICE_ACCEPT_STOP
#define SERVICE_QUERY_STATUS
#define SERVICE_CONFIG_DESCRIPTION
struct _SERVICE_DESCRIPTIONW SERVICE_DESCRIPTIONW
#define SC_MANAGER_ENUMERATE_SERVICE
#define SC_MANAGER_CREATE_SERVICE
#define SERVICES_ACTIVE_DATABASEA
#define SC_MANAGER_CONNECT
#define SERVICE_NOTIFY_STOPPED
#define SERVICE_NO_CHANGE
#define SERVICES_FAILED_DATABASEA
struct _SERVICE_DESCRIPTIONW * LPSERVICE_DESCRIPTIONW
#define SERVICE_NOTIFY_STATUS_CHANGE
struct _SERVICE_DESCRIPTIONA * LPSERVICE_DESCRIPTIONA
#define SERVICE_CONTROL_STOP
#define SERVICE_CONFIG_PRESHUTDOWN_INFO
#define SERVICE_NOTIFY_RUNNING
struct _SERVICE_STATUS_PROCESS SERVICE_STATUS_PROCESS
#define SERVICE_CONTROL_INTERROGATE
#define SERVICE_DEMAND_START
#define SERVICE_KERNEL_DRIVER
#define SERVICE_WIN32_SHARE_PROCESS
#define SERVICE_INTERACTIVE_PROCESS
#define SERVICE_AUTO_START
#define SERVICE_BOOT_START
#define SERVICE_WIN32_OWN_PROCESS
#define SERVICE_FILE_SYSTEM_DRIVER
#define SERVICE_ERROR_IGNORE
#define SERVICE_ERROR_NORMAL
#define DACL_SECURITY_INFORMATION