[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadPhysical/SysDbgWritePhysical

This commit is contained in:
Hervé Poussineau 2024-09-22 21:39:09 +02:00 committed by Hermès Bélusca-Maïto
parent 2efaa5ea1e
commit 42e038f227
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -2335,6 +2335,35 @@ KdSystemDebugControl(
case SysDbgReadPhysical:
case SysDbgWritePhysical:
if (InputBufferLength != sizeof(SYSDBG_PHYSICAL))
{
Status = STATUS_INFO_LENGTH_MISMATCH;
}
else
{
SYSDBG_PHYSICAL Request = *(PSYSDBG_PHYSICAL)InputBuffer;
PVOID LockedBuffer;
PMDL LockVariable;
Status = ExLockUserBuffer(Request.Buffer,
Request.Request,
PreviousMode,
Command == SysDbgReadVirtual ? IoWriteAccess : IoReadAccess,
&LockedBuffer,
&LockVariable);
if (NT_SUCCESS(Status))
{
Status = KdpCopyMemoryChunks(Request.Address.QuadPart,
Request.Buffer,
Request.Request,
0,
MMDBG_COPY_PHYSICAL | (Command == SysDbgReadVirtual ? 0 : MMDBG_COPY_WRITE),
&Length);
ExUnlockUserBuffer(LockVariable);
}
}
break;
case SysDbgReadControlSpace:
case SysDbgWriteControlSpace:
case SysDbgReadIoSpace: