oleaut32: Make ITypeInfo2::GetCustData succeed when data is not found.
This commit is contained in:
parent
bc56c4eab3
commit
80c870251f
|
@ -449,6 +449,7 @@ static void test_TypeInfo(void)
|
||||||
{
|
{
|
||||||
ITypeLib *pTypeLib;
|
ITypeLib *pTypeLib;
|
||||||
ITypeInfo *pTypeInfo;
|
ITypeInfo *pTypeInfo;
|
||||||
|
ITypeInfo2 *pTypeInfo2;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
static WCHAR wszBogus[] = { 'b','o','g','u','s',0 };
|
static WCHAR wszBogus[] = { 'b','o','g','u','s',0 };
|
||||||
static WCHAR wszGetTypeInfo[] = { 'G','e','t','T','y','p','e','I','n','f','o',0 };
|
static WCHAR wszGetTypeInfo[] = { 'G','e','t','T','y','p','e','I','n','f','o',0 };
|
||||||
|
@ -458,6 +459,8 @@ static void test_TypeInfo(void)
|
||||||
OLECHAR* pwszClone = wszClone;
|
OLECHAR* pwszClone = wszClone;
|
||||||
DISPID dispidMember;
|
DISPID dispidMember;
|
||||||
DISPPARAMS dispparams;
|
DISPPARAMS dispparams;
|
||||||
|
GUID bogusguid = {0x806afb4f,0x13f7,0x42d2,{0x89,0x2c,0x6c,0x97,0xc3,0x6a,0x36,0xc1}};
|
||||||
|
VARIANT var;
|
||||||
|
|
||||||
hr = LoadTypeLib(wszStdOle2, &pTypeLib);
|
hr = LoadTypeLib(wszStdOle2, &pTypeLib);
|
||||||
ok_ole_success(hr, LoadTypeLib);
|
ok_ole_success(hr, LoadTypeLib);
|
||||||
|
@ -503,6 +506,25 @@ static void test_TypeInfo(void)
|
||||||
hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &pwszGetTypeInfo, 1, &dispidMember);
|
hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &pwszGetTypeInfo, 1, &dispidMember);
|
||||||
ok_ole_success(hr, ITypeInfo_GetIDsOfNames);
|
ok_ole_success(hr, ITypeInfo_GetIDsOfNames);
|
||||||
|
|
||||||
|
hr = ITypeInfo_QueryInterface(pTypeInfo, &IID_ITypeInfo2, (void**)&pTypeInfo2);
|
||||||
|
ok_ole_success(hr, ITypeInfo_QueryInterface);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
VariantInit(&var);
|
||||||
|
|
||||||
|
V_VT(&var) = VT_I4;
|
||||||
|
|
||||||
|
/* test unknown guid passed to GetCustData */
|
||||||
|
hr = ITypeInfo2_GetCustData(pTypeInfo2, &bogusguid, &var);
|
||||||
|
ok_ole_success(hr, ITypeInfo_GetCustData);
|
||||||
|
ok(V_VT(&var) == VT_EMPTY, "got %i, expected VT_EMPTY\n", V_VT(&var));
|
||||||
|
|
||||||
|
ITypeInfo2_Release(pTypeInfo2);
|
||||||
|
|
||||||
|
VariantClear(&var);
|
||||||
|
}
|
||||||
|
|
||||||
/* test invoking a method with a [restricted] keyword */
|
/* test invoking a method with a [restricted] keyword */
|
||||||
hr = ITypeInfo_Invoke(pTypeInfo, NULL, dispidMember, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
|
hr = ITypeInfo_Invoke(pTypeInfo, NULL, dispidMember, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
|
||||||
todo_wine {
|
todo_wine {
|
||||||
|
|
|
@ -7047,13 +7047,12 @@ static HRESULT WINAPI ITypeInfo2_fnGetCustData(
|
||||||
|
|
||||||
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
|
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
|
||||||
|
|
||||||
if(pCData)
|
VariantInit( pVarVal);
|
||||||
{
|
if (pCData)
|
||||||
VariantInit( pVarVal);
|
|
||||||
VariantCopy( pVarVal, &pCData->data);
|
VariantCopy( pVarVal, &pCData->data);
|
||||||
return S_OK;
|
else
|
||||||
}
|
VariantClear( pVarVal );
|
||||||
return E_INVALIDARG; /* FIXME: correct? */
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITypeInfo2::GetFuncCustData
|
/* ITypeInfo2::GetFuncCustData
|
||||||
|
|
Loading…
Reference in New Issue