From: Elizabeth zfigura@codeweavers.com
This was added for native inetcpl, which is not redistributable or generally valuable.
It's not even present in modern Windows—the export exists, but can't actually be called, since it forwards to a "shunimpl.dll" which fails to initialize when loaded. --- dlls/shdocvw/shdocvw.spec | 4 +- dlls/shdocvw/shdocvw_main.c | 95 ----------------- dlls/shdocvw/tests/shdocvw.c | 192 ----------------------------------- 3 files changed, 2 insertions(+), 289 deletions(-)
diff --git a/dlls/shdocvw/shdocvw.spec b/dlls/shdocvw/shdocvw.spec index aa1b5e0c969..c8afffba8b1 100644 --- a/dlls/shdocvw/shdocvw.spec +++ b/dlls/shdocvw/shdocvw.spec @@ -49,8 +49,8 @@ 164 stdcall -noname ResetProfileSharing(long) 165 stub -noname URLSubstitution 167 stub -noname IsIEDefaultBrowser -169 stdcall -noname ParseURLFromOutsideSourceA(str ptr ptr ptr) -170 stdcall -noname ParseURLFromOutsideSourceW(wstr ptr ptr ptr) +169 stub -noname ParseURLFromOutsideSourceA(str ptr ptr ptr) +170 stub -noname ParseURLFromOutsideSourceW(wstr ptr ptr ptr) 171 stub -noname _DeletePidlDPA 172 stub -noname IURLQualify 173 stub -noname SHIsRestricted diff --git a/dlls/shdocvw/shdocvw_main.c b/dlls/shdocvw/shdocvw_main.c index 6556223e1d7..0a709ca3ed2 100644 --- a/dlls/shdocvw/shdocvw_main.c +++ b/dlls/shdocvw/shdocvw_main.c @@ -333,101 +333,6 @@ HRESULT WINAPI URLSubRegQueryA(LPCSTR regpath, LPCSTR name, DWORD type, return E_FAIL; }
-/****************************************************************** - * ParseURLFromOutsideSourceW (SHDOCVW.170) - */ -DWORD WINAPI ParseURLFromOutsideSourceW(LPCWSTR url, LPWSTR out, LPDWORD plen, LPDWORD unknown) -{ - WCHAR buffer_in[INTERNET_MAX_URL_LENGTH]; - WCHAR buffer_out[INTERNET_MAX_URL_LENGTH]; - LPCWSTR ptr = url; - HRESULT hr; - DWORD needed; - DWORD len; - DWORD res = 0; - - - TRACE("(%s, %p, %p, %p) len: %ld, unknown: 0x%lx\n", debugstr_w(url), out, plen, unknown, - plen ? *plen : 0, unknown ? *unknown : 0); - - if (!PathIsURLW(ptr)) { - len = ARRAY_SIZE(buffer_in); - buffer_in[0] = 0; - hr = UrlApplySchemeW(ptr, buffer_in, &len, URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT); - TRACE("got 0x%lx with %s\n", hr, debugstr_w(buffer_in)); - if (hr == S_OK) { - /* we parsed the url to buffer_in */ - ptr = buffer_in; - } - else - { - FIXME("call search hook for %s\n", debugstr_w(ptr)); - } - } - - len = ARRAY_SIZE(buffer_out); - buffer_out[0] = '\0'; - hr = UrlCanonicalizeW(ptr, buffer_out, &len, URL_ESCAPE_SPACES_ONLY); - needed = lstrlenW(buffer_out)+1; - TRACE("got 0x%lx with %s (need %ld)\n", hr, debugstr_w(buffer_out), needed); - - if (*plen >= needed) { - if (out != NULL) { - lstrcpyW(out, buffer_out); - res++; - } - needed--; - } - - *plen = needed; - - TRACE("=> %ld\n", res); - return res; -} - -/****************************************************************** - * ParseURLFromOutsideSourceA (SHDOCVW.169) - * - * See ParseURLFromOutsideSourceW - */ -DWORD WINAPI ParseURLFromOutsideSourceA(LPCSTR url, LPSTR out, LPDWORD plen, LPDWORD unknown) -{ - WCHAR buffer[INTERNET_MAX_URL_LENGTH]; - LPWSTR urlW = NULL; - DWORD needed; - DWORD res; - DWORD len; - - TRACE("(%s, %p, %p, %p) len: %ld, unknown: 0x%lx\n", debugstr_a(url), out, plen, unknown, - plen ? *plen : 0, unknown ? *unknown : 0); - - if (url) { - len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0); - urlW = malloc(len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len); - } - - len = ARRAY_SIZE(buffer); - ParseURLFromOutsideSourceW(urlW, buffer, &len, unknown); - free(urlW); - - needed = WideCharToMultiByte(CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL); - - res = 0; - if (*plen >= needed) { - if (out != NULL) { - WideCharToMultiByte(CP_ACP, 0, buffer, -1, out, *plen, NULL, NULL); - res = needed; - } - needed--; - } - - *plen = needed; - - TRACE("=> %ld\n", res); - return res; -} - /****************************************************************** * IEParseDisplayNameWithBCW (SHDOCVW.218) */ diff --git a/dlls/shdocvw/tests/shdocvw.c b/dlls/shdocvw/tests/shdocvw.c index fcfd4a644db..1f381253826 100644 --- a/dlls/shdocvw/tests/shdocvw.c +++ b/dlls/shdocvw/tests/shdocvw.c @@ -33,8 +33,6 @@
static HMODULE hshdocvw; static HRESULT (WINAPI *pURLSubRegQueryA)(LPCSTR, LPCSTR, DWORD, LPVOID, DWORD, DWORD); -static DWORD (WINAPI *pParseURLFromOutsideSourceA)(LPCSTR, LPSTR, LPDWORD, LPDWORD); -static DWORD (WINAPI *pParseURLFromOutsideSourceW)(LPCWSTR, LPWSTR, LPDWORD, LPDWORD);
static const char appdata[] = "AppData"; static const char common_appdata[] = "Common AppData"; @@ -44,38 +42,10 @@ static const char regpath_iemain[] = "Software\Microsoft\Internet Explorer\Ma static const char regpath_shellfolders[] = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"; static const char start_page[] = "Start Page";
-/* ################ */ - -static const struct { - const char *url; - const char *newurl; - DWORD len; -} ParseURL_table[] = { - {"http://www.winehq.org", "http://www.winehq.org/", 22}, - {"www.winehq.org", "http://www.winehq.org/", 22}, - {"winehq.org", "http://winehq.org/", 18}, - {"ftp.winehq.org", "ftp://ftp.winehq.org/", 21}, - {"http://winehq.org", "http://winehq.org/", 18}, - {"https://winehq.org", "https://winehq.org/", 19}, - {"https://www.winehq.org", "https://www.winehq.org/", 23}, - {"ftp://winehq.org", "ftp://winehq.org/", 17}, - {"ftp://ftp.winehq.org", "ftp://ftp.winehq.org/", 21}, - {"about:blank", "about:blank", 11}, - {"about:home", "about:home", 10}, - {"about:mozilla", "about:mozilla", 13}, - /* a space at the start is not allowed */ - {" http://www.winehq.org", "http://%20http://www.winehq.org", 31} - -}; - -/* ################ */ - static void init_functions(void) { hshdocvw = LoadLibraryA("shdocvw.dll"); pURLSubRegQueryA = (void *) GetProcAddress(hshdocvw, (LPSTR) 151); - pParseURLFromOutsideSourceA = (void *) GetProcAddress(hshdocvw, (LPSTR) 169); - pParseURLFromOutsideSourceW = (void *) GetProcAddress(hshdocvw, (LPSTR) 170); }
/* ################ */ @@ -191,171 +161,9 @@ static void test_URLSubRegQueryA(void) /* todo: what does the last parameter mean? */ }
-/* ################ */ - -static void test_ParseURLFromOutsideSourceA(void) -{ - CHAR buffer[INTERNET_MAX_URL_LENGTH]; - DWORD dummy; - DWORD maxlen; - DWORD len; - DWORD res; - int i; - - if (!pParseURLFromOutsideSourceA) { - skip("ParseURLFromOutsideSourceA not found\n"); - return; - } - - for(i = 0; i < ARRAY_SIZE(ParseURL_table); i++) { - memset(buffer, '#', sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = '\0'; - len = sizeof(buffer); - dummy = 0; - /* on success, len+1 is returned. No idea, if someone depend on this */ - res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, &len, &dummy); - /* len does not include the terminating 0, when buffer is large enough */ - ok( res != 0 && len == ParseURL_table[i].len && - !lstrcmpA(buffer, ParseURL_table[i].newurl), - "#%d: got %ld and %ld with '%s' (expected '!=0' and %ld with '%s')\n", - i, res, len, buffer, ParseURL_table[i].len, ParseURL_table[i].newurl); - - - /* use the size test only for the first examples */ - if (i > 4) continue; - - maxlen = len; - - memset(buffer, '#', sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = '\0'; - len = maxlen + 1; - dummy = 0; - res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, &len, &dummy); - ok( res != 0 && len == ParseURL_table[i].len && - !lstrcmpA(buffer, ParseURL_table[i].newurl), - "#%d (+1): got %ld and %ld with '%s' (expected '!=0' and %ld with '%s')\n", - i, res, len, buffer, ParseURL_table[i].len, ParseURL_table[i].newurl); - - memset(buffer, '#', sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = '\0'; - len = maxlen; - dummy = 0; - res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, &len, &dummy); - /* len includes the terminating 0, when the buffer is too small */ - ok( res == 0 && len == ParseURL_table[i].len + 1, - "#%d (==): got %ld and %ld (expected '0' and %ld)\n", - i, res, len, ParseURL_table[i].len + 1); - - memset(buffer, '#', sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = '\0'; - len = maxlen-1; - dummy = 0; - res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, &len, &dummy); - /* len includes the terminating 0 on XP SP1 and before, when the buffer is too small */ - ok( res == 0 && (len == ParseURL_table[i].len || len == ParseURL_table[i].len + 1), - "#%d (-1): got %ld and %ld (expected '0' and %ld or %ld)\n", - i, res, len, ParseURL_table[i].len, ParseURL_table[i].len + 1); - - memset(buffer, '#', sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = '\0'; - len = maxlen+1; - dummy = 0; - res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, NULL, &len, &dummy); - /* len does not include the terminating 0, when buffer is NULL */ - ok( res == 0 && len == ParseURL_table[i].len, - "#%d (buffer): got %ld and %ld (expected '0' and %ld)\n", - i, res, len, ParseURL_table[i].len); - - if (0) { - /* that test crash on native shdocvw */ - pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, NULL, &dummy); - } - - memset(buffer, '#', sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = '\0'; - len = maxlen+1; - dummy = 0; - res = pParseURLFromOutsideSourceA(ParseURL_table[i].url, buffer, &len, NULL); - ok( res != 0 && len == ParseURL_table[i].len && - !lstrcmpA(buffer, ParseURL_table[i].newurl), - "#%d (unknown): got %ld and %ld with '%s' (expected '!=0' and %ld with '%s')\n", - i, res, len, buffer, ParseURL_table[i].len, ParseURL_table[i].newurl); - } -} - -/* ################ */ - -static void test_ParseURLFromOutsideSourceW(void) -{ - WCHAR urlW[INTERNET_MAX_URL_LENGTH]; - WCHAR bufferW[INTERNET_MAX_URL_LENGTH]; - CHAR bufferA[INTERNET_MAX_URL_LENGTH]; - DWORD maxlen; - DWORD dummy; - DWORD len; - DWORD res; - - if (!pParseURLFromOutsideSourceW) { - skip("ParseURLFromOutsideSourceW not found\n"); - return; - } - MultiByteToWideChar(CP_ACP, 0, ParseURL_table[0].url, -1, urlW, INTERNET_MAX_URL_LENGTH); - - memset(bufferA, '#', sizeof(bufferA)-1); - bufferA[sizeof(bufferA) - 1] = '\0'; - MultiByteToWideChar(CP_ACP, 0, bufferA, -1, bufferW, INTERNET_MAX_URL_LENGTH); - - /* len is in characters */ - len = ARRAY_SIZE(bufferW); - dummy = 0; - res = pParseURLFromOutsideSourceW(urlW, bufferW, &len, &dummy); - WideCharToMultiByte(CP_ACP, 0, bufferW, -1, bufferA, sizeof(bufferA), NULL, NULL); - ok( res != 0 && len == ParseURL_table[0].len && - !lstrcmpA(bufferA, ParseURL_table[0].newurl), - "got %ld and %ld with '%s' (expected '!=0' and %ld with '%s')\n", - res, len, bufferA, ParseURL_table[0].len, ParseURL_table[0].newurl); - - - maxlen = len; - - memset(bufferA, '#', sizeof(bufferA)-1); - bufferA[sizeof(bufferA) - 1] = '\0'; - MultiByteToWideChar(CP_ACP, 0, bufferA, -1, bufferW, INTERNET_MAX_URL_LENGTH); - len = maxlen+1; - dummy = 0; - res = pParseURLFromOutsideSourceW(urlW, bufferW, &len, &dummy); - WideCharToMultiByte(CP_ACP, 0, bufferW, -1, bufferA, sizeof(bufferA), NULL, NULL); - /* len does not include the terminating 0, when buffer is large enough */ - ok( res != 0 && len == ParseURL_table[0].len && - !lstrcmpA(bufferA, ParseURL_table[0].newurl), - "+1: got %ld and %ld with '%s' (expected '!=0' and %ld with '%s')\n", - res, len, bufferA, ParseURL_table[0].len, ParseURL_table[0].newurl); - - len = maxlen; - dummy = 0; - res = pParseURLFromOutsideSourceW(urlW, bufferW, &len, &dummy); - /* len includes the terminating 0, when the buffer is too small */ - ok( res == 0 && len == ParseURL_table[0].len + 1, - "==: got %ld and %ld (expected '0' and %ld)\n", - res, len, ParseURL_table[0].len + 1); - - len = maxlen - 1; - dummy = 0; - res = pParseURLFromOutsideSourceW(urlW, bufferW, &len, &dummy); - /* len includes the terminating 0 on XP SP1 and before, when the buffer is too small */ - ok( res == 0 && (len == ParseURL_table[0].len || len == ParseURL_table[0].len + 1), - "-1: got %ld and %ld (expected '0' and %ld or %ld)\n", - res, len, ParseURL_table[0].len, ParseURL_table[0].len + 1); - -} - -/* ################ */ - START_TEST(shdocvw) { init_functions(); test_URLSubRegQueryA(); - test_ParseURLFromOutsideSourceA(); - test_ParseURLFromOutsideSourceW(); FreeLibrary(hshdocvw); }