From 45069a33307abeaeceb53c04d866b4e3ee126cae Mon Sep 17 00:00:00 2001 From: Thomas Mullaly Date: Tue, 27 Jul 2010 20:21:16 -0400 Subject: [PATCH] urlmon: Implemented IUri_GetQuery. --- dlls/urlmon/tests/uri.c | 206 ++++++++++++++++++++++++------------------------ dlls/urlmon/uri.c | 26 ++++-- 2 files changed, 122 insertions(+), 110 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 1cb8647b8d9..8155181ef0a 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -104,7 +104,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, /* PASSWORD */ {"/",S_OK,FALSE}, /* PATH */ {"/",S_OK,TRUE}, /* PATH_AND_QUERY */ - {"",S_FALSE,TRUE}, /* QUERY */ + {"",S_FALSE,FALSE}, /* QUERY */ {"http://www.winehq.org/tests/../tests/../..",S_OK,FALSE}, /* RAW_URI */ {"http",S_OK,FALSE}, /* SCHEME_NAME */ {"",S_FALSE,FALSE}, /* USER_INFO */ @@ -133,7 +133,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/tests",S_OK,FALSE}, {"/tests",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://winehq.org/tests/.././tests",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -162,7 +162,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=x&return=y",S_OK,TRUE}, - {"?query=x&return=y",S_OK,TRUE}, + {"?query=x&return=y",S_OK,FALSE}, {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -191,7 +191,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE}, {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK,FALSE}, {"http",S_OK,FALSE}, {"usEr%3Ainfo",S_OK,FALSE}, @@ -221,7 +221,7 @@ static const uri_properties uri_tests[] = { {"wine",S_OK,FALSE}, {"/dir/foo%20bar.txt",S_OK,FALSE}, {"/dir/foo%20bar.txt",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"winepass:wine",S_OK,FALSE}, @@ -249,7 +249,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE}, {"/c:/tests/foo%2520bar.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -277,7 +277,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/tests/test%20file.README.txt",S_OK,FALSE}, {"/tests/test%20file.README.txt",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -305,7 +305,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"nothing:should:happen here",S_OK,FALSE}, {"nothing:should:happen here",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"urn:nothing:should:happen here",S_OK,FALSE}, {"urn",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -334,7 +334,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test%20dir/test.txt",S_OK,FALSE}, {"/test%20dir/test.txt",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -363,7 +363,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -392,7 +392,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://[::13.1.68.3]",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -421,7 +421,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -450,7 +450,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"1234://www.winehq.org",S_OK,FALSE}, {"1234",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -479,7 +479,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/C:/test/test.mp3",S_OK,FALSE}, {"/C:/test/test.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"C:/test/test.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -509,7 +509,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test.mp3",S_OK,FALSE}, {"/test.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"\\\\Server/test.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -538,7 +538,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test",S_OK,FALSE}, {"/test",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"www.winehq.org/test",S_OK,FALSE}, {"*",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -568,7 +568,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test",S_OK,FALSE}, {"/test",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"*:www.winehq.org/test",S_OK,FALSE}, {"*",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -596,7 +596,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/../some dir/test.ext",S_OK,FALSE}, {"/../some dir/test.ext",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"/../some dir/test.ext",S_OK,FALSE}, {"",S_FALSE,FALSE}, {"",S_FALSE,FALSE}, @@ -624,7 +624,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"//implicit/wildcard/uri%20scheme",S_OK,FALSE}, {"//implicit/wildcard/uri%20scheme",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"//implicit/wildcard/uri scheme",S_OK,FALSE}, {"*",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -654,7 +654,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/.//google.com",S_OK,FALSE}, {"/.//google.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://google.com",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -685,7 +685,7 @@ static const uri_properties uri_tests[] = { {"pass:word",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://user:pass:word@winehq.org/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"user:pass:word",S_OK,FALSE}, @@ -716,7 +716,7 @@ static const uri_properties uri_tests[] = { {"PASS",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"wINe:PASS",S_OK,FALSE}, @@ -747,7 +747,7 @@ static const uri_properties uri_tests[] = { {"PA%7B%7D",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"w%5D%5Be:PA%7B%7D",S_OK,FALSE}, @@ -778,7 +778,7 @@ static const uri_properties uri_tests[] = { {"",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://empty:@ftp.google.com/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"empty:",S_OK,FALSE}, @@ -809,7 +809,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"%22%20%22weird",S_OK,FALSE}, @@ -840,7 +840,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"\" \"weird",S_OK,FALSE}, @@ -870,7 +870,7 @@ static const uri_properties uri_tests[] = { {"word",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://%xy:word@winehq.org/",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"%xy:word",S_OK,FALSE}, @@ -902,7 +902,7 @@ static const uri_properties uri_tests[] = { {"%52%53ord",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"%2E:%52%53ord",S_OK,FALSE}, @@ -932,7 +932,7 @@ static const uri_properties uri_tests[] = { {"word",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"[](),'test':word",S_OK,FALSE}, @@ -961,7 +961,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?:word@winehq.org/",S_OK,TRUE}, - {"?:word@winehq.org/",S_OK,TRUE}, + {"?:word@winehq.org/",S_OK,FALSE}, {"ftp://test?:word@winehq.org/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -990,7 +990,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://test#:word@winehq.org/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1020,7 +1020,7 @@ static const uri_properties uri_tests[] = { {"word",S_OK,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://test\\:word@winehq.org/",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"test\\:word",S_OK,FALSE}, @@ -1050,7 +1050,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://127.000.000.100/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1080,7 +1080,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://127.0/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1110,7 +1110,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://123456/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1140,7 +1140,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://4294967295/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1170,7 +1170,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://4294967296/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1200,7 +1200,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"1234://4294967295/",S_OK,FALSE}, {"1234",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1230,7 +1230,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"1234://127.001/",S_OK,FALSE}, {"1234",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1259,7 +1259,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[FEDC:BA98::3210]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1288,7 +1288,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[::]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1317,7 +1317,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[FEDC:BA98::]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1347,7 +1347,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[1::3:4:5:6:7:8]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1376,7 +1376,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[v2.34]/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1406,7 +1406,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test",S_OK,FALSE}, {"/test",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[xyz:12345.com/test",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1438,7 +1438,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"ftp://www.[works].com/",S_OK,FALSE}, {"ftp",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1468,7 +1468,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://www.google.com]:12345/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1498,7 +1498,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://w%XXw%GEw.google.com/",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1528,7 +1528,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://GOOGLE.com/",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1558,7 +1558,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://WWW.GOOGLE.com/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1590,7 +1590,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://www.%7Cgoogle|.com/",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1620,7 +1620,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1650,7 +1650,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[::001.002.003.000]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1680,7 +1680,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1710,7 +1710,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[ffff::192.222.111.32]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1740,7 +1740,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.com:65535",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1769,7 +1769,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://google.com:65536",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1798,7 +1798,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://google.com:65536:25",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1827,7 +1827,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://[::ffff]:abcd",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1856,7 +1856,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://127.0.0.1:abcd",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1885,7 +1885,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"",S_FALSE,FALSE}, {"",S_FALSE,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.com:00035",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1914,7 +1914,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"",S_FALSE,FALSE}, {"",S_FALSE,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.com:80",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1943,7 +1943,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.com.uk",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -1972,7 +1972,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.com.com",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2001,7 +2001,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.uk.1",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2031,7 +2031,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://google.foo.uk",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2060,7 +2060,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://.com",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2089,7 +2089,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://.uk",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2118,7 +2118,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://www.co.google.com.[]",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2147,7 +2147,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://co.uk",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2176,7 +2176,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://www.co.google.us.test",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2205,7 +2205,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://gov.uk",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2233,7 +2233,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"",S_FALSE,FALSE}, {"",S_FALSE,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://www.google.com\\test",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2261,7 +2261,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"excepts:bad:%XY:encoded",S_OK,FALSE}, {"excepts:bad:%XY:encoded",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"urn:excepts:bad:%XY:encoded",S_OK,FALSE}, {"urn",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2292,7 +2292,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE}, {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2323,7 +2323,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE}, {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2353,7 +2353,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/%3F%23.T/test",S_OK,FALSE}, {"/%3F%23.T/test",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2382,7 +2382,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/C:/%22test%22/test.mp3",S_OK,FALSE}, {"/C:/%22test%22/test.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"file:///C:/\"test\"/test.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2412,7 +2412,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/<|>\" test<|>",S_OK,FALSE}, {"/<|>\" test<|>",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"1234://4294967295/<|>\" test<|>",S_OK,FALSE}, {"1234",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2442,7 +2442,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE}, {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://gov.uk/<|> test<|>",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2471,7 +2471,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://gov.uk/test/../test2/././../test3/.././././",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2500,7 +2500,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://gov.uk/test/test2/../../..",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2529,7 +2529,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://gov.uk/test/test2/../../.",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2557,7 +2557,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/c:/foo%2520bar.mp3",S_OK,FALSE}, {"/c:/foo%2520bar.mp3",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK,FALSE}, {"file",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2587,7 +2587,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"zip://gov.uk/test/test2/../../.",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2617,7 +2617,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test/test2/../../.",S_OK,FALSE}, {"/test/test2/../../.",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"http://gov.uk/test/test2/../../.",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2647,7 +2647,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/test/test2/../../.",S_OK,FALSE}, {"/test/test2/../../.",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"*:gov.uk/test/test2/../../.",S_OK,FALSE}, {"*",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2676,7 +2676,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE}, {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"mailto:\"acco<|>unt@example.com\"",S_OK,FALSE}, {"mailto",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2704,7 +2704,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"test.tes%3C%7C%3Et.com",S_OK,FALSE}, {"test.tes%3C%7C%3Et.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"news:test.tes<|>t.com",S_OK,FALSE}, {"news",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2733,7 +2733,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"test.tes<|>t.com",S_OK,FALSE}, {"test.tes<|>t.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"news:test.tes<|>t.com",S_OK,FALSE}, {"news",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2762,7 +2762,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"test.tes<|>t.com",S_OK,FALSE}, {"test.tes<|>t.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"urn:test.tes<|>t.com",S_OK,FALSE}, {"urn",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2791,7 +2791,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"test.test.com",S_OK,FALSE}, {"test.test.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"news:test.%74%65%73%74.com",S_OK,FALSE}, {"news",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2820,7 +2820,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"test.test.com",S_OK,FALSE}, {"test.test.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"news:test.%74%65%73%74.com",S_OK,FALSE}, {"news",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2849,7 +2849,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"test.%74%65%73%74.com",S_OK,FALSE}, {"test.%74%65%73%74.com",S_OK,TRUE}, - {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, {"urn:test.%74%65%73%74.com",S_OK,FALSE}, {"urn",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2879,7 +2879,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=%xx&return=y",S_OK,TRUE}, - {"?query=%xx&return=y",S_OK,TRUE}, + {"?query=%xx&return=y",S_OK,FALSE}, {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2909,7 +2909,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=%xx&return=y",S_OK,TRUE}, - {"?query=%xx&return=y",S_OK,TRUE}, + {"?query=%xx&return=y",S_OK,FALSE}, {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2939,7 +2939,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=<|>&return=y",S_OK,TRUE}, - {"?query=<|>&return=y",S_OK,TRUE}, + {"?query=<|>&return=y",S_OK,FALSE}, {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2969,7 +2969,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=<|>&return=y",S_OK,TRUE}, - {"?query=<|>&return=y",S_OK,TRUE}, + {"?query=<|>&return=y",S_OK,FALSE}, {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -2999,7 +2999,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=%3C%7C%3E&return=y",S_OK,TRUE}, - {"?query=%3C%7C%3E&return=y",S_OK,TRUE}, + {"?query=%3C%7C%3E&return=y",S_OK,FALSE}, {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -3029,7 +3029,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=<|>&return=y",S_OK,TRUE}, - {"?query=<|>&return=y",S_OK,TRUE}, + {"?query=<|>&return=y",S_OK,FALSE}, {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -3059,7 +3059,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=01&return=y",S_OK,TRUE}, - {"?query=01&return=y",S_OK,TRUE}, + {"?query=01&return=y",S_OK,FALSE}, {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -3089,7 +3089,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=%30%31&return=y",S_OK,TRUE}, - {"?query=%30%31&return=y",S_OK,TRUE}, + {"?query=%30%31&return=y",S_OK,FALSE}, {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE}, {"zip",S_OK,FALSE}, {"",S_FALSE,FALSE}, @@ -3119,7 +3119,7 @@ static const uri_properties uri_tests[] = { {"",S_FALSE,FALSE}, {"/",S_OK,FALSE}, {"/?query=%30%31&return=y",S_OK,TRUE}, - {"?query=%30%31&return=y",S_OK,TRUE}, + {"?query=%30%31&return=y",S_OK,FALSE}, {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE}, {"http",S_OK,FALSE}, {"",S_FALSE,FALSE}, diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 0469afbdcb4..54d9dfefdcd 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -3014,6 +3014,19 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST hres = E_OUTOFMEMORY; break; + case Uri_PROPERTY_QUERY: + if(This->query_start > -1) { + *pbstrProperty = SysAllocStringLen(This->canon_uri+This->query_start, This->query_len); + hres = S_OK; + } else { + *pbstrProperty = SysAllocStringLen(NULL, 0); + hres = S_FALSE; + } + + if(!(*pbstrProperty)) + hres = E_OUTOFMEMORY; + + break; case Uri_PROPERTY_RAW_URI: *pbstrProperty = SysAllocString(This->raw_uri); if(!(*pbstrProperty)) @@ -3135,6 +3148,10 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D *pcchProperty = This->path_len; hres = (This->path_start > -1) ? S_OK : S_FALSE; break; + case Uri_PROPERTY_QUERY: + *pcchProperty = This->query_len; + hres = (This->query_start > -1) ? S_OK : S_FALSE; + break; case Uri_PROPERTY_RAW_URI: *pcchProperty = SysStringLen(This->raw_uri); hres = S_OK; @@ -3304,13 +3321,8 @@ static HRESULT WINAPI Uri_GetPathAndQuery(IUri *iface, BSTR *pstrPathAndQuery) static HRESULT WINAPI Uri_GetQuery(IUri *iface, BSTR *pstrQuery) { - Uri *This = URI_THIS(iface); - FIXME("(%p)->(%p)\n", This, pstrQuery); - - if(!pstrQuery) - return E_POINTER; - - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", iface, pstrQuery); + return Uri_GetPropertyBSTR(iface, Uri_PROPERTY_QUERY, pstrQuery, 0); } static HRESULT WINAPI Uri_GetRawUri(IUri *iface, BSTR *pstrRawUri) -- 2.11.4.GIT