From 4effb57f8862c90b5004c0045d24b5fd13400b2d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 27 Mar 2014 14:44:26 +0100 Subject: [PATCH] vbscript: Return only code part of HRESULT for vbscript errors as Err.number. --- dlls/vbscript/global.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 9b6ca48276..9983509764 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -1886,6 +1886,8 @@ static HRESULT Err_HelpFile(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { + HRESULT hres; + TRACE("\n"); if(!This->desc) @@ -1896,7 +1898,8 @@ static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARI return E_NOTIMPL; } - return return_int(res, This->desc->ctx->err_number); + hres = This->desc->ctx->err_number; + return return_int(res, HRESULT_FACILITY(hres) == FACILITY_VBS ? HRESULT_CODE(hres) : hres); } static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res)