1. object type names are stored in ntoskrnl's image (which is nonpaged memory), so there's no need to allocate and copy them to new memory
2. fixed PsLookupThreadByThreadId() prototype
3. renamed the process list to PsActiveProcessHead and use fast mutexes to serialize access to it
Modified: trunk/reactos/include/ddk/psfuncs.h
Modified: trunk/reactos/ntoskrnl/dbg/kdb.c
Modified: trunk/reactos/ntoskrnl/ex/callback.c
Modified: trunk/reactos/ntoskrnl/ex/win32k.c
Modified: trunk/reactos/ntoskrnl/io/driver.c
Modified: trunk/reactos/ntoskrnl/io/iomgr.c
Modified: trunk/reactos/ntoskrnl/kd/gdbstub.c
Modified: trunk/reactos/ntoskrnl/lpc/port.c
Modified: trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/ob/namespc.c
Modified: trunk/reactos/ntoskrnl/ob/symlink.c
Modified: trunk/reactos/ntoskrnl/ps/job.c
Modified: trunk/reactos/ntoskrnl/ps/process.c
Modified: trunk/reactos/ntoskrnl/ps/thread.c
Modified: trunk/reactos/subsys/win32k/ntuser/desktop.c
Modified: trunk/reactos/subsys/win32k/ntuser/hook.c
Modified: trunk/reactos/subsys/win32k/ntuser/message.c
Modified: trunk/reactos/subsys/win32k/ntuser/misc.c
Modified: trunk/reactos/subsys/win32k/ntuser/window.c
Modified: trunk/reactos/w32api/include/ddk/ntifs.h

Modified: trunk/reactos/include/ddk/psfuncs.h
--- trunk/reactos/include/ddk/psfuncs.h	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/include/ddk/psfuncs.h	2005-02-17 16:41:28 UTC (rev 13623)
@@ -403,7 +403,7 @@
 					    OUT struct _ETHREAD **Thread);
 					 /* OUT PETHREAD *Thread); */
 
