xref: /reactos/sdk/include/psdk/http.h (revision f07f9894)
1c2c66affSColin Finck /*
2c2c66affSColin Finck  * HTTP Server API definitions
3c2c66affSColin Finck  *
4c2c66affSColin Finck  * Copyright (C) 2009 Andrey Turkin
5c2c66affSColin Finck  *
6c2c66affSColin Finck  * This library is free software; you can redistribute it and/or
7c2c66affSColin Finck  * modify it under the terms of the GNU Lesser General Public
8c2c66affSColin Finck  * License as published by the Free Software Foundation; either
9c2c66affSColin Finck  * version 2.1 of the License, or (at your option) any later version.
10c2c66affSColin Finck  *
11c2c66affSColin Finck  * This library is distributed in the hope that it will be useful,
12c2c66affSColin Finck  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14c2c66affSColin Finck  * Lesser General Public License for more details.
15c2c66affSColin Finck  *
16c2c66affSColin Finck  * You should have received a copy of the GNU Lesser General Public
17c2c66affSColin Finck  * License along with this library; if not, write to the Free Software
18c2c66affSColin Finck  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19c2c66affSColin Finck  */
20c2c66affSColin Finck 
21c2c66affSColin Finck #ifndef __WINE_HTTP_H
22c2c66affSColin Finck #define __WINE_HTTP_H
23c2c66affSColin Finck 
24c2c66affSColin Finck #include <winsock2.h>
25c2c66affSColin Finck #include <ws2tcpip.h>
26c2c66affSColin Finck 
27c2c66affSColin Finck #ifdef __cplusplus
28c2c66affSColin Finck extern "C" {
29c2c66affSColin Finck #endif
30c2c66affSColin Finck 
31c2c66affSColin Finck typedef struct _HTTPAPI_VERSION
32c2c66affSColin Finck {
33c2c66affSColin Finck     USHORT HttpApiMajorVersion;
34c2c66affSColin Finck     USHORT HttpApiMinorVersion;
35c2c66affSColin Finck } HTTPAPI_VERSION, *PHTTPAPI_VERSION;
36c2c66affSColin Finck 
37c2c66affSColin Finck #define HTTPAPI_VERSION_1 {1,0}
38c2c66affSColin Finck #define HTTPAPI_VERSION_2 {2,0}
39c2c66affSColin Finck 
40*f07f9894SAmine Khaldi #define HTTP_CREATE_REQUEST_QUEUE_FLAG_OPEN_EXISTING    0x00000001
41*f07f9894SAmine Khaldi #define HTTP_CREATE_REQUEST_QUEUE_FLAG_CONTROLLER       0x00000002
42*f07f9894SAmine Khaldi 
43c2c66affSColin Finck #define HTTP_INITIALIZE_SERVER 0x00000001
44c2c66affSColin Finck #define HTTP_INITIALIZE_CONFIG 0x00000002
45c2c66affSColin Finck 
46*f07f9894SAmine Khaldi #define HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY     0x00000001
47*f07f9894SAmine Khaldi #define HTTP_RECEIVE_REQUEST_FLAG_FLUSH_BODY    0x00000002
48*f07f9894SAmine Khaldi 
49*f07f9894SAmine Khaldi #define HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS   0x00000001
50*f07f9894SAmine Khaldi #define HTTP_REQUEST_FLAG_IP_ROUTED                 0x00000002
51*f07f9894SAmine Khaldi #define HTTP_REQUEST_FLAG_HTTP2                     0x00000004
52*f07f9894SAmine Khaldi 
53*f07f9894SAmine Khaldi #define HTTP_SEND_RESPONSE_FLAG_DISCONNECT      0x00000001
54*f07f9894SAmine Khaldi #define HTTP_SEND_RESPONSE_FLAG_MORE_DATA       0x00000002
55*f07f9894SAmine Khaldi #define HTTP_SEND_RESPONSE_FLAG_BUFFER_DATA     0x00000004
56*f07f9894SAmine Khaldi #define HTTP_SEND_RESPONSE_FLAG_ENABLE_NAGLING  0x00000008
57*f07f9894SAmine Khaldi #define HTTP_SEND_RESPONSE_FLAG_PROCESS_RANGES  0x00000020
58*f07f9894SAmine Khaldi #define HTTP_SEND_RESPONSE_FLAG_OPAQUE          0x00000040
59*f07f9894SAmine Khaldi 
60*f07f9894SAmine Khaldi #define HTTP_URL_FLAG_REMOVE_ALL    0x0000001
61*f07f9894SAmine Khaldi 
62c2c66affSColin Finck typedef enum _HTTP_SERVICE_CONFIG_ID
63c2c66affSColin Finck {
64c2c66affSColin Finck     HttpServiceConfigIPListenList,
65c2c66affSColin Finck     HttpServiceConfigSSLCertInfo,
66c2c66affSColin Finck     HttpServiceConfigUrlAclInfo,
67c2c66affSColin Finck     HttpServiceConfigTimeout,
68c2c66affSColin Finck     HttpServiceConfigMax
69c2c66affSColin Finck } HTTP_SERVICE_CONFIG_ID, *PHTTP_SERVICE_CONFIG_ID;
70c2c66affSColin Finck 
71*f07f9894SAmine Khaldi #define HTTP_NULL_ID ((ULONGLONG)0)
72c2c66affSColin Finck 
73*f07f9894SAmine Khaldi typedef ULONGLONG HTTP_OPAQUE_ID, *PHTTP_OPAQUE_ID;
74*f07f9894SAmine Khaldi typedef HTTP_OPAQUE_ID HTTP_CONNECTION_ID, *PHTTP_CONNECTION_ID;
75*f07f9894SAmine Khaldi typedef HTTP_OPAQUE_ID HTTP_RAW_CONNECTION_ID, *PHTTP_RAW_CONNECTION_ID;
76*f07f9894SAmine Khaldi typedef HTTP_OPAQUE_ID HTTP_REQUEST_ID, *PHTTP_REQUEST_ID;
77*f07f9894SAmine Khaldi typedef HTTP_OPAQUE_ID HTTP_SERVER_SESSION_ID, *PHTTP_SERVER_SESSION_ID;
78*f07f9894SAmine Khaldi typedef HTTP_OPAQUE_ID HTTP_URL_GROUP_ID, *PHTTP_URL_GROUP_ID;
79*f07f9894SAmine Khaldi typedef ULONGLONG HTTP_URL_CONTEXT;
80*f07f9894SAmine Khaldi 
81*f07f9894SAmine Khaldi typedef struct _HTTP_VERSION
82*f07f9894SAmine Khaldi {
83*f07f9894SAmine Khaldi     USHORT MajorVersion;
84*f07f9894SAmine Khaldi     USHORT MinorVersion;
85*f07f9894SAmine Khaldi } HTTP_VERSION, *PHTTP_VERSION;
86*f07f9894SAmine Khaldi 
87*f07f9894SAmine Khaldi typedef enum _HTTP_VERB
88*f07f9894SAmine Khaldi {
89*f07f9894SAmine Khaldi     HttpVerbUnparsed = 0,
90*f07f9894SAmine Khaldi     HttpVerbUnknown,
91*f07f9894SAmine Khaldi     HttpVerbInvalid,
92*f07f9894SAmine Khaldi     HttpVerbOPTIONS,
93*f07f9894SAmine Khaldi     HttpVerbGET,
94*f07f9894SAmine Khaldi     HttpVerbHEAD,
95*f07f9894SAmine Khaldi     HttpVerbPOST,
96*f07f9894SAmine Khaldi     HttpVerbPUT,
97*f07f9894SAmine Khaldi     HttpVerbDELETE,
98*f07f9894SAmine Khaldi     HttpVerbTRACE,
99*f07f9894SAmine Khaldi     HttpVerbCONNECT,
100*f07f9894SAmine Khaldi     HttpVerbTRACK,
101*f07f9894SAmine Khaldi     HttpVerbMOVE,
102*f07f9894SAmine Khaldi     HttpVerbCOPY,
103*f07f9894SAmine Khaldi     HttpVerbPROPFIND,
104*f07f9894SAmine Khaldi     HttpVerbPROPPATCH,
105*f07f9894SAmine Khaldi     HttpVerbMKCOL,
106*f07f9894SAmine Khaldi     HttpVerbLOCK,
107*f07f9894SAmine Khaldi     HttpVerbUNLOCK,
108*f07f9894SAmine Khaldi     HttpVerbSEARCH,
109*f07f9894SAmine Khaldi     HttpVerbMaximum,
110*f07f9894SAmine Khaldi } HTTP_VERB, *PHTTP_VERB;
111*f07f9894SAmine Khaldi 
112*f07f9894SAmine Khaldi typedef struct _HTTP_COOKED_URL
113*f07f9894SAmine Khaldi {
114*f07f9894SAmine Khaldi     USHORT FullUrlLength;
115*f07f9894SAmine Khaldi     USHORT HostLength;
116*f07f9894SAmine Khaldi     USHORT AbsPathLength;
117*f07f9894SAmine Khaldi     USHORT QueryStringLength;
118*f07f9894SAmine Khaldi     const WCHAR *pFullUrl;
119*f07f9894SAmine Khaldi     const WCHAR *pHost;
120*f07f9894SAmine Khaldi     const WCHAR *pAbsPath;
121*f07f9894SAmine Khaldi     const WCHAR *pQueryString;
122*f07f9894SAmine Khaldi } HTTP_COOKED_URL, *PHTTP_COOKED_URL;
123*f07f9894SAmine Khaldi 
124*f07f9894SAmine Khaldi typedef struct _HTTP_TRANSPORT_ADDRESS
125*f07f9894SAmine Khaldi {
126*f07f9894SAmine Khaldi     SOCKADDR *pRemoteAddress;
127*f07f9894SAmine Khaldi     SOCKADDR *pLocalAddress;
128*f07f9894SAmine Khaldi } HTTP_TRANSPORT_ADDRESS, *PHTTP_TRANSPORT_ADDRESS;
129*f07f9894SAmine Khaldi 
130*f07f9894SAmine Khaldi typedef struct _HTTP_UNKNOWN_HEADER
131*f07f9894SAmine Khaldi {
132*f07f9894SAmine Khaldi     USHORT NameLength;
133*f07f9894SAmine Khaldi     USHORT RawValueLength;
134*f07f9894SAmine Khaldi     const char *pName;
135*f07f9894SAmine Khaldi     const char *pRawValue;
136*f07f9894SAmine Khaldi } HTTP_UNKNOWN_HEADER, *PHTTP_UNKNOWN_HEADER;
137*f07f9894SAmine Khaldi 
138*f07f9894SAmine Khaldi typedef struct _HTTP_KNOWN_HEADER
139*f07f9894SAmine Khaldi {
140*f07f9894SAmine Khaldi     USHORT RawValueLength;
141*f07f9894SAmine Khaldi     const char *pRawValue;
142*f07f9894SAmine Khaldi } HTTP_KNOWN_HEADER, *PHTTP_KNOWN_HEADER;
143*f07f9894SAmine Khaldi 
144*f07f9894SAmine Khaldi typedef enum _HTTP_HEADER_ID
145*f07f9894SAmine Khaldi {
146*f07f9894SAmine Khaldi     HttpHeaderCacheControl = 0,
147*f07f9894SAmine Khaldi     HttpHeaderConnection = 1,
148*f07f9894SAmine Khaldi     HttpHeaderDate = 2,
149*f07f9894SAmine Khaldi     HttpHeaderKeepAlive = 3,
150*f07f9894SAmine Khaldi     HttpHeaderPragma = 4,
151*f07f9894SAmine Khaldi     HttpHeaderTrailer = 5,
152*f07f9894SAmine Khaldi     HttpHeaderTransferEncoding = 6,
153*f07f9894SAmine Khaldi     HttpHeaderUpgrade = 7,
154*f07f9894SAmine Khaldi     HttpHeaderVia = 8,
155*f07f9894SAmine Khaldi     HttpHeaderWarning = 9,
156*f07f9894SAmine Khaldi     HttpHeaderAllow = 10,
157*f07f9894SAmine Khaldi     HttpHeaderContentLength = 11,
158*f07f9894SAmine Khaldi     HttpHeaderContentType = 12,
159*f07f9894SAmine Khaldi     HttpHeaderContentEncoding = 13,
160*f07f9894SAmine Khaldi     HttpHeaderContentLanguage = 14,
161*f07f9894SAmine Khaldi     HttpHeaderContentLocation = 15,
162*f07f9894SAmine Khaldi     HttpHeaderContentMd5 = 16,
163*f07f9894SAmine Khaldi     HttpHeaderContentRange = 17,
164*f07f9894SAmine Khaldi     HttpHeaderExpires = 18,
165*f07f9894SAmine Khaldi     HttpHeaderLastModified = 19,
166*f07f9894SAmine Khaldi 
167*f07f9894SAmine Khaldi     HttpHeaderAccept = 20,
168*f07f9894SAmine Khaldi     HttpHeaderAcceptCharset = 21,
169*f07f9894SAmine Khaldi     HttpHeaderAcceptEncoding = 22,
170*f07f9894SAmine Khaldi     HttpHeaderAcceptLanguage = 23,
171*f07f9894SAmine Khaldi     HttpHeaderAuthorization = 24,
172*f07f9894SAmine Khaldi     HttpHeaderCookie = 25,
173*f07f9894SAmine Khaldi     HttpHeaderExpect = 26,
174*f07f9894SAmine Khaldi     HttpHeaderFrom = 27,
175*f07f9894SAmine Khaldi     HttpHeaderHost = 28,
176*f07f9894SAmine Khaldi     HttpHeaderIfMatch = 29,
177*f07f9894SAmine Khaldi     HttpHeaderIfModifiedSince = 30,
178*f07f9894SAmine Khaldi     HttpHeaderIfNoneMatch = 31,
179*f07f9894SAmine Khaldi     HttpHeaderIfRange = 32,
180*f07f9894SAmine Khaldi     HttpHeaderIfUnmodifiedSince = 33,
181*f07f9894SAmine Khaldi     HttpHeaderMaxForwards = 34,
182*f07f9894SAmine Khaldi     HttpHeaderProxyAuthorization = 35,
183*f07f9894SAmine Khaldi     HttpHeaderReferer = 36,
184*f07f9894SAmine Khaldi     HttpHeaderRange = 37,
185*f07f9894SAmine Khaldi     HttpHeaderTe = 38,
186*f07f9894SAmine Khaldi     HttpHeaderTranslate = 39,
187*f07f9894SAmine Khaldi     HttpHeaderUserAgent = 40,
188*f07f9894SAmine Khaldi     HttpHeaderRequestMaximum = 41,
189*f07f9894SAmine Khaldi 
190*f07f9894SAmine Khaldi     HttpHeaderAcceptRanges = 20,
191*f07f9894SAmine Khaldi     HttpHeaderAge = 21,
192*f07f9894SAmine Khaldi     HttpHeaderEtag = 22,
193*f07f9894SAmine Khaldi     HttpHeaderLocation = 23,
194*f07f9894SAmine Khaldi     HttpHeaderProxyAuthenticate = 24,
195*f07f9894SAmine Khaldi     HttpHeaderRetryAfter = 25,
196*f07f9894SAmine Khaldi     HttpHeaderServer = 26,
197*f07f9894SAmine Khaldi     HttpHeaderSetCookie = 27,
198*f07f9894SAmine Khaldi     HttpHeaderVary = 28,
199*f07f9894SAmine Khaldi     HttpHeaderWwwAuthenticate = 29,
200*f07f9894SAmine Khaldi     HttpHeaderResponseMaximum = 30,
201*f07f9894SAmine Khaldi 
202*f07f9894SAmine Khaldi     HttpHeaderMaximum = 41,
203*f07f9894SAmine Khaldi } HTTP_HEADER_ID, *PHTTP_HEADER_ID;
204*f07f9894SAmine Khaldi 
205*f07f9894SAmine Khaldi typedef struct _HTTP_REQUEST_HEADERS
206*f07f9894SAmine Khaldi {
207*f07f9894SAmine Khaldi     USHORT UnknownHeaderCount;
208*f07f9894SAmine Khaldi     HTTP_UNKNOWN_HEADER *pUnknownHeaders;
209*f07f9894SAmine Khaldi     USHORT TrailerCount;
210*f07f9894SAmine Khaldi     HTTP_UNKNOWN_HEADER *pTrailers;
211*f07f9894SAmine Khaldi     HTTP_KNOWN_HEADER KnownHeaders[HttpHeaderRequestMaximum];
212*f07f9894SAmine Khaldi } HTTP_REQUEST_HEADERS, *PHTTP_REQUEST_HEADERS;
213*f07f9894SAmine Khaldi 
214*f07f9894SAmine Khaldi typedef enum _HTTP_DATA_CHUNK_TYPE
215*f07f9894SAmine Khaldi {
216*f07f9894SAmine Khaldi     HttpDataChunkFromMemory = 0,
217*f07f9894SAmine Khaldi     HttpDataChunkFromFileHandle,
218*f07f9894SAmine Khaldi     HttpDataChunkFromFragmentCache,
219*f07f9894SAmine Khaldi     HttpDataChunkFromFragmentCacheEx,
220*f07f9894SAmine Khaldi     HttpDataChunkMaximum,
221*f07f9894SAmine Khaldi } HTTP_DATA_CHUNK_TYPE, *PHTTP_DATA_CHUNK_TYPE;
222*f07f9894SAmine Khaldi 
223*f07f9894SAmine Khaldi #define HTTP_BYTE_RANGE_TO_EOF ((ULONGLONG)-1)
224*f07f9894SAmine Khaldi 
225*f07f9894SAmine Khaldi typedef struct _HTTP_BYTE_RANGE
226*f07f9894SAmine Khaldi {
227*f07f9894SAmine Khaldi     ULARGE_INTEGER StartingOffset;
228*f07f9894SAmine Khaldi     ULARGE_INTEGER Length;
229*f07f9894SAmine Khaldi } HTTP_BYTE_RANGE, *PHTTP_BYTE_RANGE;
230*f07f9894SAmine Khaldi 
231*f07f9894SAmine Khaldi typedef struct _HTTP_DATA_CHUNK
232*f07f9894SAmine Khaldi {
233*f07f9894SAmine Khaldi     HTTP_DATA_CHUNK_TYPE DataChunkType;
234*f07f9894SAmine Khaldi     __C89_NAMELESS union
235*f07f9894SAmine Khaldi     {
236*f07f9894SAmine Khaldi         struct
237*f07f9894SAmine Khaldi         {
238*f07f9894SAmine Khaldi             void *pBuffer;
239*f07f9894SAmine Khaldi             ULONG BufferLength;
240*f07f9894SAmine Khaldi         } FromMemory;
241*f07f9894SAmine Khaldi         struct
242*f07f9894SAmine Khaldi         {
243*f07f9894SAmine Khaldi             HTTP_BYTE_RANGE ByteRange;
244*f07f9894SAmine Khaldi             HANDLE FileHandle;
245*f07f9894SAmine Khaldi         } FromFileHandle;
246*f07f9894SAmine Khaldi         struct
247*f07f9894SAmine Khaldi         {
248*f07f9894SAmine Khaldi             USHORT FragmentNameLength;
249*f07f9894SAmine Khaldi             const WCHAR *pFragmentName;
250*f07f9894SAmine Khaldi         } FromFragmentCache;
251*f07f9894SAmine Khaldi     } DUMMYUNIONNAME;
252*f07f9894SAmine Khaldi } HTTP_DATA_CHUNK, *PHTTP_DATA_CHUNK;
253*f07f9894SAmine Khaldi 
254*f07f9894SAmine Khaldi typedef struct _HTTP_SSL_CLIENT_CERT_INFO
255*f07f9894SAmine Khaldi {
256*f07f9894SAmine Khaldi     ULONG CertFlags;
257*f07f9894SAmine Khaldi     ULONG CertEncodedSize;
258*f07f9894SAmine Khaldi     UCHAR *pCertEncoded;
259*f07f9894SAmine Khaldi     HANDLE Token;
260*f07f9894SAmine Khaldi     BOOLEAN CertDeniedByMapper;
261*f07f9894SAmine Khaldi } HTTP_SSL_CLIENT_CERT_INFO, *PHTTP_SSL_CLIENT_CERT_INFO;
262*f07f9894SAmine Khaldi 
263*f07f9894SAmine Khaldi typedef struct _HTTP_SSL_INFO
264*f07f9894SAmine Khaldi {
265*f07f9894SAmine Khaldi     USHORT ServerCertKeySize;
266*f07f9894SAmine Khaldi     USHORT ConnectionKeySize;
267*f07f9894SAmine Khaldi     ULONG ServerCertIssuerSize;
268*f07f9894SAmine Khaldi     ULONG ServerCertSubjectSize;
269*f07f9894SAmine Khaldi     const char *pServerCertIssuer;
270*f07f9894SAmine Khaldi     const char *pServerCertSubject;
271*f07f9894SAmine Khaldi     HTTP_SSL_CLIENT_CERT_INFO *pClientCertInfo;
272*f07f9894SAmine Khaldi     ULONG SslClientCertNegotiated;
273*f07f9894SAmine Khaldi } HTTP_SSL_INFO, *PHTTP_SSL_INFO;
274*f07f9894SAmine Khaldi 
275*f07f9894SAmine Khaldi typedef struct _HTTP_REQUEST_V1
276*f07f9894SAmine Khaldi {
277*f07f9894SAmine Khaldi     ULONG Flags;
278*f07f9894SAmine Khaldi     HTTP_CONNECTION_ID ConnectionId;
279*f07f9894SAmine Khaldi     HTTP_REQUEST_ID RequestId;
280*f07f9894SAmine Khaldi     HTTP_URL_CONTEXT UrlContext;
281*f07f9894SAmine Khaldi     HTTP_VERSION Version;
282*f07f9894SAmine Khaldi     HTTP_VERB Verb;
283*f07f9894SAmine Khaldi     USHORT UnknownVerbLength;
284*f07f9894SAmine Khaldi     USHORT RawUrlLength;
285*f07f9894SAmine Khaldi     const char *pUnknownVerb;
286*f07f9894SAmine Khaldi     const char *pRawUrl;
287*f07f9894SAmine Khaldi     HTTP_COOKED_URL CookedUrl;
288*f07f9894SAmine Khaldi     HTTP_TRANSPORT_ADDRESS Address;
289*f07f9894SAmine Khaldi     HTTP_REQUEST_HEADERS Headers;
290*f07f9894SAmine Khaldi     ULONGLONG BytesReceived;
291*f07f9894SAmine Khaldi     USHORT EntityChunkCount;
292*f07f9894SAmine Khaldi     HTTP_DATA_CHUNK *pEntityChunks;
293*f07f9894SAmine Khaldi     HTTP_RAW_CONNECTION_ID RawConnectionId;
294*f07f9894SAmine Khaldi     HTTP_SSL_INFO *pSslInfo;
295*f07f9894SAmine Khaldi } HTTP_REQUEST_V1;
296*f07f9894SAmine Khaldi 
297*f07f9894SAmine Khaldi typedef enum _HTTP_REQUEST_INFO_TYPE
298*f07f9894SAmine Khaldi {
299*f07f9894SAmine Khaldi     HttpRequestInfoTypeAuth = 0,
300*f07f9894SAmine Khaldi } HTTP_REQUEST_INFO_TYPE, *PHTTP_REQUEST_INFO_TYPE;
301*f07f9894SAmine Khaldi 
302*f07f9894SAmine Khaldi typedef struct _HTTP_REQUEST_INFO
303*f07f9894SAmine Khaldi {
304*f07f9894SAmine Khaldi     HTTP_REQUEST_INFO_TYPE InfoType;
305*f07f9894SAmine Khaldi     ULONG InfoLength;
306*f07f9894SAmine Khaldi     void *pInfo;
307*f07f9894SAmine Khaldi } HTTP_REQUEST_INFO, *PHTTP_REQUEST_INFO;
308*f07f9894SAmine Khaldi 
309*f07f9894SAmine Khaldi #ifdef __cplusplus
310*f07f9894SAmine Khaldi typedef struct _HTTP_REQUEST_V2 : HTTP_REQUEST_V1
311*f07f9894SAmine Khaldi {
312*f07f9894SAmine Khaldi     USHORT RequestInfoCount;
313*f07f9894SAmine Khaldi     HTTP_REQUEST_INFO *pRequestInfo;
314*f07f9894SAmine Khaldi } HTTP_REQUEST_V2, *PHTTP_REQUEST_V2;
315*f07f9894SAmine Khaldi #else
316*f07f9894SAmine Khaldi typedef struct _HTTP_REQUEST_V2
317*f07f9894SAmine Khaldi {
318*f07f9894SAmine Khaldi     HTTP_REQUEST_V1 s;
319*f07f9894SAmine Khaldi     USHORT RequestInfoCount;
320*f07f9894SAmine Khaldi     HTTP_REQUEST_INFO *pRequestInfo;
321*f07f9894SAmine Khaldi } HTTP_REQUEST_V2, *PHTTP_REQUEST_V2;
322*f07f9894SAmine Khaldi #endif
323*f07f9894SAmine Khaldi 
324*f07f9894SAmine Khaldi typedef HTTP_REQUEST_V2 HTTP_REQUEST, *PHTTP_REQUEST;
325*f07f9894SAmine Khaldi 
326*f07f9894SAmine Khaldi typedef struct _HTTP_RESPONSE_HEADERS
327*f07f9894SAmine Khaldi {
328*f07f9894SAmine Khaldi     USHORT UnknownHeaderCount;
329*f07f9894SAmine Khaldi     HTTP_UNKNOWN_HEADER *pUnknownHeaders;
330*f07f9894SAmine Khaldi     USHORT TrailerCount;
331*f07f9894SAmine Khaldi     HTTP_UNKNOWN_HEADER *pTrailers;
332*f07f9894SAmine Khaldi     HTTP_KNOWN_HEADER KnownHeaders[HttpHeaderResponseMaximum];
333*f07f9894SAmine Khaldi } HTTP_RESPONSE_HEADERS,*PHTTP_RESPONSE_HEADERS;
334*f07f9894SAmine Khaldi 
335*f07f9894SAmine Khaldi typedef struct _HTTP_RESPONSE_V1
336*f07f9894SAmine Khaldi {
337*f07f9894SAmine Khaldi     ULONG Flags;
338*f07f9894SAmine Khaldi     HTTP_VERSION Version;
339*f07f9894SAmine Khaldi     USHORT StatusCode;
340*f07f9894SAmine Khaldi     USHORT ReasonLength;
341*f07f9894SAmine Khaldi     const char *pReason;
342*f07f9894SAmine Khaldi     HTTP_RESPONSE_HEADERS Headers;
343*f07f9894SAmine Khaldi     USHORT EntityChunkCount;
344*f07f9894SAmine Khaldi     HTTP_DATA_CHUNK *pEntityChunks;
345*f07f9894SAmine Khaldi } HTTP_RESPONSE_V1, *PHTTP_RESPONSE_V1;
346*f07f9894SAmine Khaldi 
347*f07f9894SAmine Khaldi typedef enum _HTTP_RESPONSE_INFO_TYPE
348*f07f9894SAmine Khaldi {
349*f07f9894SAmine Khaldi     HttpResponseInfoTypeMultipleKnownHeaders = 0,
350*f07f9894SAmine Khaldi     HttpResponseInfoTypeAuthenticationProperty,
351*f07f9894SAmine Khaldi     HttpResponseInfoTypeQosProperty,
352*f07f9894SAmine Khaldi     HttpResponseInfoTypeChannelBind,
353*f07f9894SAmine Khaldi } HTTP_RESPONSE_INFO_TYPE, *PHTTP_RESPONSE_INFO_TYPE;
354*f07f9894SAmine Khaldi 
355*f07f9894SAmine Khaldi typedef struct _HTTP_RESPONSE_INFO
356*f07f9894SAmine Khaldi {
357*f07f9894SAmine Khaldi     HTTP_RESPONSE_INFO_TYPE Type;
358*f07f9894SAmine Khaldi     ULONG Length;
359*f07f9894SAmine Khaldi     void *pInfo;
360*f07f9894SAmine Khaldi } HTTP_RESPONSE_INFO, *PHTTP_RESPONSE_INFO;
361*f07f9894SAmine Khaldi 
362*f07f9894SAmine Khaldi #ifdef __cplusplus
363*f07f9894SAmine Khaldi typedef struct _HTTP_RESPONSE_V2 : HTTP_RESPONSE_V1
364*f07f9894SAmine Khaldi {
365*f07f9894SAmine Khaldi     USHORT ResponseInfoCount;
366*f07f9894SAmine Khaldi     HTTP_RESPONSE_INFO *pResponseInfo;
367*f07f9894SAmine Khaldi } HTTP_RESPONSE_V2, *PHTTP_RESPONSE_V2;
368*f07f9894SAmine Khaldi #else
369*f07f9894SAmine Khaldi typedef struct _HTTP_RESPONSE_V2
370*f07f9894SAmine Khaldi {
371*f07f9894SAmine Khaldi     HTTP_RESPONSE_V1 s;
372*f07f9894SAmine Khaldi     USHORT ResponseInfoCount;
373*f07f9894SAmine Khaldi     HTTP_RESPONSE_INFO *pResponseInfo;
374*f07f9894SAmine Khaldi } HTTP_RESPONSE_V2, *PHTTP_RESPONSE_V2;
375*f07f9894SAmine Khaldi #endif
376*f07f9894SAmine Khaldi 
377*f07f9894SAmine Khaldi typedef HTTP_RESPONSE_V2 HTTP_RESPONSE, *PHTTP_RESPONSE;
378*f07f9894SAmine Khaldi 
379*f07f9894SAmine Khaldi typedef enum _HTTP_CACHE_POLICY_TYPE
380*f07f9894SAmine Khaldi {
381*f07f9894SAmine Khaldi     HttpCachePolicyNocache,
382*f07f9894SAmine Khaldi     HttpCachePolicyUserInvalidates,
383*f07f9894SAmine Khaldi     HttpCachePolicyTimeToLive,
384*f07f9894SAmine Khaldi     HttpCachePolicyMaximum,
385*f07f9894SAmine Khaldi } HTTP_CACHE_POLICY_TYPE, *PHTTP_CACHE_POLICY_TYPE;
386*f07f9894SAmine Khaldi 
387*f07f9894SAmine Khaldi typedef struct _HTTP_CACHE_POLICY
388*f07f9894SAmine Khaldi {
389*f07f9894SAmine Khaldi     HTTP_CACHE_POLICY_TYPE Policy;
390*f07f9894SAmine Khaldi     ULONG SecondsToLive;
391*f07f9894SAmine Khaldi } HTTP_CACHE_POLICY, *PHTTP_CACHE_POLICY;
392*f07f9894SAmine Khaldi 
393*f07f9894SAmine Khaldi typedef enum _HTTP_LOG_DATA_TYPE
394*f07f9894SAmine Khaldi {
395*f07f9894SAmine Khaldi     HttpLogDataTypeFields = 0,
396*f07f9894SAmine Khaldi } HTTP_LOG_DATA_TYPE, *PHTTP_LOG_DATA_TYPE;
397*f07f9894SAmine Khaldi 
398*f07f9894SAmine Khaldi typedef struct _HTTP_LOG_DATA
399*f07f9894SAmine Khaldi {
400*f07f9894SAmine Khaldi     HTTP_LOG_DATA_TYPE Type;
401*f07f9894SAmine Khaldi } HTTP_LOG_DATA, *PHTTP_LOG_DATA;
402*f07f9894SAmine Khaldi 
403*f07f9894SAmine Khaldi typedef enum _HTTP_SERVER_PROPERTY
404*f07f9894SAmine Khaldi {
405*f07f9894SAmine Khaldi     HttpServerAuthenticationProperty,
406*f07f9894SAmine Khaldi     HttpServerLoggingProperty,
407*f07f9894SAmine Khaldi     HttpServerQosProperty,
408*f07f9894SAmine Khaldi     HttpServerTimeoutsProperty,
409*f07f9894SAmine Khaldi     HttpServerQueueLengthProperty,
410*f07f9894SAmine Khaldi     HttpServerStateProperty,
411*f07f9894SAmine Khaldi     HttpServer503VerbosityProperty,
412*f07f9894SAmine Khaldi     HttpServerBindingProperty,
413*f07f9894SAmine Khaldi     HttpServerExtendedAuthenticationProperty,
414*f07f9894SAmine Khaldi     HttpServerListenEndpointProperty,
415*f07f9894SAmine Khaldi     HttpServerChannelBindProperty,
416*f07f9894SAmine Khaldi     HttpServerProtectionLevelProperty,
417*f07f9894SAmine Khaldi } HTTP_SERVER_PROPERTY, *PHTTP_SERVER_PROPERTY;
418*f07f9894SAmine Khaldi 
419*f07f9894SAmine Khaldi typedef struct _HTTP_PROPERTY_FLAGS
420*f07f9894SAmine Khaldi {
421*f07f9894SAmine Khaldi     ULONG Present : 1;
422*f07f9894SAmine Khaldi } HTTP_PROPERTY_FLAGS, *PHTTP_PROPERTY_FLAGS;
423*f07f9894SAmine Khaldi 
424*f07f9894SAmine Khaldi typedef struct _HTTP_BINDING_INFO
425*f07f9894SAmine Khaldi {
426*f07f9894SAmine Khaldi     HTTP_PROPERTY_FLAGS Flags;
427*f07f9894SAmine Khaldi     HANDLE RequestQueueHandle;
428*f07f9894SAmine Khaldi } HTTP_BINDING_INFO, *PHTTP_BINDING_INFO;
429c2c66affSColin Finck 
430c2c66affSColin Finck ULONG WINAPI HttpAddUrl(HANDLE,PCWSTR,PVOID);
431*f07f9894SAmine Khaldi ULONG WINAPI HttpAddUrlToUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url, HTTP_URL_CONTEXT context, ULONG reserved);
432*f07f9894SAmine Khaldi ULONG WINAPI HttpCloseRequestQueue(HANDLE handle);
433*f07f9894SAmine Khaldi ULONG WINAPI HttpCloseServerSession(HTTP_SERVER_SESSION_ID id);
434*f07f9894SAmine Khaldi ULONG WINAPI HttpCloseUrlGroup(HTTP_URL_GROUP_ID id);
435c2c66affSColin Finck ULONG WINAPI HttpCreateHttpHandle(PHANDLE,ULONG);
436*f07f9894SAmine Khaldi ULONG WINAPI HttpCreateRequestQueue(HTTPAPI_VERSION version, const WCHAR *name, SECURITY_ATTRIBUTES *sa, ULONG flags, HANDLE *handle);
437c2c66affSColin Finck ULONG WINAPI HttpCreateServerSession(HTTPAPI_VERSION,PHTTP_SERVER_SESSION_ID,ULONG);
438*f07f9894SAmine Khaldi ULONG WINAPI HttpCreateUrlGroup(HTTP_SERVER_SESSION_ID session_id, HTTP_URL_GROUP_ID *group_id, ULONG reserved);
439c2c66affSColin Finck ULONG WINAPI HttpDeleteServiceConfiguration(HANDLE,HTTP_SERVICE_CONFIG_ID,PVOID,ULONG,LPOVERLAPPED);
440*f07f9894SAmine Khaldi ULONG WINAPI HttpInitialize(HTTPAPI_VERSION version, ULONG flags, void *reserved);
441*f07f9894SAmine Khaldi ULONG WINAPI HttpTerminate(ULONG flags, void *reserved);
442c2c66affSColin Finck ULONG WINAPI HttpQueryServiceConfiguration(HANDLE,HTTP_SERVICE_CONFIG_ID,PVOID,ULONG,PVOID,ULONG,PULONG,LPOVERLAPPED);
443*f07f9894SAmine Khaldi ULONG WINAPI HttpReceiveHttpRequest(HANDLE queue, HTTP_REQUEST_ID id, ULONG flags, HTTP_REQUEST *request, ULONG size, ULONG *ret_size, OVERLAPPED *ovl);
444*f07f9894SAmine Khaldi ULONG WINAPI HttpRemoveUrl(HANDLE queue, const WCHAR *url);
445*f07f9894SAmine Khaldi ULONG WINAPI HttpRemoveUrlFromUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url, ULONG flags);
446*f07f9894SAmine Khaldi ULONG WINAPI HttpSendHttpResponse(HANDLE queue, HTTP_REQUEST_ID id, ULONG flags, HTTP_RESPONSE *response, HTTP_CACHE_POLICY *cache_policy, ULONG *ret_size, void *reserved1, ULONG reserved2, OVERLAPPED *ovl, HTTP_LOG_DATA *log_data);
447c2c66affSColin Finck ULONG WINAPI HttpSetServiceConfiguration(HANDLE,HTTP_SERVICE_CONFIG_ID,PVOID,ULONG,LPOVERLAPPED);
448*f07f9894SAmine Khaldi ULONG WINAPI HttpSetUrlGroupProperty(HTTP_URL_GROUP_ID id, HTTP_SERVER_PROPERTY property, void *value, ULONG length);
449c2c66affSColin Finck 
450c2c66affSColin Finck #ifdef __cplusplus
451c2c66affSColin Finck }
452c2c66affSColin Finck #endif
453c2c66affSColin Finck 
454c2c66affSColin Finck #endif  /* __WINE_HTTP_H */
455