Alex Henrie : ntoskrnl: Provide a more realistic value for register CR0.

Alexandre Julliard julliard at winehq.org
Tue Jun 23 15:52:52 CDT 2020


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

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Tue Jun 23 00:32:58 2020 -0600

ntoskrnl: Provide a more realistic value for register CR0.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48997
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c
index 44f2ed4f51..f197570db0 100644
--- a/dlls/ntoskrnl.exe/instr.c
+++ b/dlls/ntoskrnl.exe/instr.c
@@ -35,6 +35,13 @@
 
 #define KSHARED_USER_DATA_PAGE_SIZE 0x1000
 
+#define CR0_PE 0x00000001 /* Protected Mode */
+#define CR0_ET 0x00000010 /* Extension Type */
+#define CR0_NE 0x00000020 /* Numeric Error */
+#define CR0_WP 0x00010000 /* Write Protect */
+#define CR0_AM 0x00040000 /* Alignment Mask */
+#define CR0_PG 0x80000000 /* Paging */
+
 enum instr_op
 {
     INSTR_OP_MOV,
@@ -350,7 +357,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
                 TRACE( "mov cr%u,%s at 0x%08x\n", reg, reg_names[instr[2] & 7], context->Eip );
                 switch (reg)
                 {
-                case 0: *data = 0x10; break; /* FIXME: set more bits ? */
+                case 0: *data = CR0_PE|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PG; break;
                 case 2: *data = 0; break;
                 case 3: *data = 0; break;
                 case 4: *data = 0; break;




More information about the wine-cvs mailing list