Commit b313c409 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wineusb.sys: Add support for URB_FUNCTION_VENDOR_DEVICE.

parent ca5f7fe4
...@@ -362,6 +362,7 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer) ...@@ -362,6 +362,7 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer)
break; break;
} }
case URB_FUNCTION_VENDOR_DEVICE:
case URB_FUNCTION_VENDOR_INTERFACE: case URB_FUNCTION_VENDOR_INTERFACE:
{ {
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *req = &urb->UrbControlVendorClassRequest; struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *req = &urb->UrbControlVendorClassRequest;
...@@ -539,10 +540,11 @@ static NTSTATUS usb_submit_urb(void *args) ...@@ -539,10 +540,11 @@ static NTSTATUS usb_submit_urb(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
case URB_FUNCTION_VENDOR_DEVICE:
case URB_FUNCTION_VENDOR_INTERFACE: case URB_FUNCTION_VENDOR_INTERFACE:
{ {
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *req = &urb->UrbControlVendorClassRequest; struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *req = &urb->UrbControlVendorClassRequest;
uint8_t req_type = LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_INTERFACE; uint8_t req_type = LIBUSB_REQUEST_TYPE_VENDOR;
struct transfer_ctx *transfer_ctx; struct transfer_ctx *transfer_ctx;
unsigned char *buffer; unsigned char *buffer;
...@@ -551,6 +553,11 @@ static NTSTATUS usb_submit_urb(void *args) ...@@ -551,6 +553,11 @@ static NTSTATUS usb_submit_urb(void *args)
transfer_ctx->irp = irp; transfer_ctx->irp = irp;
transfer_ctx->transfer_buffer = params->transfer_buffer; transfer_ctx->transfer_buffer = params->transfer_buffer;
if (urb->UrbHeader.Function == URB_FUNCTION_VENDOR_DEVICE)
req_type |= LIBUSB_RECIPIENT_DEVICE;
else
req_type |= LIBUSB_RECIPIENT_INTERFACE;
if (req->TransferFlags & USBD_TRANSFER_DIRECTION_IN) if (req->TransferFlags & USBD_TRANSFER_DIRECTION_IN)
req_type |= LIBUSB_ENDPOINT_IN; req_type |= LIBUSB_ENDPOINT_IN;
if (req->TransferFlags & ~USBD_TRANSFER_DIRECTION_IN) if (req->TransferFlags & ~USBD_TRANSFER_DIRECTION_IN)
......
...@@ -556,6 +556,7 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp) ...@@ -556,6 +556,7 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE: case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
case URB_FUNCTION_SELECT_CONFIGURATION: case URB_FUNCTION_SELECT_CONFIGURATION:
case URB_FUNCTION_VENDOR_DEVICE:
case URB_FUNCTION_VENDOR_INTERFACE: case URB_FUNCTION_VENDOR_INTERFACE:
{ {
struct usb_submit_urb_params params = struct usb_submit_urb_params params =
...@@ -586,6 +587,7 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp) ...@@ -586,6 +587,7 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
break; break;
} }
case URB_FUNCTION_VENDOR_DEVICE:
case URB_FUNCTION_VENDOR_INTERFACE: case URB_FUNCTION_VENDOR_INTERFACE:
{ {
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *req = &urb->UrbControlVendorClassRequest; struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *req = &urb->UrbControlVendorClassRequest;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment