The IoQueryFullDriverPath routine retrieves the full path name of the binary file that is loaded for the specified driver object.
NTKERNELAPI NTSTATUS IoQueryFullDriverPath( PDRIVER_OBJECT DriverObject, PUNICODE_STRING FullPath );
A pointer to a DRIVER_OBJECT structure. This structure must be the driver object for the calling driver.
A pointer to a caller-allocated UNICODE_STRING structure. On successful return, this structure contains the path name.
IoQueryFullDriverPath returns STATUS_SUCCESS if the call successfully fetches the path name. Possible error return values include the following status codes.
||The target driver object does not belong to the caller.|
||The driver object has no section (loaded memory image) associated with it.|
||Insufficient resources are available to perform the requested operation.|
A driver can call this routine to query for the full path name of its binary file, but not for the full path name of the binary file for another driver. If the driver object pointed to by the DriverObject parameter does not belong to the calling driver, the call fails and the routine returns an error code.
The caller allocates the UNICODE_STRING structure pointed to by the FullPath parameter, but does not need to initialize this structure. IoQueryFullDriverPath assumes that the original contents of this structure are invalid and overwrites them. This routine allocates a string buffer from paged system memory, sets the Buffer member of the structure to point to this buffer, and sets the MaximumLength and Buffer members to describe the buffer and its contents.
The caller is responsible for freeing the storage pointed to by FullPath->Buffer when the full path string is no longer needed. Typically, the caller frees this storage by calling a routine such as ExFreePool.
|Windows version||Available starting with Windows 8.1.|
|Header||ntddk.h (include Wdm.h, Ntddk.h, Ntifs.h)|