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
5815c7b5
Commit
5815c7b5
authored
Sep 12, 2018
by
Aric Stewart
Committed by
Alexandre Julliard
Sep 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Implement IRP_MN_QUERY_DEVICE_RELATIONS.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db6c5b59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
main.c
dlls/winebus.sys/main.c
+53
-0
No files found.
dlls/winebus.sys/main.c
View file @
5815c7b5
...
...
@@ -360,6 +360,57 @@ void bus_remove_hid_device(DEVICE_OBJECT *device)
HeapFree
(
GetProcessHeap
(),
0
,
pnp_device
);
}
static
NTSTATUS
build_device_relations
(
DEVICE_RELATIONS
**
devices
)
{
int
i
;
struct
pnp_device
*
ptr
;
EnterCriticalSection
(
&
device_list_cs
);
*
devices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DEVICE_RELATIONS
)
+
list_count
(
&
pnp_devset
)
*
sizeof
(
void
*
));
if
(
!*
devices
)
{
LeaveCriticalSection
(
&
device_list_cs
);
return
STATUS_INSUFFICIENT_RESOURCES
;
}
i
=
0
;
LIST_FOR_EACH_ENTRY
(
ptr
,
&
pnp_devset
,
struct
pnp_device
,
entry
)
{
(
*
devices
)
->
Objects
[
i
]
=
(
DEVICE_OBJECT
*
)
ptr
->
device
;
i
++
;
}
LeaveCriticalSection
(
&
device_list_cs
);
(
*
devices
)
->
Count
=
i
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
handle_IRP_MN_QUERY_DEVICE_RELATIONS
(
IRP
*
irp
)
{
NTSTATUS
status
=
irp
->
IoStatus
.
u
.
Status
;
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
TRACE
(
"IRP_MN_QUERY_DEVICE_RELATIONS"
);
switch
(
irpsp
->
Parameters
.
QueryDeviceRelations
.
Type
)
{
case
EjectionRelations
:
case
RemovalRelations
:
case
TargetDeviceRelation
:
case
PowerRelations
:
FIXME
(
"Unhandled Device Relation %x
\n
"
,
irpsp
->
Parameters
.
QueryDeviceRelations
.
Type
);
break
;
case
BusRelations
:
status
=
build_device_relations
((
DEVICE_RELATIONS
**
)
&
irp
->
IoStatus
.
Information
);
break
;
default:
FIXME
(
"Unknown Device Relation %x
\n
"
,
irpsp
->
Parameters
.
QueryDeviceRelations
.
Type
);
break
;
}
return
status
;
}
static
NTSTATUS
handle_IRP_MN_QUERY_ID
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
NTSTATUS
status
=
irp
->
IoStatus
.
u
.
Status
;
...
...
@@ -404,6 +455,8 @@ NTSTATUS WINAPI common_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp)
{
case
IRP_MN_QUERY_DEVICE_RELATIONS
:
TRACE
(
"IRP_MN_QUERY_DEVICE_RELATIONS
\n
"
);
status
=
handle_IRP_MN_QUERY_DEVICE_RELATIONS
(
irp
);
irp
->
IoStatus
.
u
.
Status
=
status
;
break
;
case
IRP_MN_QUERY_ID
:
TRACE
(
"IRP_MN_QUERY_ID
\n
"
);
...
...
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