- rpc-header by Ove
Index: wine/include/rpc.h =================================================================== RCS file: /home/wine/wine/include/rpc.h,v retrieving revision 1.8 diff -d -u -r1.8 rpc.h --- wine/include/rpc.h 10 Mar 2002 00:02:34 -0000 1.8 +++ wine/include/rpc.h 6 Aug 2002 20:29:08 -0000 @@ -25,6 +25,8 @@ #ifndef __WINE_RPC_H #define __WINE_RPC_H +#define __RPC_WIN32__ + #define __RPC_FAR #define __RPC_API WINAPI #define __RPC_USER WINAPI Index: wine/include/rpcdce.h =================================================================== RCS file: /home/wine/wine/include/rpcdce.h,v retrieving revision 1.8 diff -d -u -r1.8 rpcdce.h --- wine/include/rpcdce.h 31 May 2002 23:06:48 -0000 1.8 +++ wine/include/rpcdce.h 6 Aug 2002 20:29:09 -0000 @@ -29,8 +29,6 @@ typedef void* RPC_AUTHZ_HANDLE; typedef void* RPC_IF_HANDLE; typedef I_RPC_HANDLE RPC_BINDING_HANDLE; -typedef RPC_BINDING_HANDLE handle_t; -#define rpc_binding_handle_t RPC_BINDING_HANDLE #define RPC_MGR_EPV void typedef struct _RPC_BINDING_VECTOR @@ -38,14 +36,19 @@ unsigned long Count; RPC_BINDING_HANDLE BindingH[1]; } RPC_BINDING_VECTOR; -#define rpc_binding_vector_t RPC_BINDING_VECTOR typedef struct _UUID_VECTOR { unsigned long Count; UUID *Uuid[1]; } UUID_VECTOR; + +#ifndef __WINE__ +typedef RPC_BINDING_HANDLE handle_t; +#define rpc_binding_handle_t RPC_BINDING_HANDLE +#define rpc_binding_vector_t RPC_BINDING_VECTOR #define uuid_vector_t UUID_VECTOR +#endif typedef struct _RPC_IF_ID { @@ -90,6 +93,11 @@ ULONG NICFlags; } RPC_POLICY, *PRPC_POLICY; +/* RpcServerRegisterIfEx Flags */ +#define RPC_IF_AUTOLISTEN 0x1 +#define RPC_IF_OLE 0x2 +#define RPC_IF_ALLOW_UNKNOWN_AUTHORITY 0x4 +#define RPC_IF_ALLOW_SECURE_ONLY 0x8 RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding ); @@ -98,6 +106,13 @@ RpcBindingFree( RPC_BINDING_HANDLE* Binding ); RPCRTAPI RPC_STATUS RPC_ENTRY + RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid ); +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcBindingReset( RPC_BINDING_HANDLE Binding ); +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcBindingSetObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid ); + +RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingFromStringBindingA( LPSTR StringBinding, RPC_BINDING_HANDLE* Binding ); RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingFromStringBindingW( LPWSTR StringBinding, RPC_BINDING_HANDLE* Binding ); @@ -113,6 +128,45 @@ RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector ); RPCRTAPI RPC_STATUS RPC_ENTRY + RpcStringBindingComposeA( LPSTR ObjUuid, LPSTR Protseq, LPSTR NetworkAddr, + LPSTR Endpoint, LPSTR Options, LPSTR* StringBinding ); +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcStringBindingComposeW( LPWSTR ObjUuid, LPWSTR Protseq, LPWSTR NetworkAddr, + LPWSTR Endpoint, LPWSTR Options, LPWSTR* StringBinding ); +#define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose) + +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcStringBindingParseA( LPSTR StringBinding, LPSTR* ObjUuid, LPSTR* Protseq, + LPSTR* NetworkAddr, LPSTR* Endpoint, LPSTR* NetworkOptions ); +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcStringBindingParseW( LPWSTR StringBinding, LPWSTR* ObjUuid, LPWSTR* Protseq, + LPWSTR* NetworkAddr, LPWSTR* Endpoint, LPWSTR* NetworkOptions ); +#define RpcStringBindingParse WINELIB_NAME_AW(RpcStringBindingParse) + +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec ); + +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, LPSTR Annotation ); +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcEpRegisterW( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, LPWSTR Annotation ); +#define RpcEpRegister WINELIB_NAME_AW(RpcEpRegister) + +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcEpRegisterNoReplaceA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, LPSTR Annotation ); +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcEpRegisterNoReplaceW( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, LPWSTR Annotation ); +#define RpcEpRegisterNoReplace WINELIB_NAME_AW(RpcEpRegisterNoReplace) + +RPCRTAPI RPC_STATUS RPC_ENTRY + RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector ); + +RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerInqBindings( RPC_BINDING_VECTOR** BindingVector ); RPCRTAPI RPC_STATUS RPC_ENTRY @@ -163,22 +217,37 @@ #define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose) RPCRTAPI RPC_STATUS RPC_ENTRY - RpcStringFreeA(unsigned char** String); + RpcStringFreeA(LPSTR* String); RPCRTAPI RPC_STATUS RPC_ENTRY - RpcStringFreeW(unsigned short** String); + RpcStringFreeW(LPWSTR* String); #define RpcStringFree WINELIB_NAME_AW(RpcStringFree) RPCRTAPI RPC_STATUS RPC_ENTRY - UuidCreate( UUID* Uuid ); + UuidToStringA( UUID* Uuid, LPSTR* StringUuid ); +RPCRTAPI RPC_STATUS RPC_ENTRY + UuidToStringW( UUID* Uuid, LPWSTR* StringUuid ); +#define UuidToString WINELIB_NAME_AW(UuidToString) RPCRTAPI RPC_STATUS RPC_ENTRY - UuidToStringA( UUID* Uuid, unsigned char** StringUuid ); + UuidFromStringA( LPSTR StringUuid, UUID* Uuid ); RPCRTAPI RPC_STATUS RPC_ENTRY - UuidToStringW( UUID* Uuid, unsigned short** StringUuid ); -#define UuidToString WINELIB_NAME_AW(UuidToString) + UuidFromStringW( LPWSTR StringUuid, UUID* Uuid ); +#define UuidFromString WINELIB_NAME_AW(UuidFromString) +RPCRTAPI RPC_STATUS RPC_ENTRY + UuidCreate( UUID* Uuid ); +RPCRTAPI RPC_STATUS RPC_ENTRY + UuidCreateSequential( UUID* Uuid ); +RPCRTAPI RPC_STATUS RPC_ENTRY + UuidCreateNil( UUID* Uuid ); +RPCRTAPI signed int RPC_ENTRY + UuidCompare( UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status_ ); +RPCRTAPI int RPC_ENTRY + UuidEqual( UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status_ ); RPCRTAPI unsigned short RPC_ENTRY UuidHash(UUID* Uuid, RPC_STATUS* Status_ ); +RPCRTAPI int RPC_ENTRY + UuidIsNil( UUID* Uuid, RPC_STATUS* Status_ ); #include "rpcdcep.h" Index: wine/include/rpcdcep.h =================================================================== RCS file: /home/wine/wine/include/rpcdcep.h,v retrieving revision 1.2 diff -d -u -r1.2 rpcdcep.h --- wine/include/rpcdcep.h 10 Mar 2002 00:02:34 -0000 1.2 +++ wine/include/rpcdcep.h 6 Aug 2002 20:29:09 -0000 @@ -19,7 +19,6 @@ #ifndef __WINE_RPCDCEP_H #define __WINE_RPCDCEP_H - typedef struct _RPC_VERSION { unsigned short MajorVersion; unsigned short MinorVersion; @@ -45,4 +44,117 @@ unsigned long RpcFlags; } RPC_MESSAGE, *PRPC_MESSAGE; -#endif /*__WINE_RPCDCE_H */ +typedef void __RPC_STUB (*RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message); + +typedef struct +{ + unsigned int DispatchTableCount; + RPC_DISPATCH_FUNCTION* DispatchTable; + LONG_PTR Reserved; +} RPC_DISPATCH_TABLE, *PRPC_DISPATCH_TABLE; + +typedef struct _RPC_PROTSEQ_ENDPOINT +{ + unsigned char* RpcProtocolSequence; + unsigned char* Endpoint; +} RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT; + +#define NT351_INTERFACE_SIZE 0x40 +#define RPC_INTERFACE_HAS_PIPES 0x0001 + +typedef struct _RPC_SERVER_INTERFACE +{ + unsigned int Length; + RPC_SYNTAX_IDENTIFIER InterfaceId; + RPC_SYNTAX_IDENTIFIER TransferSyntax; + PRPC_DISPATCH_TABLE DispatchTable; + unsigned int RpcProtseqEndpointCount; + PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint; + RPC_MGR_EPV* DefaultManagerEpv; + void const* InterpreterInfo; + unsigned int Flags; +} RPC_SERVER_INTERFACE, *PRPC_SERVER_INTERFACE; + +typedef struct _RPC_CLIENT_INTERFACE +{ + unsigned int Length; + RPC_SYNTAX_IDENTIFIER InterfaceId; + RPC_SYNTAX_IDENTIFIER TransferSyntax; + PRPC_DISPATCH_TABLE DispatchTable; + unsigned int RpcProtseqEndpointCount; + PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint; + ULONG_PTR Reserved; + void const* InterpreterInfo; + unsigned int Flags; +} RPC_CLIENT_INTERFACE, *PRPC_CLIENT_INTERFACE; + +#define TRANSPORT_TYPE_CN 0x01 +#define TRANSPORT_TYPE_DG 0x02 +#define TRANSPORT_TYPE_LPC 0x04 +#define TRANSPORT_TYPE_WMSG 0x08 + +#ifdef WINNT +typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, HANDLE hSyncEvent); +#else +typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, void* hSyncEvent); +#endif + +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcGetBuffer( RPC_MESSAGE* Message ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcGetBufferWithObject( RPC_MESSAGE* Message, UUID* ObjectUuid ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcSendReceive( RPC_MESSAGE* Message ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcFreeBuffer( RPC_MESSAGE* Message ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcSend( RPC_MESSAGE* Message ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcReceive( RPC_MESSAGE* Message ); + +RPCRTAPI void* RPC_ENTRY + I_RpcAllocate( unsigned int Size ); +RPCRTAPI void RPC_ENTRY + I_RpcFree( void* Object ); + +RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY + I_RpcGetCurrentCallHandle( void ); + +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcServerStartListening( void* hWnd ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcServerStopListening( void ); +/* WINNT */ +RPCRTAPI RPC_STATUS RPC_ENTRY + I_GetThreadWindowHandle( HWND* hWnd ); +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcAsyncSendReceive( RPC_MESSAGE* Message, void* Context, HWND hWnd ); + +#ifdef WINNT +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn ); +#else +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn, unsigned long ServerTid ); +#endif + +/* WIN9x */ +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcSetThreadParams( int fClientFree, void* Context, void* hWndClient ); + +#ifdef WINNT +RPCRTAPI LONG RPC_ENTRY + I_RpcWindowProc( HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam ); +#else +RPCRTAPI unsigned int RPC_ENTRY + I_RpcWindowProc( void* hWnd, unsigned int Message, unsigned int wParam, unsigned long lParam ); +#endif + +/* WINNT */ +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcSetWMsgEndpoint( WCHAR* Endpoint ); + +RPCRTAPI RPC_STATUS RPC_ENTRY + I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding, unsigned int* Type ); + +#endif /*__WINE_RPCDCEP_H */ Index: wine/include/rpcndr.h =================================================================== RCS file: /home/wine/wine/include/rpcndr.h,v retrieving revision 1.5 diff -d -u -r1.5 rpcndr.h --- wine/include/rpcndr.h 10 Mar 2002 00:02:34 -0000 1.5 +++ wine/include/rpcndr.h 6 Aug 2002 20:29:10 -0000 @@ -22,7 +22,10 @@ #ifndef __RPCNDR_H_VERSION__ /* FIXME: I'm not sure what version though */ #define __RPCNDR_H_VERSION__ -#endif // __RPCNDR_H_VERSION__ +#endif + +#define TARGET_IS_NT40_OR_LATER 1 +#define TARGET_IS_NT351_OR_WIN95_OR_LATER 1 typedef unsigned char byte; typedef __int64 hyper; @@ -31,6 +34,9 @@ typedef unsigned char _wine_boolean; /* typedef _wine_boolean boolean; */ +#define __RPC_CALLEE WINAPI +#define RPC_VAR_ENTRY WINAPIV + typedef struct { void *pad[2]; @@ -96,7 +102,7 @@ unsigned char *StackTop; unsigned char *pPresentedType; unsigned char *pTransmitType; - handle_t SavedHandle; + RPC_BINDING_HANDLE SavedHandle; const struct _MIDL_STUB_DESC *StubDesc; struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables; unsigned long FullPtrRefId; @@ -146,8 +152,8 @@ void * (__RPC_API *pfnAllocate)(size_t); void (__RPC_API *pfnFree)(void *); union { - handle_t *pAutoHandle; - handle_t *pPrimitiveHandle; + RPC_BINDING_HANDLE *pAutoHandle; + RPC_BINDING_HANDLE *pPrimitiveHandle; PGENERIC_BINDING_INFO pGenericBindingInfo; } IMPLICIT_HANDLE_INFO; const NDR_RUNDOWN *apfnNdrRundownRoutines; @@ -195,6 +201,22 @@ const unsigned short *LocalFmtStringOffset; } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO; +typedef struct _MIDL_STUBLESS_PROXY_INFO +{ + PMIDL_STUB_DESC pStubDesc; + PFORMAT_STRING ProcFormatString; + const unsigned short *FormatStringOffset; + PFORMAT_STRING LocalFormatTypes; + PFORMAT_STRING LocalProcStrings; + const unsigned short *LocalFmtStringOffset; +} MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO; + +typedef union _CLIENT_CALL_RETURN +{ + void *Pointer; + LONG_PTR Simple; +} CLIENT_CALL_RETURN; + typedef enum { STUB_UNMARSHAL, STUB_CALL_SERVER, @@ -253,6 +275,21 @@ NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, long NumberParams ); RPCRTAPI void RPC_ENTRY NdrConvert( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat ); + +CLIENT_CALL_RETURN RPC_VAR_ENTRY + NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); +CLIENT_CALL_RETURN RPC_VAR_ENTRY + NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); + +RPCRTAPI void RPC_ENTRY + NdrServerCall2( PRPC_MESSAGE pRpcMsg ); +RPCRTAPI void RPC_ENTRY + NdrServerCall( PRPC_MESSAGE pRpcMsg ); + +RPCRTAPI long RPC_ENTRY + NdrStubCall2( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, LPDWORD pdwStubPhase ); +RPCRTAPI long RPC_ENTRY + NdrStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, LPDWORD pdwStubPhase ); RPCRTAPI void* RPC_ENTRY NdrOleAllocate( size_t Size ); Index: wine/include/rpcproxy.h =================================================================== RCS file: /home/wine/wine/include/rpcproxy.h,v retrieving revision 1.3 diff -d -u -r1.3 rpcproxy.h --- wine/include/rpcproxy.h 21 Jun 2002 20:09:34 -0000 1.3 +++ wine/include/rpcproxy.h 6 Aug 2002 20:29:10 -0000 @@ -19,8 +19,16 @@ #ifndef __WINE_RPCPROXY_H #define __WINE_RPCPROXY_H +#ifndef __RPCPROXY_H_VERSION__ +/* FIXME: I'm not sure what version though */ +#define __RPCPROXY_H_VERSION__ +#endif + #include "basetsd.h" #include "guiddef.h" +#include "winnt.h" +#include "rpc.h" +#include "rpcndr.h" #include "rpc.h" #include "rpcndr.h" @@ -146,6 +154,32 @@ CStdStubBuffer_DebugServerQueryInterface, \ CStdStubBuffer_DebugServerRelease +RPCRTAPI void RPC_ENTRY + NdrProxyInitialize( void *This, PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDescriptor, unsigned int ProcNum ); +RPCRTAPI void RPC_ENTRY + NdrProxyGetBuffer( void *This, PMIDL_STUB_MESSAGE pStubMsg ); +RPCRTAPI void RPC_ENTRY + NdrProxySendReceive( void *This, PMIDL_STUB_MESSAGE pStubMsg ); +RPCRTAPI void RPC_ENTRY + NdrProxyFreeBuffer( void *This, PMIDL_STUB_MESSAGE pStubMsg ); +RPCRTAPI HRESULT RPC_ENTRY + NdrProxyErrorHandler( DWORD dwExceptionCode ); + +RPCRTAPI void RPC_ENTRY + NdrStubInitialize( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDescriptor, IRpcChannelBuffer *pRpcChannelBuffer ); +RPCRTAPI void RPC_ENTRY + NdrStubInitializePartial( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDescriptor, IRpcChannelBuffer *pRpcChannelBuffer, + unsigned long RequestedBufferSize ); +void __RPC_STUB NdrStubForwardingFunction( IRpcStubBuffer *This, IRpcChannelBuffer *pChannel, + PRPC_MESSAGE pMsg, DWORD *pdwStubPhase ); +RPCRTAPI void RPC_ENTRY + NdrStubGetBuffer( IRpcStubBuffer *This, IRpcChannelBuffer *pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg ); +RPCRTAPI HRESULT RPC_ENTRY + NdrStubErrorHandler( DWORD dwExceptionCode ); + RPCRTAPI HRESULT RPC_ENTRY NdrDllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid, CStdPSFactoryBuffer *pPSFactoryBuffer ); @@ -161,6 +195,8 @@ ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) \ { return NdrCStdStubBuffer_Release(This, (IPSFactoryBuffer *)pFactory); } +#define IID_GENERIC_CHECK_IID(name,pIID,index) memcmp(pIID, name##_ProxyVtblList[index]->header.piid, sizeof(IID)) + #if defined(__WINE__) && defined(__WINE_WINE_OBJ_OLEAUT_H) /* see http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp?frame=true */ @@ -174,3 +210,4 @@ #endif #endif /*__WINE_RPCDCE_H */ + Index: wine/include/thread.h =================================================================== RCS file: /home/wine/wine/include/thread.h,v retrieving revision 1.60 diff -d -u -r1.60 thread.h --- wine/include/thread.h 31 May 2002 23:06:49 -0000 1.60 +++ wine/include/thread.h 6 Aug 2002 20:29:12 -0000 @@ -125,7 +125,8 @@ DWORD pad8[3]; /* --n f10 */ PVOID ReservedForNtRpc; /* -2- f1c used by rpcrt4 */ DWORD pad9[24]; /* --n f20 */ - PVOID ErrorInfo; /* -2- f80 used by ole32 (IErrorInfo*) */ + PVOID ErrorInfo; /* -2- f80 used by ole32 */ + PVOID OleData; } TEB; /* Thread exception flags */