• Question

  • Hi,

    I use IOCTL_STORAGE_GET_DEVICE_NUMBER within a minifilter driver, called on the disk device object, as a way for a usermode app to get that device's instance id (the app currently enumerates certain classes of devices via the setupapi, asking each device for its storage number).

    I based this on an assumption that this is a way of uniquely identifying the disk, which if wrong, has appeared correct for a few months now and after testing with a wide variety of USB connected devices.

    However today I've found that a USB stick and USB floppy have identical storage device numbers and types?

    So am I widely off the mark, and if so, what else could I pass to usermode so it can get the device instance id?

    All help greatly appreciated.

    Friday, May 16, 2014 4:04 PM

All replies

  • What are you going to do with the number?  It is only good while the system is running, i.e. the number may change on a reboot.  For the IOCTL_STORAGE_GET_DEVICE_NUMBER results, are the other fields the same, I always assume the whole structure defines the uniqness.

    Don Burn Windows Filesystem and Driver Consulting Website: Blog:

    • Marked as answer by Doron Holan [MSFT] Friday, May 16, 2014 4:13 PM
    • Unmarked as answer by SpecWin Saturday, May 17, 2014 7:36 AM
    Friday, May 16, 2014 4:12 PM
  • Thanks Don.

    Yes I'm aware that the number may change on a reboot, but that is fine, I only want to use it to uniquely identify the device during the session.

    Yes the device type and partition are also the same, that's what surprised me.  Any thoughts?

    Friday, May 16, 2014 9:09 PM