Changeset 8202 for trunk/src/user32
- Timestamp:
- Apr 7, 2002, 4:38:08 PM (23 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/HOOK.CPP
r8132 r8202 1 /* $Id: HOOK.CPP,v 1.3 6 2002-03-28 16:20:06sandervl Exp $ */1 /* $Id: HOOK.CPP,v 1.37 2002-04-07 14:36:59 sandervl Exp $ */ 2 2 3 3 /* … … 80 80 81 81 #define CHECK_MAGIC(a) ((a != 0) && (((HOOKDATA *)a)->magic == HOOK_MAGIC)) 82 83 //NOTE: This must be in the local data segment -> if a shared semaphore was84 // created by a different process, the handle returned by DosOpenMutexSem85 // will be returned in hGlobalHookMutex86 static HMTX hGlobalHookMutex = 0;87 82 88 83 //Global DLL Data -
trunk/src/user32/inituser32.cpp
r7640 r8202 1 /* $Id: inituser32.cpp,v 1.1 0 2001-12-16 15:30:14sandervl Exp $ */1 /* $Id: inituser32.cpp,v 1.11 2002-04-07 14:36:59 sandervl Exp $ */ 2 2 /* 3 3 * USER32 DLL entry point … … 43 43 #include "pmwindow.h" 44 44 #include "win32wdesktop.h" 45 #include "win32wndhandle.h" 45 46 #include "syscolor.h" 46 47 #include "initterm.h" … … 218 219 pmkbdhk_initialize(hab); 219 220 221 InitializeWindowHandles(); 222 220 223 //SvL: 18-7-'98, Register system window classes (button, listbox etc etc) 221 224 //CB: register internal classes … … 225 228 MONITOR_Initialize(&MONITOR_PrimaryMonitor); 226 229 227 break;230 break; 228 231 229 232 -
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 } -
trunk/src/user32/win32wndhandle.h
r2469 r8202 1 /* $Id: win32wndhandle.h,v 1. 4 2000-01-18 20:08:18sandervl Exp $ */1 /* $Id: win32wndhandle.h,v 1.5 2002-04-07 14:37:00 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Handle Management Code for OS/2 … … 17 17 #define WNDHANDLE_MAGIC_MASK 0x0000FFFF 18 18 19 #define WINHANDLE_CRITSECTION_NAME "\\SEM32\\ODIN_WINHANDLE.SEM" 20 21 void InitializeWindowHandles(); 19 22 BOOL HwAllocateWindowHandle(HWND *hwnd, DWORD dwUserData); 20 23 void HwFreeWindowHandle(HWND hwnd);
Note:
See TracChangeset
for help on using the changeset viewer.