Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
25304d0a
Commit
25304d0a
authored
Dec 03, 2002
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Dec 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ANSI->Unicode calling for ExtractIconExA/W.
parent
a53a9881
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
40 deletions
+46
-40
iconcache.c
dlls/shell32/iconcache.c
+46
-40
No files found.
dlls/shell32/iconcache.c
View file @
25304d0a
...
...
@@ -402,56 +402,62 @@ HICON WINAPI ExtractIconExAW ( LPCVOID lpszFile, INT nIconIndex, HICON * phiconL
return
ExtractIconExW
(
lpszFile
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
return
ExtractIconExA
(
lpszFile
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
}
/*************************************************************************
* ExtractIconEx
A
[SHELL32.@]
* RETURNS
* ExtractIconEx
W
[SHELL32.@]
* RETURNS
:
* 0 no icon found
* 1 file is not valid
* HICON handle of a icon (phiconLarge/Small == NULL)
*/
HICON
WINAPI
ExtractIconExA
(
LPCSTR
lpszFile
,
INT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIcons
)
{
HICON
ret
=
0
;
TRACE
(
"file=%s idx=%i %p %p num=%i
\n
"
,
lpszFile
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
if
(
nIconIndex
==-
1
)
/* Number of icons requested */
return
(
HICON
)
PrivateExtractIconsA
(
lpszFile
,
-
1
,
0
,
0
,
NULL
,
0
,
0
,
0
);
if
(
phiconLarge
)
{
ret
=
(
HICON
)
PrivateExtractIconsA
(
lpszFile
,
nIconIndex
,
32
,
32
,
phiconLarge
,
0
,
nIcons
,
0
);
if
(
nIcons
==
1
)
{
ret
=
phiconLarge
[
0
];
}
}
/* if no pointers given and one icon expected, return the handle directly*/
if
(
!
phiconLarge
&&
!
phiconSmall
&&
nIcons
==
1
)
phiconSmall
=
&
ret
;
if
(
phiconSmall
)
{
ret
=
(
HICON
)
PrivateExtractIconsA
(
lpszFile
,
nIconIndex
,
16
,
16
,
phiconSmall
,
0
,
nIcons
,
0
);
if
(
nIcons
==
1
)
{
ret
=
phiconSmall
[
0
];
}
}
return
ret
;
HICON
WINAPI
ExtractIconExW
(
LPCWSTR
lpszFile
,
INT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIcons
)
{
HICON
ret
=
0
;
TRACE
(
"%s %i %p %p %i
\n
"
,
debugstr_w
(
lpszFile
),
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
if
(
phiconLarge
&&
!
phiconSmall
&&
nIconIndex
==
-
1
)
/* Number of icons requested */
return
(
HICON
)
PrivateExtractIconsW
(
lpszFile
,
0
,
0
,
0
,
NULL
,
NULL
,
0
,
0
);
if
(
phiconLarge
)
{
ret
=
(
HICON
)
PrivateExtractIconsW
(
lpszFile
,
nIconIndex
,
32
,
32
,
phiconLarge
,
NULL
,
nIcons
,
0
);
if
(
nIcons
==
1
)
{
ret
=
phiconLarge
[
0
];
}
}
/* if no pointers given and one icon expected, return the handle directly */
if
(
!
phiconLarge
&&
!
phiconSmall
&&
nIcons
==
1
)
phiconSmall
=
&
ret
;
if
(
phiconSmall
)
{
ret
=
(
HICON
)
PrivateExtractIconsW
(
lpszFile
,
nIconIndex
,
16
,
16
,
phiconSmall
,
NULL
,
nIcons
,
0
);
if
(
nIcons
==
1
)
{
ret
=
phiconSmall
[
0
];
}
}
return
ret
;
}
/*************************************************************************
* ExtractIconEx
W
[SHELL32.@]
* ExtractIconEx
A
[SHELL32.@]
*/
HICON
WINAPI
ExtractIconExW
(
LPCWSTR
lpszFile
,
INT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIcons
)
{
LPSTR
sFile
;
HICON
ret
;
HICON
WINAPI
ExtractIconExA
(
LPCSTR
lpszFile
,
INT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIcons
)
{
HICON
ret
;
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszFile
,
-
1
,
NULL
,
0
);
LPWSTR
lpwstrFile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
TRACE
(
"file=%s idx=%i %p %p num=%i
\n
"
,
debugstr_w
(
lpszFile
),
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
TRACE
(
"%s %i %p %p %i
\n
"
,
lpszFile
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
sFile
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
lpszFile
);
ret
=
ExtractIconExA
(
s
File
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
HeapFree
(
GetProcessHeap
(),
0
,
s
File
);
return
ret
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszFile
,
-
1
,
lpwstrFile
,
len
);
ret
=
ExtractIconExW
(
lpwstr
File
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIcons
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwstr
File
);
return
ret
;
}
/*************************************************************************
...
...
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