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
850fd237
Commit
850fd237
authored
May 16, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
May 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implement PsGetProcessInheritedFromUniqueProcessId.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ed140a7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+9
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+2
-2
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+16
-0
wdm.h
include/ddk/wdm.h
+1
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
850fd237
...
...
@@ -2589,6 +2589,15 @@ HANDLE WINAPI PsGetProcessId(PEPROCESS process)
return
(
HANDLE
)
process
->
info
.
UniqueProcessId
;
}
/*********************************************************************
* PsGetProcessInheritedFromUniqueProcessId (NTOSKRNL.@)
*/
HANDLE
WINAPI
PsGetProcessInheritedFromUniqueProcessId
(
PEPROCESS
process
)
{
HANDLE
id
=
(
HANDLE
)
process
->
info
.
InheritedFromUniqueProcessId
;
TRACE
(
"%p -> %p
\n
"
,
process
,
id
);
return
id
;
}
static
void
*
create_thread_object
(
HANDLE
handle
)
{
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
850fd237
...
...
@@ -888,7 +888,7 @@
@ stub PsGetProcessExitTime
@ stdcall PsGetProcessId(ptr)
@ stub PsGetProcessImageFileName
@ st
ub PsGetProcessInheritedFromUniqueProcessId
@ st
dcall PsGetProcessInheritedFromUniqueProcessId(ptr)
@ stub PsGetProcessJob
@ stub PsGetProcessPeb
@ stub PsGetProcessPriorityClass
...
...
@@ -1374,7 +1374,7 @@
@ stdcall -private ZwQueryFullAttributesFile(ptr ptr) NtQueryFullAttributesFile
@ stdcall -private ZwQueryInformationFile(long ptr ptr long long) NtQueryInformationFile
@ stdcall -private ZwQueryInformationJobObject(long long ptr long ptr) NtQueryInformationJobObject
@ stdcall
-private
ZwQueryInformationProcess(long long ptr long ptr) NtQueryInformationProcess
@ stdcall ZwQueryInformationProcess(long long ptr long ptr) NtQueryInformationProcess
@ stdcall -private ZwQueryInformationThread(long long ptr long ptr) NtQueryInformationThread
@ stdcall -private ZwQueryInformationToken(long long ptr long ptr) NtQueryInformationToken
@ stdcall -private ZwQueryInstallUILanguage(ptr) NtQueryInstallUILanguage
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
850fd237
...
...
@@ -55,6 +55,8 @@ static PEPROCESS *pPsInitialSystemProcess;
void
WINAPI
ObfReferenceObject
(
void
*
obj
);
NTSTATUS
WINAPI
ZwQueryInformationProcess
(
HANDLE
,
PROCESSINFOCLASS
,
void
*
,
ULONG
,
ULONG
*
);
extern
int
CDECL
_vsnprintf
(
char
*
str
,
size_t
len
,
const
char
*
format
,
__ms_va_list
argptr
);
static
void
kvprintf
(
const
char
*
format
,
__ms_va_list
ap
)
...
...
@@ -323,7 +325,9 @@ static NTSTATUS wait_single_handle(HANDLE handle, ULONGLONG timeout)
static
void
test_current_thread
(
BOOL
is_system
)
{
PROCESS_BASIC_INFORMATION
info
;
DISPATCHER_HEADER
*
header
;
HANDLE
process_handle
,
id
;
PEPROCESS
current
;
PETHREAD
thread
;
NTSTATUS
ret
;
...
...
@@ -349,6 +353,18 @@ static void test_current_thread(BOOL is_system)
ok
(
PsGetThreadId
((
PETHREAD
)
KeGetCurrentThread
())
==
PsGetCurrentThreadId
(),
"thread IDs don't match
\n
"
);
ok
(
PsIsSystemThread
((
PETHREAD
)
KeGetCurrentThread
())
==
is_system
,
"unexpected system thread
\n
"
);
ret
=
ObOpenObjectByPointer
(
current
,
OBJ_KERNEL_HANDLE
,
NULL
,
PROCESS_QUERY_INFORMATION
,
NULL
,
KernelMode
,
&
process_handle
);
ok
(
!
ret
,
"ObOpenObjectByPointer failed: %#x
\n
"
,
ret
);
ret
=
ZwQueryInformationProcess
(
process_handle
,
ProcessBasicInformation
,
&
info
,
sizeof
(
info
),
NULL
);
ok
(
!
ret
,
"ZwQueryInformationProcess failed: %#x
\n
"
,
ret
);
id
=
PsGetProcessInheritedFromUniqueProcessId
(
current
);
ok
(
id
==
(
HANDLE
)
info
.
InheritedFromUniqueProcessId
,
"unexpected process id %p
\n
"
,
id
);
ret
=
ZwClose
(
process_handle
);
ok
(
!
ret
,
"ZwClose failed: %#x
\n
"
,
ret
);
}
static
void
sleep
(
void
)
...
...
include/ddk/wdm.h
View file @
850fd237
...
...
@@ -1663,6 +1663,7 @@ NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PC
#define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
HANDLE
WINAPI
PsGetCurrentProcessId
(
void
);
HANDLE
WINAPI
PsGetCurrentThreadId
(
void
);
HANDLE
WINAPI
PsGetProcessInheritedFromUniqueProcessId
(
PEPROCESS
);
BOOLEAN
WINAPI
PsGetVersion
(
ULONG
*
,
ULONG
*
,
ULONG
*
,
UNICODE_STRING
*
);
NTSTATUS
WINAPI
PsTerminateSystemThread
(
NTSTATUS
);
...
...
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