Authors: Greg Turner <gmturner007@ameritech.net>, Ove Kaaven <ovek@transgaming.com>
[wine] / include / rpcdcep.h
1 /*
2  * Copyright (C) 2000 Francois Gouget
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_RPCDCEP_H
20 #define __WINE_RPCDCEP_H
21
22 #include "rpcdce.h"
23
24 typedef struct _RPC_VERSION {
25     unsigned short MajorVersion;
26     unsigned short MinorVersion;
27 } RPC_VERSION;
28
29 typedef struct _RPC_SYNTAX_IDENTIFIER {
30     GUID SyntaxGUID;
31     RPC_VERSION SyntaxVersion;
32 } RPC_SYNTAX_IDENTIFIER, *PRPC_SYNTAX_IDENTIFIER;
33
34 typedef struct _RPC_MESSAGE
35 {
36     RPC_BINDING_HANDLE Handle;
37     unsigned long DataRepresentation;
38     void* Buffer;
39     unsigned int BufferLength;
40     unsigned int ProcNum;
41     PRPC_SYNTAX_IDENTIFIER TransferSyntax;
42     void* RpcInterfaceInformation;
43     void* ReservedForRuntime;
44     RPC_MGR_EPV* ManagerEpv;
45     void* ImportContext;
46     unsigned long RpcFlags;
47 } RPC_MESSAGE, *PRPC_MESSAGE;
48
49 typedef void  (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message);
50
51 typedef struct
52 {
53     unsigned int DispatchTableCount;
54     RPC_DISPATCH_FUNCTION* DispatchTable;
55     LONG_PTR Reserved;
56 } RPC_DISPATCH_TABLE, *PRPC_DISPATCH_TABLE;
57
58 typedef struct _RPC_PROTSEQ_ENDPOINT
59 {
60     unsigned char* RpcProtocolSequence;
61     unsigned char* Endpoint;
62 } RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT;
63
64 #define NT351_INTERFACE_SIZE 0x40
65 #define RPC_INTERFACE_HAS_PIPES 0x0001
66
67 typedef struct _RPC_SERVER_INTERFACE
68 {
69     unsigned int Length;
70     RPC_SYNTAX_IDENTIFIER InterfaceId;
71     RPC_SYNTAX_IDENTIFIER TransferSyntax;
72     PRPC_DISPATCH_TABLE DispatchTable;
73     unsigned int RpcProtseqEndpointCount;
74     PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
75     RPC_MGR_EPV* DefaultManagerEpv;
76     void const* InterpreterInfo;
77     unsigned int Flags;
78 } RPC_SERVER_INTERFACE, *PRPC_SERVER_INTERFACE;
79
80 typedef struct _RPC_CLIENT_INTERFACE
81 {
82     unsigned int Length;
83     RPC_SYNTAX_IDENTIFIER InterfaceId;
84     RPC_SYNTAX_IDENTIFIER TransferSyntax;
85     PRPC_DISPATCH_TABLE DispatchTable;
86     unsigned int RpcProtseqEndpointCount;
87     PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
88     ULONG_PTR Reserved;
89     void const* InterpreterInfo;
90     unsigned int Flags;
91 } RPC_CLIENT_INTERFACE, *PRPC_CLIENT_INTERFACE;
92
93 #define TRANSPORT_TYPE_CN   0x01
94 #define TRANSPORT_TYPE_DG   0x02
95 #define TRANSPORT_TYPE_LPC  0x04
96 #define TRANSPORT_TYPE_WMSG 0x08
97
98 typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, HANDLE hSyncEvent);
99
100 RPCRTAPI RPC_STATUS RPC_ENTRY
101   I_RpcGetBuffer( RPC_MESSAGE* Message );
102 RPCRTAPI RPC_STATUS RPC_ENTRY
103   I_RpcGetBufferWithObject( RPC_MESSAGE* Message, UUID* ObjectUuid );
104 RPCRTAPI RPC_STATUS RPC_ENTRY
105   I_RpcSendReceive( RPC_MESSAGE* Message );
106 RPCRTAPI RPC_STATUS RPC_ENTRY
107   I_RpcFreeBuffer( RPC_MESSAGE* Message );
108 RPCRTAPI RPC_STATUS RPC_ENTRY
109   I_RpcSend( RPC_MESSAGE* Message );
110 RPCRTAPI RPC_STATUS RPC_ENTRY
111   I_RpcReceive( RPC_MESSAGE* Message );
112
113 RPCRTAPI void* RPC_ENTRY
114   I_RpcAllocate( unsigned int Size );
115 RPCRTAPI void RPC_ENTRY
116   I_RpcFree( void* Object );
117
118 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
119   I_RpcGetCurrentCallHandle( void );
120
121 RPCRTAPI RPC_STATUS RPC_ENTRY
122   I_RpcServerStartListening( void* hWnd );
123 RPCRTAPI RPC_STATUS RPC_ENTRY
124   I_RpcServerStopListening( void );
125 /* WINNT */
126 RPCRTAPI RPC_STATUS RPC_ENTRY
127   I_GetThreadWindowHandle( HWND* hWnd );
128 RPCRTAPI RPC_STATUS RPC_ENTRY
129   I_RpcAsyncSendReceive( RPC_MESSAGE* Message, void* Context, HWND hWnd );
130
131 RPCRTAPI RPC_STATUS RPC_ENTRY
132   I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn );
133
134 /* WIN9x */
135 RPCRTAPI RPC_STATUS RPC_ENTRY
136   I_RpcSetThreadParams( int fClientFree, void* Context, void* hWndClient );
137
138 RPCRTAPI UINT RPC_ENTRY
139   I_RpcWindowProc( void* hWnd, UINT Message, UINT wParam, ULONG lParam );
140
141 /* WINNT */
142 RPCRTAPI RPC_STATUS RPC_ENTRY
143   I_RpcSetWMsgEndpoint( WCHAR* Endpoint );
144
145 RPCRTAPI RPC_STATUS RPC_ENTRY
146   I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding, unsigned int* Type );
147
148 #endif /*__WINE_RPCDCEP_H */