[Memory] Trigger watches when making pages writable, not the other way around

This commit is contained in:
Triang3l
2019-11-10 14:21:36 +03:00
parent 26e1a67036
commit 8ba6f3fc37
3 changed files with 30 additions and 18 deletions

View File

@@ -170,8 +170,8 @@ dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
if (XSUCCEEDED(result)) {
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());
if (heap && heap->IsGuestPhysicalHeap()) {
kernel_memory()->TriggerWatches(buffer.guest_address(), buffer_length,
true, true);
}