https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7ec84eea0790899ca34b7...
commit f7ec84eea0790899ca34b79f2ec5a308204254ac Author: Hervé Poussineau hpoussin@reactos.org AuthorDate: Mon May 20 12:17:22 2019 +0200 Commit: Hervé Poussineau hpoussin@reactos.org CommitDate: Thu May 23 11:04:40 2019 +0200
[NTOS:KD] Remove some _WINDK_ usages
- Always include kd64.h - Change KdpPrompt() prototype to be compatible between KDBG and _WINDK_ - Rename KdComponentTable to KdpComponentTable to prevent a conflict - Add some functions stubs and global variables --- ntoskrnl/ex/init.c | 2 -- ntoskrnl/include/internal/kd.h | 10 ---------- ntoskrnl/include/internal/ntoskrnl.h | 4 ---- ntoskrnl/kd/kdmain.c | 35 ++++++++++++++++++++++++++--------- ntoskrnl/kdbg/kdb.h | 1 + ntoskrnl/kdbg/kdb_cli.c | 6 ++++-- ntoskrnl/ke/bug.c | 4 ---- ntoskrnl/ps/psmgr.c | 2 -- 8 files changed, 31 insertions(+), 33 deletions(-)
diff --git a/ntoskrnl/ex/init.c b/ntoskrnl/ex/init.c index 1e31003af6b..39869a5b061 100644 --- a/ntoskrnl/ex/init.c +++ b/ntoskrnl/ex/init.c @@ -1792,10 +1792,8 @@ Phase1InitializationDiscard(IN PVOID Context) /* Update progress bar */ InbvUpdateProgressBar(25);
-#ifdef _WINKD_ /* No KD Time Slip is pending */ KdpTimeSlipPending = 0; -#endif
/* Initialize in-place execution support */ XIPInit(LoaderBlock); diff --git a/ntoskrnl/include/internal/kd.h b/ntoskrnl/include/internal/kd.h index 3e57fc2c30a..162ece58f71 100644 --- a/ntoskrnl/include/internal/kd.h +++ b/ntoskrnl/include/internal/kd.h @@ -189,16 +189,6 @@ KdpPrintString( _In_ ULONG Length, _In_ KPROCESSOR_MODE PreviousMode);
-ULONG -NTAPI -KdpPrompt( - _In_reads_bytes_(InStringLength) PCHAR UnsafeInString, - _In_ USHORT InStringLength, - _Out_writes_bytes_(OutStringLength) PCHAR UnsafeOutString, - _In_ USHORT OutStringLength, - _In_ KPROCESSOR_MODE PreviousMode -); - BOOLEAN NTAPI KdpDetectConflicts(PCM_RESOURCE_LIST DriverList); diff --git a/ntoskrnl/include/internal/ntoskrnl.h b/ntoskrnl/include/internal/ntoskrnl.h index d0dfe4dbde1..b3dd74f196b 100644 --- a/ntoskrnl/include/internal/ntoskrnl.h +++ b/ntoskrnl/include/internal/ntoskrnl.h @@ -61,11 +61,7 @@ #include "po.h" #include "se.h" #include "ldr.h" -#ifndef _WINKD_ -#include "kd.h" -#else #include "kd64.h" -#endif #include "fsrtl.h" #include "lpc.h" #include "rtl.h" diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c index d613848bef2..fdbeeea4deb 100644 --- a/ntoskrnl/kd/kdmain.c +++ b/ntoskrnl/kd/kdmain.c @@ -21,6 +21,8 @@ BOOLEAN KdPitchDebugger = TRUE; BOOLEAN KdIgnoreUmExceptions = FALSE; KD_CONTEXT KdpContext; ULONG Kd_WIN2000_Mask; +LONG KdpTimeSlipPending; +KDDEBUGGER_DATA64 KdDebuggerDataBlock; VOID NTAPI PspDumpThreads(BOOLEAN SystemThreads);
typedef struct @@ -29,7 +31,7 @@ typedef struct ULONG Level; } KD_COMPONENT_DATA; #define MAX_KD_COMPONENT_TABLE_ENTRIES 128 -KD_COMPONENT_DATA KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]; +KD_COMPONENT_DATA KdpComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]; ULONG KdComponentTableEntries = 0;
ULONG Kd_DEFAULT_MASK = 1 << DPFLTR_ERROR_LEVEL; @@ -204,7 +206,9 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame, ExceptionInformation[2], OutString, OutStringLength, - PreviousMode); + PreviousMode, + TrapFrame, + ExceptionFrame);
/* Return the number of characters that we received */ Context->Eax = ReturnValue; @@ -264,6 +268,12 @@ KdIsThisAKdTrap(IN PEXCEPTION_RECORD ExceptionRecord,
/* PUBLIC FUNCTIONS *********************************************************/
+VOID +NTAPI +KdUpdateDataBlock(VOID) +{ +} + /* * @implemented */ @@ -302,6 +312,13 @@ KdDisableDebugger(VOID) return STATUS_SUCCESS; }
+NTSTATUS +NTAPI +KdEnableDebuggerWithLock(IN BOOLEAN NeedLock) +{ + return STATUS_ACCESS_DENIED; +} + /* * @implemented */ @@ -383,10 +400,10 @@ NtQueryDebugFilterState(IN ULONG ComponentId, for (i = 0; i < KdComponentTableEntries; i++) { /* Check if it is the right component */ - if (ComponentId == KdComponentTable[i].ComponentId) + if (ComponentId == KdpComponentTable[i].ComponentId) { /* Check if mask are matching */ - return (Level & KdComponentTable[i].Level) ? TRUE : FALSE; + return (Level & KdpComponentTable[i].Level) ? TRUE : FALSE; } } } @@ -423,7 +440,7 @@ NtSetDebugFilterState(IN ULONG ComponentId, /* Search for an existing entry */ for (i = 0; i < KdComponentTableEntries; i++ ) { - if (ComponentId == KdComponentTable[i].ComponentId) + if (ComponentId == KdpComponentTable[i].ComponentId) break; }
@@ -436,15 +453,15 @@ NtSetDebugFilterState(IN ULONG ComponentId,
/* Add a new entry */ ++KdComponentTableEntries; - KdComponentTable[i].ComponentId = ComponentId; - KdComponentTable[i].Level = Kd_DEFAULT_MASK; + KdpComponentTable[i].ComponentId = ComponentId; + KdpComponentTable[i].Level = Kd_DEFAULT_MASK; }
/* Update entry table */ if (State) - KdComponentTable[i].Level |= Level; + KdpComponentTable[i].Level |= Level; else - KdComponentTable[i].Level &= ~Level; + KdpComponentTable[i].Level &= ~Level;
return STATUS_SUCCESS; } diff --git a/ntoskrnl/kdbg/kdb.h b/ntoskrnl/kdbg/kdb.h index 65bedf227af..b6419079e61 100644 --- a/ntoskrnl/kdbg/kdb.h +++ b/ntoskrnl/kdbg/kdb.h @@ -1,4 +1,5 @@ #pragma once +#include "internal/kd.h"
/* DEFINES *******************************************************************/
diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index 5ef7f616af0..4009e0a7319 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -3672,14 +3672,16 @@ KdpSerialDebugPrint( STRING KdpPromptString = RTL_CONSTANT_STRING("kdb:> "); extern KSPIN_LOCK KdpSerialSpinLock;
-ULONG +USHORT NTAPI KdpPrompt( _In_reads_bytes_(InStringLength) PCHAR UnsafeInString, _In_ USHORT InStringLength, _Out_writes_bytes_(OutStringLength) PCHAR UnsafeOutString, _In_ USHORT OutStringLength, - _In_ KPROCESSOR_MODE PreviousMode) + _In_ KPROCESSOR_MODE PreviousMode, + _In_ PKTRAP_FRAME TrapFrame, + _In_ PKEXCEPTION_FRAME ExceptionFrame) { USHORT i; CHAR Response; diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c index a92acb1baba..3208e6ba687 100644 --- a/ntoskrnl/ke/bug.c +++ b/ntoskrnl/ke/bug.c @@ -1062,9 +1062,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, }
/* Check if we need to save the context for KD */ -#ifdef _WINKD_ if (!KdPitchDebugger) KdDebuggerDataBlock.SavedContext = (ULONG_PTR)&Context; -#endif
/* Check if a debugger is connected */ if ((BugCheckCode != MANUALLY_INITIATED_CRASH) && (KdDebuggerEnabled)) @@ -1147,9 +1145,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, if (!(KdDebuggerEnabled) && !(KdPitchDebugger)) { /* Enable it */ -#ifdef _WINKD_ KdEnableDebuggerWithLock(FALSE); -#endif } else { diff --git a/ntoskrnl/ps/psmgr.c b/ntoskrnl/ps/psmgr.c index 317861c1288..4b70413653a 100644 --- a/ntoskrnl/ps/psmgr.c +++ b/ntoskrnl/ps/psmgr.c @@ -383,10 +383,8 @@ PspInitializeSystemDll(VOID) KeBugCheckEx(PROCESS1_INITIALIZATION_FAILED, Status, 8, 0, 0); }
-#ifdef _WINKD_ /* Let KD know we are done */ KdUpdateDataBlock(); -#endif
/* Return status */ return Status;