Changeset 5935 for trunk/src/user32/windowclass.cpp
- Timestamp:
- Jun 9, 2001, 4:50:26 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/windowclass.cpp
r5472 r5935 1 /* $Id: windowclass.cpp,v 1.2 0 2001-04-04 09:01:25sandervl Exp $ */1 /* $Id: windowclass.cpp,v 1.21 2001-06-09 14:50:26 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Code for OS/2 … … 52 52 wc.hIconSm = 0; 53 53 54 if(Win32WndClass::FindClass(wc.hInstance, (LPSTR)wc.lpszClassName)) { 54 wclass = Win32WndClass::FindClass(wc.hInstance, (LPSTR)wc.lpszClassName); 55 if(wclass) { 56 RELEASE_CLASSOBJ(wclass); 55 57 if(HIWORD(wc.lpszClassName)) { 56 58 dprintf(("RegisterClassA %x %s already exists", wc.hInstance, wc.lpszClassName)); … … 75 77 return(0); 76 78 } 77 return(wclass->getAtom()); 79 ATOM atom = wclass->getAtom(); 80 RELEASE_CLASSOBJ(wclass); 81 return atom; 78 82 } 79 83 //****************************************************************************** … … 84 88 Win32WndClass *wclass; 85 89 86 if(Win32WndClass::FindClass(lpWndClass->hInstance, (LPSTR)lpWndClass->lpszClassName)) { 90 wclass = Win32WndClass::FindClass(lpWndClass->hInstance, (LPSTR)lpWndClass->lpszClassName); 91 if(wclass) { 92 RELEASE_CLASSOBJ(wclass); 87 93 if(HIWORD(lpWndClass->lpszClassName)) { 88 94 dprintf(("RegisterClassExA %x %s already exists", lpWndClass->hInstance, lpWndClass->lpszClassName)); … … 100 106 return(0); 101 107 } 102 return(wclass->getAtom()); 108 ATOM atom = wclass->getAtom(); 109 RELEASE_CLASSOBJ(wclass); 110 return atom; 103 111 } 104 112 //****************************************************************************** … … 115 123 memcpy(&wc.style, lpwc, sizeof(WNDCLASSA)); 116 124 117 if(Win32WndClass::FindClass(wc.hInstance, (LPWSTR)wc.lpszClassName)) { 125 winclass = Win32WndClass::FindClass(wc.hInstance, (LPWSTR)wc.lpszClassName); 126 if(winclass) { 127 RELEASE_CLASSOBJ(winclass); 118 128 if(HIWORD(wc.lpszClassName)) { 119 129 dprintf(("RegisterClassW %x %ls already exists", wc.hInstance, wc.lpszClassName)); … … 139 149 } 140 150 rc = winclass->getAtom(); 141 151 RELEASE_CLASSOBJ(winclass); 142 152 return(rc); 143 153 } … … 153 163 memcpy(&wc, lpwc, sizeof(WNDCLASSEXA)); 154 164 155 if(Win32WndClass::FindClass(wc.hInstance, (LPWSTR)wc.lpszClassName)) { 165 winclass = Win32WndClass::FindClass(wc.hInstance, (LPWSTR)wc.lpszClassName); 166 if(winclass) { 167 RELEASE_CLASSOBJ(winclass); 156 168 if(HIWORD(wc.lpszClassName)) { 157 169 dprintf(("RegisterClassExW %x %ls already exists", wc.hInstance, wc.lpszClassName)); … … 170 182 } 171 183 rc = winclass->getAtom(); 184 RELEASE_CLASSOBJ(winclass); 172 185 173 186 return(rc); … … 180 193 181 194 ret = Win32WndClass::UnregisterClassA(hinst, (LPSTR)lpszClassName); 182 #if 1183 195 return ret; 184 #else185 //Spintest returns FALSE in dll termination, so pretend it succeeded186 // return(TRUE);187 #endif188 196 } 189 197 //****************************************************************************** … … 204 212 FreeAsciiString((char *)astring); 205 213 206 #if 1207 214 return ret; 208 #else209 //Spintest returns FALSE in dll termination, so pretend it succeeded210 // return(TRUE);211 #endif212 215 } 213 216 //****************************************************************************** … … 227 230 if(wndclass) { 228 231 wndclass->getClassInfo(&wc); 232 RELEASE_CLASSOBJ(wndclass); 229 233 memcpy(lpwc, &wc.style, sizeof(WNDCLASSA)); 230 234 SetLastError(ERROR_SUCCESS); … … 256 260 if(wndclass) { 257 261 wndclass->getClassInfo(&wc); 262 RELEASE_CLASSOBJ(wndclass); 258 263 memcpy(lpwc, &wc.style, sizeof(WNDCLASSW)); 259 264 SetLastError(ERROR_SUCCESS); … … 295 300 if(wndclass) { 296 301 wndclass->getClassInfo(lpwcx); 302 RELEASE_CLASSOBJ(wndclass); 297 303 lpwcx->cbSize = sizeof(WNDCLASSEXA); 298 304 SetLastError(ERROR_SUCCESS); … … 344 350 if(wndclass) { 345 351 wndclass->getClassInfo(lpwcx); 352 RELEASE_CLASSOBJ(wndclass); 346 353 lpwcx->cbSize = sizeof(WNDCLASSEXW); 347 354 SetLastError(ERROR_SUCCESS); … … 365 372 *lpszClassName = 0; 366 373 rc = (wnd->getClass())->getClassName(lpszClassName, cchClassName); 374 RELEASE_WNDOBJ(wnd); 367 375 dprintf(("USER32: GetClassNameA %x %s (%d)", hwnd, lpszClassName, rc)); 368 376 return rc; … … 373 381 { 374 382 Win32BaseWindow *wnd; 383 int ret; 375 384 376 385 dprintf(("USER32: GetClassNameW\n")); … … 380 389 return(0); 381 390 } 382 return (wnd->getClass())->getClassName(lpszClassName, cchClassName); 391 ret = (wnd->getClass())->getClassName(lpszClassName, cchClassName); 392 RELEASE_WNDOBJ(wnd); 393 return ret; 383 394 } 384 395 //****************************************************************************** … … 387 398 { 388 399 Win32BaseWindow *wnd; 400 LONG ret; 389 401 390 402 wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); … … 393 405 return(0); 394 406 } 395 return (wnd->getClass())->setClassLongA(nIndex, lNewVal); 407 ret = (wnd->getClass())->setClassLongA(nIndex, lNewVal); 408 RELEASE_WNDOBJ(wnd); 409 return ret; 396 410 } 397 411 //****************************************************************************** … … 400 414 { 401 415 Win32BaseWindow *wnd; 416 LONG ret; 402 417 403 418 wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); … … 406 421 return(0); 407 422 } 408 return (wnd->getClass())->setClassLongW(nIndex, lNewVal); 423 ret = (wnd->getClass())->setClassLongW(nIndex, lNewVal); 424 RELEASE_WNDOBJ(wnd); 425 return ret; 409 426 } 410 427 //****************************************************************************** … … 413 430 { 414 431 Win32BaseWindow *wnd; 432 LONG ret; 415 433 416 434 dprintf(("USER32: SetClassWord %x %d %x", hwnd, nIndex, (ULONG)wNewVal)); … … 420 438 return(0); 421 439 } 422 return (wnd->getClass())->setClassWord(nIndex, wNewVal); 440 ret = (wnd->getClass())->setClassWord(nIndex, wNewVal); 441 RELEASE_WNDOBJ(wnd); 442 return ret; 423 443 } 424 444 //****************************************************************************** … … 435 455 } 436 456 ret = (wnd->getClass())->getClassWord(nIndex); 457 RELEASE_WNDOBJ(wnd); 437 458 dprintf(("USER32: GetClassWord %x %d returned %x", hwnd, nIndex, (ULONG)ret)); 438 459 return ret; … … 451 472 } 452 473 ret = (wnd->getClass())->getClassLongA(nIndex); 474 RELEASE_WNDOBJ(wnd); 453 475 dprintf(("USER32: GetClassLongA %x %d returned %x", hwnd, nIndex, ret)); 454 476 return ret; … … 467 489 } 468 490 ret = (wnd->getClass())->getClassLongW(nIndex); 491 RELEASE_WNDOBJ(wnd); 469 492 dprintf(("USER32: GetClassLongW %x %d returned %x", hwnd, nIndex, ret)); 470 493 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.