1 /***********************************************************************\
2 *                               wininet.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module windows.wininet;
12 pragma(lib, "wininet");
13 nothrow:
14 // FIXME: check types and grouping of constants
15 
16 import windows.windows;
17 
18 enum {
19 	INTERNET_INVALID_PORT_NUMBER =    0,
20 	INTERNET_DEFAULT_FTP_PORT    =   21,
21 	INTERNET_DEFAULT_GOPHER_PORT =   70,
22 	INTERNET_DEFAULT_HTTP_PORT   =   80,
23 	INTERNET_DEFAULT_HTTPS_PORT  =  443,
24 	INTERNET_DEFAULT_SOCKS_PORT  = 1080
25 }
26 
27 const size_t
28 	MAX_CACHE_ENTRY_INFO_SIZE       =  4096,
29 	INTERNET_MAX_HOST_NAME_LENGTH   =   256,
30 	INTERNET_MAX_USER_NAME_LENGTH   =   128,
31 	INTERNET_MAX_PASSWORD_LENGTH    =   128,
32 	INTERNET_MAX_PORT_NUMBER_LENGTH =     5,
33 	INTERNET_MAX_PORT_NUMBER_VALUE  = 65535,
34 	INTERNET_MAX_PATH_LENGTH        =  2048,
35 	INTERNET_MAX_SCHEME_LENGTH      =    32,
36 	INTERNET_MAX_URL_LENGTH         = INTERNET_MAX_SCHEME_LENGTH
37 	                                  + "://".length
38 	                                  + INTERNET_MAX_PATH_LENGTH;
39 
40 enum : DWORD {
41 	INTERNET_KEEP_ALIVE_UNKNOWN  = DWORD.max,
42 	INTERNET_KEEP_ALIVE_DISABLED = 0,
43 	INTERNET_KEEP_ALIVE_ENABLED
44 }
45 
46 enum {
47 	INTERNET_REQFLAG_FROM_CACHE = 1,
48 	INTERNET_REQFLAG_ASYNC      = 2
49 }
50 
51 const DWORD
52 	INTERNET_FLAG_RELOAD                   = 0x80000000,
53 	INTERNET_FLAG_RAW_DATA                 = 0x40000000,
54 	INTERNET_FLAG_EXISTING_CONNECT         = 0x20000000,
55 	INTERNET_FLAG_ASYNC                    = 0x10000000,
56 	INTERNET_FLAG_PASSIVE                  = 0x08000000,
57 	INTERNET_FLAG_NO_CACHE_WRITE           = 0x04000000,
58 	INTERNET_FLAG_DONT_CACHE               = INTERNET_FLAG_NO_CACHE_WRITE,
59 	INTERNET_FLAG_MAKE_PERSISTENT          = 0x02000000,
60 	INTERNET_FLAG_OFFLINE                  = 0x01000000,
61 	INTERNET_FLAG_SECURE                   = 0x00800000,
62 	INTERNET_FLAG_KEEP_CONNECTION          = 0x00400000,
63 	INTERNET_FLAG_NO_AUTO_REDIRECT         = 0x00200000,
64 	INTERNET_FLAG_READ_PREFETCH            = 0x00100000,
65 	INTERNET_FLAG_NO_COOKIES               = 0x00080000,
66 	INTERNET_FLAG_NO_AUTH                  = 0x00040000,
67 	INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP  = 0x00008000,
68 	INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS = 0x00004000,
69 	INTERNET_FLAG_IGNORE_CERT_DATE_INVALID = 0x00002000,
70 	INTERNET_FLAG_IGNORE_CERT_CN_INVALID   = 0x00001000,
71 	INTERNET_FLAG_RESYNCHRONIZE            = 0x00000800,
72 	INTERNET_FLAG_HYPERLINK                = 0x00000400,
73 	INTERNET_FLAG_NO_UI                    = 0x00000200,
74 	INTERNET_FLAG_PRAGMA_NOCACHE           = 0x00000100,
75 	INTERNET_FLAG_MUST_CACHE_REQUEST       = 0x00000010,
76 	INTERNET_FLAG_TRANSFER_ASCII           = FTP_TRANSFER_TYPE_ASCII,
77 	INTERNET_FLAG_TRANSFER_BINARY          = FTP_TRANSFER_TYPE_BINARY,
78 
79 	SECURITY_INTERNET_MASK                 = 0x0000F000,
80 	SECURITY_SET_MASK                      = SECURITY_INTERNET_MASK,
81 
82 	INTERNET_FLAGS_MASK                    = 0xFFFCFE13,
83 	INTERNET_OPTIONS_MASK                  = ~INTERNET_FLAGS_MASK;
84 
85 const INTERNET_NO_CALLBACK = 0;
86 const INTERNET_RFC1123_FORMAT = 0;
87 const size_t INTERNET_RFC1123_BUFSIZE = 30;
88 
89 const DWORD
90 	ICU_ESCAPE             = 0x80000000,
91 	ICU_USERNAME           = 0x40000000,
92 	ICU_NO_ENCODE          = 0x20000000,
93 	ICU_DECODE             = 0x10000000,
94 	ICU_NO_META            = 0x08000000,
95 	ICU_ENCODE_SPACES_ONLY = 0x04000000,
96 	ICU_BROWSER_MODE       = 0x02000000;
97 
98 enum {
99 	INTERNET_OPEN_TYPE_PRECONFIG = 0,
100 	INTERNET_OPEN_TYPE_DIRECT    = 1,
101 	INTERNET_OPEN_TYPE_PROXY     = 3,
102 	PRE_CONFIG_INTERNET_ACCESS   = INTERNET_OPEN_TYPE_PRECONFIG,
103 	LOCAL_INTERNET_ACCESS        = INTERNET_OPEN_TYPE_DIRECT,
104 	GATEWAY_INTERNET_ACCESS      = 2,
105 	CERN_PROXY_INTERNET_ACCESS   = INTERNET_OPEN_TYPE_PROXY,
106 }
107 
108 const ISO_GLOBAL      = 1;
109 const ISO_REGISTRY    = 2;
110 const ISO_VALID_FLAGS = ISO_GLOBAL | ISO_REGISTRY;
111 
112 enum {
113 	INTERNET_OPTION_CALLBACK                    =  1,
114 	INTERNET_OPTION_CONNECT_TIMEOUT,
115 	INTERNET_OPTION_CONNECT_RETRIES,
116 	INTERNET_OPTION_CONNECT_BACKOFF,
117 	INTERNET_OPTION_SEND_TIMEOUT,
118 	INTERNET_OPTION_CONTROL_SEND_TIMEOUT        = INTERNET_OPTION_SEND_TIMEOUT,
119 	INTERNET_OPTION_RECEIVE_TIMEOUT,
120 	INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT  = INTERNET_OPTION_RECEIVE_TIMEOUT,
121 	INTERNET_OPTION_DATA_SEND_TIMEOUT,
122 	INTERNET_OPTION_DATA_RECEIVE_TIMEOUT,
123 	INTERNET_OPTION_HANDLE_TYPE,
124 	INTERNET_OPTION_CONTEXT_VALUE,
125 	INTERNET_OPTION_LISTEN_TIMEOUT,
126 	INTERNET_OPTION_READ_BUFFER_SIZE,
127 	INTERNET_OPTION_WRITE_BUFFER_SIZE,       // = 13
128 	INTERNET_OPTION_ASYNC_ID                    = 15,
129 	INTERNET_OPTION_ASYNC_PRIORITY,          // = 16
130 	INTERNET_OPTION_PARENT_HANDLE               = 21,
131 	INTERNET_OPTION_KEEP_CONNECTION,
132 	INTERNET_OPTION_REQUEST_FLAGS,
133 	INTERNET_OPTION_EXTENDED_ERROR,          // = 24
134 	INTERNET_OPTION_OFFLINE_MODE                = 26,
135 	INTERNET_OPTION_CACHE_STREAM_HANDLE,
136 	INTERNET_OPTION_USERNAME,
137 	INTERNET_OPTION_PASSWORD,
138 	INTERNET_OPTION_ASYNC,
139 	INTERNET_OPTION_SECURITY_FLAGS,
140 	INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT,
141 	INTERNET_OPTION_DATAFILE_NAME,
142 	INTERNET_OPTION_URL,
143 	INTERNET_OPTION_SECURITY_CERTIFICATE,
144 	INTERNET_OPTION_SECURITY_KEY_BITNESS,
145 	INTERNET_OPTION_REFRESH,
146 	INTERNET_OPTION_PROXY,
147 	INTERNET_OPTION_SETTINGS_CHANGED,
148 	INTERNET_OPTION_VERSION,
149 	INTERNET_OPTION_USER_AGENT,
150 	INTERNET_OPTION_END_BROWSER_SESSION,
151 	INTERNET_OPTION_PROXY_USERNAME,
152 	INTERNET_OPTION_PROXY_PASSWORD,          // = 44
153 	INTERNET_FIRST_OPTION                       = INTERNET_OPTION_CALLBACK,
154 	// why?
155 	INTERNET_LAST_OPTION                        = INTERNET_OPTION_USER_AGENT
156 }
157 
158 const INTERNET_PRIORITY_FOREGROUND = 1000;
159 
160 enum {
161 	INTERNET_HANDLE_TYPE_INTERNET = 1,
162 	INTERNET_HANDLE_TYPE_CONNECT_FTP,
163 	INTERNET_HANDLE_TYPE_CONNECT_GOPHER,
164 	INTERNET_HANDLE_TYPE_CONNECT_HTTP,
165 	INTERNET_HANDLE_TYPE_FTP_FIND,
166 	INTERNET_HANDLE_TYPE_FTP_FIND_HTML,
167 	INTERNET_HANDLE_TYPE_FTP_FILE,
168 	INTERNET_HANDLE_TYPE_FTP_FILE_HTML,
169 	INTERNET_HANDLE_TYPE_GOPHER_FIND,
170 	INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML,
171 	INTERNET_HANDLE_TYPE_GOPHER_FILE,
172 	INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML,
173 	INTERNET_HANDLE_TYPE_HTTP_REQUEST
174 }
175 
176 const DWORD
177 	SECURITY_FLAG_SECURE                   = 0x00000001,
178 	SECURITY_FLAG_SSL                      = 0x00000002,
179 	SECURITY_FLAG_SSL3                     = 0x00000004,
180 	SECURITY_FLAG_PCT                      = 0x00000008,
181 	SECURITY_FLAG_PCT4                     = 0x00000010,
182 	SECURITY_FLAG_IETFSSL4                 = 0x00000020,
183 	SECURITY_FLAG_IGNORE_REVOCATION        = 0x00000080,
184 	SECURITY_FLAG_IGNORE_UNKNOWN_CA        = 0x00000100,
185 	SECURITY_FLAG_IGNORE_WRONG_USAGE       = 0x00000200,
186 	SECURITY_FLAG_40BIT                    = 0x10000000,
187 	SECURITY_FLAG_128BIT                   = 0x20000000,
188 	SECURITY_FLAG_56BIT                    = 0x40000000,
189 	SECURITY_FLAG_UNKNOWNBIT               = 0x80000000,
190 	SECURITY_FLAG_NORMALBITNESS            = SECURITY_FLAG_40BIT,
191 	SECURITY_FLAG_IGNORE_CERT_CN_INVALID   = INTERNET_FLAG_IGNORE_CERT_CN_INVALID,
192 	SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = INTERNET_FLAG_IGNORE_CERT_DATE_INVALID,
193 	SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS,
194 	SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP  = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
195 
196 enum {
197 	INTERNET_SERVICE_FTP = 1,
198 	INTERNET_SERVICE_GOPHER,
199 	INTERNET_SERVICE_HTTP
200 }
201 
202 enum {
203 	INTERNET_STATUS_RESOLVING_NAME        =  10,
204 	INTERNET_STATUS_NAME_RESOLVED         =  11,
205 	INTERNET_STATUS_CONNECTING_TO_SERVER  =  20,
206 	INTERNET_STATUS_CONNECTED_TO_SERVER   =  21,
207 	INTERNET_STATUS_SENDING_REQUEST       =  30,
208 	INTERNET_STATUS_REQUEST_SENT          =  31,
209 	INTERNET_STATUS_RECEIVING_RESPONSE    =  40,
210 	INTERNET_STATUS_RESPONSE_RECEIVED     =  41,
211 	INTERNET_STATUS_CTL_RESPONSE_RECEIVED =  42,
212 	INTERNET_STATUS_PREFETCH              =  43,
213 	INTERNET_STATUS_CLOSING_CONNECTION    =  50,
214 	INTERNET_STATUS_CONNECTION_CLOSED     =  51,
215 	INTERNET_STATUS_HANDLE_CREATED        =  60,
216 	INTERNET_STATUS_HANDLE_CLOSING        =  70,
217 	INTERNET_STATUS_REQUEST_COMPLETE      = 100,
218 	INTERNET_STATUS_REDIRECT              = 110
219 }
220 
221 enum {
222 	FTP_TRANSFER_TYPE_UNKNOWN = 0,
223 	FTP_TRANSFER_TYPE_ASCII   = 1,
224 	FTP_TRANSFER_TYPE_BINARY  = 2,
225 	FTP_TRANSFER_TYPE_MASK    = 3
226 }
227 
228 const size_t
229 	MAX_GOPHER_DISPLAY_TEXT   = 128,
230 	MAX_GOPHER_SELECTOR_TEXT  = 256,
231 	MAX_GOPHER_HOST_NAME      = INTERNET_MAX_HOST_NAME_LENGTH,
232 	MAX_GOPHER_LOCATOR_LENGTH
233 	  = 1 + MAX_GOPHER_DISPLAY_TEXT + 1 + MAX_GOPHER_SELECTOR_TEXT + 1
234 	    + MAX_GOPHER_HOST_NAME + 1 + INTERNET_MAX_PORT_NUMBER_LENGTH + 4;
235 
236 const DWORD
237 	GOPHER_TYPE_TEXT_FILE      = 0x00000001,
238 	GOPHER_TYPE_DIRECTORY      = 0x00000002,
239 	GOPHER_TYPE_CSO            = 0x00000004,
240 	GOPHER_TYPE_ERROR          = 0x00000008,
241 	GOPHER_TYPE_MAC_BINHEX     = 0x00000010,
242 	GOPHER_TYPE_DOS_ARCHIVE    = 0x00000020,
243 	GOPHER_TYPE_UNIX_UUENCODED = 0x00000040,
244 	GOPHER_TYPE_INDEX_SERVER   = 0x00000080,
245 	GOPHER_TYPE_TELNET         = 0x00000100,
246 	GOPHER_TYPE_BINARY         = 0x00000200,
247 	GOPHER_TYPE_REDUNDANT      = 0x00000400,
248 	GOPHER_TYPE_TN3270         = 0x00000800,
249 	GOPHER_TYPE_GIF            = 0x00001000,
250 	GOPHER_TYPE_IMAGE          = 0x00002000,
251 	GOPHER_TYPE_BITMAP         = 0x00004000,
252 	GOPHER_TYPE_MOVIE          = 0x00008000,
253 	GOPHER_TYPE_SOUND          = 0x00010000,
254 	GOPHER_TYPE_HTML           = 0x00020000,
255 	GOPHER_TYPE_PDF            = 0x00040000,
256 	GOPHER_TYPE_CALENDAR       = 0x00080000,
257 	GOPHER_TYPE_INLINE         = 0x00100000,
258 	GOPHER_TYPE_UNKNOWN        = 0x20000000,
259 	GOPHER_TYPE_ASK            = 0x40000000,
260 	GOPHER_TYPE_GOPHER_PLUS    = 0x80000000,
261 	GOPHER_TYPE_FILE_MASK      = 0x001FF271;
262 
263 BOOL IS_GOPHER_FILE(DWORD t) {
264 	return !!(t & GOPHER_TYPE_FILE_MASK);
265 }
266 
267 BOOL IS_GOPHER_DIRECTORY(DWORD t) {
268 	return !!(t & GOPHER_TYPE_DIRECTORY);
269 }
270 
271 BOOL IS_GOPHER_PHONE_SERVER(DWORD t) {
272 	return !!(t & GOPHER_TYPE_CSO);
273 }
274 
275 BOOL IS_GOPHER_ERROR(DWORD t) {
276 	return !!(t & GOPHER_TYPE_ERROR);
277 }
278 
279 BOOL IS_GOPHER_INDEX_SERVER(DWORD t) {
280 	return !!(t & GOPHER_TYPE_INDEX_SERVER);
281 }
282 
283 BOOL IS_GOPHER_TELNET_SESSION(DWORD t) {
284 	return !!(t & GOPHER_TYPE_TELNET);
285 }
286 
287 BOOL IS_GOPHER_BACKUP_SERVER(DWORD t) {
288 	return !!(t & GOPHER_TYPE_REDUNDANT);
289 }
290 
291 BOOL IS_GOPHER_TN3270_SESSION(DWORD t) {
292 	return !!(t & GOPHER_TYPE_TN3270);
293 }
294 
295 BOOL IS_GOPHER_ASK(DWORD t) {
296 	return !!(t & GOPHER_TYPE_ASK);
297 }
298 
299 BOOL IS_GOPHER_PLUS(DWORD t) {
300 	return !!(t & GOPHER_TYPE_GOPHER_PLUS);
301 }
302 
303 BOOL IS_GOPHER_TYPE_KNOWN(DWORD t) {
304 	return !(t & GOPHER_TYPE_UNKNOWN);
305 }
306 
307 const size_t
308 	MAX_GOPHER_CATEGORY_NAME    = 128,
309 	MAX_GOPHER_ATTRIBUTE_NAME   = 128,
310 	MIN_GOPHER_ATTRIBUTE_LENGTH = 256;
311 
312 const TCHAR[]
313 	GOPHER_INFO_CATEGORY      = "+INFO",
314 	GOPHER_ADMIN_CATEGORY     = "+ADMIN",
315 	GOPHER_VIEWS_CATEGORY     = "+VIEWS",
316 	GOPHER_ABSTRACT_CATEGORY  = "+ABSTRACT",
317 	GOPHER_VERONICA_CATEGORY  = "+VERONICA",
318 	GOPHER_ADMIN_ATTRIBUTE    = "Admin",
319 	GOPHER_MOD_DATE_ATTRIBUTE = "Mod-Date",
320 	GOPHER_TTL_ATTRIBUTE      = "TTL",
321 	GOPHER_SCORE_ATTRIBUTE    = "Score",
322 	GOPHER_RANGE_ATTRIBUTE    = "Score-range",
323 	GOPHER_SITE_ATTRIBUTE     = "Site",
324 	GOPHER_ORG_ATTRIBUTE      = "Org",
325 	GOPHER_LOCATION_ATTRIBUTE = "Loc",
326 	GOPHER_GEOG_ATTRIBUTE     = "Geog",
327 	GOPHER_TIMEZONE_ATTRIBUTE = "TZ",
328 	GOPHER_PROVIDER_ATTRIBUTE = "Provider",
329 	GOPHER_VERSION_ATTRIBUTE  = "Version",
330 	GOPHER_ABSTRACT_ATTRIBUTE = "Abstract",
331 	GOPHER_VIEW_ATTRIBUTE     = "View",
332 	GOPHER_TREEWALK_ATTRIBUTE = "treewalk";
333 
334 enum : DWORD {
335 	GOPHER_ATTRIBUTE_ID_BASE = 0xABCCCC00,
336 	GOPHER_CATEGORY_ID_ALL,
337 	GOPHER_CATEGORY_ID_INFO,
338 	GOPHER_CATEGORY_ID_ADMIN,
339 	GOPHER_CATEGORY_ID_VIEWS,
340 	GOPHER_CATEGORY_ID_ABSTRACT,
341 	GOPHER_CATEGORY_ID_VERONICA,
342 	GOPHER_CATEGORY_ID_ASK,
343 	GOPHER_CATEGORY_ID_UNKNOWN,
344 	GOPHER_ATTRIBUTE_ID_ALL,
345 	GOPHER_ATTRIBUTE_ID_ADMIN,
346 	GOPHER_ATTRIBUTE_ID_MOD_DATE,
347 	GOPHER_ATTRIBUTE_ID_TTL,
348 	GOPHER_ATTRIBUTE_ID_SCORE,
349 	GOPHER_ATTRIBUTE_ID_RANGE,
350 	GOPHER_ATTRIBUTE_ID_SITE,
351 	GOPHER_ATTRIBUTE_ID_ORG,
352 	GOPHER_ATTRIBUTE_ID_LOCATION,
353 	GOPHER_ATTRIBUTE_ID_GEOG,
354 	GOPHER_ATTRIBUTE_ID_TIMEZONE,
355 	GOPHER_ATTRIBUTE_ID_PROVIDER,
356 	GOPHER_ATTRIBUTE_ID_VERSION,
357 	GOPHER_ATTRIBUTE_ID_ABSTRACT,
358 	GOPHER_ATTRIBUTE_ID_VIEW,
359 	GOPHER_ATTRIBUTE_ID_TREEWALK,
360 	GOPHER_ATTRIBUTE_ID_UNKNOWN
361 }
362 
363 const HTTP_MAJOR_VERSION   = 1;
364 const HTTP_MINOR_VERSION   = 0;
365 const TCHAR[] HTTP_VERSION = "HTTP/1.0";
366 
367 enum : DWORD {
368 	HTTP_QUERY_MIME_VERSION,
369 	HTTP_QUERY_CONTENT_TYPE,
370 	HTTP_QUERY_CONTENT_TRANSFER_ENCODING,
371 	HTTP_QUERY_CONTENT_ID,
372 	HTTP_QUERY_CONTENT_DESCRIPTION,
373 	HTTP_QUERY_CONTENT_LENGTH,
374 	HTTP_QUERY_CONTENT_LANGUAGE,
375 	HTTP_QUERY_ALLOW,
376 	HTTP_QUERY_PUBLIC,
377 	HTTP_QUERY_DATE,
378 	HTTP_QUERY_EXPIRES,
379 	HTTP_QUERY_LAST_MODIFIED,
380 	HTTP_QUERY_MESSAGE_ID,
381 	HTTP_QUERY_URI,
382 	HTTP_QUERY_DERIVED_FROM,
383 	HTTP_QUERY_COST,
384 	HTTP_QUERY_LINK,
385 	HTTP_QUERY_PRAGMA,
386 	HTTP_QUERY_VERSION,
387 	HTTP_QUERY_STATUS_CODE,
388 	HTTP_QUERY_STATUS_TEXT,
389 	HTTP_QUERY_RAW_HEADERS,
390 	HTTP_QUERY_RAW_HEADERS_CRLF,
391 	HTTP_QUERY_CONNECTION,
392 	HTTP_QUERY_ACCEPT,
393 	HTTP_QUERY_ACCEPT_CHARSET,
394 	HTTP_QUERY_ACCEPT_ENCODING,
395 	HTTP_QUERY_ACCEPT_LANGUAGE,
396 	HTTP_QUERY_AUTHORIZATION,
397 	HTTP_QUERY_CONTENT_ENCODING,
398 	HTTP_QUERY_FORWARDED,
399 	HTTP_QUERY_FROM,
400 	HTTP_QUERY_IF_MODIFIED_SINCE,
401 	HTTP_QUERY_LOCATION,
402 	HTTP_QUERY_ORIG_URI,
403 	HTTP_QUERY_REFERER,
404 	HTTP_QUERY_RETRY_AFTER,
405 	HTTP_QUERY_SERVER,
406 	HTTP_QUERY_TITLE,
407 	HTTP_QUERY_USER_AGENT,
408 	HTTP_QUERY_WWW_AUTHENTICATE,
409 	HTTP_QUERY_PROXY_AUTHENTICATE,
410 	HTTP_QUERY_ACCEPT_RANGES,
411 	HTTP_QUERY_SET_COOKIE,
412 	HTTP_QUERY_COOKIE,
413 	HTTP_QUERY_REQUEST_METHOD,
414 	HTTP_QUERY_MAX    = 45,
415 	HTTP_QUERY_CUSTOM = 65535
416 }
417 
418 const DWORD
419 	HTTP_QUERY_FLAG_REQUEST_HEADERS = 0x80000000,
420 	HTTP_QUERY_FLAG_SYSTEMTIME      = 0x40000000,
421 	HTTP_QUERY_FLAG_NUMBER          = 0x20000000,
422 	HTTP_QUERY_FLAG_COALESCE        = 0x10000000,
423 	HTTP_QUERY_MODIFIER_FLAGS_MASK  = 0xF0000000,
424 	HTTP_QUERY_HEADER_MASK          = ~HTTP_QUERY_MODIFIER_FLAGS_MASK;
425 
426 enum {
427 	HTTP_STATUS_OK                 = 200,
428 	HTTP_STATUS_CREATED,
429 	HTTP_STATUS_ACCEPTED,
430 	HTTP_STATUS_PARTIAL,
431 	HTTP_STATUS_NO_CONTENT,     // = 204
432 	HTTP_STATUS_AMBIGUOUS          = 300,
433 	HTTP_STATUS_MOVED,
434 	HTTP_STATUS_REDIRECT,
435 	HTTP_STATUS_REDIRECT_METHOD,
436 	HTTP_STATUS_NOT_MODIFIED,   // = 304
437 	HTTP_STATUS_BAD_REQUEST        = 400,
438 	HTTP_STATUS_DENIED,
439 	HTTP_STATUS_PAYMENT_REQ,
440 	HTTP_STATUS_FORBIDDEN,
441 	HTTP_STATUS_NOT_FOUND,
442 	HTTP_STATUS_BAD_METHOD,
443 	HTTP_STATUS_NONE_ACCEPTABLE,
444 	HTTP_STATUS_PROXY_AUTH_REQ,
445 	HTTP_STATUS_REQUEST_TIMEOUT,
446 	HTTP_STATUS_CONFLICT,
447 	HTTP_STATUS_GONE,
448 	HTTP_STATUS_AUTH_REFUSED,   // = 411
449 	HTTP_STATUS_SERVER_ERROR       = 500,
450 	HTTP_STATUS_NOT_SUPPORTED,
451 	HTTP_STATUS_BAD_GATEWAY,
452 	HTTP_STATUS_SERVICE_UNAVAIL,
453 	HTTP_STATUS_GATEWAY_TIMEOUT // = 504
454 }
455 
456 enum {
457 	INTERNET_PREFETCH_PROGRESS,
458 	INTERNET_PREFETCH_COMPLETE,
459 	INTERNET_PREFETCH_ABORTED
460 }
461 
462 const FLAGS_ERROR_UI_FILTER_FOR_ERRORS    = 0x01;
463 const FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS = 0x02;
464 const FLAGS_ERROR_UI_FLAGS_GENERATE_DATA  = 0x04;
465 const FLAGS_ERROR_UI_FLAGS_NO_UI          = 0x08;
466 
467 const DWORD
468 	HTTP_ADDREQ_INDEX_MASK                   = 0x0000FFFF,
469 	HTTP_ADDREQ_FLAGS_MASK                   = 0xFFFF0000,
470 	HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON = 0x01000000,
471 	HTTP_ADDREQ_FLAG_ADD_IF_NEW              = 0x10000000,
472 	HTTP_ADDREQ_FLAG_ADD                     = 0x20000000,
473 	HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA     = 0x40000000,
474 	HTTP_ADDREQ_FLAG_COALESCE          = HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA,
475 	HTTP_ADDREQ_FLAG_REPLACE                 = 0x80000000;
476 
477 enum {
478 	INTERNET_ERROR_BASE                       = 12000,
479 	ERROR_INTERNET_OUT_OF_HANDLES,
480 	ERROR_INTERNET_TIMEOUT,
481 	ERROR_INTERNET_EXTENDED_ERROR,
482 	ERROR_INTERNET_INTERNAL_ERROR,
483 	ERROR_INTERNET_INVALID_URL,
484 	ERROR_INTERNET_UNRECOGNIZED_SCHEME,
485 	ERROR_INTERNET_NAME_NOT_RESOLVED,
486 	ERROR_INTERNET_PROTOCOL_NOT_FOUND,
487 	ERROR_INTERNET_INVALID_OPTION,
488 	ERROR_INTERNET_BAD_OPTION_LENGTH,
489 	ERROR_INTERNET_OPTION_NOT_SETTABLE,
490 	ERROR_INTERNET_SHUTDOWN,
491 	ERROR_INTERNET_INCORRECT_USER_NAME,
492 	ERROR_INTERNET_INCORRECT_PASSWORD,
493 	ERROR_INTERNET_LOGIN_FAILURE,
494 	ERROR_INTERNET_INVALID_OPERATION,
495 	ERROR_INTERNET_OPERATION_CANCELLED,
496 	ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
497 	ERROR_INTERNET_INCORRECT_HANDLE_STATE,
498 	ERROR_INTERNET_NOT_PROXY_REQUEST,
499 	ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND,
500 	ERROR_INTERNET_BAD_REGISTRY_PARAMETER,
501 	ERROR_INTERNET_NO_DIRECT_ACCESS,
502 	ERROR_INTERNET_NO_CONTEXT,
503 	ERROR_INTERNET_NO_CALLBACK,
504 	ERROR_INTERNET_REQUEST_PENDING,
505 	ERROR_INTERNET_INCORRECT_FORMAT,
506 	ERROR_INTERNET_ITEM_NOT_FOUND,
507 	ERROR_INTERNET_CANNOT_CONNECT,
508 	ERROR_INTERNET_CONNECTION_ABORTED,
509 	ERROR_INTERNET_CONNECTION_RESET,
510 	ERROR_INTERNET_FORCE_RETRY,
511 	ERROR_INTERNET_INVALID_PROXY_REQUEST,
512 	ERROR_INTERNET_NEED_UI,                // = INTERNET_ERROR_BASE +  34
513 	ERROR_INTERNET_HANDLE_EXISTS              = INTERNET_ERROR_BASE +  36,
514 	ERROR_INTERNET_SEC_CERT_DATE_INVALID,
515 	ERROR_INTERNET_SEC_CERT_CN_INVALID,
516 	ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR,
517 	ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR,
518 	ERROR_INTERNET_MIXED_SECURITY,
519 	ERROR_INTERNET_CHG_POST_IS_NON_SECURE,
520 	ERROR_INTERNET_POST_IS_NON_SECURE,
521 	ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED,
522 	ERROR_INTERNET_INVALID_CA,
523 	ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP,
524 	ERROR_INTERNET_ASYNC_THREAD_FAILED,
525 	ERROR_INTERNET_REDIRECT_SCHEME_CHANGE, // = INTERNET_ERROR_BASE +  48
526 
527 	ERROR_FTP_TRANSFER_IN_PROGRESS            = INTERNET_ERROR_BASE + 110,
528 	ERROR_FTP_DROPPED,                     // = INTERNET_ERROR_BASE + 111
529 	ERROR_GOPHER_PROTOCOL_ERROR               = INTERNET_ERROR_BASE + 130,
530 	ERROR_GOPHER_NOT_FILE,
531 	ERROR_GOPHER_DATA_ERROR,
532 	ERROR_GOPHER_END_OF_DATA,
533 	ERROR_GOPHER_INVALID_LOCATOR,
534 	ERROR_GOPHER_INCORRECT_LOCATOR_TYPE,
535 	ERROR_GOPHER_NOT_GOPHER_PLUS,
536 	ERROR_GOPHER_ATTRIBUTE_NOT_FOUND,
537 	ERROR_GOPHER_UNKNOWN_LOCATOR,          // = INTERNET_ERROR_BASE + 138,
538 	ERROR_HTTP_HEADER_NOT_FOUND               = INTERNET_ERROR_BASE + 150,
539 	ERROR_HTTP_DOWNLEVEL_SERVER,
540 	ERROR_HTTP_INVALID_SERVER_RESPONSE,
541 	ERROR_HTTP_INVALID_HEADER,
542 	ERROR_HTTP_INVALID_QUERY_REQUEST,
543 	ERROR_HTTP_HEADER_ALREADY_EXISTS,
544 	ERROR_HTTP_REDIRECT_FAILED,
545 	ERROR_INTERNET_SECURITY_CHANNEL_ERROR,
546 	ERROR_INTERNET_UNABLE_TO_CACHE_FILE,
547 	ERROR_INTERNET_TCPIP_NOT_INSTALLED,
548 	ERROR_HTTP_NOT_REDIRECTED,             // = INTERNET_ERROR_BASE + 160
549 	// why?
550 	INTERNET_ERROR_LAST                  = ERROR_INTERNET_TCPIP_NOT_INSTALLED
551 }
552 
553 
554 const NORMAL_CACHE_ENTRY     = 0x000001;
555 const STABLE_CACHE_ENTRY     = 0x000002;
556 const STICKY_CACHE_ENTRY     = 0x000004;
557 const SPARSE_CACHE_ENTRY     = 0x010000;
558 const OCX_CACHE_ENTRY        = 0x020000;
559 const COOKIE_CACHE_ENTRY     = 0x100000;
560 const URLHISTORY_CACHE_ENTRY = 0x200000;
561 
562 const CACHE_ENTRY_ATTRIBUTE_FC  = 0x0004;
563 const CACHE_ENTRY_HITRATE_FC    = 0x0010;
564 const CACHE_ENTRY_MODTIME_FC    = 0x0040;
565 const CACHE_ENTRY_EXPTIME_FC    = 0x0080;
566 const CACHE_ENTRY_ACCTIME_FC    = 0x0100;
567 const CACHE_ENTRY_SYNCTIME_FC   = 0x0200;
568 const CACHE_ENTRY_HEADERINFO_FC = 0x0400;
569 
570 enum {
571 	WININET_API_FLAG_ASYNC       = 1,
572 	WININET_API_FLAG_SYNC        = 4,
573 	WININET_API_FLAG_USE_CONTEXT = 8
574 }
575 
576 // FIXME: how should these really be grouped?
577 enum {
578 	IRF_ASYNC       = WININET_API_FLAG_ASYNC,
579 	IRF_SYNC        = WININET_API_FLAG_SYNC,
580 	IRF_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT,
581 }
582 const IRF_NO_WAIT = 8;
583 
584 enum {
585 	HSR_ASYNC = WININET_API_FLAG_ASYNC,
586 	HSR_SYNC = WININET_API_FLAG_SYNC,
587 	HSR_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT,
588 }
589 
590 const HSR_INITIATE =  8;
591 const HSR_DOWNLOAD = 16;
592 const HSR_CHUNKED  = 32;
593 
594 const INTERNET_DIAL_UNATTENDED              = 0x8000;
595 const INTERNET_DIALSTATE_DISCONNECTED       = 1;
596 const INTERENT_GOONLINE_REFRESH             = 1;
597 const INTERENT_GOONLINE_MASK                = 1;
598 const INTERNET_AUTODIAL_FORCE_ONLINE        = 1;
599 const INTERNET_AUTODIAL_FORCE_UNATTENDED    = 2;
600 const INTERNET_AUTODIAL_FAILIFSECURITYCHECK = 4;
601 const INTERNET_CONNECTION_MODEM             = 0x01;
602 const INTERNET_CONNECTION_LAN               = 0x02;
603 const INTERNET_CONNECTION_PROXY             = 0x04;
604 const INTERNET_CONNECTION_MODEM_BUSY        = 0x08;
605 const INTERNET_RAS_INSTALLED                = 0x10;
606 const INTERNET_CONNECTION_OFFLINE           = 0x20;
607 const INTERNET_CONNECTION_CONFIGURED        = 0x40;
608 
609 enum {
610 	CACHEGROUP_SEARCH_ALL   = 0,
611 	CACHEGROUP_SEARCH_BYURL = 1
612 }
613 
614 enum {
615 	INTERNET_CACHE_GROUP_ADD    = 0,
616 	INTERNET_CACHE_GROUP_REMOVE = 1
617 }
618 
619 mixin DECLARE_HANDLE!("HINTERNET"); // doesn't work - bug
620 /*struct HINTERNET {
621 	HANDLE h;
622 	alias h this;
623 }*/
624 alias HINTERNET* LPHINTERNET;
625 
626 alias LONGLONG GROUPID;
627 alias WORD INTERNET_PORT;
628 alias WORD* LPINTERNET_PORT;
629 
630 enum INTERNET_SCHEME {
631 	INTERNET_SCHEME_PARTIAL = -2,
632 	INTERNET_SCHEME_UNKNOWN,
633 	INTERNET_SCHEME_DEFAULT,
634 	INTERNET_SCHEME_FTP,
635 	INTERNET_SCHEME_GOPHER,
636 	INTERNET_SCHEME_HTTP,
637 	INTERNET_SCHEME_HTTPS,
638 	INTERNET_SCHEME_FILE,
639 	INTERNET_SCHEME_NEWS,
640 	INTERNET_SCHEME_MAILTO,
641 	INTERNET_SCHEME_SOCKS,
642 	INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
643 	INTERNET_SCHEME_LAST = INTERNET_SCHEME_SOCKS
644 }
645 alias INTERNET_SCHEME* LPINTERNET_SCHEME;
646 
647 struct INTERNET_ASYNC_RESULT {
648 	DWORD dwResult;
649 	DWORD dwError;
650 }
651 alias INTERNET_ASYNC_RESULT* LPINTERNET_ASYNC_RESULT;
652 
653 struct INTERNET_PREFETCH_STATUS {
654 	DWORD dwStatus;
655 	DWORD dwSize;
656 }
657 alias INTERNET_PREFETCH_STATUS* LPINTERNET_PREFETCH_STATUS;
658 
659 struct INTERNET_PROXY_INFO {
660 	DWORD dwAccessType;
661 	LPCTSTR lpszProxy;
662 	LPCTSTR lpszProxyBypass;
663 }
664 alias INTERNET_PROXY_INFO* LPINTERNET_PROXY_INFO;
665 
666 struct INTERNET_VERSION_INFO {
667 	DWORD dwMajorVersion;
668 	DWORD dwMinorVersion;
669 }
670 alias INTERNET_VERSION_INFO* LPINTERNET_VERSION_INFO;
671 
672 struct URL_COMPONENTSA {
673 	DWORD           dwStructSize = URL_COMPONENTSA.sizeof;
674 	LPSTR           lpszScheme;
675 	DWORD           dwSchemeLength;
676 	INTERNET_SCHEME nScheme;
677 	LPSTR           lpszHostName;
678 	DWORD           dwHostNameLength;
679 	INTERNET_PORT   nPort;
680 	LPSTR           lpszUserName;
681 	DWORD           dwUserNameLength;
682 	LPSTR           lpszPassword;
683 	DWORD           dwPasswordLength;
684 	LPSTR           lpszUrlPath;
685 	DWORD           dwUrlPathLength;
686 	LPSTR           lpszExtraInfo;
687 	DWORD           dwExtraInfoLength;
688 }
689 alias URL_COMPONENTSA* LPURL_COMPONENTSA;
690 
691 struct URL_COMPONENTSW {
692 	DWORD  dwStructSize = URL_COMPONENTSW.sizeof;
693 	LPWSTR lpszScheme;
694 	DWORD  dwSchemeLength;
695 	INTERNET_SCHEME nScheme;
696 	LPWSTR lpszHostName;
697 	DWORD  dwHostNameLength;
698 	INTERNET_PORT nPort;
699 	LPWSTR lpszUserName;
700 	DWORD  dwUserNameLength;
701 	LPWSTR lpszPassword;
702 	DWORD  dwPasswordLength;
703 	LPWSTR lpszUrlPath;
704 	DWORD  dwUrlPathLength;
705 	LPWSTR lpszExtraInfo;
706 	DWORD  dwExtraInfoLength;
707 }
708 alias URL_COMPONENTSW* LPURL_COMPONENTSW;
709 
710 struct INTERNET_CERTIFICATE_INFO {
711 	FILETIME ftExpiry;
712 	FILETIME ftStart;
713 	LPTSTR   lpszSubjectInfo;
714 	LPTSTR   lpszIssuerInfo;
715 	LPTSTR   lpszProtocolName;
716 	LPTSTR   lpszSignatureAlgName;
717 	LPTSTR   lpszEncryptionAlgName;
718 	DWORD    dwKeySize;
719 }
720 alias INTERNET_CERTIFICATE_INFO* LPINTERNET_CERTIFICATE_INFO;
721 
722 extern (Windows) alias void function(HINTERNET, DWORD, DWORD, PVOID, DWORD)
723   INTERNET_STATUS_CALLBACK;
724 alias INTERNET_STATUS_CALLBACK* LPINTERNET_STATUS_CALLBACK;
725 
726 const INTERNET_INVALID_STATUS_CALLBACK
727   = cast(INTERNET_STATUS_CALLBACK) -1;
728 
729 struct GOPHER_FIND_DATAA {
730 	CHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString;
731 	DWORD    GopherType;
732 	DWORD    SizeLow;
733 	DWORD    SizeHigh;
734 	FILETIME LastModificationTime;
735 	CHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator;
736 }
737 alias GOPHER_FIND_DATAA* LPGOPHER_FIND_DATAA;
738 
739 struct GOPHER_FIND_DATAW {
740 	WCHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString;
741 	DWORD    GopherType;
742 	DWORD    SizeLow;
743 	DWORD    SizeHigh;
744 	FILETIME LastModificationTime;
745 	WCHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator;
746 }
747 alias GOPHER_FIND_DATAW* LPGOPHER_FIND_DATAW;
748 
749 struct GOPHER_ADMIN_ATTRIBUTE_TYPE {
750 	LPCTSTR Comment;
751 	LPCTSTR EmailAddress;
752 }
753 alias GOPHER_ADMIN_ATTRIBUTE_TYPE* LPGOPHER_ADMIN_ATTRIBUTE_TYPE;
754 
755 struct GOPHER_MOD_DATE_ATTRIBUTE_TYPE {
756 	FILETIME DateAndTime;
757 }
758 alias GOPHER_MOD_DATE_ATTRIBUTE_TYPE* LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE;
759 
760 struct GOPHER_TTL_ATTRIBUTE_TYPE {
761 	DWORD Ttl;
762 }
763 alias GOPHER_TTL_ATTRIBUTE_TYPE* LPGOPHER_TTL_ATTRIBUTE_TYPE;
764 
765 struct GOPHER_SCORE_ATTRIBUTE_TYPE {
766 	INT Score;
767 }
768 alias GOPHER_SCORE_ATTRIBUTE_TYPE* LPGOPHER_SCORE_ATTRIBUTE_TYPE;
769 
770 struct GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE {
771 	INT LowerBound;
772 	INT UpperBound;
773 }
774 alias GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE* LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
775 
776 struct GOPHER_SITE_ATTRIBUTE_TYPE {
777 	LPCTSTR Site;
778 }
779 alias GOPHER_SITE_ATTRIBUTE_TYPE* LPGOPHER_SITE_ATTRIBUTE_TYPE;
780 
781 struct GOPHER_ORGANIZATION_ATTRIBUTE_TYPE {
782 	LPCTSTR Organization;
783 }
784 alias GOPHER_ORGANIZATION_ATTRIBUTE_TYPE* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
785 
786 struct GOPHER_LOCATION_ATTRIBUTE_TYPE {
787 	LPCTSTR Location;
788 }
789 alias GOPHER_LOCATION_ATTRIBUTE_TYPE* LPGOPHER_LOCATION_ATTRIBUTE_TYPE;
790 
791 struct GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE {
792 	INT DegreesNorth;
793 	INT MinutesNorth;
794 	INT SecondsNorth;
795 	INT DegreesEast;
796 	INT MinutesEast;
797 	INT SecondsEast;
798 }
799 alias GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE*
800   LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
801 
802 struct GOPHER_TIMEZONE_ATTRIBUTE_TYPE {
803 	INT Zone;
804 }
805 alias GOPHER_TIMEZONE_ATTRIBUTE_TYPE* LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE;
806 
807 struct GOPHER_PROVIDER_ATTRIBUTE_TYPE {
808 	LPCTSTR Provider;
809 }
810 alias GOPHER_PROVIDER_ATTRIBUTE_TYPE* LPGOPHER_PROVIDER_ATTRIBUTE_TYPE;
811 
812 struct GOPHER_VERSION_ATTRIBUTE_TYPE {
813 	LPCTSTR Version;
814 }
815 alias GOPHER_VERSION_ATTRIBUTE_TYPE* LPGOPHER_VERSION_ATTRIBUTE_TYPE;
816 
817 struct GOPHER_ABSTRACT_ATTRIBUTE_TYPE {
818 	LPCTSTR ShortAbstract;
819 	LPCTSTR AbstractFile;
820 }
821 alias GOPHER_ABSTRACT_ATTRIBUTE_TYPE* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE;
822 
823 struct GOPHER_VIEW_ATTRIBUTE_TYPE {
824 	LPCTSTR ContentType;
825 	LPCTSTR Language;
826 	DWORD   Size;
827 }
828 alias GOPHER_VIEW_ATTRIBUTE_TYPE* LPGOPHER_VIEW_ATTRIBUTE_TYPE;
829 
830 struct GOPHER_VERONICA_ATTRIBUTE_TYPE {
831 	BOOL TreeWalk;
832 }
833 alias GOPHER_VERONICA_ATTRIBUTE_TYPE* LPGOPHER_VERONICA_ATTRIBUTE_TYPE;
834 
835 struct GOPHER_ASK_ATTRIBUTE_TYPE {
836 	LPCTSTR QuestionType;
837 	LPCTSTR QuestionText;
838 }
839 alias GOPHER_ASK_ATTRIBUTE_TYPE* LPGOPHER_ASK_ATTRIBUTE_TYPE;
840 
841 struct GOPHER_UNKNOWN_ATTRIBUTE_TYPE {
842 	LPCTSTR Text;
843 }
844 alias GOPHER_UNKNOWN_ATTRIBUTE_TYPE* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE;
845 
846 struct GOPHER_ATTRIBUTE_TYPE {
847 	DWORD CategoryId;
848 	DWORD AttributeId;
849 	union {
850 		GOPHER_ADMIN_ATTRIBUTE_TYPE                 Admin;
851 		GOPHER_MOD_DATE_ATTRIBUTE_TYPE              ModDate;
852 		GOPHER_TTL_ATTRIBUTE_TYPE                   Ttl;
853 		GOPHER_SCORE_ATTRIBUTE_TYPE                 Score;
854 		GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE           ScoreRange;
855 		GOPHER_SITE_ATTRIBUTE_TYPE                  Site;
856 		GOPHER_ORGANIZATION_ATTRIBUTE_TYPE          Organization;
857 		GOPHER_LOCATION_ATTRIBUTE_TYPE              Location;
858 		GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
859 		GOPHER_TIMEZONE_ATTRIBUTE_TYPE              TimeZone;
860 		GOPHER_PROVIDER_ATTRIBUTE_TYPE              Provider;
861 		GOPHER_VERSION_ATTRIBUTE_TYPE               Version;
862 		GOPHER_ABSTRACT_ATTRIBUTE_TYPE              Abstract;
863 		GOPHER_VIEW_ATTRIBUTE_TYPE                  View;
864 		GOPHER_VERONICA_ATTRIBUTE_TYPE              Veronica;
865 		GOPHER_ASK_ATTRIBUTE_TYPE                   Ask;
866 		GOPHER_UNKNOWN_ATTRIBUTE_TYPE               Unknown;
867 	} /+AttributeType;+/
868 }
869 alias GOPHER_ATTRIBUTE_TYPE* LPGOPHER_ATTRIBUTE_TYPE;
870 
871 alias BOOL function(LPGOPHER_ATTRIBUTE_TYPE, DWORD)
872   GOPHER_ATTRIBUTE_ENUMERATOR;
873 
874 struct INTERNET_CACHE_ENTRY_INFOA {
875 	DWORD    dwStructSize = INTERNET_CACHE_ENTRY_INFOA.sizeof;
876 	LPSTR    lpszSourceUrlName;
877 	LPSTR    lpszLocalFileName;
878 	DWORD    CacheEntryType;
879 	DWORD    dwUseCount;
880 	DWORD    dwHitRate;
881 	DWORD    dwSizeLow;
882 	DWORD    dwSizeHigh;
883 	FILETIME LastModifiedTime;
884 	FILETIME ExpireTime;
885 	FILETIME LastAccessTime;
886 	FILETIME LastSyncTime;
887 	PBYTE    lpHeaderInfo;
888 	DWORD    dwHeaderInfoSize;
889 	LPSTR    lpszFileExtension;
890 	DWORD    dwReserved;
891 }
892 alias INTERNET_CACHE_ENTRY_INFOA* LPINTERNET_CACHE_ENTRY_INFOA;
893 
894 struct INTERNET_CACHE_ENTRY_INFOW {
895 	DWORD    dwStructSize = INTERNET_CACHE_ENTRY_INFOW.sizeof;
896 	LPWSTR   lpszSourceUrlName;
897 	LPWSTR   lpszLocalFileName;
898 	DWORD    CacheEntryType;
899 	DWORD    dwUseCount;
900 	DWORD    dwHitRate;
901 	DWORD    dwSizeLow;
902 	DWORD    dwSizeHigh;
903 	FILETIME LastModifiedTime;
904 	FILETIME ExpireTime;
905 	FILETIME LastAccessTime;
906 	FILETIME LastSyncTime;
907 	PBYTE    lpHeaderInfo;
908 	DWORD    dwHeaderInfoSize;
909 	LPWSTR   lpszFileExtension;
910 	DWORD    dwReserved;
911 }
912 alias INTERNET_CACHE_ENTRY_INFOW* LPINTERNET_CACHE_ENTRY_INFOW;
913 
914 struct INTERNET_BUFFERSA {
915 	DWORD              dwStructSize = INTERNET_BUFFERSA.sizeof;
916 	INTERNET_BUFFERSA* Next;
917 	LPCSTR             lpcszHeader;
918 	DWORD              dwHeadersLength;
919 	DWORD              dwHeadersTotal;
920 	LPVOID             lpvBuffer;
921 	DWORD              dwBufferLength;
922 	DWORD              dwBufferTotal;
923 	DWORD              dwOffsetLow;
924 	DWORD              dwOffsetHigh;
925 }
926 alias INTERNET_BUFFERSA* LPINTERNET_BUFFERSA;
927 
928 struct INTERNET_BUFFERSW {
929 	DWORD              dwStructSize = INTERNET_BUFFERSW.sizeof;
930 	INTERNET_BUFFERSW* Next;
931 	LPCWSTR            lpcszHeader;
932 	DWORD              dwHeadersLength;
933 	DWORD              dwHeadersTotal;
934 	LPVOID             lpvBuffer;
935 	DWORD              dwBufferLength;
936 	DWORD              dwBufferTotal;
937 	DWORD              dwOffsetLow;
938 	DWORD              dwOffsetHigh;
939 }
940 alias INTERNET_BUFFERSW* LPINTERNET_BUFFERSW;
941 
942 const size_t
943 	GROUP_OWNER_STORAGE_SIZE =   4,
944 	GROUPNAME_MAX_LENGTH     = 120;
945 
946 struct INTERNET_CACHE_GROUP_INFOA {
947 	DWORD dwGroupSize;
948 	DWORD dwGroupFlags;
949 	DWORD dwGroupType;
950 	DWORD dwDiskUsage;
951 	DWORD dwDiskQuota;
952 	DWORD[GROUP_OWNER_STORAGE_SIZE] dwOwnerStorage;
953 	CHAR[GROUPNAME_MAX_LENGTH]      szGroupName;
954 }
955 alias INTERNET_CACHE_GROUP_INFOA* LPINTERNET_CACHE_GROUP_INFOA;
956 
957 struct INTERNET_CACHE_GROUP_INFOW {
958 	DWORD dwGroupSize;
959 	DWORD dwGroupFlags;
960 	DWORD dwGroupType;
961 	DWORD dwDiskUsage;
962 	DWORD dwDiskQuota;
963 	DWORD[GROUP_OWNER_STORAGE_SIZE] dwOwnerStorage;
964 	WCHAR[GROUPNAME_MAX_LENGTH]     szGroupName;
965 }
966 alias INTERNET_CACHE_GROUP_INFOW* LPINTERNET_CACHE_GROUP_INFOW;
967 
968 extern (Windows) {
969 	BOOL InternetTimeFromSystemTime(SYSTEMTIME*, DWORD, LPSTR, DWORD);
970 	BOOL InternetTimeToSystemTime(LPCSTR, SYSTEMTIME*, DWORD);
971 	BOOL InternetDebugGetLocalTime(SYSTEMTIME*, PDWORD);
972 	BOOL InternetCrackUrlA(LPCSTR, DWORD, DWORD, LPURL_COMPONENTSA);
973 	BOOL InternetCrackUrlW(LPCWSTR, DWORD, DWORD, LPURL_COMPONENTSW);
974 	BOOL InternetCreateUrlA(LPURL_COMPONENTSA, DWORD, LPSTR, PDWORD);
975 	BOOL InternetCreateUrlW(LPURL_COMPONENTSW, DWORD, LPWSTR, PDWORD);
976 	BOOL InternetCanonicalizeUrlA(LPCSTR, LPSTR, PDWORD, DWORD);
977 	BOOL InternetCanonicalizeUrlW(LPCWSTR, LPWSTR, PDWORD, DWORD);
978 	BOOL InternetCheckConnectionA(LPCSTR, DWORD, DWORD);
979 	BOOL InternetCheckConnectionW(LPCWSTR, DWORD, DWORD);
980 	BOOL InternetCombineUrlA(LPCSTR, LPCSTR, LPSTR, PDWORD, DWORD);
981 	BOOL InternetCombineUrlW(LPCWSTR, LPCWSTR, LPWSTR, PDWORD, DWORD);
982 	HINTERNET InternetOpenA(LPCSTR, DWORD, LPCSTR, LPCSTR, DWORD);
983 	HINTERNET InternetOpenW(LPCWSTR, DWORD, LPCWSTR, LPCWSTR, DWORD);
984 	BOOL InternetCloseHandle(HINTERNET);
985 	HINTERNET InternetConnectA(HINTERNET, LPCSTR, INTERNET_PORT, LPCSTR,
986 	  LPCSTR, DWORD, DWORD, DWORD);
987 	HINTERNET InternetConnectW(HINTERNET, LPCWSTR, INTERNET_PORT, LPCWSTR,
988 	  LPCWSTR, DWORD, DWORD, DWORD);
989 	HINTERNET InternetOpenUrlA(HINTERNET, LPCSTR, LPCSTR, DWORD, DWORD,
990 	  DWORD);
991 	HINTERNET InternetOpenUrlW(HINTERNET, LPCWSTR, LPCWSTR, DWORD, DWORD,
992 	  DWORD);
993 	BOOL InternetReadFile(HINTERNET, PVOID, DWORD, PDWORD);
994 	DWORD InternetSetFilePointer(HINTERNET, LONG, PVOID, DWORD, DWORD);
995 	BOOL InternetWriteFile(HINTERNET, LPCVOID, DWORD, PDWORD);
996 	BOOL InternetQueryDataAvailable(HINTERNET, PDWORD, DWORD, DWORD);
997 	BOOL InternetFindNextFileA(HINTERNET, PVOID);
998 	BOOL InternetFindNextFileW(HINTERNET, PVOID);
999 	BOOL InternetQueryOptionA(HINTERNET, DWORD, PVOID, PDWORD);
1000 	BOOL InternetQueryOptionW(HINTERNET, DWORD, PVOID, PDWORD);
1001 	BOOL InternetSetOptionA(HINTERNET, DWORD, PVOID, DWORD);
1002 	BOOL InternetSetOptionW(HINTERNET, DWORD, PVOID, DWORD);
1003 	BOOL InternetSetOptionExA(HINTERNET, DWORD, PVOID, DWORD, DWORD);
1004 	BOOL InternetSetOptionExW(HINTERNET, DWORD, PVOID, DWORD, DWORD);
1005 	BOOL InternetGetLastResponseInfoA(PDWORD, LPSTR, PDWORD);
1006 	BOOL InternetGetLastResponseInfoW(PDWORD, LPWSTR, PDWORD);
1007 	INTERNET_STATUS_CALLBACK InternetSetStatusCallback(HINTERNET,
1008 	  INTERNET_STATUS_CALLBACK);
1009 	DWORD FtpGetFileSize(HINTERNET, LPDWORD);
1010 	HINTERNET FtpFindFirstFileA(HINTERNET, LPCSTR, LPWIN32_FIND_DATA, DWORD,
1011 	  DWORD);
1012 	HINTERNET FtpFindFirstFileW(HINTERNET, LPCWSTR, LPWIN32_FIND_DATA, DWORD,
1013 	  DWORD);
1014 	BOOL FtpGetFileA(HINTERNET, LPCSTR, LPCSTR, BOOL, DWORD, DWORD, DWORD);
1015 	BOOL FtpGetFileW(HINTERNET, LPCWSTR, LPCWSTR, BOOL, DWORD, DWORD, DWORD);
1016 	BOOL FtpPutFileA(HINTERNET, LPCSTR, LPCSTR, DWORD, DWORD);
1017 	BOOL FtpPutFileW(HINTERNET, LPCWSTR, LPCWSTR, DWORD, DWORD);
1018 	BOOL FtpDeleteFileA(HINTERNET, LPCSTR);
1019 	BOOL FtpDeleteFileW(HINTERNET, LPCWSTR);
1020 	BOOL FtpRenameFileA(HINTERNET, LPCSTR, LPCSTR);
1021 	BOOL FtpRenameFileW(HINTERNET, LPCWSTR, LPCWSTR);
1022 	HINTERNET FtpOpenFileA(HINTERNET, LPCSTR, DWORD, DWORD, DWORD);
1023 	HINTERNET FtpOpenFileW(HINTERNET, LPCWSTR, DWORD, DWORD, DWORD);
1024 	BOOL FtpCreateDirectoryA(HINTERNET, LPCSTR);
1025 	BOOL FtpCreateDirectoryW(HINTERNET, LPCWSTR);
1026 	BOOL FtpRemoveDirectoryA(HINTERNET, LPCSTR);
1027 	BOOL FtpRemoveDirectoryW(HINTERNET, LPCWSTR);
1028 	BOOL FtpSetCurrentDirectoryA(HINTERNET, LPCSTR);
1029 	BOOL FtpSetCurrentDirectoryW(HINTERNET, LPCWSTR);
1030 	BOOL FtpGetCurrentDirectoryA(HINTERNET, LPSTR, PDWORD);
1031 	BOOL FtpGetCurrentDirectoryW(HINTERNET, LPWSTR, PDWORD);
1032 	BOOL FtpCommandA(HINTERNET, BOOL, DWORD, LPCSTR, DWORD_PTR, HINTERNET*);
1033 	BOOL FtpCommandW(HINTERNET, BOOL, DWORD, LPCWSTR, DWORD_PTR, HINTERNET*);
1034 	BOOL GopherCreateLocatorA(LPCSTR, INTERNET_PORT, LPCSTR, LPCSTR, DWORD,
1035 	  LPSTR, PDWORD);
1036 	BOOL GopherCreateLocatorW(LPCWSTR, INTERNET_PORT, LPCWSTR, LPCWSTR, DWORD,
1037 	  LPWSTR, PDWORD);
1038 	BOOL GopherGetLocatorTypeA(LPCSTR, PDWORD);
1039 	BOOL GopherGetLocatorTypeW(LPCWSTR, PDWORD);
1040 	HINTERNET GopherFindFirstFileA(HINTERNET, LPCSTR, LPCSTR,
1041 	  LPGOPHER_FIND_DATAA, DWORD, DWORD);
1042 	HINTERNET GopherFindFirstFileW(HINTERNET, LPCWSTR, LPCWSTR,
1043 	  LPGOPHER_FIND_DATAW, DWORD, DWORD);
1044 	HINTERNET GopherOpenFileA(HINTERNET, LPCSTR, LPCSTR, DWORD, DWORD);
1045 	HINTERNET GopherOpenFileW(HINTERNET, LPCWSTR, LPCWSTR, DWORD, DWORD);
1046 	BOOL GopherGetAttributeA(HINTERNET, LPCSTR, LPCSTR, LPBYTE, DWORD,
1047 	  PDWORD, GOPHER_ATTRIBUTE_ENUMERATOR, DWORD);
1048 	BOOL GopherGetAttributeW(HINTERNET, LPCWSTR, LPCWSTR, LPBYTE, DWORD,
1049 	  PDWORD, GOPHER_ATTRIBUTE_ENUMERATOR, DWORD);
1050 	HINTERNET HttpOpenRequestA(HINTERNET, LPCSTR, LPCSTR, LPCSTR, LPCSTR,
1051 	  LPCSTR*, DWORD, DWORD);
1052 	HINTERNET HttpOpenRequestW(HINTERNET, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR,
1053 	  LPCWSTR*, DWORD, DWORD);
1054 	BOOL HttpAddRequestHeadersA(HINTERNET, LPCSTR, DWORD, DWORD);
1055 	BOOL HttpAddRequestHeadersW(HINTERNET, LPCWSTR, DWORD, DWORD);
1056 	BOOL HttpSendRequestA(HINTERNET, LPCSTR, DWORD, PVOID, DWORD);
1057 	BOOL HttpSendRequestW(HINTERNET, LPCWSTR, DWORD, PVOID, DWORD);
1058 	BOOL HttpQueryInfoA(HINTERNET, DWORD, PVOID, PDWORD, PDWORD);
1059 	BOOL HttpQueryInfoW(HINTERNET, DWORD, PVOID, PDWORD, PDWORD);
1060 	BOOL InternetSetCookieA(LPCSTR, LPCSTR, LPCSTR);
1061 	BOOL InternetSetCookieW(LPCWSTR, LPCWSTR, LPCWSTR);
1062 	BOOL InternetGetCookieA(LPCSTR, LPCSTR, LPSTR, PDWORD);
1063 	BOOL InternetGetCookieW(LPCWSTR, LPCWSTR, LPWSTR, PDWORD);
1064 	DWORD InternetAttemptConnect(DWORD);
1065 	DWORD InternetErrorDlg(HWND, HINTERNET, DWORD, DWORD, PVOID*);
1066 	DWORD InternetConfirmZoneCrossing(HWND, LPSTR, LPSTR, BOOL);
1067 	BOOL CreateUrlCacheEntryA(LPCSTR, DWORD, LPCSTR, LPSTR, DWORD);
1068 	BOOL CreateUrlCacheEntryW(LPCWSTR, DWORD, LPCWSTR, LPWSTR, DWORD);
1069 	BOOL CommitUrlCacheEntryA(LPCSTR, LPCSTR, FILETIME, FILETIME, DWORD,
1070 	  LPBYTE, DWORD, LPCSTR, DWORD);
1071 	BOOL CommitUrlCacheEntryW(LPCWSTR, LPCWSTR, FILETIME, FILETIME, DWORD,
1072 	  LPBYTE, DWORD, LPCWSTR, DWORD);
1073 	BOOL RetrieveUrlCacheEntryFileA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA,
1074 	  PDWORD, DWORD);
1075 	BOOL RetrieveUrlCacheEntryFileW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW,
1076 	  PDWORD, DWORD);
1077 	BOOL UnlockUrlCacheEntryFile(LPCSTR, DWORD);
1078 	HANDLE RetrieveUrlCacheEntryStreamA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA,
1079 	  PDWORD, BOOL, DWORD);
1080 	HANDLE RetrieveUrlCacheEntryStreamW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW,
1081 	  PDWORD, BOOL, DWORD);
1082 	BOOL ReadUrlCacheEntryStream(HANDLE, DWORD, PVOID, PDWORD, DWORD);
1083 	BOOL UnlockUrlCacheEntryStream(HANDLE, DWORD);
1084 	BOOL GetUrlCacheEntryInfoA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA, PDWORD);
1085 	BOOL GetUrlCacheEntryInfoW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW, PDWORD);
1086 	BOOL SetUrlCacheEntryInfoA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA, DWORD);
1087 	BOOL SetUrlCacheEntryInfoW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW, DWORD);
1088 	HANDLE FindFirstUrlCacheEntryA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA,
1089 	  PDWORD);
1090 	HANDLE FindFirstUrlCacheEntryW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW,
1091 	  PDWORD);
1092 	BOOL FindNextUrlCacheEntryA(HANDLE, LPINTERNET_CACHE_ENTRY_INFOA, PDWORD);
1093 	BOOL FindNextUrlCacheEntryW(HANDLE, LPINTERNET_CACHE_ENTRY_INFOW, PDWORD);
1094 	BOOL FindCloseUrlCache(HANDLE);
1095 	BOOL DeleteUrlCacheEntry(LPCSTR);
1096 	DWORD AuthenticateUser(PVOID*, LPSTR, LPSTR, DWORD, LPSTR, DWORD, LPSTR,
1097 	  LPSTR);
1098 	BOOL HttpSendRequestExA(HINTERNET, LPINTERNET_BUFFERSA,
1099 	  LPINTERNET_BUFFERSA, DWORD, DWORD);
1100 	BOOL HttpSendRequestExW(HINTERNET, LPINTERNET_BUFFERSW,
1101 	  LPINTERNET_BUFFERSW, DWORD, DWORD);
1102 	BOOL HttpEndRequestA(HINTERNET, LPINTERNET_BUFFERSA, DWORD, DWORD);
1103 	BOOL HttpEndRequestW(HINTERNET, LPINTERNET_BUFFERSW, DWORD, DWORD);
1104 	DWORD InternetDial(HWND, LPTSTR, DWORD, LPDWORD, DWORD);
1105 	DWORD InternetHangUp(DWORD, DWORD);
1106 	BOOL InternetGoOnline(LPTSTR, HWND, DWORD);
1107 	BOOL InternetAutodial(DWORD, DWORD);
1108 	BOOL InternetAutodialHangup(DWORD);
1109 	BOOL InternetGetConnectedState(LPDWORD, DWORD);
1110 	BOOL InternetSetDialState(LPCTSTR, DWORD, DWORD);
1111 	BOOL InternetReadFileExA(HINTERNET, LPINTERNET_BUFFERSA, DWORD, DWORD_PTR);
1112 	BOOL InternetReadFileExW(HINTERNET, LPINTERNET_BUFFERSW, DWORD, DWORD_PTR);
1113 	GROUPID CreateUrlCacheGroup(DWORD, LPVOID);
1114 	BOOL DeleteUrlCacheGroup(GROUPID, DWORD, LPVOID);
1115 	HANDLE FindFirstUrlCacheGroup(DWORD, DWORD, LPVOID, DWORD, GROUPID*,
1116 	  LPVOID);
1117 	BOOL FindNextUrlCacheGroup(HANDLE, GROUPID*, LPVOID);
1118 	BOOL GetUrlCacheGroupAttributeA(GROUPID, DWORD, DWORD,
1119 	  LPINTERNET_CACHE_GROUP_INFOA, LPDWORD, LPVOID);
1120 	BOOL GetUrlCacheGroupAttributeW(GROUPID, DWORD, DWORD,
1121 	  LPINTERNET_CACHE_GROUP_INFOW, LPDWORD, LPVOID);
1122 	BOOL SetUrlCacheGroupAttributeA(GROUPID, DWORD, DWORD,
1123 	  LPINTERNET_CACHE_GROUP_INFOA, LPVOID);
1124 	BOOL SetUrlCacheGroupAttributeW(GROUPID, DWORD, DWORD,
1125 	  LPINTERNET_CACHE_GROUP_INFOW, LPVOID);
1126 }
1127 
1128 version (Unicode) {
1129 	alias URL_COMPONENTSW URL_COMPONENTS;
1130 	alias LPURL_COMPONENTSW LPURL_COMPONENTS;
1131 	alias GOPHER_FIND_DATAW GOPHER_FIND_DATA;
1132 	alias LPGOPHER_FIND_DATAW LPGOPHER_FIND_DATA;
1133 	alias INTERNET_CACHE_ENTRY_INFOW INTERNET_CACHE_ENTRY_INFO;
1134 	alias LPINTERNET_CACHE_ENTRY_INFOW LPINTERNET_CACHE_ENTRY_INFO;
1135 	alias INTERNET_BUFFERSW INTERNET_BUFFERS;
1136 	alias INTERNET_CACHE_GROUP_INFOW INTERNET_CACHE_GROUP_INFO;
1137 	alias LPINTERNET_CACHE_GROUP_INFOW LPINTERNET_CACHE_GROUP_INFO;
1138 	alias InternetCrackUrlW InternetCrackUrl;
1139 	alias InternetCreateUrlW InternetCreateUrl;
1140 	alias InternetCanonicalizeUrlW InternetCanonicalizeUrl;
1141 	alias InternetCheckConnectionW InternetCheckConnection;
1142 	alias InternetCombineUrlW InternetCombineUrl;
1143 	alias InternetOpenW InternetOpen;
1144 	alias InternetConnectW InternetConnect;
1145 	alias InternetOpenUrlW InternetOpenUrl;
1146 	alias InternetFindNextFileW InternetFindNextFile;
1147 	alias InternetQueryOptionW InternetQueryOption;
1148 	alias InternetSetOptionW InternetSetOption;
1149 	alias InternetSetOptionExW InternetSetOptionEx;
1150 	alias InternetGetLastResponseInfoW InternetGetLastResponseInfo;
1151 	alias InternetReadFileExW InternetReadFileEx;
1152 	alias FtpFindFirstFileW FtpFindFirstFile;
1153 	alias FtpGetFileW FtpGetFile;
1154 	alias FtpPutFileW FtpPutFile;
1155 	alias FtpDeleteFileW FtpDeleteFile;
1156 	alias FtpRenameFileW FtpRenameFile;
1157 	alias FtpOpenFileW FtpOpenFile;
1158 	alias FtpCreateDirectoryW FtpCreateDirectory;
1159 	alias FtpRemoveDirectoryW FtpRemoveDirectory;
1160 	alias FtpSetCurrentDirectoryW FtpSetCurrentDirectory;
1161 	alias FtpGetCurrentDirectoryW FtpGetCurrentDirectory;
1162 	alias FtpCommandW FtpCommand;
1163 	alias GopherGetLocatorTypeW GopherGetLocatorType;
1164 	alias GopherCreateLocatorW GopherCreateLocator;
1165 	alias GopherFindFirstFileW GopherFindFirstFile;
1166 	alias GopherOpenFileW GopherOpenFile;
1167 	alias GopherGetAttributeW GopherGetAttribute;
1168 	alias HttpSendRequestW HttpSendRequest;
1169 	alias HttpOpenRequestW HttpOpenRequest;
1170 	alias HttpAddRequestHeadersW HttpAddRequestHeaders;
1171 	alias HttpQueryInfoW HttpQueryInfo;
1172 	alias InternetSetCookieW InternetSetCookie;
1173 	alias InternetGetCookieW InternetGetCookie;
1174 	alias CreateUrlCacheEntryW CreateUrlCacheEntry;
1175 	alias RetrieveUrlCacheEntryStreamW RetrieveUrlCacheEntryStream;
1176 	alias FindNextUrlCacheEntryW FindNextUrlCacheEntry;
1177 	alias CommitUrlCacheEntryW CommitUrlCacheEntry;
1178 	alias GetUrlCacheEntryInfoW GetUrlCacheEntryInfo;
1179 	alias SetUrlCacheEntryInfoW SetUrlCacheEntryInfo;
1180 	alias FindFirstUrlCacheEntryW FindFirstUrlCacheEntry;
1181 	alias RetrieveUrlCacheEntryFileW RetrieveUrlCacheEntryFile;
1182 	alias HttpSendRequestExW HttpSendRequestEx;
1183 	alias HttpEndRequestW HttpEndRequest;
1184 	alias GetUrlCacheGroupAttributeW GetUrlCacheGroupAttribute;
1185 	alias SetUrlCacheGroupAttributeW SetUrlCacheGroupAttribute;
1186 } else {
1187 	alias URL_COMPONENTSA URL_COMPONENTS;
1188 	alias LPURL_COMPONENTSA LPURL_COMPONENTS;
1189 	alias GOPHER_FIND_DATAA GOPHER_FIND_DATA;
1190 	alias LPGOPHER_FIND_DATAA LPGOPHER_FIND_DATA;
1191 	alias INTERNET_CACHE_ENTRY_INFOA INTERNET_CACHE_ENTRY_INFO;
1192 	alias LPINTERNET_CACHE_ENTRY_INFOA LPINTERNET_CACHE_ENTRY_INFO;
1193 	alias INTERNET_BUFFERSA INTERNET_BUFFERS;
1194 	alias INTERNET_CACHE_GROUP_INFOA INTERNET_CACHE_GROUP_INFO;
1195 	alias LPINTERNET_CACHE_GROUP_INFOA LPINTERNET_CACHE_GROUP_INFO;
1196 	alias GopherGetAttributeA GopherGetAttribute;
1197 	alias InternetCrackUrlA InternetCrackUrl;
1198 	alias InternetCreateUrlA InternetCreateUrl;
1199 	alias InternetCanonicalizeUrlA InternetCanonicalizeUrl;
1200 	alias InternetCheckConnectionA InternetCheckConnection;
1201 	alias InternetCombineUrlA InternetCombineUrl;
1202 	alias InternetOpenA InternetOpen;
1203 	alias InternetConnectA InternetConnect;
1204 	alias InternetOpenUrlA InternetOpenUrl;
1205 	alias InternetFindNextFileA InternetFindNextFile;
1206 	alias InternetQueryOptionA InternetQueryOption;
1207 	alias InternetSetOptionA InternetSetOption;
1208 	alias InternetSetOptionExA InternetSetOptionEx;
1209 	alias InternetGetLastResponseInfoA InternetGetLastResponseInfo;
1210 	alias InternetReadFileExA InternetReadFileEx;
1211 	alias FtpFindFirstFileA FtpFindFirstFile;
1212 	alias FtpGetFileA FtpGetFile;
1213 	alias FtpPutFileA FtpPutFile;
1214 	alias FtpDeleteFileA FtpDeleteFile;
1215 	alias FtpRenameFileA FtpRenameFile;
1216 	alias FtpOpenFileA FtpOpenFile;
1217 	alias FtpCreateDirectoryA FtpCreateDirectory;
1218 	alias FtpRemoveDirectoryA FtpRemoveDirectory;
1219 	alias FtpSetCurrentDirectoryA FtpSetCurrentDirectory;
1220 	alias FtpGetCurrentDirectoryA FtpGetCurrentDirectory;
1221 	alias FtpCommandA FtpCommand;
1222 	alias GopherGetLocatorTypeA GopherGetLocatorType;
1223 	alias GopherCreateLocatorA GopherCreateLocator;
1224 	alias GopherFindFirstFileA GopherFindFirstFile;
1225 	alias GopherOpenFileA GopherOpenFile;
1226 	alias HttpSendRequestA HttpSendRequest;
1227 	alias HttpOpenRequestA HttpOpenRequest;
1228 	alias HttpAddRequestHeadersA HttpAddRequestHeaders;
1229 	alias HttpQueryInfoA HttpQueryInfo;
1230 	alias InternetSetCookieA InternetSetCookie;
1231 	alias InternetGetCookieA InternetGetCookie;
1232 	alias CreateUrlCacheEntryA CreateUrlCacheEntry;
1233 	alias RetrieveUrlCacheEntryStreamA RetrieveUrlCacheEntryStream;
1234 	alias FindNextUrlCacheEntryA FindNextUrlCacheEntry;
1235 	alias CommitUrlCacheEntryA CommitUrlCacheEntry;
1236 	alias GetUrlCacheEntryInfoA GetUrlCacheEntryInfo;
1237 	alias SetUrlCacheEntryInfoA SetUrlCacheEntryInfo;
1238 	alias FindFirstUrlCacheEntryA FindFirstUrlCacheEntry;
1239 	alias RetrieveUrlCacheEntryFileA RetrieveUrlCacheEntryFile;
1240 	alias HttpSendRequestExA HttpSendRequestEx;
1241 	alias HttpEndRequestA HttpEndRequest;
1242 	alias GetUrlCacheGroupAttributeA GetUrlCacheGroupAttribute;
1243 	alias SetUrlCacheGroupAttributeA SetUrlCacheGroupAttribute;
1244 }
1245 
1246 alias INTERNET_BUFFERS* LPINTERNET_BUFFERS;