From 23b72e4888e5fea89a0adb025eb7e8ebe83727c5 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 18 Jun 2016 18:25:10 -0500 Subject: [PATCH] Complain loudly when ReadFile() returns ERROR_NOACCESS. --- src/xenia/base/filesystem_win.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xenia/base/filesystem_win.cc b/src/xenia/base/filesystem_win.cc index eda0885d0..13e1c9ce9 100644 --- a/src/xenia/base/filesystem_win.cc +++ b/src/xenia/base/filesystem_win.cc @@ -8,6 +8,7 @@ */ #include "xenia/base/filesystem.h" +#include "xenia/base/logging.h" #include @@ -89,6 +90,12 @@ class Win32FileHandle : public FileHandle { *out_bytes_read = bytes_read; return true; } else { + if (GetLastError() == ERROR_NOACCESS) { + XELOGW( + "Win32FileHandle::Read(..., %.8llX, %.8llX, ...) returned " + "ERROR_NOACCESS. Read-only memory?", + buffer, buffer_length); + } return false; } }