<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><pre>I think it probably does something similar to:<br><a href="http://www.codeproject.com/KB/system/RemoveDriveByLetter.aspx">http://www.codeproject.com/KB/system/RemoveDriveByLetter.aspx</a><br>
<br>Except instead of mapping a drive to usb device, it does it the other<br>way around.<br><br>After looking more into it it really looks like this is the thing it<br>does. (I need a bunch of hacks for it to work, but alas.) However it<br>
doesn't get me much further since our IOCTL_STORAGE_GET_DEVICE_NUMBER<br>ioctl is a stub. I would need something that can at least guarantee<br>uniqueness per volume for it, perhaps a conversion of drive letter to<br>
integer. Now I just need to figure that one out.<br><br>Cheers,<br>Maarten.</pre></blockquote><div>I do not believe the device number matching is the problem, I have been exploring this problem a little with RemoveDriveByLetter and I believe that it is not working because the SymbolicLink entry is not added as a "real" thing in Wine. Performing an experiment with accessing the same drive letter in three different ways (results below, last parameter is "hDrive") I see that only the call with the registry-returned value for the drive fails (even if it is added to "HKLM/System/MountedDevices"). I believe that a call to IoCreateSymbolicLink must be made in order for the name returned by the registry to be recognized as an alias for the drive. I think iTunes is probably going through the device tree looking for its vendor and product code. It should get this back from CM_Get_Device_ID, but I do not have Windows so I cannot fake iTunes out to confirm this.<br>
<br>SetupDiGetDeviceInterfaceDetail '\\?\USBSTOR#Disk&Ven_Apple&Prod_iPod&Rev_1.62#000A27001420C124&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}': -1<br>SetupDiGetDeviceInterfaceDetail '\\?\Volume{00000000-0000-0000-0000-000000000048}': 60<br>
SetupDiGetDeviceInterfaceDetail '\\.\H:': 64<br>Device number comparison: 1 1 <br><br></div>