Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d60c9adc
Commit
d60c9adc
authored
Jul 17, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Jul 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix some return values from the shellview contextmenu.
parent
bd6b8062
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
3 deletions
+116
-3
shv_item_cmenu.c
dlls/shell32/shv_item_cmenu.c
+7
-3
shlfolder.c
dlls/shell32/tests/shlfolder.c
+109
-0
No files found.
dlls/shell32/shv_item_cmenu.c
View file @
d60c9adc
...
@@ -218,6 +218,7 @@ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
...
@@ -218,6 +218,7 @@ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
UINT
uFlags
)
UINT
uFlags
)
{
{
ItemCmImpl
*
This
=
(
ItemCmImpl
*
)
iface
;
ItemCmImpl
*
This
=
(
ItemCmImpl
*
)
iface
;
INT
uIDMax
;
TRACE
(
"(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )
\n
"
,
This
,
hmenu
,
indexMenu
,
idCmdFirst
,
idCmdLast
,
uFlags
);
TRACE
(
"(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )
\n
"
,
This
,
hmenu
,
indexMenu
,
idCmdFirst
,
idCmdLast
,
uFlags
);
...
@@ -231,7 +232,7 @@ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
...
@@ -231,7 +232,7 @@ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
if
(
uFlags
&
CMF_EXPLORE
)
if
(
uFlags
&
CMF_EXPLORE
)
RemoveMenu
(
hmenures
,
FCIDM_SHVIEW_OPEN
,
MF_BYCOMMAND
);
RemoveMenu
(
hmenures
,
FCIDM_SHVIEW_OPEN
,
MF_BYCOMMAND
);
Shell_MergeMenus
(
hmenu
,
GetSubMenu
(
hmenures
,
0
),
indexMenu
,
idCmdFirst
,
idCmdLast
,
MM_SUBMENUSHAVEIDS
);
uIDMax
=
Shell_MergeMenus
(
hmenu
,
GetSubMenu
(
hmenures
,
0
),
indexMenu
,
idCmdFirst
,
idCmdLast
,
MM_SUBMENUSHAVEIDS
);
DestroyMenu
(
hmenures
);
DestroyMenu
(
hmenures
);
...
@@ -255,7 +256,7 @@ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
...
@@ -255,7 +256,7 @@ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
else
else
EnableMenuItem
(
hmenu
,
FCIDM_SHVIEW_RENAME
,
MF_BYCOMMAND
|
ISvItemCm_CanRenameItems
(
This
)
?
MFS_ENABLED
:
MFS_DISABLED
);
EnableMenuItem
(
hmenu
,
FCIDM_SHVIEW_RENAME
,
MF_BYCOMMAND
|
ISvItemCm_CanRenameItems
(
This
)
?
MFS_ENABLED
:
MFS_DISABLED
);
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
(
FCIDM_SHVIEWLAST
)
);
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
uIDMax
);
}
}
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
0
);
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
0
);
}
}
...
@@ -561,6 +562,7 @@ static HRESULT WINAPI ISvItemCm_fnInvokeCommand(
...
@@ -561,6 +562,7 @@ static HRESULT WINAPI ISvItemCm_fnInvokeCommand(
break
;
break
;
default:
default:
FIXME
(
"Unhandled Verb %xl
\n
"
,
LOWORD
(
lpcmi
->
lpVerb
));
FIXME
(
"Unhandled Verb %xl
\n
"
,
LOWORD
(
lpcmi
->
lpVerb
));
return
E_INVALIDARG
;
}
}
}
}
else
else
...
@@ -570,8 +572,10 @@ static HRESULT WINAPI ISvItemCm_fnInvokeCommand(
...
@@ -570,8 +572,10 @@ static HRESULT WINAPI ISvItemCm_fnInvokeCommand(
DoDelete
(
iface
);
DoDelete
(
iface
);
else
if
(
strcmp
(
lpcmi
->
lpVerb
,
"properties"
)
==
0
)
else
if
(
strcmp
(
lpcmi
->
lpVerb
,
"properties"
)
==
0
)
DoOpenProperties
(
iface
,
lpcmi
->
hwnd
);
DoOpenProperties
(
iface
,
lpcmi
->
hwnd
);
else
else
{
FIXME
(
"Unhandled string verb %s
\n
"
,
debugstr_a
(
lpcmi
->
lpVerb
));
FIXME
(
"Unhandled string verb %s
\n
"
,
debugstr_a
(
lpcmi
->
lpVerb
));
return
E_FAIL
;
}
}
}
return
NOERROR
;
return
NOERROR
;
}
}
...
...
dlls/shell32/tests/shlfolder.c
View file @
d60c9adc
...
@@ -2110,6 +2110,114 @@ static void test_desktop_IPersist(void)
...
@@ -2110,6 +2110,114 @@ static void test_desktop_IPersist(void)
IShellFolder_Release
(
desktop
);
IShellFolder_Release
(
desktop
);
}
}
static
void
test_GetUIObject
(
void
)
{
IShellFolder
*
psf_desktop
;
IContextMenu
*
pcm
;
LPITEMIDLIST
pidl
;
HRESULT
hr
;
WCHAR
path
[
MAX_PATH
];
const
WCHAR
filename
[]
=
{
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'd'
,
'i'
,
'r'
,
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'1'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
if
(
!
pSHBindToParent
)
{
win_skip
(
"SHBindToParent missing.
\n
"
);
return
;
}
GetCurrentDirectoryW
(
MAX_PATH
,
path
);
if
(
!
lstrlenW
(
path
))
{
skip
(
"GetCurrentDirectoryW returned an empty string.
\n
"
);
return
;
}
lstrcatW
(
path
,
filename
);
SHGetDesktopFolder
(
&
psf_desktop
);
CreateFilesFolders
();
hr
=
IShellFolder_ParseDisplayName
(
psf_desktop
,
NULL
,
NULL
,
path
,
NULL
,
&
pidl
,
0
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
IShellFolder
*
psf
;
LPCITEMIDLIST
pidl_child
;
hr
=
pSHBindToParent
(
pidl
,
&
IID_IShellFolder
,
(
void
**
)
&
psf
,
&
pidl_child
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IShellFolder_GetUIObjectOf
(
psf
,
NULL
,
1
,
(
LPCITEMIDLIST
*
)
&
pidl_child
,
&
IID_IContextMenu
,
NULL
,
(
void
**
)
&
pcm
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
HMENU
hmenu
=
CreatePopupMenu
();
INT
max_id
,
max_id_check
;
UINT
count
,
i
;
const
int
id_upper_limit
=
32767
;
hr
=
IContextMenu_QueryContextMenu
(
pcm
,
hmenu
,
0
,
0
,
id_upper_limit
,
CMF_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Got 0x%08x
\n
"
,
hr
);
max_id
=
HRESULT_CODE
(
hr
)
-
1
;
/* returns max_id + 1 */
ok
(
max_id
<=
id_upper_limit
,
"Got %d
\n
"
,
max_id
);
count
=
GetMenuItemCount
(
hmenu
);
ok
(
count
,
"Got %d
\n
"
,
count
);
max_id_check
=
0
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
MENUITEMINFOA
mii
;
INT
res
;
ZeroMemory
(
&
mii
,
sizeof
(
MENUITEMINFOA
));
mii
.
cbSize
=
sizeof
(
MENUITEMINFOA
);
mii
.
fMask
=
MIIM_ID
|
MIIM_FTYPE
;
SetLastError
(
0
);
res
=
GetMenuItemInfoA
(
hmenu
,
i
,
TRUE
,
&
mii
);
ok
(
res
,
"Failed (last error: %d).
\n
"
,
GetLastError
());
ok
(
(
mii
.
wID
<=
id_upper_limit
)
||
(
mii
.
fType
&
MFT_SEPARATOR
),
"Got non-separator ID out of range: %d (type: %x)
\n
"
,
mii
.
wID
,
mii
.
fType
);
if
(
!
(
mii
.
fType
&
MFT_SEPARATOR
))
max_id_check
=
(
mii
.
wID
>
max_id_check
)
?
mii
.
wID
:
max_id_check
;
}
ok
((
max_id_check
==
max_id
)
||
(
max_id_check
==
max_id
-
1
/* Win 7 */
),
"Not equal (or near equal), got %d and %d
\n
"
,
max_id_check
,
max_id
);
#define is_win2k() (pSHGetFolderPathA && !pSHGetFolderPathAndSubDirA)
if
(
count
&&
!
is_win2k
())
/* Test is interactive on w2k, so skip */
{
CMINVOKECOMMANDINFO
cmi
;
ZeroMemory
(
&
cmi
,
sizeof
(
CMINVOKECOMMANDINFO
));
cmi
.
cbSize
=
sizeof
(
CMINVOKECOMMANDINFO
);
/* Attempt to execute non-existing command */
cmi
.
lpVerb
=
MAKEINTRESOURCEA
(
9999
);
hr
=
IContextMenu_InvokeCommand
(
pcm
,
&
cmi
);
ok
(
hr
==
E_INVALIDARG
,
"Got 0x%08x
\n
"
,
hr
);
cmi
.
lpVerb
=
"foobar_wine_test"
;
hr
=
IContextMenu_InvokeCommand
(
pcm
,
&
cmi
);
ok
(
(
hr
==
E_INVALIDARG
)
||
(
hr
==
E_FAIL
/* Win7 */
)
||
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_NO_ASSOCIATION
)
/* Vista */
),
"Got 0x%08x
\n
"
,
hr
);
}
#undef is_win2k
DestroyMenu
(
hmenu
);
IContextMenu_Release
(
pcm
);
}
IShellFolder_Release
(
psf
);
}
if
(
pILFree
)
pILFree
(
pidl
);
}
IShellFolder_Release
(
psf_desktop
);
Cleanup
();
}
START_TEST
(
shlfolder
)
START_TEST
(
shlfolder
)
{
{
init_function_pointers
();
init_function_pointers
();
...
@@ -2131,6 +2239,7 @@ START_TEST(shlfolder)
...
@@ -2131,6 +2239,7 @@ START_TEST(shlfolder)
test_LocalizedNames
();
test_LocalizedNames
();
test_SHCreateShellItem
();
test_SHCreateShellItem
();
test_desktop_IPersist
();
test_desktop_IPersist
();
test_GetUIObject
();
OleUninitialize
();
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