https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d0ffb7d7dbc37d2263a6…
commit 0d0ffb7d7dbc37d2263a6109693d8bbf2036a91a
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue Mar 21 18:42:29 2023 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Aug 31 16:09:49 2023 +0200
[NTOS:KD:KDBG] Integration into KD framework (Part 2/3)
Add redirections for KdSave/KdRestore and KdD0Transition/KdD3Transition.
Both KDBG and KD(TERM) need those since they will become external
transport DLLs later.
---
ntoskrnl/include/ntoskrnl.h | 4 ++++
ntoskrnl/kd/kdmain.c | 39 +++++++++++++++++++++++++++++++++++++++
ntoskrnl/kdbg/kdbg.c | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
diff --git a/ntoskrnl/include/ntoskrnl.h b/ntoskrnl/include/ntoskrnl.h
index 4d70fd91627..c228e625587 100644
--- a/ntoskrnl/include/ntoskrnl.h
+++ b/ntoskrnl/include/ntoskrnl.h
@@ -91,6 +91,10 @@
#include <kddll.h>
#ifdef KDBG
/* Define new names for these exports also present in KDBG */
+ #define KdD0Transition KdbgD0Transition
+ #define KdD3Transition KdbgD3Transition
+ #define KdSave KdbgSave
+ #define KdRestore KdbgRestore
#define KdSendPacket KdbgSendPacket
#define KdReceivePacket KdbgReceivePacket
/* And reload the definitions with these new names */
diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c
index 8120ab52e5d..c5b3e828e2e 100644
--- a/ntoskrnl/kd/kdmain.c
+++ b/ntoskrnl/kd/kdmain.c
@@ -14,6 +14,11 @@
#define NDEBUG
#include <debug.h>
+#undef KdD0Transition
+#undef KdD3Transition
+#undef KdSave
+#undef KdRestore
+
/* PUBLIC FUNCTIONS *********************************************************/
static VOID
@@ -446,4 +451,38 @@ KdDebuggerInitialize1(
return STATUS_SUCCESS;
}
+NTSTATUS
+NTAPI
+KdD0Transition(VOID)
+{
+ /* Nothing to do */
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+KdD3Transition(VOID)
+{
+ /* Nothing to do */
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+KdSave(
+ _In_ BOOLEAN SleepTransition)
+{
+ /* Nothing to do */
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+KdRestore(
+ _In_ BOOLEAN SleepTransition)
+{
+ /* Nothing to do */
+ return STATUS_SUCCESS;
+}
+
/* EOF */
diff --git a/ntoskrnl/kdbg/kdbg.c b/ntoskrnl/kdbg/kdbg.c
index ac78f72b7e3..b61d19f8aba 100644
--- a/ntoskrnl/kdbg/kdbg.c
+++ b/ntoskrnl/kdbg/kdbg.c
@@ -22,6 +22,48 @@ static NTSTATUS KdbgContinueStatus = STATUS_SUCCESS;
/* FUNCTIONS *****************************************************************/
+NTSTATUS
+NTAPI
+KdD0Transition(VOID)
+#undef KdD0Transition
+#define pKdD0Transition KdD0Transition
+{
+ /* Call KdTerm */
+ return pKdD0Transition();
+}
+
+NTSTATUS
+NTAPI
+KdD3Transition(VOID)
+#undef KdD3Transition
+#define pKdD3Transition KdD3Transition
+{
+ /* Call KdTerm */
+ return pKdD3Transition();
+}
+
+NTSTATUS
+NTAPI
+KdSave(
+ _In_ BOOLEAN SleepTransition)
+#undef KdSave
+#define pKdSave KdSave
+{
+ /* Call KdTerm */
+ return pKdSave(SleepTransition);
+}
+
+NTSTATUS
+NTAPI
+KdRestore(
+ _In_ BOOLEAN SleepTransition)
+#undef KdRestore
+#define pKdRestore KdRestore
+{
+ /* Call KdTerm */
+ return pKdRestore(SleepTransition);
+}
+
VOID
NTAPI
KdSendPacket(