Changeset 5242 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Feb 22, 2001, 11:37:31 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r5237 r5242 1 /* $Id: win32wbase.cpp,v 1.24 1 2001-02-21 21:30:43sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.242 2001-02-22 10:37:31 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 110 110 wndNameLength = 0; 111 111 112 userWindow Long= NULL;;113 nrUserWindow Long= 0;112 userWindowBytes = NULL;; 113 nrUserWindowBytes= 0; 114 114 115 115 magic = WIN32PM_MAGIC; … … 214 214 HwFreeWindowHandle(Win32Hwnd); 215 215 216 if(userWindow Long)217 free(userWindow Long);216 if(userWindowBytes) 217 free(userWindowBytes); 218 218 219 219 if(windowNameA) { … … 393 393 394 394 //Allocate window words 395 nrUserWindow Long = windowClass->getExtraWndWords();396 if(nrUserWindow Long) {397 userWindow Long = (ULONG *)_smalloc(nrUserWindowLong);398 memset(userWindow Long, 0, nrUserWindowLong);395 nrUserWindowBytes = windowClass->getExtraWndBytes(); 396 if(nrUserWindowBytes) { 397 userWindowBytes = (char *)_smalloc(nrUserWindowBytes); 398 memset(userWindowBytes, 0, nrUserWindowBytes); 399 399 } 400 400 … … 3424 3424 3425 3425 default: 3426 if(index >= 0 && index /4 < nrUserWindowLong)3426 if(index >= 0 && index + sizeof(ULONG) <= nrUserWindowBytes) 3427 3427 { 3428 oldval = userWindowLong[index/4];3429 userWindowLong[index/4]= value;3428 oldval = *(ULONG *)(userWindowBytes + index); 3429 *(ULONG *)(userWindowBytes + index) = value; 3430 3430 break; 3431 3431 } … … 3468 3468 break; 3469 3469 default: 3470 if(index >= 0 && index /4 < nrUserWindowLong)3471 { 3472 value = userWindowLong[index/4];3470 if(index >= 0 && index + sizeof(ULONG) <= nrUserWindowBytes) 3471 { 3472 value = *(ULONG *)(userWindowBytes + index); 3473 3473 break; 3474 3474 } 3475 dprintf(("WARNING: GetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value)); 3475 3476 SetLastError(ERROR_INVALID_INDEX); //verified in NT4, SP6 3476 3477 return 0; 3477 3478 } 3478 dprintf2(("GetWindowLong A %x %d %x", getWindowHandle(), index, value));3479 dprintf2(("GetWindowLong%c %x %d %x", getWindowHandle(), (fUnicode) ? 'W' : 'A', index, value)); 3479 3480 //Note: NT4, SP6 does not set the last error to 0 3480 3481 SetLastError(ERROR_SUCCESS); … … 3487 3488 WORD oldval; 3488 3489 3489 if(index >= 0 && index/4 < nrUserWindowLong) 3490 { 3491 oldval = ((WORD *)userWindowLong)[index/2]; 3492 ((WORD *)userWindowLong)[index/2] = value; 3490 if(index >= 0 && index + sizeof(WORD) <= nrUserWindowBytes) 3491 { 3492 oldval = *(WORD *)(userWindowBytes + index); 3493 *(WORD *)(userWindowBytes + index) = value; 3494 //Note: NT4, SP6 does not set the last error to 0 3495 dprintf2(("SetWindowWord %x %d %x returned %x", getWindowHandle(), index, value, oldval)); 3496 SetLastError(ERROR_SUCCESS); 3497 return oldval; 3498 } 3499 dprintf(("WARNING: SetWindowWord %x %d %x returned %x INVALID index!", getWindowHandle(), index, value)); 3500 SetLastError(ERROR_INVALID_INDEX); //verified in NT4, SP6 3501 return 0; 3502 } 3503 //****************************************************************************** 3504 //****************************************************************************** 3505 WORD Win32BaseWindow::GetWindowWord(int index) 3506 { 3507 if(index >= 0 && index + sizeof(WORD) <= nrUserWindowBytes) 3508 { 3493 3509 //Note: NT4, SP6 does not set the last error to 0 3494 3510 SetLastError(ERROR_SUCCESS); 3495 return oldval; 3496 } 3497 SetLastError(ERROR_INVALID_INDEX); //verified in NT4, SP6 3498 return 0; 3499 } 3500 //****************************************************************************** 3501 //****************************************************************************** 3502 WORD Win32BaseWindow::GetWindowWord(int index) 3503 { 3504 if(index >= 0 && index/4 < nrUserWindowLong) 3505 { 3506 //Note: NT4, SP6 does not set the last error to 0 3507 SetLastError(ERROR_SUCCESS); 3508 return ((WORD *)userWindowLong)[index/2]; 3509 } 3511 dprintf2(("GetWindowWord %x %d %x", getWindowHandle(), index, *(WORD *)(userWindowBytes + index))); 3512 return *(WORD *)(userWindowBytes + index); 3513 } 3514 dprintf(("WARNING: GetWindowWord %x %d returned %x INVALID index!", getWindowHandle(), index)); 3510 3515 SetLastError(ERROR_INVALID_INDEX); //verified in NT4, SP6 3511 3516 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.