Changeset 8202 for trunk/src/gdi32/objhandle.cpp
- Timestamp:
- Apr 7, 2002, 4:38:08 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/objhandle.cpp
r7635 r8202 1 /* $Id: objhandle.cpp,v 1.2 0 2001-12-15 18:50:27sandervl Exp $ */1 /* $Id: objhandle.cpp,v 1.21 2002-04-07 14:38:08 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Handle Management Code for OS/2 … … 45 45 static VMutex objTableMutex; 46 46 47 #ifdef DEBUG 48 static DWORD GetObjectTypeNoDbg( HGDIOBJ hObj); 49 #else 50 #define GetObjectTypeNoDbg GetObjectType 51 #endif 52 47 53 //****************************************************************************** 48 54 //****************************************************************************** 49 55 BOOL WIN32API ObjAllocateHandle(HANDLE *hObject, DWORD dwUserData, ObjectType type) 50 56 { 51 objTableMutex.enter( VMUTEX_WAIT_FOREVER);57 objTableMutex.enter(); 52 58 if(lowestFreeIndex == -1) { 53 59 //oops, out of handles … … 85 91 hObject &= OBJHANDLE_MAGIC_MASK; 86 92 if(hObject < MAX_OBJECT_HANDLES) { 87 objTableMutex.enter( VMUTEX_WAIT_FOREVER);93 objTableMutex.enter(); 88 94 objHandleTable[hObject].dwUserData = 0; 89 95 objHandleTable[hObject].type = GDIOBJ_NONE; … … 158 164 if(lpBuffer == NULL) 159 165 { //return required size if buffer pointer == NULL 160 int objtype = GetObjectType (hObject);166 int objtype = GetObjectTypeNoDbg(hObject); 161 167 switch(objtype) 162 168 { … … 219 225 hObject |= GDIOBJ_PREFIX; 220 226 } 221 objtype = GetObjectType (hObject);227 objtype = GetObjectTypeNoDbg(hObject); 222 228 223 229 switch(objtype) … … 253 259 //****************************************************************************** 254 260 //****************************************************************************** 261 #ifdef DEBUG 262 static char *gditypenames[] = { 263 "NULL", 264 "OBJ_PEN", 265 "OBJ_BRUSH", 266 "OBJ_DC", 267 "OBJ_METADC", 268 "OBJ_PAL", 269 "OBJ_FONT", 270 "OBJ_BITMAP", 271 "OBJ_REGION", 272 "OBJ_METAFILE", 273 "OBJ_MEMDC", 274 "OBJ_EXTPEN", 275 "OBJ_ENHMETADC", 276 "OBJ_ENHMETAFILE" 277 }; 278 279 char *DbgGetGDITypeName(DWORD handleType) 280 { 281 if(handleType <= OBJ_ENHMETAFILE) { 282 return gditypenames[handleType]; 283 } 284 return "UNKNOWN TYPE"; 285 } 286 #endif 287 //****************************************************************************** 288 //****************************************************************************** 255 289 HGDIOBJ WIN32API SelectObject(HDC hdc, HGDIOBJ hObj) 256 290 { … … 263 297 } 264 298 265 handleType = GetObjectType (hObj);266 dprintf2(("GDI32: SelectObject %x %x type % x", hdc, hObj, handleType));299 handleType = GetObjectTypeNoDbg(hObj); 300 dprintf2(("GDI32: SelectObject %x %x type %s", hdc, hObj, DbgGetGDITypeName(handleType))); 267 301 if(handleType == GDIOBJ_REGION) { 268 302 //Return complexity here; not previously selected clip region … … 287 321 } 288 322 rc = O32_SelectObject(hdc, hObj); 289 if(rc != 0 && GetObjectType (rc) == OBJ_BITMAP && DIBSection::getSection != NULL)323 if(rc != 0 && GetObjectTypeNoDbg(rc) == OBJ_BITMAP && DIBSection::getSection != NULL) 290 324 { 291 325 DIBSection *dsect = DIBSection::findObj(rc); … … 327 361 //****************************************************************************** 328 362 //****************************************************************************** 329 DWORD WIN32API GetObjectType( HGDIOBJ hObj) 363 #ifdef DEBUG 364 static DWORD GetObjectTypeNoDbg( HGDIOBJ hObj) 330 365 { 331 366 DWORD objtype; … … 340 375 return OBJ_REGION; 341 376 } 377 return O32_GetObjectType(hObj); 378 } 379 #endif 380 //****************************************************************************** 381 //****************************************************************************** 382 DWORD WIN32API GetObjectType( HGDIOBJ hObj) 383 { 384 DWORD objtype; 385 386 //TODO: must use 16 bits gdi object handles 387 if(HIWORD(hObj) == 0) { 388 hObj |= GDIOBJ_PREFIX; 389 } 390 if(ObjGetHandleType(hObj) == GDIOBJ_REGION) { 391 dprintf2(("GDI32: GetObjectType %x REGION", hObj)); 392 SetLastError(ERROR_SUCCESS); 393 return OBJ_REGION; 394 } 342 395 objtype = O32_GetObjectType(hObj); 343 396 dprintf2(("GDI32: GetObjectType %x objtype %d", hObj, objtype)); … … 360 413 361 414 //System objects can't be deleted (TODO: any others?? (fonts?))!!!!) 362 objtype = GetObjectType (hObj);415 objtype = GetObjectTypeNoDbg(hObj); 363 416 switch (objtype) 364 417 {
Note:
See TracChangeset
for help on using the changeset viewer.