ReactOS  0.4.15-dev-3182-g7b62228
http.h
Go to the documentation of this file.
1 /*
2  * HTTP Server API definitions
3  *
4  * Copyright (C) 2009 Andrey Turkin
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #ifndef __WINE_HTTP_H
22 #define __WINE_HTTP_H
23 
24 #include <winsock2.h>
25 #include <ws2tcpip.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 typedef struct _HTTPAPI_VERSION
32 {
36 
37 #define HTTPAPI_VERSION_1 {1,0}
38 #define HTTPAPI_VERSION_2 {2,0}
39 
40 #define HTTP_CREATE_REQUEST_QUEUE_FLAG_OPEN_EXISTING 0x00000001
41 #define HTTP_CREATE_REQUEST_QUEUE_FLAG_CONTROLLER 0x00000002
42 
43 #define HTTP_INITIALIZE_SERVER 0x00000001
44 #define HTTP_INITIALIZE_CONFIG 0x00000002
45 
46 #define HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY 0x00000001
47 #define HTTP_RECEIVE_REQUEST_FLAG_FLUSH_BODY 0x00000002
48 
49 #define HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS 0x00000001
50 #define HTTP_REQUEST_FLAG_IP_ROUTED 0x00000002
51 #define HTTP_REQUEST_FLAG_HTTP2 0x00000004
52 
53 #define HTTP_SEND_RESPONSE_FLAG_DISCONNECT 0x00000001
54 #define HTTP_SEND_RESPONSE_FLAG_MORE_DATA 0x00000002
55 #define HTTP_SEND_RESPONSE_FLAG_BUFFER_DATA 0x00000004
56 #define HTTP_SEND_RESPONSE_FLAG_ENABLE_NAGLING 0x00000008
57 #define HTTP_SEND_RESPONSE_FLAG_PROCESS_RANGES 0x00000020
58 #define HTTP_SEND_RESPONSE_FLAG_OPAQUE 0x00000040
59 
60 #define HTTP_URL_FLAG_REMOVE_ALL 0x0000001
61 
63 {
70 
71 #define HTTP_NULL_ID ((ULONGLONG)0)
72 
80 
81 typedef struct _HTTP_VERSION
82 {
86 
87 typedef enum _HTTP_VERB
88 {
111 
112 typedef struct _HTTP_COOKED_URL
113 {
118  const WCHAR *pFullUrl;
119  const WCHAR *pHost;
120  const WCHAR *pAbsPath;
123 
125 {
129 
130 typedef struct _HTTP_UNKNOWN_HEADER
131 {
134  const char *pName;
135  const char *pRawValue;
137 
138 typedef struct _HTTP_KNOWN_HEADER
139 {
141  const char *pRawValue;
143 
144 typedef enum _HTTP_HEADER_ID
145 {
166 
189 
201 
204 
205 typedef struct _HTTP_REQUEST_HEADERS
206 {
213 
215 {
222 
223 #define HTTP_BYTE_RANGE_TO_EOF ((ULONGLONG)-1)
224 
225 typedef struct _HTTP_BYTE_RANGE
226 {
230 
231 typedef struct _HTTP_DATA_CHUNK
232 {
234  __C89_NAMELESS union
235  {
236  struct
237  {
238  void *pBuffer;
240  } FromMemory;
241  struct
242  {
245  } FromFileHandle;
246  struct
247  {
251  } DUMMYUNIONNAME;
253 
255 {
262 
263 typedef struct _HTTP_SSL_INFO
264 {
269  const char *pServerCertIssuer;
270  const char *pServerCertSubject;
274 
275 typedef struct _HTTP_REQUEST_V1
276 {
285  const char *pUnknownVerb;
286  const char *pRawUrl;
296 
298 {
301 
302 typedef struct _HTTP_REQUEST_INFO
303 {
306  void *pInfo;
308 
309 #ifdef __cplusplus
310 typedef struct _HTTP_REQUEST_V2 : HTTP_REQUEST_V1
311 {
315 #else
316 typedef struct _HTTP_REQUEST_V2
317 {
322 #endif
323 
325 
327 {
334 
335 typedef struct _HTTP_RESPONSE_V1
336 {
341  const char *pReason;
346 
348 {
354 
355 typedef struct _HTTP_RESPONSE_INFO
356 {
359  void *pInfo;
361 
362 #ifdef __cplusplus
363 typedef struct _HTTP_RESPONSE_V2 : HTTP_RESPONSE_V1
364 {
368 #else
369 typedef struct _HTTP_RESPONSE_V2
370 {
375 #endif
376 
378 
380 {
386 
387 typedef struct _HTTP_CACHE_POLICY
388 {
392 
394 {
397 
398 typedef struct _HTTP_LOG_DATA
399 {
402 
404 {
418 
419 typedef struct _HTTP_PROPERTY_FLAGS
420 {
423 
424 typedef struct _HTTP_BINDING_INFO
425 {
429 
446 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);
449 
450 #ifdef __cplusplus
451 }
452 #endif
453 
454 #endif /* __WINE_HTTP_H */
const WCHAR * pFullUrl
Definition: http.h:118
void * pBuffer
Definition: http.h:238
enum _HTTP_HEADER_ID HTTP_HEADER_ID
ULONG WINAPI HttpCreateUrlGroup(HTTP_SERVER_SESSION_ID session_id, HTTP_URL_GROUP_ID *group_id, ULONG reserved)
ULONG WINAPI HttpCloseServerSession(HTTP_SERVER_SESSION_ID id)
USHORT HttpApiMinorVersion
Definition: http.h:34
struct _HTTP_SSL_CLIENT_CERT_INFO HTTP_SSL_CLIENT_CERT_INFO
HTTP_OPAQUE_ID * PHTTP_URL_GROUP_ID
Definition: http.h:78
HTTP_OPAQUE_ID HTTP_CONNECTION_ID
Definition: http.h:74
const uint16_t * PCWSTR
Definition: typedefs.h:57
const WCHAR * pQueryString
Definition: http.h:121
Definition: pdh_main.c:93
USHORT ConnectionKeySize
Definition: http.h:266
enum _HTTP_RESPONSE_INFO_TYPE * PHTTP_RESPONSE_INFO_TYPE
__C89_NAMELESS union _HTTP_DATA_CHUNK::@2913 DUMMYUNIONNAME
HTTP_REQUEST_V2 HTTP_REQUEST
Definition: http.h:324
struct _HTTP_RESPONSE_INFO HTTP_RESPONSE_INFO
USHORT AbsPathLength
Definition: http.h:116
USHORT UnknownHeaderCount
Definition: http.h:328
HTTP_PROPERTY_FLAGS Flags
Definition: http.h:426
SOCKADDR * pLocalAddress
Definition: http.h:127
Definition: http.c:7251
enum _HTTP_SERVER_PROPERTY HTTP_SERVER_PROPERTY
const char * pReason
Definition: http.h:341
HTTP_DATA_CHUNK * pEntityChunks
Definition: http.h:292
enum _HTTP_HEADER_ID * PHTTP_HEADER_ID
_HTTP_RESPONSE_INFO_TYPE
Definition: http.h:347
struct _HTTP_REQUEST_HEADERS HTTP_REQUEST_HEADERS
HANDLE RequestQueueHandle
Definition: http.h:427
HTTP_RESPONSE_INFO * pResponseInfo
Definition: http.h:373
HTTP_UNKNOWN_HEADER * pUnknownHeaders
Definition: http.h:329
const char * pUnknownVerb
Definition: http.h:285
struct _HTTP_REQUEST_INFO HTTP_REQUEST_INFO
ULONG InfoLength
Definition: http.h:305
struct _HTTP_SSL_CLIENT_CERT_INFO * PHTTP_SSL_CLIENT_CERT_INFO
struct _HTTP_VERSION HTTP_VERSION
struct _HTTP_DATA_CHUNK::@2913::@2916 FromFragmentCache
struct _HTTP_SSL_INFO HTTP_SSL_INFO
ULONGLONG HTTP_URL_CONTEXT
Definition: http.h:79
struct _HTTP_CACHE_POLICY HTTP_CACHE_POLICY
ULONG BufferLength
Definition: http.h:239
USHORT RawValueLength
Definition: http.h:140
struct _HTTP_UNKNOWN_HEADER * PHTTP_UNKNOWN_HEADER
void * pInfo
Definition: http.h:306
HTTP_LOG_DATA_TYPE Type
Definition: http.h:400
_HTTP_DATA_CHUNK_TYPE
Definition: http.h:214
ULONG ServerCertSubjectSize
Definition: http.h:268
HTTP_CACHE_POLICY_TYPE Policy
Definition: http.h:389
USHORT QueryStringLength
Definition: http.h:117
ULONG WINAPI HttpCreateHttpHandle(PHANDLE, ULONG)
struct _HTTP_RESPONSE_V2 * PHTTP_RESPONSE_V2
struct _HTTP_RESPONSE_V1 * PHTTP_RESPONSE_V1
struct _HTTP_RESPONSE_V1 HTTP_RESPONSE_V1
const char * pRawValue
Definition: http.h:141
struct _HTTP_COOKED_URL * PHTTP_COOKED_URL
HTTP_CONNECTION_ID ConnectionId
Definition: http.h:278
HTTP_OPAQUE_ID HTTP_URL_GROUP_ID
Definition: http.h:78
USHORT StatusCode
Definition: http.h:339
USHORT MajorVersion
Definition: http.h:83
HTTP_UNKNOWN_HEADER * pTrailers
Definition: http.h:210
struct _HTTP_LOG_DATA * PHTTP_LOG_DATA
ULONG WINAPI HttpCreateRequestQueue(HTTPAPI_VERSION version, const WCHAR *name, SECURITY_ATTRIBUTES *sa, ULONG flags, HANDLE *handle)
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
HTTP_OPAQUE_ID HTTP_RAW_CONNECTION_ID
Definition: http.h:75
r reserved
Definition: btrfs.c:2940
enum _HTTP_VERB HTTP_VERB
struct _HTTP_LOG_DATA HTTP_LOG_DATA
const char * pName
Definition: http.h:134
struct _HTTP_TRANSPORT_ADDRESS * PHTTP_TRANSPORT_ADDRESS
Definition: _queue.h:59
unsigned char BOOLEAN
ULONG WINAPI HttpAddUrl(HANDLE, PCWSTR, PVOID)
ULONG WINAPI HttpCreateServerSession(HTTPAPI_VERSION, PHTTP_SERVER_SESSION_ID, ULONG)
USHORT TrailerCount
Definition: http.h:209
static const WCHAR version[]
Definition: asmname.c:66
ULONG WINAPI HttpRemoveUrl(HANDLE queue, const WCHAR *url)
_HTTP_CACHE_POLICY_TYPE
Definition: http.h:379
struct _HTTP_BYTE_RANGE * PHTTP_BYTE_RANGE
HTTP_RAW_CONNECTION_ID RawConnectionId
Definition: http.h:293
SOCKADDR * pRemoteAddress
Definition: http.h:126
HTTP_VERSION Version
Definition: http.h:338
struct _HTTP_PROPERTY_FLAGS * PHTTP_PROPERTY_FLAGS
struct _HTTP_KNOWN_HEADER HTTP_KNOWN_HEADER
const char * pServerCertIssuer
Definition: http.h:269
ULONG ServerCertIssuerSize
Definition: http.h:267
GLsizeiptr size
Definition: glext.h:5919
enum _HTTP_SERVICE_CONFIG_ID * PHTTP_SERVICE_CONFIG_ID
uint8_t reserved2[12]
Definition: fsck.fat.h:58
ULONG WINAPI HttpSetUrlGroupProperty(HTTP_URL_GROUP_ID id, HTTP_SERVER_PROPERTY property, void *value, ULONG length)
struct _HTTP_DATA_CHUNK::@2913::@2914 FromMemory
ULONG WINAPI HttpCloseUrlGroup(HTTP_URL_GROUP_ID id)
__wchar_t WCHAR
Definition: xmlstorage.h:180
USHORT RawUrlLength
Definition: http.h:284
struct _HTTP_RESPONSE_V2 HTTP_RESPONSE_V2
void * pInfo
Definition: http.h:359
ULONG WINAPI HttpSetServiceConfiguration(HANDLE, HTTP_SERVICE_CONFIG_ID, PVOID, ULONG, LPOVERLAPPED)
static const WCHAR url[]
Definition: encode.c:1432
uint64_t ULONGLONG
Definition: typedefs.h:67
enum _HTTP_DATA_CHUNK_TYPE * PHTTP_DATA_CHUNK_TYPE
ULARGE_INTEGER StartingOffset
Definition: http.h:227
const char * pRawValue
Definition: http.h:135
HTTP_OPAQUE_ID * PHTTP_CONNECTION_ID
Definition: http.h:74
HTTP_VERSION Version
Definition: http.h:281
enum _HTTP_RESPONSE_INFO_TYPE HTTP_RESPONSE_INFO_TYPE
#define WINAPI
Definition: msvc.h:6
USHORT FullUrlLength
Definition: http.h:114
struct _HTTP_RESPONSE_HEADERS * PHTTP_RESPONSE_HEADERS
HTTP_OPAQUE_ID HTTP_SERVER_SESSION_ID
Definition: http.h:77
struct _HTTP_DATA_CHUNK HTTP_DATA_CHUNK
HTTP_RESPONSE_HEADERS Headers
Definition: http.h:342
const WCHAR * pHost
Definition: http.h:119
ULONG SecondsToLive
Definition: http.h:390
GLbitfield flags
Definition: glext.h:7161
USHORT HostLength
Definition: http.h:115
ULONG WINAPI HttpTerminate(ULONG flags, void *reserved)
struct _HTTPAPI_VERSION * PHTTPAPI_VERSION
enum _HTTP_VERB * PHTTP_VERB
unsigned char UCHAR
Definition: xmlstorage.h:181
HTTP_DATA_CHUNK_TYPE DataChunkType
Definition: http.h:233
struct _HTTP_BYTE_RANGE HTTP_BYTE_RANGE
const char * pServerCertSubject
Definition: http.h:270
_HTTP_VERB
Definition: http.h:87
USHORT EntityChunkCount
Definition: http.h:343
const char * pRawUrl
Definition: http.h:286
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
ULONG Flags
Definition: http.h:277
_HTTP_HEADER_ID
Definition: http.h:144
enum _HTTP_REQUEST_INFO_TYPE HTTP_REQUEST_INFO_TYPE
USHORT MinorVersion
Definition: http.h:84
HTTP_SSL_INFO * pSslInfo
Definition: http.h:294
HTTP_OPAQUE_ID * PHTTP_SERVER_SESSION_ID
Definition: http.h:77
HTTP_REQUEST_HEADERS Headers
Definition: http.h:289
USHORT ServerCertKeySize
Definition: http.h:265
struct _HTTP_REQUEST_HEADERS * PHTTP_REQUEST_HEADERS
struct _HTTP_COOKED_URL HTTP_COOKED_URL
struct _HTTP_PROPERTY_FLAGS HTTP_PROPERTY_FLAGS
HTTP_REQUEST_ID RequestId
Definition: http.h:279
struct _HTTP_KNOWN_HEADER * PHTTP_KNOWN_HEADER
struct _HTTP_BINDING_INFO HTTP_BINDING_INFO
HANDLE FileHandle
Definition: http.h:244
USHORT HttpApiMajorVersion
Definition: http.h:33
HTTP_COOKED_URL CookedUrl
Definition: http.h:287
HTTP_RESPONSE_INFO_TYPE Type
Definition: http.h:357
_HTTP_REQUEST_INFO_TYPE
Definition: http.h:297
BOOLEAN CertDeniedByMapper
Definition: http.h:260
#define __C89_NAMELESS
Definition: _mingw_mac.h:128
HTTP_RESPONSE_V1 s
Definition: http.h:371
USHORT ResponseInfoCount
Definition: http.h:372
ULONGLONG HTTP_OPAQUE_ID
Definition: http.h:73
unsigned short USHORT
Definition: pedump.c:61
struct _HTTP_RESPONSE_HEADERS HTTP_RESPONSE_HEADERS
const WCHAR * pAbsPath
Definition: http.h:120
_HTTP_SERVICE_CONFIG_ID
Definition: http.h:62
enum _HTTP_LOG_DATA_TYPE * PHTTP_LOG_DATA_TYPE
HTTP_REQUEST_INFO * pRequestInfo
Definition: http.h:320
USHORT ReasonLength
Definition: http.h:340
HTTP_DATA_CHUNK * pEntityChunks
Definition: http.h:344
struct _HTTP_RESPONSE_INFO * PHTTP_RESPONSE_INFO
struct _HTTP_TRANSPORT_ADDRESS HTTP_TRANSPORT_ADDRESS
unsigned int * PULONG
Definition: retypes.h:1
ULONG WINAPI HttpAddUrlToUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url, HTTP_URL_CONTEXT context, ULONG reserved)
HTTP_REQUEST_V2 * PHTTP_REQUEST
Definition: http.h:324
struct _HTTP_VERSION * PHTTP_VERSION
enum _HTTP_DATA_CHUNK_TYPE HTTP_DATA_CHUNK_TYPE
struct _HTTP_REQUEST_INFO * PHTTP_REQUEST_INFO
_HTTP_LOG_DATA_TYPE
Definition: http.h:393
ULONG WINAPI HttpRemoveUrlFromUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url, ULONG flags)
struct _HTTP_UNKNOWN_HEADER HTTP_UNKNOWN_HEADER
Definition: tftpd.h:85
enum _HTTP_CACHE_POLICY_TYPE * PHTTP_CACHE_POLICY_TYPE
USHORT EntityChunkCount
Definition: http.h:291
enum _HTTP_SERVER_PROPERTY * PHTTP_SERVER_PROPERTY
ULONG SslClientCertNegotiated
Definition: http.h:272
USHORT FragmentNameLength
Definition: http.h:248
ULONGLONG * PHTTP_OPAQUE_ID
Definition: http.h:73
HTTP_TRANSPORT_ADDRESS Address
Definition: http.h:288
ULONG WINAPI HttpQueryServiceConfiguration(HANDLE, HTTP_SERVICE_CONFIG_ID, PVOID, ULONG, PVOID, ULONG, PULONG, LPOVERLAPPED)
HTTP_UNKNOWN_HEADER * pTrailers
Definition: http.h:331
USHORT NameLength
Definition: http.h:132
Definition: name.c:38
enum _HTTP_SERVICE_CONFIG_ID HTTP_SERVICE_CONFIG_ID
ULONG WINAPI HttpInitialize(HTTPAPI_VERSION version, ULONG flags, void *reserved)
const WCHAR * pFragmentName
Definition: http.h:249
enum _HTTP_REQUEST_INFO_TYPE * PHTTP_REQUEST_INFO_TYPE
USHORT UnknownVerbLength
Definition: http.h:283
struct _HTTP_DATA_CHUNK * PHTTP_DATA_CHUNK
unsigned int ULONG
Definition: retypes.h:1
ULONG Flags
Definition: http.h:337
HTTP_URL_CONTEXT UrlContext
Definition: http.h:280
ULONG WINAPI HttpCloseRequestQueue(HANDLE handle)
HTTP_OPAQUE_ID * PHTTP_RAW_CONNECTION_ID
Definition: http.h:75
HTTP_REQUEST_INFO_TYPE InfoType
Definition: http.h:304
struct _HTTP_CACHE_POLICY * PHTTP_CACHE_POLICY
struct _HTTPAPI_VERSION HTTPAPI_VERSION
_HTTP_SERVER_PROPERTY
Definition: http.h:403
struct _HTTP_BINDING_INFO * PHTTP_BINDING_INFO
HTTP_SSL_CLIENT_CERT_INFO * pClientCertInfo
Definition: http.h:271
HTTP_OPAQUE_ID HTTP_REQUEST_ID
Definition: http.h:76
USHORT RequestInfoCount
Definition: http.h:319
struct _HTTP_SSL_INFO * PHTTP_SSL_INFO
HTTP_UNKNOWN_HEADER * pUnknownHeaders
Definition: http.h:208
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)
struct _HTTP_REQUEST_V1 HTTP_REQUEST_V1
ULONG WINAPI HttpDeleteServiceConfiguration(HANDLE, HTTP_SERVICE_CONFIG_ID, PVOID, ULONG, LPOVERLAPPED)
HTTP_VERB Verb
Definition: http.h:282
ULONGLONG BytesReceived
Definition: http.h:290
struct _HTTP_REQUEST_V2 * PHTTP_REQUEST_V2
HTTP_OPAQUE_ID * PHTTP_REQUEST_ID
Definition: http.h:76
USHORT TrailerCount
Definition: http.h:330
ULONG WINAPI HttpReceiveHttpRequest(HANDLE queue, HTTP_REQUEST_ID id, ULONG flags, HTTP_REQUEST *request, ULONG size, ULONG *ret_size, OVERLAPPED *ovl)
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
HTTP_BYTE_RANGE ByteRange
Definition: http.h:243
struct _HTTP_REQUEST_V2 HTTP_REQUEST_V2
struct _HTTP_DATA_CHUNK::@2913::@2915 FromFileHandle
enum _HTTP_CACHE_POLICY_TYPE HTTP_CACHE_POLICY_TYPE
enum _HTTP_LOG_DATA_TYPE HTTP_LOG_DATA_TYPE
USHORT RawValueLength
Definition: http.h:133
HTTP_RESPONSE_V2 * PHTTP_RESPONSE
Definition: http.h:377
USHORT UnknownHeaderCount
Definition: http.h:207
HTTP_RESPONSE_V2 HTTP_RESPONSE
Definition: http.h:377
HTTP_KNOWN_HEADER KnownHeaders[HttpHeaderResponseMaximum]
Definition: http.h:332
HTTP_KNOWN_HEADER KnownHeaders[HttpHeaderRequestMaximum]
Definition: http.h:211
ULARGE_INTEGER Length
Definition: http.h:228
HTTP_REQUEST_V1 s
Definition: http.h:318