Author: akhaldi
Date: Sat Apr 25 10:59:08 2015
New Revision: 67398
URL:
http://svn.reactos.org/svn/reactos?rev=67398&view=rev
Log:
[SHLWAPI] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
trunk/reactos/dll/win32/setupapi/devinst.c
trunk/reactos/dll/win32/shlwapi/ordinal.c
trunk/reactos/dll/win32/shlwapi/path.c
trunk/reactos/dll/win32/shlwapi/string.c
trunk/reactos/dll/win32/shlwapi/url.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/setupapi/devinst.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Sat Apr 25 10:59:08 2015
@@ -661,7 +661,7 @@
* SetupDiBuildClassInfoListExA (SETUPAPI.@)
*
* Returns a list of setup class GUIDs that identify the classes
- * that are installed on a local or remote macine.
+ * that are installed on a local or remote machine.
*
* PARAMS
* Flags [I] control exclusion of classes from the list.
@@ -708,7 +708,7 @@
* SetupDiBuildClassInfoListExW (SETUPAPI.@)
*
* Returns a list of setup class GUIDs that identify the classes
- * that are installed on a local or remote macine.
+ * that are installed on a local or remote machine.
*
* PARAMS
* Flags [I] control exclusion of classes from the list.
@@ -1258,7 +1258,7 @@
* Create an empty DeviceInfoSet list.
*
* PARAMS
- * ClassGuid [I] if not NULL only devices with GUID ClcassGuid are associated
+ * ClassGuid [I] if not NULL only devices with GUID ClassGuid are associated
* with this list.
* hwndParent [I] hwnd needed for interface related actions.
* MachineName [I] name of machine to create emtpy DeviceInfoSet list, if NULL
Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sat Apr 25 10:59:08 2015
@@ -431,7 +431,7 @@
* Success: S_OK. langbuf is set to the language string found.
* Failure: E_FAIL, If any arguments are invalid, error occurred, or Explorer
* does not contain the setting.
- * HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), If the buffer is not big
enough
+ * E_NOT_SUFFICIENT_BUFFER, If the buffer is not big enough
*/
HRESULT WINAPI GetAcceptLanguagesW( LPWSTR langbuf, LPDWORD buflen)
{
@@ -484,7 +484,7 @@
}
*buflen = 0;
- return __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
+ return E_NOT_SUFFICIENT_BUFFER;
}
/*************************************************************************
@@ -5032,11 +5032,8 @@
{
if ((fmt_flags & FDTF_LONGDATE) && (ret < size + 2))
{
- if (ret < size + 2)
- {
- lstrcatW(&buf[ret-1], sep1);
- ret += 2;
- }
+ lstrcatW(&buf[ret-1], sep1);
+ ret += 2;
}
else
{
Modified: trunk/reactos/dll/win32/shlwapi/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Sat Apr 25 10:59:08 2015
@@ -3280,6 +3280,9 @@
if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
return E_INVALIDARG;
+ if (lstrlenW(pszUrl) < 5)
+ return E_INVALIDARG;
+
if (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
file_colon, 5) != CSTR_EQUAL)
return E_INVALIDARG;
@@ -3321,9 +3324,8 @@
src -= 1;
break;
case 2:
- if (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, src, 9,
- localhost, 9) == CSTR_EQUAL &&
- (src[9] == '/' || src[9] == '\\'))
+ if (lstrlenW(src) >= 10 && CompareStringW(LOCALE_INVARIANT,
NORM_IGNORECASE,
+ src, 9, localhost, 9) == CSTR_EQUAL && (src[9] == '/' ||
src[9] == '\\'))
{
/* 'file://localhost/' + escaped DOS path */
src += 10;
@@ -3835,13 +3837,13 @@
WCHAR szSearch[MAX_PATH];
DWORD dwLen;
HANDLE hfind;
- BOOL retVal = FALSE;
+ BOOL retVal = TRUE;
WIN32_FIND_DATAW find_data;
TRACE("(%s)\n",debugstr_w(lpszPath));
if (!lpszPath || !PathIsDirectoryW(lpszPath))
- return FALSE;
+ return FALSE;
lstrcpynW(szSearch, lpszPath, MAX_PATH);
PathAddBackslashW(szSearch);
@@ -3851,14 +3853,23 @@
strcpyW(szSearch + dwLen, szAllFiles);
hfind = FindFirstFileW(szSearch, &find_data);
- if (hfind != INVALID_HANDLE_VALUE)
- {
- if (find_data.cFileName[0] == '.' && find_data.cFileName[1] ==
'.')
- /* The only directory entry should be the parent */
- retVal = !FindNextFileW(hfind, &find_data);
- FindClose(hfind);
- }
-
+ if (hfind == INVALID_HANDLE_VALUE)
+ return FALSE;
+
+ do
+ {
+ if (find_data.cFileName[0] == '.')
+ {
+ if (find_data.cFileName[1] == '\0') continue;
+ if (find_data.cFileName[1] == '.' && find_data.cFileName[2] ==
'\0') continue;
+ }
+
+ retVal = FALSE;
+ break;
+ }
+ while (FindNextFileW(hfind, &find_data));
+
+ FindClose(hfind);
return retVal;
}
Modified: trunk/reactos/dll/win32/shlwapi/string.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] Sat Apr 25 10:59:08 2015
@@ -343,7 +343,7 @@
* PARAMS
* lpszStr [I] First string to compare
* lpszComp [I] Second string to compare
- * iLen [I] Maximum number of chars to compare.
+ * iLen [I] Number of chars to compare
*
* RETURNS
* An integer less than, equal to or greater than 0, indicating that
@@ -374,7 +374,7 @@
* PARAMS
* lpszStr [I] First string to compare
* lpszComp [I] Second string to compare
- * iLen [I] Maximum number of chars to compare.
+ * iLen [I] Number of chars to compare
*
* RETURNS
* An integer less than, equal to or greater than 0, indicating that
@@ -541,13 +541,15 @@
INT (WINAPI *pStrCmpFn)(LPCSTR,LPCSTR,INT))
{
size_t iLen;
+ LPCSTR end;
if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL;
iLen = strlen(lpszSearch);
-
- while (*lpszStr)
+ end = lpszStr + strlen(lpszStr);
+
+ while (lpszStr + iLen <= end)
{
if (!pStrCmpFn(lpszStr, lpszSearch, iLen))
return (LPSTR)lpszStr;
@@ -603,17 +605,13 @@
*/
LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch)
{
+ LPSTR lpszRet = NULL;
WORD ch1, ch2;
INT iLen;
TRACE("(%s,%s)\n", debugstr_a(lpszStr), debugstr_a(lpszSearch));
if (!lpszStr || !lpszSearch || !*lpszSearch)
- return NULL;
-
- if (!lpszEnd)
- lpszEnd = lpszStr + lstrlenA(lpszStr);
- if (lpszEnd == lpszStr)
return NULL;
if (IsDBCSLeadByte(*lpszSearch))
@@ -622,17 +620,22 @@
ch1 = *lpszSearch;
iLen = lstrlenA(lpszSearch);
- do
- {
- lpszEnd = CharPrevA(lpszStr, lpszEnd);
- ch2 = IsDBCSLeadByte(*lpszEnd)? *lpszEnd << 8 | (UCHAR)lpszEnd[1] : *lpszEnd;
+ if (!lpszEnd)
+ lpszEnd = lpszStr + lstrlenA(lpszStr);
+ else /* reproduce the broken behaviour on Windows */
+ lpszEnd += min(iLen - 1, lstrlenA(lpszEnd));
+
+ while (lpszStr + iLen <= lpszEnd && *lpszStr)
+ {
+ ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | (UCHAR)lpszStr[1] : *lpszStr;
if (!ChrCmpIA(ch1, ch2))
{
- if (!StrCmpNIA(lpszEnd, lpszSearch, iLen))
- return (LPSTR)lpszEnd;
- }
- } while (lpszEnd > lpszStr);
- return NULL;
+ if (!StrCmpNIA(lpszStr, lpszSearch, iLen))
+ lpszRet = (LPSTR)lpszStr;
+ }
+ lpszStr = CharNextA(lpszStr);
+ }
+ return lpszRet;
}
/*************************************************************************
@@ -642,6 +645,7 @@
*/
LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch)
{
+ LPWSTR lpszRet = NULL;
INT iLen;
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch));
@@ -649,18 +653,23 @@
if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL;
+ iLen = strlenW(lpszSearch);
+
if (!lpszEnd)
lpszEnd = lpszStr + strlenW(lpszStr);
-
- iLen = strlenW(lpszSearch);
-
- while (lpszEnd > lpszStr)
- {
- lpszEnd--;
- if (!StrCmpNIW(lpszEnd, lpszSearch, iLen))
- return (LPWSTR)lpszEnd;
- }
- return NULL;
+ else /* reproduce the broken behaviour on Windows */
+ lpszEnd += min(iLen - 1, lstrlenW(lpszEnd));
+
+ while (lpszStr + iLen <= lpszEnd && *lpszStr)
+ {
+ if (!ChrCmpIW(*lpszSearch, *lpszStr))
+ {
+ if (!StrCmpNIW(lpszStr, lpszSearch, iLen))
+ lpszRet = (LPWSTR)lpszStr;
+ }
+ lpszStr++;
+ }
+ return lpszRet;
}
/*************************************************************************
@@ -690,6 +699,7 @@
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
{
int iLen;
+ LPCWSTR end;
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch));
@@ -697,8 +707,9 @@
return NULL;
iLen = strlenW(lpszSearch);
-
- while (*lpszStr)
+ end = lpszStr + strlenW(lpszStr);
+
+ while (lpszStr + iLen <= end)
{
if (!StrCmpNIW(lpszStr, lpszSearch, iLen))
return (LPWSTR)lpszStr;
Modified: trunk/reactos/dll/win32/shlwapi/url.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sat Apr 25 10:59:08 2015
@@ -899,7 +899,10 @@
work = preliminary + base.cchProtocol+1+base.cchSuffix - 1;
if (*work++ != '/')
*(work++) = '/';
- strcpyW(work, relative.pszSuffix);
+ if (relative.pszSuffix[0] == '.' && relative.pszSuffix[1] == 0)
+ *work = 0;
+ else
+ strcpyW(work, relative.pszSuffix);
break;
default:
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 25 10:59:08 2015
@@ -180,7 +180,7 @@
reactos/dll/win32/shdocvw # Synced to WineStaging-1.7.37
reactos/dll/win32/shell32 # Forked at Wine-20071011
reactos/dll/win32/shfolder # Synced to Wine-1.7.27
-reactos/dll/win32/shlwapi # Synced to Wine-1.7.27
+reactos/dll/win32/shlwapi # Synced to WineStaging-1.7.37
reactos/dll/win32/slbcsp # Synced to Wine-1.7.27
reactos/dll/win32/snmpapi # Synced to Wine-1.7.27
reactos/dll/win32/softpub # Synced to Wine-1.7.27