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
73b99d29
Commit
73b99d29
authored
May 01, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
May 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Use ObGetObjectType in kernel_object_from_handle.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
02df7eeb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+11
-16
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
73b99d29
...
...
@@ -366,6 +366,15 @@ static void ObReferenceObject( void *obj )
LeaveCriticalSection
(
&
obref_cs
);
}
/***********************************************************************
* ObGetObjectType (NTOSKRNL.EXE.@)
*/
POBJECT_TYPE
WINAPI
ObGetObjectType
(
void
*
object
)
{
struct
object_header
*
header
=
(
struct
object_header
*
)
object
-
1
;
return
header
->
type
;
}
static
const
POBJECT_TYPE
*
known_types
[]
=
{
&
ExEventObjectType
,
...
...
@@ -389,7 +398,6 @@ static CRITICAL_SECTION handle_map_cs = { &handle_map_critsect_debug, -1, 0, 0,
NTSTATUS
kernel_object_from_handle
(
HANDLE
handle
,
POBJECT_TYPE
type
,
void
**
ret
)
{
struct
object_header
*
header
;
void
*
obj
;
NTSTATUS
status
;
...
...
@@ -409,12 +417,7 @@ NTSTATUS kernel_object_from_handle( HANDLE handle, POBJECT_TYPE type, void **ret
return
status
;
}
if
(
obj
)
{
header
=
(
struct
object_header
*
)
obj
-
1
;
if
(
type
&&
header
->
type
!=
type
)
status
=
STATUS_OBJECT_TYPE_MISMATCH
;
}
else
if
(
!
obj
)
{
char
buf
[
256
];
OBJECT_TYPE_INFORMATION
*
type_info
=
(
OBJECT_TYPE_INFORMATION
*
)
buf
;
...
...
@@ -459,6 +462,7 @@ NTSTATUS kernel_object_from_handle( HANDLE handle, POBJECT_TYPE type, void **ret
}
if
(
!
obj
)
status
=
STATUS_NO_MEMORY
;
}
else
if
(
type
&&
ObGetObjectType
(
obj
)
!=
type
)
status
=
STATUS_OBJECT_TYPE_MISMATCH
;
LeaveCriticalSection
(
&
handle_map_cs
);
if
(
!
status
)
*
ret
=
obj
;
...
...
@@ -489,15 +493,6 @@ NTSTATUS WINAPI ObReferenceObjectByHandle( HANDLE handle, ACCESS_MASK access,
}
/***********************************************************************
* ObGetObjectType (NTOSKRNL.EXE.@)
*/
POBJECT_TYPE
WINAPI
ObGetObjectType
(
void
*
object
)
{
struct
object_header
*
header
=
(
struct
object_header
*
)
object
-
1
;
return
header
->
type
;
}
/***********************************************************************
* ObOpenObjectByPointer (NTOSKRNL.EXE.@)
*/
NTSTATUS
WINAPI
ObOpenObjectByPointer
(
void
*
obj
,
ULONG
attr
,
ACCESS_STATE
*
access_state
,
...
...
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