QueryServiceObjectSecurity function advapi32
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);
}