Removing unnecessary indirection from XFile.
This commit is contained in:
parent
de844a3db9
commit
3e55b590b1
|
@ -40,15 +40,6 @@ X_STATUS DiscImageFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, s
|
||||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS DiscImageFile::QueryVolume(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) {
|
|
||||||
return entry_->device()->QueryVolume(out_info, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS DiscImageFile::QueryFileSystemAttributes(
|
|
||||||
X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length) {
|
|
||||||
return entry_->device()->QueryFileSystemAttributes(out_info, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS DiscImageFile::ReadSync(void* buffer, size_t buffer_length,
|
X_STATUS DiscImageFile::ReadSync(void* buffer, size_t buffer_length,
|
||||||
size_t byte_offset, size_t* out_bytes_read) {
|
size_t byte_offset, size_t* out_bytes_read) {
|
||||||
GDFXEntry* gdfx_entry = entry_->gdfx_entry();
|
GDFXEntry* gdfx_entry = entry_->gdfx_entry();
|
||||||
|
|
|
@ -32,9 +32,6 @@ class DiscImageFile : public XFile {
|
||||||
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(X_FILE_DIRECTORY_INFORMATION* 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(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) override;
|
|
||||||
X_STATUS QueryFileSystemAttributes(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
|
||||||
size_t length) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
X_STATUS ReadSync(void* buffer, size_t buffer_length, size_t byte_offset,
|
X_STATUS ReadSync(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||||
|
|
|
@ -40,15 +40,6 @@ X_STATUS HostPathFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, si
|
||||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS HostPathFile::QueryVolume(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) {
|
|
||||||
return entry_->device()->QueryVolume(out_info, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS HostPathFile::QueryFileSystemAttributes(
|
|
||||||
X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length) {
|
|
||||||
return entry_->device()->QueryFileSystemAttributes(out_info, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS HostPathFile::ReadSync(void* buffer, size_t buffer_length,
|
X_STATUS HostPathFile::ReadSync(void* buffer, size_t buffer_length,
|
||||||
size_t byte_offset, size_t* out_bytes_read) {
|
size_t byte_offset, size_t* out_bytes_read) {
|
||||||
OVERLAPPED overlapped;
|
OVERLAPPED overlapped;
|
||||||
|
|
|
@ -34,9 +34,6 @@ class HostPathFile : public XFile {
|
||||||
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(X_FILE_DIRECTORY_INFORMATION* 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(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) override;
|
|
||||||
X_STATUS QueryFileSystemAttributes(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
|
||||||
size_t length) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
X_STATUS ReadSync(void* buffer, size_t buffer_length, size_t byte_offset,
|
X_STATUS ReadSync(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||||
|
|
|
@ -41,15 +41,6 @@ X_STATUS STFSContainerFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_inf
|
||||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||||
}
|
}
|
||||||
|
|
||||||
X_STATUS STFSContainerFile::QueryVolume(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) {
|
|
||||||
return entry_->device()->QueryVolume(out_info, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS STFSContainerFile::QueryFileSystemAttributes(
|
|
||||||
X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length) {
|
|
||||||
return entry_->device()->QueryFileSystemAttributes(out_info, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS STFSContainerFile::ReadSync(void* buffer, size_t buffer_length,
|
X_STATUS STFSContainerFile::ReadSync(void* buffer, size_t buffer_length,
|
||||||
size_t byte_offset,
|
size_t byte_offset,
|
||||||
size_t* out_bytes_read) {
|
size_t* out_bytes_read) {
|
||||||
|
|
|
@ -32,9 +32,6 @@ class STFSContainerFile : public XFile {
|
||||||
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(X_FILE_DIRECTORY_INFORMATION* 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(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) override;
|
|
||||||
X_STATUS QueryFileSystemAttributes(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
|
||||||
size_t length) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
X_STATUS ReadSync(void* buffer, size_t buffer_length, size_t byte_offset,
|
X_STATUS ReadSync(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||||
|
|
|
@ -158,9 +158,6 @@ class XFile : public XObject {
|
||||||
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(X_FILE_DIRECTORY_INFORMATION* 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(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) = 0;
|
|
||||||
virtual X_STATUS QueryFileSystemAttributes(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
|
||||||
size_t length) = 0;
|
|
||||||
|
|
||||||
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
|
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||||
size_t* out_bytes_read);
|
size_t* out_bytes_read);
|
||||||
|
|
|
@ -617,7 +617,7 @@ SHIM_CALL NtQueryVolumeInformationFile_shim(PPCContext* ppc_state,
|
||||||
switch (fs_info_class) {
|
switch (fs_info_class) {
|
||||||
case 1: { // FileFsVolumeInformation
|
case 1: { // FileFsVolumeInformation
|
||||||
auto volume_info = (X_FILE_FS_VOLUME_INFORMATION*)calloc(length, 1);
|
auto volume_info = (X_FILE_FS_VOLUME_INFORMATION*)calloc(length, 1);
|
||||||
result = file->QueryVolume(volume_info, length);
|
result = file->device()->QueryVolume(volume_info, length);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
volume_info->Write(SHIM_MEM_BASE, fs_info_ptr);
|
volume_info->Write(SHIM_MEM_BASE, fs_info_ptr);
|
||||||
info = length;
|
info = length;
|
||||||
|
@ -627,7 +627,7 @@ SHIM_CALL NtQueryVolumeInformationFile_shim(PPCContext* ppc_state,
|
||||||
}
|
}
|
||||||
case 5: { // FileFsAttributeInformation
|
case 5: { // FileFsAttributeInformation
|
||||||
auto fs_attribute_info = (X_FILE_FS_ATTRIBUTE_INFORMATION*)calloc(length, 1);
|
auto fs_attribute_info = (X_FILE_FS_ATTRIBUTE_INFORMATION*)calloc(length, 1);
|
||||||
result = file->QueryFileSystemAttributes(fs_attribute_info, length);
|
result = file->device()->QueryFileSystemAttributes(fs_attribute_info, length);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
fs_attribute_info->Write(SHIM_MEM_BASE, fs_info_ptr);
|
fs_attribute_info->Write(SHIM_MEM_BASE, fs_info_ptr);
|
||||||
info = length;
|
info = length;
|
||||||
|
|
Loading…
Reference in New Issue