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
308a5ff7
Commit
308a5ff7
authored
Feb 18, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add IObjectWithSite stub for context menus.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
408f856f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
shlview_cmenu.c
dlls/shell32/shlview_cmenu.c
+57
-0
shlfolder.c
dlls/shell32/tests/shlfolder.c
+0
-2
No files found.
dlls/shell32/shlview_cmenu.c
View file @
308a5ff7
...
...
@@ -46,6 +46,7 @@ typedef struct
{
IContextMenu3
IContextMenu3_iface
;
IShellExtInit
IShellExtInit_iface
;
IObjectWithSite
IObjectWithSite_iface
;
LONG
ref
;
IShellFolder
*
parent
;
...
...
@@ -70,6 +71,11 @@ static inline ContextMenu *impl_from_IShellExtInit(IShellExtInit *iface)
return
CONTAINING_RECORD
(
iface
,
ContextMenu
,
IShellExtInit_iface
);
}
static
inline
ContextMenu
*
impl_from_IObjectWithSite
(
IObjectWithSite
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ContextMenu
,
IObjectWithSite_iface
);
}
static
HRESULT
WINAPI
ContextMenu_QueryInterface
(
IContextMenu3
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ContextMenu
*
This
=
impl_from_IContextMenu3
(
iface
);
...
...
@@ -89,6 +95,10 @@ static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID ri
{
*
ppvObj
=
&
This
->
IShellExtInit_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IObjectWithSite
))
{
*
ppvObj
=
&
This
->
IObjectWithSite_iface
;
}
if
(
*
ppvObj
)
{
...
...
@@ -622,6 +632,51 @@ static const IShellExtInitVtbl ShellExtInitVtbl =
ShellExtInit_Initialize
};
static
HRESULT
WINAPI
ObjectWithSite_QueryInterface
(
IObjectWithSite
*
iface
,
REFIID
riid
,
void
**
obj
)
{
ContextMenu
*
This
=
impl_from_IObjectWithSite
(
iface
);
return
IContextMenu3_QueryInterface
(
&
This
->
IContextMenu3_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
ObjectWithSite_AddRef
(
IObjectWithSite
*
iface
)
{
ContextMenu
*
This
=
impl_from_IObjectWithSite
(
iface
);
return
IContextMenu3_AddRef
(
&
This
->
IContextMenu3_iface
);
}
static
ULONG
WINAPI
ObjectWithSite_Release
(
IObjectWithSite
*
iface
)
{
ContextMenu
*
This
=
impl_from_IObjectWithSite
(
iface
);
return
IContextMenu3_Release
(
&
This
->
IContextMenu3_iface
);
}
static
HRESULT
WINAPI
ObjectWithSite_SetSite
(
IObjectWithSite
*
iface
,
IUnknown
*
site
)
{
ContextMenu
*
This
=
impl_from_IObjectWithSite
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
site
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ObjectWithSite_GetSite
(
IObjectWithSite
*
iface
,
REFIID
riid
,
void
**
site
)
{
ContextMenu
*
This
=
impl_from_IObjectWithSite
(
iface
);
FIXME
(
"(%p)->(%s %p): stub
\n
"
,
This
,
debugstr_guid
(
riid
),
site
);
return
E_NOTIMPL
;
}
static
const
IObjectWithSiteVtbl
ObjectWithSiteVtbl
=
{
ObjectWithSite_QueryInterface
,
ObjectWithSite_AddRef
,
ObjectWithSite_Release
,
ObjectWithSite_SetSite
,
ObjectWithSite_GetSite
,
};
HRESULT
ItemMenu_Constructor
(
IShellFolder
*
parent
,
LPCITEMIDLIST
pidl
,
const
LPCITEMIDLIST
*
apidl
,
UINT
cidl
,
REFIID
riid
,
void
**
pObj
)
{
...
...
@@ -634,6 +689,7 @@ HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPC
This
->
IContextMenu3_iface
.
lpVtbl
=
&
ItemContextMenuVtbl
;
This
->
IShellExtInit_iface
.
lpVtbl
=
&
ShellExtInitVtbl
;
This
->
IObjectWithSite_iface
.
lpVtbl
=
&
ObjectWithSiteVtbl
;
This
->
ref
=
1
;
This
->
parent
=
parent
;
if
(
parent
)
IShellFolder_AddRef
(
parent
);
...
...
@@ -943,6 +999,7 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri
This
->
IContextMenu3_iface
.
lpVtbl
=
&
BackgroundContextMenuVtbl
;
This
->
IShellExtInit_iface
.
lpVtbl
=
&
ShellExtInitVtbl
;
This
->
IObjectWithSite_iface
.
lpVtbl
=
&
ObjectWithSiteVtbl
;
This
->
ref
=
1
;
This
->
parent
=
parent
;
...
...
dlls/shell32/tests/shlfolder.c
View file @
308a5ff7
...
...
@@ -4358,9 +4358,7 @@ static void test_contextmenu(IContextMenu *menu, BOOL background)
IUnknown_Release
(
unk
);
hr
=
IContextMenu_QueryInterface
(
menu
,
&
IID_IObjectWithSite
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to get IShellExtInit, hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IUnknown_Release
(
unk
);
hr
=
IContextMenu_QueryContextMenu
(
menu
,
hmenu
,
0
,
baseItem
,
id_upper_limit
,
CMF_NORMAL
);
...
...
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