Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e5e2cc10
Commit
e5e2cc10
authored
Apr 17, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Implement URB_FUNCTION_VENDOR_INTERFACE.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a103ee57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
wineusb.c
dlls/wineusb.sys/wineusb.c
+46
-0
No files found.
dlls/wineusb.sys/wineusb.c
View file @
e5e2cc10
...
@@ -439,6 +439,15 @@ static void transfer_cb(struct libusb_transfer *transfer)
...
@@ -439,6 +439,15 @@ static void transfer_cb(struct libusb_transfer *transfer)
break
;
break
;
}
}
case
URB_FUNCTION_VENDOR_INTERFACE
:
{
struct
_URB_CONTROL_VENDOR_OR_CLASS_REQUEST
*
req
=
&
urb
->
UrbControlVendorClassRequest
;
req
->
TransferBufferLength
=
transfer
->
actual_length
;
if
(
req
->
TransferFlags
&
USBD_TRANSFER_DIRECTION_IN
)
memcpy
(
req
->
TransferBuffer
,
libusb_control_transfer_get_data
(
transfer
),
transfer
->
actual_length
);
break
;
}
default:
default:
ERR
(
"Unexpected function %#x.
\n
"
,
urb
->
UrbHeader
.
Function
);
ERR
(
"Unexpected function %#x.
\n
"
,
urb
->
UrbHeader
.
Function
);
}
}
...
@@ -540,6 +549,43 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
...
@@ -540,6 +549,43 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
case
URB_FUNCTION_VENDOR_INTERFACE
:
{
struct
_URB_CONTROL_VENDOR_OR_CLASS_REQUEST
*
req
=
&
urb
->
UrbControlVendorClassRequest
;
uint8_t
req_type
=
LIBUSB_REQUEST_TYPE_VENDOR
|
LIBUSB_RECIPIENT_INTERFACE
;
unsigned
char
*
buffer
;
if
(
req
->
TransferFlags
&
USBD_TRANSFER_DIRECTION_IN
)
req_type
|=
LIBUSB_ENDPOINT_IN
;
if
(
req
->
TransferFlags
&
~
USBD_TRANSFER_DIRECTION_IN
)
FIXME
(
"Unhandled flags %#x.
\n
"
,
req
->
TransferFlags
);
if
(
req
->
TransferBufferMDL
)
FIXME
(
"Unhandled MDL output buffer.
\n
"
);
if
(
!
(
transfer
=
libusb_alloc_transfer
(
0
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
buffer
=
malloc
(
sizeof
(
struct
libusb_control_setup
)
+
req
->
TransferBufferLength
)))
{
libusb_free_transfer
(
transfer
);
return
STATUS_NO_MEMORY
;
}
queue_irp
(
device
,
irp
,
transfer
);
libusb_fill_control_setup
(
buffer
,
req_type
,
req
->
Request
,
req
->
Value
,
req
->
Index
,
req
->
TransferBufferLength
);
if
(
!
(
req
->
TransferFlags
&
USBD_TRANSFER_DIRECTION_IN
))
memcpy
(
buffer
+
LIBUSB_CONTROL_SETUP_SIZE
,
req
->
TransferBuffer
,
req
->
TransferBufferLength
);
libusb_fill_control_transfer
(
transfer
,
device
->
handle
,
buffer
,
transfer_cb
,
irp
,
0
);
transfer
->
flags
=
LIBUSB_TRANSFER_FREE_BUFFER
|
LIBUSB_TRANSFER_FREE_TRANSFER
;
ret
=
libusb_submit_transfer
(
transfer
);
if
(
ret
<
0
)
ERR
(
"Failed to submit vendor-specific interface transfer: %s
\n
"
,
libusb_strerror
(
ret
));
return
STATUS_PENDING
;
}
default:
default:
FIXME
(
"Unhandled function %#x.
\n
"
,
urb
->
UrbHeader
.
Function
);
FIXME
(
"Unhandled function %#x.
\n
"
,
urb
->
UrbHeader
.
Function
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment