rpcndr.h revision 4b9d6701570cb98fd36e209314239d104ec584d3
/*
* Copyright (C) 2000 Francois Gouget
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifndef __RPCNDR_H_VERSION__
/* FIXME: What version? Perhaps something is better than nothing, however incorrect */
#define __RPCNDR_H_VERSION__ ( 399 )
#endif
#ifndef __WINE_RPCNDR_H
#define __WINE_RPCNDR_H
#ifdef __cplusplus
extern "C" {
#endif
#include <basetsd.h>
#ifdef CONST_VTABLE
# define CONST_VTBL const
#else
# define CONST_VTBL
#endif
/* stupid #if can't handle casts... this __stupidity
is just a workaround for that limitation */
#define __NDR_CHAR_REP_MASK 0x000fL
#define __NDR_INT_REP_MASK 0x00f0L
#define __NDR_FLOAT_REP_MASK 0xff00L
#define __NDR_IEEE_FLOAT 0x0000L
#define __NDR_VAX_FLOAT 0x0100L
#define __NDR_IBM_FLOAT 0x0300L
#define __NDR_ASCII_CHAR 0x0000L
#define __NDR_EBCDIC_CHAR 0x0001L
#define __NDR_LITTLE_ENDIAN 0x0010L
#define __NDR_BIG_ENDIAN 0x0000L
/* Mac's are special */
#if defined(__RPC_MAC__)
# define __NDR_LOCAL_DATA_REPRESENTATION \
#else
# define __NDR_LOCAL_DATA_REPRESENTATION \
#endif
#define __NDR_LOCAL_ENDIAN \
/* for convenience, define NDR_LOCAL_IS_BIG_ENDIAN iff it is */
# define NDR_LOCAL_IS_BIG_ENDIAN
#else
#endif
/* finally, do the casts like Microsoft */
#define TARGET_IS_NT50_OR_LATER 1
#define TARGET_IS_NT40_OR_LATER 1
#define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
#define small char
typedef unsigned char byte;
typedef UINT64 MIDL_uhyper;
typedef unsigned char boolean;
#define __RPC_CALLEE WINAPI
#define RPC_VAR_ENTRY __cdecl
#define NDR_SHAREABLE static
#define MIDL_ascii_strlen(s) strlen(s)
#define MIDL_ascii_strcpy(d,s) strcpy(d,s)
#define MIDL_memset(d,v,n) memset(d,v,n)
#define midl_user_free MIDL_user_free
#define midl_user_allocate MIDL_user_allocate
(unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
#define RPC_BAD_STUB_DATA_EXCEPTION_FILTER \
((RpcExceptionCode() == STATUS_ACCESS_VIOLATION) || \
(RpcExceptionCode() == STATUS_DATATYPE_MISALIGNMENT) || \
(RpcExceptionCode() == RPC_X_BAD_STUB_DATA) || \
(RpcExceptionCode() == RPC_S_INVALID_BOUND))
typedef struct
{
void *pad[2];
void *userContext;
} *NDR_SCONTEXT;
#define cbNDRContext 20
typedef void (__RPC_USER *NDR_NOTIFY_ROUTINE)(void);
#define DECLSPEC_UUID(x)
#define MIDL_INTERFACE(x) struct
struct _MIDL_STUB_MESSAGE;
struct _MIDL_STUB_DESC;
struct _FULL_PTR_XLAT_TABLES;
struct NDR_ALLOC_ALL_NODES_CONTEXT;
struct NDR_POINTER_QUEUE_STATE;
typedef unsigned char *RPC_BUFPTR;
typedef ULONG RPC_LENGTH;
typedef const unsigned char *PFORMAT_STRING;
typedef struct
{
} ARRAY_INFO, *PARRAY_INFO;
typedef struct
{
void *CSArrayInfo;
} CS_STUB_INFO;
typedef struct _NDR_PIPE_DESC *PNDR_PIPE_DESC;
typedef struct _NDR_PIPE_MESSAGE *PNDR_PIPE_MESSAGE;
typedef struct _NDR_ASYNC_MESSAGE *PNDR_ASYNC_MESSAGE;
typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
typedef struct _MIDL_STUB_MESSAGE
{
unsigned char *Buffer;
unsigned char *BufferStart;
unsigned char *BufferEnd;
unsigned char *BufferMark;
unsigned char *Memory;
unsigned char IsClient;
unsigned char Pad;
unsigned short uFlags2;
int ReuseBuffer;
unsigned char *PointerBufferMark;
unsigned char CorrDespIncrement;
unsigned char uFlags;
unsigned short UniquePtrCount;
unsigned char *StackTop;
unsigned char *pPresentedType;
unsigned char *pTransmitType;
const struct _MIDL_STUB_DESC *StubDesc;
struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
unsigned int fInDontFree:1;
unsigned int fDontCallFreeInst:1;
unsigned int fInOnlyParam:1;
unsigned int fHasReturn:1;
unsigned int fHasExtensions:1;
unsigned int fHasNewCorrDesc:1;
unsigned int fIsIn:1;
unsigned int fIsOut:1;
unsigned int fIsOicf:1;
unsigned int fBufferValid:1;
unsigned int fHasMemoryValidateCallback:1;
unsigned int fInFree:1;
unsigned int fNeedMCCP:1;
int fUnused:3;
int fUnused2:16;
void *pvDestContext;
struct IRpcChannelBuffer *pRpcChannelBuffer;
void *pArgQueue;
void *LowStackMark;
unsigned char *pCorrMemory;
void *pMemoryList;
unsigned char *ConformanceMark;
unsigned char *VarianceMark;
struct _NDR_PROC_CONTEXT *pContext;
void* ContextHandleHash;
void* pUserMarshalList;
typedef void * (__RPC_API * GENERIC_BINDING_ROUTINE)(void *);
typedef void (__RPC_API * GENERIC_UNBIND_ROUTINE)(void *, unsigned char *);
typedef struct _GENERIC_BINDING_ROUTINE_PAIR
{
typedef struct __GENERIC_BINDING_INFO
{
void *pObj;
unsigned int Size;
typedef struct _XMIT_ROUTINE_QUINTUPLE
{
typedef unsigned char * (__RPC_USER *USER_MARSHAL_MARSHALLING_ROUTINE)(ULONG *, unsigned char *, void *);
typedef unsigned char * (__RPC_USER *USER_MARSHAL_UNMARSHALLING_ROUTINE)(ULONG *, unsigned char *, void *);
typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
{
/* 'USRC' */
#define USER_MARSHAL_CB_SIGNATURE \
typedef enum
{
typedef struct _USER_MARSHAL_CB
{
#define USER_CALL_CTXT_MASK(f) ((f) & 0x00ff)
#define USER_CALL_AUX_MASK(f) ((f) & 0xff00)
#define GET_USER_DATA_REP(f) HIWORD(f)
#define USER_CALL_IS_ASYNC 0x0100
#define USER_CALL_NEW_CORRELATION_DESC 0x0200
typedef struct _MALLOC_FREE_STRUCT
{
void (__RPC_USER *pfnFree)(void *);
typedef struct _COMM_FAULT_OFFSETS
{
short CommOffset;
short FaultOffset;
typedef struct _MIDL_STUB_DESC
{
void *RpcInterfaceInformation;
union {
const NDR_RUNDOWN *apfnNdrRundownRoutines;
const EXPR_EVAL *apfnExprEval;
const XMIT_ROUTINE_QUINTUPLE *aXmitQuintuple;
const unsigned char *pFormatTypes;
int fCheckBounds;
const COMM_FAULT_OFFSETS *CommFaultOffsets;
const NDR_NOTIFY_ROUTINE *NotifyRoutineTable;
typedef const MIDL_STUB_DESC *PMIDL_STUB_DESC;
typedef struct _MIDL_FORMAT_STRING
{
short Pad;
#if defined(__GNUC__)
unsigned char Format[0];
#else
unsigned char Format[1];
#endif
typedef struct _MIDL_SYNTAX_INFO
{
const unsigned short* FmtStringOffset;
const void* aUserMarshalQuadruple;
#ifdef WINE_STRICT_PROTOTYPES
#else
#endif
typedef struct _MIDL_SERVER_INFO_
{
const SERVER_ROUTINE *DispatchTable;
const unsigned short *FmtStringOffset;
const STUB_THUNK *ThunkTable;
typedef struct _MIDL_STUBLESS_PROXY_INFO
{
const unsigned short *FormatStringOffset;
typedef union _CLIENT_CALL_RETURN
{
void *Pointer;
typedef enum {
} STUB_PHASE;
typedef enum {
} PROXY_PHASE;
typedef enum {
XLAT_SERVER = 1,
} XLAT_SIDE;
typedef struct _FULL_PTR_TO_REFID_ELEMENT {
struct _FULL_PTR_TO_REFID_ELEMENT *Next;
void *Pointer;
unsigned char State;
/* Full pointer translation tables */
typedef struct _FULL_PTR_XLAT_TABLES {
struct {
void **XlatTable;
unsigned char *StateTable;
struct {
struct IRpcStubBuffer;
typedef ULONG error_status_t;
typedef void * NDR_CCONTEXT;
typedef struct _SCONTEXT_QUEUE {
typedef struct _NDR_USER_MARSHAL_INFO_LEVEL1
{
void *Buffer;
struct IRpcChannelBuffer *pRpcChannelBuffer;
typedef struct _NDR_USER_MARSHAL_INFO
{
union
{
/* Context Handles */
NdrServerContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle, NDR_RUNDOWN RundownRoutine );
NdrContextHandleSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
RpcSmDestroyClientContext( void **ContextHandle );
RpcSsDestroyClientContext( void **ContextHandle );
NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
NdrByteCountPointerMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
NdrByteCountPointerUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc );
NdrByteCountPointerBufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
NdrByteCountPointerFree( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
NdrRangeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc );
/* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
#define SIMPLE_TYPE_MARSHAL(type) \
Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
#define TYPE_MARSHAL(type) \
NdrCorrelationInitialize( PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG flags );
#define USER_MARSHAL_FC_BYTE 1
#define USER_MARSHAL_FC_CHAR 2
#define USER_MARSHAL_FC_SMALL 3
#define USER_MARSHAL_FC_USMALL 4
#define USER_MARSHAL_FC_WCHAR 5
#define USER_MARSHAL_FC_SHORT 6
#define USER_MARSHAL_FC_USHORT 7
#define USER_MARSHAL_FC_LONG 8
#define USER_MARSHAL_FC_ULONG 9
#define USER_MARSHAL_FC_FLOAT 10
#define USER_MARSHAL_FC_HYPER 11
#define USER_MARSHAL_FC_DOUBLE 12
/* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
* returning structures/unions is different between Windows and gcc on i386. */
NdrStubCall2( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
NdrStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
NdrAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
NdrDcomAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
NdrOleFree( void* NodeToFree );
NdrServerInitialize( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
NdrServerInitializeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, PRPC_MESSAGE pRpcMsg );
NdrServerMarshall( struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
NdrNsSendReceive( PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pBufferEnd, RPC_BINDING_HANDLE *pAutoHandle );
NdrRpcSmClientFree( void *NodeToFree );
NdrRpcSsDefaultFree( void *NodeToFree );
NdrGetUserMarshalInfo( ULONG *pFlags, ULONG InformationLevel, NDR_USER_MARSHAL_INFO *pMarshalInfo );
#ifdef __cplusplus
}
#endif
#endif /*__WINE_RPCNDR_H */