From 4493a74c2325de72b375bcd6ae8a4d8ff7b4a4e3 Mon Sep 17 00:00:00 2001 From: Juergen Schmied Date: Mon, 30 Nov 1998 17:29:28 +0000 Subject: [PATCH] Load now the first icon from the *.ani file instead of crashing. --- objects/cursoricon.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/objects/cursoricon.c b/objects/cursoricon.c index 2fb2914883a..30a8870f807 100644 --- a/objects/cursoricon.c +++ b/objects/cursoricon.c @@ -227,6 +227,29 @@ BOOL32 CURSORICON_SimulateLoadingFromResourceW( LPWSTR filename, BOOL32 fCursor, *res = NULL; *ptr = NULL; if (!(bits = (CURSORICONFILEDIR *)VIRTUAL_MapFileW( filename ))) return FALSE; + + /* FIXME: test for inimated icons + * hack to load the first icon from the *.ani file + */ + if ( *(LPDWORD)bits==0x46464952 ) /* "RIFF" */ + { LPBYTE pos = (LPBYTE) bits; + FIXME (cursor,"Animated icons not correctly implemented! %p \n", bits); + + for (;;) + { if (*(LPDWORD)pos==0x6e6f6369) /* "icon" */ + { FIXME (cursor,"icon entry found! %p\n", bits); + pos+=4; + if ( !*(LPWORD) pos==0x2fe) /* iconsize */ + { goto fail; + } + bits+=2; + FIXME (cursor,"icon size ok %p \n", bits); + break; + } + pos+=2; + if (pos>=(LPBYTE)bits+766) goto fail; + } + } if (!(entries = bits->idCount)) goto fail; (int)_free = size = sizeof(CURSORICONDIR) + sizeof(CURSORICONDIRENTRY) * (entries - 1);