-NTSTATUS STDCALL PsLookupThreadByThreadId(IN PVOID ThreadId,
+NTSTATUS STDCALL PsLookupThreadByThreadId(IN HANDLE ThreadId,
 					  OUT struct _ETHREAD **Thread);
 					/* OUT PETHREAD *Thread); */
 

Modified: trunk/reactos/ntoskrnl/dbg/kdb.c
--- trunk/reactos/ntoskrnl/dbg/kdb.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/dbg/kdb.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -862,20 +862,20 @@
 ULONG
 DbgProcessListCommand(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf)
 {
-  extern LIST_ENTRY PsProcessListHead;
+  extern LIST_ENTRY PsActiveProcessHead;
   PLIST_ENTRY current_entry;
   PEPROCESS current;
   ULONG i = 1;
 
-  if (PsProcessListHead.Flink == NULL)
+  if (PsActiveProcessHead.Flink == NULL)
     {
       DbgPrint("No processes.\n");
       return(1);
     }
 
   DbgPrint("Process list: ");
-  current_entry = PsProcessListHead.Flink;
-  while (current_entry != &PsProcessListHead)
+  current_entry = PsActiveProcessHead.Flink;
+  while (current_entry != &PsActiveProcessHead)
     {
       current = CONTAINING_RECORD(current_entry, EPROCESS, ProcessListEntry);
       DbgPrint("%d %.8s", current->UniqueProcessId, 

Modified: trunk/reactos/ntoskrnl/ex/callback.c
--- trunk/reactos/ntoskrnl/ex/callback.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ex/callback.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -49,7 +49,7 @@
    ExCallbackObjectType = ExAllocatePoolWithTag(NonPagedPool, sizeof(OBJECT_TYPE), CALLBACK_TAG);
 
    /* Initialize name */
-   RtlRosInitUnicodeStringFromLiteral(&ExCallbackObjectType->TypeName,L"Callback");
+   RtlInitUnicodeString(&ExCallbackObjectType->TypeName, L"Callback");
 
    /* Create the Object Type */
    ExCallbackObjectType->Tag = CALLBACK_TAG;

Modified: trunk/reactos/ntoskrnl/ex/win32k.c
--- trunk/reactos/ntoskrnl/ex/win32k.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ex/win32k.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -295,7 +295,7 @@
   ExWindowStationObjectType->OkayToClose = NULL;
   ExWindowStationObjectType->Create = ExpWinStaObjectCreate;
   ExWindowStationObjectType->DuplicationNotify = NULL;
-  RtlRosInitUnicodeStringFromLiteral(&ExWindowStationObjectType->TypeName, L"WindowStation");
+  RtlInitUnicodeString(&ExWindowStationObjectType->TypeName, L"WindowStation");
 
   ObpCreateTypeObject(ExWindowStationObjectType);
 
@@ -325,7 +325,7 @@
   ExDesktopObjectType->OkayToClose = NULL;
   ExDesktopObjectType->Create = ExpDesktopObjectCreate;
   ExDesktopObjectType->DuplicationNotify = NULL;
-  RtlRosInitUnicodeStringFromLiteral(&ExDesktopObjectType->TypeName, L"Desktop");
+  RtlInitUnicodeString(&ExDesktopObjectType->TypeName, L"Desktop");
 
   ObpCreateTypeObject(ExDesktopObjectType);
 }

Modified: trunk/reactos/ntoskrnl/io/driver.c
--- trunk/reactos/ntoskrnl/io/driver.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/io/driver.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -110,7 +110,7 @@
    IoDriverObjectType->OkayToClose = NULL;
    IoDriverObjectType->Create = IopCreateDriver;
    IoDriverObjectType->DuplicationNotify = NULL;
-   RtlRosInitUnicodeStringFromLiteral(&IoDriverObjectType->TypeName, L"Driver");
+   RtlInitUnicodeString(&IoDriverObjectType->TypeName, L"Driver");
 
    ObpCreateTypeObject(IoDriverObjectType);
 

Modified: trunk/reactos/ntoskrnl/io/iomgr.c
--- trunk/reactos/ntoskrnl/io/iomgr.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/io/iomgr.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -410,7 +410,7 @@
   IoDeviceObjectType->Create = IopCreateDevice;
   IoDeviceObjectType->DuplicationNotify = NULL;
   
-  RtlRosInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName, L"Device");
+  RtlInitUnicodeString(&IoDeviceObjectType->TypeName, L"Device");
 
   ObpCreateTypeObject(IoDeviceObjectType);
 
@@ -439,7 +439,7 @@
   IoFileObjectType->Create = IopCreateFile;
   IoFileObjectType->DuplicationNotify = NULL;
   
-  RtlRosInitUnicodeStringFromLiteral(&IoFileObjectType->TypeName, L"File");
+  RtlInitUnicodeString(&IoFileObjectType->TypeName, L"File");
 
   ObpCreateTypeObject(IoFileObjectType);
   
@@ -453,7 +453,7 @@
   IoAdapterObjectType->PeakObjects = 0;
   IoAdapterObjectType->PeakHandles = 0;
   IoDeviceObjectType->Mapping = &IopFileMapping;
-  RtlRosInitUnicodeStringFromLiteral(&IoAdapterObjectType->TypeName, L"Adapter");
+  RtlInitUnicodeString(&IoAdapterObjectType->TypeName, L"Adapter");
   ObpCreateTypeObject(IoAdapterObjectType);
 
   /*

Modified: trunk/reactos/ntoskrnl/kd/gdbstub.c
--- trunk/reactos/ntoskrnl/kd/gdbstub.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/kd/gdbstub.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -106,7 +106,7 @@
 static PETHREAD GspDbgThread;
 static PETHREAD GspEnumThread;
 
-extern LIST_ENTRY PsProcessListHead;
+extern LIST_ENTRY PsActiveProcessHead;
 
 /* Number of Registers.  */
 #define NUMREGS	16
@@ -652,12 +652,14 @@
     }
     else
     {
-      ULONG ThreadId;
+      ULONG uThreadId;
+      HANDLE ThreadId;
       PCHAR ptr = &Data[0];
 
-      GspHex2Long (&ptr, (PLONG) &ThreadId);
+      GspHex2Long (&ptr, (PULONG) &uThreadId);
+      ThreadId = (HANDLE)uThreadId;
 
-      if (!NT_SUCCESS (PsLookupThreadByThreadId ((PVOID) ThreadId, &ThreadInfo)))
+      if (!NT_SUCCESS (PsLookupThreadByThreadId (ThreadId, &ThreadInfo)))
 			  {
           *Thread = NULL;
           return FALSE;
@@ -745,8 +747,8 @@
 
     /* Get first thread id */
     GspEnumThread = NULL;
-    AProcess = PsProcessListHead.Flink;
-    while(AProcess != &PsProcessListHead)
+    AProcess = PsActiveProcessHead.Flink;
+    while(AProcess != &PsActiveProcessHead)
     {
       Process = CONTAINING_RECORD(AProcess, EPROCESS, ProcessListEntry);
       AThread = Process->ThreadListHead.Flink;
@@ -791,7 +793,7 @@
       {
         PETHREAD Thread = NULL;
         AProcess = Process->ProcessListEntry.Flink;
-        while(AProcess != &PsProcessListHead)
+        while(AProcess != &PsActiveProcessHead)
         {
           Process = CONTAINING_RECORD(AProcess, EPROCESS, ProcessListEntry);
           AThread = Process->ThreadListHead.Flink;

Modified: trunk/reactos/ntoskrnl/lpc/port.c
--- trunk/reactos/ntoskrnl/lpc/port.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/lpc/port.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -33,11 +33,11 @@
 NTSTATUS INIT_FUNCTION
 LpcpInitSystem (VOID)
 {
-    /* Allocate Memory for the LPC Object */
-    LpcPortObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
-    RtlZeroMemory (LpcPortObjectType, sizeof (OBJECT_TYPE));
+   /* Allocate Memory for the LPC Object */
+   LpcPortObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
+   RtlZeroMemory (LpcPortObjectType, sizeof (OBJECT_TYPE));
    
-    RtlRosInitUnicodeStringFromLiteral(&LpcPortObjectType->TypeName,L"Port");
+   RtlInitUnicodeString(&LpcPortObjectType->TypeName,L"Port");
    
    LpcPortObjectType->Tag = TAG('L', 'P', 'R', 'T');
    LpcPortObjectType->PeakObjects = 0;

Modified: trunk/reactos/ntoskrnl/mm/section.c
--- trunk/reactos/ntoskrnl/mm/section.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/mm/section.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -2127,7 +2127,7 @@
 {
    MmSectionObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
 
-   RtlRosInitUnicodeStringFromLiteral(&MmSectionObjectType->TypeName, L"Section");
+   RtlInitUnicodeString(&MmSectionObjectType->TypeName, L"Section");
 
    MmSectionObjectType->Tag = TAG('S', 'E', 'C', 'T');
    MmSectionObjectType->TotalObjects = 0;

Modified: trunk/reactos/ntoskrnl/ob/namespc.c
--- trunk/reactos/ntoskrnl/ob/namespc.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ob/namespc.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -391,7 +391,7 @@
   ObDirectoryType->Create = ObpCreateDirectory;
   ObDirectoryType->DuplicationNotify = NULL;
 
-  RtlRosInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
+  RtlInitUnicodeString(&ObDirectoryType->TypeName,
 		       L"Directory");
 
   /* create 'type' object type*/
@@ -416,7 +416,7 @@
   ObTypeObjectType->Create = NULL;
   ObTypeObjectType->DuplicationNotify = NULL;
 
-  RtlRosInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
+  RtlInitUnicodeString(&ObTypeObjectType->TypeName,
 		       L"ObjectType");
 
   /* Create security descriptor */

Modified: trunk/reactos/ntoskrnl/ob/symlink.c
--- trunk/reactos/ntoskrnl/ob/symlink.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ob/symlink.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -180,8 +180,8 @@
   ObSymbolicLinkType->Create = ObpCreateSymbolicLink;
   ObSymbolicLinkType->DuplicationNotify = NULL;
 
-  RtlRosInitUnicodeStringFromLiteral(&ObSymbolicLinkType->TypeName,
-				  L"SymbolicLink");
+  RtlInitUnicodeString(&ObSymbolicLinkType->TypeName,
+		       L"SymbolicLink");
 
   ObpCreateTypeObject(ObSymbolicLinkType);
 }

Modified: trunk/reactos/ntoskrnl/ps/job.c
--- trunk/reactos/ntoskrnl/ps/job.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ps/job.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -1,11 +1,12 @@
-/* $Id:$
+/* $Id$
  * 
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ps/job.c
  * PURPOSE:         Job Native Functions
  * 
- * PROGRAMMERS:     Alex Ionescu (alex@relsoft.net)
+ * PROGRAMMERS:     Alex Ionescu (alex@relsoft.net) (stubs)
+ *                  Thomas Weidenmueller <w3seek@reactos.com>
  */
 
 /* Note: Jobs are only supported on Win2K+ */
@@ -74,7 +75,7 @@
   PsJobType->Create = NULL;
   PsJobType->DuplicationNotify = NULL;
   
-  RtlRosInitUnicodeStringFromLiteral(&PsJobType->TypeName, L"Job");
+  RtlInitUnicodeString(&PsJobType->TypeName, L"Job");
   
   ObpCreateTypeObject(PsJobType);
   

Modified: trunk/reactos/ntoskrnl/ps/process.c
--- trunk/reactos/ntoskrnl/ps/process.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ps/process.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -20,8 +20,8 @@
 
 POBJECT_TYPE EXPORTED PsProcessType = NULL;
 
-LIST_ENTRY PsProcessListHead;
-static KSPIN_LOCK PsProcessListLock;
+LIST_ENTRY PsActiveProcessHead;
+FAST_MUTEX PspActiveProcessMutex;
 static LARGE_INTEGER ShortPsLockDelay, PsLockTimeout;
 
 static GENERIC_MAPPING PiProcessMapping = {STANDARD_RIGHTS_READ | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
@@ -101,7 +101,6 @@
 PEPROCESS
 PsGetNextProcess(PEPROCESS OldProcess)
 {
-   KIRQL oldIrql;
    PEPROCESS NextProcess;
    NTSTATUS Status;
    
@@ -119,13 +118,13 @@
        return PsInitialSystemProcess;
      }
    
-   KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
+   ExAcquireFastMutex(&PspActiveProcessMutex);
    NextProcess = OldProcess;
    while (1)
      {
-       if (NextProcess->ProcessListEntry.Blink == &PsProcessListHead)
+       if (NextProcess->ProcessListEntry.Blink == &PsActiveProcessHead)
          {
-	   NextProcess = CONTAINING_RECORD(PsProcessListHead.Blink,
+	   NextProcess = CONTAINING_RECORD(PsActiveProcessHead.Blink,
 					   EPROCESS,
 					   ProcessListEntry);
          }
@@ -154,7 +153,7 @@
 	 }
      }
 
-   KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+   ExReleaseFastMutex(&PspActiveProcessMutex);
    ObDereferenceObject(OldProcess);
    
    return(NextProcess);
@@ -281,14 +280,13 @@
 VOID 
 PiKillMostProcesses(VOID)
 {
-   KIRQL oldIrql;
    PLIST_ENTRY current_entry;
    PEPROCESS current;
    
-   KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
+   ExAcquireFastMutex(&PspActiveProcessMutex);
    
-   current_entry = PsProcessListHead.Flink;
-   while (current_entry != &PsProcessListHead)
+   current_entry = PsActiveProcessHead.Flink;
+   while (current_entry != &PsActiveProcessHead)
      {
 	current = CONTAINING_RECORD(current_entry, EPROCESS, 
 				    ProcessListEntry);
@@ -301,7 +299,7 @@
 	  }
      }
    
-   KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+   ExReleaseFastMutex(&PspActiveProcessMutex);
 }
 
 
@@ -309,7 +307,6 @@
 PsInitProcessManagment(VOID)
 {
    PKPROCESS KProcess;
-   KIRQL oldIrql;
    NTSTATUS Status;
    
    ShortPsLockDelay.QuadPart = -100LL;
@@ -339,12 +336,12 @@
    PsProcessType->Create = NULL;
    PsProcessType->DuplicationNotify = NULL;
    
-   RtlRosInitUnicodeStringFromLiteral(&PsProcessType->TypeName, L"Process");
+   RtlInitUnicodeString(&PsProcessType->TypeName, L"Process");
    
    ObpCreateTypeObject(PsProcessType);
 
-   InitializeListHead(&PsProcessListHead);
-   KeInitializeSpinLock(&PsProcessListLock);
+   InitializeListHead(&PsActiveProcessHead);
+   ExInitializeFastMutex(&PspActiveProcessMutex);
 
    RtlZeroMemory(PiProcessNotifyRoutine, sizeof(PiProcessNotifyRoutine));
    RtlZeroMemory(PiLoadImageNotifyRoutine, sizeof(PiLoadImageNotifyRoutine));
@@ -412,11 +409,9 @@
    
    PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
    
-   KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
-   InsertHeadList(&PsProcessListHead, 
+   InsertHeadList(&PsActiveProcessHead,
 		  &PsInitialSystemProcess->ProcessListEntry);
    InitializeListHead(&PsInitialSystemProcess->ThreadListHead);
-   KeReleaseSpinLock(&PsProcessListLock, oldIrql);
 
    SepCreateSystemProcessToken(PsInitialSystemProcess);
 }
@@ -424,7 +419,6 @@
 VOID STDCALL
 PiDeleteProcessWorker(PVOID pContext)
 {
-  KIRQL oldIrql;
   PDEL_CONTEXT Context;
   PEPROCESS CurrentProcess;
   PEPROCESS Process;
@@ -440,9 +434,9 @@
       KeAttachProcess(&Process->Pcb);
     }
 
-  KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
+  ExAcquireFastMutex(&PspActiveProcessMutex);
   RemoveEntryList(&Process->ProcessListEntry);
-  KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+  ExReleaseFastMutex(&PspActiveProcessMutex);
 
   /* KDB hook */
   KDB_DELETEPROCESS_HOOK(Process);
@@ -657,7 +651,6 @@
    PEPROCESS Process;
    PEPROCESS pParentProcess;
    PKPROCESS KProcess;
-   KIRQL oldIrql;
    PVOID LdrStartupAddr;
    PVOID BaseAddress;
    PMEMORY_AREA MemoryArea;
@@ -863,10 +856,10 @@
    
    Process->Win32WindowStation = (HANDLE)0;
 
-   KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
-   InsertHeadList(&PsProcessListHead, &Process->ProcessListEntry);
+   ExAcquireFastMutex(&PspActiveProcessMutex);
+   InsertHeadList(&PsActiveProcessHead, &Process->ProcessListEntry);
    InitializeListHead(&Process->ThreadListHead);
-   KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+   ExReleaseFastMutex(&PspActiveProcessMutex);
 
    ExInitializeFastMutex(&Process->TebLock);
    Process->Pcb.State = PROCESS_STATE_ACTIVE;
@@ -1261,14 +1254,13 @@
      }
    else
      {
-	KIRQL oldIrql;
 	PLIST_ENTRY current_entry;
 	PEPROCESS current;
 	NTSTATUS Status;
 	
-	KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
-	current_entry = PsProcessListHead.Flink;
-	while (current_entry != &PsProcessListHead)
+	ExAcquireFastMutex(&PspActiveProcessMutex);
+	current_entry = PsActiveProcessHead.Flink;
+	while (current_entry != &PsActiveProcessHead)
 	  {
 	     current = CONTAINING_RECORD(current_entry, EPROCESS, 
 					 ProcessListEntry);
@@ -1285,7 +1277,7 @@
 					                  PsProcessType,
 					                  UserMode);
 		    }
-		  KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+		  ExReleaseFastMutex(&PspActiveProcessMutex);
 		  if (NT_SUCCESS(Status))
 		    {
 		      Status = ObCreateHandle(PsGetCurrentProcess(),
@@ -1301,7 +1293,7 @@
 	       }
 	     current_entry = current_entry->Flink;
 	  }
-	KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+	ExReleaseFastMutex(&PspActiveProcessMutex);
 	DPRINT("NtOpenProcess() = STATUS_UNSUCCESSFUL\n");
 	return(STATUS_UNSUCCESSFUL);
      }
@@ -2093,6 +2085,27 @@
         }
         break;
       }
+      
+      case ProcessPriorityClass:
+      {
+        PROCESS_PRIORITY_CLASS ppc;
+
+        _SEH_TRY
+        {
+          ppc = *(PPROCESS_PRIORITY_CLASS)ProcessInformation;
+        }
+        _SEH_HANDLE
+        {
+          Status = _SEH_GetExceptionCode();
+        }
+        _SEH_END;
+        
+        if(NT_SUCCESS(Status))
+        {
+        }
+        
+        break;
+      }
 	
       case ProcessLdtInformation:
       case ProcessLdtSize:
@@ -2100,7 +2113,6 @@
       case ProcessWorkingSetWatch:
       case ProcessUserModeIOPL:
       case ProcessEnableAlignmentFaultFixup:
-      case ProcessPriorityClass:
       case ProcessAffinityMask:
 	Status = STATUS_NOT_IMPLEMENTED;
 	break;
@@ -2143,7 +2155,6 @@
    return STATUS_NOT_IMPLEMENTED;
 
 #if 0
-	KIRQL		OldIrql;
 	PLIST_ENTRY	CurrentEntryP;
 	PEPROCESS	CurrentP;
 	PLIST_ENTRY	CurrentEntryT;
@@ -2160,16 +2171,15 @@
 	
 
    /* Lock the process list. */
-   KeAcquireSpinLock(&PsProcessListLock,
-		     &OldIrql);
+   ExAcquireFastMutex(&PspActiveProcessMutex);
 
 	/*
 	 * Scan the process list. Since the
 	 * list is circular, the guard is false
 	 * after the last process.
 	 */
-	for (	CurrentEntryP = PsProcessListHead.Flink;
-		(CurrentEntryP != & PsProcessListHead);
+	for (	CurrentEntryP = PsActiveProcessHead.Flink;
+		(CurrentEntryP != & PsActiveProcessHead);
 		CurrentEntryP = CurrentEntryP->Flink
 		)
 	{
@@ -2305,9 +2315,8 @@
 	/*
 	 * Unlock the process list.
 	 */
-	KeReleaseSpinLock (
-		& PsProcessListLock,
-		OldIrql
+	ExReleaseFastMutex (
+		& PspActiveProcessMutex
 		);
 	/*
 	 * Return the proper error status code,
@@ -2541,14 +2550,13 @@
 PsLookupProcessByProcessId(IN HANDLE ProcessId,
 			   OUT PEPROCESS *Process)
 {
-  KIRQL oldIrql;
   PLIST_ENTRY current_entry;
   PEPROCESS current;
 
-  KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
+  ExAcquireFastMutex(&PspActiveProcessMutex);
 
-  current_entry = PsProcessListHead.Flink;
-  while (current_entry != &PsProcessListHead)
+  current_entry = PsActiveProcessHead.Flink;
+  while (current_entry != &PsActiveProcessHead)
     {
       current = CONTAINING_RECORD(current_entry,
 				  EPROCESS,
@@ -2557,13 +2565,13 @@
 	{
 	  *Process = current;
           ObReferenceObject(current);
-	  KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+	  ExReleaseFastMutex(&PspActiveProcessMutex);
 	  return(STATUS_SUCCESS);
 	}
       current_entry = current_entry->Flink;
     }
 
-  KeReleaseSpinLock(&PsProcessListLock, oldIrql);
+  ExReleaseFastMutex(&PspActiveProcessMutex);
 
   return(STATUS_INVALID_PARAMETER);
 }

Modified: trunk/reactos/ntoskrnl/ps/thread.c
--- trunk/reactos/ntoskrnl/ps/thread.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/ntoskrnl/ps/thread.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -27,7 +27,7 @@
 
 /* GLOBALS ******************************************************************/
 
-extern LIST_ENTRY PsProcessListHead;
+extern LIST_ENTRY PsActiveProcessHead;
 
 POBJECT_TYPE EXPORTED PsThreadType = NULL;
 
@@ -287,8 +287,8 @@
    PETHREAD Thread;
    ULONG nThreads = 0;
    
-   AProcess = PsProcessListHead.Flink;
-   while(AProcess != &PsProcessListHead)
+   AProcess = PsActiveProcessHead.Flink;
+   while(AProcess != &PsActiveProcessHead)
    {
      Process = CONTAINING_RECORD(AProcess, EPROCESS, ProcessListEntry);
      /* FIXME - skip suspended, ... processes? */
@@ -767,7 +767,7 @@
    PsThreadType->Create = NULL;
    PsThreadType->DuplicationNotify = NULL;
 
-   RtlRosInitUnicodeStringFromLiteral(&PsThreadType->TypeName, L"Thread");
+   RtlInitUnicodeString(&PsThreadType->TypeName, L"Thread");
 
    ObpCreateTypeObject(PsThreadType);
 
@@ -1088,12 +1088,12 @@
  * @implemented
  */
 NTSTATUS STDCALL
-PsLookupThreadByThreadId(IN PVOID ThreadId,
+PsLookupThreadByThreadId(IN HANDLE ThreadId,
 			 OUT PETHREAD *Thread)
 {
   PCID_OBJECT CidObject;
   
-  CidObject = PsLockCidHandle((HANDLE)ThreadId, PsThreadType);
+  CidObject = PsLockCidHandle(ThreadId, PsThreadType);
   if(CidObject != NULL)
   {
     *Thread = CidObject->Obj.Thread;

Modified: trunk/reactos/subsys/win32k/ntuser/desktop.c
--- trunk/reactos/subsys/win32k/ntuser/desktop.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/subsys/win32k/ntuser/desktop.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -1138,7 +1138,7 @@
     return 0;
   }
   
-  Status = PsLookupThreadByThreadId((PVOID)dwThreadId, &Thread);
+  Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
   if(!NT_SUCCESS(Status))
   {
     SetLastWin32Error(ERROR_INVALID_PARAMETER);

Modified: trunk/reactos/subsys/win32k/ntuser/hook.c
--- trunk/reactos/subsys/win32k/ntuser/hook.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/subsys/win32k/ntuser/hook.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -460,7 +460,7 @@
         }
       Mod = NULL;
       Global = FALSE;
-      if (! NT_SUCCESS(PsLookupThreadByThreadId((PVOID) ThreadId, &Thread)))
+      if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE) ThreadId, &Thread)))
         {
           DPRINT1("Invalid thread id 0x%x\n", ThreadId);
           SetLastWin32Error(ERROR_INVALID_PARAMETER);

Modified: trunk/reactos/subsys/win32k/ntuser/message.c
--- trunk/reactos/subsys/win32k/ntuser/message.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/subsys/win32k/ntuser/message.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -1173,7 +1173,7 @@
   NTSTATUS Status;
   PMSGMEMORY MsgMemoryEntry;
 
-  Status = PsLookupThreadByThreadId((void *)idThread,&peThread);
+  Status = PsLookupThreadByThreadId((HANDLE)idThread,&peThread);
   
   if( Status == STATUS_SUCCESS ) {
     pThread = peThread->Tcb.Win32Thread;

Modified: trunk/reactos/subsys/win32k/ntuser/misc.c
--- trunk/reactos/subsys/win32k/ntuser/misc.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/subsys/win32k/ntuser/misc.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -1179,7 +1179,7 @@
   
   if(idThread)
   {
-    Status = PsLookupThreadByThreadId((PVOID)idThread, &Thread);
+    Status = PsLookupThreadByThreadId((HANDLE)idThread, &Thread);
     if(!NT_SUCCESS(Status))
     {
       SetLastWin32Error(ERROR_ACCESS_DENIED);

Modified: trunk/reactos/subsys/win32k/ntuser/window.c
--- trunk/reactos/subsys/win32k/ntuser/window.c	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/subsys/win32k/ntuser/window.c	2005-02-17 16:41:28 UTC (rev 13623)
@@ -1164,7 +1164,7 @@
     PLIST_ENTRY Current;
     PWINDOW_OBJECT Window;
     
-    Status = PsLookupThreadByThreadId((PVOID)dwThreadId, &Thread);
+    Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
     if(!NT_SUCCESS(Status))
     {
       SetLastWin32Error(ERROR_INVALID_PARAMETER);

Modified: trunk/reactos/w32api/include/ddk/ntifs.h
--- trunk/reactos/w32api/include/ddk/ntifs.h	2005-02-17 15:11:36 UTC (rev 13622)
+++ trunk/reactos/w32api/include/ddk/ntifs.h	2005-02-17 16:41:28 UTC (rev 13623)
@@ -3306,7 +3306,7 @@
 NTSTATUS
 NTAPI
 PsLookupThreadByThreadId (
-    IN PVOID        UniqueThreadId,
+    IN HANDLE       UniqueThreadId,
     OUT PETHREAD    *Thread
 );