Renamed XDirectoryInfo to X_FILE_DIRECTORY_INFORMATION.
This commit is contained in:
parent
e3e2b1a6d9
commit
d60870e9eb
|
@ -46,7 +46,7 @@ X_STATUS DiscImageEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||||
return X_STATUS_SUCCESS;
|
return X_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS DiscImageEntry::QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS DiscImageEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) {
|
const char* file_name, bool restart) {
|
||||||
assert_not_null(out_info);
|
assert_not_null(out_info);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class DiscImageEntry : public Entry {
|
||||||
GDFXEntry* gdfx_entry() const { return gdfx_entry_; }
|
GDFXEntry* gdfx_entry() const { return gdfx_entry_; }
|
||||||
|
|
||||||
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
||||||
X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) override;
|
const char* file_name, bool restart) override;
|
||||||
|
|
||||||
bool can_map() override { return true; }
|
bool can_map() override { return true; }
|
||||||
|
|
|
@ -35,7 +35,7 @@ X_STATUS DiscImageFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||||
return entry_->QueryInfo(out_info);
|
return entry_->QueryInfo(out_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS DiscImageFile::QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS DiscImageFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) {
|
const char* file_name, bool restart) {
|
||||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class DiscImageFile : public XFile {
|
||||||
Device* device() const override;
|
Device* device() const override;
|
||||||
|
|
||||||
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
||||||
X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) override;
|
const char* file_name, bool restart) override;
|
||||||
X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) override;
|
X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) override;
|
||||||
X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
||||||
|
|
|
@ -59,7 +59,7 @@ X_STATUS HostPathEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||||
return X_STATUS_SUCCESS;
|
return X_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS HostPathEntry::QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS HostPathEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) {
|
const char* file_name, bool restart) {
|
||||||
assert_not_null(out_info);
|
assert_not_null(out_info);
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class HostPathEntry : public Entry {
|
||||||
const std::wstring& local_path() { return local_path_; }
|
const std::wstring& local_path() { return local_path_; }
|
||||||
|
|
||||||
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
||||||
X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) override;
|
const char* file_name, bool restart) override;
|
||||||
|
|
||||||
bool can_map() override { return true; }
|
bool can_map() override { return true; }
|
||||||
|
|
|
@ -35,7 +35,7 @@ X_STATUS HostPathFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||||
return entry_->QueryInfo(out_info);
|
return entry_->QueryInfo(out_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS HostPathFile::QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS HostPathFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) {
|
const char* file_name, bool restart) {
|
||||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ class HostPathFile : public XFile {
|
||||||
Device* device() const override;
|
Device* device() const override;
|
||||||
|
|
||||||
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
||||||
X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) override;
|
const char* file_name, bool restart) override;
|
||||||
X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) override;
|
X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) override;
|
||||||
X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
||||||
|
|
|
@ -37,7 +37,7 @@ X_STATUS STFSContainerEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info
|
||||||
return X_STATUS_SUCCESS;
|
return X_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS STFSContainerEntry::QueryDirectory(XDirectoryInfo* out_info,
|
X_STATUS STFSContainerEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||||
size_t length,
|
size_t length,
|
||||||
const char* file_name,
|
const char* file_name,
|
||||||
bool restart) {
|
bool restart) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ class STFSContainerEntry : public Entry {
|
||||||
STFSEntry* stfs_entry() const { return stfs_entry_; }
|
STFSEntry* stfs_entry() const { return stfs_entry_; }
|
||||||
|
|
||||||
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
||||||
X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) override;
|
const char* file_name, bool restart) override;
|
||||||
|
|
||||||
X_STATUS Open(KernelState* kernel_state, Mode desired_access, bool async,
|
X_STATUS Open(KernelState* kernel_state, Mode desired_access, bool async,
|
||||||
|
|
|
@ -35,7 +35,7 @@ X_STATUS STFSContainerFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info)
|
||||||
return entry_->QueryInfo(out_info);
|
return entry_->QueryInfo(out_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS STFSContainerFile::QueryDirectory(XDirectoryInfo* out_info,
|
X_STATUS STFSContainerFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||||
size_t length, const char* file_name,
|
size_t length, const char* file_name,
|
||||||
bool restart) {
|
bool restart) {
|
||||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||||
|
|
|
@ -30,7 +30,7 @@ class STFSContainerFile : public XFile {
|
||||||
Device* device() const override;
|
Device* device() const override;
|
||||||
|
|
||||||
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) override;
|
||||||
X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) override;
|
const char* file_name, bool restart) override;
|
||||||
X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) override;
|
X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) override;
|
||||||
X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
||||||
|
|
|
@ -21,7 +21,7 @@ class KernelState;
|
||||||
class XFile;
|
class XFile;
|
||||||
class X_FILE_NETWORK_OPEN_INFORMATION;
|
class X_FILE_NETWORK_OPEN_INFORMATION;
|
||||||
class XFileSystemAttributeInfo;
|
class XFileSystemAttributeInfo;
|
||||||
class XDirectoryInfo;
|
class X_FILE_DIRECTORY_INFORMATION;
|
||||||
class XVolumeInfo;
|
class XVolumeInfo;
|
||||||
} // namespace kernel
|
} // namespace kernel
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
@ -64,7 +64,7 @@ class Entry {
|
||||||
bool is_read_only() const;
|
bool is_read_only() const;
|
||||||
|
|
||||||
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
||||||
virtual X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) = 0;
|
const char* file_name, bool restart) = 0;
|
||||||
|
|
||||||
virtual bool can_map() { return false; }
|
virtual bool can_map() { return false; }
|
||||||
|
|
|
@ -44,7 +44,8 @@ class X_FILE_NETWORK_OPEN_INFORMATION {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class XDirectoryInfo {
|
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff540248.aspx
|
||||||
|
class X_FILE_DIRECTORY_INFORMATION {
|
||||||
public:
|
public:
|
||||||
// FILE_DIRECTORY_INFORMATION
|
// FILE_DIRECTORY_INFORMATION
|
||||||
uint32_t next_entry_offset;
|
uint32_t next_entry_offset;
|
||||||
|
@ -62,9 +63,9 @@ class XDirectoryInfo {
|
||||||
void Write(uint8_t* base, uint32_t p) {
|
void Write(uint8_t* base, uint32_t p) {
|
||||||
uint8_t* dst = base + p;
|
uint8_t* dst = base + p;
|
||||||
uint8_t* src = (uint8_t*)this;
|
uint8_t* src = (uint8_t*)this;
|
||||||
XDirectoryInfo* info;
|
X_FILE_DIRECTORY_INFORMATION* info;
|
||||||
do {
|
do {
|
||||||
info = (XDirectoryInfo*)src;
|
info = (X_FILE_DIRECTORY_INFORMATION*)src;
|
||||||
xe::store_and_swap<uint32_t>(dst, info->next_entry_offset);
|
xe::store_and_swap<uint32_t>(dst, info->next_entry_offset);
|
||||||
xe::store_and_swap<uint32_t>(dst + 4, info->file_index);
|
xe::store_and_swap<uint32_t>(dst + 4, info->file_index);
|
||||||
xe::store_and_swap<uint64_t>(dst + 8, info->creation_time);
|
xe::store_and_swap<uint64_t>(dst + 8, info->creation_time);
|
||||||
|
@ -81,7 +82,7 @@ class XDirectoryInfo {
|
||||||
} while (info->next_entry_offset != 0);
|
} while (info->next_entry_offset != 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
static_assert_size(XDirectoryInfo, 72);
|
static_assert_size(X_FILE_DIRECTORY_INFORMATION, 72);
|
||||||
|
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/hardware/ff540287(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/hardware/ff540287(v=vs.85).aspx
|
||||||
class XVolumeInfo {
|
class XVolumeInfo {
|
||||||
|
@ -155,7 +156,7 @@ class XFile : public XObject {
|
||||||
void set_position(size_t value) { position_ = value; }
|
void set_position(size_t value) { position_ = value; }
|
||||||
|
|
||||||
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
||||||
virtual X_STATUS QueryDirectory(XDirectoryInfo* out_info, size_t length,
|
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||||
const char* file_name, bool restart) = 0;
|
const char* file_name, bool restart) = 0;
|
||||||
virtual X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) = 0;
|
virtual X_STATUS QueryVolume(XVolumeInfo* out_info, size_t length) = 0;
|
||||||
virtual X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
virtual X_STATUS QueryFileSystemAttributes(XFileSystemAttributeInfo* out_info,
|
||||||
|
|
|
@ -701,7 +701,7 @@ SHIM_CALL NtQueryDirectoryFile_shim(PPCContext* ppc_state, KernelState* state) {
|
||||||
XFile* file = NULL;
|
XFile* file = NULL;
|
||||||
result = state->object_table()->GetObject(file_handle, (XObject**)&file);
|
result = state->object_table()->GetObject(file_handle, (XObject**)&file);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
XDirectoryInfo* dir_info = (XDirectoryInfo*)calloc(length, 1);
|
X_FILE_DIRECTORY_INFORMATION* dir_info = (X_FILE_DIRECTORY_INFORMATION*)calloc(length, 1);
|
||||||
result =
|
result =
|
||||||
file->QueryDirectory(dir_info, length, file_name, restart_scan != 0);
|
file->QueryDirectory(dir_info, length, file_name, restart_scan != 0);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
|
|
Loading…
Reference in New Issue