mirror of
https://github.com/reactos/reactos.git
synced 2024-08-01 09:01: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
|
@ -758,17 +758,41 @@ HBITMAP STDCALL NtGdiCreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header,
|
|||
{
|
||||
PDC Dc;
|
||||
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);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
||||
DC_UnlockDc(Dc);
|
||||
NtGdiDeleteObjectApp(hDc);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
Dc = DC_LockDc(hDc);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
||||
DC_UnlockDc(Dc);
|
||||
}
|
||||
|
||||
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
||||
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
|
||||
return Bmp;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue