![]() I can't believe how much code is required to do what I thought would be a fairly straightforward task (I quoted my client 2 hours to write this code, it's taken me four days to figure it all out!). The device I am dealing with is a USB CD-ROM drive which is why I have hard-coded the device type to CDROM. Finally I can use an IOCTL to eject the device. ![]() The CM_Locate_DevNode() and CM_Get_Child() functions were the key to this. I needed to figure out how to find the device instance for my USB device and find a way to match that to the device interface. The CodeProject article linked to by Luke shows how to match the drive letter to a device interface which is half the way there so I'll +1 that answer but it doesn't solve the whole problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |