From 89c76714038d60ee6a62e98157c2477b2d87ca27 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 21 Oct 2011 12:42:37 +0200 Subject: [PATCH] vbscript: Added vbSunday constant implementation. --- dlls/vbscript/global.c | 14 ++++++++++++-- dlls/vbscript/tests/api.vbs | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 56cedf627ba..d3c4c0c83a9 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -75,6 +75,16 @@ static HRESULT return_bstr(VARIANT *res, const WCHAR *str) return S_OK; } +static HRESULT return_short(VARIANT *res, short val) +{ + if(res) { + V_VT(res) = VT_I2; + V_I2(res) = val; + } + + return S_OK; +} + static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid) { IInternetHostSecurityManager *secmgr = NULL; @@ -897,8 +907,8 @@ static HRESULT Global_vbUseSystemDayOfWeek(vbdisp_t *This, VARIANT *arg, unsigne static HRESULT Global_vbSunday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, 1); } static HRESULT Global_vbMonday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index 126f1e0bff8..c201bead063 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -23,6 +23,9 @@ Dim x Class EmptyClass End Class +Call ok(vbSunday = 1, "vbSunday = " & vbSunday) +Call ok(getVT(vbSunday) = "VT_I2", "getVT(vbSunday) = " & getVT(vbSunday)) + Call ok(isObject(new EmptyClass), "isObject(new EmptyClass) is not true?") Set x = new EmptyClass Call ok(isObject(x), "isObject(x) is not true?")