forked from Mirrors/wine-wine
Check if dc has been created before using it.
parent
d0cbe85d05
commit
578621349a
|
@ -696,7 +696,6 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name,
|
||||||
{
|
{
|
||||||
WORD resid;
|
WORD resid;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
DC *dc;
|
|
||||||
|
|
||||||
if ( HIWORD(name) )
|
if ( HIWORD(name) )
|
||||||
{
|
{
|
||||||
|
@ -714,12 +713,13 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name,
|
||||||
}
|
}
|
||||||
else resid = LOWORD(name);
|
else resid = LOWORD(name);
|
||||||
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
|
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
|
||||||
dc = DC_GetDCPtr( hdc );
|
if (hdc) {
|
||||||
if (dc->funcs->pLoadOEMResource)
|
DC *dc = DC_GetDCPtr( hdc );
|
||||||
h = dc->funcs->pLoadOEMResource( resid, fCursor ?
|
if (dc->funcs->pLoadOEMResource)
|
||||||
OEM_CURSOR : OEM_ICON );
|
h = dc->funcs->pLoadOEMResource( resid, fCursor ? OEM_CURSOR : OEM_ICON );
|
||||||
GDI_HEAP_UNLOCK( hdc );
|
GDI_HEAP_UNLOCK( hdc );
|
||||||
DeleteDC( hdc );
|
DeleteDC( hdc );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else /* Load from resource */
|
else /* Load from resource */
|
||||||
|
|
Loading…
Reference in New Issue