On Sun, 13 Oct 2002, Greg Turner wrote:
LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, va_list args) {
FIXME("(pStubDec == ^%p,pFormat = "%s",...): stub\n", pStubDesc, pFormat);
PRPC_CLIENT_INTERFACE rpc_cli_if = (PRPC_CLIENT_INTERFACE)(pStubDesc->RpcInterfaceInformation);
(hmm, does this even compile? I didn't think C allowed variable declarations after statements)
TRACE("rpc_cli_if == ^%p\n", rpc_cli_if);
TRACE("rpc_cli_if: Length == %d; InterfaceID == <%s,<%d.%d>>; TransferSyntax == <%s,<%d.%d>>; DispatchTable == ^%p; RpcProtseqEndpointCount == %d; RpcProtseqEndpoint == ^%p; Flags == %d\n", rpc_cli_if->Length, debugstr_guid(&rpc_cli_if->InterfaceId.SyntaxGUID), rpc_cli_if->InterfaceId.SyntaxVersion.MajorVersion, rpc_cli_if->InterfaceId.SyntaxVersion.MinorVersion, debugstr_guid(&rpc_cli_if->TransferSyntax.SyntaxGUID), rpc_cli_if->TransferSyntax.SyntaxVersion.MajorVersion, rpc_cli_if->TransferSyntax.SyntaxVersion.MinorVersion, rpc_cli_if->DispatchTable, rpc_cli_if->RpcProtseqEndpointCount, rpc_cli_if->RpcProtseqEndpoint, rpc_cli_if->Flags);
return 0; }
but that doesn't work out. It blows up:
greg@yodull midled $ wine --dll rpcrt4,msvcrt=b --debugmsg +ole helloc trace:ole:RpcStringBindingComposeA ((null),"ncacn_np",(null),"\pipe\hello",(null),0x406d2ddc) RpcStringBindingCompose returned 0x0 pszStringBinding = ncacn_np:[\pipe\hello] trace:ole:RpcBindingFromStringBindingA ("ncacn_np:[\pipe\hello]",0x403224) trace:ole:RpcStringBindingParseA ("ncacn_np:[\pipe\hello]",0x406d2d68,0x406d2d6c,0x406d2d70,0x406d2d74,0x406d2d78) trace:ole:RPCRT4_CreateBindingA binding: 0x403b4970 trace:ole:RPCRT4_SetBindingObject (*RpcBinding == ^0x403b4970, UUID == {00000000-0000-0000-0000-000000000000}) trace:ole:RPCRT4_CompleteBindingA (RpcBinding == ^0x403b4970, NetworkAddr == "", EndPoint == "\pipe\hello", NetworkOptions == "(null)") RpcBindingFromStringBinding returned 0x0 Calling the remote procedure 'HelloProc' Print the string 'hello, world' on the server trace:ole:NdrClientCall2 (0x4020c2,0x406d2da4,...) fixme:ole:RPCRT4_NdrClientCall2 (pStubDec == ^0x4020c2,pFormat = "0@",...): stub trace:ole:RPCRT4_NdrClientCall2 rpc_cli_if = ^0x4832 Runtime reported exception 0xc0000005 = -1073741819
Obviously, it never succesfully displays the big trace stmt, probably crashing deferincing the suspicious-looking "0x4832" pointer...
The pStubDesc structure should have been initialized (including setting that pointer, I think) by the NdrClientInitialize or NdrClientInitializeNew (or for DCOM, NdrProxyInitialize, but perhaps NdrProxyInitialize should call down to NdrClientInitialize/New anyway) functions. My patches didn't implement those functions, since I was mostly concerned with DCOM. Is this a real RPC app that works on Windows you're working on?