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
aaafeb4c
Commit
aaafeb4c
authored
Oct 21, 2015
by
Andrew Eikum
Committed by
Alexandre Julliard
Nov 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement IShellDispatch2::ShellExecute.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
263b06ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
4 deletions
+79
-4
shelldispatch.c
dlls/shell32/shelldispatch.c
+38
-4
shelldispatch.c
dlls/shell32/tests/shelldispatch.c
+41
-0
No files found.
dlls/shell32/shelldispatch.c
View file @
aaafeb4c
...
@@ -1569,11 +1569,45 @@ static HRESULT WINAPI ShellDispatch_IsRestricted(IShellDispatch6 *iface, BSTR gr
...
@@ -1569,11 +1569,45 @@ static HRESULT WINAPI ShellDispatch_IsRestricted(IShellDispatch6 *iface, BSTR gr
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
ShellDispatch_ShellExecute
(
IShellDispatch6
*
iface
,
BSTR
file
,
VARIANT
args
,
VARIANT
dir
,
static
HRESULT
WINAPI
ShellDispatch_ShellExecute
(
IShellDispatch6
*
iface
,
VARIANT
op
,
VARIANT
show
)
BSTR
file
,
VARIANT
v_args
,
VARIANT
v_dir
,
VARIANT
v_op
,
VARIANT
v_
show
)
{
{
FIXME
(
"(%s): stub
\n
"
,
debugstr_w
(
file
));
VARIANT
args_str
,
dir_str
,
op_str
,
show_int
;
return
E_NOTIMPL
;
WCHAR
*
args
=
NULL
,
*
dir
=
NULL
,
*
op
=
NULL
;
INT
show
=
0
;
HINSTANCE
ret
;
TRACE
(
"(%s, %s, %s, %s, %s)
\n
"
,
debugstr_w
(
file
),
debugstr_variant
(
&
v_args
),
debugstr_variant
(
&
v_dir
),
debugstr_variant
(
&
v_op
),
debugstr_variant
(
&
v_show
));
VariantInit
(
&
args_str
);
VariantChangeType
(
&
args_str
,
&
v_args
,
0
,
VT_BSTR
);
if
(
V_VT
(
&
args_str
)
==
VT_BSTR
)
args
=
V_BSTR
(
&
args_str
);
VariantInit
(
&
dir_str
);
VariantChangeType
(
&
dir_str
,
&
v_dir
,
0
,
VT_BSTR
);
if
(
V_VT
(
&
dir_str
)
==
VT_BSTR
)
dir
=
V_BSTR
(
&
dir_str
);
VariantInit
(
&
op_str
);
VariantChangeType
(
&
op_str
,
&
v_op
,
0
,
VT_BSTR
);
if
(
V_VT
(
&
op_str
)
==
VT_BSTR
)
op
=
V_BSTR
(
&
op_str
);
VariantInit
(
&
show_int
);
VariantChangeType
(
&
show_int
,
&
v_show
,
0
,
VT_I4
);
if
(
V_VT
(
&
show_int
)
==
VT_I4
)
show
=
V_I4
(
&
show_int
);
ret
=
ShellExecuteW
(
NULL
,
op
,
file
,
args
,
dir
,
show
);
VariantClear
(
&
args_str
);
VariantClear
(
&
dir_str
);
VariantClear
(
&
op_str
);
VariantClear
(
&
show_int
);
return
(
ULONG_PTR
)
ret
>
32
?
S_OK
:
S_FALSE
;
}
}
static
HRESULT
WINAPI
ShellDispatch_FindPrinter
(
IShellDispatch6
*
iface
,
BSTR
name
,
BSTR
location
,
BSTR
model
)
static
HRESULT
WINAPI
ShellDispatch_FindPrinter
(
IShellDispatch6
*
iface
,
BSTR
name
,
BSTR
location
,
BSTR
model
)
...
...
dlls/shell32/tests/shelldispatch.c
View file @
aaafeb4c
...
@@ -829,6 +829,46 @@ if (0) { /* crashes on winxp/win2k3 */
...
@@ -829,6 +829,46 @@ if (0) { /* crashes on winxp/win2k3 */
IShellDispatch_Release
(
sd
);
IShellDispatch_Release
(
sd
);
}
}
static
void
test_ShellExecute
(
void
)
{
HRESULT
hr
;
IShellDispatch2
*
sd
;
BSTR
name
;
VARIANT
args
,
dir
,
op
,
show
;
static
const
WCHAR
regW
[]
=
{
'r'
,
'e'
,
'g'
,
0
};
hr
=
CoCreateInstance
(
&
CLSID_Shell
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IShellDispatch2
,
(
void
**
)
&
sd
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"IShellDispatch2 not supported
\n
"
);
return
;
}
VariantInit
(
&
args
);
VariantInit
(
&
dir
);
VariantInit
(
&
op
);
VariantInit
(
&
show
);
V_VT
(
&
show
)
=
VT_I4
;
V_I4
(
&
show
)
=
0
;
name
=
SysAllocString
(
regW
);
hr
=
IShellDispatch2_ShellExecute
(
sd
,
name
,
args
,
dir
,
op
,
show
);
ok
(
hr
==
S_OK
,
"ShellExecute failed: %08x
\n
"
,
hr
);
/* test invalid value for show */
V_VT
(
&
show
)
=
VT_BSTR
;
V_BSTR
(
&
show
)
=
name
;
hr
=
IShellDispatch2_ShellExecute
(
sd
,
name
,
args
,
dir
,
op
,
show
);
ok
(
hr
==
S_OK
,
"ShellExecute failed: %08x
\n
"
,
hr
);
SysFreeString
(
name
);
}
START_TEST
(
shelldispatch
)
START_TEST
(
shelldispatch
)
{
{
HRESULT
r
;
HRESULT
r
;
...
@@ -845,6 +885,7 @@ START_TEST(shelldispatch)
...
@@ -845,6 +885,7 @@ START_TEST(shelldispatch)
test_ShellWindows
();
test_ShellWindows
();
test_ParseName
();
test_ParseName
();
test_Verbs
();
test_Verbs
();
test_ShellExecute
();
CoUninitialize
();
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