- Timestamp:
- Mar 23, 2000, 8:24:26 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/HOOK.CPP
r2948 r3207 1 /* $Id: HOOK.CPP,v 1.1 2 2000-02-29 19:16:11sandervl Exp $ */1 /* $Id: HOOK.CPP,v 1.13 2000-03-23 19:24:25 sandervl Exp $ */ 2 2 3 3 /* … … 62 62 #define CHECK_MAGIC(a) ((a != 0) && (((HOOKDATA *)a)->magic == HOOK_MAGIC)) 63 63 64 //NOTE: This must be in the local data segment -> if a shared semaphore was 65 // created by a different process, the handle returned by DosOpenMutexSem 66 // will be returned in hGlobalHookMutex 67 static HMTX hGlobalHookMutex = 0; 68 64 69 //Global DLL Data 65 70 #pragma data_seg(_GLOBALDATA) 66 71 static HANDLE HOOK_systemHooks[WH_NB_HOOKS] = { 0 }; 67 static VMutex systemHookMutex( TRUE);72 static VMutex systemHookMutex(VMUTEX_SHARED, &hGlobalHookMutex); 68 73 #pragma data_seg() 69 74 static HANDLE HOOK_threadHooks[WH_NB_HOOKS] = { 0 }; … … 309 314 else 310 315 { 311 systemHookMutex.enter( );316 systemHookMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalHookMutex); 312 317 data->next = HOOK_systemHooks[id - WH_MINHOOK]; 313 318 HOOK_systemHooks[id - WH_MINHOOK] = (HANDLE)data; 314 systemHookMutex.leave( );319 systemHookMutex.leave(&hGlobalHookMutex); 315 320 } 316 321 -
trunk/src/user32/win32wndhandle.cpp
r3127 r3207 1 /* $Id: win32wndhandle.cpp,v 1. 6 2000-03-16 19:19:11sandervl Exp $ */1 /* $Id: win32wndhandle.cpp,v 1.7 2000-03-23 19:24:26 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Handle Management Code for OS/2 … … 25 25 //****************************************************************************** 26 26 27 //NOTE: This must be in the local data segment -> if a shared semaphore was 28 // created by a different process, the handle returned by DosOpenMutexSem 29 // will be returned in hGlobalTableMutex 30 HMTX hGlobalTableMutex = 0; 31 27 32 //Global DLL Data 28 33 #pragma data_seg(_GLOBALDATA) 29 34 ULONG WindowHandleTable[MAX_WINDOW_HANDLES] = {0}; 30 VMutex tableMutex( TRUE);35 VMutex tableMutex(VMUTEX_SHARED, &hGlobalTableMutex); 31 36 ULONG lowestFreeIndex = 0; 32 37 #pragma data_seg() … … 36 41 BOOL HwAllocateWindowHandle(HWND *hwnd, DWORD dwUserData) 37 42 { 38 tableMutex.enter( );43 tableMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalTableMutex); 39 44 if(lowestFreeIndex == -1) { 40 45 //oops, out of handles 41 46 dprintf(("USER32: HwAllocateWindowHandle OUT OF WINDOW HANDLES!!")); 42 tableMutex.leave( );47 tableMutex.leave(&hGlobalTableMutex); 43 48 DebugInt3(); 44 49 return FALSE; … … 57 62 } 58 63 } 59 tableMutex.leave( );64 tableMutex.leave(&hGlobalTableMutex); 60 65 return TRUE; 61 66 } … … 66 71 hwnd &= WNDHANDLE_MAGIC_MASK; 67 72 if(hwnd < MAX_WINDOW_HANDLES) { 68 tableMutex.enter( );73 tableMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalTableMutex); 69 74 WindowHandleTable[hwnd] = 0; 70 75 if(lowestFreeIndex == -1 || hwnd < lowestFreeIndex) 71 76 lowestFreeIndex = hwnd; 72 77 73 tableMutex.leave( );78 tableMutex.leave(&hGlobalTableMutex); 74 79 } 75 80 }
Note:
See TracChangeset
for help on using the changeset viewer.