[PSDK]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 11 Jun 2017 12:26:48 +0000 (12:26 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 11 Jun 2017 12:26:48 +0000 (12:26 +0000)
- Fix C++ version of BM_REQUEST_TYPE without breaking the C version

svn path=/trunk/; revision=75002

reactos/sdk/include/psdk/usb200.h
reactos/sdk/lib/drivers/libusb/hub_controller.cpp
reactos/sdk/lib/drivers/libusb/usb_device.cpp

index 83be5b5..63ed4d9 100644 (file)
@@ -55,12 +55,16 @@ typedef enum _USB_DEVICE_SPEED {
 
 
 typedef union _BM_REQUEST_TYPE {
+#ifdef __cplusplus
+  struct {
+#else
   struct _BM {
+#endif
     UCHAR Recipient:2;
     UCHAR Reserved:3;
     UCHAR Type:2;
     UCHAR Dir:1;
-  } _BM;
+  };
   UCHAR B;
 } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
 
index b7464e1..9ebedfb 100644 (file)
@@ -1426,8 +1426,8 @@ CHubController::HandleClassDevice(
             // generate setup packet
             //
             CtrlSetup.bmRequestType.B = 0;
-            CtrlSetup.bmRequestType._BM.Recipient = BMREQUEST_TO_DEVICE;
-            CtrlSetup.bmRequestType._BM.Type = BMREQUEST_CLASS;
+            CtrlSetup.bmRequestType.Recipient = BMREQUEST_TO_DEVICE;
+            CtrlSetup.bmRequestType.Type = BMREQUEST_CLASS;
             CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request;
             CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value;
             CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index;
@@ -1438,7 +1438,7 @@ CHubController::HandleClassDevice(
                 //
                 // data direction is device to host
                 //
-                CtrlSetup.bmRequestType._BM.Dir = BMREQUEST_DEVICE_TO_HOST;
+                CtrlSetup.bmRequestType.Dir = BMREQUEST_DEVICE_TO_HOST;
             }
 
             //
@@ -1889,8 +1889,8 @@ CHubController::HandleVendorDevice(
     // initialize setup packet
     //
     CtrlSetup.bmRequestType.B = 0;
-    CtrlSetup.bmRequestType._BM.Recipient = BMREQUEST_TO_DEVICE;
-    CtrlSetup.bmRequestType._BM.Type = BMREQUEST_VENDOR;
+    CtrlSetup.bmRequestType.Recipient = BMREQUEST_TO_DEVICE;
+    CtrlSetup.bmRequestType.Type = BMREQUEST_VENDOR;
     CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request;
     CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value;
     CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index;
@@ -1901,7 +1901,7 @@ CHubController::HandleVendorDevice(
         //
         // data direction is device to host
         //
-        CtrlSetup.bmRequestType._BM.Dir = BMREQUEST_DEVICE_TO_HOST;
+        CtrlSetup.bmRequestType.Dir = BMREQUEST_DEVICE_TO_HOST;
     }
 
     //
index 78cc012..edc1896 100644 (file)
@@ -698,10 +698,10 @@ CUSBDevice::GetConfigurationDescriptor(
     //
     // build setup packet
     //
-    CtrlSetup.bmRequestType._BM.Recipient = BMREQUEST_TO_DEVICE;
-    CtrlSetup.bmRequestType._BM.Type = BMREQUEST_STANDARD;
-    CtrlSetup.bmRequestType._BM.Reserved = 0;
-    CtrlSetup.bmRequestType._BM.Dir = BMREQUEST_DEVICE_TO_HOST;
+    CtrlSetup.bmRequestType.Recipient = BMREQUEST_TO_DEVICE;
+    CtrlSetup.bmRequestType.Type = BMREQUEST_STANDARD;
+    CtrlSetup.bmRequestType.Reserved = 0;
+    CtrlSetup.bmRequestType.Dir = BMREQUEST_DEVICE_TO_HOST;
     CtrlSetup.bRequest = USB_REQUEST_GET_DESCRIPTOR;
     CtrlSetup.wValue.LowByte = ConfigurationIndex;
     CtrlSetup.wValue.HiByte = USB_CONFIGURATION_DESCRIPTOR_TYPE;