TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

Notices

Opening USB device from application

Microsoft Device Drivers


Reply
 
Thread Tools Display Modes
Old 17-02-2009, 09:39 PM   #1
Newbie
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 odomae is an unknown quantity at this point


OS: Windows XP


Opening USB device from application

Hi,

I am trying to open a USB mass storage device from a windows application. To use CreateFile(), I needed the device name. So I did the following.

hardwareDeviceInfo = SetupDiGetClassDevs(&UsbClassGuid,
NULL, // Define no enumerator (global)
NULL, // Define no
DIGCF_PRESENT| DIGCF_DEVICEINTERFACE // Only Devices present
); // Function class devices.
if (hardwareDeviceInfo == INVALID_HANDLE_VALUE)
{
return INVALID_HANDLE_VALUE;
}
else
printf(" SetupDiGetClassDevs returned a valid handle!\n");

//Get Device Interface Data
deviceInterfaceData.cbSize = sizeof(deviceInterfaceData);
(SetupDiEnumDeviceInterfaces(hardwareDeviceInfo, NULL, &UsbClassGuid, 0, &deviceInterfaceData))


The call to SetupDiEnumDeviceInterfaces() fails.

Any ideas on what the problem could be?

I got the USB GUID from the windows system defined GUID list for disk drives.

Odomae
odomae is offline   Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 07:36 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional