#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
/**
* This flag only applies to objects that are named within the object manager.
* By default such objects are deleted when all open handles to them are closed.
* If this flag is specified, the object is not deleted when all open handles are closed.
* The NtMakeTemporaryObject function can be used to delete permanent objects.
*/
#define OBJ_PERMANENT 0x00000010L
View code on GitHubThis OBJECT_ATTRIBUTES flag indicates that the object should be marked as permanent. This flag alters the lifetime of the object, making it independent from reference counting. Creating or marking objects as permanent requires SeCreatePermanentPrivilege. To delete such object, make it temporary first via NtMakeTemporaryObject.
OBJ_PROTECT_CLOSEOBJ_INHERITOBJ_AUDIT_OBJECT_CLOSEOBJ_NO_RIGHTS_UPGRADEOBJ_EXCLUSIVEOBJ_CASE_INSENSITIVEOBJ_OPENIFOBJ_OPENLINKOBJ_KERNEL_HANDLEOBJ_FORCE_ACCESS_CHECKOBJ_IGNORE_IMPERSONATED_DEVICEMAPOBJ_DONT_REPARSETo make an existing object permanent, use NtMakePermanentObject.