#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
);
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
);
View code on GitHubAdjusts various information common to all types of kernel handles.
Handle - a handle to set information on. The handle does not need to grant any specific access.ObjectInformationClass - the type of information to set.ObjectInformation - a pointer to the buffer with the data specific to the request.ObjectInformationLength - the size of the provided buffer in bytes.For the list of supported information classes, see OBJECT_INFORMATION_CLASS.
Open handle to any NT object.
See NtQueryObject for detailed description of possible information classes.
Buffer with data to set.
Length of ObjectInformation buffer, in bytes.
Currently only one class in allowed in set mode: ObjectDataInformation. See description of OBJECT_DATA_INFORMATION structure.
NtQueryObjectOBJECT_DATA_INFORMATION