EnumServicesStatusEx function advapi32

int EnumServicesStatusEx(
  1. int hSCManager,
  2. int InfoLevel,
  3. int dwServiceType,
  4. int dwServiceState,
  5. Pointer<Uint8> lpServices,
  6. int cbBufSize,
  7. Pointer<Uint32> pcbBytesNeeded,
  8. Pointer<Uint32> lpServicesReturned,
  9. Pointer<Uint32> lpResumeHandle,
  10. Pointer<Utf16> pszGroupName,
)

Enumerates services in the specified service control manager database. The name and status of each service are provided, along with additional data based on the specified information level.

BOOL EnumServicesStatusExW(
  [in]                SC_HANDLE    hSCManager,
  [in]                SC_ENUM_TYPE InfoLevel,
  [in]                DWORD        dwServiceType,
  [in]                DWORD        dwServiceState,
  [out, optional]     LPBYTE       lpServices,
  [in]                DWORD        cbBufSize,
  [out]               LPDWORD      pcbBytesNeeded,
  [out]               LPDWORD      lpServicesReturned,
  [in, out, optional] LPDWORD      lpResumeHandle,
  [in, optional]      LPCWSTR      pszGroupName
);

Implementation

int EnumServicesStatusEx(
        int hSCManager,
        int InfoLevel,
        int dwServiceType,
        int dwServiceState,
        Pointer<Uint8> lpServices,
        int cbBufSize,
        Pointer<Uint32> pcbBytesNeeded,
        Pointer<Uint32> lpServicesReturned,
        Pointer<Uint32> lpResumeHandle,
        Pointer<Utf16> pszGroupName) =>
    _EnumServicesStatusEx(
        hSCManager,
        InfoLevel,
        dwServiceType,
        dwServiceState,
        lpServices,
        cbBufSize,
        pcbBytesNeeded,
        lpServicesReturned,
        lpResumeHandle,
        pszGroupName);