oleaut32: Zero-init [out] only parameters.

This commit is contained in:
Huw Davies 2012-02-17 13:02:17 +00:00 committed by Alexandre Julliard
parent a91097ed33
commit be4d45cacb
2 changed files with 16 additions and 7 deletions

View file

@ -1118,7 +1118,7 @@ static void test_typelibmarshal(void)
VariantClear(&varresult);
/* call get_Name (direct) */
bstr = NULL;
bstr = (void *)0xdeadbeef;
hr = IWidget_get_Name(pWidget, &bstr);
ok_ole_success(hr, IWidget_get_Name);
ok(!lstrcmpW(bstr, szCat), "IWidget_get_Name should have returned string \"Cat\" instead of %s\n", wine_dbgstr_w(bstr));

View file

@ -723,7 +723,7 @@ serialize_param(
return S_OK;
}
case VT_BSTR: {
if (debugout) {
if (writeit && debugout) {
if (*arg)
TRACE_(olerelay)("%s",relaystr((WCHAR*)*arg));
else
@ -1402,11 +1402,20 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
TRACE_(olerelay)("%s=",relaystr(names[i+1]));
}
/* No need to marshal other data than FIN and any VT_PTR. */
if (!is_in_elem(elem) && (elem->tdesc.vt != VT_PTR)) {
xargs+=_argsize(&elem->tdesc, tinfo);
if (relaydeb) TRACE_(olerelay)("[out]");
continue;
}
if (!is_in_elem(elem))
{
if (elem->tdesc.vt != VT_PTR)
{
xargs+=_argsize(&elem->tdesc, tinfo);
if (relaydeb) TRACE_(olerelay)("[out]");
continue;
}
else
{
memset( *(void **)xargs, 0, _xsize( elem->tdesc.u.lptdesc, tinfo ) );
}
}
hres = serialize_param(
tinfo,
is_in_elem(elem),