diff --git a/reactos/include/ddk/psfuncs.h b/reactos/include/ddk/psfuncs.h index 5baa97592d8..53df80ba8ca 100644 --- a/reactos/include/ddk/psfuncs.h +++ b/reactos/include/ddk/psfuncs.h @@ -1,15 +1,8 @@ -/* $Id: psfuncs.h,v 1.11 2000/09/06 03:00:10 phreak Exp $ +/* $Id: psfuncs.h,v 1.12 2000/12/22 13:29:48 ekohl Exp $ */ #ifndef _INCLUDE_DDK_PSFUNCS_H #define _INCLUDE_DDK_PSFUNCS_H -PACCESS_TOKEN PsReferenceEffectiveToken(struct _ETHREAD* Thread, - PTOKEN_TYPE TokenType, - PUCHAR b, - PSECURITY_IMPERSONATION_LEVEL Level); - -NTSTATUS PsOpenTokenOfProcess(HANDLE ProcessHandle, - PACCESS_TOKEN* Token); NTSTATUS STDCALL PsAssignImpersonationToken (struct _ETHREAD* Thread, HANDLE TokenHandle); @@ -40,12 +33,7 @@ NTSTATUS STDCALL PsCreateSystemThread(PHANDLE ThreadHandle, PKSTART_ROUTINE StartRoutine, PVOID StartContext); NTSTATUS STDCALL PsTerminateSystemThread(NTSTATUS ExitStatus); -ULONG PsSuspendThread(struct _ETHREAD* Thread, - PNTSTATUS WaitStatus, - UCHAR Alertable, - ULONG WaitMode); -ULONG PsResumeThread(struct _ETHREAD* Thread, - PNTSTATUS WaitStatus); + struct _ETHREAD* STDCALL PsGetCurrentThread(VOID); struct _EPROCESS* STDCALL PsGetCurrentProcess(VOID); PACCESS_TOKEN STDCALL PsReferenceImpersonationToken(struct _ETHREAD* Thread, diff --git a/reactos/include/ntos/ps.h b/reactos/include/ntos/ps.h index 3f80a107cb4..f1dc0684cac 100644 --- a/reactos/include/ntos/ps.h +++ b/reactos/include/ntos/ps.h @@ -59,5 +59,7 @@ #define NORMAL_PRIORITY_CLASS (32) #define REALTIME_PRIORITY_CLASS (256) +/* ResumeThread / SuspendThread */ +#define MAXIMUM_SUSPEND_COUNT (0x7f) #endif /* __INCLUDE_PS_H */ diff --git a/reactos/ntoskrnl/include/internal/ps.h b/reactos/ntoskrnl/include/internal/ps.h index bfa5a58a9ec..878fdbe8e19 100644 --- a/reactos/ntoskrnl/include/internal/ps.h +++ b/reactos/ntoskrnl/include/internal/ps.h @@ -381,12 +381,15 @@ PACCESS_TOKEN PsReferenceEffectiveToken(PETHREAD Thread, NTSTATUS PsOpenTokenOfProcess(HANDLE ProcessHandle, PACCESS_TOKEN* Token); -ULONG PsSuspendThread(PETHREAD Thread, - PNTSTATUS WaitStatus, - UCHAR Alertable, - ULONG WaitMode); -ULONG PsResumeThread(PETHREAD Thread, - PNTSTATUS WaitStatus); +ULONG PsFreezeThread(PETHREAD Thread, + PNTSTATUS WaitStatus, + UCHAR Alertable, + ULONG WaitMode); +ULONG PsUnfreezeThread(PETHREAD Thread, + PNTSTATUS WaitStatus); + +ULONG PsSuspendThread(PETHREAD Thread); +ULONG PsResumeThread(PETHREAD Thread); #define THREAD_STATE_INVALID (0) diff --git a/reactos/ntoskrnl/ke/kthread.c b/reactos/ntoskrnl/ke/kthread.c index b8306c1d268..4c1e2e0c3d0 100644 --- a/reactos/ntoskrnl/ke/kthread.c +++ b/reactos/ntoskrnl/ke/kthread.c @@ -139,8 +139,8 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread) KeInitializeSemaphore(&Thread->SuspendSemaphore, 0, 255); Thread->ThreadListEntry.Flink = NULL; Thread->ThreadListEntry.Blink = NULL; - Thread->FreezeCount = 1; - Thread->SuspendCount = 0; + Thread->FreezeCount = 0; + Thread->SuspendCount = 1; /* * Initialize ReactOS specific members