Share via


Use DeviceIoControl and Control Codes to Retrieve the Physical Drive Number 

 
Platform SDK: Application Compatibility Guide

Use DeviceIoControl and Control Codes to Retrieve the Physical Drive Number

To be compatible with Windows 2000 and Windows XP, your application may need to find the physical drive number using one of the following codes. The physical drive number is commonly needed only by applications that require low-level access to hard-drives and volumes, such as virus scanners.

On Windows NT 4.0, Windows 2000, or later, your application should call DeviceIoControl function with the following input and output control codes. For more information, see Calling DeviceIoControl.

IOCTL_STORAGE_GET_DEVICE_NUMBER works for a single drive number. Use this code if the drive is a C drive or if you have multiple partitions on a single drive.

IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS works for multiple volume sets.

  
  Last updated: April 2004  |  What did you think of this topic?  |  Order a Platform SDK CD
  © 2004 Microsoft Corporation. All rights reserved. Terms of use.