mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
gdi.exe16: Fix some incorrect usage of NtGdiDdDDICreateDCFromMemory.
This commit is contained in:
parent
3a0376f8b5
commit
7292edaf55
1 changed files with 11 additions and 3 deletions
|
@ -1189,10 +1189,11 @@ HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
|
|||
D3DKMT_CREATEDCFROMMEMORY desc =
|
||||
{
|
||||
.Width = info->bmiHeader.biWidth,
|
||||
.Height = info->bmiHeader.biHeight,
|
||||
.Pitch = info->bmiHeader.biWidth * info->bmiHeader.biBitCount / 8,
|
||||
.Height = abs( info->bmiHeader.biHeight ),
|
||||
.Pitch = info->bmiHeader.biSizeImage / abs( info->bmiHeader.biHeight ),
|
||||
};
|
||||
struct saved_bitmap *bitmap;
|
||||
UINT status;
|
||||
int color;
|
||||
|
||||
if (info->bmiHeader.biBitCount <= 8)
|
||||
|
@ -1230,7 +1231,14 @@ HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
|
|||
desc.pMemory = &info->bmiColors[0];
|
||||
}
|
||||
|
||||
if (NtGdiDdDDICreateDCFromMemory( &desc )) return 0;
|
||||
if (!(desc.hDeviceDc = NtGdiCreateCompatibleDC( 0 ))) return 0;
|
||||
if ((status = NtGdiDdDDICreateDCFromMemory( &desc )))
|
||||
{
|
||||
NtGdiDeleteObjectApp( desc.hDeviceDc );
|
||||
ERR( "Failed to create HBITMAP over memory, status %#x\n", status );
|
||||
return 0;
|
||||
}
|
||||
NtGdiDeleteObjectApp( desc.hDeviceDc );
|
||||
|
||||
if ((bitmap = HeapAlloc( GetProcessHeap(), 0, sizeof(*bitmap) )))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue