[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 29 Dec 2012 19:14:30 +0000 (19:14 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 29 Dec 2012 19:14:30 +0000 (19:14 +0000)
Use the official HANDLE_TYPE enum instead of the custom USER_OBJECT_TYPE

svn path=/trunk/; revision=58041

25 files changed:
reactos/win32ss/drivers/videoprt/child.c
reactos/win32ss/gdi/ntgdi/cliprgn.h
reactos/win32ss/include/ntuser.h
reactos/win32ss/user/ntuser/accelerator.c
reactos/win32ss/user/ntuser/callproc.c
reactos/win32ss/user/ntuser/class.c
reactos/win32ss/user/ntuser/clipboard.c
reactos/win32ss/user/ntuser/cursoricon.c
reactos/win32ss/user/ntuser/cursoricon_new.c
reactos/win32ss/user/ntuser/event.c
reactos/win32ss/user/ntuser/hook.c
reactos/win32ss/user/ntuser/kbdlayout.c
reactos/win32ss/user/ntuser/menu.c
reactos/win32ss/user/ntuser/monitor.c
reactos/win32ss/user/ntuser/object.c
reactos/win32ss/user/ntuser/object.h
reactos/win32ss/user/ntuser/painting.c
reactos/win32ss/user/ntuser/simplecall.c
reactos/win32ss/user/ntuser/timer.c
reactos/win32ss/user/ntuser/win32.h
reactos/win32ss/user/ntuser/window.c
reactos/win32ss/user/ntuser/winpos.c
reactos/win32ss/user/user32/include/user_x.h
reactos/win32ss/user/user32/misc/misc.c
reactos/win32ss/user/user32/windows/menu.c

index 4bdc34d..e6a35e9 100644 (file)
@@ -393,4 +393,4 @@ IntVideoPortDispatchPdoPnp(
     IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
     return Status;
-}
\ No newline at end of file
+}
index 5ee4ba6..b160392 100644 (file)
@@ -3,4 +3,4 @@
 INT FASTCALL GdiGetClipBox(HDC hDC, RECTL *rc);
 INT FASTCALL GdiSelectVisRgn(HDC hdc, HRGN hrgn);
 INT FASTCALL GdiExtSelectClipRgn (PDC dc, HRGN hrgn, int fnMode);
-int FASTCALL CLIPPING_UpdateGCRegion(DC* Dc);
\ No newline at end of file
+int FASTCALL CLIPPING_UpdateGCRegion(DC* Dc);
index 77dce0e..be749e2 100644 (file)
@@ -33,32 +33,33 @@ typedef struct _USER_HANDLE_TABLE
    int allocated_handles;
 } USER_HANDLE_TABLE, * PUSER_HANDLE_TABLE;
 
-typedef enum _USER_OBJECT_TYPE
+typedef enum _HANDLE_TYPE
 {
-  otFree = 0,
-  otWindow,
-  otMenu,
-  otCursorIcon,
-  otSMWP,
-  otHook,
-  otClipBoardData,
-  otCallProc,
-  otAccel,
-  otDDEaccess,
-  otDDEconv,
-  otDDExact,
-  otMonitor,
-  otKBDlayout,
-  otKBDfile,
-  otEvent,
-  otTimer,
-  otInputContext,
-  otHidData,
-  otDeviceInfo,
-  otTouchInput,
-  otGestureInfo,
-  USER_HANDLE_TYPE_COUNT
-} USER_OBJECT_TYPE;
+    TYPE_FREE = 0,
+    TYPE_WINDOW = 1,
+    TYPE_MENU = 2,
+    TYPE_CURSOR = 3,
+    TYPE_SETWINDOWPOS = 4,
+    TYPE_HOOK = 5,
+    TYPE_CLIPDATA = 6,
+    TYPE_CALLPROC = 7,
+    TYPE_ACCELTABLE = 8,
+    TYPE_DDEACCESS = 9,
+    TYPE_DDECONV = 10,
+    TYPE_DDEXACT = 11,
+    TYPE_MONITOR = 12,
+    TYPE_KBDLAYOUT = 13,
+    TYPE_KBDFILE = 14,
+    TYPE_WINEVENTHOOK = 15,
+    TYPE_TIMER = 16,
+    TYPE_INPUTCONTEXT = 17,
+    TYPE_HIDDATA = 18,
+    TYPE_DEVICEINFO = 19,
+    TYPE_TOUCHINPUTINFO = 20,
+    TYPE_GESTUREINFOOBJ = 21,
+    TYPE_CTYPES,
+    TYPE_GENERIC = 255
+} HANDLE_TYPE, *PHANDLE_TYPE;
 
 typedef enum _USERTHREADINFOCLASS
 {
index 24d1b61..4c88bfa 100644 (file)
@@ -28,7 +28,7 @@ PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hAccel)
         return NULL;
     }
 
