DSK_GETLOGICALMAP
Appearance
- Category
- IOCTL_DISK (08h)
- Function
- DSK_GETLOGICALMAP (21h)
- Description
- Query Logical Map
Description
This function returns the logical drive letter that was last used to reference (open) the drive.
Parameter Packet Format
| Field | Length | C Datatype |
|---|---|---|
| Command Information | BYTE | UCHAR |
Data Packet Format
| Field | Length | C Datatype |
|---|---|---|
| Logical Drive Number | BYTE | UCHAR |
Returns
Possible values are shown in the following list:
| Code | Description |
|---|---|
| 0 | NO_ERROR |
| 1 | ERROR_INVALID_FUNCTION |
| 6 | ERROR_INVALID_HANDLE |
| 15 | ERROR_INVALID_DRIVE |
| 31 | ERROR_GEN_FAILURE |
| 87 | ERROR_INVALID_PARAMETER |
| 111 | ERROR_BUFFER_OVERFLOW |
| 115 | ERROR_PROTECTION_VIOLATION |
| 117 | ERROR_INVALID_CATEGORY |
| 119 | ERROR_BAD_DRIVER_LEVEL |
| 163 | ERROR_UNCERTAIN_MEDIA |
| 165 | ERROR_MONITORS_NOT_SUPPORTED |
Remarks
On entry, a logical drive number (1=A, 2=B, and so forth) is specified. On return, if the device has more than one logical drive letter assigned to it, a drive number corresponding to the last drive letter that was used to reference the device is returned. For example, if the entry drive number was 1 (A) and the returned drive number was 2 (B), this drive was last referenced as the B: drive. If only one drive letter is assigned to the device, a zero is returned. This function works as long as the file handle is valid and can be set to any value other than zero.