Share via


IOCTL_DISK_GETNAME (Compact 2013)

3/26/2014

This I/O control message services the request from the FAT file system for the name of the folder that determines how users access the block device. If the driver does not supply a name, the FAT file system uses the default name passed to it by the file system. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,           // handle to device
    DWORD dwIoControlCode,    // use IOCTL_DISK_GETNAME
    LPVOID lpInBuffer,        // pointer to input buffer
    DWORD nInBufferSize,      // input buffer size
    LPVOID lpOutBuffer,       // pointer to output buffer
    DWORD nOutBufferSize,     // output buffer size
    LPDWORD lpBytesReturned,  // number of bytes returned
    OVERLAPPED lpOverlapped   // pointer to OVERLAPPED structure
);

Parameters

  • hDevice
    [in] Handle to the device.
  • dwIoControlCode
    [in] Control code for the operation. Use IOCTL_DISK_GETNAME for this operation.
  • lpInBuffer
    Set to NULL.
  • nInBufferSize
    Set to zero.
  • lpOutBuffer
    [out] Specifies a buffer allocated by the file system driver. The device driver fills this buffer with the folder name. The folder name must be a Unicode string.
  • nOutBufferSize
    Specifies the size of lpOutBuffer. Always set to MAX_PATH, where MAX_PATH includes the terminating NULL character.
  • lpBytesReturned
    [out] Set by the device driver to the length of the returned string and also the terminating NULL character.
  • lpOverlapped
    Set to NULL.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

To get extended error information, call GetLastError. GetLastError may return other standard error messages as appropriate.

Remarks

The block device driver should fill the lpOutBuffer buffer with a Unicode string that represents the folder name to use for the block device. The FAT file system queries for a name each time a new block device is connected. The block device driver can supply the same name for each query or it can use different names. The FAT file system appends a number to the folder name if the supplied name is the same as an existing folder name. However, the FAT file system makes limited attempts to create a folder for the block device. If the block device driver does not support this IOCTL, all block device connected from the block device driver use the default name for the file system. A block device driver cannot use the name Storage Card, which is reserved. If you use this name, the request to connect the volume fails. Platforms that use languages other than English may have a different reserved folder name for block devices.

Requirements

Header

diskio.h

See Also

Reference

Block Driver IOCTLs
DeviceIoControl