Changeset 3766 for trunk/src


Ignore:
Timestamp:
Jun 28, 2000, 8:11:19 PM (25 years ago)
Author:
sandervl
Message:

MM: BeginDeferWindowPos bugfix (count can be 0)

File:
1 edited

Legend:

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

    r3679 r3766  
    1 /* $Id: window.cpp,v 1.70 2000-06-08 18:10:12 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.71 2000-06-28 18:11:19 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    11781178}
    11791179//******************************************************************************
     1180//Note: count 0 is a legal parameter (verified in NT4)
    11801181//******************************************************************************
    11811182HDWP WIN32API BeginDeferWindowPos(int count)
     
    11841185    DWP *pDWP;
    11851186
    1186     if (count <= 0)
     1187    if (count < 0)
    11871188    {
    11881189        dprintf(("USER32: BeginDeferWindowPos invalid param %d", count));
     
    11911192    }
    11921193    dprintf(("USER32: BeginDeferWindowPos %d", count));
    1193     handle = (HDWP)HeapAlloc(GetProcessHeap(), 0, sizeof(DWP) + (count-1)*sizeof(WINDOWPOS) );
     1194    if(count == 0)
     1195        count = 8;  // change to any non-zero value
     1196
     1197    handle = (HDWP)HeapAlloc(GetProcessHeap(), 0, sizeof(DWP) + (count-1)*sizeof(WINDOWPOS));
    11941198    if (!handle)
    11951199        return 0;
     
    12051209/***********************************************************************
    12061210 *           DeferWindowPos   (USER32.128)
     1211 *
     1212 * TODO: SvL: Does this need to be thread safe?
     1213 *
    12071214 */
    12081215HDWP WIN32API DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
     
    12821289    if (pDWP->actualCount >= pDWP->suggestedCount)
    12831290    {
     1291        //DWP structure already contains WINDOWPOS, allocated with (count-1)
     1292        //in BeginDeferWindowPos; pDWP->suggestedCount alloc increases it by one
    12841293        newhdwp = (HDWP)HeapReAlloc(GetProcessHeap(), 0, (LPVOID)hdwp,
    12851294                                    sizeof(DWP) + pDWP->suggestedCount*sizeof(WINDOWPOS));
Note: See TracChangeset for help on using the changeset viewer.