Use official THREAD_STATE enumeration for thread states
Modified: trunk/reactos/include/ntos/zwtypes.h
Modified: trunk/reactos/ntoskrnl/dbg/kdb_cli.c
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h
Modified: trunk/reactos/ntoskrnl/kd/gdbstub.c
Modified: trunk/reactos/ntoskrnl/ke/apc.c
Modified: trunk/reactos/ntoskrnl/ke/dpc.c
Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
Modified: trunk/reactos/ntoskrnl/ke/main.c
Modified: trunk/reactos/ntoskrnl/ke/wait.c
Modified: trunk/reactos/ntoskrnl/ps/kill.c
Modified: trunk/reactos/ntoskrnl/ps/process.c
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c
Modified: trunk/reactos/ntoskrnl/ps/thread.c
_____
Modified: trunk/reactos/include/ntos/zwtypes.h
--- trunk/reactos/include/ntos/zwtypes.h 2005-04-18 14:56:52 UTC
(rev 14670)
+++ trunk/reactos/include/ntos/zwtypes.h 2005-04-18 15:49:57 UTC
(rev 14671)
@@ -338,7 +338,7 @@
KPRIORITY Priority;
LONG BasePriority;
ULONG ContextSwitches;
- ULONG ThreadState;
+ LONG ThreadState;
KWAIT_REASON WaitReason;
} SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
_____
Modified: trunk/reactos/ntoskrnl/dbg/kdb_cli.c
--- trunk/reactos/ntoskrnl/dbg/kdb_cli.c 2005-04-18 14:56:52 UTC
(rev 14670)
+++ trunk/reactos/ntoskrnl/dbg/kdb_cli.c 2005-04-18 15:49:57 UTC
(rev 14671)
@@ -878,10 +878,10 @@
ULONG Eip;
ULONG ul = 0;
PCHAR State, pend, str1, str2;
- STATIC CONST PCHAR ThreadStateToString[THREAD_STATE_MAX] =
+ STATIC CONST PCHAR ThreadStateToString[DeferredReady+1] =
{ "Initialized", "Ready",
"Running",
- "Suspended", "Frozen",
"Terminated1",
- "Terminated2", "Blocked"
};
+ "Standby", "Terminated",
"Waiting",
+ "Transition",
"DeferredReady" };
ASSERT(KdbCurrentProcess != NULL);
if (Argc >= 2 && _stricmp(Argv[1], "list") == 0)
@@ -943,7 +943,7 @@
if (Ebp != NULL) /* FIXME: Should we attach to the process
to read Ebp[1]? */
KdbpSafeReadMemory(&Eip, Ebp + 1, sizeof (Eip));;
}
- if (Thread->Tcb.State < THREAD_STATE_MAX)
+ if (Thread->Tcb.State < (DeferredReady + 1))
State = ThreadStateToString[Thread->Tcb.State];
else
State = "Unknown";
@@ -1001,7 +1001,7 @@
}
}
- if (Thread->Tcb.State < THREAD_STATE_MAX)
+ if (Thread->Tcb.State < (DeferredReady + 1))
State = ThreadStateToString[Thread->Tcb.State];
else
State = "Unknown";
_____
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
--- trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -572,8 +572,10 @@
return (STATUS_INFO_LENGTH_MISMATCH); // in case buffer
size is too small
}
+ DPRINT1("getting next proc\n");
syspr = PsGetNextProcess(NULL);
pr = syspr;
+ DPRINT1("next proc: %x\n", pr);
pCur = (unsigned char *)Spi;
do
@@ -661,6 +663,7 @@
// SpiCur->Threads[i].CreateTime = current->CreateTime;
SpiCur->Threads[i].WaitTime = current->Tcb.WaitTime;
SpiCur->Threads[i].StartAddress = (PVOID)
current->StartAddress;
+ DPRINT1("cid: %d\n", current->Cid.UniqueThread);
SpiCur->Threads[i].ClientId = current->Cid;
SpiCur->Threads[i].Priority = current->Tcb.Priority;
SpiCur->Threads[i].BasePriority =
current->Tcb.BasePriority;
@@ -670,8 +673,9 @@
i++;
current_entry = current_entry->Flink;
}
-
+
pr = PsGetNextProcess(pr);
+ DPRINT1("next proc: %x\n", pr);
nThreads = 0;
if ((pr == syspr) || (pr == NULL))
{
@@ -688,6 +692,7 @@
}
*ReqSize = ovlSize;
+ DPRINT1("done\n");
return (STATUS_SUCCESS);
}
_____
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
--- trunk/reactos/ntoskrnl/include/internal/ke.h 2005-04-18
14:56:52 UTC (rev 14670)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h 2005-04-18
15:49:57 UTC (rev 14671)
@@ -49,6 +49,17 @@
#define IPI_REQUEST_DPC 2
#define IPI_REQUEST_FREEZE 3
+typedef enum _KTHREAD_STATE {
+ Initialized,
+ Ready,
+ Running,
+ Standby,
+ Terminated,
+ Waiting,
+ Transition,
+ DeferredReady,
+} THREAD_STATE, *PTHREAD_STATE;
+
/* MACROS
************************************************************************
*/
#define KeEnterCriticalRegion(X) \
_____
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h
--- trunk/reactos/ntoskrnl/include/internal/ps.h 2005-04-18
14:56:52 UTC (rev 14670)
+++ trunk/reactos/ntoskrnl/include/internal/ps.h 2005-04-18
15:49:57 UTC (rev 14671)
@@ -496,15 +496,6 @@
PspInitializeProcessSecurity(PEPROCESS Process,
PEPROCESS Parent OPTIONAL);
-#define THREAD_STATE_INITIALIZED (0)
-#define THREAD_STATE_READY (1)
-#define THREAD_STATE_RUNNING (2)
-#define THREAD_STATE_SUSPENDED (3)
-#define THREAD_STATE_FROZEN (4)
-#define THREAD_STATE_TERMINATED_1 (5)
-#define THREAD_STATE_TERMINATED_2 (6)
-#define THREAD_STATE_BLOCKED (7)
-#define THREAD_STATE_MAX (8)
/*
_____
Modified: trunk/reactos/ntoskrnl/kd/gdbstub.c
--- trunk/reactos/ntoskrnl/kd/gdbstub.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/kd/gdbstub.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -150,17 +150,16 @@
{ 4, FIELD_OFFSET (KTRAP_FRAME_X86, Fs), FIELD_OFFSET (CONTEXT,
SegFs), TRUE },
{ 4, FIELD_OFFSET (KTRAP_FRAME_X86, Gs), FIELD_OFFSET (CONTEXT,
SegGs), TRUE }
};
-
-static PCHAR GspThreadStates[THREAD_STATE_MAX] =
-{
- "Initialized", /* THREAD_STATE_INITIALIZED */
- "Ready", /* THREAD_STATE_READY */
- "Running", /* THREAD_STATE_RUNNING */
- "Suspended", /* THREAD_STATE_SUSPENDED */
- "Frozen", /* THREAD_STATE_FROZEN */
- "Terminated 1", /* THREAD_STATE_TERMINATED_1 */
- "Terminated 2", /* THREAD_STATE_TERMINATED_2 */
- "Blocked" /* THREAD_STATE_BLOCKED */
+
+static PCHAR GspThreadStates[DeferredReady+1] =
+{ "Initialized",
+ "Ready",
+ "Running",
+ "Standby",
+ "Terminated",
+ "Waiting",
+ "Transition",
+ "DeferredReady"
};
char *
_____
Modified: trunk/reactos/ntoskrnl/ke/apc.c
--- trunk/reactos/ntoskrnl/ke/apc.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ke/apc.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -313,13 +313,13 @@
Thread->ApcState.KernelApcPending = TRUE;
/* Check the Thread State */
- if (Thread->State == THREAD_STATE_RUNNING) {
+ if (Thread->State == Running) {
/* FIXME: Use IPI */
DPRINT ("Requesting APC Interrupt for Running Thread \n");
HalRequestSoftwareInterrupt(APC_LEVEL);
- } else if ((Thread->State == THREAD_STATE_BLOCKED) &&
(Thread->WaitIrql == PASSIVE_LEVEL) &&
+ } else if ((Thread->State == Waiting) && (Thread->WaitIrql ==
PASSIVE_LEVEL) &&
((Apc->NormalRoutine == NULL) ||
((!Thread->KernelApcDisable) &&
(!Thread->ApcState.KernelApcInProgress)))) {
@@ -327,7 +327,7 @@
KiAbortWaitThread(Thread, STATUS_KERNEL_APC,
PriorityBoost);
}
- } else if ((Thread->State == THREAD_STATE_BLOCKED) &&
+ } else if ((Thread->State == Waiting) &&
(Thread->WaitMode == UserMode) &&
(Thread->Alertable)) {
_____
Modified: trunk/reactos/ntoskrnl/ke/dpc.c
--- trunk/reactos/ntoskrnl/ke/dpc.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ke/dpc.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -491,7 +491,7 @@
/* Dispatch the Thread */
KeLowerIrql(DISPATCH_LEVEL);
- KiDispatchThread(THREAD_STATE_READY);
+ KiDispatchThread(Ready);
}
/*
_____
Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
--- trunk/reactos/ntoskrnl/ke/i386/kernel.c 2005-04-18 14:56:52 UTC
(rev 14670)
+++ trunk/reactos/ntoskrnl/ke/i386/kernel.c 2005-04-18 15:49:57 UTC
(rev 14671)
@@ -146,7 +146,7 @@
NULL,
KernelMode,
FALSE);
- IdleThread->Tcb.State = THREAD_STATE_RUNNING;
+ IdleThread->Tcb.State = Running;
IdleThread->Tcb.FreezeCount = 0;
IdleThread->Tcb.Affinity = 1 << Id;
IdleThread->Tcb.UserAffinity = 1 << Id;
_____
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
--- trunk/reactos/ntoskrnl/ke/kthread.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ke/kthread.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -45,7 +45,7 @@
KiInsertIntoThreadList(KPRIORITY Priority,
PKTHREAD Thread)
{
- ASSERT(THREAD_STATE_READY == Thread->State);
+ ASSERT(Ready == Thread->State);
ASSERT(Thread->Priority == Priority);
if (Priority >= MAXIMUM_PRIORITY || Priority < LOW_PRIORITY) {
@@ -62,7 +62,7 @@
VOID
KiRemoveFromThreadList(PKTHREAD Thread)
{
- ASSERT(THREAD_STATE_READY == Thread->State);
+ ASSERT(Ready == Thread->State);
RemoveEntryList(&Thread->QueueListEntry);
if (IsListEmpty(&PriorityListHead[(ULONG)Thread->Priority])) {
@@ -89,12 +89,12 @@
current = CONTAINING_RECORD(current_entry, KTHREAD,
QueueListEntry);
- if (current->State != THREAD_STATE_READY) {
+ if (current->State != Ready) {
DPRINT1("%d/%d\n", ¤t, current->State);
}
- ASSERT(current->State == THREAD_STATE_READY);
+ ASSERT(current->State == Ready);
if (current->Affinity & Affinity) {
@@ -123,7 +123,7 @@
CurrentThread->State = (UCHAR)NewThreadStatus;
- if (NewThreadStatus == THREAD_STATE_READY) {
+ if (NewThreadStatus == Ready) {
KiInsertIntoThreadList(CurrentThread->Priority,
CurrentThread);
@@ -137,7 +137,7 @@
if (Candidate == CurrentThread) {
- Candidate->State = THREAD_STATE_RUNNING;
+ Candidate->State = Ready;
KeReleaseDispatcherDatabaseLockFromDpcLevel();
return;
}
@@ -149,7 +149,7 @@
DPRINT("Scheduling %x(%d)\n",Candidate, CurrentPriority);
- Candidate->State = THREAD_STATE_RUNNING;
+ Candidate->State = Ready;
OldThread = CurrentThread;
CurrentThread = Candidate;
@@ -199,7 +199,7 @@
Thread->WaitBlockList = NULL;
/* Dispatch it and return status */
- KiDispatchThreadNoLock (THREAD_STATE_READY);
+ KiDispatchThreadNoLock (Ready);
if (Status != NULL) *Status = STATUS_KERNEL_APC;
} else {
@@ -211,7 +211,7 @@
Thread->WaitReason = WaitReason;
/* Dispatch it and return status */
- KiDispatchThreadNoLock(THREAD_STATE_BLOCKED);
+ KiDispatchThreadNoLock(Waiting);
DPRINT("Dispatching Thread as blocked: %d\n",
Thread->WaitStatus);
if (Status != NULL) *Status = Thread->WaitStatus;
}
@@ -241,17 +241,16 @@
PNTSTATUS WaitStatus,
KPRIORITY Increment)
{
- if (THREAD_STATE_TERMINATED_1 == Thread->State ||
- THREAD_STATE_TERMINATED_2 == Thread->State) {
+ if (Terminated == Thread->State) {
DPRINT("Can't unblock thread 0x%x because it's terminating\n",
Thread);
- } else if (THREAD_STATE_READY == Thread->State ||
- THREAD_STATE_RUNNING == Thread->State) {
+ } else if (Ready == Thread->State ||
+ Running == Thread->State) {
DPRINT("Can't unblock thread 0x%x because it's %s\n",
- Thread, (Thread->State == THREAD_STATE_READY ? "ready" :
"running"));
+ Thread, (Thread->State == Ready ? "ready" :
"running"));
} else {
@@ -279,7 +278,7 @@
Thread->WaitStatus = *WaitStatus;
}
- Thread->State = THREAD_STATE_READY;
+ Thread->State = Ready;
KiInsertIntoThreadList(Thread->Priority, Thread);
Processor = KeGetCurrentProcessorNumber();
Affinity = Thread->Affinity;
@@ -588,7 +587,7 @@
if (Thread->Alerted[KernelMode] == FALSE) {
/* If it's Blocked, unblock if it we should */
- if (Thread->State == THREAD_STATE_BLOCKED &&
Thread->Alertable) {
+ if (Thread->State == Waiting && Thread->Alertable) {
DPRINT("Aborting Wait\n");
KiAbortWaitThread(Thread, STATUS_ALERTED,
THREAD_ALERT_INCREMENT);
@@ -639,7 +638,7 @@
if (PreviousState == FALSE) {
/* If it's Blocked, unblock if it we should */
- if (Thread->State == THREAD_STATE_BLOCKED &&
+ if (Thread->State == Waiting &&
(AlertMode == KernelMode || Thread->WaitMode == AlertMode)
&&
Thread->Alertable) {
@@ -779,7 +778,7 @@
MmUpdatePageDir((PEPROCESS)Process, (PVOID)Thread,
sizeof(ETHREAD));
/* Set the Thread to initalized */
- Thread->State = THREAD_STATE_INITIALIZED;
+ Thread->State = Initialized;
/* The Native API function will initialize the TEB field later */
Thread->Teb = NULL;
@@ -1017,7 +1016,7 @@
/* We need to dispatch a new thread */
CurrentThread->WaitIrql = OldIrql;
- KiDispatchThreadNoLock(THREAD_STATE_READY);
+ KiDispatchThreadNoLock(Ready);
KeLowerIrql(OldIrql);
}
}
@@ -1080,7 +1079,7 @@
/* We need to dispatch a new thread */
CurrentThread->WaitIrql = OldIrql;
- KiDispatchThreadNoLock(THREAD_STATE_READY);
+ KiDispatchThreadNoLock(Ready);
KeLowerIrql(OldIrql);
}
}
@@ -1146,7 +1145,7 @@
CurrentThread = KeGetCurrentThread();
- if (Thread->State == THREAD_STATE_READY) {
+ if (Thread->State == Ready) {
KiRemoveFromThreadList(Thread);
Thread->BasePriority = Thread->Priority = (CHAR)Priority;
@@ -1154,12 +1153,12 @@
if (CurrentThread->Priority < Priority) {
- KiDispatchThreadNoLock(THREAD_STATE_READY);
+ KiDispatchThreadNoLock(Ready);
KeLowerIrql(OldIrql);
return (OldPriority);
}
- } else if (Thread->State == THREAD_STATE_RUNNING) {
+ } else if (Thread->State == Running) {
Thread->BasePriority = Thread->Priority = (CHAR)Priority;
@@ -1171,7 +1170,7 @@
if (Thread == CurrentThread) {
- KiDispatchThreadNoLock(THREAD_STATE_READY);
+ KiDispatchThreadNoLock(Ready);
KeLowerIrql(OldIrql);
return (OldPriority);
@@ -1229,14 +1228,14 @@
Thread->Affinity = Affinity;
- if (Thread->State == THREAD_STATE_RUNNING) {
+ if (Thread->State == Running) {
ProcessorMask = 1 << KeGetCurrentKPCR()->ProcessorNumber;
if (Thread == KeGetCurrentThread()) {
if (!(Affinity & ProcessorMask)) {
- KiDispatchThreadNoLock(THREAD_STATE_READY);
+ KiDispatchThreadNoLock(Ready);
KeLowerIrql(OldIrql);
return STATUS_SUCCESS;
}
@@ -1318,7 +1317,7 @@
}
/* Find a new Thread */
- KiDispatchThreadNoLock(THREAD_STATE_TERMINATED_1);
+ KiDispatchThreadNoLock(Terminated);
}
/*
_____
Modified: trunk/reactos/ntoskrnl/ke/main.c
--- trunk/reactos/ntoskrnl/ke/main.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ke/main.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -53,7 +53,6 @@
ULONG_PTR FirstKrnlPhysAddr;
ULONG_PTR LastKrnlPhysAddr;
ULONG_PTR LastKernelAddress;
-volatile BOOLEAN Initialized = FALSE;
ULONG KeLargestCacheLine = 0x40; /* FIXME: Arch-specific */
_____
Modified: trunk/reactos/ntoskrnl/ke/wait.c
--- trunk/reactos/ntoskrnl/ke/wait.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ke/wait.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -724,7 +724,7 @@
/* If we are blocked, we must be waiting on something also */
DPRINT("KiAbortWaitThread: %x, Status: %x, %x \n", Thread,
WaitStatus, Thread->WaitBlockList);
- ASSERT((Thread->State == THREAD_STATE_BLOCKED) ==
(Thread->WaitBlockList != NULL));
+ ASSERT((Thread->State == Waiting) == (Thread->WaitBlockList !=
NULL));
/* Remove the Wait Blocks from the list */
DPRINT("Removing waits\n");
@@ -886,7 +886,7 @@
if (!KeIsExecutingDpc() && OldIrql < DISPATCH_LEVEL &&
KeGetCurrentThread() != NULL &&
KeGetCurrentThread() == KeGetCurrentPrcb()->IdleThread) {
- KiDispatchThreadNoLock(THREAD_STATE_READY);
+ KiDispatchThreadNoLock(Ready);
KeLowerIrql(OldIrql);
} else {
_____
Modified: trunk/reactos/ntoskrnl/ps/kill.c
--- trunk/reactos/ntoskrnl/ps/kill.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ps/kill.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -151,7 +151,7 @@
{
PEPROCESS Process = (PEPROCESS)ObjectBody;
- DPRINT1("PiDeleteProcess(ObjectBody
%x)\n",Process->UniqueProcessId);
+ DPRINT("PiDeleteProcess(ObjectBody %x)\n", ObjectBody);
/* Delete the CID Handle */
if(Process->UniqueProcessId != NULL) {
@@ -160,6 +160,7 @@
}
/* KDB hook */
+ DPRINT1("deleted: %d\n", Process->UniqueProcessId);
KDB_DELETEPROCESS_HOOK(Process);
/* Dereference the Token and release Memory Information */
_____
Modified: trunk/reactos/ntoskrnl/ps/process.c
--- trunk/reactos/ntoskrnl/ps/process.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ps/process.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -363,6 +363,7 @@
Status = PsCreateCidHandle(Process,
PsProcessType,
&Process->UniqueProcessId);
+ DPRINT1("Created CID: %d\n", Process->UniqueProcessId);
if(!NT_SUCCESS(Status))
{
DPRINT1("Failed to create CID handle (unique process ID)!
Status: 0x%x\n", Status);
@@ -872,7 +873,7 @@
if (ClientId->UniqueThread)
{
/* Get the Process */
- DPRINT("Opening by Thread ID: %x\n",
ClientId->UniqueThread);
+ DPRINT1("Opening by Thread ID: %x\n",
ClientId->UniqueThread);
Status = PsLookupProcessThreadByCid(ClientId,
&Process,
&Thread);
@@ -881,7 +882,7 @@
else
{
/* Get the Process */
- DPRINT("Opening by Process ID: %x\n",
ClientId->UniqueProcess);
+ DPRINT1("Opening by Process ID: %x\n",
ClientId->UniqueProcess);
Status =
PsLookupProcessByProcessId(ClientId->UniqueProcess,
&Process);
DPRINT("Found: %x\n", Process);
_____
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c
--- trunk/reactos/ntoskrnl/ps/psmgr.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ps/psmgr.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -104,7 +104,7 @@
ObpCreateTypeObject(PsThreadType);
PsInitializeThread(NULL, &FirstThread, NULL, KernelMode, TRUE);
- FirstThread->Tcb.State = THREAD_STATE_RUNNING;
+ FirstThread->Tcb.State = Running;
FirstThread->Tcb.FreezeCount = 0;
FirstThread->Tcb.UserAffinity = (1 << 0); /* Set the affinity of
the first thread to the boot processor */
FirstThread->Tcb.Affinity = (1 << 0);
_____
Modified: trunk/reactos/ntoskrnl/ps/thread.c
--- trunk/reactos/ntoskrnl/ps/thread.c 2005-04-18 14:56:52 UTC (rev
14670)
+++ trunk/reactos/ntoskrnl/ps/thread.c 2005-04-18 15:49:57 UTC (rev
14671)
@@ -164,9 +164,9 @@
Thread->ThreadsProcess->UniqueProcessId,
Thread->Cid.UniqueThread,
Thread->ThreadsProcess->ImageFileName);
- if(Thread->Tcb.State == THREAD_STATE_READY ||
- Thread->Tcb.State == THREAD_STATE_SUSPENDED ||
- Thread->Tcb.State == THREAD_STATE_BLOCKED)
+ if(Thread->Tcb.State == Ready ||
+ Thread->Tcb.State == Standby ||
+ Thread->Tcb.State == Waiting)
{
ULONG i = 0;
PULONG Esp = (PULONG)Thread->Tcb.KernelStack;
@@ -567,6 +567,7 @@
/* create a client id handle */
Status = PsCreateCidHandle (
Thread, PsThreadType, &Thread->Cid.UniqueThread);
+ DPRINT1("cid: %d\n", Thread->Cid.UniqueThread);
if (!NT_SUCCESS(Status))
{
ObDereferenceObject(Thread);
@@ -760,7 +761,7 @@
NTSTATUS STDCALL
NtYieldExecution(VOID)
{
- KiDispatchThread(THREAD_STATE_READY);
+ KiDispatchThread(Ready);
return(STATUS_SUCCESS);
}