Commit in reactos/ntoskrnl on MAIN
cm/cm.h+2-21.52 -> 1.53
  /regfile.c+2-21.85 -> 1.86
dbg/kdb.c+5-51.36 -> 1.37
ex/fmutex.c+3-31.22 -> 1.23
include/internal/ex.h+201.46 -> 1.47
io/device.c+2-21.85 -> 1.86
kd/gdbstub.c+1-11.28 -> 1.29
ke/dpc.c+2-21.49 -> 1.50
  /ipi.c+6-61.4 -> 1.5
  /main.c+12-121.211 -> 1.212
  /spinlock.c+3-31.24 -> 1.25
  /timer.c+5-51.92 -> 1.93
ke/i386/kernel.c+2-21.44 -> 1.45
ldr/loader.c+5-51.151 -> 1.152
lpc/reply.c+2-21.23 -> 1.24
mm/RPoolMgr.h+5-51.3 -> 1.4
  /balance.c+7-71.33 -> 1.34
  /pageop.c+3-31.21 -> 1.22
  /rmap.c+4-41.31 -> 1.32
  /section.c+8-81.167 -> 1.168
mm/i386/page.c+34-341.78 -> 1.79
ps/job.c+1-11.10 -> 1.11
  /kill.c+3-31.90 -> 1.91
  /process.c+8-91.159 -> 1.160
+145-126
24 modified files
- Fix compilation with GCC 4.0-20041219.

reactos/ntoskrnl/cm
cm.h 1.52 -> 1.53
diff -u -r1.52 -r1.53
--- cm.h	12 Dec 2004 22:36:10 -0000	1.52
+++ cm.h	24 Dec 2004 17:06:57 -0000	1.53
@@ -641,13 +641,13 @@
 
 BOOLEAN
 CmiComparePackedNames(IN PUNICODE_STRING Name,
-		      IN PCHAR NameBuffer,
+		      IN PUCHAR NameBuffer,
 		      IN USHORT NameBufferSize,
 		      IN BOOLEAN NamePacked);
 
 VOID
 CmiCopyPackedName(PWCHAR NameBuffer,
-		  PCHAR PackedNameBuffer,
+		  PUCHAR PackedNameBuffer,
 		  ULONG PackedNameSize);
 
 BOOLEAN

