Export (0) Print
Expand All
Expand Minimize

IoQueryFullDriverPath routine

The IoQueryFullDriverPath routine retrieves the full path name of the binary file that is loaded for the specified driver object.

Syntax


NTSTATUS IoQueryFullDriverPath(
  _In_   PDRIVER_OBJECT DriverObject,
  _Out_  PUNICODE_STRING FullPath
);

Parameters

DriverObject [in]

A pointer to a DRIVER_OBJECT structure. This structure must be the driver object for the calling driver.

FullPath [out]

A pointer to a caller-allocated UNICODE_STRING structure. On successful return, this structure contains the path name.

Return value

IoQueryFullDriverPath returns STATUS_SUCCESS if the call successfully fetches the path name. Possible error return values include the following status codes.

Return codeDescription
STATUS_ACCESS_DENIED

The target driver object does not belong to the caller.

STATUS_NOT_FOUND

The driver object has no section (loaded memory image) associated with it.

STATUS_INSUFFICIENT_RESOURCES

Insufficient resources are available to perform the requested operation.

 

Remarks

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.

Requirements

Version

Available starting with Windows 8.1.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

DRIVER_OBJECT
ExFreePool
UNICODE_STRING

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft