estructura EXTENDED_CREATE_INFORMATION (wdm.h)
La estructura EXTENDED_CREATE_INFORMATION es el campo EaBuffer en NtCreateFile cuando la marca de FILE_CONTAINS_EXTENDED_CREATE_INFORMATION está establecida en el parámetro CreateOp tion CreateOption de NtCreateFile.
Sintaxis
typedef struct _EXTENDED_CREATE_INFORMATION {
LONGLONG ExtendedCreateFlags;
PVOID EaBuffer;
ULONG EaLength;
PEXTENDED_CREATE_DUAL_OPLOCK_KEYS DualOplockKeys;
} EXTENDED_CREATE_INFORMATION, *PEXTENDED_CREATE_INFORMATION;
Miembros
ExtendedCreateFlags
Marcas para la creación extendida. ExtendedCreateFlags puede ser uno de los siguientes valores. Cuando se especifica cualquiera de estas marcas, objeto de archivo ntCreateFilese marca como abierto para la intención de copia en su FileObjectExtension. Los filtros pueden comprobar este estado almacenado llamando a ioCheckFileObjectOpenedAsCopySource o IoCheckFileObjectOpenedAsCopyDestination
Bandera | Significado |
---|---|
EX_CREATE_FLAG_FILE_SOURCE_OPEN_FOR_COPY (0x00000001) | Indica que el archivo se está abriendo como archivo de origen para una copia de archivo. |
EX_CREATE_FLAG_FILE_DEST_OPEN_FOR_COPY (0x00000002) | Indica que el archivo se está abriendo como archivo de destino para una copia de archivo. |
La presencia de una de las marcas anteriores no es suficiente para asegurarse de que las operaciones de lectura y escritura (operaciones de E/S) en el objeto de archivo son de confianza, ya que cualquier proceso en modo de usuario puede proporcionar estas marcas en tiempo de creación.
EaBuffer
Puntero al búfer de atributos extendidos.
EaLength
Longitud del búfer al que apunta EaBuffer.
DualOplockKeys
Observaciones
En el ejemplo siguiente se muestra cómo proporcionar una estructura de EXTENDED_CREATE_INFORMATION para NtCreateFile , ajustando correctamente el EaBuffer y 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));
Para obtener más información, consulte escenarios de copia de archivos en modo kernel y detección de escenarios de archivos de copia.
Requisitos
Requisito | Valor |
---|---|
cliente mínimo admitido | Windows 11, versión 22H2 |
encabezado de | wdm.h (incluya Wdm.h) |
Consulte también
ioCheckFileObjectOpenedAsCopyDestination