ChangeServiceConfig2 function advapi32

Win32Result<bool> ChangeServiceConfig2(
  1. SC_HANDLE hService,
  2. SERVICE_CONFIG dwInfoLevel,
  3. Pointer<NativeType>? lpInfo
)

Changes the optional configuration parameters of a service.

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

Implementation

Win32Result<bool> ChangeServiceConfig2(
  SC_HANDLE hService,
  SERVICE_CONFIG dwInfoLevel,
  Pointer? lpInfo,
) {
  final result_ = ChangeServiceConfig2W_Wrapper(
    hService,
    dwInfoLevel,
    lpInfo ?? nullptr,
  );
  return .new(value: result_.value.i32 != FALSE, error: result_.error);
}