Commit 34f1d8a2 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

oleaut32: Handle LCID arguments in ITypeInfo::Invoke.

parent 1327ae0c
...@@ -1299,7 +1299,6 @@ static void test_typelibmarshal(void) ...@@ -1299,7 +1299,6 @@ static void test_typelibmarshal(void)
dispparams.rgvarg = vararg; dispparams.rgvarg = vararg;
VariantInit(&varresult); VariantInit(&varresult);
hr = IDispatch_Invoke(pDispatch, DISPID_TM_PROP_WITH_LCID, &IID_NULL, 0x40c, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL); hr = IDispatch_Invoke(pDispatch, DISPID_TM_PROP_WITH_LCID, &IID_NULL, 0x40c, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
todo_wine
ok_ole_success(hr, ITypeInfo_Invoke); ok_ole_success(hr, ITypeInfo_Invoke);
VariantClear(&varresult); VariantClear(&varresult);
...@@ -1309,12 +1308,9 @@ todo_wine ...@@ -1309,12 +1308,9 @@ todo_wine
dispparams.rgvarg = NULL; dispparams.rgvarg = NULL;
dispparams.rgdispidNamedArgs = NULL; dispparams.rgdispidNamedArgs = NULL;
hr = IDispatch_Invoke(pDispatch, DISPID_TM_PROP_WITH_LCID, &IID_NULL, 0x40c, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL); hr = IDispatch_Invoke(pDispatch, DISPID_TM_PROP_WITH_LCID, &IID_NULL, 0x40c, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
todo_wine
{
ok_ole_success(hr, ITypeInfo_Invoke); ok_ole_success(hr, ITypeInfo_Invoke);
ok(V_VT(&varresult) == VT_I4, "got %x\n", V_VT(&varresult)); ok(V_VT(&varresult) == VT_I4, "got %x\n", V_VT(&varresult));
ok(V_I4(&varresult) == 0x409, "got %x\n", V_I4(&varresult)); ok(V_I4(&varresult) == 0x409, "got %x\n", V_I4(&varresult));
}
VariantClear(&varresult); VariantClear(&varresult);
/* test propget of INT value */ /* test propget of INT value */
......
...@@ -930,6 +930,7 @@ typedef struct tagITypeLibImpl ...@@ -930,6 +930,7 @@ typedef struct tagITypeLibImpl
const ITypeCompVtbl *lpVtblTypeComp; const ITypeCompVtbl *lpVtblTypeComp;
LONG ref; LONG ref;
TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */ TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */
LCID lcid;
/* strings can be stored in tlb as multibyte strings BUT they are *always* /* strings can be stored in tlb as multibyte strings BUT they are *always*
* exported to the application as a UNICODE string. * exported to the application as a UNICODE string.
...@@ -2878,6 +2879,8 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) ...@@ -2878,6 +2879,8 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
pTypeLibImpl->LibAttr.wMinorVerNum = HIWORD(tlbHeader.version); pTypeLibImpl->LibAttr.wMinorVerNum = HIWORD(tlbHeader.version);
pTypeLibImpl->LibAttr.wLibFlags = (WORD) tlbHeader.flags & 0xffff;/* check mask */ pTypeLibImpl->LibAttr.wLibFlags = (WORD) tlbHeader.flags & 0xffff;/* check mask */
pTypeLibImpl->lcid = tlbHeader.lcid;
/* name, eventually add to a hash table */ /* name, eventually add to a hash table */
pTypeLibImpl->Name = MSFT_ReadName(&cx, tlbHeader.NameOffset); pTypeLibImpl->Name = MSFT_ReadName(&cx, tlbHeader.NameOffset);
...@@ -3099,9 +3102,9 @@ static DWORD SLTG_ReadLibBlk(LPVOID pLibBlk, ITypeLibImpl *pTypeLibImpl) ...@@ -3099,9 +3102,9 @@ static DWORD SLTG_ReadLibBlk(LPVOID pLibBlk, ITypeLibImpl *pTypeLibImpl)
ptr += 2; ptr += 2;
if(SUBLANGID(*(WORD*)ptr) == SUBLANG_NEUTRAL) if(SUBLANGID(*(WORD*)ptr) == SUBLANG_NEUTRAL)
pTypeLibImpl->LibAttr.lcid = MAKELCID(MAKELANGID(PRIMARYLANGID(*(WORD*)ptr),0),0); pTypeLibImpl->lcid = pTypeLibImpl->LibAttr.lcid = MAKELCID(MAKELANGID(PRIMARYLANGID(*(WORD*)ptr),0),0);
else else
pTypeLibImpl->LibAttr.lcid = 0; pTypeLibImpl->lcid = pTypeLibImpl->LibAttr.lcid = 0;
ptr += 2; ptr += 2;
ptr += 4; /* skip res12 */ ptr += 4; /* skip res12 */
...@@ -6063,6 +6066,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6063,6 +6066,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
VARTYPE *rgvt = INVBUF_GET_ARG_TYPE_ARRAY(buffer, func_desc->cParams); VARTYPE *rgvt = INVBUF_GET_ARG_TYPE_ARRAY(buffer, func_desc->cParams);
UINT cNamedArgs = pDispParams->cNamedArgs; UINT cNamedArgs = pDispParams->cNamedArgs;
DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs; DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs;
UINT vargs_converted=0;
hres = S_OK; hres = S_OK;
...@@ -6100,6 +6104,15 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6100,6 +6104,15 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags; USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags;
VARIANTARG *src_arg; VARIANTARG *src_arg;
if (wParamFlags & PARAMFLAG_FLCID)
{
VARIANTARG *arg;
arg = prgpvarg[i] = &rgvarg[i];
V_VT(arg) = VT_I4;
V_I4(arg) = This->pTypeLib->lcid;
continue;
}
if (cNamedArgs) if (cNamedArgs)
{ {
USHORT j; USHORT j;
...@@ -6112,7 +6125,10 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6112,7 +6125,10 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
} }
} }
else else
src_arg = i < pDispParams->cArgs ? &pDispParams->rgvarg[pDispParams->cArgs - 1 - i] : NULL; {
src_arg = vargs_converted < pDispParams->cArgs ? &pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted] : NULL;
vargs_converted++;
}
if (wParamFlags & PARAMFLAG_FRETVAL) if (wParamFlags & PARAMFLAG_FRETVAL)
{ {
...@@ -6278,10 +6294,15 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6278,10 +6294,15 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
V_VT(&varresult), func_desc->cParams, rgvt, V_VT(&varresult), func_desc->cParams, rgvt,
prgpvarg, &varresult); prgpvarg, &varresult);
vargs_converted = 0;
for (i = 0; i < func_desc->cParams; i++) for (i = 0; i < func_desc->cParams; i++)
{ {
USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags; USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags;
if (wParamFlags & PARAMFLAG_FRETVAL)
if (wParamFlags & PARAMFLAG_FLCID)
continue;
else if (wParamFlags & PARAMFLAG_FRETVAL)
{ {
if (TRACE_ON(ole)) if (TRACE_ON(ole))
{ {
...@@ -6309,11 +6330,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6309,11 +6330,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
} }
break; break;
} }
else if (i < pDispParams->cArgs) else if (vargs_converted < pDispParams->cArgs)
{ {
if (wParamFlags & PARAMFLAG_FOUT) if (wParamFlags & PARAMFLAG_FOUT)
{ {
VARIANTARG *arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - i]; VARIANTARG *arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted];
if ((rgvt[i] == VT_BYREF) && (V_VT(arg) != VT_BYREF)) if ((rgvt[i] == VT_BYREF) && (V_VT(arg) != VT_BYREF))
hres = VariantChangeType(arg, &rgvarg[i], 0, V_VT(arg)); hres = VariantChangeType(arg, &rgvarg[i], 0, V_VT(arg));
...@@ -6321,7 +6342,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6321,7 +6342,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
if (FAILED(hres)) if (FAILED(hres))
{ {
ERR("failed to convert param %d to vt %d\n", i, ERR("failed to convert param %d to vt %d\n", i,
V_VT(&pDispParams->rgvarg[pDispParams->cArgs - 1 - i])); V_VT(&pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted]));
break; break;
} }
} }
...@@ -6354,6 +6375,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -6354,6 +6375,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
} }
} }
VariantClear(&rgvarg[i]); VariantClear(&rgvarg[i]);
vargs_converted++;
} }
else if (wParamFlags & PARAMFLAG_FOPT) else if (wParamFlags & PARAMFLAG_FOPT)
{ {
......
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