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
2a15390e
Commit
2a15390e
authored
Jun 16, 2020
by
Porot Mo
Committed by
Alexandre Julliard
Jun 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom.ocx: Expand environment string before executing command through CreateProcessW.
Signed-off-by:
Porot Mo
<
porotmjp@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
15303e54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
shell.c
dlls/wshom.ocx/shell.c
+10
-1
wshom.c
dlls/wshom.ocx/tests/wshom.c
+10
-0
No files found.
dlls/wshom.ocx/shell.c
View file @
2a15390e
...
@@ -1714,6 +1714,9 @@ static HRESULT WINAPI WshShell3_SendKeys(IWshShell3 *iface, BSTR Keys, VARIANT *
...
@@ -1714,6 +1714,9 @@ static HRESULT WINAPI WshShell3_SendKeys(IWshShell3 *iface, BSTR Keys, VARIANT *
static
HRESULT
WINAPI
WshShell3_Exec
(
IWshShell3
*
iface
,
BSTR
command
,
IWshExec
**
ret
)
static
HRESULT
WINAPI
WshShell3_Exec
(
IWshShell3
*
iface
,
BSTR
command
,
IWshExec
**
ret
)
{
{
BSTR
expandedcmd
;
HRESULT
hr
;
TRACE
(
"(%s %p)
\n
"
,
debugstr_w
(
command
),
ret
);
TRACE
(
"(%s %p)
\n
"
,
debugstr_w
(
command
),
ret
);
if
(
!
ret
)
if
(
!
ret
)
...
@@ -1722,7 +1725,13 @@ static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec *
...
@@ -1722,7 +1725,13 @@ static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec *
if
(
!
command
)
if
(
!
command
)
return
DISP_E_EXCEPTION
;
return
DISP_E_EXCEPTION
;
return
WshExec_create
(
command
,
ret
);
hr
=
WshShell3_ExpandEnvironmentStrings
(
iface
,
command
,
&
expandedcmd
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
WshExec_create
(
expandedcmd
,
ret
);
SysFreeString
(
expandedcmd
);
return
hr
;
}
}
static
HRESULT
WINAPI
WshShell3_get_CurrentDirectory
(
IWshShell3
*
iface
,
BSTR
*
dir
)
static
HRESULT
WINAPI
WshShell3_get_CurrentDirectory
(
IWshShell3
*
iface
,
BSTR
*
dir
)
...
...
dlls/wshom.ocx/tests/wshom.c
View file @
2a15390e
...
@@ -327,6 +327,16 @@ static void test_wshshell(void)
...
@@ -327,6 +327,16 @@ static void test_wshshell(void)
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
SysFreeString
(
str
);
str
=
SysAllocString
(
L"%deadbeaf% /c echo test"
);
hr
=
IWshShell3_Exec
(
sh3
,
str
,
&
shexec
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
str
=
SysAllocString
(
L"%ComSpec% /c echo test"
);
hr
=
IWshShell3_Exec
(
sh3
,
str
,
&
shexec
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_SUCCESS
),
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
IWshCollection_Release
(
coll
);
IWshCollection_Release
(
coll
);
IDispatch_Release
(
disp
);
IDispatch_Release
(
disp
);
IWshShell3_Release
(
sh3
);
IWshShell3_Release
(
sh3
);
...
...
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