Share via


Funzione ZwQueryInformationByName (wdm.h)

ZwQueryInformationByName restituisce le informazioni richieste su un file specificato dal nome file.

Sintassi

NTSYSAPI NTSTATUS ZwQueryInformationByName(
  [in]  POBJECT_ATTRIBUTES     ObjectAttributes,
  [out] PIO_STATUS_BLOCK       IoStatusBlock,
  [out] PVOID                  FileInformation,
  [in]  ULONG                  Length,
  [in]  FILE_INFORMATION_CLASS FileInformationClass
);

Parametri

[in] ObjectAttributes

Puntatore a una struttura OBJECT_ATTRIBUTES che contiene gli attributi del file, incluso il nome file.

[out] IoStatusBlock

Puntatore a una struttura IO_STATUS_BLOCK contenente lo stato di I/O del chiamante.

[out] FileInformation

Puntatore al buffer fornito dal chiamante in cui restituire le informazioni richieste sul file. La struttura del buffer è determinata dal parametro FileInformationClass .

[in] Length

Lunghezza, in byte, del buffer a cui punta FileInformation .

[in] FileInformationClass

Valore FILE_INFORMATION_CLASS che identifica il tipo di informazioni sul file da restituire nel buffer a cui punta FileInformation . FileInformationClass può essere uno dei valori seguenti.

valore FILE_INFORMATION_CLASS Tipo di informazioni da restituire
FileStatInformation (68) FILE_STAT_INFORMATION. Disponibile a partire da Windows 10 versione 1709.
FileStatLxInformation (70) FILE_STAT_LX_INFORMATION. Disponibile a partire da Windows 10 aggiornamento di aprile 2018.
FileCaseSensitiveInformation (71) FILE_CASE_SENSITIVE_INFORMATION. Disponibile a partire da Windows 10 aggiornamento di aprile 2018.

Valore restituito

ZwQueryInformationByName restituisce STATUS_SUCCESS al completamento; in caso contrario, restituisce un codice di errore, ad esempio uno dei seguenti.

Codice di errore Significato
STATUS_INVALID_PARAMETER Il parametro FileInformationClass contiene un valore non valido.
STATUS_INFO_LENGTH_MISMATCH Le dimensioni del buffer specificate da Length non sono sufficienti per contenere le informazioni richieste.

Commenti

ZwQueryInformationByName esegue query e restituisce le informazioni richieste sul file. Lo fa senza aprire il file effettivo, rendendolo più efficiente di ZwQueryInformationFile, che richiede un file aperto (e la successiva chiusura del file).

I chiamanti di ZwQueryInformationByName devono essere in esecuzione in IRQL = PASSIVE_LEVEL e con API kernel speciali abilitate.

Requisiti

Requisito Valore
Intestazione wdm.h
IRQL PASSIVE_LEVEL (vedere la sezione Osservazioni)

Vedi anche

FILE_CASE_SENSITIVE_INFORMATION

FILE_INFORMATION_CLASS

FILE_STAT_INFORMATION

FILE_STAT_LX_INFORMATION

IO_STATUS_BLOCK

OBJECT_ATTRIBUTES

ZwQueryInformationFile