Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49172 Signed-off-by: Robert Wilhelm robert.wilhelm@gmx.net --- dlls/vbscript/global.c | 2 +- dlls/vbscript/tests/api.vbs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 1231beee8e6..89780777216 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -3148,7 +3148,7 @@ static HRESULT Err_Raise(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VA hres = to_int(args, &code); if(FAILED(hres)) return hres; - if(code > 0 && code > 0xffff) + if(code == 0 || code > 0xffff) return E_INVALIDARG;
if(args_cnt >= 2) diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index 48b263334c8..20798a0aacd 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -1856,13 +1856,29 @@ end sub sub testErrRaise() on error resume next call ok(err.number = 0, "err.number = " & err.number) + err.raise 0 + call ok(err.number = 5, "err.number = " & err.number) err.raise 1 call ok(err.number = 1, "err.number = " & err.number) err.raise call ok(err.number = 450, "err.number = " & err.number) call testErrNumber(450) + err.raise &h8000 + call ok(err.number = -32768, "err.number = " & err.number) + err.raise &hffff + call ok(err.number = -1, "err.number = " & err.number) err.raise &h10000& call ok(err.number = 5, "err.number = " & err.number) + err.raise -3000000000 + call ok(err.number = 6, "err.number = " & err.number) + err.raise -1 + call ok(err.number = -1, "err.number = " & err.number) + err.raise -20 + call ok(err.number = -20, "err.number = " & err.number) + err.raise -&hfff0 + call ok(err.number = 16, "err.number = " & err.number) + err.raise -&h8000 + call ok(err.number = 32768, "err.number = " & err.number)
err.clear call ok(getVT(err.source) = "VT_BSTR", "err.source = " & err.source) -- 2.26.2