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
332035fb
Commit
332035fb
authored
Apr 30, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Use ObOpenObjectByPointer to get handle for kernel object.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bfe3dfb5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
19 deletions
+8
-19
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+4
-15
ntoskrnl_private.h
dlls/ntoskrnl.exe/ntoskrnl_private.h
+0
-1
sync.c
dlls/ntoskrnl.exe/sync.c
+4
-3
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
332035fb
...
...
@@ -366,20 +366,6 @@ static void ObReferenceObject( void *obj )
LeaveCriticalSection
(
&
obref_cs
);
}
HANDLE
kernel_object_handle
(
void
*
obj
,
unsigned
int
access
)
{
HANDLE
handle
=
NULL
;
SERVER_START_REQ
(
get_kernel_object_handle
)
{
req
->
manager
=
wine_server_obj_handle
(
get_device_manager
()
);
req
->
user_ptr
=
wine_server_client_ptr
(
obj
);
req
->
access
=
access
;
if
(
!
wine_server_call
(
req
))
handle
=
wine_server_ptr_handle
(
reply
->
handle
);
}
SERVER_END_REQ
;
return
handle
;
}
static
const
POBJECT_TYPE
*
known_types
[]
=
{
&
ExEventObjectType
,
...
...
@@ -1870,9 +1856,12 @@ NTSTATUS WINAPI IoGetDeviceProperty( DEVICE_OBJECT *device, DEVICE_REGISTRY_PROP
OBJECT_NAME_INFORMATION
*
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
HANDLE
handle
;
handle
=
kernel_object_handle
(
device
,
0
);
status
=
ObOpenObjectByPointer
(
device
,
OBJ_KERNEL_HANDLE
,
NULL
,
0
,
NULL
,
KernelMode
,
&
handle
);
if
(
!
status
)
{
status
=
NtQueryObject
(
handle
,
ObjectNameInformation
,
name
,
len
,
&
used_len
);
NtClose
(
handle
);
}
if
(
status
==
STATUS_SUCCESS
)
{
/* Ensure room for NULL termination */
...
...
dlls/ntoskrnl.exe/ntoskrnl_private.h
View file @
332035fb
...
...
@@ -47,7 +47,6 @@ struct _ETHREAD
};
void
*
alloc_kernel_object
(
POBJECT_TYPE
type
,
HANDLE
handle
,
SIZE_T
size
,
LONG
ref
)
DECLSPEC_HIDDEN
;
HANDLE
kernel_object_handle
(
void
*
obj
,
unsigned
int
access
)
DECLSPEC_HIDDEN
;
NTSTATUS
kernel_object_from_handle
(
HANDLE
handle
,
POBJECT_TYPE
type
,
void
**
ret
)
DECLSPEC_HIDDEN
;
extern
POBJECT_TYPE
ExEventObjectType
;
...
...
dlls/ntoskrnl.exe/sync.c
View file @
332035fb
...
...
@@ -29,6 +29,7 @@
#include "winternl.h"
#include "ddk/ntddk.h"
#include "ddk/wdm.h"
#include "ddk/ntifs.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -80,7 +81,7 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[],
{
if
(
objs
[
i
]
->
WaitListHead
.
Blink
==
INVALID_HANDLE_VALUE
)
{
handles
[
i
]
=
kernel_object_handle
(
objs
[
i
],
SYNCHRONIZE
);
ObOpenObjectByPointer
(
objs
[
i
],
OBJ_KERNEL_HANDLE
,
NULL
,
SYNCHRONIZE
,
NULL
,
KernelMode
,
&
handles
[
i
]
);
continue
;
}
...
...
@@ -266,7 +267,7 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait )
}
else
{
if
(
(
handle
=
kernel_object_handle
(
event
,
EVENT_MODIFY_STATE
)
))
if
(
!
ObOpenObjectByPointer
(
event
,
OBJ_KERNEL_HANDLE
,
NULL
,
EVENT_MODIFY_STATE
,
NULL
,
KernelMode
,
&
handle
))
{
NtSetEvent
(
handle
,
&
ret
);
NtClose
(
handle
);
...
...
@@ -297,7 +298,7 @@ LONG WINAPI KeResetEvent( PRKEVENT event )
}
else
{
if
(
(
handle
=
kernel_object_handle
(
event
,
EVENT_MODIFY_STATE
)
))
if
(
!
ObOpenObjectByPointer
(
event
,
OBJ_KERNEL_HANDLE
,
NULL
,
EVENT_MODIFY_STATE
,
NULL
,
KernelMode
,
&
handle
))
{
NtResetEvent
(
handle
,
&
ret
);
NtClose
(
handle
);
...
...
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