From 4479af6df47570bf019a1dd26140b4d9c1abb8d4 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 28 Apr 2020 15:51:22 -0700 Subject: [PATCH] Fixed BfpFile_GetActualPath --- BeefySysLib/platform/win/Platform.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BeefySysLib/platform/win/Platform.cpp b/BeefySysLib/platform/win/Platform.cpp index 8cc97a20..2d6df814 100644 --- a/BeefySysLib/platform/win/Platform.cpp +++ b/BeefySysLib/platform/win/Platform.cpp @@ -3260,10 +3260,14 @@ BFP_EXPORT void BFP_CALLTYPE BfpFile_GetActualPath(const char* inPathC, char* ou subName[j] = DIR_SEP_CHAR; info.szDisplayName[0] = 0; int32 size = (int32)sizeof(SHFILEINFOW); - if (SHGetFileInfoW(UTF8Decode(subName).c_str(), 0, &info, (int32)sizeof(SHFILEINFOW), SHGFI_DISPLAYNAME)) + + WIN32_FIND_DATAW findData; + HANDLE handleVal = FindFirstFileW(UTF8Decode(subName).c_str(), &findData); + if (handleVal != INVALID_HANDLE_VALUE) { - outPath.Append(UTF8Encode(info.szDisplayName)); - } + outPath.Append(UTF8Encode(findData.cFileName)); + FindClose(handleVal); + } else { // most likely file does not exist.