#ifndef _NTOBAPI_H
//
// Objects, handles
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)
/**
 * The NtMakePermanentObject routine changes the attributes of an object to make it permanent.
 *
 * @param Handle Handle to an object of any type.
 * @return NTSTATUS Successful or errant status.
 * @sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwmaketemporaryobject
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtMakePermanentObject(
    _In_ HANDLE Handle
    );
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwMakePermanentObject(
    _In_ HANDLE Handle
    );
View code on GitHubMarks an object as permanent, extending its lifetime past the last closed handle. Calling this function requires having SeCreatePermanentPrivilege enabled. To undo the operation, use NtMakeTemporaryObject.
Handle - a handle to a kernel object. The handle does not need to grant any specific access.To make new objects have permanent state from their creation, include OBJ_PERMANENT in OBJECT_ATTRIBUTES.