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
bc5d5d6b
Commit
bc5d5d6b
authored
Dec 12, 2002
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Dec 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shell32.ExtractIcon with A->W and 16 -> 32 calls.
parent
eddf9a02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
27 deletions
+32
-27
shell32_main.c
dlls/shell32/shell32_main.c
+32
-27
No files found.
dlls/shell32/shell32_main.c
View file @
bc5d5d6b
...
...
@@ -540,41 +540,46 @@ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon)
/*************************************************************************
* ExtractIconA [SHELL32.@]
*
* FIXME
* if the filename is not a file return 1
*/
HICON
WINAPI
ExtractIconA
(
HINSTANCE
hInstance
,
LPCSTR
lpszExeFileName
,
UINT
nIconIndex
)
{
HGLOBAL16
handle
=
InternalExtractIcon16
(
HINSTANCE_16
(
hInstance
),
lpszExeFileName
,
nIconIndex
,
1
);
TRACE
(
"
\n
"
);
if
(
handle
)
{
HICON16
*
ptr
=
(
HICON16
*
)
GlobalLock16
(
handle
);
HICON16
hIcon
=
*
ptr
;
GlobalFree16
(
handle
);
return
HICON_32
(
hIcon
);
}
return
0
;
HICON
WINAPI
ExtractIconA
(
HINSTANCE
hInstance
,
LPCSTR
lpszFile
,
UINT
nIconIndex
)
{
HICON
ret
;
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszFile
,
-
1
,
NULL
,
0
);
LPWSTR
lpwstrFile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
TRACE
(
"%p %s %d
\n
"
,
hInstance
,
lpszFile
,
nIconIndex
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszFile
,
-
1
,
lpwstrFile
,
len
);
ret
=
ExtractIconW
(
hInstance
,
lpwstrFile
,
nIconIndex
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwstrFile
);
return
ret
;
}
/*************************************************************************
* ExtractIconW [SHELL32.@]
*
* FIXME: if the filename is not a file return 1
*/
HICON
WINAPI
ExtractIconW
(
HINSTANCE
hInstance
,
LPCWSTR
lpszExeFileName
,
UINT
nIconIndex
)
{
LPSTR
exefn
;
HICON
ret
;
TRACE
(
"
\n
"
);
HICON
WINAPI
ExtractIconW
(
HINSTANCE
hInstance
,
LPCWSTR
lpszFile
,
UINT
nIconIndex
)
{
HICON
hIcon
=
NULL
;
UINT
ret
;
UINT
cx
=
GetSystemMetrics
(
SM_CXICON
),
cy
=
GetSystemMetrics
(
SM_CYICON
);
exefn
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
lpszExeFileName
);
ret
=
ExtractIconA
(
hInstance
,
exefn
,
nIconIndex
);
TRACE
(
"%p %s %d
\n
"
,
hInstance
,
debugstr_w
(
lpszFile
),
nIconIndex
);
HeapFree
(
GetProcessHeap
(),
0
,
exefn
);
return
ret
;
if
(
nIconIndex
==
-
1
)
{
ret
=
PrivateExtractIconsW
(
lpszFile
,
0
,
cx
,
cy
,
NULL
,
NULL
,
0
,
LR_DEFAULTCOLOR
);
if
(
ret
!=
0xFFFFFFFF
&&
ret
)
return
(
HICON
)
ret
;
return
NULL
;
}
else
ret
=
PrivateExtractIconsW
(
lpszFile
,
nIconIndex
,
cx
,
cy
,
&
hIcon
,
NULL
,
1
,
LR_DEFAULTCOLOR
);
if
(
ret
==
0xFFFFFFFF
)
return
(
HICON
)
1
;
else
if
(
ret
>
0
&&
hIcon
)
return
hIcon
;
return
NULL
;
}
typedef
struct
...
...
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