ReadFile EOF.
This commit is contained in:
parent
ff8c03046a
commit
829b4f67bf
|
@ -63,6 +63,9 @@ X_STATUS DiscImageFile::ReadSync(
|
|||
size_t* out_bytes_read) {
|
||||
GDFXEntry* gdfx_entry = entry_->gdfx_entry();
|
||||
xe_mmap_ref mmap = entry_->mmap();
|
||||
if (byte_offset >= gdfx_entry->size) {
|
||||
return X_STATUS_END_OF_FILE;
|
||||
}
|
||||
size_t real_offset = gdfx_entry->offset + byte_offset;
|
||||
size_t real_length = MIN(buffer_length, gdfx_entry->size - byte_offset);
|
||||
xe_copy_memory(
|
||||
|
|
|
@ -71,6 +71,6 @@ X_STATUS HostPathFile::ReadSync(
|
|||
*out_bytes_read = bytes_read;
|
||||
return X_STATUS_SUCCESS;
|
||||
} else {
|
||||
return X_STATUS_UNSUCCESSFUL;
|
||||
return X_STATUS_END_OF_FILE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,9 @@ X_STATUS STFSContainerFile::ReadSync(
|
|||
STFSEntry* stfs_entry = entry_->stfs_entry();
|
||||
xe_mmap_ref mmap = entry_->mmap();
|
||||
uint8_t* map_ptr = xe_mmap_get_addr(mmap);
|
||||
if (byte_offset >= stfs_entry->size) {
|
||||
return X_STATUS_END_OF_FILE;
|
||||
}
|
||||
|
||||
// Each block is 4096.
|
||||
// Blocks may not be sequential, so we need to read by blocks and handle the
|
||||
|
|
|
@ -43,6 +43,7 @@ typedef uint32_t X_STATUS;
|
|||
#define X_STATUS_INVALID_HANDLE ((X_STATUS)0xC0000008L)
|
||||
#define X_STATUS_INVALID_PARAMETER ((X_STATUS)0xC000000DL)
|
||||
#define X_STATUS_NO_SUCH_FILE ((X_STATUS)0xC000000FL)
|
||||
#define X_STATUS_END_OF_FILE ((X_STATUS)0xC0000011L)
|
||||
#define X_STATUS_NO_MEMORY ((X_STATUS)0xC0000017L)
|
||||
#define X_STATUS_ALREADY_COMMITTED ((X_STATUS)0xC0000021L)
|
||||
#define X_STATUS_ACCESS_DENIED ((X_STATUS)0xC0000022L)
|
||||
|
|
Loading…
Reference in New Issue