EnumServicesStatus function advapi32
Win32Result<bool>
EnumServicesStatus(
- SC_HANDLE hSCManager,
- ENUM_SERVICE_TYPE dwServiceType,
- ENUM_SERVICE_STATE dwServiceState,
- Pointer<
ENUM_SERVICE_STATUS> ? lpServices, - int cbBufSize,
- Pointer<
Uint32> pcbBytesNeeded, - Pointer<
Uint32> lpServicesReturned, - Pointer<
Uint32> ? lpResumeHandle,
Enumerates services in the specified service control manager database.
The name and status of each service are provided.
To learn more, see learn.microsoft.com/windows/win32/api/winsvc/nf-winsvc-enumservicesstatusw.
Implementation
Win32Result<bool> EnumServicesStatus(
SC_HANDLE hSCManager,
ENUM_SERVICE_TYPE dwServiceType,
ENUM_SERVICE_STATE dwServiceState,
Pointer<ENUM_SERVICE_STATUS>? lpServices,
int cbBufSize,
Pointer<Uint32> pcbBytesNeeded,
Pointer<Uint32> lpServicesReturned,
Pointer<Uint32>? lpResumeHandle,
) {
final result_ = EnumServicesStatusW_Wrapper(
hSCManager,
dwServiceType,
dwServiceState,
lpServices ?? nullptr,
cbBufSize,
pcbBytesNeeded,
lpServicesReturned,
lpResumeHandle ?? nullptr,
);
return .new(value: result_.value.i32 != FALSE, error: result_.error);
}