ZwClose

NTSTATUS
    ZwClose(

        IN HANDLE  Handle
        );

ZwClose closes object handles. A named object is not actually deleted until all of its valid handles are closed and no referenced pointers remain.

Parameters

Handle
Is a valid handle for an open object.

Return Value

ZwClose can return one of the following values:

STATUS_SUCCESS
STATUS_OBJECT_TYPE_MISMATCH
STATUS_ACCESS_DENIED
STATUS_INVALID_HANDLE

Comments

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

Closing an open handle for an object causes that handle to become invalid. The reference count for the object handle is decremented and object retention checks are performed.

Callers of ZwClose must be running at IRQL PASSIVE_LEVEL.

See Also

ZwCreateDirectoryObject, ZwCreateFile, ZwCreateKey, ZwOpenKey, ZwOpenSection