Adding locks and parents to vfs.

Progress on #305.
This commit is contained in:
Ben Vanik
2015-06-29 05:07:29 -07:00
parent 9a80b5e5be
commit 0104a2290f
16 changed files with 65 additions and 40 deletions

View File

@@ -17,9 +17,9 @@
namespace xe {
namespace vfs {
HostPathEntry::HostPathEntry(Device* device, std::string path,
HostPathEntry::HostPathEntry(Device* device, Entry* parent, std::string path,
const std::wstring& local_path)
: Entry(device, path), local_path_(local_path) {}
: Entry(device, parent, path), local_path_(local_path) {}
HostPathEntry::~HostPathEntry() = default;
@@ -49,9 +49,9 @@ X_STATUS HostPathEntry::Open(KernelState* kernel_state, Mode mode, bool async,
}
DWORD flags_and_attributes = async ? FILE_FLAG_OVERLAPPED : 0;
HANDLE file =
CreateFile(local_path_.c_str(), desired_access, share_mode, NULL,
creation_disposition,
flags_and_attributes | FILE_FLAG_BACKUP_SEMANTICS, NULL);
CreateFileW(local_path_.c_str(), desired_access, share_mode, NULL,
creation_disposition,
flags_and_attributes | FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (file == INVALID_HANDLE_VALUE) {
// TODO(benvanik): pick correct response.
return X_STATUS_NO_SUCH_FILE;