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
d4c91cc6
Commit
d4c91cc6
authored
Jun 22, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Add a stub PnP manager driver.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f79da399
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+5
-0
ntoskrnl_private.h
dlls/ntoskrnl.exe/ntoskrnl_private.h
+3
-0
pnp.c
dlls/ntoskrnl.exe/pnp.c
+36
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
d4c91cc6
...
@@ -850,6 +850,8 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
...
@@ -850,6 +850,8 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
PsInitialSystemProcess
=
IoGetCurrentProcess
();
PsInitialSystemProcess
=
IoGetCurrentProcess
();
request_thread
=
GetCurrentThreadId
();
request_thread
=
GetCurrentThreadId
();
pnp_manager_start
();
handles
[
0
]
=
stop_event
;
handles
[
0
]
=
stop_event
;
handles
[
1
]
=
manager
;
handles
[
1
]
=
manager
;
...
@@ -917,6 +919,9 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
...
@@ -917,6 +919,9 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
}
}
done:
done:
/* Native PnP drivers expect that all of their devices will be removed when
* their unload routine is called, so we must stop the PnP manager first. */
pnp_manager_stop
();
wine_rb_destroy
(
&
wine_drivers
,
unload_driver
,
NULL
);
wine_rb_destroy
(
&
wine_drivers
,
unload_driver
,
NULL
);
return
status
;
return
status
;
}
}
...
...
dlls/ntoskrnl.exe/ntoskrnl_private.h
View file @
d4c91cc6
...
@@ -76,6 +76,9 @@ extern POBJECT_TYPE SeTokenObjectType;
...
@@ -76,6 +76,9 @@ extern POBJECT_TYPE SeTokenObjectType;
void
ObReferenceObject
(
void
*
obj
)
DECLSPEC_HIDDEN
;
void
ObReferenceObject
(
void
*
obj
)
DECLSPEC_HIDDEN
;
void
pnp_manager_start
(
void
)
DECLSPEC_HIDDEN
;
void
pnp_manager_stop
(
void
)
DECLSPEC_HIDDEN
;
static
const
WCHAR
servicesW
[]
=
{
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
static
const
WCHAR
servicesW
[]
=
{
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
'\\'
,
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
...
...
dlls/ntoskrnl.exe/pnp.c
View file @
d4c91cc6
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
*
*
* Copyright 2016 Sebastian Lackner
* Copyright 2016 Sebastian Lackner
* Copyright 2016 Aric Stewart for CodeWeavers
* Copyright 2016 Aric Stewart for CodeWeavers
* Copyright 2019 Zebediah Figura
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -751,3 +752,38 @@ POWER_STATE WINAPI PoSetPowerState( DEVICE_OBJECT *device, POWER_STATE_TYPE type
...
@@ -751,3 +752,38 @@ POWER_STATE WINAPI PoSetPowerState( DEVICE_OBJECT *device, POWER_STATE_TYPE type
FIXME
(
"device %p, type %u, state %u, stub!
\n
"
,
device
,
type
,
state
.
DeviceState
);
FIXME
(
"device %p, type %u, state %u, stub!
\n
"
,
device
,
type
,
state
.
DeviceState
);
return
state
;
return
state
;
}
}
static
DRIVER_OBJECT
*
pnp_manager
;
static
NTSTATUS
WINAPI
pnp_manager_device_pnp
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
TRACE
(
"device %p, irp %p, minor function %#x.
\n
"
,
device
,
irp
,
stack
->
MinorFunction
);
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
return
irp
->
IoStatus
.
u
.
Status
;
}
static
NTSTATUS
WINAPI
pnp_manager_driver_entry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
keypath
)
{
pnp_manager
=
driver
;
driver
->
MajorFunction
[
IRP_MJ_PNP
]
=
pnp_manager_device_pnp
;
return
STATUS_SUCCESS
;
}
void
pnp_manager_start
(
void
)
{
static
const
WCHAR
driver_nameW
[]
=
{
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
'\\'
,
'P'
,
'n'
,
'p'
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
UNICODE_STRING
driver_nameU
;
NTSTATUS
status
;
RtlInitUnicodeString
(
&
driver_nameU
,
driver_nameW
);
if
((
status
=
IoCreateDriver
(
&
driver_nameU
,
pnp_manager_driver_entry
)))
ERR
(
"Failed to create PnP manager driver, status %#x.
\n
"
,
status
);
}
void
pnp_manager_stop
(
void
)
{
IoDeleteDriver
(
pnp_manager
);
}
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