Changes in crossover-wine-src-6.1.0 except for configure
[wine/hacks.git] / dlls / rpcrt4 / rpc_defs.h
blob4506ca311392a1b56caec351263a51a8a1880f8b
1 /*
2 * RPC definitions
4 * Copyright 2001-2002 Ove Kåven, TransGaming Technologies
5 * Copyright 2004 Filip Navara
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef __WINE_RPC_DEFS_H
23 #define __WINE_RPC_DEFS_H
25 /* info from http://www.microsoft.com/msj/0398/dcomtextfigs.htm */
27 typedef struct
29 unsigned char rpc_ver; /* RPC major version (5) */
30 unsigned char rpc_ver_minor; /* RPC minor version (0) */
31 unsigned char ptype; /* Packet type (PKT_*) */
32 unsigned char flags;
33 unsigned char drep[4]; /* Data representation */
34 unsigned short frag_len; /* Data size in bytes including header and tail. */
35 unsigned short auth_len; /* Authentication length */
36 unsigned long call_id; /* Call identifier. */
37 } RpcPktCommonHdr;
39 typedef struct
41 RpcPktCommonHdr common;
42 unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */
43 unsigned short context_id; /* Presentation context identifier */
44 unsigned short opnum;
45 } RpcPktRequestHdr;
47 typedef struct
49 RpcPktCommonHdr common;
50 unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */
51 unsigned short context_id; /* Presentation context identifier */
52 unsigned char cancel_count;
53 unsigned char reserved;
54 } RpcPktResponseHdr;
56 typedef struct
58 RpcPktCommonHdr common;
59 unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */
60 unsigned short context_id; /* Presentation context identifier */
61 unsigned char cancel_count; /* Received cancel count */
62 unsigned char reserved; /* Force alignment! */
63 unsigned long status; /* Runtime fault code (RPC_STATUS) */
64 unsigned long reserved2;
65 } RpcPktFaultHdr;
67 typedef struct
69 RpcPktCommonHdr common;
70 unsigned short max_tsize; /* Maximum transmission fragment size */
71 unsigned short max_rsize; /* Maximum receive fragment size */
72 unsigned long assoc_gid; /* Associated group id */
73 unsigned char num_elements; /* Number of elements */
74 unsigned char padding[3]; /* Force alignment! */
75 unsigned short context_id; /* Presentation context identifier */
76 unsigned char num_syntaxes; /* Number of syntaxes */
77 RPC_SYNTAX_IDENTIFIER abstract;
78 RPC_SYNTAX_IDENTIFIER transfer;
79 } RpcPktBindHdr;
81 #include "pshpack1.h"
82 typedef struct
84 unsigned short length; /* Length of the string including null terminator */
85 char string[1]; /* String data in single byte, null terminated form */
86 } RpcAddressString;
87 #include "poppack.h"
89 typedef struct
91 unsigned char num_results; /* Number of results */
92 unsigned char reserved[3]; /* Force alignment! */
93 struct {
94 unsigned short result;
95 unsigned short reason;
96 } results[1];
97 } RpcResults;
99 typedef struct
101 RpcPktCommonHdr common;
102 unsigned short max_tsize; /* Maximum transmission fragment size */
103 unsigned short max_rsize; /* Maximum receive fragment size */
104 unsigned long assoc_gid; /* Associated group id */
106 * Following this header are these fields:
107 * RpcAddressString server_address;
108 * [0 - 3 bytes of padding so that results is 4-byte aligned]
109 * RpcResults results;
110 * RPC_SYNTAX_IDENTIFIER transfer;
112 } RpcPktBindAckHdr;
114 typedef struct
116 RpcPktCommonHdr common;
117 unsigned short reject_reason;
118 unsigned char protocols_count;
119 struct {
120 unsigned char rpc_ver;
121 unsigned char rpc_ver_minor;
122 } protocols[1];
123 } RpcPktBindNAckHdr;
125 /* undocumented packet sent during RPC over HTTP */
126 typedef struct
128 RpcPktCommonHdr common;
129 unsigned short flags;
130 unsigned short num_data_items;
131 } RpcPktHttpHdr;
133 /* Union representing all possible packet headers */
134 typedef union
136 RpcPktCommonHdr common;
137 RpcPktRequestHdr request;
138 RpcPktResponseHdr response;
139 RpcPktFaultHdr fault;
140 RpcPktBindHdr bind;
141 RpcPktBindAckHdr bind_ack;
142 RpcPktBindNAckHdr bind_nack;
143 RpcPktHttpHdr http;
144 } RpcPktHdr;
146 typedef struct
148 unsigned char auth_type; /* authentication scheme in use */
149 unsigned char auth_level; /* RPC_C_AUTHN_LEVEL* */
150 unsigned char auth_pad_length; /* length of padding to restore n % 4 alignment */
151 unsigned char auth_reserved; /* reserved, must be zero */
152 unsigned long auth_context_id; /* unique value for the authenticated connection */
153 } RpcAuthVerifier;
155 #define RPC_AUTH_VERIFIER_LEN(common_hdr) \
156 ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0)
158 #define RPC_VER_MAJOR 5
159 #define RPC_VER_MINOR 0
161 #define RPC_FLG_FIRST 1
162 #define RPC_FLG_LAST 2
163 #define RPC_FLG_OBJECT_UUID 0x80
165 #define RPC_MIN_PACKET_SIZE 0x1000
166 #define RPC_MAX_PACKET_SIZE 0x16D0
168 #define PKT_REQUEST 0
169 #define PKT_PING 1
170 #define PKT_RESPONSE 2
171 #define PKT_FAULT 3
172 #define PKT_WORKING 4
173 #define PKT_NOCALL 5
174 #define PKT_REJECT 6
175 #define PKT_ACK 7
176 #define PKT_CL_CANCEL 8
177 #define PKT_FACK 9
178 #define PKT_CANCEL_ACK 10
179 #define PKT_BIND 11
180 #define PKT_BIND_ACK 12
181 #define PKT_BIND_NACK 13
182 #define PKT_ALTER_CONTEXT 14
183 #define PKT_ALTER_CONTEXT_RESP 15
184 #define PKT_AUTH3 16
185 #define PKT_SHUTDOWN 17
186 #define PKT_CO_CANCEL 18
187 #define PKT_ORPHANED 19
188 #define PKT_HTTP 20
190 #define RESULT_ACCEPT 0
192 #define NO_REASON 0
194 #define NCADG_IP_UDP 0x08
195 #define NCACN_IP_TCP 0x07
196 #define NCADG_IPX 0x0E
197 #define NCACN_SPX 0x0C
198 #define NCACN_NB_NB 0x12
199 #define NCACN_NB_IPX 0x0D
200 #define NCACN_DNET_NSP 0x04
201 #define NCACN_HTTP 0x1F
203 /* FreeDCE: TWR_C_FLR_PROT_ID_IP */
204 #define TWR_IP 0x09
206 #endif /* __WINE_RPC_DEFS_H */