Commit a103ee57 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wineusb.sys: Partially implement URB_FUNCTION_SELECT_CONFIGURATION.

parent 65b9b202
......@@ -460,6 +460,25 @@ static void queue_irp(struct usb_device *device, IRP *irp, struct libusb_transfe
LeaveCriticalSection(&wineusb_cs);
}
struct pipe
{
unsigned char endpoint;
unsigned char type;
};
static HANDLE make_pipe_handle(unsigned char endpoint, USBD_PIPE_TYPE type)
{
union
{
struct pipe pipe;
HANDLE handle;
} u;
u.pipe.endpoint = endpoint;
u.pipe.type = type;
return u.handle;
}
static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
{
URB *urb = IoGetCurrentIrpStackLocation(irp)->Parameters.Others.Argument1;
......@@ -501,6 +520,26 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
return STATUS_PENDING;
}
case URB_FUNCTION_SELECT_CONFIGURATION:
{
struct _URB_SELECT_CONFIGURATION *req = &urb->UrbSelectConfiguration;
ULONG i;
/* FIXME: In theory, we'd call libusb_set_configuration() here, but
* the CASIO FX-9750GII (which has only one configuration) goes into
* an error state if it receives a SET_CONFIGURATION request. Maybe
* we should skip setting that if and only if the configuration is
* already active? */
for (i = 0; i < req->Interface.NumberOfPipes; ++i)
{
USBD_PIPE_INFORMATION *pipe = &req->Interface.Pipes[i];
pipe->PipeHandle = make_pipe_handle(pipe->EndpointAddress, pipe->PipeType);
}
return STATUS_SUCCESS;
}
default:
FIXME("Unhandled function %#x.\n", urb->UrbHeader.Function);
}
......
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