Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jason Beetham
wine
Commits
12aae27a
Commit
12aae27a
authored
24 years ago
by
Juergen Schmied
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed: extract the icon by resource id.
parent
1b4f5bb2
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/shell32/iconcache.c
+36
-5
36 additions, 5 deletions
dlls/shell32/iconcache.c
with
36 additions
and
5 deletions
dlls/shell32/iconcache.c
+
36
−
5
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment