EXTENDED_CREATE_INFORMATION structure (wdm.h)

La structure EXTENDED_CREATE_INFORMATION est le champ EaBuffer dans NtCreateFile lorsque l’indicateur FILE_CONTAINS_EXTENDED_CREATE_INFORMATION est défini dans le paramètre CreateOption de NtCreateFile.

Syntaxe

typedef struct _EXTENDED_CREATE_INFORMATION {
  LONGLONG ExtendedCreateFlags;
  PVOID    EaBuffer;
  ULONG    EaLength;
} EXTENDED_CREATE_INFORMATION, *PEXTENDED_CREATE_INFORMATION;

Membres

ExtendedCreateFlags

Indicateurs pour la création étendue. ExtendedCreateFlags peut avoir l’une des valeurs suivantes. Lorsque l’un de ces indicateurs est spécifié, l’objet file de NtCreateFile est marqué comme ouvert pour l’intention de copie dans son FileObjectExtension. Les filtres peuvent case activée pour cet état stocké en appelant IoCheckFileObjectOpenedAsCopySource ou IoCheckFileObjectOpenedAsCopyDestination

Indicateur Signification
EX_CREATE_FLAG_FILE_SOURCE_OPEN_FOR_COPY (0x00000001) Indique que le fichier est ouvert en tant que fichier source pour une copie de fichier.
EX_CREATE_FLAG_FILE_DEST_OPEN_FOR_COPY (0x00000002) Indique que le fichier est ouvert en tant que fichier de destination pour une copie de fichier.

La présence de l’un des indicateurs ci-dessus n’est pas suffisante pour garantir que la lecture/écriture (opérations d’E/S) sur l’objet fichier est fiable, car tout processus en mode utilisateur peut fournir ces indicateurs au moment de la création.

EaBuffer

Pointeur vers la mémoire tampon des attributs étendus.

EaLength

Longueur de la mémoire tampon vers laquelle EaBuffer pointe.

Remarques

L’exemple suivant montre comment fournir une structure EXTENDED_CREATE_INFORMATION à NtCreateFile, en encapsulant correctement EaBuffer et EaLength en interne.

// 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));

Pour plus d’informations, consultez Copie de fichiers en mode noyau et détection des scénarios de fichier de copie.

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows 11, version 22H2
En-tête wdm.h (include Wdm.h)

Voir aussi

IoCheckFileObjectOpenedAsCopyDestination

IoCheckFileObjectOpenedAsCopySource

NtCopyFileChunk

NtCreateFile