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
e083dc83
Commit
e083dc83
authored
May 15, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
May 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Handle NULL return icon parameters in SHDefExtractIcon.
parent
5a28d37f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
iconcache.c
dlls/shell32/iconcache.c
+8
-2
shelllink.c
dlls/shell32/tests/shelllink.c
+32
-0
No files found.
dlls/shell32/iconcache.c
View file @
e083dc83
...
...
@@ -817,8 +817,14 @@ HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
if
(
ret
==
0xFFFFFFFF
)
return
E_FAIL
;
if
(
ret
>
0
)
{
*
phiconLarge
=
hIcons
[
0
];
*
phiconSmall
=
hIcons
[
1
];
if
(
phiconLarge
)
*
phiconLarge
=
hIcons
[
0
];
else
DestroyIcon
(
hIcons
[
0
]);
if
(
phiconSmall
)
*
phiconSmall
=
hIcons
[
1
];
else
DestroyIcon
(
hIcons
[
1
]);
return
S_OK
;
}
return
S_FALSE
;
...
...
dlls/shell32/tests/shelllink.c
View file @
e083dc83
...
...
@@ -40,10 +40,12 @@
typedef
void
(
WINAPI
*
fnILFree
)(
LPITEMIDLIST
);
typedef
BOOL
(
WINAPI
*
fnILIsEqual
)(
LPCITEMIDLIST
,
LPCITEMIDLIST
);
typedef
HRESULT
(
WINAPI
*
fnSHILCreateFromPath
)(
LPCWSTR
,
LPITEMIDLIST
*
,
DWORD
*
);
typedef
HRESULT
(
WINAPI
*
fnSHDefExtractIconA
)(
LPCSTR
,
int
,
UINT
,
HICON
*
,
HICON
*
,
UINT
);
static
fnILFree
pILFree
;
static
fnILIsEqual
pILIsEqual
;
static
fnSHILCreateFromPath
pSHILCreateFromPath
;
static
fnSHDefExtractIconA
pSHDefExtractIconA
;
static
DWORD
(
WINAPI
*
pGetLongPathNameA
)(
LPCSTR
,
LPSTR
,
DWORD
);
...
...
@@ -708,6 +710,34 @@ static void test_datalink(void)
IShellLinkW_Release
(
sl
);
}
static
void
test_shdefextracticon
(
void
)
{
HICON
hiconlarge
=
NULL
,
hiconsmall
=
NULL
;
HRESULT
res
;
if
(
!
pSHDefExtractIconA
)
{
win_skip
(
"SHDefExtractIconA is unavailable
\n
"
);
return
;
}
res
=
pSHDefExtractIconA
(
"shell32.dll"
,
0
,
0
,
&
hiconlarge
,
&
hiconsmall
,
MAKELONG
(
16
,
24
));
ok
(
SUCCEEDED
(
res
),
"SHDefExtractIconA failed, res=%x
\n
"
,
res
);
ok
(
hiconlarge
!=
NULL
,
"got null hiconlarge
\n
"
);
ok
(
hiconsmall
!=
NULL
,
"got null hiconsmall
\n
"
);
DestroyIcon
(
hiconlarge
);
DestroyIcon
(
hiconsmall
);
hiconsmall
=
NULL
;
res
=
pSHDefExtractIconA
(
"shell32.dll"
,
0
,
0
,
NULL
,
&
hiconsmall
,
MAKELONG
(
16
,
24
));
ok
(
SUCCEEDED
(
res
),
"SHDefExtractIconA failed, res=%x
\n
"
,
res
);
ok
(
hiconsmall
!=
NULL
,
"got null hiconsmall
\n
"
);
DestroyIcon
(
hiconsmall
);
res
=
pSHDefExtractIconA
(
"shell32.dll"
,
0
,
0
,
NULL
,
NULL
,
MAKELONG
(
16
,
24
));
ok
(
SUCCEEDED
(
res
),
"SHDefExtractIconA failed, res=%x
\n
"
,
res
);
}
START_TEST
(
shelllink
)
{
HRESULT
r
;
...
...
@@ -717,6 +747,7 @@ START_TEST(shelllink)
pILFree
=
(
fnILFree
)
GetProcAddress
(
hmod
,
(
LPSTR
)
155
);
pILIsEqual
=
(
fnILIsEqual
)
GetProcAddress
(
hmod
,
(
LPSTR
)
21
);
pSHILCreateFromPath
=
(
fnSHILCreateFromPath
)
GetProcAddress
(
hmod
,
(
LPSTR
)
28
);
pSHDefExtractIconA
=
(
fnSHDefExtractIconA
)
GetProcAddress
(
hmod
,
"SHDefExtractIconA"
);
pGetLongPathNameA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetLongPathNameA"
);
...
...
@@ -728,6 +759,7 @@ START_TEST(shelllink)
test_get_set
();
test_load_save
();
test_datalink
();
test_shdefextracticon
();
CoUninitialize
();
}
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