2 * Copyright 2008 Hans Leidekker
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/test.h"
28 static WCHAR empty[] = {0};
29 static WCHAR ftp[] = {'f','t','p',0};
30 static WCHAR http[] = {'h','t','t','p',0};
31 static WCHAR winehq[] = {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
32 static WCHAR username[] = {'u','s','e','r','n','a','m','e',0};
33 static WCHAR password[] = {'p','a','s','s','w','o','r','d',0};
34 static WCHAR about[] = {'/','s','i','t','e','/','a','b','o','u','t',0};
35 static WCHAR query[] = {'?','q','u','e','r','y',0};
36 static WCHAR escape[] = {' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/',':',';','<','=','>','?','@','[','\\',']','^','_','`','{','|','}','~',0};
38 static const WCHAR url1[] =
39 {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d',
40 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','s','i','t','e','/','a','b','o','u','t','?','q','u','e','r','y',0};
41 static const WCHAR url2[] =
42 {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',
43 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','s','i','t','e','/','a','b','o','u','t','?','q','u','e','r','y',0};
44 static const WCHAR url3[] = {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':',0};
45 static const WCHAR url4[] =
46 {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','s','i','t','e','/','a','b','o','u','t','?','q','u','e','r','y',0};
47 static const WCHAR url5[] = {'h','t','t','p',':','/','/',0};
48 static const WCHAR url6[] =
49 {'f','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d',
50 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g',':','8','0','/','s','i','t','e','/','a','b','o','u','t','?','q','u','e','r','y',0};
51 static const WCHAR url7[] =
52 {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d',
53 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g',':','4','2','/','s','i','t','e','/','a','b','o','u','t','?','q','u','e','r','y',0};
54 static const WCHAR url8[] =
55 {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d',
56 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','s','i','t','e','/','a','b','o','u','t',
57 '%','2','0','!','%','2','2','%','2','3','$','%','2','5','&','\'','(',')','*','+',',','-','.','/',':',';','%','3','C','=','%','3','E','?','@','%',
58 '5','B','%','5','C','%','5','D','%','5','E','_','%','6','0','%','7','B','%','7','C','%','7','D','%','7','E',0};
59 static const WCHAR url9[] =
60 {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d',
61 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g',':','0','/','s','i','t','e','/','a','b','o','u','t','?','q','u','e','r','y',0};
63 static const WCHAR url_k1[] =
64 {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d',
65 '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','s','i','t','e','/','a','b','o','u','t',0};
66 static const WCHAR url_k2[] =
67 {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
68 static const WCHAR url_k3[] =
69 {'h','t','t','p','s',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','p','o','s','t','?',0};
70 static const WCHAR url_k4[] =
71 {'H','T','T','P',':','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
72 static const WCHAR url_k5[] =
73 {'h','t','t','p',':','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
74 static const WCHAR url_k6[] =
75 {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
76 static const WCHAR url_k7[] =
78 static const WCHAR url_k8[] =
80 static const WCHAR url_k9[] =
81 {'h','t','t','p',':','/','/','w','i','n','e','h','q','?',0};
82 static const WCHAR url_k10[] =
83 {'h','t','t','p',':','/','/','w','i','n','e','h','q','/','p','o','s','t',';','a',0};
85 static void fill_url_components( URL_COMPONENTS *uc )
87 uc->dwStructSize = sizeof(URL_COMPONENTS);
88 uc->lpszScheme = http;
89 uc->dwSchemeLength = lstrlenW( uc->lpszScheme );
90 uc->nScheme = INTERNET_SCHEME_HTTP;
91 uc->lpszHostName = winehq;
92 uc->dwHostNameLength = lstrlenW( uc->lpszHostName );
94 uc->lpszUserName = username;
95 uc->dwUserNameLength = lstrlenW( uc->lpszUserName );
96 uc->lpszPassword = password;
97 uc->dwPasswordLength = lstrlenW( uc->lpszPassword );
98 uc->lpszUrlPath = about;
99 uc->dwUrlPathLength = lstrlenW( uc->lpszUrlPath );
100 uc->lpszExtraInfo = query;
101 uc->dwExtraInfoLength = lstrlenW( uc->lpszExtraInfo );
104 static void WinHttpCreateUrl_test( void )
111 /* NULL components */
113 SetLastError( 0xdeadbeef );
114 ret = WinHttpCreateUrl( NULL, 0, NULL, &len );
115 ok( !ret, "expected failure\n" );
116 ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() );
117 ok( len == ~0UL, "expected len ~0UL got %u\n", len );
119 /* zero'ed components */
120 memset( &uc, 0, sizeof(URL_COMPONENTS) );
121 SetLastError( 0xdeadbeef );
122 ret = WinHttpCreateUrl( &uc, 0, NULL, &len );
123 ok( !ret, "expected failure\n" );
124 ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() );
125 ok( len == ~0UL, "expected len ~0UL got %u\n", len );
127 /* valid components, NULL url, NULL length */
128 fill_url_components( &uc );
129 SetLastError( 0xdeadbeef );
130 ret = WinHttpCreateUrl( &uc, 0, NULL, NULL );
131 ok( !ret, "expected failure\n" );
132 ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() );
133 ok( len == ~0UL, "expected len ~0UL got %u\n", len );
135 /* valid components, NULL url */
136 SetLastError( 0xdeadbeef );
137 ret = WinHttpCreateUrl( &uc, 0, NULL, &len );
138 ok( !ret, "expected failure\n" );
139 ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError() );
140 ok( len == 57, "expected len 57 got %u\n", len );
142 /* correct size, NULL url */
143 fill_url_components( &uc );
144 SetLastError( 0xdeadbeef );
145 ret = WinHttpCreateUrl( &uc, 0, NULL, &len );
146 ok( !ret, "expected failure\n" );
147 ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError() );
148 ok( len == 57, "expected len 57 got %u\n", len );
150 /* valid components, allocated url, short length */
151 SetLastError( 0xdeadbeef );
152 url = HeapAlloc( GetProcessHeap(), 0, 256 * sizeof(WCHAR) );
155 ret = WinHttpCreateUrl( &uc, 0, url, &len );
156 ok( !ret, "expected failure\n" );
157 ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError() );
158 ok( len == 57, "expected len 57 got %u\n", len );
160 /* allocated url, NULL scheme */
161 uc.lpszScheme = NULL;
164 ret = WinHttpCreateUrl( &uc, 0, url, &len );
165 ok( ret, "expected success\n" );
166 ok( len == 56, "expected len 56 got %u\n", len );
167 ok( !lstrcmpW( url, url1 ), "url doesn't match\n" );
169 /* allocated url, 0 scheme */
170 fill_url_components( &uc );
174 ret = WinHttpCreateUrl( &uc, 0, url, &len );
175 ok( ret, "expected success\n" );
176 ok( len == 56, "expected len 56 got %u\n", len );
178 /* valid components, allocated url */
179 fill_url_components( &uc );
182 ret = WinHttpCreateUrl( &uc, 0, url, &len );
183 ok( ret, "expected success\n" );
184 ok( len == 56, "expected len 56 got %d\n", len );
185 ok( !lstrcmpW( url, url1 ), "url doesn't match\n" );
187 /* valid username, NULL password */
188 fill_url_components( &uc );
189 uc.lpszPassword = NULL;
192 ret = WinHttpCreateUrl( &uc, 0, url, &len );
193 ok( ret, "expected success\n" );
195 /* valid username, empty password */
196 fill_url_components( &uc );
197 uc.lpszPassword = empty;
200 ret = WinHttpCreateUrl( &uc, 0, url, &len );
201 ok( ret, "expected success\n" );
202 ok( len == 56, "expected len 56 got %u\n", len );
203 ok( !lstrcmpW( url, url3 ), "url doesn't match\n" );
205 /* valid password, NULL username */
206 fill_url_components( &uc );
207 SetLastError( 0xdeadbeef );
208 uc.lpszUserName = NULL;
211 ret = WinHttpCreateUrl( &uc, 0, url, &len );
212 ok( !ret, "expected failure\n" );
213 ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() );
215 /* valid password, empty username */
216 fill_url_components( &uc );
217 uc.lpszUserName = empty;
220 ret = WinHttpCreateUrl( &uc, 0, url, &len );
221 ok( ret, "expected success\n");
223 /* NULL username, NULL password */
224 fill_url_components( &uc );
225 uc.lpszUserName = NULL;
226 uc.lpszPassword = NULL;
229 ret = WinHttpCreateUrl( &uc, 0, url, &len );
230 ok( ret, "expected success\n" );
231 ok( len == 38, "expected len 38 got %u\n", len );
232 ok( !lstrcmpW( url, url4 ), "url doesn't match\n" );
234 /* empty username, empty password */
235 fill_url_components( &uc );
236 uc.lpszUserName = empty;
237 uc.lpszPassword = empty;
240 ret = WinHttpCreateUrl( &uc, 0, url, &len );
241 ok( ret, "expected success\n" );
242 ok( len == 56, "expected len 56 got %u\n", len );
243 ok( !lstrcmpW( url, url5 ), "url doesn't match\n" );
245 /* nScheme has lower precedence than lpszScheme */
246 fill_url_components( &uc );
248 uc.dwSchemeLength = lstrlenW( uc.lpszScheme );
251 ret = WinHttpCreateUrl( &uc, 0, url, &len );
252 ok( ret, "expected success\n" );
253 ok( len == lstrlenW( url6 ), "expected len %d got %u\n", lstrlenW( url6 ) + 1, len );
254 ok( !lstrcmpW( url, url6 ), "url doesn't match\n" );
256 /* non-standard port */
257 uc.lpszScheme = http;
258 uc.dwSchemeLength = lstrlenW( uc.lpszScheme );
262 ret = WinHttpCreateUrl( &uc, 0, url, &len );
263 ok( ret, "expected success\n" );
264 ok( len == 59, "expected len 59 got %u\n", len );
265 ok( !lstrcmpW( url, url7 ), "url doesn't match\n" );
267 /* escape extra info */
268 fill_url_components( &uc );
269 uc.lpszExtraInfo = escape;
270 uc.dwExtraInfoLength = lstrlenW( uc.lpszExtraInfo );
273 ret = WinHttpCreateUrl( &uc, ICU_ESCAPE, url, &len );
274 ok( ret, "expected success\n" );
275 ok( len == 113, "expected len 113 got %u\n", len );
276 ok( !lstrcmpW( url, url8 ), "url doesn't match\n" );
278 /* NULL lpszScheme, 0 nScheme and nPort */
279 fill_url_components( &uc );
280 uc.lpszScheme = NULL;
281 uc.dwSchemeLength = 0;
286 ret = WinHttpCreateUrl( &uc, 0, url, &len );
287 ok( ret, "expected success\n" );
288 ok( len == 58, "expected len 58 got %u\n", len );
289 ok( !lstrcmpW( url, url9 ), "url doesn't match\n" );
291 HeapFree( GetProcessHeap(), 0, url );
294 static void reset_url_components( URL_COMPONENTS *uc )
296 memset( uc, 0, sizeof(URL_COMPONENTS) );
297 uc->dwStructSize = sizeof(URL_COMPONENTS);
298 uc->dwSchemeLength = ~0UL;
299 uc->dwHostNameLength = ~0UL;
300 uc->dwUserNameLength = ~0UL;
301 uc->dwPasswordLength = ~0UL;
302 uc->dwUrlPathLength = ~0UL;
303 uc->dwExtraInfoLength = ~0UL;
306 static void WinHttpCrackUrl_test( void )
309 WCHAR scheme[20], user[20], pass[20], host[20], path[40], extra[20];
313 /* buffers of sufficient length */
321 uc.dwStructSize = sizeof(URL_COMPONENTS);
323 uc.lpszScheme = scheme;
324 uc.dwSchemeLength = 20;
325 uc.lpszUserName = user;
326 uc.dwUserNameLength = 20;
327 uc.lpszPassword = pass;
328 uc.dwPasswordLength = 20;
329 uc.lpszHostName = host;
330 uc.dwHostNameLength = 20;
331 uc.lpszUrlPath = path;
332 uc.dwUrlPathLength = 40;
333 uc.lpszExtraInfo = extra;
334 uc.dwExtraInfoLength = 20;
336 ret = WinHttpCrackUrl( url1, 0, 0, &uc );
337 ok( ret, "WinHttpCrackUrl failed\n" );
338 ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" );
339 ok( !memcmp( uc.lpszScheme, http, sizeof(http) ), "unexpected scheme\n" );
340 ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" );
341 ok( !memcmp( uc.lpszUserName, username, sizeof(username) ), "unexpected username\n" );
342 ok( uc.dwUserNameLength == 8, "unexpected username length\n" );
343 ok( !memcmp( uc.lpszPassword, password, sizeof(password) ), "unexpected password\n" );
344 ok( uc.dwPasswordLength == 8, "unexpected password length\n" );
345 ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected hostname\n" );
346 ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" );
347 ok( !memcmp( uc.lpszUrlPath, about, sizeof(about) ), "unexpected path\n" );
348 ok( uc.dwUrlPathLength == 11, "unexpected path length\n" );
349 ok( !memcmp( uc.lpszExtraInfo, query, sizeof(query) ), "unexpected extra info\n" );
350 ok( uc.dwExtraInfoLength == 6, "unexpected extra info length\n" );
352 /* buffer of insufficient length */
354 uc.dwSchemeLength = 1;
356 SetLastError( 0xdeadbeef );
357 ret = WinHttpCrackUrl( url1, 0, 0, &uc );
358 error = GetLastError();
359 ok( !ret, "WinHttpCrackUrl failed\n" );
360 ok( error == ERROR_INSUFFICIENT_BUFFER, "WinHttpCrackUrl failed\n" );
361 ok( uc.dwSchemeLength == 5, "unexpected scheme length: %u\n", uc.dwSchemeLength );
364 reset_url_components( &uc );
365 ret = WinHttpCrackUrl( url_k1, 0, 0,&uc);
367 ok( ret, "WinHttpCrackUrl failed\n" );
368 ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" );
369 ok( uc.lpszScheme == url_k1,"unexpected scheme\n" );
370 ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" );
371 ok( uc.lpszUserName == url_k1 + 7, "unexpected username\n" );
372 ok( uc.dwUserNameLength == 8, "unexpected username length\n" );
373 ok( uc.lpszPassword == url_k1 + 16, "unexpected password\n" );
374 ok( uc.dwPasswordLength == 8, "unexpected password length\n" );
375 ok( uc.lpszHostName == url_k1 + 25, "unexpected hostname\n" );
376 ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" );
377 ok( uc.lpszUrlPath == url_k1 + 39, "unexpected path\n" );
378 ok( uc.dwUrlPathLength == 11, "unexpected path length\n" );
379 ok( uc.lpszExtraInfo == url_k1 + 50, "unexpected extra info\n" );
380 ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" );
382 reset_url_components( &uc );
383 ret = WinHttpCrackUrl( url_k2, 0, 0,&uc);
385 ok( ret, "WinHttpCrackUrl failed\n" );
386 ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" );
387 ok( uc.lpszScheme == url_k2, "unexpected scheme\n" );
388 ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" );
389 ok( uc.lpszUserName == NULL ,"unexpected username\n" );
390 ok( uc.dwUserNameLength == 0, "unexpected username length\n" );
391 ok( uc.lpszPassword == NULL, "unexpected password\n" );
392 ok( uc.dwPasswordLength == 0, "unexpected password length\n" );
393 ok( uc.lpszHostName == url_k2 + 7, "unexpected hostname\n" );
394 ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" );
395 ok( uc.lpszUrlPath == url_k2 + 21, "unexpected path\n" );
396 ok( uc.dwUrlPathLength == 0, "unexpected path length\n" );
397 ok( uc.lpszExtraInfo == url_k2 + 21, "unexpected extra info\n" );
398 ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" );
400 reset_url_components( &uc );
401 ret = WinHttpCrackUrl( url_k3, 0, 0, &uc );
403 ok( ret, "WinHttpCrackUrl failed\n" );
404 ok( uc.nScheme == INTERNET_SCHEME_HTTPS, "unexpected scheme\n" );
405 ok( uc.lpszScheme == url_k3, "unexpected scheme\n" );
406 ok( uc.dwSchemeLength == 5, "unexpected scheme length\n" );
407 ok( uc.lpszUserName == NULL, "unexpected username\n" );
408 ok( uc.dwUserNameLength == 0, "unexpected username length\n" );
409 ok( uc.lpszPassword == NULL, "unexpected password\n" );
410 ok( uc.dwPasswordLength == 0, "unexpected password length\n" );
411 ok( uc.lpszHostName == url_k3 + 8, "unexpected hostname\n" );
412 ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" );
413 ok( uc.lpszUrlPath == url_k3 + 22, "unexpected path\n" );
414 ok( uc.dwUrlPathLength == 5, "unexpected path length\n" );
415 ok( uc.lpszExtraInfo == url_k3 + 27, "unexpected extra info\n" );
416 ok( uc.dwExtraInfoLength == 1, "unexpected extra info length\n" );
419 reset_url_components( &uc );
420 ret = WinHttpCrackUrl( url_k4, 0, 0, &uc );
421 ok( !ret, "WinHttpCrackUrl failed\n" );
423 reset_url_components( &uc );
424 ret = WinHttpCrackUrl( url_k5, 0, 0, &uc );
425 ok( !ret, "WinHttpCrackUrl failed\n" );
427 reset_url_components( &uc );
428 ret = WinHttpCrackUrl( url_k6, 0, 0, &uc );
429 ok( !ret, "WinHttpCrackUrl failed\n" );
431 reset_url_components( &uc );
432 ret = WinHttpCrackUrl( url_k7, 0, 0, &uc );
433 ok( !ret, "WinHttpCrackUrl failed\n" );
435 reset_url_components( &uc );
436 ret = WinHttpCrackUrl( url_k8, 0, 0, &uc );
437 ok( !ret, "WinHttpCrackUrl failed\n" );
439 reset_url_components( &uc );
440 ret = WinHttpCrackUrl( url_k9, 0, 0, &uc );
441 ok( ret, "WinHttpCrackUrl failed\n" );
442 ok( uc.lpszUrlPath == url_k9 + 14, "unexpected path\n" );
443 ok( uc.dwUrlPathLength == 0, "unexpected path length\n" );
444 ok( uc.lpszExtraInfo == url_k9 + 14, "unexpected extra info\n" );
445 ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" );
447 reset_url_components( &uc );
448 ret = WinHttpCrackUrl( url_k10, 0, 0, &uc );
449 ok( ret, "WinHttpCrackUrl failed\n" );
450 ok( uc.lpszUrlPath == url_k10 + 13, "unexpected path\n" );
451 ok( uc.dwUrlPathLength == 7, "unexpected path length\n" );
452 ok( uc.lpszExtraInfo == url_k10 + 20, "unexpected extra info\n" );
453 ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" );
455 reset_url_components( &uc );
456 ret = WinHttpCrackUrl( url5, 0, 0, &uc );
457 ok( !ret, "WinHttpCrackUrl failed\n" );
459 reset_url_components( &uc );
460 ret = WinHttpCrackUrl( empty, 0, 0, &uc );
461 ok( !ret, "WinHttpCrackUrl failed\n" );
463 ret = WinHttpCrackUrl( url1, 0, 0, NULL );
464 ok( !ret, "WinHttpCrackUrl failed\n" );
466 ret = WinHttpCrackUrl( NULL, 0, 0, &uc );
467 ok( !ret, "WinHttpCrackUrl failed\n" );
469 /* decoding without buffers */
470 reset_url_components( &uc );
471 SetLastError(0xdeadbeef);
472 ret = WinHttpCrackUrl( url8, 0, ICU_DECODE, &uc );
473 error = GetLastError();
474 ok( !ret, "WinHttpCrackUrl failed\n" );
475 ok( error == ERROR_INVALID_PARAMETER, "WinHttpCrackUrl failed\n" );
477 /* decoding with buffers */
478 uc.lpszScheme = scheme;
479 uc.dwSchemeLength = 20;
480 uc.lpszUserName = user;
481 uc.dwUserNameLength = 20;
482 uc.lpszPassword = pass;
483 uc.dwPasswordLength = 20;
484 uc.lpszHostName = host;
485 uc.dwHostNameLength = 20;
486 uc.lpszUrlPath = path;
487 uc.dwUrlPathLength = 40;
488 uc.lpszExtraInfo = extra;
489 uc.dwExtraInfoLength = 20;
492 ret = WinHttpCrackUrl( url8, 0, ICU_DECODE, &uc );
493 ok( ret, "WinHttpCrackUrl failed\n" );
494 ok( !memcmp( uc.lpszUrlPath + 11, escape, 21 * sizeof(WCHAR) ), "unexpected path\n" );
495 ok( uc.dwUrlPathLength == 32, "unexpected path length\n" );
496 ok( !memcmp( uc.lpszExtraInfo, escape + 21, 12 * sizeof(WCHAR) ), "unexpected extra info\n" );
497 ok( uc.dwExtraInfoLength == 12, "unexpected extra info length\n" );
502 WinHttpCreateUrl_test();
503 WinHttpCrackUrl_test();