Commit 97f29129 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Added support for a few more constants.

parent 70c21c8e
...@@ -1771,30 +1771,6 @@ static HRESULT Global_vbVerticalTab(vbdisp_t *This, VARIANT *arg, unsigned args_ ...@@ -1771,30 +1771,6 @@ static HRESULT Global_vbVerticalTab(vbdisp_t *This, VARIANT *arg, unsigned args_
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT Global_vbMsgBoxHelpButton(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Global_vbMsgBoxSetForeground(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Global_vbMsgBoxRight(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Global_vbMsgBoxRtlReading(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
}
static const builtin_prop_t global_props[] = { static const builtin_prop_t global_props[] = {
{DISPID_GLOBAL_VBUSESYSTEM, NULL, BP_GET, 0}, {DISPID_GLOBAL_VBUSESYSTEM, NULL, BP_GET, 0},
{DISPID_GLOBAL_USESYSTEMDAYOFWEEK, NULL, BP_GET, 0}, {DISPID_GLOBAL_USESYSTEMDAYOFWEEK, NULL, BP_GET, 0},
...@@ -1984,10 +1960,10 @@ static const builtin_prop_t global_props[] = { ...@@ -1984,10 +1960,10 @@ static const builtin_prop_t global_props[] = {
{DISPID_GLOBAL_EXECUTE, Global_Execute, 0, 1}, {DISPID_GLOBAL_EXECUTE, Global_Execute, 0, 1},
{DISPID_GLOBAL_EXECUTEGLOBAL, Global_ExecuteGlobal, 0, 1}, {DISPID_GLOBAL_EXECUTEGLOBAL, Global_ExecuteGlobal, 0, 1},
{DISPID_GLOBAL_GETREF, Global_GetRef, 0, 1}, {DISPID_GLOBAL_GETREF, Global_GetRef, 0, 1},
{DISPID_GLOBAL_VBMSGBOXHELPBUTTON, Global_vbMsgBoxHelpButton, BP_GET}, {DISPID_GLOBAL_VBMSGBOXHELPBUTTON, NULL, BP_GET, MB_HELP},
{DISPID_GLOBAL_VBMSGBOXSETFOREGROUND, Global_vbMsgBoxSetForeground, BP_GET}, {DISPID_GLOBAL_VBMSGBOXSETFOREGROUND, NULL, BP_GET, MB_SETFOREGROUND},
{DISPID_GLOBAL_VBMSGBOXRIGHT, Global_vbMsgBoxRight, BP_GET}, {DISPID_GLOBAL_VBMSGBOXRIGHT, NULL, BP_GET, MB_RIGHT},
{DISPID_GLOBAL_VBMSGBOXRTLREADING, Global_vbMsgBoxRtlReading, BP_GET} {DISPID_GLOBAL_VBMSGBOXRTLREADING, NULL, BP_GET, MB_RTLREADING}
}; };
HRESULT init_global(script_ctx_t *ctx) HRESULT init_global(script_ctx_t *ctx)
......
...@@ -43,6 +43,11 @@ Sub TestConstant(name, val, exval) ...@@ -43,6 +43,11 @@ Sub TestConstant(name, val, exval)
Call ok(getVT(val) = "VT_I2*", "getVT(" & name & ") = " & getVT(val)) Call ok(getVT(val) = "VT_I2*", "getVT(" & name & ") = " & getVT(val))
End Sub End Sub
Sub TestConstantI4(name, val, exval)
Call ok(val = exval, name & " = " & val & " expected " & exval)
Call ok(getVT(val) = "VT_I4*", "getVT(" & name & ") = " & getVT(val))
End Sub
TestConstant "vbEmpty", vbEmpty, 0 TestConstant "vbEmpty", vbEmpty, 0
TestConstant "vbNull", vbNull, 1 TestConstant "vbNull", vbNull, 1
TestConstant "vbLong", vbLong, 3 TestConstant "vbLong", vbLong, 3
...@@ -76,6 +81,10 @@ TestConstant "vbFirstFourDays", vbFirstFourDays, 2 ...@@ -76,6 +81,10 @@ TestConstant "vbFirstFourDays", vbFirstFourDays, 2
TestConstant "vbFirstFullWeek", vbFirstFullWeek, 3 TestConstant "vbFirstFullWeek", vbFirstFullWeek, 3
TestConstant "vbTrue", vbTrue, -1 TestConstant "vbTrue", vbTrue, -1
TestConstant "vbFalse", vbFalse, 0 TestConstant "vbFalse", vbFalse, 0
TestConstantI4 "vbMsgBoxHelpButton", vbMsgBoxHelpButton, 16384
TestConstantI4 "vbMsgBoxSetForeground", vbMsgBoxSetForeground, 65536
TestConstantI4 "vbMsgBoxRight", vbMsgBoxRight, 524288
TestConstantI4 "vbMsgBoxRtlReading", vbMsgBoxRtlReading, 1048576
Sub TestCStr(arg, exval) Sub TestCStr(arg, exval)
dim x dim x
......
...@@ -150,9 +150,14 @@ static HRESULT invoke_builtin(vbdisp_t *This, const builtin_prop_t *prop, WORD f ...@@ -150,9 +150,14 @@ static HRESULT invoke_builtin(vbdisp_t *This, const builtin_prop_t *prop, WORD f
break; break;
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
if(!prop->proc && prop->flags == BP_GET) { if(!prop->proc && prop->flags == BP_GET) {
assert((INT16)prop->min_args == prop->min_args); int val = prop->min_args;
if(val < 0x4000) {
V_VT(res) = VT_I2; V_VT(res) = VT_I2;
V_I2(res) = prop->min_args; V_I2(res) = val;
}else {
V_VT(res) = VT_I4;
V_I4(res) = val;
}
return S_OK; return S_OK;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment