This patch is wrong. (n=0; n++; but while(i)).

I have it already in my tree and will submit it with the next changes.

juergen


Date forwarded:         Mon, 13 Mar 2000 23:25:38 -0700
Date sent:              Tue, 14 Mar 2000 14:21:39 +0100
From:                   Marcus Meissner <[EMAIL PROTECTED]>
To:                     Alexandre Julliard <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED]
Subject:                COREL: iconcache undoc. feature
Forwarded by:           [EMAIL PROTECTED]
Send reply to:          [EMAIL PROTECTED]

> Hi,
> 
> Have no testcase, but it looks good and appears to be needed & tested.
> 
> Ciao, Marcus
> 
> Changelog:
> Francois Boisvert <[EMAIL PROTECTED]>
> With this patch correct icons will be displayed for the Corel files.
> The problem was that ExtractIcon was not supporting negative icon index
> when the source was a dll.
> 
> Index: iconcache.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/shell32/iconcache.c,v
> retrieving revision 1.34
> diff -u -r1.34 iconcache.c
> --- iconcache.c       2000/02/29 22:06:06     1.34
> +++ iconcache.c       2000/03/14 05:48:02
> @@ -210,7 +210,7 @@
>   * returns
>   *  failure:0; success: icon handle or nr of icons (nIconIndex-1)
>   */
> -HICON WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT 
>nIconIndex, UINT n, UINT cxDesired, UINT cyDesired )
> +HICON WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, INT 
>nIconIndex, UINT n, UINT cxDesired, UINT cyDesired )
>  {    HGLOBAL         hRet = 0;
>       LPBYTE          pData;
>       OFSTRUCT        ofs;
> @@ -357,6 +357,28 @@
>         { hRet = iconDirCount;
>           goto end_3;         /* success */
>         }
> +
> +      /* if nIconIndex is negative we have to extract the icon whose resource
> +         id is equal to the absolute value of nIconIndex */
> +      if( nIconIndex < 0 )
> +      {
> +          int n = 0;
> +          int iId = abs(nIconIndex);
> +          PIMAGE_RESOURCE_DIRECTORY_ENTRY xprdeTmp = 
>(PIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1);
> +          nIconIndex = iconDirCount + 1; /* Initialise to get an error at 
> +                                            the condition nIconIndex >= 
>iconDirCount 
> +                                            below if nothing is found */          
> +          while(i<iconDirCount && xprdeTmp)
> +          {              
> +              if(xprdeTmp->u1.Id ==  iId)
> +              {
> +                  nIconIndex = n;
> +                  break;
> +              }
> +              n++;
> +              xprdeTmp++;                  
> +          }
> +      }
>  
>         if (nIconIndex >= iconDirCount) 
>         { WARN("nIconIndex %d is larger than iconDirCount 
>%d\n",nIconIndex,iconDirCount);
> 
> 
> 



---
[EMAIL PROTECTED]

... from sunny Berlin

Reply via email to