[WIN32k]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 5 Jan 2010 20:06:33 +0000 (20:06 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 5 Jan 2010 20:06:33 +0000 (20:06 +0000)
Fix some 64 bit issues.

svn path=/trunk/; revision=44958

reactos/subsystems/win32/win32k/ntuser/event.c
reactos/subsystems/win32/win32k/ntuser/hook.c
reactos/subsystems/win32/win32k/ntuser/kbdlayout.c
reactos/subsystems/win32/win32k/ntuser/msgqueue.c
reactos/subsystems/win32/win32k/ntuser/simplecall.c

index 0eb1168..9c1b23f 100644 (file)
@@ -165,7 +165,7 @@ co_EVENT_CallEvents( DWORD event,
                                         hwnd,
                                pEP->idObject,
                                 pEP->idChild,
- (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
+ (DWORD_PTR)(NtCurrentTeb()->ClientId).UniqueThread,
                     (DWORD)EngGetTickCount(),
                                    pEH->Proc);
    return Result;
@@ -202,7 +202,7 @@ IntNotifyWinEvent(
         if (pEH->head.pti->pEThread != PsGetCurrentThread())
         { // if all process || all thread || other thread same process
            if (!(pEH->idProcess) || !(pEH->idThread) || 
-               (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess))
+               (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)(DWORD_PTR)pEH->idProcess))
            {
               Result = IntCallLowLevelEvent( pEH,
                                              Event,
@@ -213,7 +213,7 @@ IntNotifyWinEvent(
         }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
         else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) &&
                    ( ((pEH->idProcess &&
-                     NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess) &&
+                     NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)(DWORD_PTR)pEH->idProcess) &&
                      !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) ||
                      !pEH->idProcess ) )
         {
index 99a6a10..a59444b 100644 (file)
@@ -1136,7 +1136,7 @@ NtUserSetWindowsHookEx(HINSTANCE Mod,
         Mod = NULL;
         Global = FALSE;
 
-        if (!NT_SUCCESS(PsLookupThreadByThreadId((HANDLE) ThreadId, &Thread)))
+        if (!NT_SUCCESS(PsLookupThreadByThreadId((HANDLE)(DWORD_PTR) ThreadId, &Thread)))
         {
             DPRINT1("Invalid thread id 0x%x\n", ThreadId);
             SetLastWin32Error(ERROR_INVALID_PARAMETER);
index c43a6c2..ec07d34 100644 (file)
@@ -228,7 +228,7 @@ static PKBL UserLoadDllAndCreateKbl(DWORD LocaleId)
       hKl |= 0xe001 << 16; /* FIXME */
    else hKl |= hKl << 16;
 
-   NewKbl->hkl = (HKL) hKl;
+   NewKbl->hkl = (HKL)(ULONG_PTR) hKl;
    NewKbl->klid = LocaleId;
    NewKbl->Flags = 0;
    NewKbl->RefCount = 0;
@@ -453,7 +453,7 @@ UserGetKeyboardLayout(
       return W32Thread->KeyboardLayout->hkl;
    }
 
-   Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
+   Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)dwThreadId, &Thread);
    if(!NT_SUCCESS(Status))
    {
       SetLastWin32Error(ERROR_INVALID_PARAMETER);
index 27e029a..b7f3c4b 100644 (file)
@@ -456,7 +456,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
 
    *ScreenPoint = Message->Msg.pt;
 
-   if((Window != NULL && (int)Window != 1 && CaptureWindow->hSelf != Window->hSelf) ||
+   if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->hSelf != Window->hSelf) ||
          ((FilterLow != 0 || FilterHigh != 0) && (Msg < FilterLow || Msg > FilterHigh)))
    {
       /* Reject the message because it doesn't match the filter */
@@ -1374,7 +1374,7 @@ co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
    {
       CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
                                          ListEntry);
-      if ((!Window || (int)Window == 1 || Window->hSelf == CurrentMessage->Msg.hwnd) &&
+      if ((!Window || PtrToInt(Window) == 1 || Window->hSelf == CurrentMessage->Msg.hwnd) &&
             ((MsgFilterLow == 0 && MsgFilterHigh == 0) ||
              (MsgFilterLow <= CurrentMessage->Msg.message &&
               MsgFilterHigh >= CurrentMessage->Msg.message)))
@@ -1985,7 +1985,7 @@ MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
       Timer = CONTAINING_RECORD(MessageQueue->TimerListHead.Flink,
                                 TIMER_ENTRY, ListEntry);
       EnumEntry = EnumEntry->Flink;
-      if ((NULL == WndFilter || (int)WndFilter == 1 || Timer->Wnd == WndFilter->hSelf) &&
+      if ((NULL == WndFilter || PtrToInt(WndFilter) == 1 || Timer->Wnd == WndFilter->hSelf) &&
             ((MsgFilterMin == 0 && MsgFilterMax == 0) ||
              (MsgFilterMin <= Timer->Msg &&
               Timer->Msg <= MsgFilterMax)))
index 5f47f39..2c978cb 100644 (file)
@@ -492,7 +492,7 @@ NtUserCallHwndLock(
             if (!((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
                break;
 
-            if(!(Menu = UserGetMenuObject((HMENU) Wnd->IDMenu)))
+            if(!(Menu = UserGetMenuObject((HMENU)(DWORD_PTR) Wnd->IDMenu)))
                break;
 
             Menu->MenuInfo.WndOwner = hWnd;