reactos/ntoskrnl/cm
regfile.c 1.85 -> 1.86
diff -u -r1.85 -r1.86
--- regfile.c	12 Dec 2004 22:36:10 -0000	1.85
+++ regfile.c	24 Dec 2004 17:06:57 -0000	1.86
@@ -3825,7 +3825,7 @@
 
 BOOLEAN
 CmiComparePackedNames(IN PUNICODE_STRING Name,
-		      IN PCHAR NameBuffer,
+		      IN PUCHAR NameBuffer,
 		      IN USHORT NameBufferSize,
 		      IN BOOLEAN NamePacked)
 {
@@ -3863,7 +3863,7 @@
 
 VOID
 CmiCopyPackedName(PWCHAR NameBuffer,
-		  PCHAR PackedNameBuffer,
+		  PUCHAR PackedNameBuffer,
 		  ULONG PackedNameSize)
 {
   ULONG i;

reactos/ntoskrnl/dbg
kdb.c 1.36 -> 1.37
diff -u -r1.36 -r1.37
--- kdb.c	18 Dec 2004 19:22:10 -0000	1.36
+++ kdb.c	24 Dec 2004 17:06:58 -0000	1.37
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: kdb.c,v 1.36 2004/12/18 19:22:10 blight Exp $
+/* $Id: kdb.c,v 1.37 2004/12/24 17:06:58 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/dbg/kdb.c
@@ -323,7 +323,7 @@
 {
   CHAR Key;
   PCH Orig = Buffer;
-  static UCHAR LastCommand[256] = "";
+  static CHAR LastCommand[256] = "";
   ULONG ScanCode = 0;
   static CHAR LastKey = '\0';
   
@@ -404,7 +404,7 @@
 }
 
 BOOLEAN STATIC
-KdbDecodeAddress(PUCHAR Buffer, PULONG Address)
+KdbDecodeAddress(PCHAR Buffer, PULONG Address)
 {
   while (isspace(*Buffer))
     {
@@ -412,8 +412,8 @@
     }
   if (Buffer[0] == '<')
     {
-      PUCHAR ModuleName = Buffer + 1;
-      PUCHAR AddressString = strpbrk(Buffer, ":");
+      PCHAR ModuleName = Buffer + 1;
+      PCHAR AddressString = strpbrk(Buffer, ":");
       extern LIST_ENTRY ModuleTextListHead;
       PLIST_ENTRY current_entry;
       MODULE_TEXT_SECTION* current = NULL;

reactos/ntoskrnl/ex
fmutex.c 1.22 -> 1.23
diff -u -r1.22 -r1.23
--- fmutex.c	22 Oct 2004 20:18:35 -0000	1.22
+++ fmutex.c	24 Dec 2004 17:06:58 -0000	1.23
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: fmutex.c,v 1.22 2004/10/22 20:18:35 ekohl Exp $
+/* $Id: fmutex.c,v 1.23 2004/12/24 17:06:58 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ex/fmutex.c
@@ -41,7 +41,7 @@
 ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex)
 {
   ASSERT(FastMutex->Owner != KeGetCurrentThread());
-  InterlockedIncrement((LONG *)&FastMutex->Contention);
+  InterlockedIncrementUL(&FastMutex->Contention);
   while (InterlockedExchange(&FastMutex->Count, 0) == 0)
      {
        KeWaitForSingleObject(&FastMutex->Event,
@@ -50,7 +50,7 @@
 			     FALSE,
 			     NULL);
      }
-  InterlockedDecrement((LONG *)&FastMutex->Contention);
+  InterlockedDecrementUL(&FastMutex->Contention);
   FastMutex->Owner = KeGetCurrentThread();
 }
 

reactos/ntoskrnl/include/internal
ex.h 1.46 -> 1.47
diff -u -r1.46 -r1.47
--- ex.h	18 Dec 2004 13:27:26 -0000	1.46
+++ ex.h	24 Dec 2004 17:06:58 -0000	1.47
@@ -120,5 +120,25 @@
 NTSTATUS
 ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation);
 
+#define InterlockedDecrementUL(Addend) \
+   (ULONG)InterlockedDecrement((PLONG)(Addend))
+
+#define InterlockedIncrementUL(Addend) \
+   (ULONG)InterlockedIncrement((PLONG)(Addend))
+
+#define InterlockedExchangeUL(Target, Value) \
+   (ULONG)InterlockedExchange((PLONG)(Target), (LONG)(Value))
+
+#define InterlockedExchangeAddUL(Addend, Value) \
+   (ULONG)InterlockedExchangeAdd((PLONG)(Addend), (LONG)(Value))
+
+#define InterlockedCompareExchangeUL(Destination, Exchange, Comperand) \
+   (ULONG)InterlockedCompareExchange((PLONG)(Destination), (LONG)(Exchange), (LONG)(Comperand))
+
+#define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
+   (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
+
+#define ExfpInterlockedExchange64UL(Target, Value) \
+   (ULONGLONG)ExfpInterlockedExchange64((PLONGLONG)(Target), (PLONGLONG)(Value))
 
 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */

reactos/ntoskrnl/io
device.c 1.85 -> 1.86
diff -u -r1.85 -r1.86
--- device.c	18 Nov 2004 11:46:07 -0000	1.85
+++ device.c	24 Dec 2004 17:06:58 -0000	1.86
@@ -1,4 +1,4 @@
-/* $Id: device.c,v 1.85 2004/11/18 11:46:07 ekohl Exp $
+/* $Id: device.c,v 1.86 2004/12/24 17:06:58 navaraf Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -557,7 +557,7 @@
    {
       swprintf(AutoNameBuffer,
                L"\\Device\\%08lx",
-               InterlockedIncrement(&IopDeviceObjectNumber));
+               InterlockedIncrementUL(&IopDeviceObjectNumber));
       RtlInitUnicodeString(&AutoName,
                            AutoNameBuffer);
       DeviceName = &AutoName;

reactos/ntoskrnl/kd
gdbstub.c 1.28 -> 1.29
diff -u -r1.28 -r1.29
--- gdbstub.c	2 Dec 2004 01:33:02 -0000	1.28
+++ gdbstub.c	24 Dec 2004 17:06:58 -0000	1.29
@@ -1428,7 +1428,7 @@
   BOOLEAN DoBreakIn;
   CONTEXT Context;
   KIRQL OldIrql;
-  CHAR Value;
+  UCHAR Value;
 
   DPRINT ("Break In\n");
 

reactos/ntoskrnl/ke
dpc.c 1.49 -> 1.50
diff -u -r1.49 -r1.50
--- dpc.c	27 Nov 2004 19:27:31 -0000	1.49
+++ dpc.c	24 Dec 2004 17:06:58 -0000	1.50
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dpc.c,v 1.49 2004/11/27 19:27:31 hbirr Exp $
+/* $Id: dpc.c,v 1.50 2004/12/24 17:06:58 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -209,7 +209,7 @@
 #endif
 
 	/* Get the DPC Data */
-	if (InterlockedCompareExchange((LONG*)&Dpc->DpcData, (LONG)&Pcr->PrcbData.DpcData[0].DpcLock, 0)) {
+	if (InterlockedCompareExchangeUL(&Dpc->DpcData, &Pcr->PrcbData.DpcData[0].DpcLock, 0)) {
 		DPRINT("DPC Already Inserted");
 #ifdef MP
 		KiReleaseSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock);

reactos/ntoskrnl/ke
ipi.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ipi.c	27 Nov 2004 16:32:10 -0000	1.4
+++ ipi.c	24 Dec 2004 17:06:58 -0000	1.5
@@ -1,4 +1,4 @@
-/* $Id: ipi.c,v 1.4 2004/11/27 16:32:10 hbirr Exp $
+/* $Id: ipi.c,v 1.5 2004/12/24 17:06:58 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -76,13 +76,13 @@
 
    if (Pcr->PrcbData.IpiFrozen & IPI_REQUEST_FUNCTIONCALL)
    {
-      InterlockedDecrement((PLONG)&Pcr->PrcbData.SignalDone->CurrentPacket[1]);
+      InterlockedDecrementUL(&Pcr->PrcbData.SignalDone->CurrentPacket[1]);
       if (Pcr->PrcbData.SignalDone->CurrentPacket[2])
       {
 #ifdef DBG      	
          StartTime = KeQueryPerformanceCounter(&Frequency);
 #endif         
-         while (0 != InterlockedCompareExchange((PLONG)&Pcr->PrcbData.SignalDone->CurrentPacket[1], 0, 0))
+         while (0 != InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone->CurrentPacket[1], 0, 0))
 	 {
 #ifdef DBG	 	
             CurrentTime = KeQueryPerformanceCounter(NULL);
@@ -99,13 +99,13 @@
       {
          Processor = 1 << KeGetCurrentProcessorNumber();
 	 TargetSet = Pcr->PrcbData.SignalDone->TargetSet;
-      } while (Processor & InterlockedCompareExchange(&Pcr->PrcbData.SignalDone->TargetSet, TargetSet & ~Processor, TargetSet)); 
+      } while (Processor & InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone->TargetSet, TargetSet & ~Processor, TargetSet)); 
       if (Pcr->PrcbData.SignalDone->CurrentPacket[2])
       {
 #ifdef DBG      	
          StartTime = KeQueryPerformanceCounter(&Frequency);
 #endif         
-         while (0 != InterlockedCompareExchange(&Pcr->PrcbData.SignalDone->TargetSet, 0, 0))
+         while (0 != InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone->TargetSet, 0, 0))
          {
 #ifdef DBG         	
 	    CurrentTime = KeQueryPerformanceCounter(NULL);
@@ -149,7 +149,7 @@
        if (TargetSet & Processor)
        {
           Pcr = (PKPCR)(KPCR_BASE + i * PAGE_SIZE);
-          while(0 != InterlockedCompareExchange((PLONG)&Pcr->PrcbData.SignalDone, (LONG)&CurrentPcr->PrcbData, 0));
+          while(0 != InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone, (LONG)&CurrentPcr->PrcbData, 0));
 	  Pcr->PrcbData.IpiFrozen |= IPI_REQUEST_FUNCTIONCALL;
 	  if (Processor != CurrentProcessor)
 	  {

reactos/ntoskrnl/ke
main.c 1.211 -> 1.212
diff -u -r1.211 -r1.212
--- main.c	12 Dec 2004 20:14:01 -0000	1.211
+++ main.c	24 Dec 2004 17:06:58 -0000	1.212
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: main.c,v 1.211 2004/12/12 20:14:01 hbirr Exp $
+/* $Id: main.c,v 1.212 2004/12/24 17:06:58 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/main.c
@@ -73,8 +73,8 @@
 #endif	/* __GNUC__ */
 
 static LOADER_MODULE KeLoaderModules[64];
-static UCHAR KeLoaderModuleStrings[64][256];
-static UCHAR KeLoaderCommandLine[256];
+static CHAR KeLoaderModuleStrings[64][256];
+static CHAR KeLoaderCommandLine[256];
 static ADDRESS_RANGE KeMemoryMap[64];
 static ULONG KeMemoryMapRangeCount;
 static ULONG FirstKrnlPhysAddr;
@@ -696,8 +696,8 @@
   IoCreateArcNames();
 
   /* Create the SystemRoot symbolic link */
-  CPRINT("CommandLine: %s\n", (PUCHAR)KeLoaderBlock.CommandLine);
-  Status = IoCreateSystemRootLink((PUCHAR)KeLoaderBlock.CommandLine);
+  CPRINT("CommandLine: %s\n", (PCHAR)KeLoaderBlock.CommandLine);
+  Status = IoCreateSystemRootLink((PCHAR)KeLoaderBlock.CommandLine);
   if (!NT_SUCCESS(Status))
   {
     DbgPrint ( "IoCreateSystemRootLink FAILED: (0x%x) - ", Status );
@@ -745,7 +745,7 @@
    * Initialize shared user page:
    *  - set dos system path, dos device map, etc.
    */
-  InitSystemSharedUserPage ((PUCHAR)KeLoaderBlock.CommandLine);
+  InitSystemSharedUserPage ((PCHAR)KeLoaderBlock.CommandLine);
 
   /* Create 'ReactOSInitDone' event */
   RtlInitUnicodeString(&Name, L"\\ReactOSInitDone");
@@ -917,10 +917,10 @@
       if (((PUCHAR)_LoaderBlock->CommandLine)[1] == 'h' &&
 	  ((PUCHAR)_LoaderBlock->CommandLine)[2] == 'd')
 	{
-	  DiskNumber = ((PUCHAR)_LoaderBlock->CommandLine)[3] - '0';
-	  PartNumber = ((PUCHAR)_LoaderBlock->CommandLine)[5] - '0';
+	  DiskNumber = ((PCHAR)_LoaderBlock->CommandLine)[3] - '0';
+	  PartNumber = ((PCHAR)_LoaderBlock->CommandLine)[5] - '0';
 	}
-      strcpy(Temp, &((PUCHAR)_LoaderBlock->CommandLine)[7]);
+      strcpy(Temp, &((PCHAR)_LoaderBlock->CommandLine)[7]);
       if ((options = strchr(Temp, ' ')) != NULL)
 	{
 	  *options = 0;
@@ -955,7 +955,7 @@
     }
   else
     {
-      strcpy(KeLoaderCommandLine, (PUCHAR)_LoaderBlock->CommandLine);
+      strcpy(KeLoaderCommandLine, (PCHAR)_LoaderBlock->CommandLine);
     }
   KeLoaderBlock.CommandLine = (ULONG)KeLoaderCommandLine;
   
@@ -976,13 +976,13 @@
   for (i = 1; i < KeLoaderBlock.ModsCount; i++)
     {      
       CHAR* s;
-      if ((s = strrchr((PUCHAR)KeLoaderModules[i].String, '/')) != 0)
+      if ((s = strrchr((PCHAR)KeLoaderModules[i].String, '/')) != 0)
 	{
 	  strcpy(KeLoaderModuleStrings[i], s + 1);
 	}
       else
 	{
-	  strcpy(KeLoaderModuleStrings[i], (PUCHAR)KeLoaderModules[i].String);
+	  strcpy(KeLoaderModuleStrings[i], (PCHAR)KeLoaderModules[i].String);
 	}
       /* TODO: Fix this hardcoded load address stuff... */
       KeLoaderModules[i].ModStart -= 0x200000;

reactos/ntoskrnl/ke
spinlock.c 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- spinlock.c	22 Oct 2004 20:30:48 -0000	1.24
+++ spinlock.c	24 Dec 2004 17:06:58 -0000	1.25
@@ -1,4 +1,4 @@
-/* $Id: spinlock.c,v 1.24 2004/10/22 20:30:48 ekohl Exp $
+/* $Id: spinlock.c,v 1.25 2004/12/24 17:06:58 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -183,7 +183,7 @@
     KEBUGCHECK(0);
   }
    
-  while ((i = InterlockedExchange((LONG *)SpinLock, 1)) == 1)
+  while ((i = InterlockedExchangeUL(SpinLock, 1)) == 1)
   {
 #ifndef MP
     DbgPrint("Spinning on spinlock %x current value %x\n", SpinLock, i);
@@ -218,7 +218,7 @@
     DbgPrint("Releasing unacquired spinlock %x\n", SpinLock);
     KEBUGCHECK(0);
   }
-  (void)InterlockedExchange((LONG *)SpinLock, 0);
+  (void)InterlockedExchangeUL(SpinLock, 0);
 }
 
 /* EOF */

reactos/ntoskrnl/ke
timer.c 1.92 -> 1.93
diff -u -r1.92 -r1.93
--- timer.c	28 Nov 2004 12:59:00 -0000	1.92
+++ timer.c	24 Dec 2004 17:06:58 -0000	1.93
@@ -1,4 +1,4 @@
-/* $Id: timer.c,v 1.92 2004/11/28 12:59:00 ekohl Exp $
+/* $Id: timer.c,v 1.93 2004/12/24 17:06:58 navaraf Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -712,8 +712,8 @@
    if (TrapFrame->Cs & 0x1 ||
        TrapFrame->Eflags & X86_EFLAGS_VM)
    {
-      InterlockedIncrement((PLONG)&CurrentThread->UserTime);
-      InterlockedIncrement((PLONG)&CurrentProcess->UserTime);
+      InterlockedIncrementUL(&CurrentThread->UserTime);
+      InterlockedIncrementUL(&CurrentProcess->UserTime);
       Pcr->PrcbData.UserTime++;
    }
    else
@@ -728,8 +728,8 @@
       }
       else
       {
-         InterlockedIncrement((PLONG)&CurrentThread->KernelTime);
-         InterlockedIncrement((PLONG)&CurrentProcess->KernelTime);
+         InterlockedIncrementUL(&CurrentThread->KernelTime);
+         InterlockedIncrementUL(&CurrentProcess->KernelTime);
 	 Pcr->PrcbData.KernelTime++;
       }
    }

reactos/ntoskrnl/ke/i386
kernel.c 1.44 -> 1.45
diff -u -r1.44 -r1.45
--- kernel.c	4 Dec 2004 21:40:55 -0000	1.44
+++ kernel.c	24 Dec 2004 17:06:59 -0000	1.45
@@ -175,7 +175,7 @@
   }
   
 
-  Offset = InterlockedIncrement(&PcrsAllocated) - 1;
+  Offset = InterlockedIncrementUL(&PcrsAllocated) - 1;
   Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
 
   /*
@@ -296,7 +296,7 @@
     *   Make the detection of the noexecute feature more portable.
     */
    if(KPCR->PrcbData.CpuType == 0xf &&
-      0 == strcmp("AuthenticAMD", KPCR->PrcbData.VendorString))
+      0 == memcpy("AuthenticAMD", KPCR->PrcbData.VendorString, 12))
    {
       if (NoExecute)
       {

reactos/ntoskrnl/ldr
loader.c 1.151 -> 1.152
diff -u -r1.151 -r1.152
--- loader.c	13 Nov 2004 13:09:07 -0000	1.151
+++ loader.c	24 Dec 2004 17:06:59 -0000	1.152
@@ -1,4 +1,4 @@
-/* $Id: loader.c,v 1.151 2004/11/13 13:09:07 weiden Exp $
+/* $Id: loader.c,v 1.152 2004/12/24 17:06:59 navaraf Exp $
  * 
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -1157,7 +1157,7 @@
 	CPRINT("LdrPEFixupForward: failed to find module %s\n", NameBuffer);
 	return NULL;
      }
-  return LdrPEGetExportByName(ModuleObject->Base, p+1, 0xffff);
+  return LdrPEGetExportByName(ModuleObject->Base, (PUCHAR)(p+1), 0xffff);
 }
 
 static NTSTATUS
@@ -1377,7 +1377,7 @@
    if (Hint < ExportDir->NumberOfNames)
    {
       ExName = RVA(BaseAddress, ExNames[Hint]);
-      if (strcmp(ExName, SymbolName) == 0)
+      if (strcmp(ExName, (PCHAR)SymbolName) == 0)
       {
          Ordinal = ExOrdinals[Hint];
          Function = RVA(BaseAddress, ExFunctions[Ordinal]);
@@ -1412,7 +1412,7 @@
       mid = (minn + maxn) / 2;
 
       ExName = RVA(BaseAddress, ExNames[mid]);
-      res = strcmp(ExName, SymbolName);
+      res = strcmp(ExName, (PCHAR)SymbolName);
       if (res == 0)
       {
          Ordinal = ExOrdinals[mid];
@@ -1455,7 +1455,7 @@
    for (i = 0; i < ExportDir->NumberOfNames; i++)
    {
       ExName = RVA(BaseAddress, ExNames[i]);
-      if (strcmp(ExName,SymbolName) == 0)
+      if (strcmp(ExName, (PCHAR)SymbolName) == 0)
       {
          Ordinal = ExOrdinals[i];
          Function = RVA(BaseAddress, ExFunctions[Ordinal]);

reactos/ntoskrnl/lpc
reply.c 1.23 -> 1.24
diff -u -r1.23 -r1.24
--- reply.c	31 Oct 2004 20:27:08 -0000	1.23
+++ reply.c	24 Dec 2004 17:06:59 -0000	1.24
@@ -1,4 +1,4 @@
-/* $Id: reply.c,v 1.23 2004/10/31 20:27:08 ea Exp $
+/* $Id: reply.c,v 1.24 2004/12/24 17:06:59 navaraf Exp $
  * 
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -56,7 +56,7 @@
    MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId();
    MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId();
    MessageReply->Message.MessageType = MessageType;
-   MessageReply->Message.MessageId = InterlockedIncrement((LONG *)&LpcpNextMessageId);
+   MessageReply->Message.MessageId = InterlockedIncrementUL(&LpcpNextMessageId);
    
    KeAcquireSpinLock(&Port->Lock, &oldIrql);
    EiEnqueueMessagePort(Port, MessageReply);

reactos/ntoskrnl/mm
RPoolMgr.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- RPoolMgr.h	21 Dec 2004 04:05:18 -0000	1.3
+++ RPoolMgr.h	24 Dec 2004 17:06:59 -0000	1.4
@@ -1,4 +1,4 @@
-/* $Id: RPoolMgr.h,v 1.3 2004/12/21 04:05:18 royce Exp $
+/* $Id: RPoolMgr.h,v 1.4 2004/12/24 17:06:59 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -354,8 +354,8 @@
 
 	if ( printzone )
 	{
-		unsigned char* HiZone = Addr + pUsed->UserSize;
-		unsigned char* LoZone = Addr - R_RZ; // this is to simplify indexing below...
+		unsigned char* HiZone = (unsigned char*)Addr + pUsed->UserSize;
+		unsigned char* LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below...
 		R_DEBUG ( ", LoZone " );
 		for ( i = 0; i < R_RZ; i++ )
 			R_DEBUG ( "%02x", LoZone[i] );
@@ -414,8 +414,8 @@
 	{
 		RiBadBlock ( pUsed, Addr, "invalid user size", file, line, 0 );
 	}
-	HiZone = Addr + pUsed->UserSize;
-	LoZone = Addr - R_RZ; // this is to simplify indexing below...
+	HiZone = (unsigned char*)Addr + pUsed->UserSize;
+	LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below...
 	for ( i = 0; i < R_RZ && bLow && bHigh; i++ )
 	{
 		bLow = bLow && ( LoZone[i] == R_RZ_LOVALUE );

reactos/ntoskrnl/mm
balance.c 1.33 -> 1.34
diff -u -r1.33 -r1.34
--- balance.c	15 Aug 2004 16:39:06 -0000	1.33
+++ balance.c	24 Dec 2004 17:06:59 -0000	1.34
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: balance.c,v 1.33 2004/08/15 16:39:06 chorns Exp $
+/* $Id: balance.c,v 1.34 2004/12/24 17:06:59 navaraf Exp $
  *
  * PROJECT:     ReactOS kernel 
  * FILE:        ntoskrnl/mm/balance.c
@@ -110,7 +110,7 @@
    KeAcquireSpinLock(&AllocationListLock, &oldIrql);
    if (MmGetReferenceCountPage(Page) == 1)
    {
-      InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+      InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
       if (IsListEmpty(&AllocationListHead) || MmStats.NrFreePages < MiMinimumAvailablePages)
       {
          KeReleaseSpinLock(&AllocationListLock, oldIrql);
@@ -196,13 +196,13 @@
    /*
     * Make sure we don't exceed our individual target.
     */
-   OldUsed = InterlockedIncrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+   OldUsed = InterlockedIncrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
    if (OldUsed >= (MiMemoryConsumers[Consumer].PagesTarget - 1) &&
          !MiIsBalancerThread())
    {
       if (!CanWait)
       {
-         InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+         InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
          return(STATUS_NO_MEMORY);
       }
       MiTrimMemoryConsumer(Consumer);
@@ -236,7 +236,7 @@
 
       if (!CanWait)
       {
-         InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+         InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
          return(STATUS_NO_MEMORY);
       }
 
@@ -244,7 +244,7 @@
       Request.Page = 0;
 
       KeInitializeEvent(&Request.Event, NotificationEvent, FALSE);
-      InterlockedIncrement((LONG *)&MiPagesRequired);
+      InterlockedIncrementUL(&MiPagesRequired);
 
       KeAcquireSpinLock(&AllocationListLock, &oldIrql);
 
@@ -268,7 +268,7 @@
       }
       MmTransferOwnershipPage(Page, Consumer);
       *AllocatedPage = Page;
-      InterlockedDecrement((LONG *)&MiPagesRequired);
+      InterlockedDecrementUL(&MiPagesRequired);
       return(STATUS_SUCCESS);
    }
 

reactos/ntoskrnl/mm
pageop.c 1.21 -> 1.22
diff -u -r1.21 -r1.22
--- pageop.c	15 Aug 2004 16:39:08 -0000	1.21
+++ pageop.c	24 Dec 2004 17:06:59 -0000	1.22
@@ -1,4 +1,4 @@
-/* $Id: pageop.c,v 1.21 2004/08/15 16:39:08 chorns Exp $
+/* $Id: pageop.c,v 1.22 2004/12/24 17:06:59 navaraf Exp $
  *
  * COPYRIGHT:    See COPYING in the top level directory
  * PROJECT:      ReactOS kernel
@@ -42,7 +42,7 @@
       KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql);
       return;
    }
-   InterlockedDecrement((LONG *)&PageOp->MArea->PageOpCount);
+   InterlockedDecrementUL(&PageOp->MArea->PageOpCount);
    PrevPageOp = MmPageOpHashTable[PageOp->Hash];
    if (PrevPageOp == PageOp)
    {
@@ -230,7 +230,7 @@
    PageOp->MArea = MArea;
    KeInitializeEvent(&PageOp->CompletionEvent, NotificationEvent, FALSE);
    MmPageOpHashTable[Hash] = PageOp;
-   InterlockedIncrement((LONG *)&MArea->PageOpCount);
+   InterlockedIncrementUL(&MArea->PageOpCount);
 
    KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql);
    return(PageOp);

reactos/ntoskrnl/mm
rmap.c 1.31 -> 1.32
diff -u -r1.31 -r1.32
--- rmap.c	2 Oct 2004 10:16:10 -0000	1.31
+++ rmap.c	24 Dec 2004 17:06:59 -0000	1.32
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: rmap.c,v 1.31 2004/10/02 10:16:10 hbirr Exp $
+/* $Id: rmap.c,v 1.32 2004/12/24 17:06:59 navaraf Exp $
  *
  * COPYRIGHT:   See COPYING in the top directory
  * PROJECT:     ReactOS kernel 
@@ -423,7 +423,7 @@
    }
    if (Process)
    {
-      PrevSize = InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, PAGE_SIZE);
+      PrevSize = InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, PAGE_SIZE);
       if (PrevSize >= Process->Vm.PeakWorkingSetSize)
       {
          Process->Vm.PeakWorkingSetSize = PrevSize + PAGE_SIZE;
@@ -465,7 +465,7 @@
       }
       if (Process)
       {
-         InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
+         InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
       }
    }
    ExReleaseFastMutex(&RmapListLock);
@@ -501,7 +501,7 @@
 	 }
 	 if (Process)
 	 {
-            InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
+            InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
 	 }
          return;
       }

reactos/ntoskrnl/mm
section.c 1.167 -> 1.168
diff -u -r1.167 -r1.168
--- section.c	19 Dec 2004 16:16:58 -0000	1.167
+++ section.c	24 Dec 2004 17:06:59 -0000	1.168
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: section.c,v 1.167 2004/12/19 16:16:58 navaraf Exp $
+/* $Id: section.c,v 1.168 2004/12/24 17:06:59 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/mm/section.c
@@ -2026,7 +2026,7 @@
          {
             MmLockSectionSegment(&SectionSegments[i]);
          }
-         RefCount = InterlockedDecrement((LONG *)&SectionSegments[i].ReferenceCount);
+         RefCount = InterlockedDecrementUL(&SectionSegments[i].ReferenceCount);
          if (SectionSegments[i].Characteristics & IMAGE_SECTION_CHAR_SHARED)
          {
             if (RefCount == 0)
@@ -2055,7 +2055,7 @@
       }
       else
       {
-         InterlockedDecrement((LONG *)&Section->Segment->ReferenceCount);
+         InterlockedDecrementUL(&Section->Segment->ReferenceCount);
       }
    }
    if (Section->FileObject != NULL)
@@ -2468,7 +2468,7 @@
          (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointer->
          DataSectionObject;
       Section->Segment = Segment;
-      InterlockedIncrement((PLONG)&Segment->ReferenceCount);
+      InterlockedIncrementUL(&Segment->ReferenceCount);
       MmLockSectionSegment(Segment);
 
       if (MaximumSize.u.LowPart > Segment->RawLength &&
@@ -2818,8 +2818,8 @@
          ExInitializeFastMutex(&SectionSegments[i].Lock);
          RtlZeroMemory(&SectionSegments[i].PageDirectory, sizeof(SECTION_PAGE_DIRECTORY));
       }
-      if (0 != InterlockedCompareExchange((PLONG)&FileObject->SectionObjectPointer->ImageSectionObject,
-                                          (LONG)ImageSectionObject, 0))
+      if (0 != InterlockedCompareExchangeUL(&FileObject->SectionObjectPointer->ImageSectionObject,
+                                            ImageSectionObject, 0))
       {
          /*
           * An other thread has initialized the some image in the background
@@ -2831,7 +2831,7 @@
 
          for (i = 0; i < NrSegments; i++)
          {
-            InterlockedIncrement((LONG *)&SectionSegments[i].ReferenceCount);
+            InterlockedIncrementUL(&SectionSegments[i].ReferenceCount);
          }
       }
       ExFreePool(ImageSections);
@@ -2897,7 +2897,7 @@
        */
       for (i = 0; i < NrSegments; i++)
       {
-         InterlockedIncrement((LONG *)&SectionSegments[i].ReferenceCount);
+         InterlockedIncrementUL(&SectionSegments[i].ReferenceCount);
       }
 
    }

reactos/ntoskrnl/mm/i386
page.c 1.78 -> 1.79
diff -u -r1.78 -r1.79
--- page.c	27 Nov 2004 16:37:52 -0000	1.78
+++ page.c	24 Dec 2004 17:07:00 -0000	1.79
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: page.c,v 1.78 2004/11/27 16:37:52 hbirr Exp $
+/* $Id: page.c,v 1.79 2004/12/24 17:07:00 navaraf Exp $
  *
  * PROJECT:     ReactOS kernel
  * FILE:        ntoskrnl/mm/i386/page.c
@@ -426,7 +426,7 @@
    if (Ke386Pae)
    {
       ULONGLONG ZeroPde = 0LL;
-      ExfpInterlockedExchange64(PAE_ADDR_TO_PDE(Address), &ZeroPde);
+      ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPde);
    }
    else
    {
@@ -470,7 +470,7 @@
          }
       }
       Pfn = PAE_PTE_TO_PFN(*(PAE_ADDR_TO_PDE(Address)));
-      ExfpInterlockedExchange64(PAE_ADDR_TO_PDE(Address), &ZeroPte);
+      ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPte);
    }
    else
    {
@@ -536,7 +536,7 @@
          KEBUGCHECK(0);
       }
       PageDir += PAE_ADDR_TO_PDE_PAGE_OFFSET(Address);
-      Entry = ExfInterlockedCompareExchange64(PageDir, &ZeroEntry, &ZeroEntry);
+      Entry = ExfInterlockedCompareExchange64UL(PageDir, &ZeroEntry, &ZeroEntry);
       if (Entry == 0LL)
       {
          if (Create == FALSE)
@@ -550,7 +550,7 @@
 	    KEBUGCHECK(0);
 	 }
          Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER; 
-	 Entry = ExfInterlockedCompareExchange64(PageDir, &Entry, &ZeroEntry);
+	 Entry = ExfInterlockedCompareExchange64UL(PageDir, &Entry, &ZeroEntry);
 	 if (Entry != 0LL)
 	 {
 	    MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
@@ -570,7 +570,7 @@
       return Pt + PAE_ADDR_TO_PTE_OFFSET(Address);
    }
    PageDir = PAE_ADDR_TO_PDE(Address);
-   if (0LL == ExfInterlockedCompareExchange64(PageDir, &ZeroEntry, &ZeroEntry))
+   if (0LL == ExfInterlockedCompareExchange64UL(PageDir, &ZeroEntry, &ZeroEntry))
    {
       if (Address >= (PVOID)KERNEL_BASE)
       {
@@ -590,12 +590,12 @@
 	    {
 	       Entry |= PA_GLOBAL;
 	    }
-	    if (0LL != ExfInterlockedCompareExchange64(&MmGlobalKernelPageDirectoryForPAE[PAE_ADDR_TO_PDE_OFFSET(Address)], &Entry, &ZeroEntry))
+	    if (0LL != ExfInterlockedCompareExchange64UL(&MmGlobalKernelPageDirectoryForPAE[PAE_ADDR_TO_PDE_OFFSET(Address)], &Entry, &ZeroEntry))
 	    {
 	       MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
 	    }
 	 }
-	 ExfInterlockedCompareExchange64(PageDir, &MmGlobalKernelPageDirectoryForPAE[PAE_ADDR_TO_PDE_OFFSET(Address)], &ZeroEntry);
+	 ExfInterlockedCompareExchange64UL(PageDir, &MmGlobalKernelPageDirectoryForPAE[PAE_ADDR_TO_PDE_OFFSET(Address)], &ZeroEntry);
       }
       else
       {
@@ -609,7 +609,7 @@
 	    KEBUGCHECK(0);
 	 }
 	 Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER;
-         Entry = ExfInterlockedCompareExchange64(PageDir, &Entry, &ZeroEntry);
+         Entry = ExfInterlockedCompareExchange64UL(PageDir, &Entry, &ZeroEntry);
 	 if (Entry != 0LL)
 	 {
 	    MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
@@ -647,7 +647,7 @@
 	 {
 	    KEBUGCHECK(0);
 	 }
-         Entry = InterlockedCompareExchange(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
+         Entry = InterlockedCompareExchangeUL(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
 	 if (Entry != 0)
 	 {
 	    MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
@@ -687,7 +687,7 @@
 	    {
 	       Entry |= PA_GLOBAL;
 	    }
-	    if(0 != InterlockedCompareExchange(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0))
+	    if(0 != InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0))
 	    {
 	       MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
 	    }
@@ -705,7 +705,7 @@
 	 {
 	    KEBUGCHECK(0);
 	 }
-         Entry = InterlockedCompareExchange(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
+         Entry = InterlockedCompareExchangeUL(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
 	 if (Entry != 0)
 	 {
 	    MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
@@ -820,7 +820,7 @@
       {
         Pte = *Pt;
 	tmpPte = Pte & ~PA_PRESENT;
-      } while (Pte != ExfInterlockedCompareExchange64(Pt, &tmpPte, &Pte)); 
+      } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte)); 
 
       MiFlushTlb((PULONG)Pt, Address);
       WasValid = PAE_PAGE_MASK(Pte) != 0LL ? TRUE : FALSE;
@@ -857,7 +857,7 @@
       do
       {
         Pte = *Pt;
-      } while (Pte != InterlockedCompareExchange(Pt, Pte & ~PA_PRESENT, Pte)); 
+      } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_PRESENT, Pte)); 
 
       MiFlushTlb(Pt, Address);
       WasValid = (PAGE_MASK(Pte) != 0);
@@ -893,7 +893,7 @@
          /*
           * Set the entry to zero
           */
-	 ExfpInterlockedExchange64(Pt, &ZeroPte);
+	 ExfpInterlockedExchange64UL(Pt, &ZeroPte);
          MiFlushTlb((PULONG)Pt, Address);
       }
    }
@@ -948,7 +948,7 @@
        * Atomically set the entry to zero and get the old value.
        */
       Pte = 0LL;
-      Pte = ExfpInterlockedExchange64(Pt, &Pte);
+      Pte = ExfpInterlockedExchange64UL(Pt, &Pte);
 
       MiFlushTlb((PULONG)Pt, Address);
 
@@ -1003,7 +1003,7 @@
       /*
        * Atomically set the entry to zero and get the old value.
        */
-      Pte = InterlockedExchange(Pt, 0);
+      Pte = InterlockedExchangeUL(Pt, 0);
 
       MiFlushTlb(Pt, Address);
 
@@ -1079,7 +1079,7 @@
        * Atomically set the entry to zero and get the old value.
        */
       Pte = 0LL;
-      Pte = ExfpInterlockedExchange64(Pt, &Pte);
+      Pte = ExfpInterlockedExchange64UL(Pt, &Pte);
 
       MiFlushTlb((PULONG)Pt, Address);
 
@@ -1123,7 +1123,7 @@
       /*
        * Atomically set the entry to zero and get the old value.
        */
-      Pte = InterlockedExchange(Pt, 0);
+      Pte = InterlockedExchangeUL(Pt, 0);
 
       MiFlushTlb(Pt, Address);
 
@@ -1230,7 +1230,7 @@
       {
          Pte = *Pt;
 	 tmpPte = Pte & ~PA_ACCESSED;
-      } while (Pte != ExfInterlockedCompareExchange64(Pt, &tmpPte, &Pte));
+      } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte));
 
       if (Pte & PA_ACCESSED)
       {
@@ -1257,7 +1257,7 @@
       do
       {
          Pte = *Pt;
-      } while (Pte != InterlockedCompareExchange(Pt, Pte & ~PA_ACCESSED, Pte));
+      } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_ACCESSED, Pte));
 
       if (Pte & PA_ACCESSED)
       {
@@ -1296,7 +1296,7 @@
       {
          Pte = *Pt;
 	 tmpPte = Pte & ~PA_DIRTY;
-      } while (Pte != ExfInterlockedCompareExchange64(Pt, &tmpPte, &Pte));
+      } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte));
 
       if (Pte & PA_DIRTY)
       {
@@ -1322,7 +1322,7 @@
       do
       {
          Pte = *Pt;
-      } while (Pte != InterlockedCompareExchange(Pt, Pte & ~PA_DIRTY, Pte));
+      } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_DIRTY, Pte));
 
       if (Pte & PA_DIRTY)
       {
@@ -1358,7 +1358,7 @@
       {
          Pte = *Pt;
 	 tmpPte = Pte | PA_DIRTY; 
-      } while (Pte != ExfInterlockedCompareExchange64(Pt, &tmpPte, &Pte));
+      } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte));
       if (!(Pte & PA_DIRTY))
       {
          MiFlushTlb((PULONG)Pt, Address);
@@ -1382,7 +1382,7 @@
       do
       {
          Pte = *Pt;
-      } while (Pte != InterlockedCompareExchange(Pt, Pte | PA_DIRTY, Pte));
+      } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_DIRTY, Pte));
       if (!(Pte & PA_DIRTY))
       {
          MiFlushTlb(Pt, Address);
@@ -1412,7 +1412,7 @@
       {
          Pte = *Pt;
 	 tmpPte = Pte | PA_PRESENT;
-      } while (Pte != ExfInterlockedCompareExchange64(Pt, &tmpPte, &Pte));
+      } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte));
       if (!(Pte & PA_PRESENT))
       {
          MiFlushTlb((PULONG)Pt, Address);
@@ -1436,7 +1436,7 @@
       do
       {
          Pte = *Pt;
-      } while (Pte != InterlockedCompareExchange(Pt, Pte | PA_PRESENT, Pte));
+      } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_PRESENT, Pte));
       if (!(Pte & PA_PRESENT))
       {
          MiFlushTlb(Pt, Address);
@@ -1546,7 +1546,7 @@
 	 {
 	    Pte |= 0x8000000000000000LL;
 	 }
-         Pte = ExfpInterlockedExchange64(Pt, &Pte);
+         Pte = ExfpInterlockedExchange64UL(Pt, &Pte);
          if (Pte != 0LL)
          {
             KEBUGCHECK(0);
@@ -1635,7 +1635,7 @@
          KEBUGCHECK(0);
       }
       tmpPte = SwapEntry << 1;
-      Pte = ExfpInterlockedExchange64(Pt, &tmpPte);
+      Pte = ExfpInterlockedExchange64UL(Pt, &tmpPte);
       if (PAE_PAGE_MASK((Pte)) != 0)
       {
          MmMarkPageUnmapped(PAE_PTE_TO_PFN((Pte)));
@@ -1793,7 +1793,7 @@
 	 {
 	    tmpPte |= 0x8000000000000000LL;
 	 }
-         Pte = ExfpInterlockedExchange64(Pt, &tmpPte);
+         Pte = ExfpInterlockedExchange64UL(Pt, &tmpPte);
          if (PAE_PAGE_MASK((Pte)) != 0LL && !((Pte) & PA_PRESENT))
          {
             KEBUGCHECK(0);
@@ -2014,7 +2014,7 @@
 	{
 	   tmpPte &= ~0x8000000000000000LL;
 	}
-      } while (Pte != ExfInterlockedCompareExchange64(Pt, &tmpPte, &Pte));
+      } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte));
 
       MiFlushTlb((PULONG)Pt, Address);
    }
