update for HEAD-2003050101
[reactos.git] / ntoskrnl / mm / balance.c
index 309948e..753adae 100644 (file)
@@ -117,9 +117,9 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PHYSICAL_ADDRESS Page)
   KeAcquireSpinLock(&AllocationListLock, &oldIrql);
   if (MmGetReferenceCountPage(Page) == 1)
     {
-      InterlockedDecrement(&MiMemoryConsumers[Consumer].PagesUsed);
-      InterlockedIncrement(&MiNrAvailablePages);
-      InterlockedDecrement(&MiPagesRequired);
+      InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+      InterlockedIncrement((LONG *)&MiNrAvailablePages);
+      InterlockedDecrement((LONG *)&MiPagesRequired);
       if (IsListEmpty(&AllocationListHead))
        {
          KeReleaseSpinLock(&AllocationListLock, oldIrql);
@@ -203,13 +203,13 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
   /*
    * Make sure we don't exceed our individual target.
    */
-  OldUsed = InterlockedIncrement(&MiMemoryConsumers[Consumer].PagesUsed);
+  OldUsed = InterlockedIncrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
   if (OldUsed >= (MiMemoryConsumers[Consumer].PagesTarget - 1) &&
       WorkerThreadId != PsGetCurrentThreadId())
     {
       if (!CanWait)
        {
-         InterlockedDecrement(&MiMemoryConsumers[Consumer].PagesUsed);
+         InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
          return(STATUS_NO_MEMORY);
        }
       MiTrimMemoryConsumer(Consumer);
@@ -218,22 +218,22 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
   /*
    * Make sure we don't exceed global targets.
    */
-  OldAvailable = InterlockedDecrement(&MiNrAvailablePages);
+  OldAvailable = InterlockedDecrement((LONG *)&MiNrAvailablePages);
   if (OldAvailable < MiMinimumAvailablePages)
     {
       MM_ALLOCATION_REQUEST Request;
 
       if (!CanWait)
        {
-         InterlockedIncrement(&MiNrAvailablePages);
-         InterlockedDecrement(&MiMemoryConsumers[Consumer].PagesUsed);
+         InterlockedIncrement((LONG *)&MiNrAvailablePages);
+         InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
          return(STATUS_NO_MEMORY);
        }
 
       /* Insert an allocation request. */
       Request.Page.QuadPart = 0LL;
       KeInitializeEvent(&Request.Event, NotificationEvent, FALSE);
-      InterlockedIncrement(&MiPagesRequired);
+      InterlockedIncrement((LONG *)&MiPagesRequired);
 
       KeAcquireSpinLock(&AllocationListLock, &oldIrql);     
       if (NrWorkingThreads == 0)