NtMakePermanentObject - 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 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
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwMakePermanentObject(
    _In_ HANDLE Handle
    );

#endif

View code on GitHub

Marks 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.

Parameters

Remarks

To make new objects have permanent state from their creation, include OBJ_PERMANENT in OBJECT_ATTRIBUTES.

See also