mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 07:46:29 +00:00
[SHLWAPI]
* Sync with Wine 1.5.26. svn path=/trunk/; revision=58600
This commit is contained in:
parent
66fc8a9d5a
commit
aa6e6ab600
10 changed files with 193 additions and 75 deletions
|
@ -531,7 +531,7 @@ HRESULT WINAPI SHCreateStreamOnFileA(LPCSTR lpszPath, DWORD dwMode,
|
||||||
if (!lpszPath)
|
if (!lpszPath)
|
||||||
return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND);
|
return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND);
|
||||||
|
|
||||||
MultiByteToWideChar(0, 0, lpszPath, -1, szPath, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, szPath, MAX_PATH);
|
||||||
return SHCreateStreamOnFileW(szPath, dwMode, lppStream);
|
return SHCreateStreamOnFileW(szPath, dwMode, lppStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -641,25 +641,6 @@ INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax)
|
||||||
return iLen;
|
return iLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* @ [SHLWAPI.29]
|
|
||||||
*
|
|
||||||
* Determine if a Unicode character is a space.
|
|
||||||
*
|
|
||||||
* PARAMS
|
|
||||||
* wc [I] Character to check.
|
|
||||||
*
|
|
||||||
* RETURNS
|
|
||||||
* TRUE, if wc is a space,
|
|
||||||
* FALSE otherwise.
|
|
||||||
*/
|
|
||||||
BOOL WINAPI IsCharSpaceW(WCHAR wc)
|
|
||||||
{
|
|
||||||
WORD CharType;
|
|
||||||
|
|
||||||
return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_SPACE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* @ [SHLWAPI.30]
|
* @ [SHLWAPI.30]
|
||||||
*
|
*
|
||||||
|
@ -2680,7 +2661,7 @@ DWORD WINAPI SHGetRestriction(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpVal
|
||||||
lpSubKey = strRegistryPolicyW;
|
lpSubKey = strRegistryPolicyW;
|
||||||
|
|
||||||
retval = RegOpenKeyW(HKEY_LOCAL_MACHINE, lpSubKey, &hKey);
|
retval = RegOpenKeyW(HKEY_LOCAL_MACHINE, lpSubKey, &hKey);
|
||||||
if (retval != ERROR_SUCCESS)
|
if (retval != ERROR_SUCCESS)
|
||||||
retval = RegOpenKeyW(HKEY_CURRENT_USER, lpSubKey, &hKey);
|
retval = RegOpenKeyW(HKEY_CURRENT_USER, lpSubKey, &hKey);
|
||||||
if (retval != ERROR_SUCCESS)
|
if (retval != ERROR_SUCCESS)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2728,7 +2709,7 @@ DWORD WINAPI SHRestrictionLookup(
|
||||||
/* we have a known policy */
|
/* we have a known policy */
|
||||||
|
|
||||||
/* check if this policy has been cached */
|
/* check if this policy has been cached */
|
||||||
if (*polArr == SHELL_NO_POLICY)
|
if (*polArr == SHELL_NO_POLICY)
|
||||||
*polArr = SHGetRestriction(initial, polTable->appstr, polTable->keystr);
|
*polArr = SHGetRestriction(initial, polTable->appstr, polTable->keystr);
|
||||||
return *polArr;
|
return *polArr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3246,6 +3246,9 @@ HRESULT WINAPI PathCreateFromUrlA(LPCSTR pszUrl, LPSTR pszPath,
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
DWORD lenW = sizeof(bufW)/sizeof(WCHAR), lenA;
|
DWORD lenW = sizeof(bufW)/sizeof(WCHAR), lenA;
|
||||||
|
|
||||||
|
if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if(!RtlCreateUnicodeStringFromAsciiz(&urlW, pszUrl))
|
if(!RtlCreateUnicodeStringFromAsciiz(&urlW, pszUrl))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
if((ret = PathCreateFromUrlW(urlW.Buffer, pathW, &lenW, dwReserved)) == E_POINTER) {
|
if((ret = PathCreateFromUrlW(urlW.Buffer, pathW, &lenW, dwReserved)) == E_POINTER) {
|
||||||
|
@ -3287,61 +3290,156 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath,
|
||||||
LPDWORD pcchPath, DWORD dwReserved)
|
LPDWORD pcchPath, DWORD dwReserved)
|
||||||
{
|
{
|
||||||
static const WCHAR file_colon[] = { 'f','i','l','e',':',0 };
|
static const WCHAR file_colon[] = { 'f','i','l','e',':',0 };
|
||||||
HRESULT hr;
|
static const WCHAR localhost[] = { 'l','o','c','a','l','h','o','s','t',0 };
|
||||||
DWORD nslashes = 0;
|
DWORD nslashes, unescape, len;
|
||||||
WCHAR *ptr;
|
const WCHAR *src;
|
||||||
|
WCHAR *tpath, *dst;
|
||||||
|
HRESULT ret;
|
||||||
|
|
||||||
TRACE("(%s,%p,%p,0x%08x)\n", debugstr_w(pszUrl), pszPath, pcchPath, dwReserved);
|
TRACE("(%s,%p,%p,0x%08x)\n", debugstr_w(pszUrl), pszPath, pcchPath, dwReserved);
|
||||||
|
|
||||||
if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
|
if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
if (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
|
||||||
if (strncmpW(pszUrl, file_colon, 5))
|
file_colon, 5) != CSTR_EQUAL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
pszUrl += 5;
|
pszUrl += 5;
|
||||||
|
ret = S_OK;
|
||||||
|
|
||||||
while(*pszUrl == '/' || *pszUrl == '\\') {
|
src = pszUrl;
|
||||||
|
nslashes = 0;
|
||||||
|
while (*src == '/' || *src == '\\') {
|
||||||
nslashes++;
|
nslashes++;
|
||||||
pszUrl++;
|
src++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isalphaW(*pszUrl) && (pszUrl[1] == ':' || pszUrl[1] == '|') && (pszUrl[2] == '/' || pszUrl[2] == '\\'))
|
/* We need a temporary buffer so we can compute what size to ask for.
|
||||||
nslashes = 0;
|
* We know that the final string won't be longer than the current pszUrl
|
||||||
|
* plus at most two backslashes. All the other transformations make it
|
||||||
|
* shorter.
|
||||||
|
*/
|
||||||
|
len = 2 + lstrlenW(pszUrl) + 1;
|
||||||
|
if (*pcchPath < len)
|
||||||
|
tpath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
|
else
|
||||||
|
tpath = pszPath;
|
||||||
|
|
||||||
switch(nslashes) {
|
len = 0;
|
||||||
case 2:
|
dst = tpath;
|
||||||
pszUrl -= 2;
|
unescape = 1;
|
||||||
break;
|
switch (nslashes)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
/* 'file:' + escaped DOS path */
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
/* 'file:/' + escaped DOS path */
|
||||||
|
/* fall through */
|
||||||
|
case 3:
|
||||||
|
/* 'file:///' (implied localhost) + escaped DOS path */
|
||||||
|
if (!isalphaW(*src) || (src[1] != ':' && src[1] != '|'))
|
||||||
|
src -= 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, src, 9,
|
||||||
|
localhost, 9) == CSTR_EQUAL &&
|
||||||
|
(src[9] == '/' || src[9] == '\\'))
|
||||||
|
{
|
||||||
|
/* 'file://localhost/' + escaped DOS path */
|
||||||
|
src += 10;
|
||||||
|
}
|
||||||
|
else if (isalphaW(*src) && (src[1] == ':' || src[1] == '|'))
|
||||||
|
{
|
||||||
|
/* 'file://' + unescaped DOS path */
|
||||||
|
unescape = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* 'file://hostname:port/path' (where path is escaped)
|
||||||
|
* or 'file:' + escaped UNC path (\\server\share\path)
|
||||||
|
* The second form is clearly specific to Windows and it might
|
||||||
|
* even be doing a network lookup to try to figure it out.
|
||||||
|
*/
|
||||||
|
while (*src && *src != '/' && *src != '\\')
|
||||||
|
src++;
|
||||||
|
len = src - pszUrl;
|
||||||
|
StrCpyNW(dst, pszUrl, len + 1);
|
||||||
|
dst += len;
|
||||||
|
if (isalphaW(src[1]) && (src[2] == ':' || src[2] == '|'))
|
||||||
|
{
|
||||||
|
/* 'Forget' to add a trailing '/', just like Windows */
|
||||||
|
src++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
/* 'file://' + unescaped UNC path (\\server\share\path) */
|
||||||
|
unescape = 0;
|
||||||
|
if (isalphaW(*src) && (src[1] == ':' || src[1] == '|'))
|
||||||
|
break;
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
pszUrl -= 1;
|
/* 'file:/...' + escaped UNC path (\\server\share\path) */
|
||||||
break;
|
src -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = UrlUnescapeW((LPWSTR)pszUrl, pszPath, pcchPath, 0);
|
/* Copy the remainder of the path */
|
||||||
if(hr != S_OK) return hr;
|
len += lstrlenW(src);
|
||||||
|
StrCpyW(dst, src);
|
||||||
|
|
||||||
for(ptr = pszPath; *ptr; ptr++)
|
/* First do the Windows-specific path conversions */
|
||||||
if(*ptr == '/') *ptr = '\\';
|
for (dst = tpath; *dst; dst++)
|
||||||
|
if (*dst == '/') *dst = '\\';
|
||||||
|
if (isalphaW(*tpath) && tpath[1] == '|')
|
||||||
|
tpath[1] = ':'; /* c| -> c: */
|
||||||
|
|
||||||
while(*pszPath == '\\')
|
/* And only then unescape the path (i.e. escaped slashes are left as is) */
|
||||||
pszPath++;
|
if (unescape)
|
||||||
|
{
|
||||||
if(isalphaW(*pszPath) && pszPath[1] == '|' && pszPath[2] == '\\') /* c|\ -> c:\ */
|
ret = UrlUnescapeW(tpath, NULL, &len, URL_UNESCAPE_INPLACE);
|
||||||
pszPath[1] = ':';
|
if (ret == S_OK)
|
||||||
|
{
|
||||||
if(nslashes == 2 && (ptr = strchrW(pszPath, '\\'))) { /* \\host\c:\ -> \\hostc:\ */
|
/* When working in-place UrlUnescapeW() does not set len */
|
||||||
ptr++;
|
len = lstrlenW(tpath);
|
||||||
if(isalphaW(*ptr) && (ptr[1] == ':' || ptr[1] == '|') && ptr[2] == '\\') {
|
|
||||||
memmove(ptr - 1, ptr, (strlenW(ptr) + 1) * sizeof(WCHAR));
|
|
||||||
(*pcchPath)--;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Returning %s\n",debugstr_w(pszPath));
|
if (*pcchPath < len + 1)
|
||||||
|
{
|
||||||
|
ret = E_POINTER;
|
||||||
|
*pcchPath = len + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*pcchPath = len;
|
||||||
|
if (tpath != pszPath)
|
||||||
|
StrCpyW(pszPath, tpath);
|
||||||
|
}
|
||||||
|
if (tpath != pszPath)
|
||||||
|
HeapFree(GetProcessHeap(), 0, tpath);
|
||||||
|
|
||||||
|
TRACE("Returning (%u) %s\n", *pcchPath, debugstr_w(pszPath));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* PathCreateFromUrlAlloc [SHLWAPI.@]
|
||||||
|
*/
|
||||||
|
HRESULT WINAPI PathCreateFromUrlAlloc(LPCWSTR pszUrl, LPWSTR *pszPath,
|
||||||
|
DWORD dwReserved)
|
||||||
|
{
|
||||||
|
WCHAR pathW[MAX_PATH];
|
||||||
|
DWORD size;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
hr = PathCreateFromUrlW(pszUrl, pathW, &size, dwReserved);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
/* Yes, this is supposed to crash if pszPath is NULL */
|
||||||
|
*pszPath = StrDupW(pathW);
|
||||||
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2232,7 +2232,7 @@ DWORD WINAPI SHCopyKeyA(HKEY hKeySrc, LPCSTR lpszSrcSubKey, HKEY hKeyDst, DWORD
|
||||||
TRACE("(hkey=%p,%s,%p08x,%d)\n", hKeySrc, debugstr_a(lpszSrcSubKey), hKeyDst, dwReserved);
|
TRACE("(hkey=%p,%s,%p08x,%d)\n", hKeySrc, debugstr_a(lpszSrcSubKey), hKeyDst, dwReserved);
|
||||||
|
|
||||||
if (lpszSrcSubKey)
|
if (lpszSrcSubKey)
|
||||||
MultiByteToWideChar(0, 0, lpszSrcSubKey, -1, szSubKeyW, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, lpszSrcSubKey, -1, szSubKeyW, MAX_PATH);
|
||||||
|
|
||||||
return SHCopyKeyW(hKeySrc, lpszSrcSubKey ? szSubKeyW : NULL, hKeyDst, dwReserved);
|
return SHCopyKeyW(hKeySrc, lpszSrcSubKey ? szSubKeyW : NULL, hKeyDst, dwReserved);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Top level resource file for shlwapi
|
* Resources for shlwapi
|
||||||
*
|
*
|
||||||
* Copyright 2004 Jon Griffiths
|
* Copyright 2004 Jon Griffiths
|
||||||
*
|
*
|
||||||
|
|
|
@ -566,6 +566,8 @@
|
||||||
@ stdcall HashData (ptr long ptr long)
|
@ stdcall HashData (ptr long ptr long)
|
||||||
@ stdcall IntlStrEqWorkerA(long str str long) StrIsIntlEqualA
|
@ stdcall IntlStrEqWorkerA(long str str long) StrIsIntlEqualA
|
||||||
@ stdcall IntlStrEqWorkerW(long wstr wstr long) StrIsIntlEqualW
|
@ stdcall IntlStrEqWorkerW(long wstr wstr long) StrIsIntlEqualW
|
||||||
|
@ stdcall IsCharSpaceA(long)
|
||||||
|
@ stdcall IsInternetESCEnabled()
|
||||||
@ stdcall PathAddBackslashA (str)
|
@ stdcall PathAddBackslashA (str)
|
||||||
@ stdcall PathAddBackslashW (wstr)
|
@ stdcall PathAddBackslashW (wstr)
|
||||||
@ stdcall PathAddExtensionA (str str)
|
@ stdcall PathAddExtensionA (str str)
|
||||||
|
@ -586,6 +588,7 @@
|
||||||
@ stdcall PathCompactPathW(long wstr long)
|
@ stdcall PathCompactPathW(long wstr long)
|
||||||
@ stdcall PathCreateFromUrlA(str ptr ptr long)
|
@ stdcall PathCreateFromUrlA(str ptr ptr long)
|
||||||
@ stdcall PathCreateFromUrlW(wstr ptr ptr long)
|
@ stdcall PathCreateFromUrlW(wstr ptr ptr long)
|
||||||
|
@ stdcall PathCreateFromUrlAlloc(wstr ptr long)
|
||||||
@ stdcall PathFileExistsA (str)
|
@ stdcall PathFileExistsA (str)
|
||||||
@ stdcall PathFileExistsW (wstr)
|
@ stdcall PathFileExistsW (wstr)
|
||||||
@ stdcall PathFindExtensionA (str)
|
@ stdcall PathFindExtensionA (str)
|
||||||
|
|
|
@ -1891,7 +1891,7 @@ HRESULT WINAPI SHStrDupA(LPCSTR lpszStr, LPWSTR * lppszDest)
|
||||||
|
|
||||||
if (lpszStr)
|
if (lpszStr)
|
||||||
{
|
{
|
||||||
len = MultiByteToWideChar(0, 0, lpszStr, -1, 0, 0) * sizeof(WCHAR);
|
len = MultiByteToWideChar(CP_ACP, 0, lpszStr, -1, NULL, 0) * sizeof(WCHAR);
|
||||||
*lppszDest = CoTaskMemAlloc(len);
|
*lppszDest = CoTaskMemAlloc(len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1899,7 +1899,7 @@ HRESULT WINAPI SHStrDupA(LPCSTR lpszStr, LPWSTR * lppszDest)
|
||||||
|
|
||||||
if (*lppszDest)
|
if (*lppszDest)
|
||||||
{
|
{
|
||||||
MultiByteToWideChar(0, 0, lpszStr, -1, *lppszDest, len/sizeof(WCHAR));
|
MultiByteToWideChar(CP_ACP, 0, lpszStr, -1, *lppszDest, len/sizeof(WCHAR));
|
||||||
hRet = S_OK;
|
hRet = S_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2828,3 +2828,28 @@ end:
|
||||||
HeapFree(GetProcessHeap(), 0, dllname);
|
HeapFree(GetProcessHeap(), 0, dllname);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI IsCharSpaceA(CHAR c)
|
||||||
|
{
|
||||||
|
WORD CharType;
|
||||||
|
return GetStringTypeA(GetSystemDefaultLCID(), CT_CTYPE1, &c, 1, &CharType) && (CharType & C1_SPACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* @ [SHLWAPI.29]
|
||||||
|
*
|
||||||
|
* Determine if a Unicode character is a space.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* wc [I] Character to check.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE, if wc is a space,
|
||||||
|
* FALSE otherwise.
|
||||||
|
*/
|
||||||
|
BOOL WINAPI IsCharSpaceW(WCHAR wc)
|
||||||
|
{
|
||||||
|
WORD CharType;
|
||||||
|
|
||||||
|
return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_SPACE);
|
||||||
|
}
|
||||||
|
|
|
@ -534,7 +534,7 @@ HANDLE WINAPI SHGlobalCounterCreateNamedA(LPCSTR lpszName, DWORD iInitial)
|
||||||
TRACE("(%s,%d)\n", debugstr_a(lpszName), iInitial);
|
TRACE("(%s,%d)\n", debugstr_a(lpszName), iInitial);
|
||||||
|
|
||||||
if (lpszName)
|
if (lpszName)
|
||||||
MultiByteToWideChar(0, 0, lpszName, -1, szBuff, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, lpszName, -1, szBuff, MAX_PATH);
|
||||||
return SHGlobalCounterCreateNamedW(lpszName ? szBuff : NULL, iInitial);
|
return SHGlobalCounterCreateNamedW(lpszName ? szBuff : NULL, iInitial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,8 +270,8 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized,
|
||||||
|
|
||||||
ret = UrlCanonicalizeW(url, canonical, pcchCanonicalized, dwFlags);
|
ret = UrlCanonicalizeW(url, canonical, pcchCanonicalized, dwFlags);
|
||||||
if(ret == S_OK)
|
if(ret == S_OK)
|
||||||
WideCharToMultiByte(0, 0, canonical, -1, pszCanonicalized,
|
WideCharToMultiByte(CP_ACP, 0, canonical, -1, pszCanonicalized,
|
||||||
*pcchCanonicalized+1, 0, 0);
|
*pcchCanonicalized+1, NULL, NULL);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, url);
|
HeapFree(GetProcessHeap(), 0, url);
|
||||||
HeapFree(GetProcessHeap(), 0, canonical);
|
HeapFree(GetProcessHeap(), 0, canonical);
|
||||||
|
@ -631,8 +631,8 @@ HRESULT WINAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative,
|
||||||
relative = base + INTERNET_MAX_URL_LENGTH;
|
relative = base + INTERNET_MAX_URL_LENGTH;
|
||||||
combined = relative + INTERNET_MAX_URL_LENGTH;
|
combined = relative + INTERNET_MAX_URL_LENGTH;
|
||||||
|
|
||||||
MultiByteToWideChar(0, 0, pszBase, -1, base, INTERNET_MAX_URL_LENGTH);
|
MultiByteToWideChar(CP_ACP, 0, pszBase, -1, base, INTERNET_MAX_URL_LENGTH);
|
||||||
MultiByteToWideChar(0, 0, pszRelative, -1, relative, INTERNET_MAX_URL_LENGTH);
|
MultiByteToWideChar(CP_ACP, 0, pszRelative, -1, relative, INTERNET_MAX_URL_LENGTH);
|
||||||
len = *pcchCombined;
|
len = *pcchCombined;
|
||||||
|
|
||||||
ret = UrlCombineW(base, relative, pszCombined?combined:NULL, &len, dwFlags);
|
ret = UrlCombineW(base, relative, pszCombined?combined:NULL, &len, dwFlags);
|
||||||
|
@ -642,14 +642,14 @@ HRESULT WINAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
len2 = WideCharToMultiByte(0, 0, combined, len, 0, 0, 0, 0);
|
len2 = WideCharToMultiByte(CP_ACP, 0, combined, len, NULL, 0, NULL, NULL);
|
||||||
if (len2 > *pcchCombined) {
|
if (len2 > *pcchCombined) {
|
||||||
*pcchCombined = len2;
|
*pcchCombined = len2;
|
||||||
HeapFree(GetProcessHeap(), 0, base);
|
HeapFree(GetProcessHeap(), 0, base);
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
}
|
}
|
||||||
WideCharToMultiByte(0, 0, combined, len+1, pszCombined, (*pcchCombined)+1,
|
WideCharToMultiByte(CP_ACP, 0, combined, len+1, pszCombined, (*pcchCombined)+1,
|
||||||
0, 0);
|
NULL, NULL);
|
||||||
*pcchCombined = len2;
|
*pcchCombined = len2;
|
||||||
HeapFree(GetProcessHeap(), 0, base);
|
HeapFree(GetProcessHeap(), 0, base);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -1601,7 +1601,7 @@ HRESULT WINAPI UrlHashW(LPCWSTR pszUrl, unsigned char *lpDest, DWORD nDestLen)
|
||||||
/* Win32 hashes the data as an ASCII string, presumably so that both A+W
|
/* Win32 hashes the data as an ASCII string, presumably so that both A+W
|
||||||
* return the same digests for the same URL.
|
* return the same digests for the same URL.
|
||||||
*/
|
*/
|
||||||
WideCharToMultiByte(0, 0, pszUrl, -1, szUrl, MAX_PATH, 0, 0);
|
WideCharToMultiByte(CP_ACP, 0, pszUrl, -1, szUrl, MAX_PATH, NULL, NULL);
|
||||||
HashData((const BYTE*)szUrl, (int)strlen(szUrl), lpDest, nDestLen);
|
HashData((const BYTE*)szUrl, (int)strlen(szUrl), lpDest, nDestLen);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -1670,7 +1670,7 @@ static HRESULT URL_GuessScheme(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut)
|
||||||
WCHAR value[MAX_PATH], data[MAX_PATH];
|
WCHAR value[MAX_PATH], data[MAX_PATH];
|
||||||
WCHAR Wxx, Wyy;
|
WCHAR Wxx, Wyy;
|
||||||
|
|
||||||
MultiByteToWideChar(0, 0,
|
MultiByteToWideChar(CP_ACP, 0,
|
||||||
"Software\\Microsoft\\Windows\\CurrentVersion\\URL\\Prefixes",
|
"Software\\Microsoft\\Windows\\CurrentVersion\\URL\\Prefixes",
|
||||||
-1, reg_path, MAX_PATH);
|
-1, reg_path, MAX_PATH);
|
||||||
RegOpenKeyExW(HKEY_LOCAL_MACHINE, reg_path, 0, 1, &newkey);
|
RegOpenKeyExW(HKEY_LOCAL_MACHINE, reg_path, 0, 1, &newkey);
|
||||||
|
@ -1868,7 +1868,8 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case URLIS_FILEURL:
|
case URLIS_FILEURL:
|
||||||
return !StrCmpNA("file:", pszUrl, 5);
|
return (CompareStringA(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
|
||||||
|
"file:", 5) == CSTR_EQUAL);
|
||||||
|
|
||||||
case URLIS_DIRECTORY:
|
case URLIS_DIRECTORY:
|
||||||
last = pszUrl + strlen(pszUrl) - 1;
|
last = pszUrl + strlen(pszUrl) - 1;
|
||||||
|
@ -1893,7 +1894,7 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
|
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
|
||||||
{
|
{
|
||||||
static const WCHAR stemp[] = { 'f','i','l','e',':',0 };
|
static const WCHAR file_colon[] = { 'f','i','l','e',':',0 };
|
||||||
PARSEDURLW base;
|
PARSEDURLW base;
|
||||||
DWORD res1;
|
DWORD res1;
|
||||||
LPCWSTR last;
|
LPCWSTR last;
|
||||||
|
@ -1921,7 +1922,8 @@ BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case URLIS_FILEURL:
|
case URLIS_FILEURL:
|
||||||
return !strncmpW(stemp, pszUrl, 5);
|
return (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
|
||||||
|
file_colon, 5) == CSTR_EQUAL);
|
||||||
|
|
||||||
case URLIS_DIRECTORY:
|
case URLIS_DIRECTORY:
|
||||||
last = pszUrl + strlenW(pszUrl) - 1;
|
last = pszUrl + strlenW(pszUrl) - 1;
|
||||||
|
@ -2199,7 +2201,7 @@ HRESULT WINAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut,
|
||||||
(2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR));
|
(2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR));
|
||||||
out = in + INTERNET_MAX_URL_LENGTH;
|
out = in + INTERNET_MAX_URL_LENGTH;
|
||||||
|
|
||||||
MultiByteToWideChar(0, 0, pszIn, -1, in, INTERNET_MAX_URL_LENGTH);
|
MultiByteToWideChar(CP_ACP, 0, pszIn, -1, in, INTERNET_MAX_URL_LENGTH);
|
||||||
|
|
||||||
len = INTERNET_MAX_URL_LENGTH;
|
len = INTERNET_MAX_URL_LENGTH;
|
||||||
ret = UrlGetPartW(in, out, &len, dwPart, dwFlags);
|
ret = UrlGetPartW(in, out, &len, dwPart, dwFlags);
|
||||||
|
@ -2209,13 +2211,13 @@ HRESULT WINAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
len2 = WideCharToMultiByte(0, 0, out, len, 0, 0, 0, 0);
|
len2 = WideCharToMultiByte(CP_ACP, 0, out, len, NULL, 0, NULL, NULL);
|
||||||
if (len2 > *pcchOut) {
|
if (len2 > *pcchOut) {
|
||||||
*pcchOut = len2+1;
|
*pcchOut = len2+1;
|
||||||
HeapFree(GetProcessHeap(), 0, in);
|
HeapFree(GetProcessHeap(), 0, in);
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
}
|
}
|
||||||
len2 = WideCharToMultiByte(0, 0, out, len+1, pszOut, *pcchOut, 0, 0);
|
len2 = WideCharToMultiByte(CP_ACP, 0, out, len+1, pszOut, *pcchOut, NULL, NULL);
|
||||||
*pcchOut = len2-1;
|
*pcchOut = len2-1;
|
||||||
HeapFree(GetProcessHeap(), 0, in);
|
HeapFree(GetProcessHeap(), 0, in);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2529,7 +2531,7 @@ HRESULT WINAPI MLBuildResURLA(LPCSTR lpszLibName, HMODULE hMod, DWORD dwFlags,
|
||||||
hRet = MLBuildResURLW(lpszLibName ? szLibName : NULL, hMod, dwFlags,
|
hRet = MLBuildResURLW(lpszLibName ? szLibName : NULL, hMod, dwFlags,
|
||||||
lpszRes ? szRes : NULL, lpszDest ? szDest : NULL, dwDestLen);
|
lpszRes ? szRes : NULL, lpszDest ? szDest : NULL, dwDestLen);
|
||||||
if (SUCCEEDED(hRet) && lpszDest)
|
if (SUCCEEDED(hRet) && lpszDest)
|
||||||
WideCharToMultiByte(CP_ACP, 0, szDest, -1, lpszDest, dwDestLen, 0, 0);
|
WideCharToMultiByte(CP_ACP, 0, szDest, -1, lpszDest, dwDestLen, NULL, NULL);
|
||||||
|
|
||||||
return hRet;
|
return hRet;
|
||||||
}
|
}
|
||||||
|
@ -2623,3 +2625,12 @@ HRESULT WINAPI UrlFixupW(LPCWSTR url, LPWSTR translatedUrl, DWORD maxChars)
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* IsInternetESCEnabled [SHLWAPI.@]
|
||||||
|
*/
|
||||||
|
BOOL WINAPI IsInternetESCEnabled(void)
|
||||||
|
{
|
||||||
|
FIXME(": stub\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ reactos/dll/win32/shdoclc # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/shdocvw # Autosync
|
reactos/dll/win32/shdocvw # Autosync
|
||||||
reactos/dll/win32/shell32 # Forked at Wine-20071011
|
reactos/dll/win32/shell32 # Forked at Wine-20071011
|
||||||
reactos/dll/win32/shfolder # Autosync
|
reactos/dll/win32/shfolder # Autosync
|
||||||
reactos/dll/win32/shlwapi # Synced to Wine-1.5.13
|
reactos/dll/win32/shlwapi # Synced to Wine-1.5.26
|
||||||
reactos/dll/win32/slbcsp # Synced to Wine-1.5.19
|
reactos/dll/win32/slbcsp # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/snmpapi # Synced to Wine-1.5.19
|
reactos/dll/win32/snmpapi # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/softpub # Synced to Wine-1.5.19
|
reactos/dll/win32/softpub # Synced to Wine-1.5.19
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue