Changeset 8202 for trunk/src/user32/win32wndhandle.cpp
- Timestamp:
- Apr 7, 2002, 4:38:08 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wndhandle.cpp
r7097 r8202 1 /* $Id: win32wndhandle.cpp,v 1.1 0 2001-10-17 15:16:58 phallerExp $ */1 /* $Id: win32wndhandle.cpp,v 1.11 2002-04-07 14:37:00 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 was28 // created by a different process, the handle returned by DosOpenMutexSem29 // will be returned in hGlobalTableMutex30 HMTX hGlobalTableMutex = 0;31 32 27 //Global DLL Data 33 28 #pragma data_seg(_GLOBALDATA) 34 ULONG WindowHandleTable[MAX_WINDOW_HANDLES] = {0};35 VMutex tableMutex(VMUTEX_SHARED, &hGlobalTableMutex);29 ULONG WindowHandleTable[MAX_WINDOW_HANDLES] = {0}; 30 CRITICAL_SECTION_OS2 globalwhandlecritsect = {0}; 36 31 ULONG lastIndex = 0; 37 32 #pragma data_seg() … … 39 34 //****************************************************************************** 40 35 //****************************************************************************** 36 void InitializeWindowHandles() 37 { 38 if(globalwhandlecritsect.hmtxLock == 0) { 39 DosInitializeCriticalSection(&globalwhandlecritsect, WINHANDLE_CRITSECTION_NAME); 40 } 41 else { 42 dprintf(("InitializeWindowHandles -> access shared critical section")); 43 DosAccessCriticalSection(&globalwhandlecritsect, WINHANDLE_CRITSECTION_NAME); 44 } 45 } 46 //****************************************************************************** 47 //****************************************************************************** 41 48 BOOL HwAllocateWindowHandle(HWND *hwnd, DWORD dwUserData) 42 49 { 43 tableMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalTableMutex);50 DosEnterCriticalSection(&globalwhandlecritsect); 44 51 45 52 //find next free handle … … 55 62 if(i == MAX_WINDOW_HANDLES) { 56 63 //oops, out of handles 57 tableMutex.leave(&hGlobalTableMutex);64 DosLeaveCriticalSection(&globalwhandlecritsect); 58 65 dprintf(("ERROR: USER32: HwAllocateWindowHandle OUT OF WINDOW HANDLES!!")); 59 66 DebugInt3(); … … 65 72 66 73 lastIndex++; 67 tableMutex.leave(&hGlobalTableMutex);74 DosLeaveCriticalSection(&globalwhandlecritsect); 68 75 return TRUE; 69 76 } … … 74 81 hwnd &= WNDHANDLE_MAGIC_MASK; 75 82 if(hwnd < MAX_WINDOW_HANDLES) { 76 tableMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalTableMutex);83 DosEnterCriticalSection(&globalwhandlecritsect); 77 84 WindowHandleTable[hwnd] = 0; 78 tableMutex.leave(&hGlobalTableMutex);85 DosLeaveCriticalSection(&globalwhandlecritsect); 79 86 } 80 87 }
Note:
See TracChangeset
for help on using the changeset viewer.