Ignore:
Timestamp:
Mar 16, 2000, 8:18:14 PM (25 years ago)
Author:
sandervl
Message:

CreateDIBSection fix (hdc==0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibitmap.cpp

    r2802 r3126  
    1 /* $Id: dibitmap.cpp,v 1.4 2000-02-16 14:18:09 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.5 2000-03-16 19:18:14 sandervl Exp $ */
    22
    33/*
     
    4848//******************************************************************************
    4949//******************************************************************************
    50 HBITMAP WIN32API CreateCompatibleBitmap( HDC arg1, int arg2, int  arg3)
    51 {
    52     dprintf(("GDI32: CreateCompatibleBitmap\n"));
    53     return O32_CreateCompatibleBitmap(arg1, arg2, arg3);
     50HBITMAP WIN32API CreateCompatibleBitmap( HDC hdc, int nWidth, int nHeight)
     51{
     52    dprintf(("GDI32: CreateCompatibleBitmap %x (%d,%d)", hdc, nWidth, nHeight));
     53    return O32_CreateCompatibleBitmap(hdc, nWidth, nHeight);
    5454}
    5555//******************************************************************************
     
    8787 BOOL    fFlip = 0;
    8888 int     iHeight, iWidth;
     89 BOOL    fCreateDC = FALSE;
    8990
    9091  dprintf(("GDI32: CreateDIBSection %x %x %x %x %d", hdc, iUsage, ppvBits, hSection, dwOffset));
     
    106107  }
    107108
     109  //SvL: RP7 (update) calls this api with hdc == 0
     110  if(hdc == 0) {
     111        hdc = GetWindowDC(GetDesktopWindow());
     112        fCreateDC = TRUE;
     113  }
    108114  res = O32_CreateDIBitmap(hdc, &pbmi->bmiHeader, 0, NULL, pbmi, iUsage);
    109115  if (res)
     
    150156      pbmi->bmiHeader.biHeight = iHeight;
    151157
     158      if(fCreateDC)     ReleaseDC(GetDesktopWindow(), hdc);
    152159      return(res);
    153160    }
    154161  }
     162  if(fCreateDC) ReleaseDC(GetDesktopWindow(), hdc);
    155163
    156164  /* Error.  */
Note: See TracChangeset for help on using the changeset viewer.