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
77c2892d
Commit
77c2892d
authored
May 10, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement FolderItemVerbs_get_Count().
parent
540171bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
8 deletions
+56
-8
shelldispatch.c
dlls/shell32/shelldispatch.c
+56
-6
shelldispatch.c
dlls/shell32/tests/shelldispatch.c
+0
-2
No files found.
dlls/shell32/shelldispatch.c
View file @
77c2892d
...
...
@@ -72,6 +72,9 @@ typedef struct {
typedef
struct
{
FolderItemVerbs
FolderItemVerbs_iface
;
LONG
ref
;
IContextMenu
*
menu
;
LONG
count
;
}
FolderItemVerbsImpl
;
static
inline
ShellDispatch
*
impl_from_IShellDispatch6
(
IShellDispatch6
*
iface
)
...
...
@@ -195,7 +198,10 @@ static ULONG WINAPI FolderItemVerbsImpl_Release(FolderItemVerbs *iface)
TRACE
(
"(%p), new refcount=%i
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
IContextMenu_Release
(
This
->
menu
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
...
...
@@ -254,8 +260,12 @@ static HRESULT WINAPI FolderItemVerbsImpl_Invoke(FolderItemVerbs *iface,
static
HRESULT
WINAPI
FolderItemVerbsImpl_get_Count
(
FolderItemVerbs
*
iface
,
LONG
*
count
)
{
FIXME
(
"(%p, %p)
\n
"
,
iface
,
count
);
return
E_NOTIMPL
;
FolderItemVerbsImpl
*
This
=
impl_from_FolderItemVerbs
(
iface
);
TRACE
(
"(%p, %p)
\n
"
,
iface
,
count
);
*
count
=
This
->
count
;
return
S_OK
;
}
static
HRESULT
WINAPI
FolderItemVerbsImpl_get_Application
(
FolderItemVerbs
*
iface
,
IDispatch
**
disp
)
...
...
@@ -297,11 +307,14 @@ static FolderItemVerbsVtbl folderitemverbsvtbl = {
FolderItemVerbsImpl__NewEnum
};
static
HRESULT
FolderItemVerbs_Constructor
(
FolderItemVerbs
**
verbs
)
static
HRESULT
FolderItemVerbs_Constructor
(
BSTR
path
,
FolderItemVerbs
**
verbs
)
{
FolderItemVerbsImpl
*
This
;
*
verbs
=
NULL
;
IShellFolder
*
folder
;
LPCITEMIDLIST
child
;
LPITEMIDLIST
pidl
;
HRESULT
hr
;
HMENU
menu
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
FolderItemVerbsImpl
));
if
(
!
This
)
...
...
@@ -309,9 +322,35 @@ static HRESULT FolderItemVerbs_Constructor(FolderItemVerbs **verbs)
This
->
FolderItemVerbs_iface
.
lpVtbl
=
&
folderitemverbsvtbl
;
This
->
ref
=
1
;
This
->
count
=
0
;
/* build context menu for this path */
hr
=
SHParseDisplayName
(
path
,
NULL
,
&
pidl
,
0
,
NULL
);
if
(
FAILED
(
hr
))
goto
failed
;
hr
=
SHBindToParent
(
pidl
,
&
IID_IShellFolder
,
(
void
**
)
&
folder
,
&
child
);
CoTaskMemFree
(
pidl
);
if
(
FAILED
(
hr
))
goto
failed
;
hr
=
IShellFolder_GetUIObjectOf
(
folder
,
NULL
,
1
,
&
child
,
&
IID_IContextMenu
,
NULL
,
(
void
**
)
&
This
->
menu
);
IShellFolder_Release
(
folder
);
if
(
FAILED
(
hr
))
goto
failed
;
menu
=
CreatePopupMenu
();
hr
=
IContextMenu_QueryContextMenu
(
This
->
menu
,
menu
,
0
,
FCIDM_SHVIEWFIRST
,
FCIDM_SHVIEWLAST
,
CMF_NORMAL
);
if
(
SUCCEEDED
(
hr
))
This
->
count
=
GetMenuItemCount
(
menu
);
DestroyMenu
(
menu
);
*
verbs
=
&
This
->
FolderItemVerbs_iface
;
return
S_OK
;
failed:
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
static
HRESULT
WINAPI
FolderItemImpl_QueryInterface
(
FolderItem2
*
iface
,
...
...
@@ -570,12 +609,23 @@ static HRESULT WINAPI FolderItemImpl_get_Type(FolderItem2 *iface, BSTR *pbs)
static
HRESULT
WINAPI
FolderItemImpl_Verbs
(
FolderItem2
*
iface
,
FolderItemVerbs
**
verbs
)
{
HRESULT
hr
;
BSTR
path
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
verbs
);
if
(
!
verbs
)
return
E_INVALIDARG
;
return
FolderItemVerbs_Constructor
(
verbs
);
*
verbs
=
NULL
;
hr
=
FolderItem2_get_Path
(
iface
,
&
path
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
FolderItemVerbs_Constructor
(
path
,
verbs
);
SysFreeString
(
path
);
return
hr
;
}
static
HRESULT
WINAPI
FolderItemImpl_InvokeVerb
(
FolderItem2
*
iface
,
...
...
dlls/shell32/tests/shelldispatch.c
View file @
77c2892d
...
...
@@ -784,10 +784,8 @@ if (0) { /* crashes on some systems */
count
=
0
;
hr
=
FolderItemVerbs_get_Count
(
verbs
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
count
>
0
,
"got count %d
\n
"
,
count
);
}
FolderItem_Release
(
item
);
IShellDispatch_Release
(
sd
);
...
...
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