mirror of
https://github.com/reactos/reactos.git
synced 2025-07-12 18:04:13 +00:00
Fixing two fail from wine gdi32 test, When HDC is NULL to NtGdiCreateDIBitmap we need create a hdc and delete the hdc when we are done.
svn path=/trunk/; revision=22010
This commit is contained in:
parent
8954d82145
commit
050efa1da2
1 changed files with 32 additions and 8 deletions
|
@ -759,16 +759,40 @@ HBITMAP STDCALL NtGdiCreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header,
|
||||||
PDC Dc;
|
PDC Dc;
|
||||||
HBITMAP Bmp;
|
HBITMAP Bmp;
|
||||||
|
|
||||||
Dc = DC_LockDc(hDc);
|
|
||||||
if (NULL == Dc)
|
if (NULL == hDc)
|
||||||
{
|
{
|
||||||
|
hDc = IntGdiCreateDC(NULL, NULL, NULL, NULL,FALSE);
|
||||||
|
if (hDc == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
Dc = DC_LockDc(hDc);
|
||||||
|
if (Dc == NULL)
|
||||||
|
{
|
||||||
|
NtGdiDeleteObjectApp(hDc);
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
||||||
|
|
||||||
DC_UnlockDc(Dc);
|
DC_UnlockDc(Dc);
|
||||||
|
NtGdiDeleteObjectApp(hDc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Dc = DC_LockDc(hDc);
|
||||||
|
if (Dc == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
||||||
|
DC_UnlockDc(Dc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Bmp;
|
return Bmp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue