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
5f0d1a00
Commit
5f0d1a00
authored
Apr 21, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Apr 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Don't copy the imagelist in SHGetImageList().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9072dbd2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
10 deletions
+42
-10
shellord.c
dlls/shell32/shellord.c
+2
-10
shelllink.c
dlls/shell32/tests/shelllink.c
+40
-0
No files found.
dlls/shell32/shellord.c
View file @
5f0d1a00
...
...
@@ -2182,7 +2182,6 @@ HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
{
HIMAGELIST
hLarge
,
hSmall
;
HIMAGELIST
hNew
;
HRESULT
ret
=
E_FAIL
;
/* Wine currently only maintains large and small image lists */
if
((
iImageList
!=
SHIL_LARGE
)
&&
(
iImageList
!=
SHIL_SMALL
)
&&
(
iImageList
!=
SHIL_SYSSMALL
))
...
...
@@ -2192,16 +2191,9 @@ HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
}
Shell_GetImageLists
(
&
hLarge
,
&
hSmall
);
hNew
=
ImageList_Duplicate
(
iImageList
==
SHIL_LARGE
?
hLarge
:
hSmall
)
;
hNew
=
(
iImageList
==
SHIL_LARGE
)
?
hLarge
:
hSmall
;
/* Get the interface for the new image list */
if
(
hNew
)
{
ret
=
HIMAGELIST_QueryInterface
(
hNew
,
riid
,
ppv
);
ImageList_Destroy
(
hNew
);
}
return
ret
;
return
HIMAGELIST_QueryInterface
(
hNew
,
riid
,
ppv
);
}
/*************************************************************************
...
...
dlls/shell32/tests/shelllink.c
View file @
5f0d1a00
...
...
@@ -27,6 +27,7 @@
#include "shobjidl.h"
#include "shlobj.h"
#include "shellapi.h"
#include "commoncontrols.h"
#include "wine/test.h"
#include "shell32_test.h"
...
...
@@ -1303,6 +1304,44 @@ todo_wine {
DestroyIcon
(
hicon
);
}
static
void
test_SHGetImageList
(
void
)
{
HRESULT
hr
;
IImageList
*
list
,
*
list2
;
BOOL
ret
;
HIMAGELIST
lg
,
sm
;
ULONG
start_refs
,
refs
;
hr
=
SHGetImageList
(
SHIL_LARGE
,
&
IID_IImageList
,
(
void
**
)
&
list
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
start_refs
=
IImageList_AddRef
(
list
);
IImageList_Release
(
list
);
hr
=
SHGetImageList
(
SHIL_LARGE
,
&
IID_IImageList
,
(
void
**
)
&
list2
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
list
==
list2
,
"lists differ
\n
"
);
refs
=
IImageList_AddRef
(
list
);
IImageList_Release
(
list
);
ok
(
refs
==
start_refs
+
1
,
"got %d, start_refs %d
\n
"
,
refs
,
start_refs
);
IImageList_Release
(
list2
);
hr
=
SHGetImageList
(
SHIL_SMALL
,
&
IID_IImageList
,
(
void
**
)
&
list2
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ret
=
Shell_GetImageLists
(
&
lg
,
&
sm
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
lg
==
(
HIMAGELIST
)
list
,
"mismatch
\n
"
);
ok
(
sm
==
(
HIMAGELIST
)
list2
,
"mismatch
\n
"
);
/* Shell_GetImageLists doesn't take a reference */
refs
=
IImageList_AddRef
(
list
);
IImageList_Release
(
list
);
ok
(
refs
==
start_refs
,
"got %d, start_refs %d
\n
"
,
refs
,
start_refs
);
IImageList_Release
(
list2
);
IImageList_Release
(
list
);
}
START_TEST
(
shelllink
)
{
HRESULT
r
;
...
...
@@ -1333,6 +1372,7 @@ START_TEST(shelllink)
test_propertystore
();
test_ExtractIcon
();
test_ExtractAssociatedIcon
();
test_SHGetImageList
();
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