WinDDK API: UsbBuildGetDescriptorRequest() fails to compile

  • Thread starter Thread starter Sanjay234
  • Start date Start date
S

Sanjay234

Guest
I am trying to compile this code and it is failing with the following errors.

#include <windows.h>
#include <Usb.h>
#include <Usbdlib.h>

int main()
{
USB_DEVICE_DESCRIPTOR dd;
URB urb;
UsbBuildGetDescriptorRequest(&urb,
sizeof(_URB_CONTROL_DESCRIPTOR_REQUEST),
USB_DEVICE_DESCRIPTOR_TYPE, 0, 0, &dd, NULL,
sizeof(dd), NULL);
return 0;
}

1>------ Build started: Project: USBDeviceDescriptor, Configuration: Release Win32 ------
1> Source.c
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(432): error C2146: syntax error: missing ')' before identifier 'DeviceObject'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(432): error C2061: syntax error: identifier 'DeviceObject'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(432): error C2059: syntax error: ';'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(432): error C2059: syntax error: ','
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(434): error C2059: syntax error: ')'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(458): error C2146: syntax error: missing ')' before identifier 'PhysicalDeviceObject'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(458): error C2061: syntax error: identifier 'PhysicalDeviceObject'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(458): error C2059: syntax error: ';'
1>C:\WinDDK\2600.1106\inc\ddk\wdm\wxp\Usbdlib.h(458): error C2059: syntax error: ','


The file it is showing as errors is part of the WinDDK. May I know what I have to do build the above code successfully.

Thanks in advance.

Continue reading...
 
Back
Top