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
bfe3dfb5
Commit
bfe3dfb5
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: Implement ObOpenObjectByPointer.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
136312e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
3 deletions
+53
-3
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+34
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-1
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+17
-2
ntifs.h
include/ddk/ntifs.h
+1
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
bfe3dfb5
...
...
@@ -511,6 +511,40 @@ POBJECT_TYPE WINAPI ObGetObjectType( void *object )
return
header
->
type
;
}
/***********************************************************************
* ObOpenObjectByPointer (NTOSKRNL.EXE.@)
*/
NTSTATUS
WINAPI
ObOpenObjectByPointer
(
void
*
obj
,
ULONG
attr
,
ACCESS_STATE
*
access_state
,
ACCESS_MASK
access
,
POBJECT_TYPE
type
,
KPROCESSOR_MODE
mode
,
HANDLE
*
handle
)
{
NTSTATUS
status
;
TRACE
(
"%p %x %p %x %p %d %p
\n
"
,
obj
,
attr
,
access_state
,
access
,
type
,
mode
,
handle
);
if
(
mode
!=
KernelMode
)
{
FIXME
(
"UserMode access not implemented
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
}
if
(
attr
&
~
OBJ_KERNEL_HANDLE
)
FIXME
(
"access %x not supported
\n
"
,
access
);
if
(
access_state
)
FIXME
(
"access_state not implemented
\n
"
);
if
(
type
&&
ObGetObjectType
(
obj
)
!=
type
)
return
STATUS_OBJECT_TYPE_MISMATCH
;
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
(
!
(
status
=
wine_server_call
(
req
)))
*
handle
=
wine_server_ptr_handle
(
reply
->
handle
);
}
SERVER_END_REQ
;
return
status
;
}
static
void
*
create_file_object
(
HANDLE
handle
);
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
bfe3dfb5
...
...
@@ -822,7 +822,7 @@
@ stub ObLogSecurityDescriptor
@ stub ObMakeTemporaryObject
@ stub ObOpenObjectByName
@ st
ub ObOpenObjectByPointer
@ st
dcall ObOpenObjectByPointer(ptr long ptr long ptr long ptr)
@ stdcall ObQueryNameString(ptr ptr long ptr)
@ stub ObQueryObjectAuditingByHandle
@ stdcall ObReferenceObjectByHandle(long long ptr long ptr ptr)
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
bfe3dfb5
...
...
@@ -773,7 +773,7 @@ static void test_ob_reference(const WCHAR *test_path)
{
POBJECT_TYPE
(
WINAPI
*
pObGetObjectType
)(
void
*
);
OBJECT_ATTRIBUTES
attr
=
{
sizeof
(
attr
)
};
HANDLE
event_handle
,
file_handle
,
file_handle2
,
thread_handle
;
HANDLE
event_handle
,
file_handle
,
file_handle2
,
thread_handle
,
handle
;
DISPATCHER_HEADER
*
header
;
FILE_OBJECT
*
file
;
void
*
obj1
,
*
obj2
;
...
...
@@ -878,9 +878,24 @@ static void test_ob_reference(const WCHAR *test_path)
status
=
wait_single
(
header
,
0
);
ok
(
status
==
0
||
status
==
STATUS_TIMEOUT
,
"got %#x
\n
"
,
status
);
ObDereferenceObject
(
obj1
);
ObDereferenceObject
(
obj2
);
status
=
ObOpenObjectByPointer
(
obj1
,
OBJ_KERNEL_HANDLE
,
NULL
,
0
,
NULL
,
KernelMode
,
&
handle
);
ok
(
status
==
STATUS_SUCCESS
,
"ObOpenObjectByPointer failed: %#x
\n
"
,
status
);
status
=
ZwClose
(
handle
);
ok
(
!
status
,
"ZwClose failed: %#x
\n
"
,
status
);
status
=
ObReferenceObjectByHandle
(
thread_handle
,
SYNCHRONIZE
,
*
pPsThreadType
,
KernelMode
,
&
obj2
,
NULL
);
ok
(
!
status
,
"ObReferenceObjectByHandle failed: %#x
\n
"
,
status
);
ok
(
obj1
==
obj2
,
"obj1 != obj2
\n
"
);
ObDereferenceObject
(
obj2
);
status
=
ObOpenObjectByPointer
(
obj1
,
OBJ_KERNEL_HANDLE
,
NULL
,
0
,
*
pIoFileObjectType
,
KernelMode
,
&
handle
);
ok
(
status
==
STATUS_OBJECT_TYPE_MISMATCH
,
"ObOpenObjectByPointer returned: %#x
\n
"
,
status
);
ObDereferenceObject
(
obj1
);
status
=
ZwClose
(
thread_handle
);
ok
(
!
status
,
"ZwClose failed: %#x
\n
"
,
status
);
...
...
include/ddk/ntifs.h
View file @
bfe3dfb5
...
...
@@ -130,6 +130,7 @@ typedef struct _FS_FILTER_CALLBACKS
}
FS_FILTER_CALLBACKS
,
*
PFS_FILTER_CALLBACKS
;
BOOLEAN
WINAPI
FsRtlIsNameInExpression
(
PUNICODE_STRING
,
PUNICODE_STRING
,
BOOLEAN
,
PWCH
);
NTSTATUS
WINAPI
ObOpenObjectByPointer
(
void
*
,
ULONG
,
PACCESS_STATE
,
ACCESS_MASK
,
POBJECT_TYPE
,
KPROCESSOR_MODE
,
HANDLE
*
);
NTSTATUS
WINAPI
ObQueryNameString
(
PVOID
,
POBJECT_NAME_INFORMATION
,
ULONG
,
PULONG
);
BOOLEAN
WINAPI
PsIsSystemThread
(
PETHREAD
);
NTSTATUS
WINAPI
PsLookupProcessByProcessId
(
HANDLE
,
PEPROCESS
*
);
...
...
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