Signed-off-by: Derek Lesho dereklesho52@Gmail.com --- dlls/ntoskrnl.exe/instr.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c index 67cdd327ee..192ba05ee4 100644 --- a/dlls/ntoskrnl.exe/instr.c +++ b/dlls/ntoskrnl.exe/instr.c @@ -586,6 +586,12 @@ static BYTE *INSTR_GetOperandAddr( CONTEXT *context, BYTE *instr, }
+static void fake_syscall_function(void) +{ + TRACE("() stub\n"); +} + + /*********************************************************************** * emulate_instruction * @@ -757,6 +763,25 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) context->Rip += prefixlen + 3; return ExceptionContinueExecution; } + case 0x32: /* rdmsr */ + { + int reg = context->Rcx & 0xffffffff; + TRACE("rdmsr CR 0x%08x\n", reg); + switch (reg) + { + case 0xc0000082: + { + ULONGLONG syscall_address = (ULONGLONG) fake_syscall_function; + + context->Rdx = (syscall_address >> 32) & 0xffffffff; + context->Rax = syscall_address & 0xffffffff; + } + break; + default: return ExceptionContinueSearch; + } + context->Rip += prefixlen + 2; + return ExceptionContinueExecution; + } case 0xb6: /* movzx Eb, Gv */ case 0xb7: /* movzx Ew, Gv */ {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49664
Your paranoid android.
=== debian9b (64 bit WoW report) ===
ntoskrnl.exe: driver.c:565: Test failed: got 0 driver.c:568: Test failed: got 0x102
On Mar 20, 2019, at 11:19 PM, Derek Lesho dereklesho52@gmail.com wrote:
Signed-off-by: Derek Lesho dereklesho52@Gmail.com
dlls/ntoskrnl.exe/instr.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c index 67cdd327ee..192ba05ee4 100644 --- a/dlls/ntoskrnl.exe/instr.c +++ b/dlls/ntoskrnl.exe/instr.c @@ -586,6 +586,12 @@ static BYTE *INSTR_GetOperandAddr( CONTEXT *context, BYTE *instr, }
+static void fake_syscall_function(void) +{
- TRACE("() stub\n");
+}
/***********************************************************************
emulate_instruction
@@ -757,6 +763,25 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) context->Rip += prefixlen + 3; return ExceptionContinueExecution; }
case 0x32: /* rdmsr */
{
int reg = context->Rcx & 0xffffffff;
TRACE("rdmsr CR 0x%08x\n", reg);
switch (reg)
{
case 0xc0000082:
You should probably use a symbolic constant here, rather than a bare magic number. Define one, if needed (and it probably will be).
-Ken