Changeset 4188 for trunk/src


Ignore:
Timestamp:
Sep 4, 2000, 8:23:58 PM (25 years ago)
Author:
sandervl
Message:

SetWindowLong changes + fixes for GWL_WNDPROC

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r3662 r4188  
    1 /* $Id: win32dlg.cpp,v 1.50 2000-06-07 14:51:29 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.51 2000-09-04 18:23:55 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    10621062    {
    10631063    case DWL_DLGPROC:
     1064    {
     1065        //Note: Type of SetWindowLong determines new window proc type
     1066        //      UNLESS the new window proc has already been registered
     1067        //      (use the old type in that case)
     1068        //      (VERIFIED in NT 4, SP6)
     1069        WINDOWPROCTYPE type = WINPROC_GetProcType((HWINDOWPROC)value);
     1070        if(type == WIN_PROC_INVALID) {
     1071                type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A;
     1072        }
    10641073        oldval = (LONG)WINPROC_GetProc(Win32DlgProc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
    1065         WINPROC_SetProc((HWINDOWPROC *)&Win32DlgProc, (WNDPROC)value, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_WINDOW);
     1074        WINPROC_SetProc((HWINDOWPROC *)&Win32DlgProc, (WNDPROC)value, type, WIN_PROC_WINDOW);
    10661075        return oldval;
     1076    }
    10671077    case DWL_MSGRESULT:
    10681078        oldval = msgResult;
  • trunk/src/user32/win32wbase.cpp

    r4147 r4188  
    1 /* $Id: win32wbase.cpp,v 1.209 2000-09-02 08:30:09 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.210 2000-09-04 18:23:56 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    20782078
    20792079    dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow));
    2080     if(getWindowHandle() == 0x6800001d && nCmdShow == 1) {
    2081         rc = 0;
    2082     }
    20832080    wasVisible = (getStyle() & WS_VISIBLE) != 0;
    20842081
     
    21892186   RECT oldClientRect = rectClient;
    21902187
    2191     if(getWindowHandle() == 0x6800000a) {
    2192         rc = FALSE;
    2193     }
    21942188    if (fuFlags &
    21952189       ~(SWP_NOSIZE     | SWP_NOMOVE     | SWP_NOZORDER     |
     
    30603054        }
    30613055        case GWL_WNDPROC:
    3062                 oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
    3063                 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, WINPROC_GetProcType(win32wndproc), WIN_PROC_WINDOW);
     3056        {
     3057                //Note: Type of SetWindowLong determines new window proc type
     3058                //      UNLESS the new window proc has already been registered
     3059                //      (use the old type in that case)
     3060                //      (VERIFIED in NT 4, SP6)
     3061                WINDOWPROCTYPE type = WINPROC_GetProcType((HWINDOWPROC)value);
     3062                if(type == WIN_PROC_INVALID) {
     3063                        type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A;
     3064                }
     3065                oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
     3066                WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, type, WIN_PROC_WINDOW);
    30643067                return oldval;
    3065 
     3068        }
    30663069        case GWL_HINSTANCE:
    30673070                oldval = hInstance;
  • trunk/src/user32/window.cpp

    r4147 r4188  
    1 /* $Id: window.cpp,v 1.73 2000-09-02 08:30:11 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.74 2000-09-04 18:23:58 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    802802        return 0;
    803803    }
    804     dprintf(("GetWindowTextW %x", hwnd));
     804#ifdef DEBUG
     805    int rc = window->GetWindowTextW(lpsz, cch);
     806    if(rc) {
     807        LPSTR astring = UnicodeToAsciiString(lpsz);
     808        dprintf(("GetWindowTextW %x %s", hwnd, lpsz));
     809        free(astring);
     810    }
     811    else dprintf(("GetWindowTextW %x returned %d", hwnd, rc));
     812    return rc;
     813#else
    805814    return window->GetWindowTextW(lpsz, cch);
     815#endif
    806816}
    807817//******************************************************************************
     
    832842        return 0;
    833843    }
    834     dprintf(("SetWindowTextW %x", hwnd));
     844#ifdef DEBUG
     845    LPSTR astring = UnicodeToAsciiString(lpsz);
     846    dprintf(("SetWindowTextW %x %s", hwnd, astring));
     847    free(astring);
     848    if(hwnd == 0x68000008) {
     849        int i;
     850        i = 5;
     851    }
     852#endif
    835853    return window->SetWindowTextW((LPWSTR)lpsz);
    836854}
  • trunk/src/user32/winproc.cpp

    r2803 r4188  
    1 /* $Id: winproc.cpp,v 1.4 2000-02-16 14:28:28 sandervl Exp $ */
     1/* $Id: winproc.cpp,v 1.5 2000-09-04 18:23:58 sandervl Exp $ */
    22/*
    33 * Window procedure callbacks
     
    6161    WINDOWPROC *proc;
    6262
     63    ptr = (BYTE *)handle;
    6364    if(ptr == NULL) {
     65        DebugInt3();
    6466        return NULL;
    6567    }
    6668
    67     ptr = (BYTE *)handle;
    6869    /* First check if it is the jmp address */
    6970//    if (*ptr == 0xe9 /* jmp */) ptr -= (int)&((WINDOWPROC *)0)->jmp -
     
    131132 WINDOWPROC *lpProc = (WINDOWPROC *)proc;
    132133
    133     if (!lpProc) return NULL;
    134 
    135     /* We want a 32-bit address */
    136     return (WNDPROC)&lpProc->jmp;
     134    if(!lpProc) {
     135        DebugInt3();
     136        return NULL;
     137    }
     138
     139    if(type != lpProc->type) {
     140         /* Have to return the jmp address if types don't match */
     141         return (WNDPROC)&lpProc->jmp;
     142    }
     143    else return WINPROC_THUNKPROC(lpProc); //return original window proc address if types match
    137144}
    138145
Note: See TracChangeset for help on using the changeset viewer.