Overlay icons for .lnk files with a small arrow in the lower left
[wine] / dlls / wininet / tests / http.c
1 #include <stdarg.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4
5 #include "windef.h"
6 #include "winbase.h"
7 #include "wininet.h"
8
9 #include "wine/test.h"
10
11 #define TEST_URL "http://www.winehq.org/site/about"
12 #define TEST_URL_PATH "/site/about"
13 #define TEST_URL2 "http://www.myserver.com/myscript.php?arg=1"
14 #define TEST_URL2_SERVER "www.myserver.com"
15 #define TEST_URL2_PATH "/myscript.php"
16 #define TEST_URL2_PATHEXTRA "/myscript.php?arg=1"
17 #define TEST_URL2_EXTRA "?arg=1"
18
19 int goon = 0;
20
21 VOID WINAPI callback(
22      HINTERNET hInternet,
23      DWORD dwContext,
24      DWORD dwInternetStatus,
25      LPVOID lpvStatusInformation,
26      DWORD dwStatusInformationLength
27 )
28 {
29     char name[124];
30
31     switch (dwInternetStatus)
32     {
33         case INTERNET_STATUS_RESOLVING_NAME:
34             strcpy(name,"INTERNET_STATUS_RESOLVING_NAME");
35             break;
36         case INTERNET_STATUS_NAME_RESOLVED:
37             strcpy(name,"INTERNET_STATUS_NAME_RESOLVED");
38             break;
39         case INTERNET_STATUS_CONNECTING_TO_SERVER:
40             strcpy(name,"INTERNET_STATUS_CONNECTING_TO_SERVER");
41             break;
42         case INTERNET_STATUS_CONNECTED_TO_SERVER:
43             strcpy(name,"INTERNET_STATUS_CONNECTED_TO_SERVER");
44             break;
45         case INTERNET_STATUS_SENDING_REQUEST:
46             strcpy(name,"INTERNET_STATUS_SENDING_REQUEST");
47             break;
48         case INTERNET_STATUS_REQUEST_SENT:
49             strcpy(name,"INTERNET_STATUS_REQUEST_SENT");
50             break;
51         case INTERNET_STATUS_RECEIVING_RESPONSE:
52             strcpy(name,"INTERNET_STATUS_RECEIVING_RESPONSE");
53             break;
54         case INTERNET_STATUS_RESPONSE_RECEIVED:
55             strcpy(name,"INTERNET_STATUS_RESPONSE_RECEIVED");
56             break;
57         case INTERNET_STATUS_CTL_RESPONSE_RECEIVED:
58             strcpy(name,"INTERNET_STATUS_CTL_RESPONSE_RECEIVED");
59             break;
60         case INTERNET_STATUS_PREFETCH:
61             strcpy(name,"INTERNET_STATUS_PREFETCH");
62             break;
63         case INTERNET_STATUS_CLOSING_CONNECTION:
64             strcpy(name,"INTERNET_STATUS_CLOSING_CONNECTION");
65             break;
66         case INTERNET_STATUS_CONNECTION_CLOSED:
67             strcpy(name,"INTERNET_STATUS_CONNECTION_CLOSED");
68             break;
69         case INTERNET_STATUS_HANDLE_CREATED:
70             strcpy(name,"INTERNET_STATUS_HANDLE_CREATED");
71             break;
72         case INTERNET_STATUS_HANDLE_CLOSING:
73             strcpy(name,"INTERNET_STATUS_HANDLE_CLOSING");
74             break;
75         case INTERNET_STATUS_REQUEST_COMPLETE:
76             strcpy(name,"INTERNET_STATUS_REQUEST_COMPLETE");
77             goon = 1;
78             break;
79         case INTERNET_STATUS_REDIRECT:
80             strcpy(name,"INTERNET_STATUS_REDIRECT");
81             break;
82         case INTERNET_STATUS_INTERMEDIATE_RESPONSE:
83             strcpy(name,"INTERNET_STATUS_INTERMEDIATE_RESPONSE");
84             break;
85     }
86
87     trace("Callback %p 0x%lx %s(%li) %p %ld\n",hInternet,dwContext,name,dwInternetStatus,lpvStatusInformation,dwStatusInformationLength);
88 }
89
90 void winapi_test(int flags)
91 {
92     DWORD rc;
93     CHAR buffer[4000];
94     DWORD length;
95     DWORD out;
96     const char *types[2] = { "*", NULL };
97     HINTERNET hi, hic = 0, hor = 0;
98
99     trace("Starting with flags 0x%x\n",flags);
100
101     trace("InternetOpenA <--\n");
102     hi = InternetOpenA("",0x0,0x0,0x0,flags);
103     ok((hi != 0x0),"InternetOpen Failed\n");
104     trace("InternetOpenA -->\n");
105
106     if (hi == 0x0) goto abort;
107
108     InternetSetStatusCallback(hi,&callback);
109
110     trace("InternetConnectA <--\n");
111     hic=InternetConnectA(hi,"www.winehq.org",0x0,0x0,0x0,0x3,0x0,0xdeadbeef);
112     ok((hic != 0x0),"InternetConnect Failed\n");
113     trace("InternetConnectA -->\n");
114
115     if (hic == 0x0) goto abort;
116
117     trace("HttpOpenRequestA <--\n");
118     hor = HttpOpenRequestA(hic, "GET",
119                           "/about/",
120                           0x0,0x0,types,0x00400800,0xdeadbead);
121     if (hor == 0x0 && GetLastError() == 12007 /* ERROR_INTERNET_NAME_NOT_RESOLVED */) {
122         /*
123          * If the internet name can't be resolved we are probably behind
124          * a firewall or in some other way not directly connected to the
125          * Internet. Not enough reason to fail the test. Just ignore and
126          * abort.
127          */
128     } else  {
129         ok((hor != 0x0),"HttpOpenRequest Failed\n");
130     }
131     trace("HttpOpenRequestA -->\n");
132
133     if (hor == 0x0) goto abort;
134
135     trace("HttpSendRequestA -->\n");
136     SetLastError(0);
137     rc = HttpSendRequestA(hor, "", 0xffffffff,0x0,0x0);
138     if (flags)
139         ok(((rc == 0)&&(GetLastError()==997)),
140             "Asynchronous HttpSendRequest NOT returning 0 with error 997\n");
141     else
142         ok((rc != 0) || GetLastError() == 12007, /* 12007 == XP */
143            "Synchronous HttpSendRequest returning 0, error %ld\n", GetLastError());
144     trace("HttpSendRequestA <--\n");
145
146     while ((flags)&&(!goon))
147         Sleep(100);
148
149     length = 4;
150     rc = InternetQueryOptionA(hor,0x17,&out,&length);
151     trace("Option 0x17 -> %li  %li\n",rc,out);
152
153     length = 100;
154     rc = InternetQueryOptionA(hor,0x22,buffer,&length);
155     trace("Option 0x22 -> %li  %s\n",rc,buffer);
156
157     length = 4000;
158     rc = HttpQueryInfoA(hor,0x16,buffer,&length,0x0);
159     buffer[length]=0;
160     trace("Option 0x16 -> %li  %s\n",rc,buffer);
161
162     length = 4000;
163     rc = InternetQueryOptionA(hor,0x22,buffer,&length);
164     buffer[length]=0;
165     trace("Option 0x22 -> %li  %s\n",rc,buffer);
166
167     length = 16;
168     rc = HttpQueryInfoA(hor,0x5,&buffer,&length,0x0);
169     trace("Option 0x5 -> %li  %s  (%li)\n",rc,buffer,GetLastError());
170
171     length = 100;
172     rc = HttpQueryInfoA(hor,0x1,buffer,&length,0x0);
173     buffer[length]=0;
174     trace("Option 0x1 -> %li  %s\n",rc,buffer);
175
176     length = 100;
177     trace("Entering Query loop\n");
178
179     while (length)
180     {
181
182         rc = InternetQueryDataAvailable(hor,&length,0x0,0x0);
183         ok(!(rc == 0 && length != 0),"InternetQueryDataAvailable failed\n");
184
185         if (length)
186         {
187             char *buffer;
188             buffer = HeapAlloc(GetProcessHeap(),0,length+1);
189
190             rc = InternetReadFile(hor,buffer,length,&length);
191
192             buffer[length]=0;
193
194             trace("ReadFile -> %li %li\n",rc,length);
195
196             HeapFree(GetProcessHeap(),0,buffer);
197         }
198     }
199 abort:
200     if (hor != 0x0) {
201         rc = InternetCloseHandle(hor);
202         ok ((rc != 0), "InternetCloseHandle of handle opened by HttpOpenRequestA failed\n");
203         rc = InternetCloseHandle(hor);
204         ok ((rc == 0), "Double close of handle opened by HttpOpenRequestA succeeded\n");
205     }
206     if (hic != 0x0) {
207         rc = InternetCloseHandle(hic);
208         ok ((rc != 0), "InternetCloseHandle of handle opened by InternetConnectA failed\n");
209     }
210     if (hi != 0x0) {
211       rc = InternetCloseHandle(hi);
212       ok ((rc != 0), "InternetCloseHandle of handle opened by InternetOpenA failed\n");
213       if (flags)
214           Sleep(100);
215     }
216 }
217
218 void InternetOpenUrlA_test(void)
219 {
220   HINTERNET myhinternet, myhttp;
221   char buffer[0x400];
222   URL_COMPONENTSA urlComponents;
223   char protocol[32], hostName[1024], userName[1024];
224   char password[1024], extra[1024], path[1024];
225   DWORD size, readbytes, totalbytes=0;
226   BOOL ret;
227   
228   myhinternet = InternetOpen("Winetest",0,NULL,NULL,INTERNET_FLAG_NO_CACHE_WRITE);
229   ok((myhinternet != 0), "InternetOpen failed, error %lx\n",GetLastError());
230   size = 0x400;
231   ret = InternetCanonicalizeUrl(TEST_URL, buffer, &size,ICU_BROWSER_MODE);
232   ok( ret, "InternetCanonicalizeUrl failed, error %lx\n",GetLastError());
233   
234   urlComponents.dwStructSize = sizeof(URL_COMPONENTSA);
235   urlComponents.lpszScheme = protocol;
236   urlComponents.dwSchemeLength = 32;
237   urlComponents.lpszHostName = hostName;
238   urlComponents.dwHostNameLength = 1024;
239   urlComponents.lpszUserName = userName;
240   urlComponents.dwUserNameLength = 1024;
241   urlComponents.lpszPassword = password;
242   urlComponents.dwPasswordLength = 1024;
243   urlComponents.lpszUrlPath = path;
244   urlComponents.dwUrlPathLength = 2048;
245   urlComponents.lpszExtraInfo = extra;
246   urlComponents.dwExtraInfoLength = 1024;
247   ret = InternetCrackUrl(TEST_URL, 0,0,&urlComponents);
248   ok( ret, "InternetCrackUrl failed, error %lx\n",GetLastError());
249   SetLastError(0);
250   myhttp = InternetOpenUrl(myhinternet, TEST_URL, 0, 0,
251                            INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_TRANSFER_BINARY,0);
252   if (GetLastError() == 12007)
253     return; /* WinXP returns this when not connected to the net */
254   ok((myhttp != 0),"InternetOpenUrl failed, error %lx\n",GetLastError());
255   ret = InternetReadFile(myhttp, buffer,0x400,&readbytes);
256   ok( ret, "InternetReadFile failed, error %lx\n",GetLastError());
257   totalbytes += readbytes;
258   while (readbytes && InternetReadFile(myhttp, buffer,0x400,&readbytes))
259     totalbytes += readbytes;
260   trace("read 0x%08lx bytes\n",totalbytes);
261 }
262   
263 void InternetCrackUrl_test(void)
264 {
265   URL_COMPONENTSA urlComponents;
266   char protocol[32], hostName[1024], userName[1024];
267   char password[1024], extra[1024], path[1024];
268   BOOL ret;
269
270   urlComponents.dwStructSize = sizeof(URL_COMPONENTSA);
271   urlComponents.lpszScheme = protocol;
272   urlComponents.dwSchemeLength = 32;
273   urlComponents.lpszHostName = hostName;
274   urlComponents.dwHostNameLength = 1024;
275   urlComponents.lpszUserName = userName;
276   urlComponents.dwUserNameLength = 1024;
277   urlComponents.lpszPassword = password;
278   urlComponents.dwPasswordLength = 1024;
279   urlComponents.lpszUrlPath = path;
280   urlComponents.dwUrlPathLength = 2048;
281   urlComponents.lpszExtraInfo = extra;
282   urlComponents.dwExtraInfoLength = 1024;
283   ret = InternetCrackUrl(TEST_URL, 0,0,&urlComponents);
284   ok( ret, "InternetCrackUrl failed, error %lx\n",GetLastError());
285   ok((strcmp(TEST_URL_PATH,path) == 0),"path cracked wrong\n");
286
287   /* Bug 1805: Confirm the returned lengths are correct:                     */
288   /* 1. When extra info split out explicitly */
289   ZeroMemory(&urlComponents, sizeof(urlComponents));
290   urlComponents.dwStructSize = sizeof(urlComponents);
291   urlComponents.dwHostNameLength = 1;
292   urlComponents.dwUrlPathLength  = 1;
293   urlComponents.dwExtraInfoLength = 1;
294   ok(InternetCrackUrlA(TEST_URL2, 0, 0, &urlComponents),"InternetCrackUrl failed, error 0x%lx\n", GetLastError());
295   ok(urlComponents.dwUrlPathLength == strlen(TEST_URL2_PATH),".dwUrlPathLength should be %d, but is %ld\n", strlen(TEST_URL2_PATH), urlComponents.dwUrlPathLength);
296   ok(!strncmp(urlComponents.lpszUrlPath,TEST_URL2_PATH,strlen(TEST_URL2_PATH)),"lpszUrlPath should be %s but is %s\n", TEST_URL2_PATH, urlComponents.lpszUrlPath);
297   ok(urlComponents.dwHostNameLength == strlen(TEST_URL2_SERVER),".dwHostNameLength should be %d, but is %ld\n", strlen(TEST_URL2_SERVER), urlComponents.dwHostNameLength);
298   ok(!strncmp(urlComponents.lpszHostName,TEST_URL2_SERVER,strlen(TEST_URL2_SERVER)),"lpszHostName should be %s but is %s\n", TEST_URL2_SERVER, urlComponents.lpszHostName);
299   ok(urlComponents.dwExtraInfoLength == strlen(TEST_URL2_EXTRA),".dwExtraInfoLength should be %d, but is %ld\n", strlen(TEST_URL2_EXTRA), urlComponents.dwExtraInfoLength);
300   ok(!strncmp(urlComponents.lpszExtraInfo,TEST_URL2_EXTRA,strlen(TEST_URL2_EXTRA)),"lpszExtraInfo should be %s but is %s\n", TEST_URL2_EXTRA, urlComponents.lpszHostName);
301
302   /* 2. When extra info is not split out explicitly and is in url path */
303   ZeroMemory(&urlComponents, sizeof(urlComponents));
304   urlComponents.dwStructSize = sizeof(urlComponents);
305   urlComponents.dwHostNameLength = 1;
306   urlComponents.dwUrlPathLength  = 1;
307   ok(InternetCrackUrlA(TEST_URL2, 0, 0, &urlComponents),"InternetCrackUrl failed with GLE 0x%lx\n",GetLastError());
308   ok(urlComponents.dwUrlPathLength == strlen(TEST_URL2_PATHEXTRA),".dwUrlPathLength should be %d, but is %ld\n", strlen(TEST_URL2_PATHEXTRA), urlComponents.dwUrlPathLength);
309   ok(!strncmp(urlComponents.lpszUrlPath,TEST_URL2_PATHEXTRA,strlen(TEST_URL2_PATHEXTRA)),"lpszUrlPath should be %s but is %s\n", TEST_URL2_PATHEXTRA, urlComponents.lpszUrlPath);
310   ok(urlComponents.dwHostNameLength == strlen(TEST_URL2_SERVER),".dwHostNameLength should be %d, but is %ld\n", strlen(TEST_URL2_SERVER), urlComponents.dwHostNameLength);
311   ok(!strncmp(urlComponents.lpszHostName,TEST_URL2_SERVER,strlen(TEST_URL2_SERVER)),"lpszHostName should be %s but is %s\n", TEST_URL2_SERVER, urlComponents.lpszHostName);
312
313
314
315 }
316
317 void InternetCrackUrlW_test(void)
318 {
319     WCHAR url[] = {
320         'h','t','t','p',':','/','/','1','9','2','.','1','6','8','.','0','.','2','2','/',
321         'C','F','I','D','E','/','m','a','i','n','.','c','f','m','?','C','F','S','V','R',
322         '=','I','D','E','&','A','C','T','I','O','N','=','I','D','E','_','D','E','F','A',
323         'U','L','T', 0 };
324     URL_COMPONENTSW comp;
325     WCHAR scheme[20], host[20], user[20], pwd[20], urlpart[50], extra[50];
326     BOOL r;
327
328     urlpart[0]=0;
329     scheme[0]=0;
330     extra[0]=0;
331     host[0]=0;
332     user[0]=0;
333     pwd[0]=0;
334     memset(&comp, 0, sizeof comp);
335     comp.dwStructSize = sizeof comp;
336     comp.lpszScheme = scheme;
337     comp.dwSchemeLength = sizeof scheme;
338     comp.lpszHostName = host;
339     comp.dwHostNameLength = sizeof host;
340     comp.lpszUserName = user;
341     comp.dwUserNameLength = sizeof user;
342     comp.lpszPassword = pwd;
343     comp.dwPasswordLength = sizeof pwd;
344     comp.lpszUrlPath = urlpart;
345     comp.dwUrlPathLength = sizeof urlpart;
346     comp.lpszExtraInfo = extra;
347     comp.dwExtraInfoLength = sizeof extra;
348
349     r = InternetCrackUrlW(url, 0, 0, &comp );
350     ok( r, "failed to crack url\n");
351     ok( comp.dwSchemeLength == 4, "scheme length wrong\n");
352     ok( comp.dwHostNameLength == 12, "host length wrong\n");
353     ok( comp.dwUserNameLength == 0, "user length wrong\n");
354     ok( comp.dwPasswordLength == 0, "password length wrong\n");
355     ok( comp.dwUrlPathLength == 15, "url length wrong\n");
356     ok( comp.dwExtraInfoLength == 29, "extra length wrong\n");
357  
358     urlpart[0]=0;
359     scheme[0]=0;
360     extra[0]=0;
361     host[0]=0;
362     user[0]=0;
363     pwd[0]=0;
364     memset(&comp, 0, sizeof comp);
365     comp.dwStructSize = sizeof comp;
366     comp.lpszHostName = host;
367     comp.dwHostNameLength = sizeof host;
368     comp.lpszUrlPath = urlpart;
369     comp.dwUrlPathLength = sizeof urlpart;
370
371     r = InternetCrackUrlW(url, 0, 0, &comp );
372     ok( r, "failed to crack url\n");
373     ok( comp.dwSchemeLength == 0, "scheme length wrong\n");
374     ok( comp.dwHostNameLength == 12, "host length wrong\n");
375     ok( comp.dwUserNameLength == 0, "user length wrong\n");
376     ok( comp.dwPasswordLength == 0, "password length wrong\n");
377     ok( comp.dwUrlPathLength == 44, "url length wrong\n");
378     ok( comp.dwExtraInfoLength == 0, "extra length wrong\n");
379
380     urlpart[0]=0;
381     scheme[0]=0;
382     extra[0]=0;
383     host[0]=0;
384     user[0]=0;
385     pwd[0]=0;
386     memset(&comp, 0, sizeof comp);
387     comp.dwStructSize = sizeof comp;
388     comp.lpszHostName = host;
389     comp.dwHostNameLength = sizeof host;
390     comp.lpszUrlPath = urlpart;
391     comp.dwUrlPathLength = sizeof urlpart;
392     comp.lpszExtraInfo = NULL;
393     comp.dwExtraInfoLength = sizeof extra;
394
395     r = InternetCrackUrlW(url, 0, 0, &comp );
396     ok( r, "failed to crack url\n");
397     ok( comp.dwSchemeLength == 0, "scheme length wrong\n");
398     ok( comp.dwHostNameLength == 12, "host length wrong\n");
399     ok( comp.dwUserNameLength == 0, "user length wrong\n");
400     ok( comp.dwPasswordLength == 0, "password length wrong\n");
401     ok( comp.dwUrlPathLength == 15, "url length wrong\n");
402     ok( comp.dwExtraInfoLength == 29, "extra length wrong\n");
403 }
404
405 static void InternetTimeFromSystemTimeA_test()
406 {
407     BOOL ret;
408     static const SYSTEMTIME time = { 2005, 1, 5, 7, 12, 6, 35, 0 };
409     char string[INTERNET_RFC1123_BUFSIZE];
410     static const char expect[] = "Fri, 07 Jan 2005 12:06:35 GMT";
411
412     ret = InternetTimeFromSystemTimeA( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) );
413     ok( ret, "InternetTimeFromSystemTimeA failed (%ld)\n", GetLastError() );
414
415     ok( !memcmp( string, expect, sizeof(expect) ),
416         "InternetTimeFromSystemTimeA failed (%ld)\n", GetLastError() );
417 }
418
419 static void InternetTimeFromSystemTimeW_test()
420 {
421     BOOL ret;
422     static const SYSTEMTIME time = { 2005, 1, 5, 7, 12, 6, 35, 0 };
423     WCHAR string[INTERNET_RFC1123_BUFSIZE + 1];
424     static const WCHAR expect[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ',
425                                     '1','2',':','0','6',':','3','5',' ','G','M','T',0 };
426
427     ret = InternetTimeFromSystemTimeW( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) );
428     ok( ret, "InternetTimeFromSystemTimeW failed (%ld)\n", GetLastError() );
429
430     ok( !memcmp( string, expect, sizeof(expect) ),
431         "InternetTimeFromSystemTimeW failed (%ld)\n", GetLastError() );
432 }
433
434 static void InternetTimeToSystemTimeA_test()
435 {
436     BOOL ret;
437     SYSTEMTIME time;
438     static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 };
439     static const char string[] = "Fri, 07 Jan 2005 12:06:35 GMT";
440     static const char string2[] = " fri 7 jan 2005 12 06 35";
441
442     ret = InternetTimeToSystemTimeA( string, &time, 0 );
443     ok( ret, "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
444     ok( !memcmp( &time, &expect, sizeof(expect) ),
445         "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
446
447     ret = InternetTimeToSystemTimeA( string2, &time, 0 );
448     ok( ret, "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
449     ok( !memcmp( &time, &expect, sizeof(expect) ),
450         "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
451 }
452
453 static void InternetTimeToSystemTimeW_test()
454 {
455     BOOL ret;
456     SYSTEMTIME time;
457     static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 };
458     static const WCHAR string[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ',
459                                     '1','2',':','0','6',':','3','5',' ','G','M','T',0 };
460     static const WCHAR string2[] = { ' ','f','r','i',' ','7',' ','j','a','n',' ','2','0','0','5',' ',
461                                      '1','2',' ','0','6',' ','3','5',0 };
462     static const WCHAR string3[] = { 'F','r',0 };
463
464     ret = InternetTimeToSystemTimeW( NULL, NULL, 0 );
465     ok( !ret, "InternetTimeToSystemTimeW succeeded (%ld)\n", GetLastError() );
466
467     ret = InternetTimeToSystemTimeW( NULL, &time, 0 );
468     ok( !ret, "InternetTimeToSystemTimeW succeeded (%ld)\n", GetLastError() );
469
470     ret = InternetTimeToSystemTimeW( string, NULL, 0 );
471     ok( !ret, "InternetTimeToSystemTimeW succeeded (%ld)\n", GetLastError() );
472
473     ret = InternetTimeToSystemTimeW( string, &time, 1 );
474     ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
475
476     ret = InternetTimeToSystemTimeW( string, &time, 0 );
477     ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
478     ok( !memcmp( &time, &expect, sizeof(expect) ),
479         "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
480
481     ret = InternetTimeToSystemTimeW( string2, &time, 0 );
482     ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
483     ok( !memcmp( &time, &expect, sizeof(expect) ),
484         "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
485
486     ret = InternetTimeToSystemTimeW( string3, &time, 0 );
487     ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
488 }
489
490 START_TEST(http)
491 {
492     winapi_test(0x10000000);
493     winapi_test(0x00000000);
494     InternetCrackUrl_test();
495     InternetOpenUrlA_test();
496     InternetCrackUrlW_test();
497     InternetTimeFromSystemTimeA_test();
498     InternetTimeFromSystemTimeW_test();
499     InternetTimeToSystemTimeA_test();
500     InternetTimeToSystemTimeW_test();
501 }