Commit 0becff82 authored by Shuai Meng's avatar Shuai Meng Committed by Alexandre Julliard

shell32: Also return Attributes in GetFolderDefinition.

parent 21bfc8c4
......@@ -1268,8 +1268,29 @@ static HRESULT Global_ChrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI
static HRESULT Global_Asc(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
HRESULT hres;
BSTR bstr;
WCHAR ret;
TRACE("(%s)\n", debugstr_variant(arg));
switch(V_VT(arg)) {
case VT_NULL:
return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE);
case VT_EMPTY:
return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL);
case VT_BSTR:
bstr = V_BSTR(arg);
default:
hres = to_string(arg, &bstr);
if(FAILED(hres))
return hres;
}
ret = bstr[0];
if(ret == 0)
return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL);
return return_short(res, ret);
}
/* The function supports only single-byte and double-byte character sets. It
......
......@@ -1324,4 +1324,46 @@ Call testRGBError(&h4d&, -2, &h2f&, 5)
Call ok(getVT(Timer) = "VT_R4", "getVT(Timer) = " & getVT(Timer))
Sub testAscError(strings, error_num)
on error resume next
Dim x
Call Err.clear()
x = Asc(strings)
Call ok(Err.number = error_num, "Err.number = " & Err.number)
End Sub
Call ok(Asc(0) = 48, "Asc(0) = " & Asc(0))
Call ok(getVT(Asc(0)) = "VT_I2", "getVT(Asc(0)) = " & getVT(Asc(0)))
Call ok(Asc(-32769) = 45, "Asc(-32769) = " & Asc(-32769))
Call ok(getVT(Asc(-32769)) = "VT_I2", "getVT(Asc(-32769)) = " & getVT(Asc(-32769)))
Call ok(Asc(CSng(90.68)) = 57, "Asc(CSng(90.68)) = " & Asc(CSng(90.68)))
Call ok(getVT(Asc(CSng(90.68))) = "VT_I2", "getVT(Asc(CSng(90.68))) = " & getVT(Asc(CSng(90.68))))
Call ok(Asc(123) = 49, "Asc(123) = " & Asc(123))
Call ok(getVT(Asc(123)) = "VT_I2", "getVT(Asc(123)) = " & getVT(Asc(123)))
Call ok(Asc(CCur(234)) = 50, "Asc(CCur(234)) = " & Asc(CCur(234)))
Call ok(getVT(Asc(CCur(234))) = "VT_I2", "getVT(Asc(CCur(234))) = " & getVT(Asc(CCur(234))))
Call ok(Asc("abc") = 97, "Asc(""abc"") = " & Asc("abc"))
Call ok(getVT(Asc("abc")) = "VT_I2", "getVT(Asc(""abc"")) = " & getVT(Asc("abc")))
Call ok(Asc("?") = 63, "Asc(""?"") = " & Asc("?"))
Call ok(getVT(Asc("?")) = "VT_I2", "getVT(Asc(""?"")) = " & getVT(Asc("?")))
Call ok(Asc(" space") = 32, "Asc("" space"") = " & Asc(" space"))
Call ok(getVT(Asc(" space")) = "VT_I2", "getVT(Asc("" space"")) = " & getVT(Asc(" space")))
Call ok(Asc("@") = 64, "Asc(""@"") = " & Asc("@"))
Call ok(getVT(Asc("@")) = "VT_I2", "getVT(Asc(""@"")) = " & getVT(Asc("@")))
Call ok(Asc("\n") = 92, "Asc(""\n"") = " & Asc("\n"))
Call ok(getVT(Asc("\n")) = "VT_I2", "getVT(Asc(""\n"")) = " & getVT(Asc("\n")))
if isEnglishLang then
Call ok(Asc(False) = 70, "Asc(False) = " & Asc(False))
Call ok(getVT(Asc(False)) = "VT_I2", "getVT(Asc(False)) = " & getVT(Asc(False)))
Call ok(Asc(True) = 84, "Asc(True) = " & Asc(True))
Call ok(getVT(Asc(True)) = "VT_I2", "getVT(Asc(True)) = " & getVT(Asc(True)))
End if
Call ok(Asc(CByte(7)) = 55, "Asc(CByte(7)) = " & Asc(CByte(7)))
Call ok(getVT(Asc(CByte(7))) = "VT_I2", "getVT(Asc(CByte(7))) = " & getVT(Asc(CByte(7))))
Call testAscError(Empty, 5)
Call testAscError(Null, 94)
Call testAscError("", 5)
Call reportSuccess()
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