DeviceIoControl question
-
RomTibi, I completely understand your problem now. You have a
HANDLE
to a physical drive and want to somehow associate that back to the USB device. I spent about 10 minutes looking into this... and I did not find any way to use DeviceIoControl because there are no documented IOCTL codes that will do this. I did not find any documented methods for using a HANDLE to a physical drive for obtaining information about the parent USB device. However... you can absolutely do this using the Windows SetupAPI[^]. You could call the SetupDiGetClassDevs function[^] with the GUID_DEVINTERFACE_DISK class[^] and enumerate all of the storage devices using SetupDiEnumDeviceInterfaces[^] and call the SetupDiGetDeviceInterfaceDetail function[^] to get the drive path and serial. You can then call the CM_Get_Parent function[^] to get the parent USB device and retrieve these details. Please spend some time researching this... if you cannot figure it out let me know and when I have more free time I may be able to write a sample function for you. Best Wishes, -David DelauneHappy 9 years and 2 days of CodeProject! :) I worked a little around the example I found but I wasn`t able to port in VC++6. If you can give me some advice I would be gratefull... :(
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
-
Happy 9 years and 2 days of CodeProject! :) I worked a little around the example I found but I wasn`t able to port in VC++6. If you can give me some advice I would be gratefull... :(
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
RomTibi wrote:
Happy 9 years and 2 days of CodeProject! :)
Thanks! :) I have actually been a member here on codeproject for around 11 years but I forgot the password to my first account and created this one to replace it.
RomTibi wrote:
I worked a little around the example I found but I wasn`t able to port in VC++6. If you can give me some advice I would be gratefull...
Almost everything can be ported to VC6 with the exception of some of the modern C++ templated code and C++11. What version of the Platform SDK are you using with VC6?
-
RomTibi wrote:
Happy 9 years and 2 days of CodeProject! :)
Thanks! :) I have actually been a member here on codeproject for around 11 years but I forgot the password to my first account and created this one to replace it.
RomTibi wrote:
I worked a little around the example I found but I wasn`t able to port in VC++6. If you can give me some advice I would be gratefull...
Almost everything can be ported to VC6 with the exception of some of the modern C++ templated code and C++11. What version of the Platform SDK are you using with VC6?
I use Windows Platform SDK Feb 2003 http://groups.google.com/group/microsoft.public.platformsdk.sdk_install/msg/087b0178f5d8159e?&hl=en&pli=1[^]
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
-
RomTibi wrote:
Happy 9 years and 2 days of CodeProject! :)
Thanks! :) I have actually been a member here on codeproject for around 11 years but I forgot the password to my first account and created this one to replace it.
RomTibi wrote:
I worked a little around the example I found but I wasn`t able to port in VC++6. If you can give me some advice I would be gratefull...
Almost everything can be ported to VC6 with the exception of some of the modern C++ templated code and C++11. What version of the Platform SDK are you using with VC6?
My problem simplified so I posted this http://www.codeproject.com/Messages/4192965/Need-help-to-port-example-in-VS6.aspx[^] because remained still a problem to me. I hope you don`t mind. :)
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
-
My problem simplified so I posted this http://www.codeproject.com/Messages/4192965/Need-help-to-port-example-in-VS6.aspx[^] because remained still a problem to me. I hope you don`t mind. :)
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
Hi RomTibi, No I don't mind at all. But I don't think anyone will be able to answer your question because to convert that project to VC6 takes alot of work and patience. You will just need to copy alot of Setup API structs and defines into a new header. If I have some free time this weekend I'll investigate it. Best Wishes, -David Delaune
-
Hi RomTibi, No I don't mind at all. But I don't think anyone will be able to answer your question because to convert that project to VC6 takes alot of work and patience. You will just need to copy alot of Setup API structs and defines into a new header. If I have some free time this weekend I'll investigate it. Best Wishes, -David Delaune
-
THX!:rose::thumbsup:
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
-
Hi, Just wanted to drop in and let you know that I have not forgotten about your issue. Unfortunately I was out of town last weekend and did not write any code. I still have it on my TODO list so let me know if you have solved your problem.