SetKernelObjectSecurity function

The SetKernelObjectSecurity function sets the security of a kernel object. For example, this can be a process, thread, or event.

Note  This function should not be used when setting a security descriptor on file system objects. Instead, use the SetSecurityInfo or SetNamedSecurityInfo functions.

 

Syntax

BOOL SetKernelObjectSecurity(
  HANDLE               Handle,
  SECURITY_INFORMATION SecurityInformation,
  PSECURITY_DESCRIPTOR SecurityDescriptor
);

Parameters

Handle

A handle to a kernel object for which security information is set.

SecurityInformation

A set of bit flags that indicate the type of security information to set. This parameter can be a combination of the SECURITY_INFORMATION bit flags.

SecurityDescriptor

A pointer to a SECURITY_DESCRIPTOR structure that contains the new security information.

Return Value

If the function succeeds, the function returns nonzero.

If the function fails, it returns zero. To get extended error information, call GetLastError.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header securitybaseapi.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See Also

GetKernelObjectSecurity

Low-level Access Control

Low-level Access Control Functions

SECURITY_DESCRIPTOR

SECURITY_INFORMATION

SetFileSecurity

SetPrivateObjectSecurity

SetUserObjectSecurity