mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
Check if dc has been created before using it.
This commit is contained in:
parent
d0cbe85d05
commit
578621349a
1 changed files with 7 additions and 7 deletions
|
@ -696,7 +696,6 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name,
|
|||
{
|
||||
WORD resid;
|
||||
HDC hdc;
|
||||
DC *dc;
|
||||
|
||||
if ( HIWORD(name) )
|
||||
{
|
||||
|
@ -714,12 +713,13 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name,
|
|||
}
|
||||
else resid = LOWORD(name);
|
||||
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
|
||||
dc = DC_GetDCPtr( hdc );
|
||||
if (dc->funcs->pLoadOEMResource)
|
||||
h = dc->funcs->pLoadOEMResource( resid, fCursor ?
|
||||
OEM_CURSOR : OEM_ICON );
|
||||
GDI_HEAP_UNLOCK( hdc );
|
||||
DeleteDC( hdc );
|
||||
if (hdc) {
|
||||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if (dc->funcs->pLoadOEMResource)
|
||||
h = dc->funcs->pLoadOEMResource( resid, fCursor ? OEM_CURSOR : OEM_ICON );
|
||||
GDI_HEAP_UNLOCK( hdc );
|
||||
DeleteDC( hdc );
|
||||
}
|
||||
}
|
||||
|
||||
else /* Load from resource */
|
||||
|
|
Loading…
Reference in a new issue