Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
12aae27a
Commit
12aae27a
authored
Apr 28, 2000
by
Juergen Schmied
Committed by
Alexandre Julliard
Apr 28, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: extract the icon by resource id.
parent
1b4f5bb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
iconcache.c
dlls/shell32/iconcache.c
+36
-5
No files found.
dlls/shell32/iconcache.c
View file @
12aae27a
...
...
@@ -21,6 +21,8 @@
#include "shellapi.h"
#include "pidl.h"
#include "shell32_main.h"
#include "wine/undocshell.h"
#include "shlwapi.h"
DEFAULT_DEBUG_CHANNEL
(
shell
)
...
...
@@ -210,7 +212,7 @@ static BYTE * ICO_GetIconDirectory( HFILE hFile, LPicoICONDIR* lplpiID, ULONG *u
* returns
* failure:0; success: icon handle or nr of icons (nIconIndex-1)
*/
HICON
WINAPI
ICO_ExtractIconEx
(
LPCSTR
lpszExeFileName
,
HICON
*
RetPtr
,
U
INT
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
;
...
...
@@ -358,8 +360,34 @@ HICON WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nIco
goto
end_3
;
/* success */
}
/* (nIconIndex < 0): extract the icon by resource id */
if
(
nIconIndex
<
0
)
{
int
n
=
0
;
int
iId
=
abs
(
nIconIndex
);
PIMAGE_RESOURCE_DIRECTORY_ENTRY
xprdeTmp
=
(
PIMAGE_RESOURCE_DIRECTORY_ENTRY
)(
icongroupresdir
+
1
);
while
(
n
<
iconDirCount
&&
xprdeTmp
)
{
if
(
xprdeTmp
->
u1
.
Id
==
iId
)
{
nIconIndex
=
n
;
break
;
}
n
++
;
xprdeTmp
++
;
}
if
(
nIconIndex
<
0
)
{
WARN
(
"resource id %d not found
\n
"
,
iId
);
goto
end_3
;
/* failure */
}
}
/* check nIconIndex to be in range */
if
(
nIconIndex
>=
iconDirCount
)
{
WARN
(
"nIconIndex %d is larger than iconDirCount %d
\n
"
,
nIconIndex
,
iconDirCount
);
{
WARN
(
"nIconIndex %d is larger than iconDirCount %d
\n
"
,
nIconIndex
,
iconDirCount
);
goto
end_3
;
/* failure */
}
...
...
@@ -484,7 +512,7 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc
lpsice
=
(
LPSIC_ENTRY
)
SHAlloc
(
sizeof
(
SIC_ENTRY
));
lpsice
->
sSourceFile
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
PathFindFile
n
ameA
(
sSourceFile
));
lpsice
->
sSourceFile
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
PathFindFile
N
ameA
(
sSourceFile
));
lpsice
->
dwSourceIndex
=
dwSourceIndex
;
EnterCriticalSection
(
&
SHELL32_SicCS
);
...
...
@@ -549,7 +577,7 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
TRACE
(
"%s %i
\n
"
,
sSourceFile
,
dwSourceIndex
);
sice
.
sSourceFile
=
PathFindFile
n
ameA
(
sSourceFile
);
sice
.
sSourceFile
=
PathFindFile
N
ameA
(
sSourceFile
);
sice
.
dwSourceIndex
=
dwSourceIndex
;
EnterCriticalSection
(
&
SHELL32_SicCS
);
...
...
@@ -741,7 +769,10 @@ BOOL PidlToSicIndex (
* pIndex [OUT][OPTIONAL] SIC index for big icon
*
*/
UINT
WINAPI
SHMapPIDLToSystemImageListIndex
(
LPSHELLFOLDER
sh
,
LPITEMIDLIST
pidl
,
UINT
*
pIndex
)
int
WINAPI
SHMapPIDLToSystemImageListIndex
(
LPSHELLFOLDER
sh
,
LPCITEMIDLIST
pidl
,
UINT
*
pIndex
)
{
UINT
Index
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment