Replace Win32 file IO with UWP safe variants and add support for getting drives to UWP build (#15652)

* replace, all win32 file io with their matching uwp safe variants

* add support for drive listing

* Delete NATIVEAPP.ipch

* Update .gitignore

* fix indentation
This commit is contained in:
tunip3
2022-07-06 22:59:47 +01:00
committed by GitHub
parent f6676fd706
commit 42ae18eea5
8 changed files with 90 additions and 11 deletions

View File

@@ -38,6 +38,9 @@
#ifdef _WIN32
#include "Common/CommonWindows.h"
#include <sys/stat.h>
#if PPSSPP_PLATFORM(UWP)
#include <fileapifromapp.h>
#endif
#else
#include <dirent.h>
#include <unistd.h>
@@ -673,8 +676,11 @@ std::vector<PSPFileInfo> VirtualDiscFileSystem::GetDirListing(std::string path)
std::wstring w32path = GetLocalPath(path).ToWString() + L"\\*.*";
#if PPSSPP_PLATFORM(UWP)
hFind = FindFirstFileExFromAppW(w32path.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0);
#else
hFind = FindFirstFileEx(w32path.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0);
#endif
if (hFind == INVALID_HANDLE_VALUE) {
return myVector; //the empty list
}