Changeset 377 for trunk/dll/seeall.c


Ignore:
Timestamp:
Jul 27, 2006, 8:28:31 AM (19 years ago)
Author:
root
Message:

Validate WinCreateWindow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/seeall.c

    r335 r377  
    745745                        GetPString(IDS_TOTEXT),
    746746                        newname);
    747                 WinSetWindowText(WinWindowFromID(hwndFrame,
    748                                                  SEEALL_STATUS),
     747                WinSetWindowText(WinWindowFromID(hwndFrame,SEEALL_STATUS),
    749748                                 message);
    750749                if(fRealIdle)
     
    12961295                                  NULL,
    12971296                                  NULL);
    1298         if(hwndObj) {
     1297        if (!hwndObj) {
     1298          Win_Error2(HWND_OBJECT,HWND_DESKTOP,pszSrcFile,__LINE__,IDS_WINCREATEWINDOW);
     1299          if (!PostMsg(ad->hwndClient,WM_CLOSE,MPVOID,MPVOID))
     1300            WinSendMsg(ad->hwndClient,WM_CLOSE,MPVOID,MPVOID);
     1301        }
     1302        else {
    12991303          ad->hwndObj = hwndObj;
    13001304          WinSetWindowULong(hwndObj,QWL_USER,ad->hwndFrame);
     
    13031307            WinDispatchMsg(hab2,&qmsg2);
    13041308          WinDestroyWindow(hwndObj);
    1305         }
    1306         else {
    1307           if(!PostMsg(ad->hwndClient,WM_CLOSE,MPVOID,MPVOID))
    1308             WinSendMsg(ad->hwndClient,WM_CLOSE,MPVOID,MPVOID);
    13091309        }
    13101310        WinDestroyMsgQueue(hmq2);
     
    25442544      WinSetWindowPtr(hwnd,QWL_USER,NULL);
    25452545      pAD = xmallocz(sizeof(ALLDATA),pszSrcFile,__LINE__);
    2546       if(pAD) {
     2546      if (pAD) {
     2547        HWND hwndFrame;
    25472548        pAD->size = sizeof(ALLDATA);
    2548         pAD->hwndFrame = WinQueryWindow(hwnd,QW_PARENT);
     2549        hwndFrame = WinQueryWindow(hwnd,QW_PARENT);
     2550        pAD->hwndFrame = hwndFrame;
    25492551        pAD->mask.attrFile = FILE_READONLY | FILE_HIDDEN   |
    25502552                            FILE_SYSTEM   | FILE_ARCHIVED;
     
    26292631        pAD->fattrs.usCodePage = Codepage;
    26302632        memcpy(pAD->aulColors,Colors,sizeof(LONG) * COLORS_MAX);
    2631         pAD->hwndMenu   = WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
     2633        pAD->hwndMenu   = WinWindowFromID(hwndFrame,
    26322634                                         FID_MENU);
    26332635        SetConditionalCascade(pAD->hwndMenu,IDM_DELETESUBMENU,
     
    26462648        pAD->hwndClient = hwnd;
    26472649        pAD->hps = InitWindow(hwnd);
    2648         pAD->hvscroll = WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
     2650        pAD->hvscroll = WinWindowFromID(hwndFrame,
    26492651                                       FID_VERTSCROLL);
    2650         pAD->hhscroll = WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
     2652        pAD->hhscroll = WinWindowFromID(hwndFrame,
    26512653                                       FID_HORZSCROLL);
    26522654        pAD->multiplier = 1;
     
    26552657        else {
    26562658          if (!DosCreateMutexSem(NULL,&pAD->hmtxScan,0L,FALSE)) {
    2657             pAD->hwndStatus = WinCreateWindow(WinQueryWindow(hwnd,QW_PARENT),
     2659            pAD->hwndStatus = WinCreateWindow(hwndFrame,
    26582660                                              GetPString(IDS_WCSEESTATUS),
    26592661                                              NullStr,
     
    26642666                                              0,
    26652667                                              0,
    2666                                               WinQueryWindow(hwnd,QW_PARENT),
     2668                                              hwndFrame,
    26672669                                              HWND_TOP,
    26682670                                              SEEALL_STATUS,
    26692671                                              NULL,
    26702672                                              NULL);
     2673            if (!pAD->hwndStatus)
     2674              Win_Error2(hwndFrame,hwnd,pszSrcFile,__LINE__,IDS_WINCREATEWINDOW);
     2675            else
    26712676            {
    26722677              PFNWP oldproc;
    2673 
    2674               oldproc = WinSubclassWindow(WinQueryWindow(hwnd,QW_PARENT),
    2675                                           (PFNWP)SeeFrameWndProc);
    2676               if(oldproc)
    2677                 WinSetWindowPtr(WinQueryWindow(hwnd,QW_PARENT),
    2678                                 QWL_USER,
    2679                                 (PVOID)oldproc);
     2678              oldproc = WinSubclassWindow(hwndFrame,SeeFrameWndProc);
     2679              WinSetWindowPtr(hwndFrame,QWL_USER,(PVOID)oldproc);
    26802680            }
    26812681            break;
Note: See TracChangeset for help on using the changeset viewer.