Commit e0e7d96e authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

oleaut32: Implement getting of all properties in IPictureDisp::Invoke.

parent 9985f503
...@@ -2065,6 +2065,11 @@ static HRESULT WINAPI OLEPictureImpl_Invoke( ...@@ -2065,6 +2065,11 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
if (wFlags & DISPATCH_PROPERTYGET) if (wFlags & DISPATCH_PROPERTYGET)
{ {
if (pDispParams->cArgs != 0)
{
ERR("param count for DISPATCH_PROPERTYGET was %d instead of 0\n", pDispParams->cArgs);
return DISP_E_BADPARAMCOUNT;
}
if (!pVarResult) if (!pVarResult)
{ {
ERR("null pVarResult not allowed when DISPATCH_PROPERTYGET specified\n"); ERR("null pVarResult not allowed when DISPATCH_PROPERTYGET specified\n");
...@@ -2085,30 +2090,52 @@ static HRESULT WINAPI OLEPictureImpl_Invoke( ...@@ -2085,30 +2090,52 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
return DISP_E_MEMBERNOTFOUND; return DISP_E_MEMBERNOTFOUND;
} }
if (dispIdMember == DISPID_PICT_TYPE) switch (dispIdMember)
{ {
TRACE("DISPID_PICT_TYPE\n"); case DISPID_PICT_HANDLE:
if (!(wFlags & INVOKE_PROPERTYGET)) if (wFlags & DISPATCH_PROPERTYGET)
return DISP_E_PARAMNOTFOUND; {
if (pDispParams->cArgs != 0) TRACE("DISPID_PICT_HANDLE\n");
return DISP_E_BADPARAMCOUNT; V_VT(pVarResult) = VT_I4;
if (pVarResult) return IPicture_get_Handle((IPicture *)&This->lpVtbl, &V_UINT(pVarResult));
}
break;
case DISPID_PICT_HPAL:
if (wFlags & DISPATCH_PROPERTYGET)
{
TRACE("DISPID_PICT_HPAL\n");
V_VT(pVarResult) = VT_I4;
return IPicture_get_hPal((IPicture *)&This->lpVtbl, &V_UINT(pVarResult));
}
break;
case DISPID_PICT_TYPE:
if (wFlags & DISPATCH_PROPERTYGET)
{ {
VariantInit(pVarResult); TRACE("DISPID_PICT_TYPE\n");
V_VT(pVarResult) = VT_I2; V_VT(pVarResult) = VT_I2;
return OLEPictureImpl_get_Type((IPicture *)&This->lpVtbl, &V_I2(pVarResult)); return OLEPictureImpl_get_Type((IPicture *)&This->lpVtbl, &V_I2(pVarResult));
} }
return S_OK; break;
case DISPID_PICT_WIDTH:
if (wFlags & DISPATCH_PROPERTYGET)
{
TRACE("DISPID_PICT_WIDTH\n");
V_VT(pVarResult) = VT_I4;
return IPicture_get_Width((IPicture *)&This->lpVtbl, &V_I4(pVarResult));
} }
else break;
case DISPID_PICT_HEIGHT:
if (wFlags & DISPATCH_PROPERTYGET)
{ {
FIXME("(dispid: %ld):Stub\n",dispIdMember); TRACE("DISPID_PICT_HEIGHT\n");
V_VT(pVarResult) = VT_I4;
VariantInit(pVarResult); return IPicture_get_Height((IPicture *)&This->lpVtbl, &V_I4(pVarResult));
V_VT(pVarResult) = VT_BOOL;
V_BOOL(pVarResult) = FALSE;
return S_OK;
} }
break;
}
ERR("invalid dispid 0x%lx or wFlags 0x%x\n", dispIdMember, wFlags);
return DISP_E_MEMBERNOTFOUND;
} }
......
...@@ -337,14 +337,23 @@ static void test_Invoke(void) ...@@ -337,14 +337,23 @@ static void test_Invoke(void)
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL); hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
ok_ole_success(hr, "IPictureDisp_Invoke"); ok_ole_success(hr, "IPictureDisp_Invoke");
ok(V_VT(&varresult) == VT_I4, "V_VT(&varresult) should have been VT_UINT instead of %d\n", V_VT(&varresult));
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL); hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL);
ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr); ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
hr = IPictureDisp_Invoke(picdisp, 0xdeadbeef, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL); hr = IPictureDisp_Invoke(picdisp, 0xdeadbeef, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
todo_wine {
ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr); ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
}
dispparams.cArgs = 1;
dispparams.rgvarg = &vararg;
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08lx\n", hr);
dispparams.cArgs = 1;
dispparams.rgvarg = &vararg;
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08lx\n", hr);
IPictureDisp_Release(picdisp); IPictureDisp_Release(picdisp);
} }
......
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