SetServiceObjectSecurity function advapi32
Win32Result<bool>
SetServiceObjectSecurity(
- SC_HANDLE hService,
- OBJECT_SECURITY_INFORMATION dwSecurityInformation,
- PSECURITY_DESCRIPTOR lpSecurityDescriptor
Sets the security descriptor of a service object.
To learn more, see learn.microsoft.com/windows/win32/api/winsvc/nf-winsvc-setserviceobjectsecurity.
Implementation
Win32Result<bool> SetServiceObjectSecurity(
SC_HANDLE hService,
OBJECT_SECURITY_INFORMATION dwSecurityInformation,
PSECURITY_DESCRIPTOR lpSecurityDescriptor,
) {
resolveGetLastError();
final result_ = _SetServiceObjectSecurity(
hService,
dwSecurityInformation,
lpSecurityDescriptor,
);
return .new(value: result_ != FALSE, error: GetLastError());
}