Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5b47a2db
Commit
5b47a2db
authored
Apr 15, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Implement IRP_MN_QUERY_DEVICE_RELATIONS.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b0c2e5c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
wineusb.c
dlls/wineusb.sys/wineusb.c
+53
-0
No files found.
dlls/wineusb.sys/wineusb.c
View file @
5b47a2db
...
...
@@ -38,6 +38,23 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wineusb
);
#if defined(__i386__) && !defined(_WIN32)
extern
void
*
WINAPI
wrap_fastcall_func1
(
void
*
func
,
const
void
*
a
);
__ASM_STDCALL_FUNC
(
wrap_fastcall_func1
,
8
,
"popl %ecx
\n\t
"
"popl %eax
\n\t
"
"xchgl (%esp),%ecx
\n\t
"
"jmp *%eax"
);
#define call_fastcall_func1(func,a) wrap_fastcall_func1(func,a)
#else
#define call_fastcall_func1(func,a) func(a)
#endif
#define DECLARE_CRITICAL_SECTION(cs) \
static CRITICAL_SECTION cs; \
static CRITICAL_SECTION_DEBUG cs##_debug = \
...
...
@@ -172,6 +189,42 @@ static NTSTATUS fdo_pnp(IRP *irp)
switch
(
stack
->
MinorFunction
)
{
case
IRP_MN_QUERY_DEVICE_RELATIONS
:
{
struct
usb_device
*
device
;
DEVICE_RELATIONS
*
devices
;
unsigned
int
i
=
0
;
if
(
stack
->
Parameters
.
QueryDeviceRelations
.
Type
!=
BusRelations
)
{
FIXME
(
"Unhandled device relations type %#x.
\n
"
,
stack
->
Parameters
.
QueryDeviceRelations
.
Type
);
break
;
}
EnterCriticalSection
(
&
wineusb_cs
);
if
(
!
(
devices
=
ExAllocatePool
(
PagedPool
,
offsetof
(
DEVICE_RELATIONS
,
Objects
[
list_count
(
&
device_list
)]))))
{
LeaveCriticalSection
(
&
wineusb_cs
);
irp
->
IoStatus
.
Status
=
STATUS_NO_MEMORY
;
break
;
}
LIST_FOR_EACH_ENTRY
(
device
,
&
device_list
,
struct
usb_device
,
entry
)
{
devices
->
Objects
[
i
++
]
=
device
->
device_obj
;
call_fastcall_func1
(
ObfReferenceObject
,
device
->
device_obj
);
}
LeaveCriticalSection
(
&
wineusb_cs
);
devices
->
Count
=
i
;
irp
->
IoStatus
.
Information
=
(
ULONG_PTR
)
devices
;
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
break
;
}
case
IRP_MN_START_DEVICE
:
if
((
ret
=
libusb_hotplug_register_callback
(
NULL
,
LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED
|
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT
,
...
...
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