From db0e5108dc2e79732a0ba700a48d544fbeaba99e Mon Sep 17 00:00:00 2001 From: spycrab Date: Fri, 4 May 2018 23:43:32 +0200 Subject: [PATCH] Win32/FileUtil: Fix IsDirectory() not working for certain directories --- Source/Core/Common/FileUtil.cpp | 5 +++++ Source/Core/DolphinQt2/DolphinQt2.vcxproj | 4 ++-- Source/Core/DolphinWX/DolphinWX.vcxproj | 2 +- Source/Core/Updater/Updater.vcxproj | 2 +- Source/DSPTool/DSPTool.vcxproj | 4 ++-- Source/UnitTests/UnitTests.vcxproj | 4 ++-- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 85f252f143..88b17c99c6 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -24,6 +24,7 @@ #ifdef _WIN32 #include +#include #include // for GetSaveFileName #include // getcwd #include @@ -111,7 +112,11 @@ bool Exists(const std::string& path) // Returns true if the path exists and is a directory bool IsDirectory(const std::string& path) { +#ifdef _WIN32 + return PathIsDirectory(UTF8ToUTF16(path).c_str()); +#else return FileInfo(path).IsDirectory(); +#endif } // Returns true if the path exists and is a file diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj b/Source/Core/DolphinQt2/DolphinQt2.vcxproj index cf75a2e9bb..f526f5bcd6 100644 --- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj +++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj @@ -41,7 +41,7 @@ $(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories) - avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies) + avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;Shlwapi.lib;%(AdditionalDependencies) $(ProjectDir)VideoInterface;$(ProjectDir)GameList;$(ProjectDir)Debugger;$(ProjectDir)Settings;$(ProjectDir)Config;$(ProjectDir)Config\Mapping;$(ProjectDir)Config\Graphics;$(ProjectDir)NetPlay;$(ProjectDir)QtUtils;$(ProjectDir)TAS;%(AdditionalIncludeDirectories) @@ -423,4 +423,4 @@ - + \ No newline at end of file diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj index 2406585498..d7d7519f16 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcxproj +++ b/Source/Core/DolphinWX/DolphinWX.vcxproj @@ -39,7 +39,7 @@ $(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories) - avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies) + avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;Shlwapi.lib;%(AdditionalDependencies) $(ExternalsDir)wxWidgets3\include;%(AdditionalIncludeDirectories) diff --git a/Source/Core/Updater/Updater.vcxproj b/Source/Core/Updater/Updater.vcxproj index 748e507ec4..6898f2efe7 100644 --- a/Source/Core/Updater/Updater.vcxproj +++ b/Source/Core/Updater/Updater.vcxproj @@ -38,7 +38,7 @@ - iphlpapi.lib;winmm.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + iphlpapi.lib;winmm.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) diff --git a/Source/DSPTool/DSPTool.vcxproj b/Source/DSPTool/DSPTool.vcxproj index f7a00991e9..c995b0b81b 100644 --- a/Source/DSPTool/DSPTool.vcxproj +++ b/Source/DSPTool/DSPTool.vcxproj @@ -37,7 +37,7 @@ - winmm.lib;%(AdditionalDependencies) + winmm.lib;Shlwapi.lib;%(AdditionalDependencies) Console @@ -73,4 +73,4 @@ - + \ No newline at end of file diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj index de91cec388..d356803905 100644 --- a/Source/UnitTests/UnitTests.vcxproj +++ b/Source/UnitTests/UnitTests.vcxproj @@ -46,7 +46,7 @@ dolphin codebase. --> $(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories) - avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies) + avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;Shlwapi.lib;%(AdditionalDependencies) Console @@ -92,4 +92,4 @@ - + \ No newline at end of file