diff --git a/reactos/base/system/services/database.c b/reactos/base/system/services/database.c index 13471d2b293..2e2d11fe1be 100644 --- a/reactos/base/system/services/database.c +++ b/reactos/base/system/services/database.c @@ -612,7 +612,8 @@ ScmControlService(PSERVICE Service, static DWORD ScmSendStartCommand(PSERVICE Service, - LPWSTR Arguments) + DWORD argc, + LPWSTR *argv) { PSCM_CONTROL_PACKET ControlPacket; DWORD TotalLength; @@ -625,16 +626,14 @@ ScmSendStartCommand(PSERVICE Service, /* Calculate the total length of the start command line */ TotalLength = wcslen(Service->lpServiceName) + 1; - if (Arguments != NULL) + if (argc > 0) { - Ptr = Arguments; - while (*Ptr) + for (Count = 0; Count < argc; Count++) { - Length = wcslen(Ptr) + 1; + DPRINT("Arg: %S\n", argv[Count]); + Length = wcslen(argv[Count]) + 1; TotalLength += Length; ArgsLength += Length; - Ptr += Length; - DPRINT("Arg: %S\n", Ptr); } } TotalLength++; @@ -655,10 +654,14 @@ ScmSendStartCommand(PSERVICE Service, Ptr += (wcslen(Service->lpServiceName) + 1); /* Copy argument list */ - if (Arguments != NULL) + if (argc > 0) { + UNIMPLEMENTED; + DPRINT1("Arguments sent to service ignored!\n"); +#if 0 memcpy(Ptr, Arguments, ArgsLength); Ptr += ArgsLength; +#endif } /* Terminate the argument list */ @@ -686,7 +689,8 @@ ScmSendStartCommand(PSERVICE Service, static DWORD ScmStartUserModeService(PSERVICE Service, - LPWSTR lpArgs) + DWORD argc, + LPWSTR *argv) { RTL_QUERY_REGISTRY_TABLE QueryTable[3]; PROCESS_INFORMATION ProcessInformation; @@ -855,7 +859,7 @@ ScmStartUserModeService(PSERVICE Service, DPRINT("Received service status %lu\n", Service->hClient); /* Send start command */ - dwError = ScmSendStartCommand(Service, lpArgs); + dwError = ScmSendStartCommand(Service, argc, argv); } } else @@ -878,7 +882,7 @@ ScmStartUserModeService(PSERVICE Service, DWORD -ScmStartService(PSERVICE Service, LPWSTR lpArgs) +ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv) { PSERVICE_GROUP Group = Service->lpGroup; DWORD dwError = ERROR_SUCCESS; @@ -898,7 +902,7 @@ ScmStartService(PSERVICE Service, LPWSTR lpArgs) else { /* Start user-mode service */ - dwError = ScmStartUserModeService(Service, lpArgs); + dwError = ScmStartUserModeService(Service, argc, argv); } DPRINT("ScmStartService() done (Error %lu)\n", dwError); @@ -985,7 +989,7 @@ ScmAutoStartServices(VOID) (CurrentService->dwTag == CurrentGroup->TagArray[i])) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, NULL); + ScmStartService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1003,7 +1007,7 @@ ScmAutoStartServices(VOID) (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, NULL); + ScmStartService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1023,7 +1027,7 @@ ScmAutoStartServices(VOID) (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, NULL); + ScmStartService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1040,7 +1044,7 @@ ScmAutoStartServices(VOID) (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, NULL); + ScmStartService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index 9950e933354..fb6a446eae9 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -17,10 +17,6 @@ #define NDEBUG #include -#define SC_LOCK unsigned int -#define SC_STATUS_TYPE unsigned long -#define SC_ENUM_TYPE unsigned long - /* GLOBALS *****************************************************************/ #define MANAGER_TAG 0x72674D68 /* 'hMgr' */ @@ -115,7 +111,7 @@ ScmStartRpcServer(VOID) { RPC_STATUS Status; - DPRINT("ScmStartRpcServer() called"); + DPRINT("ScmStartRpcServer() called\n"); Status = RpcServerUseProtseqEpW(L"ncacn_np", 10, @@ -143,7 +139,7 @@ ScmStartRpcServer(VOID) return; } - DPRINT("ScmStartRpcServer() done"); + DPRINT("ScmStartRpcServer() done\n"); } @@ -240,20 +236,20 @@ ScmAssignNewTag(PSERVICE lpService) /* Function 0 */ -DWORD -ScmrCloseServiceHandle(handle_t BindingHandle, - unsigned long hScObject) +DWORD ScmrCloseServiceHandle( + handle_t BindingHandle, + LPSC_RPC_HANDLE hSCObject) { PMANAGER_HANDLE hManager; DPRINT("ScmrCloseServiceHandle() called\n"); - DPRINT("hScObject = %X\n", hScObject); + DPRINT("hSCObject = %p\n", *hSCObject); - if (hScObject == 0) + if (*hSCObject == 0) return ERROR_INVALID_HANDLE; - hManager = (PMANAGER_HANDLE)hScObject; + hManager = (PMANAGER_HANDLE)*hSCObject; if (hManager->Handle.Tag == MANAGER_TAG) { DPRINT("Found manager handle\n"); @@ -292,11 +288,11 @@ ScmrCloseServiceHandle(handle_t BindingHandle, /* Function 1 */ -DWORD -ScmrControlService(handle_t BindingHandle, - unsigned long hService, - DWORD dwControl, - LPSERVICE_STATUS lpServiceStatus) +DWORD ScmrControlService( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwControl, + LPSERVICE_STATUS lpServiceStatus) { PSERVICE_HANDLE hSvc; PSERVICE lpService; @@ -381,9 +377,9 @@ ScmrControlService(handle_t BindingHandle, /* Function 2 */ -DWORD -ScmrDeleteService(handle_t BindingHandle, - unsigned long hService) +DWORD ScmrDeleteService( + handle_t BindingHandle, + SC_RPC_HANDLE hService) { PSERVICE_HANDLE hSvc; PSERVICE lpService; @@ -431,16 +427,16 @@ ScmrDeleteService(handle_t BindingHandle, /* Function 3 */ -DWORD -ScmrLockServiceDatabase(handle_t BindingHandle, - unsigned long hSCManager, - SC_LOCK *hLock) +DWORD ScmrLockServiceDatabase( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPSC_RPC_LOCK lpLock) { PMANAGER_HANDLE hMgr; DPRINT("ScmrLockServiceDatabase() called\n"); - *hLock = 0; + *lpLock = 0; hMgr = (PMANAGER_HANDLE)hSCManager; if (!hMgr || hMgr->Handle.Tag != MANAGER_TAG) @@ -453,20 +449,20 @@ ScmrLockServiceDatabase(handle_t BindingHandle, // return ScmLockDatabase(0, hMgr->0xC, hLock); /* FIXME: Lock the database */ - *hLock = 0x12345678; /* Dummy! */ + *lpLock = (void *)0x12345678; /* Dummy! */ return ERROR_SUCCESS; } /* Function 4 */ -DWORD -ScmrQueryServiceObjectSecurity(handle_t BindingHandle, - unsigned long hService, - DWORD dwSecurityInformation, - unsigned char *lpSecurityDescriptor, - DWORD dwSecuityDescriptorSize, - DWORD *pcbBytesNeeded) +DWORD ScmrQueryServiceObjectSecurity( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + SECURITY_INFORMATION dwSecurityInformation, + LPBYTE lpSecurityDescriptor, + DWORD cbBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded) { #if 0 PSERVICE_HANDLE hSvc; @@ -538,18 +534,18 @@ ScmrQueryServiceObjectSecurity(handle_t BindingHandle, return dwError; #endif - DPRINT1("ScmrQueryServiceObjectSecurity() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 5 */ -DWORD -ScmrSetServiceObjectSecurity(handle_t BindingHandle, - unsigned long hService, - DWORD dwSecurityInformation, - unsigned char *lpSecurityDescriptor, - DWORD dwSecuityDescriptorSize) +DWORD ScmrSetServiceObjectSecurity( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwSecurityInformation, + LPBYTE lpSecurityDescriptor, + DWORD dwSecuityDescriptorSize) { PSERVICE_HANDLE hSvc; PSERVICE lpService; @@ -642,7 +638,7 @@ ScmrSetServiceObjectSecurity(handle_t BindingHandle, if (dwError != ERROR_SUCCESS) goto Done; - DPRINT1("Stub: ScmrSetServiceObjectSecurity() is unimplemented\n"); + UNIMPLEMENTED; dwError = ERROR_SUCCESS; // dwError = ScmWriteSecurityDescriptor(hServiceKey, // lpService->lpSecurityDescriptor); @@ -664,10 +660,10 @@ Done: /* Function 6 */ -DWORD -ScmrQueryServiceStatus(handle_t BindingHandle, - unsigned long hService, - LPSERVICE_STATUS lpServiceStatus) +DWORD ScmrQueryServiceStatus( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + LPSERVICE_STATUS lpServiceStatus) { PSERVICE_HANDLE hSvc; PSERVICE lpService; @@ -708,10 +704,10 @@ ScmrQueryServiceStatus(handle_t BindingHandle, /* Function 7 */ -DWORD -ScmrSetServiceStatus(handle_t BindingHandle, - SERVICE_STATUS_HANDLE hServiceStatus, - LPSERVICE_STATUS lpServiceStatus) +DWORD ScmrSetServiceStatus( + handle_t BindingHandle, + SC_RPC_HANDLE hServiceStatus, + LPSERVICE_STATUS lpServiceStatus) { PSERVICE lpService; @@ -739,58 +735,56 @@ ScmrSetServiceStatus(handle_t BindingHandle, /* Function 8 */ -DWORD -ScmrUnlockServiceDatabase(handle_t BindingHandle, - SC_LOCK hLock) +DWORD ScmrUnlockServiceDatabase( + handle_t BindingHandle, + LPSC_RPC_LOCK Lock) { - DPRINT1("ScmrUnlockServiceDatabase() called\n"); - /* FIXME */ + UNIMPLEMENTED; return ERROR_SUCCESS; } /* Function 9 */ -DWORD -ScmrNotifyBootConfigStatus(handle_t BindingHandle, - BOOL BootAcceptable) +DWORD ScmrNotifyBootConfigStatus( + handle_t BindingHandle, + SVCCTL_HANDLEW lpMachineName, + DWORD BootAcceptable) { - DPRINT1("ScmrNotifyBootConfigStatus() called\n"); - /* FIXME */ + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 10 */ -DWORD -ScmrSetServiceBitsW(handle_t BindingHandle, - SERVICE_STATUS_HANDLE hServiceStatus, - DWORD dwServiceBits, - BOOL bSetBitsOn, - BOOL bUpdateImmediately, - wchar_t *lpString) +DWORD ScmrSetServiceBitsW( + handle_t BindingHandle, + SC_RPC_HANDLE hServiceStatus, + DWORD dwServiceBits, + int bSetBitsOn, + int bUpdateImmediately, + wchar_t *lpString) { - DPRINT1("ScmrSetServiceBitsW() called\n"); - /* FIXME */ + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 11 */ -DWORD -ScmrChangeServiceConfigW(handle_t BiningHandle, - unsigned long hService, - DWORD dwServiceType, - DWORD dwStartType, - DWORD dwErrorControl, - wchar_t *lpBinaryPathName, - wchar_t *lpLoadOrderGroup, - DWORD *lpdwTagId, /* in, out, unique */ - wchar_t *lpDependencies, - DWORD dwDependenciesLength, - wchar_t *lpServiceStartName, - wchar_t *lpPassword, - DWORD dwPasswordLength, - wchar_t *lpDisplayName) +DWORD ScmrChangeServiceConfigW( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPWSTR lpBinaryPathName, + LPWSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPBYTE lpDependencies, + DWORD dwDependSize, + LPWSTR lpServiceStartName, + LPBYTE lpPassword, + DWORD dwPwSize, + LPWSTR lpDisplayName) { DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; @@ -973,8 +967,8 @@ ScmrChangeServiceConfigW(handle_t BiningHandle, if (lpDependencies != NULL && *lpDependencies != 0) { dwError = ScmWriteDependencies(hServiceKey, - lpDependencies, - dwDependenciesLength); + (LPWSTR)lpDependencies, + dwDependSize); if (dwError != ERROR_SUCCESS) goto done; } @@ -1371,24 +1365,24 @@ ScmCanonDriverImagePath(DWORD dwStartType, /* Function 12 */ -DWORD -ScmrCreateServiceW(handle_t BindingHandle, - unsigned long hSCManager, - wchar_t *lpServiceName, - wchar_t *lpDisplayName, - DWORD dwDesiredAccess, - DWORD dwServiceType, - DWORD dwStartType, - DWORD dwErrorControl, - wchar_t *lpBinaryPathName, - wchar_t *lpLoadOrderGroup, - DWORD *lpdwTagId, /* in, out */ - wchar_t *lpDependencies, - DWORD dwDependenciesLength, - wchar_t *lpServiceStartName, - wchar_t *lpPassword, - DWORD dwPasswordLength, - unsigned long *hService) /* out */ +DWORD ScmrCreateServiceW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPWSTR lpServiceName, + LPWSTR lpDisplayName, + DWORD dwDesiredAccess, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPWSTR lpBinaryPathName, + LPWSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPBYTE lpDependencies, + DWORD dwDependSize, + LPWSTR lpServiceStartName, + LPBYTE lpPassword, + DWORD dwPwSize, + LPSC_RPC_HANDLE lpServiceHandle) { PMANAGER_HANDLE hManager; DWORD dwError = ERROR_SUCCESS; @@ -1585,8 +1579,8 @@ ScmrCreateServiceW(handle_t BindingHandle, if (lpDependencies != NULL && *lpDependencies != 0) { dwError = ScmWriteDependencies(hServiceKey, - lpDependencies, - dwDependenciesLength); + (LPWSTR)lpDependencies, + dwDependSize); if (dwError != ERROR_SUCCESS) goto done; } @@ -1612,8 +1606,8 @@ done:; if (dwError == ERROR_SUCCESS) { - DPRINT("hService %lx\n", hServiceHandle); - *hService = (unsigned long)hServiceHandle; + DPRINT("hService %p\n", hServiceHandle); + *lpServiceHandle = (unsigned long)hServiceHandle; /* FIXME: 64 bit portability */ if (lpdwTagId != NULL) *lpdwTagId = lpService->dwTag; @@ -1646,18 +1640,18 @@ done:; /* Function 13 */ -DWORD -ScmrEnumDependentServicesW(handle_t BindingHandle, - unsigned long hService, - DWORD dwServiceState, - unsigned char *lpServices, - DWORD cbBufSize, - DWORD *pcbBytesNeeded, - DWORD *lpServicesReturned) +DWORD ScmrEnumDependentServicesW( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwServiceState, + LPBYTE lpServices, + DWORD cbBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned) { DWORD dwError = ERROR_SUCCESS; - DPRINT1("ScmrEnumDependentServicesW() called\n"); + UNIMPLEMENTED; *pcbBytesNeeded = 0; *lpServicesReturned = 0; @@ -1668,16 +1662,16 @@ ScmrEnumDependentServicesW(handle_t BindingHandle, /* Function 14 */ -DWORD -ScmrEnumServicesStatusW(handle_t BindingHandle, - unsigned long hSCManager, - DWORD dwServiceType, - DWORD dwServiceState, - unsigned char *lpServices, - DWORD dwBufSize, - DWORD *pcbBytesNeeded, - DWORD *lpServicesReturned, - DWORD *lpResumeHandle) +DWORD ScmrEnumServicesStatusW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpBuffer, + DWORD dwBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned, + LPBOUNDED_DWORD_256K lpResumeHandle) { PMANAGER_HANDLE hManager; PSERVICE lpService; @@ -1801,8 +1795,8 @@ ScmrEnumServicesStatusW(handle_t BindingHandle, *lpServicesReturned = dwServiceCount; *pcbBytesNeeded = dwRequiredSize; - lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices; - lpStringPtr = (LPWSTR)((ULONG_PTR)lpServices + + lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpBuffer; + lpStringPtr = (LPWSTR)((ULONG_PTR)lpBuffer + dwServiceCount * sizeof(ENUM_SERVICE_STATUSW)); dwRequiredSize = 0; @@ -1833,13 +1827,13 @@ ScmrEnumServicesStatusW(handle_t BindingHandle, /* Copy the service name */ wcscpy(lpStringPtr, CurrentService->lpServiceName); - lpStatusPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpServices); + lpStatusPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); lpStringPtr += (wcslen(CurrentService->lpServiceName) + 1); /* Copy the display name */ wcscpy(lpStringPtr, CurrentService->lpDisplayName); - lpStatusPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpServices); + lpStatusPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); lpStringPtr += (wcslen(CurrentService->lpDisplayName) + 1); /* Copy the status information */ @@ -1867,12 +1861,12 @@ Done:; /* Function 15 */ -DWORD -ScmrOpenSCManagerW(handle_t BindingHandle, - wchar_t *lpMachineName, - wchar_t *lpDatabaseName, - DWORD dwDesiredAccess, - unsigned long *hScm) +DWORD ScmrOpenSCManagerW( + handle_t BindingHandle, + LPWSTR lpMachineName, + LPWSTR lpDatabaseName, + DWORD dwDesiredAccess, + LPSC_RPC_HANDLE lpScHandle) { DWORD dwError; SC_HANDLE hHandle; @@ -1887,8 +1881,8 @@ ScmrOpenSCManagerW(handle_t BindingHandle, if (ScmShutdown) return ERROR_SHUTDOWN_IN_PROGRESS; - if (!hScm) - return ERROR_INVALID_PARAMETER; + if (!lpScHandle) + return ERROR_INVALID_PARAMETER; dwError = ScmCreateManagerHandle(lpDatabaseName, &hHandle); @@ -1908,8 +1902,8 @@ ScmrOpenSCManagerW(handle_t BindingHandle, return dwError; } - *hScm = (unsigned long)hHandle; - DPRINT("*hScm = %x\n", *hScm); + *lpScHandle = (unsigned long)hHandle; /* FIXME: 64 bit portability */ + DPRINT("*hScm = %p\n", *lpScHandle); DPRINT("ScmrOpenSCManagerW() done\n"); @@ -1918,12 +1912,12 @@ ScmrOpenSCManagerW(handle_t BindingHandle, /* Function 16 */ -DWORD -ScmrOpenServiceW(handle_t BindingHandle, - unsigned long hSCManager, - wchar_t *lpServiceName, - DWORD dwDesiredAccess, - unsigned long *hService) +DWORD ScmrOpenServiceW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPWSTR lpServiceName, + DWORD dwDesiredAccess, + LPSC_RPC_HANDLE lpServiceHandle) { PSERVICE lpService; PMANAGER_HANDLE hManager; @@ -1931,7 +1925,7 @@ ScmrOpenServiceW(handle_t BindingHandle, DWORD dwError; DPRINT("ScmrOpenServiceW() called\n"); - DPRINT("hSCManager = %x\n", hSCManager); + DPRINT("hSCManager = %p\n", hSCManager); DPRINT("lpServiceName = %p\n", lpServiceName); DPRINT("lpServiceName: %S\n", lpServiceName); DPRINT("dwDesiredAccess = %x\n", dwDesiredAccess); @@ -1939,8 +1933,8 @@ ScmrOpenServiceW(handle_t BindingHandle, if (ScmShutdown) return ERROR_SHUTDOWN_IN_PROGRESS; - if (!hService) - return ERROR_INVALID_PARAMETER; + if (!lpServiceHandle) + return ERROR_INVALID_PARAMETER; hManager = (PMANAGER_HANDLE)hSCManager; if (!hManager || hManager->Handle.Tag != MANAGER_TAG) @@ -1978,8 +1972,8 @@ ScmrOpenServiceW(handle_t BindingHandle, return dwError; } - *hService = (unsigned long)hHandle; - DPRINT("*hService = %x\n", *hService); + *lpServiceHandle = (unsigned long)hHandle; /* FIXME: 64 bit portability */ + DPRINT("*hService = %p\n", *lpServiceHandle); DPRINT("ScmrOpenServiceW() done\n"); @@ -1988,13 +1982,14 @@ ScmrOpenServiceW(handle_t BindingHandle, /* Function 17 */ -DWORD -ScmrQueryServiceConfigW(handle_t BindingHandle, - unsigned long hService, - unsigned char *lpServiceConfig, - DWORD cbBufSize, - DWORD *pcbBytesNeeded) +DWORD ScmrQueryServiceConfigW( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + LPBYTE lpBuf, //LPQUERY_SERVICE_CONFIGW lpServiceConfig, + DWORD cbBufSize, + LPBOUNDED_DWORD_8K pcbBytesNeeded) { + LPQUERY_SERVICE_CONFIGW lpServiceConfig = (LPQUERY_SERVICE_CONFIGW)lpBuf; DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; PSERVICE lpService = NULL; @@ -2148,25 +2143,24 @@ Done:; /* Function 18 */ -DWORD -ScmrQueryServiceLockStatusW(handle_t BindingHandle, - unsigned long hSCManager, - unsigned char *lpLockStatus, /* [out, unique, size_is(cbBufSize)] */ - DWORD cbBufSize, /* [in] */ - DWORD *pcbBytesNeeded) /* [out] */ +DWORD ScmrQueryServiceLockStatusW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus, + DWORD cbBufSize, + LPBOUNDED_DWORD_4K pcbBytesNeeded) { - DPRINT1("ScmrQueryServiceLockStatusW() called\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 19 */ -DWORD -ScmrStartServiceW(handle_t BindingHandle, - unsigned long hService, - DWORD dwNumServiceArgs, - unsigned char *lpServiceArgBuffer, - DWORD cbBufSize) +DWORD ScmrStartServiceW( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD argc, + LPSTRING_PTRSW argv) { DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; @@ -2204,20 +2198,25 @@ ScmrStartServiceW(handle_t BindingHandle, if (lpService->bDeleted) return ERROR_SERVICE_MARKED_FOR_DELETE; + if (argv) { + UNIMPLEMENTED; + argv = NULL; + } + /* Start the service */ - dwError = ScmStartService(lpService, (LPWSTR)lpServiceArgBuffer); + dwError = ScmStartService(lpService, argc, (LPWSTR *)argv); return dwError; } /* Function 20 */ -DWORD -ScmrGetServiceDisplayNameW(handle_t BindingHandle, - unsigned long hSCManager, - wchar_t *lpServiceName, - wchar_t *lpDisplayName, /* [out, unique] */ - DWORD *lpcchBuffer) +DWORD ScmrGetServiceDisplayNameW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPWSTR lpServiceName, + LPWSTR lpDisplayName, + DWORD *lpcchBuffer) { // PMANAGER_HANDLE hManager; PSERVICE lpService; @@ -2225,7 +2224,7 @@ ScmrGetServiceDisplayNameW(handle_t BindingHandle, DWORD dwError; DPRINT("ScmrGetServiceDisplayNameW() called\n"); - DPRINT("hSCManager = %x\n", hSCManager); + DPRINT("hSCManager = %p\n", hSCManager); DPRINT("lpServiceName: %S\n", lpServiceName); DPRINT("lpDisplayName: %p\n", lpDisplayName); DPRINT("*lpcchBuffer: %lu\n", *lpcchBuffer); @@ -2262,12 +2261,12 @@ ScmrGetServiceDisplayNameW(handle_t BindingHandle, /* Function 21 */ -DWORD -ScmrGetServiceKeyNameW(handle_t BindingHandle, - unsigned long hSCManager, - wchar_t *lpDisplayName, - wchar_t *lpServiceName, /* [out, unique] */ - DWORD *lpcchBuffer) +DWORD ScmrGetServiceKeyNameW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPWSTR lpDisplayName, + LPWSTR lpServiceName, + DWORD *lpcchBuffer) { // PMANAGER_HANDLE hManager; PSERVICE lpService; @@ -2275,7 +2274,7 @@ ScmrGetServiceKeyNameW(handle_t BindingHandle, DWORD dwError; DPRINT("ScmrGetServiceKeyNameW() called\n"); - DPRINT("hSCManager = %x\n", hSCManager); + DPRINT("hSCManager = %p\n", hSCManager); DPRINT("lpDisplayName: %S\n", lpDisplayName); DPRINT("lpServiceName: %p\n", lpServiceName); DPRINT("*lpcchBuffer: %lu\n", *lpcchBuffer); @@ -2312,77 +2311,77 @@ ScmrGetServiceKeyNameW(handle_t BindingHandle, /* Function 22 */ -DWORD -ScmrSetServiceBitsA(handle_t BindingHandle, - SERVICE_STATUS_HANDLE hServiceStatus, - DWORD dwServiceBits, - BOOL bSetBitsOn, - BOOL bUpdateImmediately, - char *lpString) +DWORD ScmrSetServiceBitsA( + handle_t BindingHandle, + SC_RPC_HANDLE hServiceStatus, + DWORD dwServiceBits, + int bSetBitsOn, + int bUpdateImmediately, + char *lpString) { - DPRINT1("ScmrSetServiceBitsA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 23 */ -DWORD -ScmrChangeServiceConfigA(handle_t BiningHandle, - unsigned long hService, - DWORD dwServiceType, - DWORD dwStartType, - DWORD dwErrorControl, - char *lpBinaryPathName, - char *lpLoadOrderGroup, - DWORD *lpdwTagId, - char *lpDependencies, - DWORD dwDependenciesLength, - char *lpServiceStartName, - char *lpPassword, - DWORD dwPasswordLength, - char *lpDisplayName) +DWORD ScmrChangeServiceConfigA( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPSTR lpBinaryPathName, + LPSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPSTR lpDependencies, + DWORD dwDependSize, + LPSTR lpServiceStartName, + LPBYTE lpPassword, + DWORD dwPwSize, + LPSTR lpDisplayName) { - DPRINT1("ScmrChangeServiceConfigA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 24 */ -DWORD -ScmrCreateServiceA(handle_t BindingHandle, - unsigned long hSCManager, - char *lpServiceName, - char *lpDisplayName, - DWORD dwDesiredAccess, - DWORD dwServiceType, - DWORD dwStartType, - DWORD dwErrorControl, - char *lpBinaryPathName, - char *lpLoadOrderGroup, - DWORD *lpdwTagId, /* in, out */ - char *lpDependencies, - DWORD dwDependenciesLength, - char *lpServiceStartName, - char *lpPassword, - DWORD dwPasswordLength, - unsigned long *hService) /* out */ +DWORD ScmrCreateServiceA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPSTR lpServiceName, + LPSTR lpDisplayName, + DWORD dwDesiredAccess, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPSTR lpBinaryPathName, + LPSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPBYTE lpDependencies, + DWORD dwDependSize, + LPSTR lpServiceStartName, + LPBYTE lpPassword, + DWORD dwPwSize, + LPSC_RPC_HANDLE lpServiceHandle) { - DPRINT1("ScmrCreateServiceA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 25 */ -DWORD -ScmrEnumDependentServicesA(handle_t BindingHandle, - unsigned long hService, - DWORD dwServiceState, - unsigned char *lpServices, - DWORD cbBufSize, - DWORD *pcbBytesNeeded, - DWORD *lpServicesReturned) +DWORD ScmrEnumDependentServicesA( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwServiceState, + LPBYTE lpServices, + DWORD cbBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned) { - DPRINT1("ScmrEnumDependentServicesA() is unimplemented\n"); + UNIMPLEMENTED; *pcbBytesNeeded = 0; *lpServicesReturned = 0; return ERROR_CALL_NOT_IMPLEMENTED; @@ -2390,29 +2389,29 @@ ScmrEnumDependentServicesA(handle_t BindingHandle, /* Function 26 */ -DWORD -ScmrEnumServicesStatusA(handle_t BindingHandle, - unsigned long hSCManager, - DWORD dwServiceType, - DWORD dwServiceState, - unsigned char *lpServices, - DWORD dwBufSize, - DWORD *pcbBytesNeeded, - DWORD *lpServicesReturned, - unsigned long *lpResumeHandle) +DWORD ScmrEnumServicesStatusA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpBuffer, + DWORD dwBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned, + LPBOUNDED_DWORD_256K lpResumeHandle) { - DPRINT1("ScmrEnumServicesAtatusA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 27 */ -DWORD -ScmrOpenSCManagerA(handle_t BindingHandle, - char *lpMachineName, - char *lpDatabaseName, - DWORD dwDesiredAccess, - unsigned long *hScm) +DWORD ScmrOpenSCManagerA( + handle_t BindingHandle, + LPSTR lpMachineName, + LPSTR lpDatabaseName, + DWORD dwDesiredAccess, + LPSC_RPC_HANDLE lpScHandle) { UNICODE_STRING MachineName; UNICODE_STRING DatabaseName; @@ -2432,7 +2431,7 @@ ScmrOpenSCManagerA(handle_t BindingHandle, lpMachineName ? MachineName.Buffer : NULL, lpDatabaseName ? DatabaseName.Buffer : NULL, dwDesiredAccess, - hScm); + lpScHandle); if (lpMachineName) RtlFreeUnicodeString(&MachineName); @@ -2445,12 +2444,12 @@ ScmrOpenSCManagerA(handle_t BindingHandle, /* Function 28 */ -DWORD -ScmrOpenServiceA(handle_t BindingHandle, - unsigned long hSCManager, - char *lpServiceName, - DWORD dwDesiredAccess, - unsigned long *hService) +DWORD ScmrOpenServiceA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPSTR lpServiceName, + DWORD dwDesiredAccess, + LPSC_RPC_HANDLE lpServiceHandle) { UNICODE_STRING ServiceName; DWORD dwError; @@ -2464,7 +2463,7 @@ ScmrOpenServiceA(handle_t BindingHandle, hSCManager, ServiceName.Buffer, dwDesiredAccess, - hService); + lpServiceHandle); RtlFreeUnicodeString(&ServiceName); @@ -2473,38 +2472,37 @@ ScmrOpenServiceA(handle_t BindingHandle, /* Function 29 */ -DWORD -ScmrQueryServiceConfigA(handle_t BindingHandle, - unsigned long hService, - unsigned char *lpServiceConfig, - DWORD cbBufSize, - DWORD *pcbBytesNeeded) +DWORD ScmrQueryServiceConfigA( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + LPQUERY_SERVICE_CONFIGA lpServiceConfig, + DWORD cbBufSize, + LPBOUNDED_DWORD_8K pcbBytesNeeded) { - DPRINT1("ScmrQueryServiceConfigA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 30 */ -DWORD -ScmrQueryServiceLockStatusA(handle_t BindingHandle, - unsigned long hSCManager, - unsigned char *lpLockStatus, /* [out, unique, size_is(cbBufSize)] */ - DWORD cbBufSize, /* [in] */ - DWORD *pcbBytesNeeded) /* [out] */ +DWORD ScmrQueryServiceLockStatusA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus, + DWORD cbBufSize, + LPBOUNDED_DWORD_4K pcbBytesNeeded) { - DPRINT1("ScmrQueryServiceLockStatusA() called\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 31 */ -DWORD -ScmrStartServiceA(handle_t BindingHandle, - unsigned long hService, - DWORD dwNumServiceArgs, - unsigned char *lpServiceArgBuffer, - DWORD cbBufSize) +DWORD ScmrStartServiceA( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD argc, + LPSTRING_PTRSA argv) { DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; @@ -2545,7 +2543,7 @@ ScmrStartServiceA(handle_t BindingHandle, /* FIXME: Convert argument vector to Unicode */ /* Start the service */ - dwError = ScmStartService(lpService, NULL); + dwError = ScmStartService(lpService, 0, NULL); /* FIXME: Free argument vector */ @@ -2554,69 +2552,74 @@ ScmrStartServiceA(handle_t BindingHandle, /* Function 32 */ -DWORD -ScmrGetServiceDisplayNameA(handle_t BindingHandle, - unsigned long hSCManager, - char *lpServiceName, - char *lpDisplayName, /* [out, unique] */ - DWORD *lpcchBuffer) +DWORD ScmrGetServiceDisplayNameA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPSTR lpServiceName, + LPSTR lpDisplayName, + LPBOUNDED_DWORD_4K lpcchBuffer) { - DPRINT1("ScmrGetServiceDisplayNameA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 33 */ -DWORD -ScmrGetServiceKeyNameA(handle_t BindingHandle, - unsigned long hSCManager, - char *lpDisplayName, - char *lpServiceName, /* [out, unique] */ - DWORD *lpcchBuffer) +DWORD ScmrGetServiceKeyNameA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + LPSTR lpDisplayName, + LPSTR lpKeyName, + LPBOUNDED_DWORD_4K lpcchBuffer) { - DPRINT1("ScmrGetServiceKeyNameA() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 34 */ -DWORD -ScmrGetCurrentGroupStateW(handle_t BindingHandle) +DWORD ScmrGetCurrentGroupStateW( + handle_t BindingHandle) { - DPRINT1("ScmrGetCurrentGroupStateW() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 35 */ -DWORD -ScmrEnumServiceGroupW(handle_t BindingHandle) +DWORD ScmrEnumServiceGroupW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned, + LPBOUNDED_DWORD_256K lpResumeIndex, + LPWSTR pszGroupName) { - DPRINT1("ScmrEnumServiceGroupW() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 36 */ -DWORD -ScmrChangeServiceConfig2A(handle_t BindingHandle, - unsigned long hService, - DWORD dwInfoLevel, - unsigned char *lpInfo, - DWORD dwInfoSize) +DWORD ScmrChangeServiceConfig2A( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + SC_RPC_CONFIG_INFOA Info) { - DPRINT1("ScmrChangeServiceConfig2A() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 37 */ -DWORD -ScmrChangeServiceConfig2W(handle_t BindingHandle, - unsigned long hService, - DWORD dwInfoLevel, - unsigned char *lpInfo, - DWORD dwInfoSize) +DWORD ScmrChangeServiceConfig2W( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + SC_RPC_CONFIG_INFOW Info) { DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; @@ -2624,8 +2627,7 @@ ScmrChangeServiceConfig2W(handle_t BindingHandle, HKEY hServiceKey = NULL; DPRINT("ScmrChangeServiceConfig2W() called\n"); - DPRINT("dwInfoLevel = %lu\n", dwInfoLevel); - DPRINT("dwInfoSize = %lu\n", dwInfoSize); + DPRINT("dwInfoLevel = %lu\n", Info.dwInfoLevel); if (ScmShutdown) return ERROR_SHUTDOWN_IN_PROGRESS; @@ -2667,12 +2669,12 @@ ScmrChangeServiceConfig2W(handle_t BindingHandle, if (dwError != ERROR_SUCCESS) goto done; - if (dwInfoLevel & SERVICE_CONFIG_DESCRIPTION) + if (Info.dwInfoLevel & SERVICE_CONFIG_DESCRIPTION) { LPSERVICE_DESCRIPTIONW lpServiceDescription; - lpServiceDescription = (LPSERVICE_DESCRIPTIONW)lpInfo; - lpServiceDescription->lpDescription = (LPWSTR)(lpInfo + sizeof(LPSERVICE_DESCRIPTIONW)); + lpServiceDescription = (LPSERVICE_DESCRIPTIONW)&Info; + lpServiceDescription->lpDescription = (LPWSTR)(&Info + sizeof(LPSERVICE_DESCRIPTIONW)); if (lpServiceDescription != NULL && lpServiceDescription->lpDescription != NULL) @@ -2688,9 +2690,9 @@ ScmrChangeServiceConfig2W(handle_t BindingHandle, goto done; } } - else if (dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS) + else if (Info.dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS) { - DPRINT1("SERVICE_CONFIG_FAILURE_ACTIONS not implemented\n"); + UNIMPLEMENTED; dwError = ERROR_CALL_NOT_IMPLEMENTED; goto done; } @@ -2707,27 +2709,27 @@ done: /* Function 38 */ -DWORD -ScmrQueryServiceConfig2A(handle_t BindingHandle, - unsigned long hService, - DWORD dwInfoLevel, - unsigned char *lpBuffer, - DWORD cbBufSize, - DWORD *pcbBytesNeeded) +DWORD ScmrQueryServiceConfig2A( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwInfoLevel, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPBOUNDED_DWORD_8K pcbBytesNeeded) { - DPRINT1("ScmrQueryServiceConfig2A() is unimplemented\n"); + UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* Function 39 */ -DWORD -ScmrQueryServiceConfig2W(handle_t BindingHandle, - unsigned long hService, - DWORD dwInfoLevel, - unsigned char *lpBuffer, - DWORD cbBufSize, - DWORD *pcbBytesNeeded) +DWORD ScmrQueryServiceConfig2W( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwInfoLevel, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPBOUNDED_DWORD_8K pcbBytesNeeded) { DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; @@ -2798,7 +2800,7 @@ ScmrQueryServiceConfig2W(handle_t BindingHandle, } else if (dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS) { - DPRINT1("SERVICE_CONFIG_FAILURE_ACTIONS not implemented\n"); + UNIMPLEMENTED; dwError = ERROR_CALL_NOT_IMPLEMENTED; goto done; } @@ -2819,13 +2821,13 @@ done: /* Function 40 */ -DWORD -ScmrQueryServiceStatusEx(handle_t BindingHandle, - unsigned long hService, - SC_STATUS_TYPE InfoLevel, - unsigned char *lpBuffer, /* out */ - DWORD cbBufSize, - DWORD *pcbBytesNeeded) /* out */ +DWORD ScmrQueryServiceStatusEx( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + SC_STATUS_TYPE InfoLevel, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPBOUNDED_DWORD_8K pcbBytesNeeded) { LPSERVICE_STATUS_PROCESS lpStatus; PSERVICE_HANDLE hSvc; @@ -2880,20 +2882,20 @@ ScmrQueryServiceStatusEx(handle_t BindingHandle, /* Function 41 */ -DWORD -ScmrEnumServicesStatusExA(handle_t BindingHandle, - unsigned long hSCManager, - SC_STATUS_TYPE InfoLevel, - DWORD dwServiceType, - DWORD dwServiceState, - unsigned char *lpServices, - DWORD dwBufSize, - DWORD *pcbBytesNeeded, - DWORD *lpServicesReturned, - unsigned long *lpResumeHandle, - char *pszGroupName) +DWORD ScmrEnumServicesStatusExA( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + SC_ENUM_TYPE InfoLevel, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned, + LPBOUNDED_DWORD_256K lpResumeIndex, + LPSTR pszGroupName) { - DPRINT1("ScmrEnumServicesStatusExA() is unimplemented\n"); + UNIMPLEMENTED; *pcbBytesNeeded = 0; *lpServicesReturned = 0; return ERROR_CALL_NOT_IMPLEMENTED; @@ -2901,18 +2903,18 @@ ScmrEnumServicesStatusExA(handle_t BindingHandle, /* Function 42 */ -DWORD -ScmrEnumServicesStatusExW(handle_t BindingHandle, - unsigned long hSCManager, - SC_ENUM_TYPE InfoLevel, - DWORD dwServiceType, - DWORD dwServiceState, - unsigned char *lpServices, - DWORD dwBufSize, - DWORD *pcbBytesNeeded, - DWORD *lpServicesReturned, - DWORD *lpResumeHandle, - wchar_t *pszGroupName) +DWORD ScmrEnumServicesStatusExW( + handle_t BindingHandle, + SC_RPC_HANDLE hSCManager, + SC_ENUM_TYPE InfoLevel, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPBOUNDED_DWORD_256K pcbBytesNeeded, + LPBOUNDED_DWORD_256K lpServicesReturned, + LPBOUNDED_DWORD_256K lpResumeIndex, + LPWSTR pszGroupName) { PMANAGER_HANDLE hManager; PSERVICE lpService; @@ -2954,7 +2956,7 @@ ScmrEnumServicesStatusExW(handle_t BindingHandle, *pcbBytesNeeded = 0; *lpServicesReturned = 0; - dwLastResumeCount = *lpResumeHandle; + dwLastResumeCount = *lpResumeIndex; /* Lock the service list shared */ @@ -3005,7 +3007,7 @@ ScmrEnumServicesStatusExW(handle_t BindingHandle, ((wcslen(CurrentService->lpServiceName) + 1) * sizeof(WCHAR)) + ((wcslen(CurrentService->lpDisplayName) + 1) * sizeof(WCHAR)); - if (dwRequiredSize + dwSize <= dwBufSize) + if (dwRequiredSize + dwSize <= cbBufSize) { DPRINT("Service name: %S fit\n", CurrentService->lpServiceName); dwRequiredSize += dwSize; @@ -3065,12 +3067,12 @@ ScmrEnumServicesStatusExW(handle_t BindingHandle, DPRINT("*pcbBytesNeeded: %lu\n", dwRequiredSize); - *lpResumeHandle = dwLastResumeCount; + *lpResumeIndex = dwLastResumeCount; *lpServicesReturned = dwServiceCount; *pcbBytesNeeded = dwRequiredSize; - lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSW)lpServices; - lpStringPtr = (LPWSTR)((ULONG_PTR)lpServices + + lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSW)lpBuffer; + lpStringPtr = (LPWSTR)((ULONG_PTR)lpBuffer + dwServiceCount * sizeof(ENUM_SERVICE_STATUS_PROCESSW)); dwRequiredSize = 0; @@ -3111,18 +3113,18 @@ ScmrEnumServicesStatusExW(handle_t BindingHandle, ((wcslen(CurrentService->lpServiceName) + 1) * sizeof(WCHAR)) + ((wcslen(CurrentService->lpDisplayName) + 1) * sizeof(WCHAR)); - if (dwRequiredSize + dwSize <= dwBufSize) + if (dwRequiredSize + dwSize <= cbBufSize) { /* Copy the service name */ wcscpy(lpStringPtr, CurrentService->lpServiceName); - lpStatusPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpServices); + lpStatusPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); lpStringPtr += (wcslen(CurrentService->lpServiceName) + 1); /* Copy the display name */ wcscpy(lpStringPtr, CurrentService->lpDisplayName); - lpStatusPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpServices); + lpStatusPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); lpStringPtr += (wcslen(CurrentService->lpDisplayName) + 1); /* Copy the status information */ @@ -3152,7 +3154,166 @@ Done:; /* Function 43 */ -/* ScmrSendTSMessage */ +DWORD ScmrSendTSMessage( + handle_t BindingHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 44 */ +DWORD ScmrCreateServiceWOW64A( + handle_t BindingHandle, + LPSTR lpServiceName, + LPSTR lpDisplayName, + DWORD dwDesiredAccess, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPSTR lpBinaryPathName, + LPSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPBYTE lpDependencies, + DWORD dwDependSize, + LPSTR lpServiceStartName, + LPBYTE lpPassword, + DWORD dwPwSize, + LPSC_RPC_HANDLE lpServiceHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 45 */ +DWORD ScmrCreateServiceWOW64W( + handle_t BindingHandle, + LPWSTR lpServiceName, + LPWSTR lpDisplayName, + DWORD dwDesiredAccess, + DWORD dwServiceType, + DWORD dwStartType, + DWORD dwErrorControl, + LPWSTR lpBinaryPathName, + LPWSTR lpLoadOrderGroup, + LPDWORD lpdwTagId, + LPBYTE lpDependencies, + DWORD dwDependSize, + LPWSTR lpServiceStartName, + LPBYTE lpPassword, + DWORD dwPwSize, + LPSC_RPC_HANDLE lpServiceHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 46 */ +DWORD ScmrFunction46( + handle_t BindingHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 47 */ +DWORD ScmrNotifyServiceStatusChange( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + SC_RPC_NOTIFY_PARAMS NotifyParams, + GUID *pClientProcessGuid, + GUID *pSCMProcessGuid, + PBOOL pfCreateRemoteQueue, + LPSC_NOTIFY_RPC_HANDLE phNotify) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 48 */ +DWORD ScmrGetNotifyResults( + handle_t BindingHandle, + SC_NOTIFY_RPC_HANDLE hNotify, + PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 49 */ +DWORD ScmrCloseNotifyHandle( + handle_t BindingHandle, + LPSC_NOTIFY_RPC_HANDLE phNotify, + PBOOL pfApcFired) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 50 */ +DWORD ScmrControlServiceExA( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwControl, + DWORD dwInfoLevel) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 51 */ +DWORD ScmrControlServiceExW( + handle_t BindingHandle, + SC_RPC_HANDLE hService, + DWORD dwControl, + DWORD dwInfoLevel) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 52 */ +DWORD ScmrFunction52( + handle_t BindingHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 53 */ +DWORD ScmrFunction53( + handle_t BindingHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 54 */ +DWORD ScmrFunction54( + handle_t BindingHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* Function 55 */ +DWORD ScmrFunction55( + handle_t BindingHandle) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len) @@ -3166,4 +3327,20 @@ void __RPC_USER midl_user_free(void __RPC_FAR * ptr) HeapFree(GetProcessHeap(), 0, ptr); } + +void __RPC_USER SC_RPC_HANDLE_rundown(SC_RPC_HANDLE hSCObject) +{ +} + + +void __RPC_USER SC_RPC_LOCK_rundown(SC_RPC_LOCK Lock) +{ +} + + +void __RPC_USER SC_NOTIFY_RPC_HANDLE_rundown(SC_NOTIFY_RPC_HANDLE hNotify) +{ +} + + /* EOF */ diff --git a/reactos/base/system/services/services.h b/reactos/base/system/services/services.h index 13f23af7f5e..72343acf553 100644 --- a/reactos/base/system/services/services.h +++ b/reactos/base/system/services/services.h @@ -100,7 +100,8 @@ VOID ScmGetBootAndSystemDriverState(VOID); VOID ScmAutoStartServices(VOID); VOID ScmAutoShutdownServices(VOID); DWORD ScmStartService(PSERVICE Service, - LPWSTR lpArgs); + DWORD argc, + LPWSTR *argv); PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName); PSERVICE ScmGetServiceEntryByDisplayName(LPWSTR lpDisplayName); diff --git a/reactos/dll/win32/advapi32/service/scm.c b/reactos/dll/win32/advapi32/service/scm.c index 1e62ced81c8..e6a40a93c61 100644 --- a/reactos/dll/win32/advapi32/service/scm.c +++ b/reactos/dll/win32/advapi32/service/scm.c @@ -88,20 +88,21 @@ ChangeServiceConfig2A(SC_HANDLE hService, DWORD dwInfoLevel, LPVOID lpInfo) { - DWORD lpInfoSize; + SC_RPC_CONFIG_INFOA Info; DWORD dwError; TRACE("ChangeServiceConfig2A() called\n"); - /* Determine the length of the lpInfo parameter */ + /* Fill relevent field of the Info structure */ + Info.dwInfoLevel = dwInfoLevel; switch (dwInfoLevel) { case SERVICE_CONFIG_DESCRIPTION: - lpInfoSize = sizeof(SERVICE_DESCRIPTIONA); + Info.psd = (LPSERVICE_DESCRIPTIONA)&lpInfo; break; case SERVICE_CONFIG_FAILURE_ACTIONS: - lpInfoSize = sizeof(SERVICE_FAILURE_ACTIONSA); + Info.psfa = (LPSERVICE_FAILURE_ACTIONSA)&lpInfo; break; default: @@ -116,10 +117,8 @@ ChangeServiceConfig2A(SC_HANDLE hService, HandleBind(); dwError = ScmrChangeServiceConfig2A(BindingHandle, - (unsigned int)hService, - dwInfoLevel, - lpInfo, - lpInfoSize); + (SC_RPC_HANDLE)hService, + Info); if (dwError != ERROR_SUCCESS) { ERR("ScmrChangeServiceConfig2A() failed (Error %lu)\n", dwError); @@ -141,42 +140,23 @@ ChangeServiceConfig2W(SC_HANDLE hService, DWORD dwInfoLevel, LPVOID lpInfo) { - LPBYTE lpSendData = NULL; - DWORD dwInfoSize; + SC_RPC_CONFIG_INFOW Info; DWORD dwError; TRACE("ChangeServiceConfig2W() called\n"); + /* Fill relevent field of the Info structure */ + Info.dwInfoLevel = dwInfoLevel; switch (dwInfoLevel) { case SERVICE_CONFIG_DESCRIPTION: { - LPSERVICE_DESCRIPTIONW lpServiceDescription = lpInfo; - DWORD dwStringSize; - - dwInfoSize = sizeof(SERVICE_DESCRIPTIONW); - dwStringSize = (wcslen(lpServiceDescription->lpDescription) + 1) * sizeof(WCHAR); - dwInfoSize += dwStringSize; - - lpSendData = HeapAlloc(GetProcessHeap(), 0, dwInfoSize); - if (lpSendData) - { - LPBYTE pt = lpSendData; - - CopyMemory(pt, lpInfo, sizeof(SERVICE_DESCRIPTIONW)); - pt += sizeof(SERVICE_DESCRIPTIONW); - CopyMemory(pt, lpServiceDescription->lpDescription, dwStringSize); - } - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } + Info.psd = (LPSERVICE_DESCRIPTIONW)&lpInfo; break; } case SERVICE_CONFIG_FAILURE_ACTIONS: - dwInfoSize = sizeof(SERVICE_FAILURE_ACTIONSW); + Info.psfa = (LPSERVICE_FAILURE_ACTIONSW)&lpInfo; break; default: @@ -186,15 +166,13 @@ ChangeServiceConfig2W(SC_HANDLE hService, } if (lpInfo == NULL) - goto done; + return TRUE; HandleBind(); dwError = ScmrChangeServiceConfig2W(BindingHandle, - (unsigned int)hService, - dwInfoLevel, - lpSendData, - dwInfoSize); + (SC_RPC_HANDLE)hService, + Info); if (dwError != ERROR_SUCCESS) { ERR("ScmrChangeServiceConfig2W() failed (Error %lu)\n", dwError); @@ -202,12 +180,6 @@ ChangeServiceConfig2W(SC_HANDLE hService, return FALSE; } -done: - if (lpSendData != NULL) - HeapFree(GetProcessHeap(), 0, lpSendData); - - TRACE("ChangeServiceConfig2W() done\n"); - return TRUE; } @@ -324,14 +296,14 @@ ChangeServiceConfigW(SC_HANDLE hService, /* Call to services.exe using RPC */ dwError = ScmrChangeServiceConfigW(BindingHandle, - (unsigned int)hService, + (SC_RPC_HANDLE)hService, dwServiceType, dwStartType, dwErrorControl, (LPWSTR)lpBinaryPathName, (LPWSTR)lpLoadOrderGroup, lpdwTagId, - (LPWSTR)lpDependencies, + (LPBYTE)lpDependencies, dwDependenciesLength, (LPWSTR)lpServiceStartName, NULL, /* FIXME: lpPassword */ @@ -364,7 +336,7 @@ CloseServiceHandle(SC_HANDLE hSCObject) /* Call to services.exe using RPC */ dwError = ScmrCloseServiceHandle(BindingHandle, - (unsigned int)hSCObject); + (LPSC_RPC_HANDLE)&hSCObject); if (dwError) { ERR("ScmrCloseServiceHandle() failed (Error %lu)\n", dwError); @@ -644,7 +616,7 @@ CreateServiceW(SC_HANDLE hSCManager, /* Call to services.exe using RPC */ dwError = ScmrCreateServiceW(BindingHandle, - (unsigned int)hSCManager, + (SC_RPC_HANDLE)hSCManager, (LPWSTR)lpServiceName, (LPWSTR)lpDisplayName, dwDesiredAccess, @@ -654,12 +626,12 @@ CreateServiceW(SC_HANDLE hSCManager, (LPWSTR)lpBinaryPathName, (LPWSTR)lpLoadOrderGroup, lpdwTagId, - (LPWSTR)lpDependencies, + (LPBYTE)lpDependencies, dwDependenciesLength, (LPWSTR)lpServiceStartName, NULL, /* FIXME: lpPassword */ 0, /* FIXME: dwPasswordLength */ - (unsigned long *)&hService); + (SC_RPC_HANDLE *)&hService); if (dwError != ERROR_SUCCESS) { ERR("ScmrCreateServiceW() failed (Error %lu)\n", dwError); @@ -1256,8 +1228,8 @@ LockServiceDatabase(SC_HANDLE hSCManager) /* Call to services.exe using RPC */ dwError = ScmrLockServiceDatabase(BindingHandle, - (unsigned int)hSCManager, - (unsigned int *)&hLock); + (SC_RPC_HANDLE)hSCManager, + (SC_RPC_LOCK *)&hLock); if (dwError != ERROR_SUCCESS) { ERR("ScmrLockServiceDatabase() failed (Error %lu)\n", dwError); @@ -1483,8 +1455,8 @@ QueryServiceConfigA(SC_HANDLE hService, /* Call to services.exe using RPC */ dwError = ScmrQueryServiceConfigA(BindingHandle, - (unsigned int)hService, - (unsigned char *)lpServiceConfig, + (SC_RPC_HANDLE)hService, + lpServiceConfig, cbBufSize, pcbBytesNeeded); if (dwError != ERROR_SUCCESS) @@ -1546,8 +1518,8 @@ QueryServiceConfigW(SC_HANDLE hService, /* Call to services.exe using RPC */ dwError = ScmrQueryServiceConfigW(BindingHandle, - (unsigned int)hService, - (unsigned char *)lpServiceConfig, + (SC_RPC_HANDLE)hService, + (LPBYTE)lpServiceConfig, cbBufSize, pcbBytesNeeded); if (dwError != ERROR_SUCCESS) @@ -1758,8 +1730,8 @@ QueryServiceLockStatusA(SC_HANDLE hSCManager, /* Call to services.exe using RPC */ dwError = ScmrQueryServiceLockStatusA(BindingHandle, - (unsigned int)hSCManager, - (unsigned char *)lpLockStatus, + (SC_RPC_HANDLE)hSCManager, + lpLockStatus, cbBufSize, pcbBytesNeeded); if (dwError != ERROR_SUCCESS) @@ -1800,8 +1772,8 @@ QueryServiceLockStatusW(SC_HANDLE hSCManager, /* Call to services.exe using RPC */ dwError = ScmrQueryServiceLockStatusW(BindingHandle, - (unsigned int)hSCManager, - (unsigned char *)lpLockStatus, + (SC_RPC_HANDLE)hSCManager, + lpLockStatus, cbBufSize, pcbBytesNeeded); if (dwError != ERROR_SUCCESS) @@ -2000,45 +1972,13 @@ StartServiceA(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCSTR *lpServiceArgVectors) { - LPSTR lpBuffer = NULL; - LPSTR lpStr; DWORD dwError; - DWORD dwBufSize = 0; - DWORD i; - - if (dwNumServiceArgs > 0) - { - for (i = 0; i < dwNumServiceArgs; i++) - { - dwBufSize += (strlen(lpServiceArgVectors[i]) + 1); - } - dwBufSize++; - TRACE("dwBufSize: %lu\n", dwBufSize); - - lpBuffer = HeapAlloc(GetProcessHeap(), 0, dwBufSize); - if (lpBuffer == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - lpStr = lpBuffer; - for (i = 0; i < dwNumServiceArgs; i++) - { - strcpy(lpStr, lpServiceArgVectors[i]); - lpStr += (strlen(lpServiceArgVectors[i]) + 1); - } - *lpStr = 0; - } dwError = ScmrStartServiceA(BindingHandle, - (unsigned int)hService, + (SC_RPC_HANDLE)hService, dwNumServiceArgs, - (unsigned char *)lpBuffer, - dwBufSize); + (LPSTRING_PTRSA)lpServiceArgVectors); - if (lpBuffer != NULL) - HeapFree(GetProcessHeap(), 0, lpBuffer); if (dwError != ERROR_SUCCESS) { @@ -2061,42 +2001,12 @@ StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors) { - LPWSTR lpBuffer; - LPWSTR lpStr; DWORD dwError; - DWORD dwBufSize; - DWORD i; - - dwBufSize = 0; - for (i = 0; i < dwNumServiceArgs; i++) - { - dwBufSize += ((wcslen(lpServiceArgVectors[i]) + 1) * sizeof(WCHAR)); - } - dwBufSize += sizeof(WCHAR); - TRACE("dwBufSize: %lu\n", dwBufSize); - - lpBuffer = HeapAlloc(GetProcessHeap(), 0, dwBufSize); - if (lpBuffer == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - lpStr = lpBuffer; - for (i = 0; i < dwNumServiceArgs; i++) - { - wcscpy(lpStr, lpServiceArgVectors[i]); - lpStr += (wcslen(lpServiceArgVectors[i]) + 1); - } - *lpStr = 0; dwError = ScmrStartServiceW(BindingHandle, - (unsigned int)hService, + (SC_RPC_HANDLE)hService, dwNumServiceArgs, - (unsigned char *)lpBuffer, - dwBufSize); - - HeapFree(GetProcessHeap(), 0, lpBuffer); + (LPSTRING_PTRSW)lpServiceArgVectors); if (dwError != ERROR_SUCCESS) { @@ -2125,7 +2035,7 @@ UnlockServiceDatabase(SC_LOCK ScLock) /* Call to services.exe using RPC */ dwError = ScmrUnlockServiceDatabase(BindingHandle, - (unsigned int)ScLock); + (SC_RPC_LOCK)ScLock); if (dwError != ERROR_SUCCESS) { ERR("ScmrUnlockServiceDatabase() failed (Error %lu)\n", dwError); @@ -2153,6 +2063,7 @@ NotifyBootConfigStatus(BOOL BootAcceptable) /* Call to services.exe using RPC */ dwError = ScmrNotifyBootConfigStatus(BindingHandle, + NULL, BootAcceptable); if (dwError != ERROR_SUCCESS) { diff --git a/reactos/include/reactos/idl/svcctl.idl b/reactos/include/reactos/idl/svcctl.idl index 840ae4143c2..a7018195ec3 100644 --- a/reactos/include/reactos/idl/svcctl.idl +++ b/reactos/include/reactos/idl/svcctl.idl @@ -2,18 +2,299 @@ * Service Control Manager (SCM) interface definition */ -//#include -//#include #include "include/reactos/idl/wtypes.idl" -#define SC_HANDLE unsigned long -#define SC_LOCK unsigned int -#define SERVICE_STATUS_HANDLE unsigned long -#define SC_STATUS_TYPE unsigned long -#define SC_ENUM_TYPE unsigned long +const unsigned int MAX_SERVICE_NAME_LENGTH = 255; +const unsigned short SC_MAX_DEPEND_SIZE = 4 * 1024; +const unsigned short SC_MAX_NAME_LENGTH = MAX_SERVICE_NAME_LENGTH + 1; +const unsigned short SC_MAX_PATH_LENGTH = 32 * 1024; +const unsigned short SC_MAX_PWD_SIZE = 514; +const unsigned short SC_MAX_COMPUTER_NAME_LENGTH = 1024; +const unsigned short SC_MAX_ACCOUNT_NAME_LENGTH = 2 * 1024; +const unsigned short SC_MAX_COMMENT_LENGTH = 128; +const unsigned short SC_MAX_ARGUMENT_LENGTH = 1024; +const unsigned short SC_MAX_ARGUMENTS = 1024; #define R(fn) Scmr ## fn +typedef unsigned long SECURITY_INFORMATION; +typedef [handle] LPSTR SVCCTL_HANDLEA; +typedef [handle] LPWSTR SVCCTL_HANDLEW; +typedef [context_handle] unsigned long SC_RPC_HANDLE; +typedef SC_RPC_HANDLE* LPSC_RPC_HANDLE; +typedef [context_handle] PVOID SC_RPC_LOCK; +typedef SC_RPC_LOCK* LPSC_RPC_LOCK; +typedef [context_handle] unsigned long SC_NOTIFY_RPC_HANDLE; +typedef SC_NOTIFY_RPC_HANDLE* LPSC_NOTIFY_RPC_HANDLE; +typedef [range(0, 1024 * 4)] DWORD BOUNDED_DWORD_4K; +typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_4K; +typedef [range(0, 1024 * 8)] DWORD BOUNDED_DWORD_8K; +typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_8K; +typedef [range(0, 1024 * 256)] DWORD BOUNDED_DWORD_256K; +typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_256K; + +cpp_quote("#if 0") + +typedef struct _SERVICE_STATUS { + DWORD dwServiceType; + DWORD dwCurrentState; + DWORD dwControlsAccepted; + DWORD dwWin32ExitCode; + DWORD dwServiceSpecificExitCode; + DWORD dwCheckPoint; + DWORD dwWaitHint; +} SERVICE_STATUS, *LPSERVICE_STATUS; + +typedef struct _SERVICE_STATUS_PROCESS { + DWORD dwServiceType; + DWORD dwCurrentState; + DWORD dwControlsAccepted; + DWORD dwWin32ExitCode; + DWORD dwServiceSpecificExitCode; + DWORD dwCheckPoint; + DWORD dwWaitHint; + DWORD dwProcessId; + DWORD dwServiceFlags; +} SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS; + +typedef struct _ENUM_SERVICE_STATUSA { + [string, range(0, 8 * 1024)] LPSTR lpServiceName; + [string, range(0, 8 * 1024)] LPSTR lpDisplayName; + SERVICE_STATUS ServiceStatus; +} ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA; + +typedef struct _ENUM_SERVICE_STATUSW { + [string, range(0, 8 * 1024)] LPWSTR lpServiceName; + [string, range(0, 8 * 1024)] LPWSTR lpDisplayName; + SERVICE_STATUS ServiceStatus; +} ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW; + +typedef struct _ENUM_SERVICE_STATUS_PROCESSA { + [string, range(0, 8 * 1024)] LPSTR lpServiceName; + [string, range(0, 8 * 1024)] LPSTR lpDisplayName; + SERVICE_STATUS_PROCESS ServiceStatusProcess; +} ENUM_SERVICE_STATUS_PROCESSA, *LPENUM_SERVICE_STATUS_PROCESSA; + +typedef struct _ENUM_SERVICE_STATUS_PROCESSW { + [string, range(0, 8 * 1024)] LPWSTR lpServiceName; + [string, range(0, 8 * 1024)] LPWSTR lpDisplayName; + SERVICE_STATUS_PROCESS ServiceStatusProcess; +} ENUM_SERVICE_STATUS_PROCESSW, *LPENUM_SERVICE_STATUS_PROCESSW; + +typedef struct _QUERY_SERVICE_CONFIGA { + DWORD dwServiceType; + DWORD dwStartType; + DWORD dwErrorControl; + [string, range(0, 8 * 1024)] LPSTR lpBinaryPathName; + [string, range(0, 8 * 1024)] LPSTR lpLoadOrderGroup; + DWORD dwTagId; + [string, range(0, 8 * 1024)] LPSTR lpDependencies; + [string, range(0, 8 * 1024)] LPSTR lpServiceStartName; + LPSTR lpDisplayName; +} QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA; + +typedef struct _QUERY_SERVICE_CONFIGW { + DWORD dwServiceType; + DWORD dwStartType; + DWORD dwErrorControl; + [string, range(0, 8 * 1024)] LPWSTR lpBinaryPathName; + [string, range(0, 8 * 1024)] LPWSTR lpLoadOrderGroup; + DWORD dwTagId; + [string, range(0, 8 * 1024)] LPWSTR lpDependencies; + [string, range(0, 8 * 1024)] LPWSTR lpServiceStartName; + LPWSTR lpDisplayName; +} QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW; + +typedef struct _QUERY_SERVICE_LOCK_STATUSA { + DWORD fIsLocked; + [string, range(0, 8 * 1024)] LPSTR lpLockOwner; + DWORD dwLockDuration; +} QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA; + +typedef struct _QUERY_SERVICE_LOCK_STATUSW { + DWORD fIsLocked; + [string, range(0, 8 * 1024)] LPWSTR lpLockOwner; + DWORD dwLockDuration; +} QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW; + +typedef [v1_enum] enum _SC_ACTION_TYPE { + SC_ACTION_NONE = 0, + SC_ACTION_RESTART = 1, + SC_ACTION_REBOOT = 2, + SC_ACTION_RUN_COMMAND = 3, +} SC_ACTION_TYPE; + +typedef struct _SC_ACTION { + SC_ACTION_TYPE Type; + DWORD Delay; +} SC_ACTION, *LPSC_ACTION; + +typedef [v1_enum] enum _SC_ENUM_TYPE { + SC_ENUM_PROCESS_INFO = 0, +} SC_ENUM_TYPE; + +typedef struct _SERVICE_DESCRIPTIONA { + [string, range(0, 8 * 1024)] LPSTR lpDescription; +} SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA; + +typedef struct _SERVICE_DESCRIPTIONW { + [string, range(0, 8 * 1024)] LPWSTR lpDescription; +} SERVICE_DESCRIPTIONW, *LPSERVICE_DESCRIPTIONW; + +typedef struct _SERVICE_FAILURE_ACTIONSA { + DWORD dwResetPeriod; + [string, range(0, 8 * 1024)] LPSTR lpRebootMsg; + [string, range(0, 8 * 1024)] LPSTR lpCommand; + [range(0, 1024)] DWORD cActions; + [size_is(cActions)] SC_ACTION* lpsaActions; +} SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA; + +typedef struct _SERVICE_FAILURE_ACTIONSW { + DWORD dwResetPeriod; + [string, range(0, 8 * 1024)] LPWSTR lpRebootMsg; + [string, range(0, 8 * 1024)] LPWSTR lpCommand; + [range(0, 1024)] DWORD cActions; + [size_is(cActions)] SC_ACTION* lpsaActions; +} SERVICE_FAILURE_ACTIONSW, *LPSERVICE_FAILURE_ACTIONSW; + +cpp_quote("#endif") + +typedef struct _SERVICE_DELAYED_AUTO_START_INFO { + BOOL fDelayedAutoStart; +} SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO; + +typedef struct _SERVICE_FAILURE_ACTIONS_FLAG { + BOOL fFailureActionsOnNonCrashFailures; +} SERVICE_FAILURE_ACTIONS_FLAG, *LPSERVICE_FAILURE_ACTIONS_FLAG; + +typedef struct _SERVICE_SID_INFO { + DWORD dwServicesSidType; +} SERVICE_SID_INFO, *LPSERVICE_SID_INFO; + +typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO { + [range(0, 1024 * 4)] DWORD cbRequiredPrivileges; + [size_is(cbRequiredPrivileges)] PBYTE pRequiredPrivileges; +} SERVICE_RPC_REQUIRED_PRIVILEGES_INFO, *LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO; + +typedef struct _SERVICE_PRESHUTDOWN_INFO { + DWORD dwPreshutdownTimeout; +} SERVICE_PRESHUTDOWN_INFO, *LPSERVICE_PRESHUTDOWN_INFO; + +typedef struct _SC_RPC_CONFIG_INFOA { + DWORD dwInfoLevel; + [switch_is(dwInfoLevel)] union { + [case(1)] LPSERVICE_DESCRIPTIONA psd; + [case(2)] LPSERVICE_FAILURE_ACTIONSA psfa; + [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda; + [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf; + [case(5)] LPSERVICE_SID_INFO pssid; + [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp; + [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;; + }; +} SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA; + +typedef struct _SC_RPC_CONFIG_INFOW { + DWORD dwInfoLevel; + [switch_is(dwInfoLevel)] union { + [case(1)] LPSERVICE_DESCRIPTIONW psd; + [case(2)] LPSERVICE_FAILURE_ACTIONSW psfa; + [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda; + [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf; + [case(5)] LPSERVICE_SID_INFO pssid; + [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp; + [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps; + }; +} SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW; + +typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 { + ULONGLONG ullThreadId; + DWORD dwNotifyMask; + UCHAR CallbackAddressArray[16]; + UCHAR CallbackParamAddressArray[16]; + SERVICE_STATUS_PROCESS ServiceStatus; + DWORD dwNotificationStatus; + DWORD dwSequence; +} SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1; + +typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 { + ULONGLONG ullThreadId; + DWORD dwNotifyMask; + UCHAR CallbackAddressArray[16]; + UCHAR CallbackParamAddressArray[16]; + SERVICE_STATUS_PROCESS ServiceStatus; + DWORD dwNotificationStatus; + DWORD dwSequence; + DWORD dwNotificationTriggered; + [string, range(0, 64 * 1024)] PWSTR pszServiceNames; +} SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2; + +typedef struct _SC_RPC_NOTIFY_PARAMS { + DWORD dwInfoLevel; + [switch_is(dwInfoLevel)] union { + [case(1)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 pStatusChangeParam1; + [case(2)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 pStatusChangeParam2; + }; +} SC_RPC_NOTIFY_PARAMS, *LPSC_RPC_NOTIFY_PARAMS; + +typedef struct _SC_RPC_NOTIFY_PARAMS_LIST { + BOUNDED_DWORD_4K cElements; + [size_is(cElements)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray[]; +} SC_RPC_NOTIFY_PARAMS_LIST, *PSC_RPC_NOTIFY_PARAMS_LIST; + +cpp_quote("#if 0"); + +#if 0 +typedef +[switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSA { + [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA psrInParams; +} SC_RPC_SERVICE_CONTROL_IN_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSA; + +typedef +[switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSW { + [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams; +} SC_RPC_SERVICE_CONTROL_IN_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSW; + +typedef +[switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSA { + [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams; +} SC_RPC_SERVICE_CONTROL_OUT_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSA; + +typedef +[switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSW { + [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams; +} SC_RPC_SERVICE_CONTROL_OUT_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSW; +#endif + +typedef [v1_enum] enum _SC_STATUS_TYPE { + SC_STATUS_PROCESS_INFO = 0, +} SC_STATUS_TYPE; + +typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA { + DWORD dwReason; + [string, range(0, SC_MAX_COMMENT_LENGTH)] LPSTR pszComment; +} SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA; + +typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW { + DWORD dwReason; + [string, range(0, SC_MAX_COMMENT_LENGTH)] LPWSTR pszComment; +} SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW; + +typedef struct _SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS { + SERVICE_STATUS_PROCESS ServiceStatus; +} SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS, *LPSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS; + +typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS, *LPSERVICE_NOTIFY_STATUS_CHANGE_PARAMS; + +cpp_quote("#endif") + +typedef struct _STRING_PTRSA { + [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPSTR StringPtr; +} STRING_PTRSA, *PSTRING_PTRSA, *LPSTRING_PTRSA; + +typedef struct _STRING_PTRSW { + [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPWSTR StringPtr; +} STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW; + [ uuid(367abb81-9844-35f1-ad32-98f038001003), version(2.0), @@ -22,379 +303,499 @@ ] interface svcctl { -cpp_quote("#if 0") - typedef struct _SERVICE_STATUS - { - DWORD dwServiceType; - DWORD dwCurrentState; - DWORD dwControlsAccepted; - DWORD dwWin32ExitCode; - DWORD dwServiceSpecificExitCode; - DWORD dwCheckPoint; - DWORD dwWaitHint; - } SERVICE_STATUS, *LPSERVICE_STATUS; -cpp_quote("#endif") + /* Function 0 */ + DWORD R(CloseServiceHandle) ( + [in] handle_t BindingHandle, + [in, out] LPSC_RPC_HANDLE hSCObject); - /* Function 0 */ - DWORD R(CloseServiceHandle) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCObject); + /* Function 1 */ + DWORD R(ControlService) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwControl, + [out] LPSERVICE_STATUS lpServiceStatus); - /* Function 1 */ - DWORD R(ControlService) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwControl, - [out] SERVICE_STATUS *lpServiceStatus); -/* [out] LPSERVICE_STATUS lpServiceStatus); */ + /* Function 2 */ + DWORD R(DeleteService) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService); - /* Function 2 */ - DWORD R(DeleteService) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService); + /* Function 3 */ + DWORD R(LockServiceDatabase) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [out] LPSC_RPC_LOCK lpLock); - /* Function 3 */ - DWORD R(LockServiceDatabase) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [out] SC_LOCK *hLock); + /* Function 4 */ + DWORD R(QueryServiceObjectSecurity) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] SECURITY_INFORMATION dwSecurityInformation, + [out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor, + [in, range(0, 1024 * 256)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded); - /* Function 4 */ - DWORD R(QueryServiceObjectSecurity) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwSecurityInformation, - [out, size_is(dwSecuityDescriptorSize)] unsigned char *lpSecurityDescriptor, - [in] DWORD dwSecuityDescriptorSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 5 */ + DWORD R(SetServiceObjectSecurity) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwSecurityInformation, + [in, size_is(dwSecuityDescriptorSize)] LPBYTE lpSecurityDescriptor, + [in] DWORD dwSecuityDescriptorSize); - /* Function 5 */ - DWORD R(SetServiceObjectSecurity) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwSecurityInformation, - [in, size_is(dwSecuityDescriptorSize)] unsigned char *lpSecurityDescriptor, - [in] DWORD dwSecuityDescriptorSize); + /* Function 6 */ + DWORD R(QueryServiceStatus) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [out] LPSERVICE_STATUS lpServiceStatus); - /* Function 6 */ - DWORD R(QueryServiceStatus) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [out] SERVICE_STATUS *lpServiceStatus); -/* [out] LPSERVICE_STATUS lpServiceStatus); */ + /* Function 7 */ + DWORD R(SetServiceStatus) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hServiceStatus, + [in] LPSERVICE_STATUS lpServiceStatus); - /* Function 7 */ - DWORD R(SetServiceStatus) ([in] handle_t BindingHandle, - [in] SERVICE_STATUS_HANDLE hServiceStatus, - [in] SERVICE_STATUS *lpServiceStatus); + /* Function 8 */ + DWORD R(UnlockServiceDatabase) ( + [in] handle_t BindingHandle, + [in, out] LPSC_RPC_LOCK Lock); - /* Function 8 */ - DWORD R(UnlockServiceDatabase) ([in] handle_t BindingHandle, - [in] SC_LOCK hLock); + /* Function 9 */ + DWORD R(NotifyBootConfigStatus) ( + [in] handle_t BindingHandle, + [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName, + [in] DWORD BootAcceptable); - /* Function 9 */ - DWORD R(NotifyBootConfigStatus) ([in] handle_t BindingHandle, - [in] BOOL BootAcceptable); + /* Function 10 */ + DWORD R(SetServiceBitsW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hServiceStatus, + [in] DWORD dwServiceBits, + [in] BOOL bSetBitsOn, + [in] BOOL bUpdateImmediately, + [in, string, unique] LPWSTR lpString); - /* Function 10 */ - DWORD R(SetServiceBitsW) ([in] handle_t BindingHandle, - [in] SERVICE_STATUS_HANDLE hServiceStatus, - [in] DWORD dwServiceBits, - [in] BOOL bSetBitsOn, - [in] BOOL bUpdateImmediately, - [in, string, unique] LPWSTR lpString); + /* Function 11 */ + DWORD R(ChangeServiceConfigW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName, + [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, + [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, + [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName, + [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, + [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName); - /* Function 11 */ - DWORD R(ChangeServiceConfigW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in] DWORD dwServiceType, - [in] DWORD dwStartType, - [in] DWORD dwErrorControl, - [in, string, unique] LPCWSTR lpBinaryPathName, - [in, string, unique] LPCWSTR lpLoadOrderGroup, - [in, out, unique] LPDWORD lpdwTagId, - [in, size_is(dwDependenciesLength), unique] LPCWSTR lpDependencies, - [in] DWORD dwDependenciesLength, - [in, string, unique] LPCWSTR lpServiceStartName, - [in, size_is(dwPasswordLength), unique] LPCWSTR lpPassword, - [in] DWORD dwPasswordLength, - [in, string, unique] LPCWSTR lpDisplayName); + /* Function 12 */ + DWORD R(CreateServiceW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName, + [in] DWORD dwDesiredAccess, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, + [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, + [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName, + [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, + [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, + [out] LPSC_RPC_HANDLE lpServiceHandle); - /* Function 12 */ - DWORD R(CreateServiceW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string, ref] LPCWSTR lpServiceName, - [in, string, unique] LPCWSTR lpDisplayName, - [in] DWORD dwDesiredAccess, - [in] DWORD dwServiceType, - [in] DWORD dwStartType, - [in] DWORD dwErrorControl, - [in, string, ref] LPCWSTR lpBinaryPathName, - [in, string, unique] LPCWSTR lpLoadOrderGroup, - [in, out, unique] LPDWORD lpdwTagId, - [in, size_is(dwDependenciesLength), unique] LPCWSTR lpDependencies, - [in] DWORD dwDependenciesLength, - [in, string, unique] LPCWSTR lpServiceStartName, - [in, size_is(dwPasswordLength), unique] LPCWSTR lpPassword, - [in] DWORD dwPasswordLength, - [out] SC_HANDLE *hService); + /* Function 13 */ + DWORD R(EnumDependentServicesW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwServiceState, + [out, size_is(cbBufSize)] LPBYTE lpServices, + [in, range(0, 1024*256)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned); - /* Function 13 */ - DWORD R(EnumDependentServicesW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwServiceState, - [out, unique, size_is(cbBufSize)] LPBYTE lpServices, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded, - [out] LPDWORD lpServicesReturned); + /* Function 14 */ + DWORD R(EnumServicesStatusW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in] DWORD dwServiceType, + [in] DWORD dwServiceState, + [out, size_is(dwBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024*256)] DWORD dwBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned, + [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle); - /* Function 14 */ - DWORD R(EnumServicesStatusW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in] DWORD dwServiceType, - [in] DWORD dwServiceState, - [out, unique, size_is(dwBufSize)] LPBYTE lpServices, - [in] DWORD dwBufSize, - [out] LPDWORD pcbBytesNeeded, - [out] LPDWORD lpServicesReturned, - [in, out, unique] LPDWORD lpResumeHandle); + /* Function 15 */ + DWORD R(OpenSCManagerW) ( + [in] handle_t BindingHandle, + [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] LPWSTR lpMachineName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDatabaseName, + [in] DWORD dwDesiredAccess, + [out] LPSC_RPC_HANDLE lpScHandle); - /* Function 15 */ - DWORD R(OpenSCManagerW) ([in] handle_t BindingHandle, - [in, string, unique] LPCWSTR lpMachineName, - [in, string, unique] LPCWSTR lpDatabaseName, - [in] DWORD dwDesiredAccess, - [out] SC_HANDLE *hScm); + /* Function 16 */ + DWORD R(OpenServiceW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName, + [in] DWORD dwDesiredAccess, + [out] LPSC_RPC_HANDLE lpServiceHandle); - /* Function 16 */ - DWORD R(OpenServiceW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string] LPCWSTR lpServiceName, - [in] DWORD dwDesiredAccess, - [out] SC_HANDLE *hScm); + /* Function 17 */ + DWORD R(QueryServiceConfigW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig, + /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, */ + [in, range(0, 1024*8)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_8K pcbBytesNeeded); - /* Function 17 */ - DWORD R(QueryServiceConfigW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 18 */ + DWORD R(QueryServiceLockStatusW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus, + [in, range(0, 1024*4)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_4K pcbBytesNeeded); - /* Function 18 */ - DWORD R(QueryServiceLockStatusW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 19 */ + DWORD R(StartServiceW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc, + [in, unique, size_is(argc)] LPSTRING_PTRSW argv); - /* Function 19 */ - DWORD R(StartServiceW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwNumServiceArgs, - [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer, - [in] DWORD cbBufSize); + /* Function 20 */ + DWORD R(GetServiceDisplayNameW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName, + [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpDisplayName, + [in, out] DWORD* lpcchBuffer); - /* FIXME: This is the correct interface but WIDL doesn't support it yet! */ -// DWORD R(StartServiceW) ([in] handle_t BindingHandle, -// [in] SC_HANDLE hService, -// [in] DWORD dwNumServiceArgs, -// [in, string, size_is(dwNumServiceArgs, ), unique] LPWSTR *lpServiceArgVectors); + /* Function 21 */ + DWORD R(GetServiceKeyNameW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName, + [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpServiceName, + [in, out] DWORD* lpcchBuffer); - /* Function 20 */ - DWORD R(GetServiceDisplayNameW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string, ref] LPCWSTR lpServiceName, - [out, size_is(*lpcchBuffer), unique] LPWSTR lpDisplayName, - [in, out, ref] LPDWORD lpcchBuffer); + /* Function 22 */ + DWORD R(SetServiceBitsA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hServiceStatus, + [in] DWORD dwServiceBits, + [in] BOOL bSetBitsOn, + [in] BOOL bUpdateImmediately, + [in, string, unique] LPSTR lpString); - /* Function 21 */ - DWORD R(GetServiceKeyNameW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string, ref] LPCWSTR lpDisplayName, - [out, size_is(*lpcchBuffer), unique] LPWSTR lpServiceName, - [in, out, ref] LPDWORD lpcchBuffer); + /* Function 23 */ + DWORD R(ChangeServiceConfigA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, unique, size_is(dwDependSize)] LPSTR lpDependencies, + [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, + [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName, + [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, + [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName); - /* Function 22 */ - DWORD R(SetServiceBitsA) ([in] handle_t BindingHandle, - [in] SERVICE_STATUS_HANDLE hServiceStatus, - [in] DWORD dwServiceBits, - [in] BOOL bSetBitsOn, - [in] BOOL bUpdateImmediately, - [in, string, unique] LPSTR lpString); + /* Function 24 */ + DWORD R(CreateServiceA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName, + [in] DWORD dwDesiredAccess, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, + [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, + [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName, + [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, + [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, + [out] LPSC_RPC_HANDLE lpServiceHandle); - /* Function 23 */ - DWORD R(ChangeServiceConfigA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in] DWORD dwServiceType, - [in] DWORD dwStartType, - [in] DWORD dwErrorControl, - [in, string, unique] LPCSTR lpBinaryPathName, - [in, string, unique] LPCSTR lpLoadOrderGroup, - [in, out, unique] LPDWORD lpdwTagId, - [in, size_is(dwDependenciesLength), unique] LPCSTR lpDependencies, - [in] DWORD dwDependenciesLength, - [in, string, unique] LPCSTR lpServiceStartName, - [in, size_is(dwPasswordLength), unique] LPCSTR lpPassword, - [in] DWORD dwPasswordLength, - [in, string, unique] LPCSTR lpDisplayName); + /* Function 25 */ + DWORD R(EnumDependentServicesA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwServiceState, + [out, size_is(cbBufSize)] LPBYTE lpServices, + [in, range(0, 1024*256)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned); - /* Function 24 */ - DWORD R(CreateServiceA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string, ref] LPCSTR lpServiceName, - [in, string, unique] LPCSTR lpDisplayName, - [in] DWORD dwDesiredAccess, - [in] DWORD dwServiceType, - [in] DWORD dwStartType, - [in] DWORD dwErrorControl, - [in, string, ref] LPCSTR lpBinaryPathName, - [in, string, unique] LPCSTR lpLoadOrderGroup, - [in, out, unique] LPDWORD lpdwTagId, - [in, size_is(dwDependenciesLength), unique] LPCSTR lpDependencies, - [in] DWORD dwDependenciesLength, - [in, string, unique] LPCSTR lpServiceStartName, - [in, size_is(dwPasswordLength), unique] LPCSTR lpPassword, - [in] DWORD dwPasswordLength, - [out] SC_HANDLE *hService); + /* Function 26 */ + DWORD R(EnumServicesStatusA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in] DWORD dwServiceType, + [in] DWORD dwServiceState, + [out, size_is(dwBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024*256)] DWORD dwBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned, + [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle); - /* Function 25 */ - DWORD R(EnumDependentServicesA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwServiceState, - [out, unique, size_is(cbBufSize)] LPBYTE lpServices, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded, - [out] LPDWORD lpServicesReturned); + /* Function 27 */ + DWORD R(OpenSCManagerA) ( + [in] handle_t BindingHandle, + [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] LPSTR lpMachineName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDatabaseName, + [in] DWORD dwDesiredAccess, + [out] LPSC_RPC_HANDLE lpScHandle); - /* Function 26 */ - DWORD R(EnumServicesStatusA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in] DWORD dwServiceType, - [in] DWORD dwServiceState, - [out, unique, size_is(dwBufSize)] LPBYTE lpServices, - [in] DWORD dwBufSize, - [out] LPDWORD pcbBytesNeeded, - [out] LPDWORD lpServicesReturned, - [in, out, unique] SC_HANDLE *lpResumeHandle); + /* Function 28 */ + DWORD R(OpenServiceA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName, + [in] DWORD dwDesiredAccess, + [out] LPSC_RPC_HANDLE lpServiceHandle); - /* Function 27 */ - DWORD R(OpenSCManagerA) ([in] handle_t BindingHandle, - [in, string, unique] LPCSTR lpMachineName, - [in, string, unique] LPCSTR lpDatabaseName, - [in] DWORD dwDesiredAccess, - [out] SC_HANDLE *hScm); + /* Function 29 */ + DWORD R(QueryServiceConfigA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, + [in, range(0, 1024*8)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_8K pcbBytesNeeded); - /* Function 28 */ - DWORD R(OpenServiceA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string] LPCSTR lpServiceName, - [in] DWORD dwDesiredAccess, - [out] SC_HANDLE *hScm); + /* Function 30 */ + DWORD R(QueryServiceLockStatusA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [out] LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus, + [in, range(0, 1024*4)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_4K pcbBytesNeeded); - /* Function 29 */ - DWORD R(QueryServiceConfigA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 31 */ + DWORD R(StartServiceA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc, + [in, unique, size_is(argc)] LPSTRING_PTRSA argv); - /* Function 30 */ - DWORD R(QueryServiceLockStatusA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 32 */ + DWORD R(GetServiceDisplayNameA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName, + [out, string, size_is(*lpcchBuffer)] LPSTR lpDisplayName, + [in, out] LPBOUNDED_DWORD_4K lpcchBuffer); - /* Function 31 */ - DWORD R(StartServiceA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwNumServiceArgs, - [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer, - [in] DWORD cbBufSize); + /* Function 33 */ + DWORD R(GetServiceKeyNameA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName, + [out, string, size_is(*lpcchBuffer)] LPSTR lpKeyName, + [in, out] LPBOUNDED_DWORD_4K lpcchBuffer); - /* FIXME: This is the correct interface but WIDL doesn't support it yet! */ -// DWORD R(StartServiceA) ([in] handle_t BindingHandle, -// [in] SC_HANDLE hService, -// [in] DWORD dwNumServiceArgs, -// [in, unique, string, size_is(dwNumServiceArgs, )] LPSTR *lpServiceArgVectors); + /* Function 34 */ + DWORD R(GetCurrentGroupStateW) ( + [in] handle_t BindingHandle); /* FIXME */ - /* Function 32 */ - DWORD R(GetServiceDisplayNameA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string, ref] LPCSTR lpServiceName, - [out, unique, size_is(*lpcchBuffer)] LPSTR lpDisplayName, - [in, out, ref] LPDWORD lpcchBuffer); + /* Function 35 */ + DWORD R(EnumServiceGroupW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in] DWORD dwServiceType, + [in] DWORD dwServiceState, + [out, size_is(cbBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024*256)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned, + [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName); - /* Function 33 */ - DWORD R(GetServiceKeyNameA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hSCManager, - [in, string, ref] LPCSTR lpDisplayName, - [out, unique, size_is(*lpcchBuffer)] LPSTR lpServiceName, - [in, out, ref] LPDWORD lpcchBuffer); + /* Function 36 */ + DWORD R(ChangeServiceConfig2A) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] SC_RPC_CONFIG_INFOA Info); - /* Function 34 */ - DWORD R(GetCurrentGroupStateW) ([in] handle_t BindingHandle); /* FIXME */ + /* Function 37 */ + DWORD R(ChangeServiceConfig2W) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] SC_RPC_CONFIG_INFOW Info); - /* Function 35 */ - DWORD R(EnumServiceGroupW) ([in] handle_t BindingHandle); /* FIXME */ + /* Function 38 */ + DWORD R(QueryServiceConfig2A) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwInfoLevel, + [out, size_is(cbBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024*8)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_8K pcbBytesNeeded); - /* Function 36 */ - DWORD R(ChangeServiceConfig2A) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwInfoLevel, - [in, size_is(dwInfoSize)] LPBYTE lpInfo, - [in] DWORD dwInfoSize); + /* Function 39 */ + DWORD R(QueryServiceConfig2W) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwInfoLevel, + [out, size_is(cbBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024*8)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_8K pcbBytesNeeded); - /* Function 37 */ - DWORD R(ChangeServiceConfig2W) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwInfoLevel, - [in, size_is(dwInfoSize)] LPBYTE lpInfo, - [in] DWORD dwInfoSize); + /* Function 40 */ + DWORD R(QueryServiceStatusEx) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] SC_STATUS_TYPE InfoLevel, + [out, size_is(cbBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024*8)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_8K pcbBytesNeeded); - /* Function 38 */ - DWORD R(QueryServiceConfig2A) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwInfoLevel, - [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 41 */ + DWORD R(EnumServicesStatusExA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in] SC_ENUM_TYPE InfoLevel, + [in] DWORD dwServiceType, + [in] DWORD dwServiceState, + [out, size_is(cbBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024 * 256)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned, + [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCSTR pszGroupName); - /* Function 39 */ - DWORD R(QueryServiceConfig2W) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] DWORD dwInfoLevel, - [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 42 */ + DWORD R(EnumServicesStatusExW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hSCManager, + [in] SC_ENUM_TYPE InfoLevel, + [in] DWORD dwServiceType, + [in] DWORD dwServiceState, + [out, size_is(cbBufSize)] LPBYTE lpBuffer, + [in, range(0, 1024 * 256)] DWORD cbBufSize, + [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, + [out] LPBOUNDED_DWORD_256K lpServicesReturned, + [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName); - /* Function 40 */ - DWORD R(QueryServiceStatusEx) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] SC_STATUS_TYPE InfoLevel, - [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded); + /* Function 43 */ + DWORD R(SendTSMessage) ( + [in] handle_t BindingHandle); /* FIXME */ - /* Function 41 */ - DWORD R(EnumServicesStatusExA) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] SC_ENUM_TYPE InfoLevel, - [in] DWORD dwServiceType, - [in] DWORD dwServiceState, - [out, unique, size_is(cbBufSize)] LPBYTE lpServices, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded, - [out] LPDWORD lpServicesReturned, - [in, out, unique] SC_HANDLE *lpResumeHandle, - [in, string, unique] LPCSTR pszGroupName); + /* Function 44 */ + DWORD R(CreateServiceWOW64A) ( + [in] handle_t BindingHandle, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName, + [in] DWORD dwDesiredAccess, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, + [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, + [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName, + [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, + [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, + [out] LPSC_RPC_HANDLE lpServiceHandle); - /* Function 42 */ - DWORD R(EnumServicesStatusExW) ([in] handle_t BindingHandle, - [in] SC_HANDLE hService, - [in] SC_ENUM_TYPE InfoLevel, - [in] DWORD dwServiceType, - [in] DWORD dwServiceState, - [out, unique, size_is(cbBufSize)] LPBYTE lpServices, - [in] DWORD cbBufSize, - [out] LPDWORD pcbBytesNeeded, - [out] LPDWORD lpServicesReturned, - [in, out, unique] LPDWORD lpResumeHandle, - [in, string, unique] LPCWSTR pszGroupName); + /* Function 45 */ + DWORD R(CreateServiceWOW64W) ( + [in] handle_t BindingHandle, + [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName, + [in] DWORD dwDesiredAccess, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName, + [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, + [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, + [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName, + [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, + [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, + [out] LPSC_RPC_HANDLE lpServiceHandle); - /* Function 43 */ - /* R(SendTSMessage) */ + /* Function 46 */ + DWORD R(Function46) ( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 47 */ + DWORD R(NotifyServiceStatusChange) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] SC_RPC_NOTIFY_PARAMS NotifyParams, + [in] GUID* pClientProcessGuid, + [out] GUID* pSCMProcessGuid, + [out] PBOOL pfCreateRemoteQueue, + [out] LPSC_NOTIFY_RPC_HANDLE phNotify); + + /* Function 48 */ + DWORD R(GetNotifyResults) ( + [in] handle_t BindingHandle, + [in] SC_NOTIFY_RPC_HANDLE hNotify, + [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams); + + /* Function 49 */ + DWORD R(CloseNotifyHandle) ( + [in] handle_t BindingHandle, + [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify, + [out] PBOOL pfApcFired); + + /* Function 50 */ + DWORD R(ControlServiceExA) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwControl, + [in] DWORD dwInfoLevel/*, + [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlInParams, + [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlOutParams*/); + + /* Function 51 */ + DWORD R(ControlServiceExW) ( + [in] handle_t BindingHandle, + [in] SC_RPC_HANDLE hService, + [in] DWORD dwControl, + [in] DWORD dwInfoLevel/*, + [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlInParams, + [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlOutParams*/); + + /* Function 52 */ + DWORD R(Function52) ( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 53 */ + DWORD R(Function53) ( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 54 */ + DWORD R(Function54) ( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 55 */ + DWORD R(Function55) ( + [in] handle_t BindingHandle); /* FIXME */ } diff --git a/reactos/include/reactos/idl/wtypes.idl b/reactos/include/reactos/idl/wtypes.idl index e0d2216f6ce..1be9c303ba9 100644 --- a/reactos/include/reactos/idl/wtypes.idl +++ b/reactos/include/reactos/idl/wtypes.idl @@ -1,14 +1,26 @@ #define BYTE unsigned char +#define UCHAR unsigned char #define WORD unsigned short -#define DWORD unsigned long -#define ULONG unsigned long + #define BOOL int -#define LPSTR char* -#define LPCSTR char* -#define LPWSTR wchar_t* -#define LPCWSTR wchar_t* -#define LPBYTE unsigned char* -#define LPDWORD unsigned long* -#define PBOOL unsigned long* +typedef wchar_t WCHAR; +typedef char CHAR; + +typedef void *PVOID; +typedef BOOL *PBOOL; +typedef unsigned char *LPBYTE; +typedef unsigned long DWORD, *LPDWORD; +typedef CHAR *LPSTR; +typedef WCHAR *LPWSTR; + +#define LPCSTR LPSTR +#define LPCWSTR LPWSTR +#define ULONG unsigned long +#define PBYTE unsigned char* +#define PWSTR wchar_t* #define NTSTATUS long +cpp_quote("#if 0") +typedef int GUID; +typedef unsigned long ULONGLONG; +cpp_quote("#endif")