* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/dbg/kdb_cli.c
* PURPOSE: Kernel debugger command line interface
* PROGRAMMER: Gregor Anich (blight@blight.eu.org)
+ * Hervé Poussineau
* UPDATE HISTORY:
* Created 16/01/2005
*/
#include <ntoskrnl.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
/* DEFINES *******************************************************************/
STATIC BOOLEAN KdbpCmdTss(ULONG Argc, PCHAR Argv[]);
STATIC BOOLEAN KdbpCmdBugCheck(ULONG Argc, PCHAR Argv[]);
+STATIC BOOLEAN KdbpCmdFilter(ULONG Argc, PCHAR Argv[]);
STATIC BOOLEAN KdbpCmdSet(ULONG Argc, PCHAR Argv[]);
STATIC BOOLEAN KdbpCmdHelp(ULONG Argc, PCHAR Argv[]);
STATIC LONG KdbNumberOfColsTerminal = -1;
PCHAR KdbInitFileBuffer = NULL; /* Buffer where KDBinit file is loaded into during initialization */
+BOOLEAN KdbpBugCheckRequested = FALSE;
STATIC CONST struct
{
/* Others */
{ NULL, NULL, "Others", NULL },
{ "bugcheck", "bugcheck", "Bugchecks the system.", KdbpCmdBugCheck },
+ { "filter", "filter [error|warning|trace|info|level]+|-[componentname|default]", "Enable/disable debug channels", KdbpCmdFilter },
{ "set", "set [var] [value]", "Sets var to value or displays value of var.", KdbpCmdSet },
{ "help", "help", "Display help screen.", KdbpCmdHelp }
};
/* FUNCTIONS *****************************************************************/
+/*!\brief Transform a component name to an integer
+ *
+ * \param ComponentName The name of the component.
+ * \param ComponentId Receives the component id on success.
+ *
+ * \retval TRUE Success.
+ * \retval FALSE Failure.
+ */
+STATIC BOOLEAN
+KdbpGetComponentId(
+ IN PCCH ComponentName,
+ OUT PULONG ComponentId)
+{
+ ULONG i;
+
+ static struct {
+ PCCH Name;
+ ULONG Id;
+ } ComponentTable[] = {
+ { "DEFAULT", DPFLTR_DEFAULT_ID },
+ { "SYSTEM", DPFLTR_SYSTEM_ID },
+ { "SMSS", DPFLTR_SMSS_ID },
+ { "SETUP", DPFLTR_SETUP_ID },
+ { "NTFS", DPFLTR_NTFS_ID },
+ { "FSTUB", DPFLTR_FSTUB_ID },
+ { "CRASHDUMP", DPFLTR_CRASHDUMP_ID },
+ { "CDAUDIO", DPFLTR_CDAUDIO_ID },
+ { "CDROM", DPFLTR_CDROM_ID },
+ { "CLASSPNP", DPFLTR_CLASSPNP_ID },
+ { "DISK", DPFLTR_DISK_ID },
+ { "REDBOOK", DPFLTR_REDBOOK_ID },
+ { "STORPROP", DPFLTR_STORPROP_ID },
+ { "SCSIPORT", DPFLTR_SCSIPORT_ID },
+ { "SCSIMINIPORT", DPFLTR_SCSIMINIPORT_ID },
+ { "CONFIG", DPFLTR_CONFIG_ID },
+ { "I8042PRT", DPFLTR_I8042PRT_ID },
+ { "SERMOUSE", DPFLTR_SERMOUSE_ID },
+ { "LSERMOUS", DPFLTR_LSERMOUS_ID },
+ { "KBDHID", DPFLTR_KBDHID_ID },
+ { "MOUHID", DPFLTR_MOUHID_ID },
+ { "KBDCLASS", DPFLTR_KBDCLASS_ID },
+ { "MOUCLASS", DPFLTR_MOUCLASS_ID },
+ { "TWOTRACK", DPFLTR_TWOTRACK_ID },
+ { "WMILIB", DPFLTR_WMILIB_ID },
+ { "ACPI", DPFLTR_ACPI_ID },
+ { "AMLI", DPFLTR_AMLI_ID },
+ { "HALIA64", DPFLTR_HALIA64_ID },
+ { "VIDEO", DPFLTR_VIDEO_ID },
+ { "SVCHOST", DPFLTR_SVCHOST_ID },
+ { "VIDEOPRT", DPFLTR_VIDEOPRT_ID },
+ { "TCPIP", DPFLTR_TCPIP_ID },
+ { "DMSYNTH", DPFLTR_DMSYNTH_ID },
+ { "NTOSPNP", DPFLTR_NTOSPNP_ID },
+ { "FASTFAT", DPFLTR_FASTFAT_ID },
+ { "SAMSS", DPFLTR_SAMSS_ID },
+ { "PNPMGR", DPFLTR_PNPMGR_ID },
+ { "NETAPI", DPFLTR_NETAPI_ID },
+ { "SCSERVER", DPFLTR_SCSERVER_ID },
+ { "SCCLIENT", DPFLTR_SCCLIENT_ID },
+ { "SERIAL", DPFLTR_SERIAL_ID },
+ { "SERENUM", DPFLTR_SERENUM_ID },
+ { "UHCD", DPFLTR_UHCD_ID },
+ { "BOOTOK", DPFLTR_BOOTOK_ID },
+ { "BOOTVRFY", DPFLTR_BOOTVRFY_ID },
+ { "RPCPROXY", DPFLTR_RPCPROXY_ID },
+ { "AUTOCHK", DPFLTR_AUTOCHK_ID },
+ { "DCOMSS", DPFLTR_DCOMSS_ID },
+ { "UNIMODEM", DPFLTR_UNIMODEM_ID },
+ { "SIS", DPFLTR_SIS_ID },
+ { "FLTMGR", DPFLTR_FLTMGR_ID },
+ { "WMICORE", DPFLTR_WMICORE_ID },
+ { "BURNENG", DPFLTR_BURNENG_ID },
+ { "IMAPI", DPFLTR_IMAPI_ID },
+ { "SXS", DPFLTR_SXS_ID },
+ { "FUSION", DPFLTR_FUSION_ID },
+ { "IDLETASK", DPFLTR_IDLETASK_ID },
+ { "SOFTPCI", DPFLTR_SOFTPCI_ID },
+ { "TAPE", DPFLTR_TAPE_ID },
+ { "MCHGR", DPFLTR_MCHGR_ID },
+ { "IDEP", DPFLTR_IDEP_ID },
+ { "PCIIDE", DPFLTR_PCIIDE_ID },
+ { "FLOPPY", DPFLTR_FLOPPY_ID },
+ { "FDC", DPFLTR_FDC_ID },
+ { "TERMSRV", DPFLTR_TERMSRV_ID },
+ { "W32TIME", DPFLTR_W32TIME_ID },
+ { "PREFETCHER", DPFLTR_PREFETCHER_ID },
+ { "RSFILTER", DPFLTR_RSFILTER_ID },
+ { "FCPORT", DPFLTR_FCPORT_ID },
+ { "PCI", DPFLTR_PCI_ID },
+ { "DMIO", DPFLTR_DMIO_ID },
+ { "DMCONFIG", DPFLTR_DMCONFIG_ID },
+ { "DMADMIN", DPFLTR_DMADMIN_ID },
+ { "WSOCKTRANSPORT", DPFLTR_WSOCKTRANSPORT_ID },
+ { "VSS", DPFLTR_VSS_ID },
+ { "PNPMEM", DPFLTR_PNPMEM_ID },
+ { "PROCESSOR", DPFLTR_PROCESSOR_ID },
+ { "DMSERVER", DPFLTR_DMSERVER_ID },
+ { "SR", DPFLTR_SR_ID },
+ { "INFINIBAND", DPFLTR_INFINIBAND_ID },
+ { "IHVDRIVER", DPFLTR_IHVDRIVER_ID },
+ { "IHVVIDEO", DPFLTR_IHVVIDEO_ID },
+ { "IHVAUDIO", DPFLTR_IHVAUDIO_ID },
+ { "IHVNETWORK", DPFLTR_IHVNETWORK_ID },
+ { "IHVSTREAMING", DPFLTR_IHVSTREAMING_ID },
+ { "IHVBUS", DPFLTR_IHVBUS_ID },
+ { "HPS", DPFLTR_HPS_ID },
+ { "RTLTHREADPOOL", DPFLTR_RTLTHREADPOOL_ID },
+ { "LDR", DPFLTR_LDR_ID },
+ { "TCPIP6", DPFLTR_TCPIP6_ID },
+ { "ISAPNP", DPFLTR_ISAPNP_ID },
+ { "SHPC", DPFLTR_SHPC_ID },
+ { "STORPORT", DPFLTR_STORPORT_ID },
+ { "STORMINIPORT", DPFLTR_STORMINIPORT_ID },
+ { "PRINTSPOOLER", DPFLTR_PRINTSPOOLER_ID },
+ };
+
+ for (i = 0; i < sizeof(ComponentTable) / sizeof(ComponentTable[0]); i++)
+ if (_stricmp(ComponentName, ComponentTable[i].Name) == 0)
+ {
+ *ComponentId = ComponentTable[i].Id;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/*!\brief Evaluates an expression...
*
* Much like KdbpRpnEvaluateExpression, but prints the error message (if any)
STATIC BOOLEAN
KdbpCmdEvalExpression(ULONG Argc, PCHAR Argv[])
{
- UINT i, len;
+ ULONG i, len;
ULONGLONG Result = 0;
ULONG ul;
LONG l = 0;
return TRUE;
}
+/*!\brief Display list of active debug channels
+ */
+STATIC BOOLEAN
+KdbpCmdFilter(ULONG Argc, PCHAR Argv[])
+{
+ ULONG i, j, ComponentId, Level;
+ ULONG set = DPFLTR_MASK, clear = DPFLTR_MASK;
+ PCHAR pend;
+ LPCSTR opt, p;
+ static struct {
+ LPCSTR Name;
+ ULONG Level;
+ } debug_classes[] = {
+ { "error", 1 << DPFLTR_ERROR_LEVEL },
+ { "warning", 1 << DPFLTR_WARNING_LEVEL },
+ { "trace", 1 << DPFLTR_TRACE_LEVEL },
+ { "info", 1 << DPFLTR_INFO_LEVEL },
+ };
+
+ for (i = 1; i < Argc; i++)
+ {
+ opt = Argv[i];
+ p = opt + strcspn(opt, "+-");
+ if (!p[0]) p = opt; /* assume it's a debug channel name */
+
+ if (p > opt)
+ {
+ for (j = 0; j < sizeof(debug_classes) / sizeof(debug_classes[0]); j++)
+ {
+ SIZE_T len = strlen(debug_classes[j].Name);
+ if (len != (p - opt))
+ continue;
+ if (_strnicmp(opt, debug_classes[j].Name, len) == 0) /* found it */
+ {
+ if (*p == '+')
+ set |= debug_classes[j].Level;
+ else
+ clear |= debug_classes[j].Level;
+ break;
+ }
+ }
+ if (j == sizeof(debug_classes) / sizeof(debug_classes[0]))
+ {
+ Level = strtoul(opt, &pend, 0);
+ if (pend != p)
+ {
+ KdbpPrint("filter: bad class name '%.*s'\n", p - opt, opt);
+ continue;
+ }
+ if (*p == '+')
+ set |= Level;
+ else
+ clear |= Level;
+ }
+ }
+ else
+ {
+ if (*p == '-')
+ clear = ~0;
+ else
+ set = ~0;
+ }
+ if (*p == '+' || *p == '-')
+ p++;
+
+ if (!KdbpGetComponentId(p, &ComponentId))
+ {
+ KdbpPrint("filter: '%s' is not a valid component name!\n", p);
+ return TRUE;
+ }
+
+ /* Get current mask value */
+ NtSetDebugFilterState(ComponentId, set, TRUE);
+ NtSetDebugFilterState(ComponentId, clear, FALSE);
+ }
+
+ return TRUE;
+}
+
/*!\brief Disassembles 10 instructions at eip or given address or
* displays 16 dwords from memory at given address.
*/
else if (Argv[0][0] == 'c') /* cregs */
{
ULONG Cr0, Cr2, Cr3, Cr4;
- KDESCRIPTOR Gdtr, Ldtr, Idtr;
- ULONG Tr;
+ KDESCRIPTOR Gdtr = {0}, Ldtr = {0}, Idtr = {0};
+ ULONG Tr = 0;
STATIC CONST PCHAR Cr0Bits[32] = { " PE", " MP", " EM", " TS", " ET", " NE", NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
" WP", NULL, " AM", NULL, NULL, NULL, NULL, NULL,
Cr4 = KdbCurrentTrapFrame->Cr4;
/* Get descriptor table regs */
- asm volatile("sgdt %0" : : "m"(Gdtr.Limit));
- asm volatile("sldt %0" : : "m"(Ldtr.Limit));
- asm volatile("sidt %0" : : "m"(Idtr.Limit));
+ Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&Gdtr.Limit);
+ Ke386GetLocalDescriptorTable(Ldtr.Limit);
+ Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&Idtr.Limit);
/* Get the task register */
- asm volatile("str %0" : "=g"(Tr));
+ Ke386GetTr(Tr);
/* Display the control registers */
KdbpPrint("CR0 0x%08x ", Cr0);
KDB_BREAKPOINT_TYPE Type;
UCHAR Size = 0;
KDB_ACCESS_TYPE AccessType = 0;
- UINT AddressArgIndex, ConditionArgIndex, i;
+ ULONG AddressArgIndex, i;
+ LONG ConditionArgIndex;
BOOLEAN Global = TRUE;
if (Argv[0][2] == 'x') /* software breakpoint */
PLIST_ENTRY Entry;
PETHREAD Thread = NULL;
PEPROCESS Process = NULL;
+ BOOLEAN ReferencedThread = FALSE, ReferencedProcess = FALSE;
PULONG Esp;
PULONG Ebp;
ULONG Eip;
KdbpPrint("thread: Invalid process id!\n");
return TRUE;
}
+
+ /* Remember our reference */
+ ReferencedProcess = TRUE;
}
Entry = Process->ThreadListHead.Flink;
KdbpPrint("No threads in process 0x%08x!\n", ul);
else
KdbpPrint("No threads in current process!\n");
+ if (ReferencedProcess) ObDereferenceObject(Process);
return TRUE;
}
Entry = Entry->Flink;
}
while (Entry != &Process->ThreadListHead);
+
+ /* Release our reference, if any */
+ if (ReferencedProcess) ObDereferenceObject(Process);
}
else if (Argc >= 2 && _stricmp(Argv[1], "attach") == 0)
{
KdbpPrint("thread: Invalid thread id!\n");
return TRUE;
}
+
+ /* Remember our reference */
+ ReferencedThread = TRUE;
}
if (Thread->Tcb.State < (DeferredReady + 1))
Thread->Tcb.TrapFrame,
NPX_STATE_TO_STRING(Thread->Tcb.NpxState), Thread->Tcb.NpxState);
+ /* Release our reference if we had one */
+ if (ReferencedThread) ObDereferenceObject(Thread);
}
return TRUE;
{
PLIST_ENTRY Entry;
PEPROCESS Process;
+ BOOLEAN ReferencedProcess = FALSE;
PCHAR State, pend, str1, str2;
ULONG ul;
extern LIST_ENTRY PsActiveProcessHead;
if (Argc >= 2 && _stricmp(Argv[1], "list") == 0)
{
Entry = PsActiveProcessHead.Flink;
- if (Entry == &PsActiveProcessHead)
+ if (!Entry || Entry == &PsActiveProcessHead)
{
KdbpPrint("No processes in the system!\n");
return TRUE;
{
return TRUE;
}
- KdbpPrint("Attached to process 0x%08x, thread 0x%08x.\n", (UINT)ul,
- (UINT)KdbCurrentThread->Cid.UniqueThread);
+ KdbpPrint("Attached to process 0x%08x, thread 0x%08x.\n", (ULONG)ul,
+ (ULONG)KdbCurrentThread->Cid.UniqueThread);
}
else
{
KdbpPrint("proc: Invalid process id!\n");
return TRUE;
}
+
+ /* Remember our reference */
+ ReferencedProcess = TRUE;
}
State = ((Process->Pcb.State == ProcessInMemory) ? "In Memory" :
Process->UniqueProcessId,
State, Process->Pcb.State,
Process->ImageFileName);
+
+ /* Release our reference, if any */
+ if (ReferencedProcess) ObDereferenceObject(Process);
}
return TRUE;
{
if (!KdbpSymFindModuleByIndex(0, &Info))
{
- KdbpPrint("No modules.\n");
- return TRUE;
+ ULONG_PTR ntoskrnlBase = ((ULONG_PTR)KdbpCmdMod) & 0xfff00000;
+ KdbpPrint(" Base Size Name\n");
+ KdbpPrint(" %08x %08x %s\n", ntoskrnlBase, 0, "ntoskrnl.exe");
+ return TRUE;
}
i = 1;
}
STATIC BOOLEAN
KdbpCmdGdtLdtIdt(ULONG Argc, PCHAR Argv[])
{
- struct __attribute__((packed)) {
- USHORT Limit;
- ULONG Base;
- } Reg;
+ KDESCRIPTOR Reg = {0};
ULONG SegDesc[2];
ULONG SegBase;
ULONG SegLimit;
if (Argv[0][0] == 'i')
{
/* Read IDTR */
- asm volatile("sidt %0" : : "m"(Reg));
+ Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&Reg.Limit);
if (Reg.Limit < 7)
{
if (Argv[0][0] == 'g')
{
/* Read GDTR */
- asm volatile("sgdt %0" : : "m"(Reg));
+ Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&Reg.Limit);
i = 8;
}
else
{
ASSERT(Argv[0][0] == 'l');
/* Read LDTR */
- asm volatile("sldt %0" : : "m"(Reg));
+ Ke386GetLocalDescriptorTable(Reg.Limit);
i = 0;
ul = 1 << 2;
}
STATIC BOOLEAN
KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
{
- PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
+ PKIPCR Pcr = (PKIPCR)KeGetPcr();
KdbpPrint("Current PCR is at 0x%08x.\n", (INT)Pcr);
KdbpPrint(" Tib.ExceptionList: 0x%08x\n"
STATIC BOOLEAN
KdbpCmdTss(ULONG Argc, PCHAR Argv[])
{
- KTSS *Tss = KeGetCurrentKPCR()->TSS;
+ KTSS *Tss = KeGetPcr()->TSS;
KdbpPrint("Current TSS is at 0x%08x.\n", (INT)Tss);
KdbpPrint(" Eip: 0x%08x\n"
STATIC BOOLEAN
KdbpCmdBugCheck(ULONG Argc, PCHAR Argv[])
{
- KEBUGCHECK(0xDEADDEAD);
- return TRUE;
+ /* Set the flag and quit looping */
+ KdbpBugCheckRequested = TRUE;
+ return FALSE;
}
/*!\brief Sets or displays a config variables value.
STATIC BOOLEAN
KdbpCmdSet(ULONG Argc, PCHAR Argv[])
{
- ULONG l;
+ LONG l;
BOOLEAN First;
PCHAR pend = 0;
KDB_ENTER_CONDITION ConditionFirst = KdbDoNotEnter;
STATIC BOOLEAN TerminalReportsSize = TRUE;
CHAR c = '\0';
PCHAR p, p2;
- UINT Length;
- UINT i, j;
- INT RowsPrintedByTerminal;
+ ULONG Length;
+ ULONG i, j;
+ LONG RowsPrintedByTerminal;
ULONG ScanCode;
va_list ap;
TerminalInitialized = TRUE;
Length = 0;
+ KeStallExecutionProcessor(100000);
+
for (;;)
{
c = KdbpTryGetCharSerial(5000);
{
/* Try to query number of rows from terminal. A reply looks like "\x1b[8;24;80t" */
TerminalReportsSize = FALSE;
+ KeStallExecutionProcessor(100000);
DbgPrint("\x1b[18t");
c = KdbpTryGetCharSerial(5000);
if (c == KEY_ESC)
}
}
}
+ /* Clear further characters */
+ while ((c = KdbpTryGetCharSerial(5000)) != -1);
}
}
while (!isalpha(p2[j++]));
strcpy(p2, p2 + j);
}
+ else
+ {
+ strcpy(p2, p2 + 1);
+ }
}
}
- DbgPrint("%s", p);
+ DbgPrint("%s", p);
if (c != '\0')
p[i + 1] = c;
/* Read the next char - this is to throw away a \n which most clients should
* send after \r.
*/
+ KeStallExecutionProcessor(100000);
if (KdbDebugState & KD_DEBUG_KDSERIAL)
NextKey = KdbpTryGetCharSerial(5);
else
NextKey = KdbpTryGetCharKeyboard(&ScanCode, 5);
if (NextKey == '\n' || NextKey == -1) /* \n or no response at all */
NextKey = '\0';
- DbgPrint("\n");
+ KdbpPrint("\n");
/*
* Repeat the last command if the user presses enter. Reduces the
* risk of RSI when single-stepping.
Buffer--;
*Buffer = 0;
if (EchoOn)
- DbgPrint("%c %c", KEY_BS, KEY_BS);
+ KdbpPrint("%c %c", KEY_BS, KEY_BS);
else
- DbgPrint(" %c", KEY_BS);
+ KdbpPrint(" %c", KEY_BS);
}
}
else if (ScanCode == KEY_SCAN_UP)
Buffer--;
*Buffer = 0;
if (EchoOn)
- DbgPrint("%c %c", KEY_BS, KEY_BS);
+ KdbpPrint("%c %c", KEY_BS, KEY_BS);
else
- DbgPrint(" %c", KEY_BS);
+ KdbpPrint(" %c", KEY_BS);
}
i = min(strlen(KdbCommandHistory[CmdHistIndex]), Size - 1);
memcpy(Orig, KdbCommandHistory[CmdHistIndex], i);
Orig[i] = '\0';
Buffer = Orig + i;
- DbgPrint("%s", Orig);
+ KdbpPrint("%s", Orig);
}
}
else if (ScanCode == KEY_SCAN_DOWN)
Buffer--;
*Buffer = 0;
if (EchoOn)
- DbgPrint("%c %c", KEY_BS, KEY_BS);
+ KdbpPrint("%c %c", KEY_BS, KEY_BS);
else
- DbgPrint(" %c", KEY_BS);
+ KdbpPrint(" %c", KEY_BS);
}
i = min(strlen(KdbCommandHistory[CmdHistIndex]), Size - 1);
memcpy(Orig, KdbCommandHistory[CmdHistIndex], i);
Orig[i] = '\0';
Buffer = Orig + i;
- DbgPrint("%s", Orig);
+ KdbpPrint("%s", Orig);
}
}
}
else
{
if (EchoOn)
- DbgPrint("%c", Key);
+ KdbpPrint("%c", Key);
*Buffer = Key;
Buffer++;
* \retval TRUE Don't continue execution.
* \retval FALSE Continue execution (leave KDB)
*/
-STATIC BOOL
+STATIC BOOLEAN
KdbpDoCommand(
IN PCHAR Command)
{
{
if (!KdbSymPrintAddress((PVOID)KdbCurrentTrapFrame->Tf.Eip))
{
- DbgPrint("<%x>", KdbCurrentTrapFrame->Tf.Eip);
+ KdbpPrint("<%x>", KdbCurrentTrapFrame->Tf.Eip);
}
- DbgPrint(": ");
+ KdbpPrint(": ");
if (KdbpDisassemble(KdbCurrentTrapFrame->Tf.Eip, KdbUseIntelSyntax) < 0)
{
- DbgPrint("<INVALID>");
+ KdbpPrint("<INVALID>");
}
- DbgPrint("\n");
+ KdbpPrint("\n");
}
/* Flush the input buffer */
do
{
/* Print the prompt */
- DbgPrint("kdb:> ");
+ KdbpPrint("kdb:> ");
/* Read a command and remember it */
KdbpReadCommand(Command, sizeof (Command));
if (!KdbBreakOnModuleLoad)
return;
- DbgPrint("Module %wZ loaded.\n", Name);
+ KdbpPrint("Module %wZ loaded.\n", Name);
DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C);
}
HANDLE hFile = NULL;
INT FileSize;
PCHAR FileBuffer;
- ULONG OldEflags;
+ ULONG OldEflags = 0;
/* Initialize the object attributes */
RtlInitUnicodeString(&FileName, L"\\SystemRoot\\system32\\drivers\\etc\\KDBinit");
/* Enter critical section */
Ke386SaveFlags(OldEflags);
- Ke386DisableInterrupts();
+ _disable();
/* Interpret the init file... */
KdbInitFileBuffer = FileBuffer;