Fix typelib marshaller relaying, add a comment describing what it is,

don't print the ugly L"" parts of Unicode strings in the relay trace.
This commit is contained in:
Mike Hearn 2004-06-17 23:03:26 +00:00 committed by Alexandre Julliard
parent de9af2414b
commit d440ca4a89
1 changed files with 79 additions and 69 deletions

View File

@ -3,6 +3,9 @@
* *
* Copyright 2002 Marcus Meissner * Copyright 2002 Marcus Meissner
* *
* The olerelay debug channel allows you to see calls marshalled by
* the typelib marshaller. It is not a generic COM relaying system.
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -59,6 +62,14 @@ typedef struct _marshal_state {
IID iid; /* HACK: for VT_VOID */ IID iid; /* HACK: for VT_VOID */
} marshal_state; } marshal_state;
/* used in the olerelay code to avoid having the L"" stuff added by debugstr_w */
static char *relaystr(WCHAR *in) {
char *tmp = (char *)debugstr_w(in);
tmp += 2;
tmp[strlen(tmp)-1] = '\0';
return tmp;
}
static HRESULT static HRESULT
xbuf_add(marshal_state *buf, LPBYTE stuff, DWORD size) { xbuf_add(marshal_state *buf, LPBYTE stuff, DWORD size) {
while (buf->size - buf->curoff < size) { while (buf->size - buf->curoff < size) {
@ -429,7 +440,7 @@ serialize_param(
case VT_UI2: case VT_UI2:
case VT_UI1: case VT_UI1:
hres = S_OK; hres = S_OK;
if (debugout) MESSAGE("%lx",*arg); if (debugout) TRACE_(olerelay)("%lx",*arg);
if (writeit) if (writeit)
hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD)); hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
return hres; return hres;
@ -438,7 +449,7 @@ serialize_param(
VARIANT *vt = (VARIANT*)arg; VARIANT *vt = (VARIANT*)arg;
DWORD vttype = V_VT(vt); DWORD vttype = V_VT(vt);
if (debugout) MESSAGE("Vt(%ld)(",vttype); if (debugout) TRACE_(olerelay)("Vt(%ld)(",vttype);
tdesc2.vt = vttype; tdesc2.vt = vttype;
if (writeit) { if (writeit) {
hres = xbuf_add(buf,(LPBYTE)&vttype,sizeof(vttype)); hres = xbuf_add(buf,(LPBYTE)&vttype,sizeof(vttype));
@ -446,15 +457,15 @@ serialize_param(
} }
/* need to recurse since we need to free the stuff */ /* need to recurse since we need to free the stuff */
hres = serialize_param(tinfo,writeit,debugout,dealloc,&tdesc2,&(V_I4(vt)),buf); hres = serialize_param(tinfo,writeit,debugout,dealloc,&tdesc2,&(V_I4(vt)),buf);
if (debugout) MESSAGE(")"); if (debugout) TRACE_(olerelay)(")");
return hres; return hres;
} }
case VT_BSTR: { case VT_BSTR: {
if (debugout) { if (debugout) {
if (arg) if (arg)
MESSAGE("%s",debugstr_w((BSTR)*arg)); TRACE_(olerelay)("%s",relaystr((BSTR)*arg));
else else
MESSAGE("<bstr NULL>"); TRACE_(olerelay)("<bstr NULL>");
} }
if (writeit) { if (writeit) {
if (!*arg) { if (!*arg) {
@ -478,7 +489,7 @@ serialize_param(
case VT_PTR: { case VT_PTR: {
DWORD cookie; DWORD cookie;
if (debugout) MESSAGE("*"); if (debugout) TRACE_(olerelay)("*");
if (writeit) { if (writeit) {
cookie = *arg ? 0x42424242 : 0; cookie = *arg ? 0x42424242 : 0;
hres = xbuf_add(buf,(LPBYTE)&cookie,sizeof(cookie)); hres = xbuf_add(buf,(LPBYTE)&cookie,sizeof(cookie));
@ -486,7 +497,7 @@ serialize_param(
return hres; return hres;
} }
if (!*arg) { if (!*arg) {
if (debugout) MESSAGE("NULL"); if (debugout) TRACE_(olerelay)("NULL");
return S_OK; return S_OK;
} }
hres = serialize_param(tinfo,writeit,debugout,dealloc,tdesc->u.lptdesc,(DWORD*)*arg,buf); hres = serialize_param(tinfo,writeit,debugout,dealloc,tdesc->u.lptdesc,(DWORD*)*arg,buf);
@ -494,17 +505,17 @@ serialize_param(
return hres; return hres;
} }
case VT_UNKNOWN: case VT_UNKNOWN:
if (debugout) MESSAGE("unk(0x%lx)",*arg); if (debugout) TRACE_(olerelay)("unk(0x%lx)",*arg);
if (writeit) if (writeit)
hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg); hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
return hres; return hres;
case VT_DISPATCH: case VT_DISPATCH:
if (debugout) MESSAGE("idisp(0x%lx)",*arg); if (debugout) TRACE_(olerelay)("idisp(0x%lx)",*arg);
if (writeit) if (writeit)
hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg); hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg);
return hres; return hres;
case VT_VOID: case VT_VOID:
if (debugout) MESSAGE("<void>"); if (debugout) TRACE_(olerelay)("<void>");
return S_OK; return S_OK;
case VT_USERDEFINED: { case VT_USERDEFINED: {
ITypeInfo *tinfo2; ITypeInfo *tinfo2;
@ -524,7 +535,7 @@ serialize_param(
break; break;
case TKIND_RECORD: { case TKIND_RECORD: {
int i; int i;
if (debugout) MESSAGE("{"); if (debugout) TRACE_(olerelay)("{");
for (i=0;i<tattr->cVars;i++) { for (i=0;i<tattr->cVars;i++) {
VARDESC *vdesc; VARDESC *vdesc;
ELEMDESC *elem2; ELEMDESC *elem2;
@ -543,7 +554,7 @@ serialize_param(
ERR("Need more names!\n"); ERR("Need more names!\n");
} }
if (!hres && debugout) if (!hres && debugout)
MESSAGE("%s=",debugstr_w(names[0])); TRACE_(olerelay)("%s=",relaystr(names[0]));
*/ */
elem2 = &vdesc->elemdescVar; elem2 = &vdesc->elemdescVar;
tdesc2 = &elem2->tdesc; tdesc2 = &elem2->tdesc;
@ -559,11 +570,11 @@ serialize_param(
if (hres!=S_OK) if (hres!=S_OK)
return hres; return hres;
if (debugout && (i<(tattr->cVars-1))) if (debugout && (i<(tattr->cVars-1)))
MESSAGE(","); TRACE_(olerelay)(",");
} }
if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID))) if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID)))
memcpy(&(buf->iid),arg,sizeof(buf->iid)); memcpy(&(buf->iid),arg,sizeof(buf->iid));
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
break; break;
} }
default: default:
@ -578,19 +589,19 @@ serialize_param(
ARRAYDESC *adesc = tdesc->u.lpadesc; ARRAYDESC *adesc = tdesc->u.lpadesc;
int i, arrsize = 1; int i, arrsize = 1;
if (debugout) MESSAGE("carr"); if (debugout) TRACE_(olerelay)("carr");
for (i=0;i<adesc->cDims;i++) { for (i=0;i<adesc->cDims;i++) {
if (debugout) MESSAGE("[%ld]",adesc->rgbounds[i].cElements); if (debugout) TRACE_(olerelay)("[%ld]",adesc->rgbounds[i].cElements);
arrsize *= adesc->rgbounds[i].cElements; arrsize *= adesc->rgbounds[i].cElements;
} }
if (debugout) MESSAGE("["); if (debugout) TRACE_(olerelay)("[");
for (i=0;i<arrsize;i++) { for (i=0;i<arrsize;i++) {
hres = serialize_param(tinfo, writeit, debugout, dealloc, &adesc->tdescElem, (DWORD*)((LPBYTE)arg+i*_xsize(&adesc->tdescElem)), buf); hres = serialize_param(tinfo, writeit, debugout, dealloc, &adesc->tdescElem, (DWORD*)((LPBYTE)arg+i*_xsize(&adesc->tdescElem)), buf);
if (hres) if (hres)
return hres; return hres;
if (debugout && (i<arrsize-1)) MESSAGE(","); if (debugout && (i<arrsize-1)) TRACE_(olerelay)(",");
} }
if (debugout) MESSAGE("]"); if (debugout) TRACE_(olerelay)("]");
return S_OK; return S_OK;
} }
default: default:
@ -626,11 +637,11 @@ serialize_LPVOID_ptr(
return hres; return hres;
} }
if (!*arg) { if (!*arg) {
if (debugout) MESSAGE("<lpvoid NULL>"); if (debugout) TRACE_(olerelay)("<lpvoid NULL>");
return S_OK; return S_OK;
} }
if (debugout) if (debugout)
MESSAGE("ppv(%p)",*(LPUNKNOWN*)*arg); TRACE_(olerelay)("ppv(%p)",*(LPUNKNOWN*)*arg);
if (writeit) { if (writeit) {
hres = _marshal_interface(buf,&(buf->iid),*(LPUNKNOWN*)*arg); hres = _marshal_interface(buf,&(buf->iid),*(LPUNKNOWN*)*arg);
if (hres) if (hres)
@ -668,7 +679,7 @@ serialize_DISPPARAM_ptr(
return hres; return hres;
} }
if (!*arg) { if (!*arg) {
if (debugout) MESSAGE("<DISPPARAMS NULL>"); if (debugout) TRACE_(olerelay)("<DISPPARAMS NULL>");
return S_OK; return S_OK;
} }
disp = (DISPPARAMS*)*arg; disp = (DISPPARAMS*)*arg;
@ -677,7 +688,7 @@ serialize_DISPPARAM_ptr(
if (hres) if (hres)
return hres; return hres;
} }
if (debugout) MESSAGE("D{"); if (debugout) TRACE_(olerelay)("D{");
for (i=0;i<disp->cArgs;i++) { for (i=0;i<disp->cArgs;i++) {
TYPEDESC vtdesc; TYPEDESC vtdesc;
@ -692,7 +703,7 @@ serialize_DISPPARAM_ptr(
buf buf
); );
if (debugout && (i<disp->cArgs-1)) if (debugout && (i<disp->cArgs-1))
MESSAGE(","); TRACE_(olerelay)(",");
} }
if (dealloc) if (dealloc)
HeapFree(GetProcessHeap(),0,disp->rgvarg); HeapFree(GetProcessHeap(),0,disp->rgvarg);
@ -701,7 +712,7 @@ serialize_DISPPARAM_ptr(
if (hres) if (hres)
return hres; return hres;
} }
if (debugout) MESSAGE("}{"); if (debugout) TRACE_(olerelay)("}{");
for (i=0;i<disp->cNamedArgs;i++) { for (i=0;i<disp->cNamedArgs;i++) {
TYPEDESC vtdesc; TYPEDESC vtdesc;
@ -716,9 +727,9 @@ serialize_DISPPARAM_ptr(
buf buf
); );
if (debugout && (i<disp->cNamedArgs-1)) if (debugout && (i<disp->cNamedArgs-1))
MESSAGE(","); TRACE_(olerelay)(",");
} }
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
if (dealloc) { if (dealloc) {
HeapFree(GetProcessHeap(),0,disp->rgdispidNamedArgs); HeapFree(GetProcessHeap(),0,disp->rgdispidNamedArgs);
HeapFree(GetProcessHeap(),0,disp); HeapFree(GetProcessHeap(),0,disp);
@ -743,10 +754,10 @@ deserialize_param(
while (1) { while (1) {
switch (tdesc->vt) { switch (tdesc->vt) {
case VT_EMPTY: case VT_EMPTY:
if (debugout) MESSAGE("<empty>"); if (debugout) TRACE_(olerelay)("<empty>");
return S_OK; return S_OK;
case VT_NULL: case VT_NULL:
if (debugout) MESSAGE("<null>"); if (debugout) TRACE_(olerelay)("<null>");
return S_OK; return S_OK;
case VT_VARIANT: { case VT_VARIANT: {
VARIANT *vt = (VARIANT*)arg; VARIANT *vt = (VARIANT*)arg;
@ -762,9 +773,9 @@ deserialize_param(
memset(&tdesc2,0,sizeof(tdesc2)); memset(&tdesc2,0,sizeof(tdesc2));
tdesc2.vt = vttype; tdesc2.vt = vttype;
V_VT(vt) = vttype; V_VT(vt) = vttype;
if (debugout) MESSAGE("Vt(%ld)(",vttype); if (debugout) TRACE_(olerelay)("Vt(%ld)(",vttype);
hres = deserialize_param(tinfo, readit, debugout, alloc, &tdesc2, &(V_I4(vt)), buf); hres = deserialize_param(tinfo, readit, debugout, alloc, &tdesc2, &(V_I4(vt)), buf);
MESSAGE(")"); TRACE_(olerelay)(")");
return hres; return hres;
} else { } else {
VariantInit(vt); VariantInit(vt);
@ -779,7 +790,7 @@ deserialize_param(
hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD)); hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
if (hres) FIXME("Failed to read integer 4 byte\n"); if (hres) FIXME("Failed to read integer 4 byte\n");
} }
if (debugout) MESSAGE("%lx",*arg); if (debugout) TRACE_(olerelay)("%lx",*arg);
return hres; return hres;
case VT_BSTR: { case VT_BSTR: {
WCHAR *str; WCHAR *str;
@ -793,7 +804,7 @@ deserialize_param(
} }
if (len == -1) { if (len == -1) {
*arg = 0; *arg = 0;
if (debugout) MESSAGE("<bstr NULL>"); if (debugout) TRACE_(olerelay)("<bstr NULL>");
} else { } else {
str = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,len+sizeof(WCHAR)); str = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,len+sizeof(WCHAR));
hres = xbuf_get(buf,(LPBYTE)str,len); hres = xbuf_get(buf,(LPBYTE)str,len);
@ -802,7 +813,7 @@ deserialize_param(
return hres; return hres;
} }
*arg = (DWORD)SysAllocStringLen(str,len); *arg = (DWORD)SysAllocStringLen(str,len);
if (debugout) MESSAGE("%s",debugstr_w(str)); if (debugout) TRACE_(olerelay)("%s",relaystr(str));
HeapFree(GetProcessHeap(),0,str); HeapFree(GetProcessHeap(),0,str);
} }
} else { } else {
@ -823,11 +834,11 @@ deserialize_param(
return hres; return hres;
} }
if (cookie != 0x42424242) { if (cookie != 0x42424242) {
if (debugout) MESSAGE("NULL"); if (debugout) TRACE_(olerelay)("NULL");
*arg = 0; *arg = 0;
return S_OK; return S_OK;
} }
if (debugout) MESSAGE("*"); if (debugout) TRACE_(olerelay)("*");
} }
if (alloc) { if (alloc) {
if (derefhere) if (derefhere)
@ -846,17 +857,17 @@ deserialize_param(
if (readit) if (readit)
hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg); hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg);
if (debugout) if (debugout)
MESSAGE("unk(%p)",arg); TRACE_(olerelay)("unk(%p)",arg);
return hres; return hres;
case VT_DISPATCH: case VT_DISPATCH:
hres = S_OK; hres = S_OK;
if (readit) if (readit)
hres = _unmarshal_interface(buf,&IID_IDispatch,(LPUNKNOWN*)arg); hres = _unmarshal_interface(buf,&IID_IDispatch,(LPUNKNOWN*)arg);
if (debugout) if (debugout)
MESSAGE("idisp(%p)",arg); TRACE_(olerelay)("idisp(%p)",arg);
return hres; return hres;
case VT_VOID: case VT_VOID:
if (debugout) MESSAGE("<void>"); if (debugout) TRACE_(olerelay)("<void>");
return S_OK; return S_OK;
case VT_USERDEFINED: { case VT_USERDEFINED: {
ITypeInfo *tinfo2; ITypeInfo *tinfo2;
@ -882,7 +893,7 @@ deserialize_param(
case TKIND_RECORD: { case TKIND_RECORD: {
int i; int i;
if (debugout) MESSAGE("{"); if (debugout) TRACE_(olerelay)("{");
for (i=0;i<tattr->cVars;i++) { for (i=0;i<tattr->cVars;i++) {
VARDESC *vdesc; VARDESC *vdesc;
@ -900,11 +911,11 @@ deserialize_param(
(DWORD*)(((LPBYTE)*arg)+vdesc->u.oInst), (DWORD*)(((LPBYTE)*arg)+vdesc->u.oInst),
buf buf
); );
if (debugout && (i<tattr->cVars-1)) MESSAGE(","); if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(",");
} }
if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID))) if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID)))
memcpy(&(buf->iid),(LPBYTE)*arg,sizeof(buf->iid)); memcpy(&(buf->iid),(LPBYTE)*arg,sizeof(buf->iid));
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
break; break;
} }
default: default:
@ -973,7 +984,7 @@ deserialize_LPVOID_ptr(
return hres; return hres;
if (cookie != 0x42424242) { if (cookie != 0x42424242) {
*(DWORD*)*arg = 0; *(DWORD*)*arg = 0;
if (debugout) MESSAGE("<lpvoid NULL>"); if (debugout) TRACE_(olerelay)("<lpvoid NULL>");
return S_OK; return S_OK;
} }
} }
@ -982,7 +993,7 @@ deserialize_LPVOID_ptr(
if (hres) if (hres)
return hres; return hres;
} }
if (debugout) MESSAGE("ppv(%p)",(LPVOID)*arg); if (debugout) TRACE_(olerelay)("ppv(%p)",(LPVOID)*arg);
return S_OK; return S_OK;
} }
@ -1011,7 +1022,7 @@ deserialize_DISPPARAM_ptr(
return hres; return hres;
if (cookie == 0) { if (cookie == 0) {
*arg = 0; *arg = 0;
if (debugout) MESSAGE("<DISPPARAMS NULL>"); if (debugout) TRACE_(olerelay)("<DISPPARAMS NULL>");
return S_OK; return S_OK;
} }
} }
@ -1025,7 +1036,7 @@ deserialize_DISPPARAM_ptr(
return hres; return hres;
if (alloc) if (alloc)
disps->rgvarg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(VARIANT)*disps->cArgs); disps->rgvarg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(VARIANT)*disps->cArgs);
if (debugout) MESSAGE("D{"); if (debugout) TRACE_(olerelay)("D{");
for (i=0; i< disps->cArgs; i++) { for (i=0; i< disps->cArgs; i++) {
TYPEDESC vdesc; TYPEDESC vdesc;
@ -1040,7 +1051,7 @@ deserialize_DISPPARAM_ptr(
buf buf
); );
} }
if (debugout) MESSAGE("}{"); if (debugout) TRACE_(olerelay)("}{");
hres = xbuf_get(buf, (LPBYTE)&disps->cNamedArgs, sizeof(disps->cNamedArgs)); hres = xbuf_get(buf, (LPBYTE)&disps->cNamedArgs, sizeof(disps->cNamedArgs));
if (hres) if (hres)
return hres; return hres;
@ -1060,10 +1071,10 @@ deserialize_DISPPARAM_ptr(
(DWORD*)(disps->rgdispidNamedArgs+i), (DWORD*)(disps->rgdispidNamedArgs+i),
buf buf
); );
if (debugout && i<(disps->cNamedArgs-1)) MESSAGE(","); if (debugout && i<(disps->cNamedArgs-1)) TRACE_(olerelay)(",");
} }
} }
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
return S_OK; return S_OK;
} }
@ -1139,16 +1150,15 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
return 0; return 0;
} }
/*dump_FUNCDESC(fdesc);*/
if (relaydeb) { if (relaydeb) {
TRACE_(olerelay)("->"); TRACE_(olerelay)("\n->");
if (iname) if (iname)
MESSAGE("%s:",debugstr_w(iname)); TRACE_(olerelay)("%s:",relaystr(iname));
if (fname) if (fname)
MESSAGE("%s(%d)",debugstr_w(fname),method); TRACE_(olerelay)("%s(%d)",relaystr(fname),method);
else else
MESSAGE("%d",method); TRACE_(olerelay)("%d",method);
MESSAGE("("); TRACE_(olerelay)("(");
if (iname) SysFreeString(iname); if (iname) SysFreeString(iname);
if (fname) SysFreeString(fname); if (fname) SysFreeString(fname);
} }
@ -1163,21 +1173,21 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
buf.iid = IID_IUnknown; buf.iid = IID_IUnknown;
if (method == 0) { if (method == 0) {
xbuf_add(&buf,(LPBYTE)args[0],sizeof(IID)); xbuf_add(&buf,(LPBYTE)args[0],sizeof(IID));
if (relaydeb) MESSAGE("riid=%s,[out]",debugstr_guid((REFIID)args[0])); if (relaydeb) TRACE_(olerelay)("riid=%s,[out]",debugstr_guid((REFIID)args[0]));
} else { } else {
xargs = args; xargs = args;
for (i=0;i<fdesc->cParams;i++) { for (i=0;i<fdesc->cParams;i++) {
ELEMDESC *elem = fdesc->lprgelemdescParam+i; ELEMDESC *elem = fdesc->lprgelemdescParam+i;
BOOL isserialized = FALSE; BOOL isserialized = FALSE;
if (relaydeb) { if (relaydeb) {
if (i) MESSAGE(","); if (i) TRACE_(olerelay)(",");
if (i+1<nrofnames && names[i+1]) if (i+1<nrofnames && names[i+1])
MESSAGE("%s=",debugstr_w(names[i+1])); TRACE_(olerelay)("%s=",relaystr(names[i+1]));
} }
/* No need to marshal other data than FIN */ /* No need to marshal other data than FIN */
if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN)) { if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN)) {
xargs+=_argsize(elem->tdesc.vt); xargs+=_argsize(elem->tdesc.vt);
if (relaydeb) MESSAGE("[out]"); if (relaydeb) TRACE_(olerelay)("[out]");
continue; continue;
} }
if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) { if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) {
@ -1231,7 +1241,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
xargs+=_argsize(elem->tdesc.vt); xargs+=_argsize(elem->tdesc.vt);
} }
} }
if (relaydeb) MESSAGE(")"); if (relaydeb) TRACE_(olerelay)(")");
memset(&msg,0,sizeof(msg)); memset(&msg,0,sizeof(msg));
msg.cbBuffer = buf.curoff; msg.cbBuffer = buf.curoff;
msg.iMethod = method; msg.iMethod = method;
@ -1241,14 +1251,14 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
return hres; return hres;
} }
memcpy(msg.Buffer,buf.base,buf.curoff); memcpy(msg.Buffer,buf.base,buf.curoff);
if (relaydeb) MESSAGE("\n"); if (relaydeb) TRACE_(olerelay)("\n");
hres = IRpcChannelBuffer_SendReceive(tpinfo->chanbuf,&msg,&status); hres = IRpcChannelBuffer_SendReceive(tpinfo->chanbuf,&msg,&status);
if (hres) { if (hres) {
FIXME("RpcChannelBuffer SendReceive failed, %lx\n",hres); FIXME("RpcChannelBuffer SendReceive failed, %lx\n",hres);
return hres; return hres;
} }
relaydeb = TRACE_ON(olerelay);
if (relaydeb) MESSAGE(" = %08lx (",status); if (relaydeb) TRACE_(olerelay)(" = %08lx (",status);
if (buf.base) if (buf.base)
buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer); buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer);
else else
@ -1258,7 +1268,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
buf.curoff = 0; buf.curoff = 0;
if (method == 0) { if (method == 0) {
_unmarshal_interface(&buf,(REFIID)args[0],(LPUNKNOWN*)args[1]); _unmarshal_interface(&buf,(REFIID)args[0],(LPUNKNOWN*)args[1]);
if (relaydeb) MESSAGE("[in],%p",*((DWORD**)args[1])); if (relaydeb) TRACE_(olerelay)("[in],%p",*((DWORD**)args[1]));
} else { } else {
xargs = args; xargs = args;
for (i=0;i<fdesc->cParams;i++) { for (i=0;i<fdesc->cParams;i++) {
@ -1266,13 +1276,13 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
BOOL isdeserialized = FALSE; BOOL isdeserialized = FALSE;
if (relaydeb) { if (relaydeb) {
if (i) MESSAGE(","); if (i) TRACE_(olerelay)(",");
if (i+1<nrofnames && names[i+1]) MESSAGE("%s=",debugstr_w(names[i+1])); if (i+1<nrofnames && names[i+1]) TRACE_(olerelay)("%s=",relaystr(names[i+1]));
} }
/* No need to marshal other data than FOUT I think */ /* No need to marshal other data than FOUT I think */
if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT)) { if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT)) {
xargs += _argsize(elem->tdesc.vt); xargs += _argsize(elem->tdesc.vt);
if (relaydeb) MESSAGE("[in]"); if (relaydeb) TRACE_(olerelay)("[in]");
continue; continue;
} }
if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) { if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) {
@ -1329,7 +1339,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
xargs += _argsize(elem->tdesc.vt); xargs += _argsize(elem->tdesc.vt);
} }
} }
if (relaydeb) MESSAGE(")\n\n"); if (relaydeb) TRACE_(olerelay)(")\n\n");
HeapFree(GetProcessHeap(),0,buf.base); HeapFree(GetProcessHeap(),0,buf.base);
return status; return status;
} }
@ -1580,7 +1590,7 @@ TMStubImpl_Invoke(
); );
xargs += _argsize(elem->tdesc.vt); xargs += _argsize(elem->tdesc.vt);
if (hres) { if (hres) {
FIXME("Failed to deserialize param %s, hres %lx\n",debugstr_w(names[i+1]),hres); FIXME("Failed to deserialize param %s, hres %lx\n",relaystr(names[i+1]),hres);
break; break;
} }
} }