Commit 808ccd11 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Vitaly Lipatov

vbscript: Add wmi test

This shows that the data returned by the EnumKey call isn't the same type as vbscript. At a source leve EnumKey returns a VT_BSTR|VT_ARRAY whereas vbscript converts it a VT_ARRAY|VT_VARIANT*.
parent f54a99d0
......@@ -1937,4 +1937,22 @@ f1 not 1 = 0
arr (0) = 2 xor -2
function wmi_array_bstr()
const HKEY_LOCAL_MACHINE = &H80000002
Dim oReg
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Dim strKeyPath, strSubkey, arrSubKeys
strKeyPath = "Software\Microsoft\NET Framework Setup\NDP"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
Call ok(getVT(arrSubKeys) = "VT_ARRAY|VT_VARIANT*", "getVT(arrSubKeys) = " & getVT(arrSubKeys))
For Each strSubkey In arrSubKeys
Next
end function
Call wmi_array_bstr()
reportSuccess()
......@@ -183,6 +183,11 @@ static const char *vt2a(VARIANT *v)
sprintf(buf, "%s*", vt2a(V_BYREF(v)));
return buf;
}
else if(V_VT(v) == (VT_BYREF|VT_VARIANT|VT_ARRAY)) {
static char buf[64];
sprintf(buf, "%s*", vt2a(V_BYREF(v)));
return buf;
}
switch(V_VT(v)) {
case VT_EMPTY:
......
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