Alexandre Julliard : oleaut32: Properly release cache DCs instead of trying to delete them.
Alexandre Julliard
julliard at winehq.org
Wed Jul 1 09:28:10 CDT 2009
Module: wine
Branch: master
Commit: 70e4611e733029964fba040c768158b58008069c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=70e4611e733029964fba040c768158b58008069c
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Jul 1 12:07:35 2009 +0200
oleaut32: Properly release cache DCs instead of trying to delete them.
---
dlls/oleaut32/olepicture.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 4409a15..54baf12 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -1232,7 +1232,6 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
if (pixel == (transparent & 0x000000FFU)) monoPointer[j >> 3] |= 1 << (7 - (j & 7));
}
}
- hdcref = GetDC(0);
hTempMask = CreateDIBitmap(
hdcref,
&bmi->bmiHeader,
@@ -1241,7 +1240,6 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
bmi,
DIB_RGB_COLORS
);
- DeleteDC(hdcref);
bmi->bmiHeader.biHeight = -bmi->bmiHeader.biHeight;
This->hbmMask = CreateBitmap(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, 1, 1, NULL);
@@ -1266,7 +1264,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
DeleteObject(hTempMask);
}
- DeleteDC(hdcref);
+ ReleaseDC(0, hdcref);
This->desc.picType = PICTYPE_BITMAP;
OLEPictureImpl_SetBitmap(This);
DGifCloseFile(gif);
@@ -1369,7 +1367,7 @@ static HRESULT OLEPictureImpl_LoadJpeg(OLEPictureImpl *This, BYTE *xbuf, ULONG x
(BITMAPINFO*)&bmi,
DIB_RGB_COLORS
);
- DeleteDC(hdcref);
+ ReleaseDC(0, hdcref);
This->desc.picType = PICTYPE_BITMAP;
OLEPictureImpl_SetBitmap(This);
HeapFree(GetProcessHeap(),0,bits);
@@ -1398,7 +1396,7 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
bi,
DIB_RGB_COLORS
);
- DeleteDC(hdcref);
+ ReleaseDC(0, hdcref);
if (This->desc.u.bmp.hbitmap == 0)
return E_FAIL;
This->desc.picType = PICTYPE_BITMAP;
More information about the wine-cvs
mailing list