[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:
Whindmar Saksit 2023-12-23 21:27:00 +01:00 committed by GitHub
parent 3558b7b985
commit f380a51040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))
{