[VFS] Add NullDevice (returns success for all calls), handle \Device\Harddisk0\ with it
XMountUtilityDrive code tries reading/writing from \Device\Harddisk0\Cache0 / Cache1 / Partition0, NullDevice handling \Device\Harddisk0 will make that code think that the reads/writes were successful, so the utility-drive mount can proceed without failing.
This commit is contained in:
42
src/xenia/vfs/devices/null_entry.h
Normal file
42
src/xenia/vfs/devices/null_entry.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2021 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_VFS_DEVICES_NULL_ENTRY_H_
|
||||
#define XENIA_VFS_DEVICES_NULL_ENTRY_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "xenia/base/filesystem.h"
|
||||
#include "xenia/vfs/entry.h"
|
||||
|
||||
namespace xe {
|
||||
namespace vfs {
|
||||
|
||||
class NullDevice;
|
||||
|
||||
class NullEntry : public Entry {
|
||||
public:
|
||||
NullEntry(Device* device, Entry* parent, std::string path);
|
||||
~NullEntry() override;
|
||||
|
||||
static NullEntry* Create(Device* device, Entry* parent,
|
||||
const std::string& path);
|
||||
|
||||
X_STATUS Open(uint32_t desired_access, File** out_file) override;
|
||||
|
||||
bool can_map() const override { return false; }
|
||||
|
||||
private:
|
||||
friend class NullDevice;
|
||||
};
|
||||
|
||||
} // namespace vfs
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_VFS_DEVICES_NULL_ENTRY_H_
|
||||
Reference in New Issue
Block a user