Changeset 10076 for trunk/src


Ignore:
Timestamp:
May 6, 2003, 3:50:37 PM (22 years ago)
Author:
sandervl
Message:

ReleaseDC check if hwnd parameter is correct (WindowFromDC(hdc)); Messagebox: Wrong ReleaseDC call

Location:
trunk/src/user32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dc.cpp

    r10060 r10076  
    1 /* $Id: dc.cpp,v 1.119 2003-05-02 15:33:15 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.120 2003-05-06 13:50:35 sandervl Exp $ */
    22
    33/*
     
    861861    if (hwnd)
    862862    {
     863        HWND hwndDC = WindowFromDC(hdc);
     864
     865        if(hwndDC != hwnd) {
     866            dprintf(("WARNING: ReleaseDC: wrong window handle specified %x -> %x", hwnd, hwndDC));
     867            hwnd = hwndDC;
     868        }
     869
    863870        Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    864871        if(wnd == NULL) {
  • trunk/src/user32/msgbox.c

    r7342 r10076  
    1 /* $Id: msgbox.c,v 1.6 2001-11-14 18:33:03 sandervl Exp $ */
     1/* $Id: msgbox.c,v 1.7 2003-05-06 13:50:36 sandervl Exp $ */
    22/*
    33 * Message boxes (based on Wine code)
     
    186186    if (hFont)
    187187        SelectObject(hdc, hPrevFont);
     188#ifdef __WIN32OS2__
     189    ReleaseDC(hwnd, hdc);
     190#else
    188191    ReleaseDC(hItem, hdc);
     192#endif
    189193
    190194    tiheight = 16 + MAX(iheight, theight);
  • trunk/src/user32/win32wbase.cpp

    r10061 r10076  
    1 /* $Id: win32wbase.cpp,v 1.371 2003-05-02 17:18:57 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.372 2003-05-06 13:50:37 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    41114111    }
    41124112
     4113    lock(&critsect);
    41134114    int j = 0;
    41144115    for(int i=0;i<MAX_OPENDCS && j<nrOpenDCs;i++) {
     
    41184119        }
    41194120    }
     4121    unlock(&critsect);
    41204122    *pnrdcs = nrOpenDCs;
    41214123    return TRUE;
     
    41344136void Win32BaseWindow::addOpenDC(HDC hdc)
    41354137{
     4138    lock(&critsect);
    41364139    for(int i=0;i<MAX_OPENDCS;i++) {
    41374140        if(hdcWindow[i] == 0) {
     
    41404143        }
    41414144    }
     4145    unlock(&critsect);
    41424146    if(i == MAX_OPENDCS) {
    41434147        DebugInt3(); //no room!
     
    41454149    }
    41464150
     4151    dprintf2(("Win32BaseWindow::addOpenDC %x %x %d", getWindowHandle(), hdc, nrOpenDCs+1));
    41474152    nrOpenDCs++;
    41484153}
     
    41614166{
    41624167    if(nrOpenDCs == 0) {
     4168        dprintf(("Win32BaseWindow::removeOpenDC %x hdc %x not found!! (1)", getWindowHandle(), hdc));
    41634169        DebugInt3();
    41644170        return;
    41654171    }
     4172    lock(&critsect);
    41664173    for(int i=0;i<MAX_OPENDCS;i++) {
    41674174        if(hdcWindow[i] == hdc) {
     
    41704177        }
    41714178    }
     4179    unlock(&critsect);
    41724180    if(i == MAX_OPENDCS) {
     4181        dprintf(("Win32BaseWindow::removeOpenDC hdc %x not found!!", hdc));
    41734182        DebugInt3(); //not found
    41744183        return;
    41754184    }
     4185    dprintf2(("Win32BaseWindow::removeOpenDC %x %x", getWindowHandle(), hdc, nrOpenDCs-1));
    41764186    nrOpenDCs--;
    41774187}
Note: See TracChangeset for help on using the changeset viewer.