From 8c2db2fee03965e5c5fd72ecdd60de5d78d80a14 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 11 May 2008 22:23:45 +0000 Subject: [PATCH] - 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 svn path=/trunk/; revision=33454 --- reactos/subsystems/win32/win32k/ntuser/desktop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index 709d396747b..4ac6e1111c4 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -542,12 +542,12 @@ IntSetFocusMessageQueue(PUSER_MESSAGE_QUEUE NewQueue) return; } IntReferenceMessageQueue(NewQueue); - InterlockedExchange((LONG*)&NewQueue->Desktop, (LONG)pdo); + (void)InterlockedExchangePointer((PVOID*)&NewQueue->Desktop, pdo); } - Old = (PUSER_MESSAGE_QUEUE)InterlockedExchange((LONG*)&pdo->ActiveMessageQueue, (LONG)NewQueue); + 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 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1) 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 @@ IntMapDesktopView(IN PDESKTOP_OBJECT DesktopObject) 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;