* 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.
* 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.
* 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
* 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)
{
}
*buflen = 0;
- return __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
+ return E_NOT_SUFFICIENT_BUFFER;
}
/*************************************************************************
{
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
{
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;
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;
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);
strcpyW(szSearch + dwLen, szAllFiles);
hfind = FindFirstFileW(szSearch, &find_data);
- if (hfind != INVALID_HANDLE_VALUE)
+ if (hfind == INVALID_HANDLE_VALUE)
+ return FALSE;
+
+ do
{
- 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 (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;
}
* 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
* 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
INT (WINAPI *pStrCmpFn)(LPCSTR,LPCSTR,INT))
{
size_t iLen;
+ LPCSTR end;
if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL;
iLen = strlen(lpszSearch);
+ end = lpszStr + strlen(lpszStr);
- while (*lpszStr)
+ while (lpszStr + iLen <= end)
{
if (!pStrCmpFn(lpszStr, lpszSearch, iLen))
return (LPSTR)lpszStr;
*/
LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch)
{
+ LPSTR lpszRet = NULL;
WORD ch1, ch2;
INT iLen;
if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL;
- if (!lpszEnd)
- lpszEnd = lpszStr + lstrlenA(lpszStr);
- if (lpszEnd == lpszStr)
- return NULL;
-
if (IsDBCSLeadByte(*lpszSearch))
ch1 = *lpszSearch << 8 | (UCHAR)lpszSearch[1];
else
ch1 = *lpszSearch;
iLen = lstrlenA(lpszSearch);
- do
+ if (!lpszEnd)
+ lpszEnd = lpszStr + lstrlenA(lpszStr);
+ else /* reproduce the broken behaviour on Windows */
+ lpszEnd += min(iLen - 1, lstrlenA(lpszEnd));
+
+ while (lpszStr + iLen <= lpszEnd && *lpszStr)
{
- lpszEnd = CharPrevA(lpszStr, lpszEnd);
- ch2 = IsDBCSLeadByte(*lpszEnd)? *lpszEnd << 8 | (UCHAR)lpszEnd[1] : *lpszEnd;
+ ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | (UCHAR)lpszStr[1] : *lpszStr;
if (!ChrCmpIA(ch1, ch2))
{
- if (!StrCmpNIA(lpszEnd, lpszSearch, iLen))
- return (LPSTR)lpszEnd;
+ if (!StrCmpNIA(lpszStr, lpszSearch, iLen))
+ lpszRet = (LPSTR)lpszStr;
}
- } while (lpszEnd > lpszStr);
- return NULL;
+ lpszStr = CharNextA(lpszStr);
+ }
+ return lpszRet;
}
/*************************************************************************
*/
LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch)
{
+ LPWSTR lpszRet = NULL;
INT iLen;
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch));
if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL;
+ iLen = strlenW(lpszSearch);
+
if (!lpszEnd)
lpszEnd = lpszStr + strlenW(lpszStr);
+ else /* reproduce the broken behaviour on Windows */
+ lpszEnd += min(iLen - 1, lstrlenW(lpszEnd));
- iLen = strlenW(lpszSearch);
-
- while (lpszEnd > lpszStr)
+ while (lpszStr + iLen <= lpszEnd && *lpszStr)
{
- lpszEnd--;
- if (!StrCmpNIW(lpszEnd, lpszSearch, iLen))
- return (LPWSTR)lpszEnd;
+ if (!ChrCmpIW(*lpszSearch, *lpszStr))
+ {
+ if (!StrCmpNIW(lpszStr, lpszSearch, iLen))
+ lpszRet = (LPWSTR)lpszStr;
+ }
+ lpszStr++;
}
- return NULL;
+ return lpszRet;
}
/*************************************************************************
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
{
int iLen;
+ LPCWSTR end;
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch));
return NULL;
iLen = strlenW(lpszSearch);
+ end = lpszStr + strlenW(lpszStr);
- while (*lpszStr)
+ while (lpszStr + iLen <= end)
{
if (!StrCmpNIW(lpszStr, lpszSearch, iLen))
return (LPWSTR)lpszStr;
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:
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