FILE_DISPOSITION_INFORMATION - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H

/**
 * The FILE_DISPOSITION_INFORMATION structure is used to mark a file for deletion.
 * \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/ns-ntddk-_file_disposition_information
 */
typedef struct _FILE_DISPOSITION_INFORMATION
{
    BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;

#endif

View code on GitHub
// ntddk.h

typedef struct _FILE_DISPOSITION_INFORMATION {
  BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;

View the official Windows Driver Kit DDI reference

NtDoc

This structure is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (ns-ntddk-_file_disposition_information)

_FILE_DISPOSITION_INFORMATION structure

Description

The FILE_DISPOSITION_INFORMATION structure is used as an argument to the ZwSetInformationFile routine.

Members

DeleteFile

Indicates whether the operating system file should delete the file when the file is closed. Set this member to TRUE to delete the file when it is closed. Otherwise, set to FALSE. Setting this member to FALSE has no effect if the handle was opened with FILE_FLAG_DELETE_ON_CLOSE.

Remarks

The caller must have DELETE access to a given file in order to call ZwSetInformationFile with DeleteFile set to TRUE in this structure. Subsequently, the only legal operation by such a caller is to close the open file handle.

A file marked for deletion is not actually deleted until all open handles for the file object have been closed and the link count for the file is zero.

See also

ZwClose

ZwSetInformationFile