The IoVolumeDeviceToDosName routine returns the MS-DOS path for a specified device object that represents a file system volume.
NTKERNELAPI NTSTATUS IoVolumeDeviceToDosName( PVOID VolumeDeviceObject, PUNICODE_STRING DosName );
A pointer to a device object that represents a volume device object created by a storage class driver.
A pointer to a caller-allocated UNICODE_STRING structure. If the call is successful, IoVolumeDeviceToDosName sets the values of the Length, MaximumLength, and Buffer members of this structure. On exit, the Buffer member points to a wide-character, null-terminated string that contains the MS-DOS path of the volume device object specified by VolumeDeviceObject. For more information, see Remarks.
IoVolumeDeviceToDosName returns STATUS_SUCCESS if the call is successful. Possible error return values include the following status codes.
||The routine failed due to invalid parameter values passed by the caller.|
||The routine failed to allocate resources required for this operation.|
IoVolumeDeviceToDosName allocates the string buffer pointed to by the Buffer member of the UNICODE_STRING structure that the DosName parameter points to. After this buffer is no longer required, a caller of this routine should call the ExFreePool routine to free the buffer.
Starting with Windows Vista, you must ensure that APCs are not disabled before calling this routine. The KeAreAllApcsDisabled routine can be used to verify that APCs are not disabled.
|Windows version||Available starting with Windows XP. Drivers that must work in earlier versions of Windows NT-based operating systems can use RtlVolumeDeviceToDosName, which behaves identically.|
|Header||ntddk.h (include Ntddk.h)|