- Timestamp:
- Jun 12, 2001, 7:02:42 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/HOOK.CPP
r5935 r5973 1 /* $Id: HOOK.CPP,v 1.2 0 2001-06-09 14:50:15sandervl Exp $ */1 /* $Id: HOOK.CPP,v 1.21 2001-06-12 17:02:33 sandervl Exp $ */ 2 2 3 3 /* … … 86 86 //Global DLL Data 87 87 //SvL: Disabled global system hooks for now 88 ////#pragma data_seg(_GLOBALDATA) 88 //#define GLOBAL_HOOKS 89 #ifdef GLOBAL_HOOKS 90 #pragma data_seg(_GLOBALDATA) 91 #endif 89 92 static HANDLE HOOK_systemHooks[WH_NB_HOOKS] = { 0 }; 93 #ifdef GLOBAL_HOOKS 90 94 static VMutex systemHookMutex(VMUTEX_SHARED, &hGlobalHookMutex); 91 ////#pragma data_seg() 95 #pragma data_seg() 96 #else 97 static CRITICAL_SECTION systemCritSect = {0}; 98 #endif 92 99 static HANDLE HOOK_threadHooks[WH_NB_HOOKS] = { 0 }; 93 static VMutex threadHookMutex; 100 static CRITICAL_SECTION threadCritSect = {0}; 101 102 #ifdef GLOBAL_HOOKS 103 #define SYSTEMHOOK_LOCK() systemHookMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalHookMutex); 104 #define SYSTEMHOOK_UNLOCK() systemHookMutex.leave(&hGlobalHookMutex); 105 #else 106 #define SYSTEMHOOK_LOCK() EnterCriticalSection(&systemCritSect); 107 #define SYSTEMHOOK_UNLOCK() LeaveCriticalSection(&systemCritSect); 108 #endif 94 109 95 110 typedef VOID (*HOOK_MapFunc)(INT, INT, WPARAM *, LPARAM *); … … 324 339 return 0; 325 340 } 326 threadHookMutex.enter();341 EnterCriticalSection(&threadCritSect); 327 342 data->next = teb->o.odin.hooks[id - WH_MINHOOK]; 328 343 teb->o.odin.hooks[id - WH_MINHOOK] = (DWORD)data; 329 threadHookMutex.leave();344 LeaveCriticalSection(&threadCritSect); 330 345 } 331 346 else 332 347 { 333 systemHookMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalHookMutex);348 SYSTEMHOOK_LOCK(); 334 349 data->next = HOOK_systemHooks[id - WH_MINHOOK]; 335 350 HOOK_systemHooks[id - WH_MINHOOK] = (HANDLE)data; 336 systemHookMutex.leave(&hGlobalHookMutex);351 SYSTEMHOOK_UNLOCK(); 337 352 } 338 353 … … 374 389 return FALSE; 375 390 } 376 threadHookMutex.enter();391 EnterCriticalSection(&threadCritSect); 377 392 prevHook = (HOOKDATA **)&teb->o.odin.hooks[data->id - WH_MINHOOK]; 378 393 } 379 394 else { 380 systemHookMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalHookMutex);395 SYSTEMHOOK_LOCK(); 381 396 prevHook = (HOOKDATA **)&HOOK_systemHooks[data->id - WH_MINHOOK]; 382 397 } … … 386 401 if (!prevHook) { 387 402 if (data->ownerThread) { 388 threadHookMutex.leave();403 LeaveCriticalSection(&threadCritSect); 389 404 } 390 else systemHookMutex.leave(&hGlobalHookMutex);405 else SYSTEMHOOK_UNLOCK(); 391 406 392 407 return FALSE; … … 395 410 396 411 if (data->ownerThread) { 397 threadHookMutex.leave();398 } 399 else systemHookMutex.leave(&hGlobalHookMutex);412 LeaveCriticalSection(&threadCritSect); 413 } 414 else SYSTEMHOOK_UNLOCK(); 400 415 401 416 HeapFree(GetProcessHeap(), 0, (LPVOID)data ); -
trunk/src/user32/syscolor.cpp
r5951 r5973 1 /* $Id: syscolor.cpp,v 1.2 7 2001-06-10 12:05:39sandervl Exp $ */1 /* $Id: syscolor.cpp,v 1.28 2001-06-12 17:02:35 sandervl Exp $ */ 2 2 3 3 /* … … 258 258 } 259 259 dprintf(("GetSysColorBrush %d returned %x ", nIndex, ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ? SysColorBrushes[nIndex]:0)); 260 return ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ? SysColorBrushes[nIndex]:0; 260 if( ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ) 261 return SysColorBrushes[nIndex]; 262 263 //MED calls FillRect with (hardcoded) zero brush -> index -1 264 dprintf2(("WARNING: Unknown index(%d)", nIndex )); 265 return GetStockObject(LTGRAY_BRUSH); 261 266 } 262 267 /*********************************************************************** -
trunk/src/user32/user32.cpp
r5951 r5973 1 /* $Id: user32.cpp,v 1. 99 2001-06-10 12:05:40sandervl Exp $ */1 /* $Id: user32.cpp,v 1.100 2001-06-12 17:02:36 sandervl Exp $ */ 2 2 3 3 /* … … 1426 1426 /* Filled Shape Functions */ 1427 1427 1428 /* Last COLOR id */ 1429 #define COLOR_MAX COLOR_GRADIENTINACTIVECAPTION 1428 1430 1429 1431 int WIN32API FillRect(HDC hDC, const RECT * lprc, HBRUSH hbr) 1430 1432 { 1433 if (hbr <= (HBRUSH) (COLOR_MAX + 1)) { 1434 hbr = GetSysColorBrush( (INT) hbr - 1 ); 1435 } 1431 1436 dprintf(("USER32: FillRect %x (%d,%d)(%d,%d) brush %X", hDC, lprc->left, lprc->top, lprc->right, lprc->bottom, hbr)); 1432 1437 return O32_FillRect(hDC,lprc,hbr); -
trunk/src/user32/win32wbase.cpp
r5968 r5973 1 /* $Id: win32wbase.cpp,v 1.26 4 2001-06-11 20:08:24sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.265 2001-06-12 17:02:41 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 653 653 if (windowClass->getStyle() & CS_CLASSDC) { 654 654 dprintf(("WARNING: Class with CS_CLASSDC style!")); 655 ownDC = 0; 655 //not a good solution, but it's a bit difficult to share a single 656 //DC among different windows... DevOpenDC apparently can't be used 657 //for window DCs and WinOpenWindowDC must be associated with a window 658 ownDC = GetDCEx(getWindowHandle(), NULL, DCX_USESTYLE); 656 659 } 657 660 /* Set the window menu */ -
trunk/src/user32/win32wbase.h
r5935 r5973 1 /* $Id: win32wbase.h,v 1.11 8 2001-06-09 14:50:21sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.119 2001-06-12 17:02:42 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 471 471 VOID AdjustTrackInfo(PPOINT minTrackSize,PPOINT maxTrackSize); 472 472 473 //Temporary hack for CS_CLASSDC style (do the same as for CS_OWNDC) 473 474 #ifndef OS2_INCLUDED 474 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & CS_OWNDC); }475 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC)); } 475 476 #else 476 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & CS_OWNDC_W); }477 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W)); } 477 478 #endif 478 479 -
trunk/src/user32/win32wbasenonclient.cpp
r5951 r5973 1 /* $Id: win32wbasenonclient.cpp,v 1.3 2 2001-06-10 12:05:41sandervl Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.33 2001-06-12 17:02:42 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 1030 1030 1031 1031 dprintf(("DoNCPaint %x %x %d", getWindowHandle(), clip, suppress_menupaint)); 1032 DecreaseLogCount();1033 1032 1034 1033 rect.top = rect.left = 0; … … 1061 1060 ((clip > 1) ?(DCX_INTERSECTRGN /*| DCX_KEEPCLIPRGN*/) : 0) ))) return; 1062 1061 1062 DecreaseLogCount(); 1063 1063 SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) ); 1064 1064 … … 1159 1159 } 1160 1160 1161 IncreaseLogCount(); 1161 1162 ReleaseDC(getWindowHandle(),hdc); 1162 IncreaseLogCount();1163 1163 dprintf(("**DoNCPaint %x DONE", getWindowHandle())); 1164 1164 }
Note:
See TracChangeset
for help on using the changeset viewer.