Implemented SafeArrayGetVarType.

Added a VT_RECORD variant type definition.
This commit is contained in:
Francois Jacques 2000-07-08 18:30:41 +00:00 committed by Alexandre Julliard
parent 00e7c3346d
commit e81b63fc9c
3 changed files with 44 additions and 0 deletions

View File

@ -73,6 +73,7 @@ import ole32.dll
74 stdcall VarR4FromStr(wstr long long ptr) VarR4FromStr
75 stub VarR4FromDisp
76 stdcall VarR4FromBool(long ptr) VarR4FromBool
77 stdcall SafeArrayGetVarType(ptr ptr) SafeArrayGetVarType
78 stdcall VarR8FromUI1(long ptr) VarR8FromUI1
79 stdcall VarR8FromI2(long ptr) VarR8FromI2
80 stdcall VarR8FromI4(long ptr) VarR8FromI4

View File

@ -1036,3 +1036,45 @@ static HRESULT duplicateData(
return S_OK;
}
/************************************************************************
* SafeArrayGetVarType
* Returns the VARTYPE stored in the given safearray
*/
HRESULT WINAPI SafeArrayGetVarType(
SAFEARRAY* psa,
VARTYPE* pvt)
{
HRESULT hr = E_INVALIDARG;
VARTYPE vt = VT_EMPTY;
/* const short VARTYPE_OFFSET = -4; */
if (psa->fFeatures & FADF_HAVEVARTYPE)
{
/* VT tag @ negative offset 4 in the array descriptor */
FIXME("Returning VT_BSTR instead of VT_...");
vt = VT_BSTR;
}
else if (psa->fFeatures & FADF_RECORD)
{
vt = VT_RECORD;
}
else if (psa->fFeatures & FADF_DISPATCH)
{
vt = VT_DISPATCH;
}
else if (psa->fFeatures & FADF_UNKNOWN)
{
vt = VT_UNKNOWN;
}
if (vt != VT_EMPTY)
{
*pvt = vt;
hr = S_OK;
}
TRACE("HRESULT = %08lx", hr);
return hr;
}

View File

@ -467,6 +467,7 @@ enum VARENUM {
VT_USERDEFINED = 29,
VT_LPSTR = 30,
VT_LPWSTR = 31,
VT_RECORD = 36,
VT_FILETIME = 64,
VT_BLOB = 65,
VT_STREAM = 66,