Add support for impersonating a token.
[wine/multimedia.git] / dlls / rpcrt4 / ndr_stubless.c
blob40f8dcc6d3002b301063cf5b451d86f9ea795fd4
1 /*
2 * NDR client stuff
4 * Copyright 2001 Ove Kåven, TransGaming Technologies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * TODO:
21 * - Exception handling
22 * - Context stuff
23 * - Who knows
26 #include <stdarg.h>
27 #include <stdio.h>
28 #include <string.h>
30 #include "windef.h"
31 #include "winbase.h"
32 #include "winerror.h"
33 #include "winreg.h"
35 #include "rpc.h"
36 #include "rpcndr.h"
38 #include "wine/debug.h"
40 #include "ndr_misc.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(ole);
44 /***********************************************************************
45 * Note: this should return a CLIENT_CALL_RETURN, but calling convention for
46 * returning structures/unions is different between Windows and gcc on i386.
48 LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, va_list args)
51 RPC_CLIENT_INTERFACE *rpc_cli_if = (RPC_CLIENT_INTERFACE *)(pStubDesc->RpcInterfaceInformation);
52 LONG_PTR ret = 0;
54 RPC_BINDING_HANDLE handle = 0;
55 RPC_MESSAGE rpcmsg;
56 MIDL_STUB_MESSAGE stubmsg;
59 FIXME("(pStubDec == ^%p,pFormat = ^%p,...): stub\n", pStubDesc, pFormat);
60 if (rpc_cli_if) /* NULL for objects */ {
61 TRACE(" *rpc_cli_if (== ^%p) == (RPC_CLIENT_INTERFACE):\n", pStubDesc);
62 TRACE(" Length == %d\n", rpc_cli_if->Length);
63 TRACE(" InterfaceID == %s (%d.%d)\n", debugstr_guid(&rpc_cli_if->InterfaceId.SyntaxGUID),
64 rpc_cli_if->InterfaceId.SyntaxVersion.MajorVersion, rpc_cli_if->InterfaceId.SyntaxVersion.MinorVersion);
65 TRACE(" TransferSyntax == %s (%d.%d)\n", debugstr_guid(&rpc_cli_if->TransferSyntax.SyntaxGUID),
66 rpc_cli_if->TransferSyntax.SyntaxVersion.MajorVersion, rpc_cli_if->TransferSyntax.SyntaxVersion.MinorVersion);
67 TRACE(" DispatchTable == ^%p\n", rpc_cli_if->DispatchTable);
68 TRACE(" RpcProtseqEndpointCount == ^%d\n", rpc_cli_if->RpcProtseqEndpointCount);
69 TRACE(" RpcProtseqEndpoint == ^%p\n", rpc_cli_if->RpcProtseqEndpoint);
70 TRACE(" Flags == ^%d\n", rpc_cli_if->Flags);
73 /* for now, while these functons are under development, this is too sketchy. commented out. */
75 NdrClientInitializeNew( &rpcmsg, &stubmsg, pStubDesc, 0 );
77 handle = (RPC_BINDING_HANDLE)0xdeadbeef; */ /* FIXME */
79 /* stubmsg.BufferLength = 0;*/ /* FIXME */
81 NdrGetBuffer( &stubmsg, stubmsg.BufferLength, handle );
82 NdrSendReceive( &stubmsg, stubmsg.Buffer );
83 NdrFreeBuffer( &stubmsg );
85 return ret;
88 /***********************************************************************
89 * NdrClientCall2 [RPCRT4.@]
91 * Note: this should return a CLIENT_CALL_RETURN, but calling convention for
92 * returning structures/unions is different between Windows and gcc on i386.
94 LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
95 PFORMAT_STRING pFormat, ...)
97 LONG_PTR ret;
98 va_list args;
100 TRACE("(%p,%p,...)\n", pStubDesc, pFormat);
102 va_start(args, pFormat);
103 ret = RPCRT4_NdrClientCall2(pStubDesc, pFormat, args);
104 va_end(args);
105 return ret;