IoVolumeDeviceToDosName function (ntddk.h)

The IoVolumeDeviceToDosName routine returns the MS-DOS path for a specified device object that represents a file system volume.

Syntax

NTSTATUS IoVolumeDeviceToDosName(
  [in]  PVOID           VolumeDeviceObject,
  [out] PUNICODE_STRING DosName
);

Parameters

[in] VolumeDeviceObject

A pointer to a device object that represents a volume device object created by a storage class driver.

[out] DosName

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.

Return value

IoVolumeDeviceToDosName returns STATUS_SUCCESS if the call is successful. Possible error return values include the following status codes.

Return value Description
STATUS_INVALID_PARAMETER The routine failed due to invalid parameter values passed by the caller.
STATUS_INSUFFICIENT_RESOURCES The routine failed to allocate resources required for this operation.

Remarks

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.

Requirements

Requirement Value
Target Platform Universal
Header ntddk.h (include Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

See also

ExFreePool

KeAreAllApcsDisabled

UNICODE_STRING