Commit 1c2d5172 authored by Derek Lesho's avatar Derek Lesho Committed by Alexandre Julliard

ntoskrnl.exe: Implement PsIsSystemThread.

parent 1064e20a
......@@ -3057,6 +3057,15 @@ HANDLE WINAPI PsGetCurrentThreadId(void)
/***********************************************************************
* PsIsSystemThread (NTOSKRNL.EXE.@)
*/
BOOLEAN WINAPI PsIsSystemThread(PETHREAD thread)
{
return thread->kthread.process == PsInitialSystemProcess;
}
/***********************************************************************
* PsGetVersion (NTOSKRNL.EXE.@)
*/
BOOLEAN WINAPI PsGetVersion(ULONG *major, ULONG *minor, ULONG *build, UNICODE_STRING *version )
......
......@@ -908,7 +908,7 @@
@ stdcall PsImpersonateClient(ptr ptr long long long)
@ extern PsInitialSystemProcess
@ stub PsIsProcessBeingDebugged
@ stub PsIsSystemThread
@ stdcall PsIsSystemThread(ptr)
@ stub PsIsThreadImpersonating
@ stub PsIsThreadTerminating
@ stub PsJobType
......
......@@ -39,6 +39,11 @@ struct _KTHREAD
CLIENT_ID id;
};
struct _ETHREAD
{
struct _KTHREAD kthread;
};
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;
......
......@@ -337,6 +337,8 @@ static void test_currentprocess(void)
thread = PsGetCurrentThread();
ret = wait_single( thread, 0 );
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
ok(!PsIsSystemThread((PETHREAD)KeGetCurrentThread()), "unexpected system thread\n");
}
static void sleep(void)
......
......@@ -131,6 +131,7 @@ typedef struct _FS_FILTER_CALLBACKS
BOOLEAN WINAPI FsRtlIsNameInExpression(PUNICODE_STRING, PUNICODE_STRING, BOOLEAN, PWCH);
NTSTATUS WINAPI ObQueryNameString(PVOID,POBJECT_NAME_INFORMATION,ULONG,PULONG);
BOOLEAN WINAPI PsIsSystemThread(PETHREAD);
NTSTATUS WINAPI PsLookupProcessByProcessId(HANDLE,PEPROCESS*);
NTSTATUS WINAPI PsLookupThreadByThreadId(HANDLE,PETHREAD*);
void WINAPI PsRevertToSelf(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment