Jacek Caban (@jacek) commented about dlls/vbscript/global.c:
return return_string(res, L"Empty"); case VT_NULL: return return_string(res, L"Null");
case VT_DISPATCH:
if (SUCCEEDED(IDispatch_GetTypeInfo(V_DISPATCH(arg), 0, GetUserDefaultLCID(), &typeinfo)))
{
BSTR name = NULL;
hres = ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &name, NULL, NULL, NULL);
ITypeInfo_Release(typeinfo);
if (SUCCEEDED(hres) && name && *name)
{
hres = return_string(res, name);
`return_string()` is convenient when we need to alloc a BSTR, but since name is already a BSTR here, I think it would be better to avoid extra allocation and open code setting res here.