diff options
author | Martijn Kaijser <martijn@xbmc.org> | 2017-04-13 18:25:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 18:25:02 +0200 |
commit | 21f4e3be52df376dea30d9fdbb885bd631b10de7 (patch) | |
tree | 1d28b58cef3ddca72e8e4416b6ec00239010e32a | |
parent | 961174f768085303d9729420db034bf28134002b (diff) | |
parent | b1b116471cf50a761e1d3df1ec3c0fd04fe44ffe (diff) |
Merge pull request #11960 from Rechi/winDropVista
[windows] drop FindFirstFileExW(...) workaround for Vista
-rw-r--r-- | xbmc/filesystem/win32/Win32Directory.cpp | 5 | ||||
-rw-r--r-- | xbmc/filesystem/win32/Win32File.cpp | 5 | ||||
-rw-r--r-- | xbmc/filesystem/win32/Win32SMBDirectory.cpp | 10 | ||||
-rw-r--r-- | xbmc/utils/SystemInfo.cpp | 12 | ||||
-rw-r--r-- | xbmc/utils/SystemInfo.h | 1 |
5 files changed, 6 insertions, 27 deletions
diff --git a/xbmc/filesystem/win32/Win32Directory.cpp b/xbmc/filesystem/win32/Win32Directory.cpp index a1575fc883..f9390558f2 100644 --- a/xbmc/filesystem/win32/Win32Directory.cpp +++ b/xbmc/filesystem/win32/Win32Directory.cpp @@ -75,10 +75,7 @@ bool CWin32Directory::GetDirectory(const CURL& url, CFileItemList &items) HANDLE hSearch; WIN32_FIND_DATAW findData = {}; - if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin7)) - hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); - else - hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0); + hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); if (hSearch == INVALID_HANDLE_VALUE) return GetLastError() == ERROR_FILE_NOT_FOUND ? Exists(url) : false; // return true if directory exist and empty diff --git a/xbmc/filesystem/win32/Win32File.cpp b/xbmc/filesystem/win32/Win32File.cpp index 9389d740b4..f3ff170f00 100644 --- a/xbmc/filesystem/win32/Win32File.cpp +++ b/xbmc/filesystem/win32/Win32File.cpp @@ -479,10 +479,7 @@ int CWin32File::Stat(const CURL& url, struct __stat64* statData) // get maximum information about file from search function HANDLE hSearch; WIN32_FIND_DATAW findData; - if (CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin7)) - hSearch = FindFirstFileExW(pathnameW.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, 0); - else - hSearch = FindFirstFileExW(pathnameW.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0); + hSearch = FindFirstFileExW(pathnameW.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, 0); if (m_smbFile) m_lastSMBFileErr = GetLastError(); // set real error state diff --git a/xbmc/filesystem/win32/Win32SMBDirectory.cpp b/xbmc/filesystem/win32/Win32SMBDirectory.cpp index 97060eabad..423a5035af 100644 --- a/xbmc/filesystem/win32/Win32SMBDirectory.cpp +++ b/xbmc/filesystem/win32/Win32SMBDirectory.cpp @@ -121,10 +121,7 @@ bool CWin32SMBDirectory::GetDirectory(const CURL& url, CFileItemList &items) WIN32_FIND_DATAW findData = {}; CURL authUrl(url); // ConnectAndAuthenticate may update url with username and password - if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin7)) - hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); - else - hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0); + hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); if (hSearch == INVALID_HANDLE_VALUE) { @@ -134,10 +131,7 @@ bool CWin32SMBDirectory::GetDirectory(const CURL& url, CFileItemList &items) if (ConnectAndAuthenticate(authUrl, (m_flags & DIR_FLAG_ALLOW_PROMPT) != 0)) { - if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin7)) - hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); - else - hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0); + hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); searchErr = GetLastError(); } if (hSearch == INVALID_HANDLE_VALUE) diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp index 8289ef77fa..526373c543 100644 --- a/xbmc/utils/SystemInfo.cpp +++ b/xbmc/utils/SystemInfo.cpp @@ -668,12 +668,6 @@ std::string CSysInfo::GetOsPrettyNameWithVersion(void) { switch (GetWindowsVersion()) { - case WindowsVersionVista: - if (osvi.wProductType == VER_NT_WORKSTATION) - osNameVer.append("Vista"); - else - osNameVer.append("Server 2008"); - break; case WindowsVersionWin7: if (osvi.wProductType == VER_NT_WORKSTATION) osNameVer.append("7"); @@ -841,9 +835,7 @@ CSysInfo::WindowsVersion CSysInfo::GetWindowsVersion() OSVERSIONINFOEXW osvi = {}; if (sysGetVersionExWByRef(osvi)) { - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) - m_WinVer = WindowsVersionVista; - else if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1) + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1) m_WinVer = WindowsVersionWin7; else if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2) m_WinVer = WindowsVersionWin8; @@ -852,7 +844,7 @@ CSysInfo::WindowsVersion CSysInfo::GetWindowsVersion() else if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0) m_WinVer = WindowsVersionWin10; /* Insert checks for new Windows versions here */ - else if ( (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion > 3) || osvi.dwMajorVersion > 6) + else if ( (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion > 3) || osvi.dwMajorVersion > 10) m_WinVer = WindowsVersionFuture; } } diff --git a/xbmc/utils/SystemInfo.h b/xbmc/utils/SystemInfo.h index 515d0aaa48..297cb698ec 100644 --- a/xbmc/utils/SystemInfo.h +++ b/xbmc/utils/SystemInfo.h @@ -83,7 +83,6 @@ public: enum WindowsVersion { WindowsVersionUnknown = -1, // Undetected, unsupported Windows version or OS in not Windows - WindowsVersionVista, // Windows Vista, Windows Server 2008 WindowsVersionWin7, // Windows 7, Windows Server 2008 R2 WindowsVersionWin8, // Windows 8, Windows Server 2012 WindowsVersionWin8_1, // Windows 8.1 |