5 #define CONFIG "config.h"
16 DWORD DataRepresentation
;
20 } /*__packed*/ RPC_HEADER
;
32 WORD InterfaceVerMajor
;
33 WORD InterfaceVerMinor
;
37 } /*__packed*/ RPC_BIND_REQUEST
;
43 WORD SecondaryAddressLength
;
44 BYTE SecondaryAddress
[6];
52 } /*__packed*/ RPC_BIND_RESPONSE
;
64 } /*__packed*/ RPC_REQUEST
;
77 } /*__packed*/ RPC_RESPONSE
;
95 } /*__packed*/ RPC_REQUEST64
;
115 uint64_t DataSizeMax
;
124 } /*__packed*/ RPC_RESPONSE64
;
127 typedef SOCKET RpcCtx
;
128 typedef int RpcStatus
;
130 #define INVALID_NDR_CTX ((WORD)~0)
132 #define RPC_BIND_ACCEPT (0)
133 #define RPC_BIND_NACK (LE16(2))
134 #define RPC_BIND_ACK (LE16(3))
136 #define RPC_SYNTAX_UNSUPPORTED (LE16(2))
137 #define RPC_ABSTRACTSYNTAX_UNSUPPORTED (LE16(1))
139 #define RPC_BTFN_SEC_CONTEXT_MULTIPLEX (LE16(1))
140 #define RPC_BTFN_KEEP_ORPHAN (LE16(2))
142 #define INVALID_RPCCTX INVALID_SOCKET
143 #define closeRpc socketclose
145 #define RPC_PT_REQUEST 0
146 #define RPC_PT_RESPONSE 2
147 #define RPC_PT_BIND_REQ 11
148 #define RPC_PT_BIND_ACK 12
149 #define RPC_PT_ALTERCONTEXT_REQ 14
150 #define RPC_PT_ALTERCONTEXT_ACK 15
152 #define RPC_PF_FIRST 1
153 #define RPC_PF_LAST 2
154 #define RPC_PF_CANCEL_PENDING 4
155 #define RPC_PF_RESERVED 8
156 #define RPC_PF_MULTIPLEX 16
157 #define RPC_PF_NOT_EXEC 32
158 #define RPC_PF_MAYBE 64
159 #define RPC_PF_OBJECT 128
161 typedef union _RPC_FLAGS
165 uint32_t FlagsBTFN
: 16;
170 } RPC_FLAGS
, *PRPC_FLAGS
;
172 extern RPC_FLAGS RpcFlags
;
174 void rpcServer(const RpcCtx socket
, const DWORD RpcAssocGroup
, const char* const ipstr
);
175 RpcStatus
rpcBindClient(const RpcCtx sock
, const int_fast8_t verbose
);
176 RpcStatus
rpcSendRequest(const RpcCtx socket
, const BYTE
*const KmsRequest
, const size_t requestSize
, BYTE
**KmsResponse
, size_t *const responseSize
);