@@ -2124,7 +2124,7 @@
          {
             if (i * 512 + Offset < PAE_ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) || i * 512 + Offset >= PAE_ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)+4)
             {
-               ExfInterlockedCompareExchange64(&Pde[Offset], &MmGlobalKernelPageDirectoryForPAE[i*512 + Offset], &ZeroPde);
+               ExfInterlockedCompareExchange64UL(&Pde[Offset], &MmGlobalKernelPageDirectoryForPAE[i*512 + Offset], &ZeroPde);
             }
          }
          MmUnmapPageTable((PULONG)Pde);
@@ -2148,7 +2148,7 @@
       {
          if (Offset != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP))
          {
-            InterlockedCompareExchange(&Pde[Offset], MmGlobalKernelPageDirectory[Offset], 0);
+            InterlockedCompareExchangeUL(&Pde[Offset], MmGlobalKernelPageDirectory[Offset], 0);
          }
       }
       if (Pde != (PULONG)PAGEDIRECTORY_MAP)
@@ -2170,7 +2170,7 @@
          if ((i < PAE_ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) || i >= PAE_ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) + 4) &&
              0LL == MmGlobalKernelPageDirectoryForPAE[i] && 0LL != CurrentPageDirectory[i])
          {
-            ExfpInterlockedExchange64(&MmGlobalKernelPageDirectoryForPAE[i], &CurrentPageDirectory[i]);
+            ExfpInterlockedExchange64UL(&MmGlobalKernelPageDirectoryForPAE[i], &CurrentPageDirectory[i]);
 	    if (Ke386GlobalPagesEnabled)
 	    {
                MmGlobalKernelPageDirectoryForPAE[i] |= PA_GLOBAL;

reactos/ntoskrnl/ps
job.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- job.c	5 Nov 2004 13:30:18 -0000	1.10
+++ job.c	24 Dec 2004 17:07:00 -0000	1.11
@@ -265,7 +265,7 @@
                             ULONG UIRestrictionsClass)
 {
   ASSERT(Job);
-  InterlockedExchange((LONG*)&Job->UIRestrictionsClass, (LONG)UIRestrictionsClass);
+  InterlockedExchangeUL(&Job->UIRestrictionsClass, UIRestrictionsClass);
   /* FIXME - walk through the job process list and update the restrictions? */
 }
 

reactos/ntoskrnl/ps
kill.c 1.90 -> 1.91
diff -u -r1.90 -r1.91
--- kill.c	12 Dec 2004 17:25:52 -0000	1.90
+++ kill.c	24 Dec 2004 17:07:00 -0000	1.91
@@ -1,4 +1,4 @@
-/* $Id: kill.c,v 1.90 2004/12/12 17:25:52 hbirr Exp $
+/* $Id: kill.c,v 1.91 2004/12/24 17:07:00 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -300,8 +300,8 @@
 	   ObGetObjectHandleCount(Process));
    
    ObReferenceObject(Process);
-   if (InterlockedExchange((PLONG)&Process->Pcb.State, 
-			   PROCESS_STATE_TERMINATED) == 
+   if (InterlockedExchangeUL(&Process->Pcb.State, 
+			     PROCESS_STATE_TERMINATED) == 
        PROCESS_STATE_TERMINATED)
      {
         ObDereferenceObject(Process);

reactos/ntoskrnl/ps
process.c 1.159 -> 1.160
diff -u -r1.159 -r1.160
--- process.c	18 Dec 2004 21:06:25 -0000	1.159
+++ process.c	24 Dec 2004 17:07:00 -0000	1.160
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.159 2004/12/18 21:06:25 gvg Exp $
+/* $Id: process.c,v 1.160 2004/12/24 17:07:00 navaraf Exp $
  *
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -333,7 +333,7 @@
 #endif
 
    PsInitialSystemProcess->UniqueProcessId = 
-     InterlockedIncrement((LONG *)&PiNextProcessUniqueId); /* TODO */
+     InterlockedIncrementUL(&PiNextProcessUniqueId); /* TODO */
    PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
    
    KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
@@ -714,7 +714,7 @@
    KProcess->AutoAlignment = 0;
    MmInitializeAddressSpace(Process,
 			    &Process->AddressSpace);
-   Process->UniqueProcessId = InterlockedIncrement((LONG *)&PiNextProcessUniqueId); /* TODO */
+   Process->UniqueProcessId = InterlockedIncrementUL(&PiNextProcessUniqueId); /* TODO */
    Process->InheritedFromUniqueProcessId = 
      (HANDLE)pParentProcess->UniqueProcessId;
    ObCreateHandleTable(pParentProcess,
@@ -2251,12 +2251,12 @@
       return STATUS_PROCESS_IS_TERMINATING;
     }
 
-    /* FIXME - why don't we have InterlockedCompareExchangePointer in ntoskrnl?! */
-    PrevLockOwner = (PKTHREAD)InterlockedCompareExchange((LONG*)&Process->LockOwner, (LONG)CallingThread, (LONG)NULL);
+    PrevLockOwner = (PKTHREAD)InterlockedCompareExchangePointer(
+      &Process->LockOwner, CallingThread, NULL);
     if(PrevLockOwner == NULL || PrevLockOwner == CallingThread)
     {
       /* we got the lock or already locked it */
-      if(InterlockedIncrement((LONG*)&Process->LockCount) == 1)
+      if(InterlockedIncrementUL(&Process->LockCount) == 1)
       {
         KeClearEvent(&Process->LockEvent);
       }
@@ -2293,10 +2293,9 @@
 {
   ASSERT(Process->LockOwner == KeGetCurrentThread());
   
-  if(InterlockedDecrement((LONG*)&Process->LockCount) == 0)
+  if(InterlockedDecrementUL(&Process->LockCount) == 0)
   {
-    /* FIXME - why don't we have InterlockedExchangePointer in ntoskrnl?! */
-    InterlockedExchange((LONG*)&Process->LockOwner, (LONG)NULL);
+    InterlockedExchangePointer(&Process->LockOwner, NULL);
     KeSetEvent(&Process->LockEvent, IO_NO_INCREMENT, FALSE);
   }
   
CVSspam 0.2.8