Paul Gofman : ntoskrnl.exe: Return zero for unknown msr registers.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 13:46:21 CST 2020


Module: wine
Branch: stable
Commit: a563a23e3da2eb1f82154eb0e950df68e0f65b75
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a563a23e3da2eb1f82154eb0e950df68e0f65b75

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Mon May 25 11:19:30 2020 +0300

ntoskrnl.exe: Return zero for unknown msr registers.

rdmsr should fault if called with the register not supported
by CPU. But until we want to support the full range of CPU
specific registers returning zero is probably a better
fallback.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 6ceb6c7f47c225c117dd514ffdb15a0cb4317753)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ntoskrnl.exe/instr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c
index 05bdd23e826..0cd986005e9 100644
--- a/dlls/ntoskrnl.exe/instr.c
+++ b/dlls/ntoskrnl.exe/instr.c
@@ -785,7 +785,11 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
                 context->Rax = (ULONG)syscall_address;
                 break;
             }
-            default: return ExceptionContinueSearch;
+            default:
+                FIXME("reg %#x, returning 0.\n", reg);
+                context->Rdx = 0;
+                context->Rax = 0;
+                break;
             }
             context->Rip += prefixlen + 2;
             return ExceptionContinueExecution;




More information about the wine-cvs mailing list