ZwMakeTemporaryObject routine

The ZwMakeTemporaryObject routine changes the attributes of an object to make it temporary.

Syntax


NTSTATUS ZwMakeTemporaryObject(
  _In_  HANDLE Handle
);

Parameters

Handle [in]

Handle to an object of any type.

Return value

ZwMakeTemporaryObject returns STATUS_SUCCESS on success, or the appropriate NTSTATUS error code on failure.

Remarks

ZwMakeTemporaryObject is a generic routine that operates on any type of object.

An object is permanent if it was created with the OBJ_PERMANENT object attribute specified. (For more information about object attributes, see InitializeObjectAttributes.) A permanent object is created with a reference count of 1, so it is not deleted when a driver dereferences it.

An object is temporary if it is not permanent. ZwMakeTemporaryObject turns the specified object into a temporary object. If the object is already temporary, this routine does nothing.

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 appropriately adjusts the object's pointer count.

Note  If the call to this function occurs in user mode, you should use the name "NtMakeTemporaryObject" instead of "ZwMakeTemporaryObject".

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

PowerIrpDDis, HwStorPortProhibitedDDIs

See also

InitializeObjectAttributes
ZwClose
ZwCreateDirectoryObject
ZwCreateFile

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft