NtSetInformationObject - 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)

/**
 * The NtSetInformationObject routine changes various kinds of information about an object.
 *
 * \param Handle The handle of the object for which information is being changed.
 * \param ObjectInformationClass The type of information, supplied in the buffer pointed to by ObjectInformation, to set for the object.
 * \param ObjectInformation Pointer to the class-specific input. Ignored for ObjectSessionInformation and ObjectSessionObjectInformation.
 * \param ObjectInformationLength The input size in bytes. Exactly 2 for ObjectHandleFlagInformation; ignored for the session classes.
 * \return NTSTATUS Successful or errant status.
 * \remarks ObjectHandleFlagInformation changes this handle, not the object or other handles.
 * Nonzero BOOLEAN values request TRUE. Query again if the object type forbids inheritance:
 * ObSetHandleAttributes can return success without applying either requested flag.
 * For the two session classes, pass NULL/0; neither buffer argument is consumed.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetInformationObject(
    _In_ HANDLE Handle,
    _In_ OBJECT_INFORMATION_CLASS ObjectInformationClass,
    _When_(ObjectInformationClass == ObjectSessionInformation || ObjectInformationClass == ObjectSessionObjectInformation, _In_opt_)
    _When_(ObjectInformationClass != ObjectSessionInformation && ObjectInformationClass != ObjectSessionObjectInformation, _In_reads_bytes_(ObjectInformationLength)) PVOID ObjectInformation,
    _In_ ULONG ObjectInformationLength
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetInformationObject(
    _In_ HANDLE Handle,
    _In_ OBJECT_INFORMATION_CLASS ObjectInformationClass,
    _When_(ObjectInformationClass == ObjectSessionInformation || ObjectInformationClass == ObjectSessionObjectInformation, _In_opt_)
    _When_(ObjectInformationClass != ObjectSessionInformation && ObjectInformationClass != ObjectSessionObjectInformation, _In_reads_bytes_(ObjectInformationLength)) PVOID ObjectInformation,
    _In_ ULONG ObjectInformationLength
    );

#endif

View code on GitHub

NtDoc

Adjusts various information common to all types of kernel handles.

Parameters

Information classes

For the list of supported information classes, see OBJECT_INFORMATION_CLASS.

Related Win32 API

See also

NTinternals.net (undocumented.ntinternals.net)

ObjectHandle

Open handle to any NT object.

ObjectInformationClass

See NtQueryObject for detailed description of possible information classes.

ObjectInformation

Buffer with data to set.

Length

Length of ObjectInformation buffer, in bytes.


Currently only one class in allowed in set mode: ObjectDataInformation. See description of OBJECT_DATA_INFORMATION structure.

Documented by

See also