mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[WSHOM.OCX] WshShell::Run intWindowStyle parameter is optional (#6180)
The last two parameters are optional, see https://learn.microsoft.com/en-us/previous-versions/d5fk67ky(v=vs.85) Test case: ``` ' test.vbs Set objShell = Wscript.CreateObject("Wscript.Shell") objShell.Run "calc.exe" ' Should work because the arguments are optional objShell.Run "winver.exe", invalidnumber ' Windows treats this as SW_HIDE because it can convert VT_EMPTY objShell.Run "notepad.exe", "invalidnumber" ' Windows fails with error ```
This commit is contained in:
parent
3558b7b985
commit
f380a51040
1 changed files with 9 additions and 0 deletions
|
@ -1261,6 +1261,15 @@ static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style,
|
|||
return E_POINTER;
|
||||
|
||||
VariantInit(&s);
|
||||
#ifdef __REACTOS__
|
||||
if (is_optional_argument(style))
|
||||
{
|
||||
V_VT(&s) = VT_I4;
|
||||
V_I4(&s) = SW_SHOW;
|
||||
hr = S_OK;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
hr = VariantChangeType(&s, style, 0, VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue