NtSetSecurityObject - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTOBAPI_H
// Objects, handles
#if (PHNT_MODE != PHNT_MODE_KERNEL)

NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetSecurityObject(
    _In_ HANDLE Handle,
    _In_ SECURITY_INFORMATION SecurityInformation,
    _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetSecurityObject(
    _In_ HANDLE Handle,
    _In_ SECURITY_INFORMATION SecurityInformation,
    _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
    );

#endif

View code on GitHub

This function is documented in Windows Driver Kit here and here.


Function NtSetSecurityDescriptor writes object's Security Descriptor.

ObjectHandle

HANDLE to object of any type. Must be opened with WRITE_DAC or WRITE_OWNER access depending on SecurityInformationClass parameter.

SecurityInformationClass

See NtQuerySecurityObject for possible values.

DescriptorBuffer

Pointer to user's allocated SECURITY_DESCRIPTOR to set.

Documented by

See also