Ignore:
Timestamp:
Feb 12, 2004, 1:44:13 PM (22 years ago)
Author:
sandervl
Message:

PathToRegion failure bugfix + leak fixed; SelectClipPath can fail in printer DCs. Pretend success.

File:
1 edited

Legend:

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

    r10442 r10453  
    1 /* $Id: region.cpp,v 1.38 2004-02-10 15:35:39 sandervl Exp $ */
     1/* $Id: region.cpp,v 1.39 2004-02-12 12:44:13 sandervl Exp $ */
    22
    33/*
     
    20112011//Returned region in device coordinates (undocumented behaviour)
    20122012//******************************************************************************
    2013 HRGN WIN32API PathToRegion( HDC  hdc)
    2014 {
     2013HRGN WIN32API PathToRegion(HDC hdc)
     2014{
     2015    HRGN hrgn = 0, hrgnTemp = 0, hrgnwin = 0;
     2016
    20152017    pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
    20162018    if(!pHps)
     
    20202022        return NULLHANDLE;
    20212023    }
    2022 
    2023     HRGN hrgn, hrgnTemp, hrgnwin;
    2024 
    20252024    dprintf(("GDI32: PathToRegion %x", hdc));
    20262025
    20272026    hrgnTemp = GpiPathToRegion(pHps->hps, 1, (pHps->polyFillMode == ALTERNATE_W) ? FPATH_ALTERNATE : FPATH_WINDING);
    2028     if(hrgnTemp == NULLHANDLE)
     2027    if(hrgnTemp == NULLHANDLE) {
     2028        dprintf(("GpiPathToRegion failed with %x", WinGetLastError(0)));
    20292029        goto error;
     2030    }
    20302031
    20312032    hrgnwin = CreateRectRgn(1, 1, 2, 2);
     
    20482049        DeleteObject(hrgnwin);
    20492050
     2051    if(hrgnTemp)
     2052        GpiDestroyRegion(pHps->hps, hrgnTemp);
     2053
    20502054    SetLastError(ERROR_INVALID_HANDLE_W);       //todo right error
    20512055    return NULLHANDLE;
     
    20542058//Selects the current path as a clipping region for a device context, combining
    20552059//any existing clipping region by using the specified mode
    2056 //TODO: Can be emulated with SelectClipRegion??
    20572060//******************************************************************************
    20582061BOOL WIN32API SelectClipPath(HDC hdc, int iMode)
     
    20692072
    20702073    if(hrgn == NULLHANDLE || ret == FALSE) {
    2071         dprintf(("GDI32: SelectClipPath FAILED %x %d", hrgn, ret));
     2074        dprintf(("GDI32: SelectClipPath FAILED %x %d PRETEND success", hrgn, ret));
     2075        ret = TRUE;
    20722076    }
    20732077    return ret;
Note: See TracChangeset for help on using the changeset viewer.