StartServiceCtrlDispatcher function advapi32

Win32Result<bool> StartServiceCtrlDispatcher(
  1. Pointer<SERVICE_TABLE_ENTRY> lpServiceStartTable
)

Connects the main thread of a service process to the service control manager, which causes the thread to be the service control dispatcher thread for the calling process.

To learn more, see learn.microsoft.com/windows/win32/api/winsvc/nf-winsvc-startservicectrldispatcherw.

Implementation

Win32Result<bool> StartServiceCtrlDispatcher(
  Pointer<SERVICE_TABLE_ENTRY> lpServiceStartTable,
) {
  resolveGetLastError();
  final result_ = _StartServiceCtrlDispatcher(lpServiceStartTable);
  return .new(value: result_ != FALSE, error: GetLastError());
}