Clean up CURSORICON_Load.

This commit is contained in:
Mike McCormack 2005-07-12 20:23:18 +00:00 committed by Alexandre Julliard
parent 4b9f3728e0
commit 8c64ebc963
1 changed files with 39 additions and 45 deletions

View File

@ -919,21 +919,16 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
{ {
HANDLE handle = 0; HANDLE handle = 0;
HICON hIcon = 0; HICON hIcon = 0;
HRSRC hRsrc; HRSRC hRsrc, hGroupRsrc;
CURSORICONDIR *dir; CURSORICONDIR *dir;
CURSORICONDIRENTRY *dirEntry; CURSORICONDIRENTRY *dirEntry;
LPBYTE bits; LPBYTE bits;
if ( loadflags & LR_LOADFROMFILE ) /* Load from file */
{
hIcon = CURSORICON_LoadFromFile( name, width, height, colors, fCursor, loadflags );
}
else /* Load from resource */
{
HRSRC hGroupRsrc;
WORD wResId; WORD wResId;
DWORD dwBytesInRes; DWORD dwBytesInRes;
if ( loadflags & LR_LOADFROMFILE ) /* Load from file */
return CURSORICON_LoadFromFile( name, width, height, colors, fCursor, loadflags );
if (!hInstance) hInstance = user32_module; /* Load OEM cursor/icon */ if (!hInstance) hInstance = user32_module; /* Load OEM cursor/icon */
/* Normalize hInstance (must be uniquely represented for icon cache) */ /* Normalize hInstance (must be uniquely represented for icon cache) */
@ -981,7 +976,6 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
if ( hIcon && (loadflags & LR_SHARED) ) if ( hIcon && (loadflags & LR_SHARED) )
CURSORICON_AddSharedIcon( hInstance, hRsrc, hGroupRsrc, hIcon ); CURSORICON_AddSharedIcon( hInstance, hRsrc, hGroupRsrc, hIcon );
}
return hIcon; return hIcon;
} }