Invalidate physical memory passed to NtReadFile.
This commit is contained in:
parent
23b72e4888
commit
85e38b7657
|
@ -194,6 +194,14 @@ dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
|
||||||
|
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
if (true || file->is_synchronous()) {
|
if (true || file->is_synchronous()) {
|
||||||
|
// some games NtReadFile() directly into texture memory
|
||||||
|
// TODO(rick): better checking of physical address
|
||||||
|
if (buffer.guest_address() >= 0xA0000000) {
|
||||||
|
auto heap = kernel_memory()->LookupHeap(buffer.guest_address());
|
||||||
|
cpu::MMIOHandler::global_handler()->InvalidateRange(
|
||||||
|
heap->GetPhysicalAddress(buffer.guest_address()), buffer_length);
|
||||||
|
}
|
||||||
|
|
||||||
// Synchronous.
|
// Synchronous.
|
||||||
size_t bytes_read = 0;
|
size_t bytes_read = 0;
|
||||||
result = file->Read(
|
result = file->Read(
|
||||||
|
|
Loading…
Reference in New Issue