Ignore:
Timestamp:
Nov 9, 2000, 7:16:57 PM (25 years ago)
Author:
sandervl
Message:

DeleteDC + CreateDIBSection fixes

File:
1 edited

Legend:

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

    r4557 r4574  
    1 /* $Id: gdi32.cpp,v 1.59 2000-11-05 18:48:21 sandervl Exp $ */
     1/* $Id: gdi32.cpp,v 1.60 2000-11-09 18:16:57 sandervl Exp $ */
    22
    33/*
     
    2222#include "oslibgpi.h"
    2323#include "oslibgdi.h"
     24#include <dcdata.h>
     25#include <win32wnd.h>
    2426
    2527#define DBG_LOCALLOG    DBG_gdi32
     
    8587//******************************************************************************
    8688//******************************************************************************
    87 ODINFUNCTION1(BOOL, DeleteDC, HDC, hdc)
    88 {
    89   return O32_DeleteDC(hdc);
    90 }
    91 //******************************************************************************
    92 //******************************************************************************
    9389HBRUSH WIN32API CreatePatternBrush(HBITMAP arg1)
    9490{
     
    137133    dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc));
    138134    return newHdc;
     135}
     136//******************************************************************************
     137//******************************************************************************
     138ODINFUNCTION1(BOOL, DeleteDC, HDC, hdc)
     139{
     140  pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
     141  if(!pHps)
     142  {
     143      dprintf(("WARNING: DeleteDC %x; invalid hdc!", hdc));
     144      SetLastError(ERROR_INVALID_HANDLE);
     145      return 0;
     146  }
     147  SetLastError(ERROR_SUCCESS);
     148  //Must call ReleaseDC for window dcs
     149  if(pHps->hdcType == TYPE_1) {
     150      return ReleaseDC(OS2ToWin32Handle(pHps->hwnd), hdc);
     151  }
     152
     153  return O32_DeleteDC(hdc);
    139154}
    140155//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.