Changeset 1062

Show
Ignore:
Timestamp:
07/08/08 22:57:26 (2 months ago)
Author:
stevenhl
Message:

Correct Fortify_LeaveScope usage and avoid spurious reports

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/dll/objwin.c

    r1038 r1062  
    77 
    88  Copyright (c) 1993-98 M. Kimes 
    9   Copyright (c) 2006 Steven H.Levine 
     9  Copyright (c) 2006, 2008 Steven H.Levine 
    1010 
    1111  26 Jul 06 SHL Check more run time errors 
     
    1313  30 Mar 07 GKY Remove GetPString for window class names 
    1414  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 
     15  08 Jul 08 SHL Correct Fortify_LeaveScope usage and avoid spurious reports 
    1516 
    1617***********************************************************************/ 
     
    7677                   IDS_WINCREATEWINDOW); 
    7778      else { 
    78 # ifdef FORTIFY 
    79   Fortify_EnterScope(); 
    80 # endif 
     79#ifdef FORTIFY 
     80        Fortify_EnterScope(); 
     81#endif 
    8182        WinSetWindowPtr(ObjectHwnd, QWL_USER, args); 
    8283        /* initially populate container */ 
     
    8788          WinDispatchMsg(hab2, &qmsg2); 
    8889        WinDestroyWindow(ObjectHwnd); 
     90#ifdef FORTIFY 
     91        { 
     92          HWND hwndCnr = ((DIRCNRDATA *)args)->hwndCnr; 
     93          USHORT i; 
     94          // Allow container to close and free data 
     95          for (i = 0; WinIsWindow(hab2, hwndCnr) && i < 10; i++) { 
     96            DosSleep(50); 
     97          } 
     98          Fortify_LeaveScope(); 
     99        } 
     100#endif 
    89101      } 
    90102      WinDestroyMsgQueue(hmq2); 
    91103    } 
    92 # ifdef FORTIFY 
    93     Fortify_LeaveScope(); 
    94 # endif 
    95104    WinTerminate(hab2); 
    96105  }