gdi32: Avoid a not necessary CreateDC call.

This commit is contained in:
Dmitry Timoshkov 2007-02-22 18:43:13 +08:00 committed by Alexandre Julliard
parent 826f89f5a7
commit aa3fa9a5d9
1 changed files with 2 additions and 4 deletions

View File

@ -96,13 +96,11 @@ HDC16 WINAPI WinGCreateDC16(void)
*/
BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
{
static const WCHAR szDisplayW[] = { 'D','I','S','P','L','A','Y','\0' };
HDC hdc;
TRACE("(%p)\n", bmpi);
if (!bmpi)
return FALSE;
hdc = CreateDCW( szDisplayW, NULL, NULL, NULL );
bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmpi->bmiHeader.biWidth = 320;
bmpi->bmiHeader.biHeight = -1;
@ -114,7 +112,7 @@ BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
bmpi->bmiHeader.biYPelsPerMeter = 0;
bmpi->bmiHeader.biClrUsed = 0;
bmpi->bmiHeader.biClrImportant = 0;
DeleteDC(hdc);
return TRUE;
}