struttura EXTENDED_CREATE_INFORMATION (wdm.h)
La struttura EXTENDED_CREATE_INFORMATION è il campo EaBuffer in NtCreateFile quando il flag FILE_CONTAINS_EXTENDED_CREATE_INFORMATION è impostato nel parametro Create Option CreateOption di NtCreateFile.
Sintassi
typedef struct _EXTENDED_CREATE_INFORMATION {
LONGLONG ExtendedCreateFlags;
PVOID EaBuffer;
ULONG EaLength;
PEXTENDED_CREATE_DUAL_OPLOCK_KEYS DualOplockKeys;
} EXTENDED_CREATE_INFORMATION, *PEXTENDED_CREATE_INFORMATION;
Membri
ExtendedCreateFlags
Flag per la creazione estesa. ExtendedCreateFlags può essere uno dei valori seguenti. Quando viene specificato uno di questi flag, l'oggetto file ntCreateFileviene contrassegnato come aperto per la finalità di copia nella relativa FileObjectExtension. I filtri possono verificare la presenza di questo stato archiviato chiamando IoCheckFileObjectOpenedAsCopySource o IoCheckFileObjectOpenedAsCopyDestination
Bandiera | Significato |
---|---|
EX_CREATE_FLAG_FILE_SOURCE_OPEN_FOR_COPY (0x00000001) | Segnala che il file viene aperto come file di origine per una copia di file. |
EX_CREATE_FLAG_FILE_DEST_OPEN_FOR_COPY (0x00000002) | Segnala che il file viene aperto come file di destinazione per una copia di file. |
La presenza di uno dei flag precedenti non è sufficiente per garantire che le operazioni di lettura/scrittura (operazioni di I/O) sull'oggetto file siano attendibili, in quanto qualsiasi processo in modalità utente può fornire questi flag in fase di creazione.
EaBuffer
Puntatore al buffer degli attributi estesi.
EaLength
Lunghezza del buffer a cui punta il EaBuffer.
DualOplockKeys
Osservazioni
Nell'esempio seguente viene illustrato come fornire una struttura EXTENDED_CREATE_INFORMATION per NtCreateFile, eseguendo correttamente il wrapping del EaBuffer e EaLength internamente.
// Input parameters to NtCreateFile. Obtaining these
// values is not shown in this sample.
HANDLE SourceFile;
ACCESS_MASK DesiredAccess;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatus;
ULONG FileAttributes;
ULONG ShareAccess;
ULONG CreateDisposition;
ULONG CreateOptions;
PVOID EaBuffer = NULL;
ULONG EaLength = 0;
EXTENDED_CREATE_INFORMATION ExtendedCreateInfo;
// Populate the extended create info. The
// ExtendedCreateFlags field could also be
// EX_CREATE_FLAG_FILE_DESTINATION_OPEN_FOR_COPY.
ExtendedCreateInfo.EaBuffer = EaBuffer;
ExtendedCreateInfo.EaLength = EaLength;
ExtendedCreateInfo.ExtendedCreateFlags = EX_CREATE_FLAG_FILE_SOURCE_OPEN_FOR_COPY;
// Set the create option flag to indicate the
// EaBuffer actually contains extended create info.
CreateOptions |= FILE_CONTAINS_EXTENDED_CREATE_INFORMATION;
// Open the file
Status = NtCreateFile(&SourceFile,
DesiredAccess,
&ObjectAttributes,
&IoStatus,
NULL,
FileAttributes,
SharseAccess,
CreateDisposition,
CreateOptions,
&ExtendedCreateInfo,
sizeof(EXTENDED_CREATE_INFORMATION));
Per altre informazioni, vedere copia di file in modalità kernel e rilevamento di scenari di file di copia.
Fabbisogno
Requisito | Valore |
---|---|
client minimo supportato | Windows 11, versione 22H2 |
intestazione | wdm.h (include Wdm.h) |
Vedere anche
IoCheckFileObjectOpenedAsCopyDestination