NTSTATUS
ZwMakeTemporaryObject(
IN HANDLE Handle
);
ZwMakeTemporaryObject changes the attributes of an object to make it temporary.
ZwMakeTemporaryObject can return one of the following values:
STATUS_SUCCESS
STATUS_ACCESS_DENIED
STATUS_INVALID_HANDLE
ZwMakeTemporaryObject is a generic routine that operates on any type of object.
Making an object temporary causes the permanent flag of the associated object to be cleared. A temporary object has a name only as long as its handle count is greater than zero. When the handle count reaches zero, the system deletes the object name and adjusts the pointer count for the object appropriately.
Callers of ZwMakeTemporaryObject must be running at IRQL PASSIVE_LEVEL.
InitializeObjectAttributes, ZwClose, ZwCreateDirectoryObject, ZwCreateFile