My question is this: Given an offline disk connected to my windows machine, how can I get it's volume letter?
The scenario: I need to create a handler to a shared storage (with CreateFile function) in order to use it in the DeviceIoControl function (need to perform SCSI reservations).
The "CreateFile" function gets the physical drive name (i.e \.\PhysicalDisk1) or the volume letter of the disk (i.e \.\E:).
My problem is, that I don't want to use the physical drive name, just the disk letter. This works fine when the disk is online, but I have to support also when the disk is offline.
Is there a way to determine the letter when the device/disk is offline? I assume there is, because when I get the disk online, windows automatically gives it the right letter. So if the operation system knows what will be the letter, there must be an API or a tool that I can use too.
Thanks, Daniel.