[ros-diffs] [tkreuzer] 33454: - Use InterlockedExchangePointer instead of InterlockedExchange for a pointer. - Don't cast a DWORD to HANDLE directly - ViewSize param of MmMapViewOfSection is SIZE_T, not ULONG

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon May 12 00:23:45 CEST 2008


Author: tkreuzer
Date: Sun May 11 17:23:45 2008
New Revision: 33454

URL: http://svn.reactos.org/svn/reactos?rev=33454&view=rev
Log:
- Use InterlockedExchangePointer instead of InterlockedExchange for a pointer.
- Don't cast a DWORD to HANDLE directly
- ViewSize param of MmMapViewOfSection is SIZE_T, not ULONG

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c?rev=33454&r1=33453&r2=33454&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sun May 11 17:23:45 2008
@@ -542,12 +542,12 @@
          return;
       }
       IntReferenceMessageQueue(NewQueue);
-      InterlockedExchange((LONG*)&NewQueue->Desktop, (LONG)pdo);
-   }
-   Old = (PUSER_MESSAGE_QUEUE)InterlockedExchange((LONG*)&pdo->ActiveMessageQueue, (LONG)NewQueue);
+      (void)InterlockedExchangePointer((PVOID*)&NewQueue->Desktop, pdo);
+   }
+   Old = (PUSER_MESSAGE_QUEUE)InterlockedExchangePointer((PVOID*)&pdo->ActiveMessageQueue, NewQueue);
    if(Old != NULL)
    {
-      InterlockedExchange((LONG*)&Old->Desktop, 0);
+      (void)InterlockedExchangePointer((PVOID*)&Old->Desktop, 0);
       IntDereferenceMessageQueue(Old);
    }
 }
@@ -1660,7 +1660,7 @@
       RETURN(0);
    }
 
-   Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
+   Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)dwThreadId, &Thread);
    if(!NT_SUCCESS(Status))
    {
       SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -1774,7 +1774,7 @@
     PW32THREADINFO ti;
     PW32HEAP_USER_MAPPING HeapMapping, *PrevLink = &PsGetCurrentProcessWin32Process()->HeapMappings.Next;
     PVOID UserBase = NULL;
-    ULONG ViewSize = 0;
+    SIZE_T ViewSize = 0;
     LARGE_INTEGER Offset;
     NTSTATUS Status;
 



More information about the Ros-diffs mailing list