Move NtCreateFile/NtOpenFile to VFS, implement (mostly) for real.

Progress on #305.
This commit is contained in:
Ben Vanik
2015-06-29 10:33:36 -07:00
parent 0104a2290f
commit cc08e9019a
25 changed files with 459 additions and 159 deletions

View File

@@ -12,6 +12,7 @@
#include <string>
#include "xenia/base/filesystem.h"
#include "xenia/vfs/entry.h"
namespace xe {
@@ -25,10 +26,14 @@ class HostPathEntry : public Entry {
const std::wstring& local_path);
~HostPathEntry() override;
static HostPathEntry* Create(Device* device, Entry* parent,
const std::wstring& full_path,
xe::filesystem::FileInfo file_info);
const std::wstring& local_path() { return local_path_; }
X_STATUS Open(KernelState* kernel_state, Mode mode, bool async,
XFile** out_file) override;
X_STATUS Open(KernelState* kernel_state, uint32_t desired_access,
object_ref<XFile>* out_file) override;
bool can_map() const override { return true; }
std::unique_ptr<MappedMemory> OpenMapped(MappedMemory::Mode mode,
@@ -38,6 +43,10 @@ class HostPathEntry : public Entry {
private:
friend class HostPathDevice;
std::unique_ptr<Entry> CreateEntryInternal(std::string name,
uint32_t attributes) override;
bool DeleteEntryInternal(Entry* entry) override;
std::wstring local_path_;
};