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
d01cd45b
Commit
d01cd45b
authored
Feb 26, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Use kernel object allocators for device object.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bb94d94b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+5
-4
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
d01cd45b
...
...
@@ -1218,7 +1218,8 @@ static const WCHAR device_type_name[] = {'D','e','v','i','c','e',0};
static
struct
_OBJECT_TYPE
device_type
=
{
device_type_name
device_type_name
,
free_kernel_object
};
POBJECT_TYPE
IoDeviceObjectType
=
&
device_type
;
...
...
@@ -1240,7 +1241,7 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
TRACE
(
"(%p, %u, %s, %u, %x, %u, %p)
\n
"
,
driver
,
ext_size
,
debugstr_us
(
name
),
type
,
characteristics
,
exclusive
,
ret_device
);
if
(
!
(
device
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
device
)
+
ext_size
)))
if
(
!
(
device
=
alloc_kernel_object
(
IoDeviceObjectType
,
sizeof
(
DEVICE_OBJECT
)
+
ext_size
,
1
)))
return
STATUS_NO_MEMORY
;
SERVER_START_REQ
(
create_device
)
...
...
@@ -1268,7 +1269,7 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
*
ret_device
=
device
;
}
else
HeapFree
(
GetProcessHeap
(),
0
,
device
);
else
free_kernel_object
(
device
);
return
status
;
}
...
...
@@ -1296,7 +1297,7 @@ void WINAPI IoDeleteDevice( DEVICE_OBJECT *device )
while
(
*
prev
&&
*
prev
!=
device
)
prev
=
&
(
*
prev
)
->
NextDevice
;
if
(
*
prev
)
*
prev
=
(
*
prev
)
->
NextDevice
;
NtClose
(
device
->
Reserved
);
HeapFree
(
GetProcessHeap
(),
0
,
device
);
dereference_kernel_object
(
device
);
}
}
...
...
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