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
1168b792
Commit
1168b792
authored
Mar 20, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Properly fail for unsupported interfaces in IShellView::GetItemObject.
parent
afb1a08b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
16 deletions
+68
-16
shlview.c
dlls/shell32/shlview.c
+26
-16
shlview.c
dlls/shell32/tests/shlview.c
+42
-0
No files found.
dlls/shell32/shlview.c
View file @
1168b792
...
...
@@ -1989,28 +1989,38 @@ static HRESULT WINAPI IShellView_fnSelectItem(
static
HRESULT
WINAPI
IShellView_fnGetItemObject
(
IShellView2
*
iface
,
UINT
uItem
,
REFIID
riid
,
LPVOID
*
ppvOut
)
{
IShellViewImpl
*
This
=
(
IShellViewImpl
*
)
iface
;
IShellViewImpl
*
This
=
(
IShellViewImpl
*
)
iface
;
HRESULT
hr
=
E_NOINTERFACE
;
TRACE
(
"(%p)->(uItem=0x%08x,
\n\t
IID=%s, ppv=
%p)
\n
"
,
This
,
uItem
,
debugstr_guid
(
riid
),
ppvOut
);
TRACE
(
"(%p)->(0x%08x, %s,
%p)
\n
"
,
This
,
uItem
,
debugstr_guid
(
riid
),
ppvOut
);
*
ppvOut
=
NULL
;
*
ppvOut
=
NULL
;
switch
(
uItem
)
{
case
SVGIO_BACKGROUND
:
*
ppvOut
=
ISvBgCm_Constructor
(
This
->
pSFParent
,
FALSE
);
break
;
switch
(
uItem
)
{
case
SVGIO_BACKGROUND
:
case
SVGIO_SELECTION
:
ShellView_GetSelections
(
This
);
IShellFolder_GetUIObjectOf
(
This
->
pSFParent
,
This
->
hWnd
,
This
->
cidl
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
riid
,
0
,
ppvOut
);
break
;
}
TRACE
(
"-- (%p)->(interface=%p)
\n
"
,
This
,
*
ppvOut
);
if
(
IsEqualIID
(
&
IID_IContextMenu
,
riid
))
{
*
ppvOut
=
ISvBgCm_Constructor
(
This
->
pSFParent
,
FALSE
);
hr
=
S_OK
;
}
else
FIXME
(
"unsupported interface requested %s
\n
"
,
debugstr_guid
(
riid
));
if
(
!*
ppvOut
)
return
E_OUTOFMEMORY
;
break
;
return
S_OK
;
case
SVGIO_SELECTION
:
ShellView_GetSelections
(
This
);
hr
=
IShellFolder_GetUIObjectOf
(
This
->
pSFParent
,
This
->
hWnd
,
This
->
cidl
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
riid
,
0
,
ppvOut
);
break
;
default:
FIXME
(
"unimplemented for uItem = 0x%08x
\n
"
,
uItem
);
}
TRACE
(
"-- (%p)->(interface=%p)
\n
"
,
This
,
*
ppvOut
);
return
hr
;
}
static
HRESULT
WINAPI
IShellView2_fnGetView
(
IShellView2
*
iface
,
SHELLVIEWID
*
view_guid
,
ULONG
view_type
)
...
...
dlls/shell32/tests/shlview.c
View file @
1168b792
...
...
@@ -36,6 +36,8 @@
#include "ocidl.h"
#include "oleauto.h"
#include "initguid.h"
#include "wine/test.h"
#include "msg.h"
...
...
@@ -43,6 +45,8 @@
#define LISTVIEW_SEQ_INDEX 0
#define NUM_MSG_SEQUENCES 1
DEFINE_GUID
(
IID_IPersistHistory
,
0x91a565c1
,
0xe38f
,
0x11d0
,
0x94
,
0xbf
,
0x00
,
0xa0
,
0xc9
,
0x05
,
0x5c
,
0xbf
);
static
struct
msg_sequence
*
sequences
[
NUM_MSG_SEQUENCES
];
static
LRESULT
WINAPI
listview_subclass_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -501,6 +505,43 @@ if (0)
IShellFolder_Release
(
desktop
);
}
static
void
test_GetItemObject
(
void
)
{
IShellFolder
*
desktop
;
IShellView
*
view
;
IUnknown
*
unk
;
HRESULT
hr
;
hr
=
SHGetDesktopFolder
(
&
desktop
);
ok
(
hr
==
S_OK
,
"got (0x%08x)
\n
"
,
hr
);
hr
=
IShellFolder_CreateViewObject
(
desktop
,
NULL
,
&
IID_IShellView
,
(
void
**
)
&
view
);
ok
(
hr
==
S_OK
,
"got (0x%08x)
\n
"
,
hr
);
/* from documentation three interfaces are supported for SVGIO_BACKGROUND:
IContextMenu, IDispatch, IPersistHistory */
hr
=
IShellView_GetItemObject
(
view
,
SVGIO_BACKGROUND
,
&
IID_IContextMenu
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"got (0x%08x)
\n
"
,
hr
);
IUnknown_Release
(
unk
);
unk
=
NULL
;
hr
=
IShellView_GetItemObject
(
view
,
SVGIO_BACKGROUND
,
&
IID_IDispatch
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOTIMPL
)
/* NT4 */
,
"got (0x%08x)
\n
"
,
hr
);
if
(
unk
)
IUnknown_Release
(
unk
);
unk
=
NULL
;
hr
=
IShellView_GetItemObject
(
view
,
SVGIO_BACKGROUND
,
&
IID_IPersistHistory
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOTIMPL
)
/* W9x, NT4 */
,
"got (0x%08x)
\n
"
,
hr
);
if
(
unk
)
IUnknown_Release
(
unk
);
/* example of unsupported interface, base for IPersistHistory */
hr
=
IShellView_GetItemObject
(
view
,
SVGIO_BACKGROUND
,
&
IID_IPersist
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
||
broken
(
hr
==
E_NOTIMPL
)
/* W2K */
,
"got (0x%08x)
\n
"
,
hr
);
IShellView_Release
(
view
);
IShellFolder_Release
(
desktop
);
}
START_TEST
(
shlview
)
{
OleInitialize
(
NULL
);
...
...
@@ -509,6 +550,7 @@ START_TEST(shlview)
test_IShellView_CreateViewWindow
();
test_IFolderView
();
test_GetItemObject
();
OleUninitialize
();
}
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