/* ################ */
static HMODULE hShlwapi;
static HRESULT (WINAPI *pUrlCanonicalizeW)(LPCWSTR, LPWSTR, LPDWORD, DWORD);
+static HRESULT (WINAPI *pUrlApplySchemeA)(LPCSTR,LPSTR,LPDWORD,DWORD);
+static HRESULT (WINAPI *pUrlApplySchemeW)(LPCWSTR,LPWSTR,LPDWORD,DWORD);
static HRESULT (WINAPI *pParseURLA)(LPCSTR,PARSEDURLA*);
static HRESULT (WINAPI *pParseURLW)(LPCWSTR,PARSEDURLW*);
static HRESULT (WINAPI *pHashData)(LPBYTE, DWORD, LPBYTE, DWORD);
DWORD len;
DWORD i;
+ if (!pUrlApplySchemeA) {
+ win_skip("UrlApplySchemeA not found\n");
+ return;
+ }
+
for(i = 0; i < sizeof(TEST_APPLY)/sizeof(TEST_APPLY[0]); i++) {
len = TEST_APPLY_MAX_LENGTH;
lstrcpyA(newurl, untouchedA);
- res = UrlApplySchemeA(TEST_APPLY[i].url, newurl, &len, TEST_APPLY[i].flags);
+ res = pUrlApplySchemeA(TEST_APPLY[i].url, newurl, &len, TEST_APPLY[i].flags);
ok( res == TEST_APPLY[i].res,
"#%dA: got HRESULT 0x%x (expected 0x%x)\n", i, res, TEST_APPLY[i].res);
MultiByteToWideChar(CP_ACP, 0, newurl, -1, newurlW, len);
MultiByteToWideChar(CP_ACP, 0, TEST_APPLY[i].url, -1, urlW, len);
- res = UrlApplySchemeW(urlW, newurlW, &len, TEST_APPLY[i].flags);
+ res = pUrlApplySchemeW(urlW, newurlW, &len, TEST_APPLY[i].flags);
WideCharToMultiByte(CP_ACP, 0, newurlW, -1, newurl, TEST_APPLY_MAX_LENGTH, NULL, NULL);
ok( res == TEST_APPLY[i].res,
"#%dW: got HRESULT 0x%x (expected 0x%x)\n", i, res, TEST_APPLY[i].res);
/* buffer too small */
lstrcpyA(newurl, untouchedA);
len = lstrlenA(TEST_APPLY[0].newurl);
- res = UrlApplySchemeA(TEST_APPLY[0].url, newurl, &len, TEST_APPLY[0].flags);
+ res = pUrlApplySchemeA(TEST_APPLY[0].url, newurl, &len, TEST_APPLY[0].flags);
ok(res == E_POINTER, "got HRESULT 0x%x (expected E_POINTER)\n", res);
/* The returned length include the space for the terminating 0 */
i = lstrlenA(TEST_APPLY[0].newurl)+1;
/* NULL as parameter. The length and the buffer are not modified */
lstrcpyA(newurl, untouchedA);
len = TEST_APPLY_MAX_LENGTH;
- res = UrlApplySchemeA(NULL, newurl, &len, TEST_APPLY[0].flags);
+ res = pUrlApplySchemeA(NULL, newurl, &len, TEST_APPLY[0].flags);
ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res);
ok(len == TEST_APPLY_MAX_LENGTH, "got len %d\n", len);
ok(!lstrcmpA(newurl, untouchedA), "got '%s' (expected '%s')\n", newurl, untouchedA);
len = TEST_APPLY_MAX_LENGTH;
- res = UrlApplySchemeA(TEST_APPLY[0].url, NULL, &len, TEST_APPLY[0].flags);
+ res = pUrlApplySchemeA(TEST_APPLY[0].url, NULL, &len, TEST_APPLY[0].flags);
ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res);
ok(len == TEST_APPLY_MAX_LENGTH, "got len %d\n", len);
lstrcpyA(newurl, untouchedA);
- res = UrlApplySchemeA(TEST_APPLY[0].url, newurl, NULL, TEST_APPLY[0].flags);
+ res = pUrlApplySchemeA(TEST_APPLY[0].url, newurl, NULL, TEST_APPLY[0].flags);
ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res);
ok(!lstrcmpA(newurl, untouchedA), "got '%s' (expected '%s')\n", newurl, untouchedA);
hShlwapi = GetModuleHandleA("shlwapi.dll");
pUrlCanonicalizeW = (void *) GetProcAddress(hShlwapi, "UrlCanonicalizeW");
+ pUrlApplySchemeA = (void *) GetProcAddress(hShlwapi, "UrlApplySchemeA");
+ pUrlApplySchemeW = (void *) GetProcAddress(hShlwapi, "UrlApplySchemeW");
pParseURLA = (void*)GetProcAddress(hShlwapi, (LPCSTR)1);
pParseURLW = (void*)GetProcAddress(hShlwapi, (LPCSTR)2);
pHashData = (void*)GetProcAddress(hShlwapi, "HashData");