2002-10-10 19:23:33 +00:00
|
|
|
|
/*
|
|
|
|
|
* NDR client stuff
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2001 Ove K<EFBFBD>ven, TransGaming Technologies
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*
|
|
|
|
|
* TODO:
|
2002-10-19 19:17:19 +00:00
|
|
|
|
* - Exception handling
|
|
|
|
|
* - Context stuff
|
|
|
|
|
* - Who knows
|
2002-10-10 19:23:33 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
|
#include "winbase.h"
|
|
|
|
|
#include "winerror.h"
|
|
|
|
|
#include "winreg.h"
|
|
|
|
|
|
|
|
|
|
#include "rpc.h"
|
|
|
|
|
#include "rpcndr.h"
|
|
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
|
|
#include "ndr_misc.h"
|
|
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
|
|
|
|
|
2002-10-16 18:51:11 +00:00
|
|
|
|
LONG_PTR /* CLIENT_CALL_RETURN */ RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, va_list args)
|
2002-10-10 19:23:33 +00:00
|
|
|
|
{
|
2002-10-18 03:56:56 +00:00
|
|
|
|
|
|
|
|
|
RPC_CLIENT_INTERFACE *rpc_cli_if = (RPC_CLIENT_INTERFACE *)(pStubDesc->RpcInterfaceInformation);
|
2002-10-19 19:17:19 +00:00
|
|
|
|
LONG_PTR ret = 0;
|
|
|
|
|
RPC_BINDING_HANDLE handle = 0;
|
|
|
|
|
RPC_MESSAGE rpcmsg;
|
|
|
|
|
MIDL_STUB_MESSAGE stubmsg;
|
|
|
|
|
|
|
|
|
|
TRACE("(pStubDec == ^%p,pFormat = ^%p,...): semi-stub\n", pStubDesc, pFormat);
|
|
|
|
|
if (rpc_cli_if) /* NULL for objects */ {
|
|
|
|
|
TRACE(" *rpc_cli_if (== ^%p) == (RPC_CLIENT_INTERFACE):\n", pStubDesc);
|
|
|
|
|
TRACE(" Length == %d\n", rpc_cli_if->Length);
|
|
|
|
|
TRACE(" InterfaceID == %s (%d.%d)\n", debugstr_guid(&rpc_cli_if->InterfaceId.SyntaxGUID),
|
|
|
|
|
rpc_cli_if->InterfaceId.SyntaxVersion.MajorVersion, rpc_cli_if->InterfaceId.SyntaxVersion.MinorVersion);
|
|
|
|
|
TRACE(" TransferSyntax == %s (%d.%d)\n", debugstr_guid(&rpc_cli_if->TransferSyntax.SyntaxGUID),
|
|
|
|
|
rpc_cli_if->TransferSyntax.SyntaxVersion.MajorVersion, rpc_cli_if->TransferSyntax.SyntaxVersion.MinorVersion);
|
|
|
|
|
TRACE(" DispatchTable == ^%p\n", rpc_cli_if->DispatchTable);
|
|
|
|
|
TRACE(" RpcProtseqEndpointCount == ^%d\n", rpc_cli_if->RpcProtseqEndpointCount);
|
|
|
|
|
TRACE(" RpcProtseqEndpoint == ^%p\n", rpc_cli_if->RpcProtseqEndpoint);
|
|
|
|
|
TRACE(" Flags == ^%d\n", rpc_cli_if->Flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NdrClientInitializeNew( &rpcmsg, &stubmsg, pStubDesc, 0 );
|
|
|
|
|
|
|
|
|
|
handle = (RPC_BINDING_HANDLE)0xdeadbeef; /* FIXME: dce uses interop_binding_handle; */
|
2002-10-18 03:56:56 +00:00
|
|
|
|
|
2002-10-19 19:17:19 +00:00
|
|
|
|
stubmsg.BufferLength = 0; /* FIXME */
|
2002-10-18 03:56:56 +00:00
|
|
|
|
|
2002-10-19 19:17:19 +00:00
|
|
|
|
NdrGetBuffer( &stubmsg, stubmsg.BufferLength, handle );
|
|
|
|
|
NdrSendReceive( &stubmsg, stubmsg.Buffer );
|
|
|
|
|
NdrFreeBuffer( &stubmsg );
|
|
|
|
|
|
|
|
|
|
return ret;
|
2002-10-10 19:23:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
* NdrClientCall2 [RPCRT4.@]
|
|
|
|
|
*/
|
2002-10-16 18:51:11 +00:00
|
|
|
|
LONG_PTR /* CLIENT_CALL_RETURN */ WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
|
|
|
|
|
PFORMAT_STRING pFormat, ...)
|
2002-10-10 19:23:33 +00:00
|
|
|
|
{
|
2002-10-16 18:51:11 +00:00
|
|
|
|
LONG_PTR ret;
|
2002-10-10 19:23:33 +00:00
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
|
|
TRACE("(%p,%p,...)\n", pStubDesc, pFormat);
|
|
|
|
|
|
|
|
|
|
va_start(args, pFormat);
|
2002-10-16 18:51:11 +00:00
|
|
|
|
ret = RPCRT4_NdrClientCall2(pStubDesc, pFormat, args);
|
2002-10-10 19:23:33 +00:00
|
|
|
|
va_end(args);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|