1 /***********************************************************************\
2 *                               rpcdcep.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module windows.rpcdcep;
11 nothrow:
12 private import windows.basetyps;
13 private import windows.w32api;
14 private import windows.windef;
15 
16 mixin DECLARE_HANDLE!("I_RPC_HANDLE");
17 alias long RPC_STATUS;
18 
19 const RPC_NCA_FLAGS_DEFAULT=0;
20 const RPC_NCA_FLAGS_IDEMPOTENT=1;
21 const RPC_NCA_FLAGS_BROADCAST=2;
22 const RPC_NCA_FLAGS_MAYBE=4;
23 const RPCFLG_ASYNCHRONOUS=0x40000000;
24 const RPCFLG_INPUT_SYNCHRONOUS=0x20000000;
25 const RPC_FLAGS_VALID_BIT=0x8000;
26 
27 const TRANSPORT_TYPE_CN=1;
28 const TRANSPORT_TYPE_DG=2;
29 const TRANSPORT_TYPE_LPC=4;
30 const TRANSPORT_TYPE_WMSG=8;
31 
32 struct RPC_VERSION {
33 	ushort MajorVersion;
34 	ushort MinorVersion;
35 }
36 struct RPC_SYNTAX_IDENTIFIER {
37 	GUID        SyntaxGUID;
38 	RPC_VERSION SyntaxVersion;
39 }
40 alias RPC_SYNTAX_IDENTIFIER* PRPC_SYNTAX_IDENTIFIER;
41 
42 struct RPC_MESSAGE {
43 	HANDLE Handle;
44 	uint  DataRepresentation;
45 	void* Buffer;
46 	uint  BufferLength;
47 	uint  ProcNum;
48 	PRPC_SYNTAX_IDENTIFIER TransferSyntax;
49 	void* RpcInterfaceInformation;
50 	void* ReservedForRuntime;
51 	void* ManagerEpv;
52 	void* ImportContext;
53 	uint  RpcFlags;
54 }
55 alias RPC_MESSAGE* PRPC_MESSAGE;
56 
57 extern (Windows) {
58 alias void function (PRPC_MESSAGE Message) RPC_DISPATCH_FUNCTION;
59 }
60 
61 struct RPC_DISPATCH_TABLE {
62 	uint DispatchTableCount;
63 	RPC_DISPATCH_FUNCTION* DispatchTable;
64 	int  Reserved;
65 }
66 alias RPC_DISPATCH_TABLE* PRPC_DISPATCH_TABLE;
67 
68 struct RPC_PROTSEQ_ENDPOINT {
69 	ubyte* RpcProtocolSequence;
70 	ubyte* Endpoint;
71 }
72 alias RPC_PROTSEQ_ENDPOINT* PRPC_PROTSEQ_ENDPOINT;
73 
74 struct RPC_SERVER_INTERFACE {
75 	uint                  Length;
76 	RPC_SYNTAX_IDENTIFIER InterfaceId;
77 	RPC_SYNTAX_IDENTIFIER TransferSyntax;
78 	PRPC_DISPATCH_TABLE   DispatchTable;
79 	uint                  RpcProtseqEndpointCount;
80 	PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
81 	void*                 DefaultManagerEpv;
82 	const(void)*          InterpreterInfo;
83 }
84 alias RPC_SERVER_INTERFACE* PRPC_SERVER_INTERFACE;
85 
86 struct RPC_CLIENT_INTERFACE {
87 	uint                  Length;
88 	RPC_SYNTAX_IDENTIFIER InterfaceId;
89 	RPC_SYNTAX_IDENTIFIER TransferSyntax;
90 	PRPC_DISPATCH_TABLE   DispatchTable;
91 	uint                  RpcProtseqEndpointCount;
92 	PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
93 	uint                  Reserved;
94 	const(void)*          InterpreterInfo;
95 }
96 alias RPC_CLIENT_INTERFACE* PRPC_CLIENT_INTERFACE;
97 
98 alias TypeDef!(void*) I_RPC_MUTEX;
99 
100 struct RPC_TRANSFER_SYNTAX {
101 	GUID   Uuid;
102 	ushort VersMajor;
103 	ushort VersMinor;
104 }
105 alias RPC_STATUS function(void*, void*, void*) RPC_BLOCKING_FN;
106 
107 extern (Windows) {
108 	alias void function(void*) PRPC_RUNDOWN;
109 	
110 	int    I_RpcGetBuffer(RPC_MESSAGE*);
111 	int    I_RpcSendReceive(RPC_MESSAGE*);
112 	int    I_RpcSend(RPC_MESSAGE*);
113 	int    I_RpcFreeBuffer(RPC_MESSAGE*);
114 	void   I_RpcRequestMutex(I_RPC_MUTEX*);
115 	void   I_RpcClearMutex(I_RPC_MUTEX);
116 	void   I_RpcDeleteMutex(I_RPC_MUTEX);
117 	void*  I_RpcAllocate(uint);
118 	void   I_RpcFree(void*);
119 	void   I_RpcPauseExecution(uint);
120 	int    I_RpcMonitorAssociation(HANDLE, PRPC_RUNDOWN, void*);
121 	int    I_RpcStopMonitorAssociation(HANDLE);
122 	HANDLE I_RpcGetCurrentCallHandle();
123 	int    I_RpcGetAssociationContext(void**);
124 	int    I_RpcSetAssociationContext(void*);
125 	int    I_RpcNsBindingSetEntryName(HANDLE, uint, wchar*);
126 	int    I_RpcBindingInqDynamicEndpoint(HANDLE, wchar**);
127 	int    I_RpcBindingInqTransportType(HANDLE, uint*);
128 	int    I_RpcIfInqTransferSyntaxes(HANDLE, RPC_TRANSFER_SYNTAX*, uint,
129 	         uint*);
130 	int    I_UuidCreate(GUID*);
131 	int    I_RpcBindingCopy(HANDLE, HANDLE*);
132 	int    I_RpcBindingIsClientLocal(HANDLE, uint*);
133 	void   I_RpcSsDontSerializeContext();
134 	int    I_RpcServerRegisterForwardFunction(int function (GUID*,
135 	         RPC_VERSION*, GUID*, ubyte*, void**));
136 	int    I_RpcConnectionInqSockBuffSize(uint*, uint*);
137 	int    I_RpcConnectionSetSockBuffSize(uint, uint);
138 	int    I_RpcBindingSetAsync(HANDLE, RPC_BLOCKING_FN);
139 	int    I_RpcAsyncSendReceive(RPC_MESSAGE*, void*);
140 	int    I_RpcGetThreadWindowHandle(void**);
141 	int    I_RpcServerThreadPauseListening();
142 	int    I_RpcServerThreadContinueListening();
143 	int    I_RpcServerUnregisterEndpointA(ubyte*, ubyte*);
144 	int    I_RpcServerUnregisterEndpointW(ushort*, ushort*);
145 }
146 
147 version(Unicode) {
148 	alias I_RpcServerUnregisterEndpointW I_RpcServerUnregisterEndpoint;
149 } else {
150 	alias I_RpcServerUnregisterEndpointA I_RpcServerUnregisterEndpoint;
151 }