On 06/17/14 07:59, Shuai Meng wrote:
> diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c
> index 5357df8..c2b2edd 100644
> --- a/dlls/vbscript/global.c
> +++ b/dlls/vbscript/global.c
> @@ -602,8 +602,52 @@ static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
>
> static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
> {
> - FIXME("\n");
> - return E_NOTIMPL;
> + TRACE("(%s)\n", debugstr_variant(arg));
> +
> + assert(args_cnt == 1);
> +
> + if(res) {
> + V_VT(res) = VT_I2;
> + switch(V_VT(arg)) {
> + case VT_EMPTY:
> + V_I2(res) = VT_EMPTY;
> + break;
> + case VT_NULL:
> + V_I2(res) = VT_NULL;
> + break;
> + case VT_I2:
> + V_I2(res) = VT_I2;
> + break;
(...)
This all could be just:
V_I2(res) = V_VT(arg);
To handle unsupported types, you could use something like:
if(V_VT(arg) & ~VT_TYPEMASK) {
FIXME("...");
return E_NOTIMPL;
}
if(res) {
V_VT(res) = VT_I2;
V_I2(res) = V_VT(arg);
}
Jacek