fixed problem for user i/o instruction

This commit is contained in:
Nikzad 2026-08-17 22:08:37 +03:30
parent fd8b9d8bc3
commit 123e0dd790

View file

@ -1542,10 +1542,17 @@ DebuggerCommandUserIn(PDEBUGGER_USER_IN_REQUEST_RESPONSE DebuggerUserInRequest)
USHORT Port = DebuggerUserInRequest->PortAddress;
//
// Zero out memory buffer
// Zero out memory buffer (maybe its not needed, but anyway lets zero out memory, we dont like garbage
// and some weird undefined behavior)
//
RtlZeroMemory(DebuggerUserInRequest, SIZEOF_DEBUGGER_USER_IN_REQUEST_RESPONSE);
//
// because we zeroed out, everything wiped out! but we need to restore correct values into their related fields
//
DebuggerUserInRequest->UserChosenRegister = Register;
DebuggerUserInRequest->PortAddress = Port;
//
// we're already in kernel mode, so there is no need to check for CPL and IOPL, TSS and etc.
//
@ -1593,10 +1600,18 @@ DebuggerCommandUserOut(PDEBUGGER_USER_OUT_REQUEST_RESPONSE DebuggerUserOutReques
UINT32 Value = DebuggerUserOutRequest->Value;
//
// Zero out memory buffer
// Same as IN instruction, zero out memory buffer (maybe its not needed, but anyway lets zero out memory,
// we dont like garbage and some weird undefined behavior)
//
RtlZeroMemory(DebuggerUserOutRequest, SIZEOF_DEBUGGER_USER_OUT_REQUEST_RESPONSE);
//
// because we zeroed out, everything wiped out! but we need to restore correct values into their related fields
//
DebuggerUserOutRequest->UserChosenRegister = Register;
DebuggerUserOutRequest->PortAddress = Port;
DebuggerUserOutRequest->Value = Value;
//
// we're already in kernel mode, so there is no need to check for CPL and IOPL, TSS and etc.
//