-    Accel = UserGetObject(gHandleTable, hAccel, otAccel);
+    Accel = UserGetObject(gHandleTable, hAccel, TYPE_ACCELTABLE);
     if (!Accel)
     {
         EngSetLastError(ERROR_INVALID_ACCEL_HANDLE);
@@ -257,7 +257,7 @@ NtUserCreateAcceleratorTable(
         RETURN( (HACCEL) NULL );
     }
 
-    Accel = UserCreateObject(gHandleTable, NULL, NULL, (PHANDLE)&hAccel, otAccel, sizeof(ACCELERATOR_TABLE));
+    Accel = UserCreateObject(gHandleTable, NULL, NULL, (PHANDLE)&hAccel, TYPE_ACCELTABLE, sizeof(ACCELERATOR_TABLE));
 
     if (Accel == NULL)
     {
@@ -270,7 +270,7 @@ NtUserCreateAcceleratorTable(
     if (Accel->Table == NULL)
     {
         UserDereferenceObject(Accel);
-        UserDeleteObject(hAccel, otAccel);
+        UserDeleteObject(hAccel, TYPE_ACCELTABLE);
         SetLastNtError(STATUS_NO_MEMORY);
         RETURN( (HACCEL) NULL);
     }
@@ -308,7 +308,7 @@ NtUserCreateAcceleratorTable(
     {
         ExFreePoolWithTag(Accel->Table, USERTAG_ACCEL);
         UserDereferenceObject(Accel);
-        UserDeleteObject(hAccel, otAccel);
+        UserDeleteObject(hAccel, TYPE_ACCELTABLE);
         SetLastNtError(Status);
         RETURN( (HACCEL) NULL);
     }
@@ -351,7 +351,7 @@ NtUserDestroyAcceleratorTable(
         Accel->Table = NULL;
     }
 
-    UserDeleteObject(hAccel, otAccel);
+    UserDeleteObject(hAccel, TYPE_ACCELTABLE);
 
     RETURN( TRUE);
 
index 815cee5..a1b6356 100644 (file)
@@ -21,7 +21,7 @@ VOID
 DestroyCallProc(IN PDESKTOPINFO Desktop,
                 IN OUT PCALLPROCDATA CallProc)
 {
-    UserDeleteObject(UserHMGetHandle(CallProc), otCallProc);
+    UserDeleteObject(UserHMGetHandle(CallProc), TYPE_CALLPROC);
 }
 
 PCALLPROCDATA
@@ -37,7 +37,7 @@ CreateCallProc(IN PDESKTOP Desktop,
                                              Desktop,
                                              NULL,
                                              &Handle,
-                                             otCallProc,
+                                             TYPE_CALLPROC,
                                              sizeof(CALLPROCDATA));
     if (NewCallProc != NULL)
     {
@@ -60,7 +60,7 @@ UserGetCallProcInfo(IN HANDLE hCallProc,
 
     CallProc = UserGetObject(gHandleTable,
                              hCallProc,
-                             otCallProc);
+                             TYPE_CALLPROC);
     if (CallProc == NULL)
     {
         return FALSE;
index a71b889..9a980ce 100644 (file)
@@ -462,7 +462,7 @@ IntSetClassWndProc(IN OUT PCLS Class,
    // Check if CallProc handle and retrieve previous call proc address and set.
    if (IsCallProcHandle(WndProc))
    {
-      pcpd = UserGetObject(gHandleTable, WndProc, otCallProc);
+      pcpd = UserGetObject(gHandleTable, WndProc, TYPE_CALLPROC);
       if (pcpd) chWndProc = pcpd->pfnClientPrevious;
    }
 
index 64b204e..28bb213 100644 (file)
@@ -58,7 +58,7 @@ IntFreeElementData(PCLIP pElement)
         !IS_DATA_SYNTHESIZED(pElement))
     {
         if (pElement->fGlobalHandle)
-            UserDeleteObject(pElement->hData, otClipBoardData);
+            UserDeleteObject(pElement->hData, TYPE_CLIPDATA);
         else if (pElement->fmt == CF_BITMAP || pElement->fmt == CF_PALETTE ||
                  pElement->fmt == CF_DSPBITMAP)
         {
@@ -184,7 +184,7 @@ IntSynthesizeDib(
                                                       NULL,
                                                       NULL,
                                                       &hMem,
-                                                      otClipBoardData,
+                                                      TYPE_CLIPDATA,
                                                       cjDataSize);
     if (!pClipboardData)
     {
@@ -235,7 +235,7 @@ IntSynthesizeBitmap(PWINSTATION_OBJECT pWinStaObj, PCLIP pBmEl)
     if(!pDibEl->fGlobalHandle)
         return;
 
-    pMemObj = (PCLIPBOARDDATA)UserGetObject(gHandleTable, pDibEl->hData, otClipBoardData);
+    pMemObj = (PCLIPBOARDDATA)UserGetObject(gHandleTable, pDibEl->hData, TYPE_CLIPDATA);
     if (!pMemObj)
         return;
 
@@ -297,7 +297,7 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
         PCLIPBOARDDATA pMemObj;
         HANDLE hMem;
 
-        pMemObj = (PCLIPBOARDDATA)UserCreateObject(gHandleTable, NULL, NULL, &hMem, otClipBoardData,
+        pMemObj = (PCLIPBOARDDATA)UserCreateObject(gHandleTable, NULL, NULL, &hMem, TYPE_CLIPDATA,
                                                    sizeof(CLIPBOARDDATA) + sizeof(LCID));
         if (pMemObj)
         {
@@ -1087,7 +1087,7 @@ NtUserConvertMemHandle(
     UserEnterExclusive();
 
     /* Create Clipboard data object */
-    pMemObj = UserCreateObject(gHandleTable, NULL, NULL, &hMem, otClipBoardData, sizeof(CLIPBOARDDATA) + cbData);
+    pMemObj = UserCreateObject(gHandleTable, NULL, NULL, &hMem, TYPE_CLIPDATA, sizeof(CLIPBOARDDATA) + cbData);
     if (!pMemObj)
         goto cleanup;
 
@@ -1111,7 +1111,7 @@ NtUserConvertMemHandle(
     /* If we failed to copy data, remove handle */
     if (!pMemObj)
     {
-        UserDeleteObject(hMem, otClipBoardData);
+        UserDeleteObject(hMem, TYPE_CLIPDATA);
         hMem = NULL;
     }
 
@@ -1134,7 +1134,7 @@ NtUserCreateLocalMemHandle(
     UserEnterShared();
 
     /* Get Clipboard data object */
-    pMemObj = (PCLIPBOARDDATA)UserGetObject(gHandleTable, hMem, otClipBoardData);
+    pMemObj = (PCLIPBOARDDATA)UserGetObject(gHandleTable, hMem, TYPE_CLIPDATA);
     if (!pMemObj)
     {
         Status = STATUS_INVALID_HANDLE;
index 04431d7..a4dbce0 100644 (file)
@@ -77,7 +77,7 @@ PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
         return NULL;
     }
 
-    CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, otCursorIcon);
+    CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, TYPE_CURSOR);
     if (!CurIcon)
     {
         /* We never set ERROR_INVALID_ICON_HANDLE. lets hope noone ever checks for it */
@@ -178,7 +178,7 @@ IntFindExistingCurIconObject(HMODULE hModule,
     LIST_FOR_EACH(CurIcon, &gCurIconList, CURICON_OBJECT, ListEntry)
     {
 
-        // if (NT_SUCCESS(UserReferenceObjectByPointer(Object, otCursorIcon))) // <- huh????
+        // if (NT_SUCCESS(UserReferenceObjectByPointer(Object, TYPE_CURSOR))) // <- huh????
 //      UserReferenceObject(  CurIcon);
 //      {
         if ((CurIcon->hModule == hModule) && (CurIcon->hRsrc == hRsrc))
@@ -209,7 +209,7 @@ IntCreateCurIconHandle(DWORD dwNumber)
     PCURICON_OBJECT CurIcon;
     HANDLE hCurIcon;
 
-    CurIcon = UserCreateObject(gHandleTable, NULL, NULL, &hCurIcon, otCursorIcon, sizeof(CURICON_OBJECT));
+    CurIcon = UserCreateObject(gHandleTable, NULL, NULL, &hCurIcon, TYPE_CURSOR, sizeof(CURICON_OBJECT));
 
     if (!CurIcon)
     {
@@ -223,7 +223,7 @@ IntCreateCurIconHandle(DWORD dwNumber)
     if (! ReferenceCurIconByProcess(CurIcon))
     {
         ERR("Failed to add process\n");
-        UserDeleteObject(hCurIcon, otCursorIcon);
+        UserDeleteObject(hCurIcon, TYPE_CURSOR);
         UserDereferenceObject(CurIcon);
         return NULL;
     }
@@ -273,7 +273,7 @@ IntDestroyCurIconObject(PCURICON_OBJECT CurIcon, PPROCESSINFO ppi)
         {
             /* Set the first process of the list as owner */
             Current = CONTAINING_RECORD(CurIcon->ProcessList.Flink, CURICON_PROCESS, ListEntry);
-            UserSetObjectOwner(CurIcon, otCursorIcon, Current->Process);
+            UserSetObjectOwner(CurIcon, TYPE_CURSOR, Current->Process);
         }
         UserDereferenceObject(CurIcon);
         return TRUE;
@@ -310,7 +310,7 @@ emptyList:
 
     /* We were given a pointer, no need to keep the reference anylonger! */
     UserDereferenceObject(CurIcon);
-    Ret = UserDeleteObject(CurIcon->Self, otCursorIcon);
+    Ret = UserDeleteObject(CurIcon->Self, TYPE_CURSOR);
 
     return Ret;
 }
index c80df05..c481eb5 100644 (file)
@@ -84,7 +84,7 @@ PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
         return NULL;
     }
 
-    CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, otCursorIcon);
+    CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, TYPE_CURSOR);
     if (!CurIcon)
     {
         /* We never set ERROR_INVALID_ICON_HANDLE. lets hope noone ever checks for it */
@@ -229,7 +229,7 @@ IntCreateCurIconHandle(DWORD dwNumber)
     if(dwNumber == 0)
         dwNumber = 1;
 
-    CurIcon = UserCreateObject(gHandleTable, NULL, NULL, &hCurIcon, otCursorIcon, sizeof(CURICON_OBJECT));
+    CurIcon = UserCreateObject(gHandleTable, NULL, NULL, &hCurIcon, TYPE_CURSOR, sizeof(CURICON_OBJECT));
 
     if (!CurIcon)
     {
@@ -244,7 +244,7 @@ IntCreateCurIconHandle(DWORD dwNumber)
     {
         ERR("Failed to add process\n");
         UserDereferenceObject(CurIcon);
-        UserDeleteObject(hCurIcon, otCursorIcon);
+        UserDeleteObject(hCurIcon, TYPE_CURSOR);
         return NULL;
     }
 
@@ -309,7 +309,7 @@ IntDestroyCurIconObject(PCURICON_OBJECT CurIcon, PPROCESSINFO ppi, BOOLEAN bForc
         {
             /* Set the first process of the list as owner */
             Current = CONTAINING_RECORD(CurIcon->ProcessList.Flink, CURICON_PROCESS, ListEntry);
-            UserSetObjectOwner(CurIcon, otCursorIcon, Current->Process);
+            UserSetObjectOwner(CurIcon, TYPE_CURSOR, Current->Process);
         }
         UserDereferenceObject(CurIcon);
         return TRUE;
@@ -350,7 +350,7 @@ emptyList:
 
     /* We were given a pointer, no need to keep the reference anylonger! */
     UserDereferenceObject(CurIcon);
-    Ret = UserDeleteObject(CurIcon->Self, otCursorIcon);
+    Ret = UserDeleteObject(CurIcon->Self, TYPE_CURSOR);
 
     return Ret;
 }
index 964119c..6a8ed66 100644 (file)
@@ -141,7 +141,7 @@ IntRemoveEvent(PEVENTHOOK pEH)
       RemoveEntryList(&pEH->Chain);
       GlobalEvents->Counts--;
       if (!GlobalEvents->Counts) gpsi->dwInstalledEventHooks = 0;
-      UserDeleteObject(UserHMGetHandle(pEH), otEvent);
+      UserDeleteObject(UserHMGetHandle(pEH), TYPE_WINEVENTHOOK);
       KeLeaveCriticalRegion();
       return TRUE;
    }
@@ -378,7 +378,7 @@ NtUserSetWinEventHook(
       }
    }
    // Creator, pti is set here.
-   pEH = UserCreateObject(gHandleTable, NULL, NULL, &Handle, otEvent, sizeof(EVENTHOOK));
+   pEH = UserCreateObject(gHandleTable, NULL, NULL, &Handle, TYPE_WINEVENTHOOK, sizeof(EVENTHOOK));
    if (pEH)
    {
       InsertTailList(&GlobalEvents->Events, &pEH->Chain);
@@ -428,7 +428,7 @@ NtUserUnhookWinEvent(
 
    UserEnterExclusive();
 
-   pEH = (PEVENTHOOK)UserGetObject(gHandleTable, hWinEventHook, otEvent);
+   pEH = (PEVENTHOOK)UserGetObject(gHandleTable, hWinEventHook, TYPE_WINEVENTHOOK);
    if (pEH) 
    {
       Ret = IntRemoveEvent(pEH);
index dc04ed8..a111d76 100644 (file)
@@ -937,7 +937,7 @@ IntGetHookObject(HHOOK hHook)
        return NULL;
     }
 
-    Hook = (PHOOK)UserGetObject(gHandleTable, hHook, otHook);
+    Hook = (PHOOK)UserGetObject(gHandleTable, hHook, TYPE_HOOK);
     if (!Hook)
     {
        EngSetLastError(ERROR_INVALID_HOOK_HANDLE);
@@ -1020,7 +1020,7 @@ IntFreeHook(PHOOK Hook)
        Hook->ModuleName.Buffer = NULL;
     }
     /* Close handle */
-    UserDeleteObject(UserHMGetHandle(Hook), otHook);
+    UserDeleteObject(UserHMGetHandle(Hook), TYPE_HOOK);
 }
 
 /* Remove a hook, freeing it from the chain */
@@ -1270,7 +1270,7 @@ co_HOOK_CallHooks( INT HookId,
        */
        for(i = 0; pHookHandles[i]; ++i)
        {
-          Hook = (PHOOK)UserGetObject(gHandleTable, pHookHandles[i], otHook);
+          Hook = (PHOOK)UserGetObject(gHandleTable, pHookHandles[i], TYPE_HOOK);
           if(!Hook)
           {
               ERR("Invalid hook!\n");
@@ -1571,7 +1571,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
     }
     ObDereferenceObject(WinStaObj);
 
-    Hook = UserCreateObject(gHandleTable, NULL, NULL, (PHANDLE)&Handle, otHook, sizeof(HOOK));
+    Hook = UserCreateObject(gHandleTable, NULL, NULL, (PHANDLE)&Handle, TYPE_HOOK, sizeof(HOOK));
 
     if (!Hook)
     {
index a04c962..a6d20c5 100644 (file)
@@ -131,7 +131,7 @@ UserLoadKbdFile(PUNICODE_STRING pwszKLID)
                                  L"Control\\Keyboard Layouts\\";
 
     /* Create keyboard layout file object */
-    pkf = UserCreateObject(gHandleTable, NULL, NULL, NULL, otKBDfile, sizeof(KBDFILE));
+    pkf = UserCreateObject(gHandleTable, NULL, NULL, NULL, TYPE_KBDFILE, sizeof(KBDFILE));
     if (!pkf)
     {
         ERR("Failed to create object!\n");
@@ -187,7 +187,7 @@ cleanup:
     {
         /* We have failed - destroy created object */
         if (pkf)
-            UserDeleteObject(pkf->head.h, otKBDfile);
+            UserDeleteObject(pkf->head.h, TYPE_KBDFILE);
     }
 
     return pRet;
@@ -206,7 +206,7 @@ UserLoadKbdLayout(PUNICODE_STRING pwszKLID, HKL hKL)
     PKL pKl;
 
     /* Create keyboard layout object */
-    pKl = UserCreateObject(gHandleTable, NULL, NULL, NULL, otKBDlayout, sizeof(KL));
+    pKl = UserCreateObject(gHandleTable, NULL, NULL, NULL, TYPE_KBDLAYOUT, sizeof(KL));
     if (!pKl)
     {
         ERR("Failed to create object!\n");
@@ -223,7 +223,7 @@ UserLoadKbdLayout(PUNICODE_STRING pwszKLID, HKL hKL)
     if (!pKl->spkf)
     {
         ERR("UserLoadKbdFile(%wZ) failed!\n", pwszKLID);
-        UserDeleteObject(pKl->head.h, otKBDlayout);
+        UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT);
         return NULL;
     }
 
@@ -272,7 +272,7 @@ UnloadKbdFile(_In_ PKBDFILE pkf)
         *ppkfLink = pkf->pkfNext;
 
     EngUnloadImage(pkf->hBase);
-    UserDeleteObject(pkf->head.h, otKBDfile);
+    UserDeleteObject(pkf->head.h, TYPE_KBDFILE);
 }
 
 /*
@@ -308,7 +308,7 @@ UserUnloadKbl(PKL pKl)
     pKl->pklPrev->pklNext = pKl->pklNext;
     pKl->pklNext->pklPrev = pKl->pklPrev;
     UnloadKbdFile(pKl->spkf);
-    UserDeleteObject(pKl->head.h, otKBDlayout);
+    UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT);
     return TRUE;
 }
 
index 1f76833..1b5a002 100644 (file)
@@ -63,7 +63,7 @@ PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu)
       return NULL;
    }
 
-   Menu = (PMENU_OBJECT)UserGetObject(gHandleTable, hMenu, otMenu);
+   Menu = (PMENU_OBJECT)UserGetObject(gHandleTable, hMenu, TYPE_MENU);
    if (!Menu)
    {
       EngSetLastError(ERROR_INVALID_MENU_HANDLE);
@@ -234,7 +234,7 @@ IntDestroyMenuObject(PMENU_OBJECT Menu,
             }
          }
 //         UserDereferenceObject(Menu);
-         ret = UserDeleteObject(Menu->MenuInfo.Self, otMenu);
+         ret = UserDeleteObject(Menu->MenuInfo.Self, TYPE_MENU);
          ObDereferenceObject(WindowStation);
          return ret;
       }
@@ -252,7 +252,7 @@ IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar)
                                           NULL,
                                           NULL,
                                           Handle,
-                                          otMenu,
+                                          TYPE_MENU,
                                           sizeof(MENU_OBJECT));
    if(!Menu)
    {
@@ -364,7 +364,7 @@ IntCloneMenu(PMENU_OBJECT Source)
                                           NULL,
                                           NULL,
                                           &hMenu,
-                                          otMenu,
+                                          TYPE_MENU,
                                           sizeof(MENU_OBJECT));
    if(!Menu)
       return NULL;
index aa5cedc..b0e4aa6 100644 (file)
@@ -32,7 +32,7 @@ static
 PMONITOR
 IntCreateMonitorObject()
 {
-    return UserCreateObject(gHandleTable, NULL, NULL, NULL, otMonitor, sizeof(MONITOR));
+    return UserCreateObject(gHandleTable, NULL, NULL, NULL, TYPE_MONITOR, sizeof(MONITOR));
 }
 
 /* IntDestroyMonitorObject
@@ -58,7 +58,7 @@ IntDestroyMonitorObject(IN PMONITOR pMonitor)
 
     /* Destroy monitor object */
     UserDereferenceObject(pMonitor);
-    UserDeleteObject(UserHMGetHandle(pMonitor), otMonitor);
+    UserDeleteObject(UserHMGetHandle(pMonitor), TYPE_MONITOR);
 }
 
 /* UserGetMonitorObject
@@ -81,7 +81,7 @@ UserGetMonitorObject(IN HMONITOR hMonitor)
         return NULL;
     }
 
-    pMonitor = (PMONITOR)UserGetObject(gHandleTable, hMonitor, otMonitor);
+    pMonitor = (PMONITOR)UserGetObject(gHandleTable, hMonitor, TYPE_MONITOR);
     if (!pMonitor)
     {
         EngSetLastError(ERROR_INVALID_MONITOR_HANDLE);
index d778575..a341b50 100644 (file)
@@ -16,7 +16,7 @@ PUSER_HANDLE_TABLE gHandleTable = NULL;
 
 void DbgUserDumpHandleTable()
 {
-    int HandleCounts[USER_HANDLE_TYPE_COUNT];
+    int HandleCounts[TYPE_CTYPES];
     PPROCESSINFO ppiList;
     int i;
     PWCHAR TypeNames[] = {L"Free",L"Window",L"Menu", L"CursorIcon", L"SMWP", L"Hook", L"ClipBoardData", L"CallProc",
@@ -33,7 +33,7 @@ void DbgUserDumpHandleTable()
     {
         ERR("Process %s (%d) handles count: %d\n\t", ppiList->peProcess->ImageFileName, ppiList->peProcess->UniqueProcessId, ppiList->UserHandleCount);
 
-        for (i = 1 ;i < USER_HANDLE_TYPE_COUNT; i++)
+        for (i = 1 ;i < TYPE_CTYPES; i++)
         {
             HandleCounts[i] += ppiList->DbgHandleCount[i];
 
@@ -48,7 +48,7 @@ void DbgUserDumpHandleTable()
 
     /* Print total type counts */
     ERR("Total handles of the running processes: \n\t");
-    for (i = 1 ;i < USER_HANDLE_TYPE_COUNT; i++)
+    for (i = 1 ;i < TYPE_CTYPES; i++)
     {
         DbgPrint("%S: %d, ", TypeNames[i], HandleCounts[i]);
         if (i % 6 == 0)
@@ -62,7 +62,7 @@ void DbgUserDumpHandleTable()
          HandleCounts[gHandleTable->handles[i].type]++;
 
     ERR("Total handles count allocated: \n\t");
-    for (i = 1 ;i < USER_HANDLE_TYPE_COUNT; i++)
+    for (i = 1 ;i < TYPE_CTYPES; i++)
     {
         DbgPrint("%S: %d, ", TypeNames[i], HandleCounts[i]);
         if (i % 6 == 0)
@@ -174,27 +174,27 @@ __inline static void *free_user_entry(PUSER_HANDLE_TABLE ht, PUSER_HANDLE_ENTRY
 }
 
 static __inline PVOID
-UserHandleOwnerByType(USER_OBJECT_TYPE type)
+UserHandleOwnerByType(HANDLE_TYPE type)
 {
     PVOID pi;
 
     switch (type)
     {
-        case otWindow:
-        case otInputContext:
+        case TYPE_WINDOW:
+        case TYPE_INPUTCONTEXT:
             pi = GetW32ThreadInfo();
             break;
 
-        case otMenu:
-        case otCursorIcon:
-        case otHook:
-        case otCallProc:
-        case otAccel:
-        case otSMWP:
+        case TYPE_MENU:
+        case TYPE_CURSOR:
+        case TYPE_HOOK:
+        case TYPE_CALLPROC:
+        case TYPE_ACCELTABLE:
+        case TYPE_SETWINDOWPOS:
             pi = GetW32ProcessInfo();
             break;
 
-        case otMonitor:
+        case TYPE_MONITOR:
             pi = NULL; /* System */
             break;
 
@@ -207,7 +207,7 @@ UserHandleOwnerByType(USER_OBJECT_TYPE type)
 }
 
 /* allocate a user handle for a given object */
-HANDLE UserAllocHandle(PUSER_HANDLE_TABLE ht, PVOID object, USER_OBJECT_TYPE type )
+HANDLE UserAllocHandle(PUSER_HANDLE_TABLE ht, PVOID object, HANDLE_TYPE type )
 {
    PUSER_HANDLE_ENTRY entry = alloc_user_entry(ht);
    if (!entry)
@@ -226,7 +226,7 @@ HANDLE UserAllocHandle(PUSER_HANDLE_TABLE ht, PVOID object, USER_OBJECT_TYPE typ
 }
 
 /* return a pointer to a user object from its handle without setting an error */
-PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, USER_OBJECT_TYPE type )
+PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type )
 {
    PUSER_HANDLE_ENTRY entry;
 
@@ -240,7 +240,7 @@ PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, USER_OBJECT_TYPE
 }
 
 /* return a pointer to a user object from its handle */
-PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, USER_OBJECT_TYPE type )
+PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type )
 {
    PUSER_HANDLE_ENTRY entry;
 
@@ -269,7 +269,7 @@ HANDLE get_user_full_handle(PUSER_HANDLE_TABLE ht,  HANDLE handle )
 
 
 /* Same as get_user_object plus set the handle to the full 32-bit value */
-void *get_user_object_handle(PUSER_HANDLE_TABLE ht,  HANDLE* handle, USER_OBJECT_TYPE type )
+void *get_user_object_handle(PUSER_HANDLE_TABLE ht,  HANDLE* handle, HANDLE_TYPE type )
 {
    PUSER_HANDLE_ENTRY entry;
 
@@ -317,7 +317,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
                   PDESKTOP pDesktop,
                   PTHREADINFO pti,
                   HANDLE* h,
-                  USER_OBJECT_TYPE type,
+                  HANDLE_TYPE type,
                   ULONG size)
 {
    HANDLE hi;
@@ -336,11 +336,11 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
 
    switch (type)
    {
-      case otWindow:
-//      case otMenu:
-      case otHook:
-      case otCallProc:
-      case otInputContext:
+      case TYPE_WINDOW:
+//      case TYPE_MENU:
+      case TYPE_HOOK:
+      case TYPE_CALLPROC:
+      case TYPE_INPUTCONTEXT:
          Object = DesktopHeapAlloc(rpdesk, size);
          dt = TRUE;
          break;
@@ -373,22 +373,22 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
 
    switch (type)
    {
-        case otWindow:
-        case otHook:
-        case otInputContext:
+        case TYPE_WINDOW:
+        case TYPE_HOOK:
+        case TYPE_INPUTCONTEXT:
             ((PTHRDESKHEAD)Object)->rpdesk = rpdesk;
             ((PTHRDESKHEAD)Object)->pSelf = Object;
-        case otEvent:
+        case TYPE_WINEVENTHOOK:
             ((PTHROBJHEAD)Object)->pti = pti;
             break;
 
-        case otMenu:
-        case otCallProc:
+        case TYPE_MENU:
+        case TYPE_CALLPROC:
             ((PPROCDESKHEAD)Object)->rpdesk = rpdesk;
             ((PPROCDESKHEAD)Object)->pSelf = Object;
             break;
 
-        case otCursorIcon:
+        case TYPE_CURSOR:
             ((PPROCMARKHEAD)Object)->ppi = ppi;
             break;
 
@@ -410,7 +410,7 @@ FASTCALL
 UserDereferenceObject(PVOID object)
 {
   PUSER_HANDLE_ENTRY entry;
-  USER_OBJECT_TYPE type;
+  HANDLE_TYPE type;
 
   ASSERT(((PHEAD)object)->cLockObj >= 1);
 
@@ -435,11 +435,11 @@ UserDereferenceObject(PVOID object)
 
      switch (type)
      {
-        case otWindow:
-//        case otMenu:
-        case otHook:
-        case otCallProc:
-        case otInputContext:
+        case TYPE_WINDOW:
+//        case TYPE_MENU:
+        case TYPE_HOOK:
+        case TYPE_CALLPROC:
+        case TYPE_INPUTCONTEXT:
            return DesktopHeapFree(((PTHRDESKHEAD)object)->rpdesk, object);
 
         default:
@@ -482,7 +482,7 @@ UserObjectInDestroy(HANDLE h)
 
 BOOL
 FASTCALL
-UserDeleteObject(HANDLE h, USER_OBJECT_TYPE type )
+UserDeleteObject(HANDLE h, HANDLE_TYPE type )
 {
    PVOID body = UserGetObject(gHandleTable, h, type);
 
@@ -504,7 +504,7 @@ UserReferenceObject(PVOID obj)
 
 PVOID
 FASTCALL
-UserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type)
+UserReferenceObjectByHandle(HANDLE handle, HANDLE_TYPE type)
 {
     PVOID object;
 
@@ -518,7 +518,7 @@ UserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type)
 
 VOID
 FASTCALL
-UserSetObjectOwner(PVOID obj, USER_OBJECT_TYPE type, PVOID owner)
+UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner)
 {
     PUSER_HANDLE_ENTRY entry = handle_to_entry(gHandleTable, ((PHEAD)obj)->h );
     PPROCESSINFO ppi, oldppi;
@@ -529,7 +529,7 @@ UserSetObjectOwner(PVOID obj, USER_OBJECT_TYPE type, PVOID owner)
     /* For now, only supported for CursorIcon object */
     switch(type)
     {
-        case otCursorIcon:
+        case TYPE_CURSOR:
             ppi = (PPROCESSINFO)owner;
             entry->pi = ppi;
             oldppi = ((PPROCMARKHEAD)obj)->ppi;
@@ -575,37 +575,37 @@ NtUserValidateHandleSecure(
      }
      switch (uType)
      {
-       case otWindow:
+       case TYPE_WINDOW:
        {
          if (UserGetWindowObject((HWND) handle)) return TRUE;
          return FALSE;
        }
-       case otMenu:
+       case TYPE_MENU:
        {
          if (UserGetMenuObject((HMENU) handle)) return TRUE;
          return FALSE;
        }
-       case otAccel:
+       case TYPE_ACCELTABLE:
        {
          if (UserGetAccelObject((HACCEL) handle)) return TRUE;
          return FALSE;
        }
-       case otCursorIcon:
+       case TYPE_CURSOR:
        {
          if (UserGetCurIconObject((HCURSOR) handle)) return TRUE;
          return FALSE;
        }
-       case otHook:
+       case TYPE_HOOK:
        {
          if (IntGetHookObject((HHOOK) handle)) return TRUE;
          return FALSE;
        }
-       case otMonitor:
+       case TYPE_MONITOR:
        {
          if (UserGetMonitorObject((HMONITOR) handle)) return TRUE;
          return FALSE;
        }
-       case otCallProc:
+       case TYPE_CALLPROC:
        {
          WNDPROC_INFO Proc;
          return UserGetCallProcInfo( handle, &Proc );
index 08ae96e..2ab5f36 100644 (file)
@@ -31,16 +31,16 @@ UserAssertLastRef(PVOID obj, const char *file, int line)
 
 extern PUSER_HANDLE_TABLE gHandleTable;
 VOID FASTCALL UserReferenceObject(PVOID obj);
-PVOID FASTCALL UserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type);
+PVOID FASTCALL UserReferenceObjectByHandle(HANDLE handle, HANDLE_TYPE type);
 BOOL FASTCALL UserDereferenceObject(PVOID obj);
-PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, struct _DESKTOP* pDesktop, PTHREADINFO pti, HANDLE* h,USER_OBJECT_TYPE type , ULONG size);
-BOOL FASTCALL UserDeleteObject(HANDLE h, USER_OBJECT_TYPE type );
-PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, USER_OBJECT_TYPE type );
-PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE, HANDLE, USER_OBJECT_TYPE);
+PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, struct _DESKTOP* pDesktop, PTHREADINFO pti, HANDLE* h,HANDLE_TYPE type , ULONG size);
+BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type );
+PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type );
+PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE, HANDLE, HANDLE_TYPE);
 BOOL FASTCALL UserCreateHandleTable(VOID);
 BOOL FASTCALL UserObjectInDestroy(HANDLE);
 void DbgUserDumpHandleTable();
-VOID FASTCALL UserSetObjectOwner(PVOID obj, USER_OBJECT_TYPE type, PVOID owner);
+VOID FASTCALL UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner);
 
 static __inline VOID
 UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
index 5779fff..e291616 100644 (file)
@@ -1141,7 +1141,7 @@ NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
 
    if (!Ret) goto Exit;
 
-   if (!( pWnd = (PWND)UserGetObject(gHandleTable, finfo.hwnd, otWindow)) ||
+   if (!( pWnd = (PWND)UserGetObject(gHandleTable, finfo.hwnd, TYPE_WINDOW)) ||
         finfo.cbSize != sizeof(FLASHWINFO) ||
         finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) )
    {
index 6eff2c8..9f8e698 100644 (file)
@@ -186,13 +186,13 @@ NtUserCallOneParam(
                                                NULL, 
                                                NULL, 
                                               (PHANDLE)&hDwp,
-                                               otSMWP,
+                                               TYPE_SETWINDOWPOS,
                                                sizeof(SMWP));
              if (!psmwp) RETURN(0);
              psmwp->acvr = ExAllocatePoolWithTag(PagedPool, count * sizeof(CVR), USERTAG_SWP);
              if (!psmwp->acvr)
              {
-                UserDeleteObject(hDwp, otSMWP);
+                UserDeleteObject(hDwp, TYPE_SETWINDOWPOS);
                 RETURN(0);
              }
              RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
index 9271edd..f113be3 100644 (file)
@@ -56,7 +56,7 @@ CreateTimer(VOID)
   HANDLE Handle;
   PTIMER Ret = NULL;
 
-  Ret = UserCreateObject(gHandleTable, NULL, NULL, &Handle, otTimer, sizeof(TIMER));
+  Ret = UserCreateObject(gHandleTable, NULL, NULL, &Handle, TYPE_TIMER, sizeof(TIMER));
   if (Ret)
   {
      Ret->head.h = Handle;
@@ -86,7 +86,7 @@ RemoveTimer(PTIMER pTmr)
         IntUnlockWindowlessTimerBitmap();
      }
      UserDereferenceObject(pTmr);
-     Ret = UserDeleteObject( UserHMGetHandle(pTmr), otTimer);
+     Ret = UserDeleteObject( UserHMGetHandle(pTmr), TYPE_TIMER);
   }
   if (!Ret) ERR("Warning: Unable to delete timer\n");
 
index 4bec70a..5a7d217 100644 (file)
@@ -225,7 +225,7 @@ typedef struct _PROCESSINFO
 
 #if DBG
   BYTE DbgChannelLevel[DbgChCount];
-  DWORD DbgHandleCount[USER_HANDLE_TYPE_COUNT];
+  DWORD DbgHandleCount[TYPE_CTYPES];
 #endif
 } PROCESSINFO;
 
index db4f50f..217d8af 100644 (file)
@@ -90,7 +90,7 @@ PWND FASTCALL VerifyWnd(PWND pWnd)
 
 PWND FASTCALL ValidateHwndNoErr(HWND hWnd)
 {
-   if (hWnd) return (PWND)UserGetObjectNoErr(gHandleTable, hWnd, otWindow);
+   if (hWnd) return (PWND)UserGetObjectNoErr(gHandleTable, hWnd, TYPE_WINDOW);
    return NULL;
 }
 
@@ -105,7 +105,7 @@ PWND FASTCALL UserGetWindowObject(HWND hWnd)
       return NULL;
    }
 
-   Window = (PWND)UserGetObject(gHandleTable, hWnd, otWindow);
+   Window = (PWND)UserGetObject(gHandleTable, hWnd, TYPE_WINDOW);
    if (!Window || 0 != (Window->state & WNDS_DESTROYED))
    {
       EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
@@ -555,7 +555,7 @@ static LRESULT co_UserFreeWindow(PWND Window,
    IntUnlinkWindow(Window);
 
    UserReferenceObject(Window);
-   UserDeleteObject(Window->head.h, otWindow);
+   UserDeleteObject(Window->head.h, TYPE_WINDOW);
 
    IntDestroyScrollBars(Window);
 
@@ -662,7 +662,7 @@ IntSetWindowProc(PWND pWnd,
 
    if (IsCallProcHandle(NewWndProc))
    {
-      CallProc = UserGetObject(gHandleTable, NewWndProc, otCallProc);
+      CallProc = UserGetObject(gHandleTable, NewWndProc, TYPE_CALLPROC);
       if (CallProc)
       {  // Reset new WndProc.
          NewWndProc = CallProc->pfnClientPrevious;
@@ -1717,7 +1717,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
                                    pdeskCreated ? pdeskCreated : pti->rpdesk,
                                    pti,
                                   (PHANDLE)&hWnd,
-                                   otWindow,
+                                   TYPE_WINDOW,
                                    sizeof(WND) + Class->cbwndExtra);
 
    if (!pWnd)
index 78f2ed5..f740ec1 100644 (file)
@@ -2472,7 +2472,7 @@ IntDeferWindowPos( HDWP hdwp,
        return NULL;
     }
 
-    if (!(pDWP = (PSMWP)UserGetObject(gHandleTable, hdwp, otSMWP)))
+    if (!(pDWP = (PSMWP)UserGetObject(gHandleTable, hdwp, TYPE_SETWINDOWPOS)))
     {
        EngSetLastError(ERROR_INVALID_DWP_HANDLE);
        return NULL;
@@ -2543,7 +2543,7 @@ BOOL FASTCALL IntEndDeferWindowPosEx( HDWP hdwp, BOOL sAsync )
 
     TRACE("%p\n", hdwp);
 
-    if (!(pDWP = (PSMWP)UserGetObject(gHandleTable, hdwp, otSMWP)))
+    if (!(pDWP = (PSMWP)UserGetObject(gHandleTable, hdwp, TYPE_SETWINDOWPOS)))
     {
        EngSetLastError(ERROR_INVALID_DWP_HANDLE);
        return FALSE;
@@ -2597,7 +2597,7 @@ BOOL FASTCALL IntEndDeferWindowPosEx( HDWP hdwp, BOOL sAsync )
     }
     ExFreePoolWithTag(pDWP->acvr, USERTAG_SWP);
     UserDereferenceObject(pDWP);
-    UserDeleteObject(hdwp, otSMWP);
+    UserDeleteObject(hdwp, TYPE_SETWINDOWPOS);
     return res;
 }
 
index f27d452..b51bfcd 100644 (file)
@@ -109,4 +109,4 @@ static __inline void LoadUserApiHook()
 #define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
 #define ISITHOOKED(HookId) (GetWin32ClientInfo()->fsHooks & HOOKID_TO_FLAG(HookId) ||\
                            (GetWin32ClientInfo()->pDeskInfo && GetWin32ClientInfo()->pDeskInfo->fsHooks & HOOKID_TO_FLAG(HookId)))
-                                                  
\ No newline at end of file
+                                                  
index 6763a61..a548570 100644 (file)
@@ -303,24 +303,30 @@ GetUser32Handle(HANDLE handle)
 /*
  * Decide whether an object is located on the desktop or shared heap
  */
-static const BOOL g_ObjectHeapTypeShared[otEvent + 1] =
+static const BOOL g_ObjectHeapTypeShared[TYPE_CTYPES] =
 {
-    FALSE, /* otFree (not used) */
-    FALSE, /* otWindow */
-    TRUE,  /* otMenu  FALSE */
-    TRUE,  /* otCursorIcon */
-    TRUE,  /* otSMWP */
-    FALSE, /* otHook */
-    FALSE, /* (not used) */
-    FALSE, /* otCallProc */
-    TRUE,  /* otAccel */
-    FALSE, /* (not used) */
-    FALSE, /* (not used) */
-    FALSE, /* (not used) */
-    TRUE,  /* otMonitor */
-    FALSE, /* (not used) */
-    FALSE, /* (not used) */
-    TRUE   /* otEvent */
+    FALSE, /* TYPE_FREE (not used) */
+    FALSE, /* TYPE_WINDOW */
+    TRUE,  /* TYPE_MENU  FALSE */
+    TRUE,  /* TYPE_CURSOR */
+    TRUE,  /* TYPE_SETWINDOWPOS */
+    FALSE, /* TYPE_HOOK */
+    FALSE, /* TYPE_CLIPDATA */
+    FALSE, /* TYPE_CALLPROC */
+    TRUE,  /* TYPE_ACCELTABLE */
+    FALSE, /* TYPE_DDEACCESS */
+    FALSE, /* TYPE_DDECONV */
+    FALSE, /* TYPE_DDEXACT */
+    TRUE,  /* TYPE_MONITOR */
+    FALSE, /* TYPE_KBDLAYOUT */
+    FALSE, /* TYPE_KBDFILE */
+    TRUE   /* TYPE_WINEVENTHOOK */
+    FALSE, /* TYPE_TIMER */
+    FALSE, /* TYPE_INPUTCONTEXT */
+    FALSE, /* TYPE_HIDDATA */
+    FALSE, /* TYPE_DEVICEINFO */
+    FALSE, /* TYPE_TOUCHINPUTINFO */
+    FALSE, /* TYPE_GESTUREINFOOBJ */
 };
 
 //
@@ -333,7 +339,7 @@ ValidateHandle(HANDLE handle, UINT uType)
   PVOID ret;
   PUSER_HANDLE_ENTRY pEntry;
 
-  ASSERT(uType <= otEvent);
+  ASSERT(uType < TYPE_CTYPES);
 
   pEntry = GetUser32Handle(handle);
 
@@ -348,22 +354,22 @@ ValidateHandle(HANDLE handle, UINT uType)
   {
      switch ( uType )
      {  // Test (with wine too) confirms these results!
-        case otWindow:
+        case TYPE_WINDOW:
           SetLastError(ERROR_INVALID_WINDOW_HANDLE);
           break;
-        case otMenu:
+        case TYPE_MENU:
           SetLastError(ERROR_INVALID_MENU_HANDLE);
           break;
-        case otCursorIcon:
+        case TYPE_CURSOR:
           SetLastError(ERROR_INVALID_CURSOR_HANDLE);
           break;
-        case otSMWP:
+        case TYPE_SETWINDOWPOS:
           SetLastError(ERROR_INVALID_DWP_HANDLE);
           break;
-        case otHook:
+        case TYPE_HOOK:
           SetLastError(ERROR_INVALID_HOOK_HANDLE);
           break;
-        case otAccel:
+        case TYPE_ACCELTABLE:
           SetLastError(ERROR_INVALID_ACCEL_HANDLE);
           break;
         default:
@@ -391,7 +397,7 @@ ValidateHandleNoErr(HANDLE handle, UINT uType)
   PVOID ret;
   PUSER_HANDLE_ENTRY pEntry;
 
-  ASSERT(uType <= otEvent);
+  ASSERT(uType < TYPE_CTYPES);
 
   pEntry = GetUser32Handle(handle);
 
@@ -419,7 +425,7 @@ ValidateCallProc(HANDLE hCallProc)
 {
   PUSER_HANDLE_ENTRY pEntry;
 
-  PCALLPROCDATA CallProc = ValidateHandle(hCallProc, otCallProc);
+  PCALLPROCDATA CallProc = ValidateHandle(hCallProc, TYPE_CALLPROC);
 
   pEntry = GetUser32Handle(hCallProc);
 
@@ -444,7 +450,7 @@ ValidateHwnd(HWND hwnd)
     if (hwnd && hwnd == ClientInfo->CallbackWnd.hWnd)
         return ClientInfo->CallbackWnd.pWnd;
 
-    return ValidateHandle((HANDLE)hwnd, otWindow);
+    return ValidateHandle((HANDLE)hwnd, TYPE_WINDOW);
 }
 
 //
@@ -462,7 +468,7 @@ ValidateHwndNoErr(HWND hwnd)
     if (hwnd == ClientInfo->CallbackWnd.hWnd)
         return ClientInfo->CallbackWnd.pWnd;
 
-    Wnd = ValidateHandleNoErr((HANDLE)hwnd, otWindow);
+    Wnd = ValidateHandleNoErr((HANDLE)hwnd, TYPE_WINDOW);
     if (Wnd != NULL)
     {
         return Wnd;
index 2f544a7..c5a2766 100644 (file)
@@ -3241,7 +3241,7 @@ static INT FASTCALL MenuTrackMenu(HMENU hmenu, UINT wFlags, INT x, INT y,
     while (! fEndMenu)
     {
         BOOL ErrorExit = FALSE;
-        PVOID menu = ValidateHandle(mt.CurrentMenu, otMenu);
+        PVOID menu = ValidateHandle(mt.CurrentMenu, TYPE_MENU);
         if (!menu) /* sometimes happens if I do a window manager close */
            break;
 
@@ -4767,7 +4767,7 @@ WINAPI
 IsMenu(
   HMENU Menu)
 {
-  if (ValidateHandle(Menu, otMenu)) return TRUE;
+  if (ValidateHandle(Menu, TYPE_MENU)) return TRUE;
   return FALSE;
 }