From 5f28a6a2d5ec5064144d260ac2e65095b5c48098 Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Wed, 2 Sep 2009 16:38:12 +0100 Subject: [PATCH] shlwapi: Implement stub for UrlFixupW. --- dlls/shlwapi/shlwapi.spec | 2 +- dlls/shlwapi/url.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 158d5e3d45d..4acda495941 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -459,7 +459,7 @@ 459 stdcall -noname SHExpandEnvironmentStringsA(str ptr long) kernel32.ExpandEnvironmentStringsA 460 stdcall -noname SHExpandEnvironmentStringsW(wstr ptr long) kernel32.ExpandEnvironmentStringsW 461 stdcall -noname SHGetAppCompatFlags(long) -462 stub -noname UrlFixupW +462 stdcall -noname UrlFixupW(wstr wstr long) 463 stub -noname SHExpandEnvironmentStringsForUserA 464 stub -noname SHExpandEnvironmentStringsForUserW 465 stub -noname PathUnExpandEnvStringsForUserA diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 64988625bdc..f03129748c4 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -2382,3 +2382,35 @@ HRESULT WINAPI MLBuildResURLW(LPCWSTR lpszLibName, HMODULE hMod, DWORD dwFlags, } return hRet; } + +/*********************************************************************** + * UrlFixupW [SHLWAPI.462] + * + * Checks the scheme part of a URL and attempts to correct misspellings. + * + * PARAMS + * lpszUrl [I] Pointer to the URL to be corrected + * lpszTranslatedUrl [O] Pointer to a buffer to store corrected URL + * dwMaxChars [I] Maximum size of corrected URL + * + * RETURNS + * success: S_OK if URL corrected or already correct + * failure: S_FALSE if unable to correct / COM error code if other error + * + */ +HRESULT WINAPI UrlFixupW(LPCWSTR url, LPWSTR translatedUrl, DWORD maxChars) +{ + DWORD srcLen; + + FIXME("(%s,%p,%d) STUB\n", debugstr_w(url), translatedUrl, maxChars); + + if (!url) + return E_FAIL; + + srcLen = lstrlenW(url); + + /* For now just copy the URL directly */ + lstrcpynW(translatedUrl, url, (maxChars < srcLen) ? maxChars : srcLen); + + return S_OK; +}