QueryServiceObjectSecurity function advapi32

Win32Result<bool> QueryServiceObjectSecurity(
  1. SC_HANDLE hService,
  2. int dwSecurityInformation,
  3. PSECURITY_DESCRIPTOR? lpSecurityDescriptor,
  4. int cbBufSize,
  5. Pointer<Uint32> pcbBytesNeeded,
)

Retrieves a copy of the security descriptor associated with a service object.

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

Implementation

Win32Result<bool> QueryServiceObjectSecurity(
  SC_HANDLE hService,
  int dwSecurityInformation,
  PSECURITY_DESCRIPTOR? lpSecurityDescriptor,
  int cbBufSize,
  Pointer<Uint32> pcbBytesNeeded,
) {
  final result_ = QueryServiceObjectSecurity_Wrapper(
    hService,
    dwSecurityInformation,
    lpSecurityDescriptor ?? nullptr,
    cbBufSize,
    pcbBytesNeeded,
  );
  return .new(value: result_.value.i32 != FALSE, error: result_.error);
}