Author: ion
Date: Thu Mar 1 22:51:20 2007
New Revision: 25937
URL:
http://svn.reactos.org/svn/reactos?rev=25937&view=rev
Log:
- Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception code,
so that usermode/SEH filters get proper exception codes again.
- Fixes and compatible merges from KD Branch:
- Add stubs for KdSave, KdRestore, KdDebuggerInitialize0, KdSendPacket, KdReceivePacket
to kdcom.dll
- Implement and export KeTryToAcquireSpinLockAtDpcLevel.
- Add EXCEPTION_RECORD64 and LIST_ENTRY64, KeTryToAcquireSpinLockAtDpcLevel,
BREAKPOINT_COMMAND_STRING, Ke386SetCr2, Ke386SetDr3, Ke386SetDr6.
- Remove non-kernel routines from kdfuncs.h and remove deprecated routines from ke.h.
- Implement KiRestoreProcessorControlState, KeFreezeExecution, KeThawExecution,
ExAcquireTimeRefreshLock, ExReleaseTimeRefreshLock.
- Rename ModuleLoadList to PsLoadedModuleList. Add PsNtosImageBase and set value in it.
- Add skeleton wdbgexts.h with what's needed until now, this is a PSDK header.
- Add kddll.h for KDCOM/1394/USB2.DLL prototypes.
- Add windbgkd.h with KD protocol definitions. Used to be an NT5 DDK header, but was
removed, so this goes into include\reactos.
- Fix KiDebugService to load EDX from KTRAP_FRAME_EDX, not KTRAP_FRAME_EAX!.
- Fix CommonDispatchException to check for the argument count in ECX, not EAX. Previously
we were ignoring parameter counts and never filling out exception records!
- Add KdDebuggerInitialize1 and enable call to it.
- Fix KD_SYMBOLS_INFO definition and DbgLoadImageSymbols prototype.
- Implement DbgUnLoadImageSymbols.
- Fix some small bugs in KeBugCheckWithTf and add various debugger calls/checks where
needed.
- Fix bugcheck recursion code which was incorrect.
- Only save/restore CR4 if KeFeatureBits indicates CR4 support exists.
- Export KdDebuggerNotPresent since KDCOM needs it.
- Add KCONTINUE_STATUS.
- Add DBGKD_ANY_CONTROL_SET and X86/IA64/AMD64 control sets.
- Add DBGKD_MANIPULATE_STATE64 and all sub-structures (READ_MEMORY, WRITE_MEMORY, etc).
- Create GCC_ULONG64 type to hack around a bug in GCC which is incapable of creating
entries for externals at compile-time for 64-bit pointers.
- Rename NameSpaceRoot to ObpRootDirectoryObject, IopLogListHead to IopErrorLogListHead,
BugcheckCallbackListHead to KeBugcheckCallbackListHead, BugcheckReasonCallbackListHead to
KeBugcheckReasonCallbackListHead, ObTypeObjectType to ObpTypeObjectType.
- Create ntverp.h and common.ver files. These are the standard files used by the NT/DDK
build systems and we should try to support them as well instead of re-defining everything
our own way (especially if we want to build ddk-compatible drivers later on).
- Made init.c use version data from ntverp.h instead of hard-coding.
- Defined NT 5.2.3790.1830 as the version we report.
- Fixed up .rc file to be correct and match DDK-sytnax/style.
- For now only the kernel uses this new versionning scheme, but we should change the
build system later to use this for every component.
- Fix KiSaveProcessorControlState and KiRestoreProcessorControlSate. The latter
doesn't freeze the CPU anymore so it's enabled, and the former doesn't cause
WinDBG to panic anymore and display weird data.
- KPROCESSOR_STATE is not 4-byte aligned.
- Use DR_MASK and DR7_OVERRIDE_V in KiUpdateDr7, KiRecordDr7 instead of DR_ACTIVE_MASK.
- Add ExceptionRecord32To64.
- Fix generation of driver name for symbol load.
Added:
trunk/reactos/include/psdk/common.ver
- copied unchanged from r25930,
branches/alex-kd-branch/reactos/include/psdk/common.ver
trunk/reactos/include/psdk/ntverp.h
- copied unchanged from r25930,
branches/alex-kd-branch/reactos/include/psdk/ntverp.h
trunk/reactos/include/psdk/wdbgexts.h
trunk/reactos/include/reactos/kddll.h
trunk/reactos/include/reactos/windbgkd.h
Modified:
trunk/reactos/drivers/base/kdcom/kdbg.c
trunk/reactos/include/ddk/ntifs.h
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ndk/asm.h
trunk/reactos/include/ndk/i386/ketypes.h
trunk/reactos/include/ndk/kdfuncs.h
trunk/reactos/include/ndk/kdtypes.h
trunk/reactos/include/ndk/ketypes.h
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/include/psdk/ntdef.h
trunk/reactos/lib/rtl/debug.c
trunk/reactos/lib/rtl/i386/debug_asm.S
trunk/reactos/ntoskrnl/cm/regobj.c
trunk/reactos/ntoskrnl/ex/init.c
trunk/reactos/ntoskrnl/ex/time.c
trunk/reactos/ntoskrnl/include/internal/ex.h
trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h
trunk/reactos/ntoskrnl/include/internal/i386/ke.h
trunk/reactos/ntoskrnl/include/internal/io.h
trunk/reactos/ntoskrnl/include/internal/ke.h
trunk/reactos/ntoskrnl/include/internal/ob.h
trunk/reactos/ntoskrnl/include/internal/ps.h
trunk/reactos/ntoskrnl/include/ntoskrnl.h
trunk/reactos/ntoskrnl/io/iomgr/error.c
trunk/reactos/ntoskrnl/io/iomgr/iomgr.c
trunk/reactos/ntoskrnl/kd/kdmain.c
trunk/reactos/ntoskrnl/ke/bug.c
trunk/reactos/ntoskrnl/ke/except.c
trunk/reactos/ntoskrnl/ke/i386/cpu.c
trunk/reactos/ntoskrnl/ke/i386/exp.c
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
trunk/reactos/ntoskrnl/ke/i386/trap.s
trunk/reactos/ntoskrnl/ke/krnlinit.c
trunk/reactos/ntoskrnl/ke/spinlock.c
trunk/reactos/ntoskrnl/mm/process.c
trunk/reactos/ntoskrnl/mm/rpoolmgr.h
trunk/reactos/ntoskrnl/mm/sysldr.c
trunk/reactos/ntoskrnl/ntoskrnl.rc
trunk/reactos/ntoskrnl/ob/obinit.c
trunk/reactos/ntoskrnl/ob/oblife.c
trunk/reactos/ntoskrnl/ob/obname.c
trunk/reactos/ntoskrnl/rtl/misc.c
Modified: trunk/reactos/drivers/base/kdcom/kdbg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdbg.c?…
==============================================================================
--- trunk/reactos/drivers/base/kdcom/kdbg.c (original)
+++ trunk/reactos/drivers/base/kdcom/kdbg.c Thu Mar 1 22:51:20 2007
@@ -17,6 +17,8 @@
#include <halfuncs.h>
#include <stdio.h>
#include <debug.h>
+#include "arc/arc.h"
+#include "windbgkd.h"
typedef struct _KD_PORT_INFORMATION
{
@@ -553,4 +555,77 @@
return TRUE;
}
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+KdDebuggerInitialize0(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
+{
+ /* FIXME: TODO */
+ return STATUS_UNSUCCESSFUL;
+}
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+KdDebuggerInitialize1(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
+{
+ /* FIXME: TODO */
+ return STATUS_UNSUCCESSFUL;
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+NTAPI
+KdSave(IN BOOLEAN SleepTransition)
+{
+ /* Nothing to do on COM ports */
+ return STATUS_SUCCESS;
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+NTAPI
+KdRestore(IN BOOLEAN SleepTransition)
+{
+ /* Nothing to do on COM ports */
+ return STATUS_SUCCESS;
+}
+
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+KdSendPacket(IN USHORT PacketType,
+ IN PSTRING Header,
+ IN PSTRING Data OPTIONAL,
+ OUT PKD_CONTEXT Context)
+{
+ /* FIXME: TODO */
+ return;
+}
+
+/*
+ * @unimplemented
+ */
+ULONG
+NTAPI
+KdReceivePacket(IN USHORT PacketType,
+ OUT PSTRING Header,
+ OUT PSTRING Data,
+ OUT PUSHORT DataSize,
+ OUT PKD_CONTEXT Context OPTIONAL)
+{
+ /* FIXME: TODO */
+ return 0;
+}
+
/* EOF */
Modified: trunk/reactos/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=25…
==============================================================================
--- trunk/reactos/include/ddk/ntifs.h (original)
+++ trunk/reactos/include/ddk/ntifs.h Thu Mar 1 22:51:20 2007
@@ -44,7 +44,9 @@
#pragma pack(push,4)
+#ifndef VER_PRODUCTBUILD
#define VER_PRODUCTBUILD 10000
+#endif
#ifndef NTSYSAPI
#define NTSYSAPI
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=2…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Thu Mar 1 22:51:20 2007
@@ -636,6 +636,28 @@
IN struct _IRP *Irp,
IN PVOID MapRegisterBase,
IN PVOID Context);
+
+
+typedef struct _EXCEPTION_RECORD32
+{
+ NTSTATUS ExceptionCode;
+ ULONG ExceptionFlags;
+ ULONG ExceptionRecord;
+ ULONG ExceptionAddress;
+ ULONG NumberParameters;
+ ULONG ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
+} EXCEPTION_RECORD32, *PEXCEPTION_RECORD32;
+
+typedef struct _EXCEPTION_RECORD64
+{
+ NTSTATUS ExceptionCode;
+ ULONG ExceptionFlags;
+ ULONG64 ExceptionRecord;
+ ULONG64 ExceptionAddress;
+ ULONG NumberParameters;
+ ULONG __unusedAlignment;
+ ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
+} EXCEPTION_RECORD64, *PEXCEPTION_RECORD64;
typedef EXCEPTION_DISPOSITION
(DDKAPI *PEXCEPTION_ROUTINE)(
@@ -5425,6 +5447,13 @@
IN PKSPIN_LOCK SpinLock,
IN KIRQL NewIrql);
+NTKERNELAPI
+BOOLEAN
+FASTCALL
+KeTryToAcquireSpinLockAtDpcLevel(
+ IN OUT PKSPIN_LOCK SpinLock
+);
+
#define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
#define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a)
Modified: trunk/reactos/include/ndk/asm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/asm.h?rev=2593…
==============================================================================
--- trunk/reactos/include/ndk/asm.h (original)
+++ trunk/reactos/include/ndk/asm.h Thu Mar 1 22:51:20 2007
@@ -494,6 +494,7 @@
#define DR6_LEGAL 0xE00F
#define DR7_LEGAL 0xFFFF0155
#define DR7_ACTIVE 0x55
+#define DR7_OVERRIDE_V 0x04
#define DR7_RESERVED_MASK 0xDC00
#define DR7_OVERRIDE_MASK 0xF0000
@@ -503,6 +504,7 @@
#define CBSTACK_STACK 0x0
#define CBSTACK_TRAP_FRAME 0x4
#define CBSTACK_CALLBACK_STACK 0x8
+#define CBSTACK_EBP 0x18
#define CBSTACK_RESULT 0x20
#define CBSTACK_RESULT_LENGTH 0x24
Modified: trunk/reactos/include/ndk/i386/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/ketypes.h…
==============================================================================
--- trunk/reactos/include/ndk/i386/ketypes.h (original)
+++ trunk/reactos/include/ndk/i386/ketypes.h Thu Mar 1 22:51:20 2007
@@ -350,7 +350,6 @@
//
// Processor State Data
//
-#pragma pack(push,4)
typedef struct _KPROCESSOR_STATE
{
CONTEXT ContextFrame;
@@ -360,6 +359,7 @@
//
// Processor Region Control Block
//
+#pragma pack(push,4)
typedef struct _KPRCB
{
USHORT MinorVersion;
Modified: trunk/reactos/include/ndk/kdfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/kdfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/kdfuncs.h (original)
+++ trunk/reactos/include/ndk/kdfuncs.h Thu Mar 1 22:51:20 2007
@@ -28,29 +28,6 @@
#ifndef NTOS_MODE_USER
//
-// Port Functions
-//
-UCHAR
-NTAPI
-KdPollBreakIn(VOID);
-
-NTSTATUS
-NTAPI
-KdRestore(IN BOOLEAN DisableDbgPorts);
-
-NTSTATUS
-NTAPI
-KdSave(IN ULONG Unknown);
-
-#ifdef _ARC_
-NTSTATUS
-NTAPI
-KdDebuggerInitialize0(
- IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock
-);
-#endif
-
-//
// Debugger API
//
NTSTATUS
@@ -63,6 +40,12 @@
ULONG OutputBufferLength,
PULONG ReturnLength,
KPROCESSOR_MODE PreviousMode
+);
+
+BOOLEAN
+NTAPI
+KdPollBreakIn(
+ VOID
);
#endif
Modified: trunk/reactos/include/ndk/kdtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/kdtypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/kdtypes.h (original)
+++ trunk/reactos/include/ndk/kdtypes.h Thu Mar 1 22:51:20 2007
@@ -52,6 +52,7 @@
#define BREAKPOINT_PROMPT 2
#define BREAKPOINT_LOAD_SYMBOLS 3
#define BREAKPOINT_UNLOAD_SYMBOLS 4
+#define BREAKPOINT_COMMAND_STRING 5
//
// Debug Control Codes for NtSystemDebugcontrol
@@ -167,7 +168,7 @@
typedef struct _KD_SYMBOLS_INFO
{
PVOID BaseOfDll;
- PVOID ProcessId;
+ ULONG_PTR ProcessId;
ULONG CheckSum;
ULONG SizeOfImage;
} KD_SYMBOLS_INFO, *PKD_SYMBOLS_INFO;
Modified: trunk/reactos/include/ndk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h (original)
+++ trunk/reactos/include/ndk/ketypes.h Thu Mar 1 22:51:20 2007
@@ -96,6 +96,12 @@
#define KF_NX_BIT 0x20000000
#define KF_NX_DISABLED 0x40000000
#define KF_NX_ENABLED 0x80000000
+
+//
+// Internal Exception Codes
+//
+#define KI_EXCEPTION_INTERNAL 0x10000000
+#define KI_EXCEPTION_ACCESS_VIOLATION (KI_EXCEPTION_INTERNAL | 0x04)
//
// KPCR Access for non-IA64 builds
@@ -298,6 +304,17 @@
} ADJUST_REASON;
//
+// Continue Status
+//
+typedef enum _KCONTINUE_STATUS
+{
+ ContinueError = 0,
+ ContinueSuccess,
+ ContinueProcessorReselected,
+ ContinueNextProcessor
+} KCONTINUE_STATUS;
+
+//
// Process States
//
typedef enum _KPROCESS_STATE
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h Thu Mar 1 22:51:20 2007
@@ -2511,7 +2511,7 @@
DbgLoadImageSymbols(
IN PANSI_STRING Name,
IN PVOID Base,
- IN ULONG ProcessId
+ IN ULONG_PTR ProcessId
);
VOID
Modified: trunk/reactos/include/psdk/ntdef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdef.h?rev=2…
==============================================================================
--- trunk/reactos/include/psdk/ntdef.h (original)
+++ trunk/reactos/include/psdk/ntdef.h Thu Mar 1 22:51:20 2007
@@ -89,6 +89,21 @@
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
#endif
+
+typedef struct LIST_ENTRY32
+{
+ ULONG Flink;
+ ULONG Blink;
+} LIST_ENTRY32;
+typedef LIST_ENTRY32 *PLIST_ENTRY32;
+
+typedef struct LIST_ENTRY64
+{
+ ULONGLONG Flink;
+ ULONGLONG Blink;
+} LIST_ENTRY64;
+typedef LIST_ENTRY64 *PLIST_ENTRY64;
+
#define NOTHING
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
#define TYPE_ALIGNMENT( t ) FIELD_OFFSET( struct { char x; t test; }, test )
Added: trunk/reactos/include/psdk/wdbgexts.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wdbgexts.h?re…
==============================================================================
--- trunk/reactos/include/psdk/wdbgexts.h (added)
+++ trunk/reactos/include/psdk/wdbgexts.h Thu Mar 1 22:51:20 2007
@@ -1,0 +1,191 @@
+#ifndef _WDBGEXTS_
+#define _WDBGEXTS_
+
+enum
+{
+ DBGKD_SIMULATION_NONE,
+ DBGKD_SIMULATION_EXDI
+};
+
+#define KD_SECONDARY_VERSION_DEFAULT 0
+#define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_1 0
+#define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_2 1
+#define KD_SECONDARY_VERSION_AMD64_CONTEXT 2
+#define CURRENT_KD_SECONDARY_VERSION KD_SECONDARY_VERSION_DEFAULT
+
+#define DBGKD_VERS_FLAG_MP 0x0001
+#define DBGKD_VERS_FLAG_DATA 0x0002
+#define DBGKD_VERS_FLAG_PTR64 0x0004
+#define DBGKD_VERS_FLAG_NOMM 0x0008
+#define DBGKD_VERS_FLAG_HSS 0x0010
+#define DBGKD_VERS_FLAG_PARTITIONS 0x0020
+
+#define KDBG_TAG TAG('K', 'D',
'B', 'G')
+
+typedef struct _DBGKD_GET_VERSION64
+{
+ USHORT MajorVersion;
+ USHORT MinorVersion;
+ UCHAR ProtocolVersion;
+ UCHAR KdSecondaryVersion;
+ USHORT Flags;
+ USHORT MachineType;
+ UCHAR MaxPacketType;
+ UCHAR MaxStateChange;
+ UCHAR MaxManipulate;
+ UCHAR Simulation;
+ USHORT Unused[1];
+ ULONG64 KernBase;
+ ULONG64 PsLoadedModuleList;
+ ULONG64 DebuggerDataList;
+} DBGKD_GET_VERSION64, *PDBGKD_GET_VERSION64;
+
+typedef struct _DBGKD_DEBUG_DATA_HEADER64
+{
+ LIST_ENTRY64 List;
+ ULONG OwnerTag;
+ ULONG Size;
+} DBGKD_DEBUG_DATA_HEADER64, *PDBGKD_DEBUG_DATA_HEADER64;
+
+typedef union _GCC_ULONG64
+{
+ ULONG_PTR Pointer;
+ ULONG64 RealPointer;
+} GCC_ULONG64, *PGCC_ULONG64;
+
+typedef struct _KDDEBUGGER_DATA64
+{
+ DBGKD_DEBUG_DATA_HEADER64 Header;
+ ULONG64 KernBase;
+ GCC_ULONG64 BreakpointWithStatus;
+ ULONG64 SavedContext;
+ USHORT ThCallbackStack;
+ USHORT NextCallback;
+ USHORT FramePointer;
+ USHORT PaeEnabled:1;
+ GCC_ULONG64 KiCallUserMode;
+ GCC_ULONG64 KeUserCallbackDispatcher;
+ GCC_ULONG64 PsLoadedModuleList;
+ GCC_ULONG64 PsActiveProcessHead;
+ GCC_ULONG64 PspCidTable;
+ GCC_ULONG64 ExpSystemResourcesList;
+ GCC_ULONG64 ExpPagedPoolDescriptor;
+ GCC_ULONG64 ExpNumberOfPagedPools;
+ GCC_ULONG64 KeTimeIncrement;
+ GCC_ULONG64 KeBugCheckCallbackListHead;
+ GCC_ULONG64 KiBugcheckData;
+ GCC_ULONG64 IopErrorLogListHead;
+ GCC_ULONG64 ObpRootDirectoryObject;
+ GCC_ULONG64 ObpTypeObjectType;
+ GCC_ULONG64 MmSystemCacheStart;
+ GCC_ULONG64 MmSystemCacheEnd;
+ GCC_ULONG64 MmSystemCacheWs;
+ GCC_ULONG64 MmPfnDatabase;
+ GCC_ULONG64 MmSystemPtesStart;
+ GCC_ULONG64 MmSystemPtesEnd;
+ GCC_ULONG64 MmSubsectionBase;
+ GCC_ULONG64 MmNumberOfPagingFiles;
+ GCC_ULONG64 MmLowestPhysicalPage;
+ GCC_ULONG64 MmHighestPhysicalPage;
+ GCC_ULONG64 MmNumberOfPhysicalPages;
+ GCC_ULONG64 MmMaximumNonPagedPoolInBytes;
+ GCC_ULONG64 MmNonPagedSystemStart;
+ GCC_ULONG64 MmNonPagedPoolStart;
+ GCC_ULONG64 MmNonPagedPoolEnd;
+ GCC_ULONG64 MmPagedPoolStart;
+ GCC_ULONG64 MmPagedPoolEnd;
+ GCC_ULONG64 MmPagedPoolInformation;
+ ULONG64 MmPageSize;
+ GCC_ULONG64 MmSizeOfPagedPoolInBytes;
+ GCC_ULONG64 MmTotalCommitLimit;
+ GCC_ULONG64 MmTotalCommittedPages;
+ GCC_ULONG64 MmSharedCommit;
+ GCC_ULONG64 MmDriverCommit;
+ GCC_ULONG64 MmProcessCommit;
+ GCC_ULONG64 MmPagedPoolCommit;
+ GCC_ULONG64 MmExtendedCommit;
+ GCC_ULONG64 MmZeroedPageListHead;
+ GCC_ULONG64 MmFreePageListHead;
+ GCC_ULONG64 MmStandbyPageListHead;
+ GCC_ULONG64 MmModifiedPageListHead;
+ GCC_ULONG64 MmModifiedNoWritePageListHead;
+ GCC_ULONG64 MmAvailablePages;
+ GCC_ULONG64 MmResidentAvailablePages;
+ GCC_ULONG64 PoolTrackTable;
+ GCC_ULONG64 NonPagedPoolDescriptor;
+ GCC_ULONG64 MmHighestUserAddress;
+ GCC_ULONG64 MmSystemRangeStart;
+ GCC_ULONG64 MmUserProbeAddress;
+ GCC_ULONG64 KdPrintCircularBuffer;
+ GCC_ULONG64 KdPrintCircularBufferEnd;
+ GCC_ULONG64 KdPrintWritePointer;
+ GCC_ULONG64 KdPrintRolloverCount;
+ GCC_ULONG64 MmLoadedUserImageList;
+ GCC_ULONG64 NtBuildLab;
+ GCC_ULONG64 KiNormalSystemCall;
+ GCC_ULONG64 KiProcessorBlock;
+ GCC_ULONG64 MmUnloadedDrivers;
+ GCC_ULONG64 MmLastUnloadedDriver;
+ GCC_ULONG64 MmTriageActionTaken;
+ GCC_ULONG64 MmSpecialPoolTag;
+ GCC_ULONG64 KernelVerifier;
+ GCC_ULONG64 MmVerifierData;
+ GCC_ULONG64 MmAllocatedNonPagedPool;
+ GCC_ULONG64 MmPeakCommitment;
+ GCC_ULONG64 MmTotalCommitLimitMaximum;
+ GCC_ULONG64 CmNtCSDVersion;
+ GCC_ULONG64 MmPhysicalMemoryBlock;
+ GCC_ULONG64 MmSessionBase;
+ GCC_ULONG64 MmSessionSize;
+ GCC_ULONG64 MmSystemParentTablePage;
+ GCC_ULONG64 MmVirtualTranslationBase;
+ USHORT OffsetKThreadNextProcessor;
+ USHORT OffsetKThreadTeb;
+ USHORT OffsetKThreadKernelStack;
+ USHORT OffsetKThreadInitialStack;
+ USHORT OffsetKThreadApcProcess;
+ USHORT OffsetKThreadState;
+ USHORT OffsetKThreadBStore;
+ USHORT OffsetKThreadBStoreLimit;
+ USHORT SizeEProcess;
+ USHORT OffsetEprocessPeb;
+ USHORT OffsetEprocessParentCID;
+ USHORT OffsetEprocessDirectoryTableBase;
+ USHORT SizePrcb;
+ USHORT OffsetPrcbDpcRoutine;
+ USHORT OffsetPrcbCurrentThread;
+ USHORT OffsetPrcbMhz;
+ USHORT OffsetPrcbCpuType;
+ USHORT OffsetPrcbVendorString;
+ USHORT OffsetPrcbProcStateContext;
+ USHORT OffsetPrcbNumber;
+ USHORT SizeEThread;
+ GCC_ULONG64 KdPrintCircularBufferPtr;
+ GCC_ULONG64 KdPrintBufferSize;
+ GCC_ULONG64 KeLoaderBlock;
+ USHORT SizePcr;
+ USHORT OffsetPcrSelfPcr;
+ USHORT OffsetPcrCurrentPrcb;
+ USHORT OffsetPcrContainedPrcb;
+ USHORT OffsetPcrInitialBStore;
+ USHORT OffsetPcrBStoreLimit;
+ USHORT OffsetPcrInitialStack;
+ USHORT OffsetPcrStackLimit;
+ USHORT OffsetPrcbPcrPage;
+ USHORT OffsetPrcbProcStateSpecialReg;
+ USHORT GdtR0Code;
+ USHORT GdtR0Data;
+ USHORT GdtR0Pcr;
+ USHORT GdtR3Code;
+ USHORT GdtR3Data;
+ USHORT GdtR3Teb;
+ USHORT GdtLdt;
+ USHORT GdtTss;
+ USHORT Gdt64R3CmCode;
+ USHORT Gdt64R3CmTeb;
+ GCC_ULONG64 IopNumTriageDumpDataBlocks;
+ GCC_ULONG64 IopTriageDumpDataBlocks;
+ GCC_ULONG64 VfCrashDataBlock;
+} KDDEBUGGER_DATA64, *PKDDEBUGGER_DATA64;
+
+#endif
Added: trunk/reactos/include/reactos/kddll.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/kddll.h?re…
==============================================================================
--- trunk/reactos/include/reactos/kddll.h (added)
+++ trunk/reactos/include/reactos/kddll.h Thu Mar 1 22:51:20 2007
@@ -1,0 +1,54 @@
+#ifndef _KDDLL_
+#define _KDDLL_
+
+typedef enum _KDSTATUS
+{
+ KdPacketReceived = 0,
+ KdPacketTimedOut,
+ KdPacketNeedsResend
+} KDSTATUS;
+
+NTSTATUS
+NTAPI
+KdDebuggerInitialize0(
+ IN PLOADER_PARAMETER_BLOCK LoaderBlock
+);
+
+NTSTATUS
+NTAPI
+KdDebuggerInitialize1(
+ IN PLOADER_PARAMETER_BLOCK LoaderBlock
+);
+
+KDSTATUS
+NTAPI
+KdReceivePacket(
+ IN ULONG PacketType,
+ OUT PSTRING MessageHeader,
+ OUT PSTRING MessageData,
+ OUT PULONG DataLength,
+ IN OUT PKD_CONTEXT Context
+);
+
+NTSTATUS
+NTAPI
+KdRestore(
+ IN BOOLEAN SleepTransition
+);
+
+NTSTATUS
+NTAPI
+KdSave(
+ IN BOOLEAN SleepTransition
+);
+
+VOID
+NTAPI
+KdSendPacket(
+ IN ULONG PacketType,
+ IN PSTRING MessageHeader,
+ IN PSTRING MessageData,
+ IN OUT PKD_CONTEXT Context
+);
+
+#endif
Added: trunk/reactos/include/reactos/windbgkd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/windbgkd.h…
==============================================================================
--- trunk/reactos/include/reactos/windbgkd.h (added)
+++ trunk/reactos/include/reactos/windbgkd.h Thu Mar 1 22:51:20 2007
@@ -1,0 +1,488 @@
+#ifndef _WINDBGKD_
+#define _WINDBGKG_
+
+//
+// Dependencies
+//
+#include "wdbgexts.h"
+
+//
+// Conversion Macros
+//
+#define COPYSE(p64, p32, f) \
+ p64->f = (ULONG64)(LONG64)(LONG)p32->f
+
+//
+// Packet Size and Control Stream Size
+//
+#define PACKET_MAX_SIZE 4000
+#define DBGKD_MAXSTREAM 16
+
+//
+// Magic Packet IDs
+//
+#define INITIAL_PACKET_ID 0x80800000
+#define SYNC_PACKET_ID 0x00000800
+
+//
+// Magic Packet bytes
+//
+#define BREAKIN_PACKET 0x62626262
+#define BREAKIN_PACKET_BYTE 0x62
+#define PACKET_LEADER 0x30303030
+#define PACKET_LEADER_BYTE 0x30
+#define CONTROL_PACKET_LEADER 0x69696969
+#define CONTROL_PACKET_LEADER_BYTE 0x69
+#define PACKET_TRAILING_BYTE 0xAA
+
+//
+// Packet Types
+//
+#define PACKET_TYPE_UNUSED 0
+#define PACKET_TYPE_KD_STATE_CHANGE32 1
+#define PACKET_TYPE_KD_STATE_MANIPULATE 2
+#define PACKET_TYPE_KD_DEBUG_IO 3
+#define PACKET_TYPE_KD_ACKNOWLEDGE 4
+#define PACKET_TYPE_KD_RESEND 5
+#define PACKET_TYPE_KD_RESET 6
+#define PACKET_TYPE_KD_STATE_CHANGE64 7
+#define PACKET_TYPE_KD_POLL_BREAKIN 8
+#define PACKET_TYPE_KD_TRACE_IO 9
+#define PACKET_TYPE_KD_CONTROL_REQUEST 10
+#define PACKET_TYPE_KD_FILE_IO 11
+#define PACKET_TYPE_MAX 12
+
+//
+// Wait State Change Types
+//
+#define DbgKdMinimumStateChange 0x00003030
+#define DbgKdExceptionStateChange 0x00003030
+#define DbgKdLoadSymbolsStateChange 0x00003031
+#define DbgKdCommandStringStateChange 0x00003032
+#define DbgKdMaximumStateChange 0x00003033
+
+//
+// Manipulate Types
+//
+#define DbgKdMinimumManipulate 0x00003130
+#define DbgKdReadVirtualMemoryApi 0x00003130
+#define DbgKdWriteVirtualMemoryApi 0x00003131
+#define DbgKdGetContextApi 0x00003132
+#define DbgKdSetContextApi 0x00003133
+#define DbgKdWriteBreakPointApi 0x00003134
+#define DbgKdRestoreBreakPointApi 0x00003135
+#define DbgKdContinueApi 0x00003136
+#define DbgKdReadControlSpaceApi 0x00003137
+#define DbgKdWriteControlSpaceApi 0x00003138
+#define DbgKdReadIoSpaceApi 0x00003139
+#define DbgKdWriteIoSpaceApi 0x0000313A
+#define DbgKdRebootApi 0x0000313B
+#define DbgKdContinueApi2 0x0000313C
+#define DbgKdReadPhysicalMemoryApi 0x0000313D
+#define DbgKdWritePhysicalMemoryApi 0x0000313E
+#define DbgKdQuerySpecialCallsApi 0x0000313F
+#define DbgKdSetSpecialCallApi 0x00003140
+#define DbgKdClearSpecialCallsApi 0x00003141
+#define DbgKdSetInternalBreakPointApi 0x00003142
+#define DbgKdGetInternalBreakPointApi 0x00003143
+#define DbgKdReadIoSpaceExtendedApi 0x00003144
+#define DbgKdWriteIoSpaceExtendedApi 0x00003145
+#define DbgKdGetVersionApi 0x00003146
+#define DbgKdWriteBreakPointExApi 0x00003147
+#define DbgKdRestoreBreakPointExApi 0x00003148
+#define DbgKdCauseBugCheckApi 0x00003149
+#define DbgKdSwitchProcessor 0x00003150
+#define DbgKdPageInApi 0x00003151
+#define DbgKdReadMachineSpecificRegister 0x00003152
+#define DbgKdWriteMachineSpecificRegister 0x00003153
+#define OldVlm1 0x00003154
+#define OldVlm2 0x00003155
+#define DbgKdSearchMemoryApi 0x00003156
+#define DbgKdGetBusDataApi 0x00003157
+#define DbgKdSetBusDataApi 0x00003158
+#define DbgKdCheckLowMemoryApi 0x00003159
+#define DbgKdClearAllInternalBreakpointsApi 0x0000315A
+#define DbgKdFillMemoryApi 0x0000315B
+#define DbgKdQueryMemoryApi 0x0000315C
+#define DbgKdSwitchPartition 0x0000315D
+#define DbgKdMaximumManipulate 0x0000315E
+
+//
+// Debug I/O Types
+//
+#define DbgKdPrintStringApi 0x00003230
+#define DbgKdGetStringApi 0x00003231
+
+//
+// Control Report Flags
+//
+#define REPORT_INCLUDES_SEGS 0x0001
+#define REPORT_INCLUDES_CS 0x0002
+
+//
+// Protocol Versions
+//
+#define DBGKD_64BIT_PROTOCOL_VERSION1 5
+#define DBGKD_64BIT_PROTOCOL_VERSION2 6
+
+//
+// KD Packet Structure
+//
+typedef struct _KD_PACKET
+{
+ ULONG PacketLeader;
+ USHORT PacketType;
+ USHORT ByteCount;
+ ULONG PacketId;
+ ULONG Checksum;
+} KD_PACKET, *PKD_PACKET;
+
+//
+// KD Context
+//
+typedef struct _KD_CONTEXT
+{
+ ULONG KdpDefaultRetries;
+ BOOLEAN KdpControlCPending;
+} KD_CONTEXT, *PKD_CONTEXT;
+
+//
+// Control Sets for Supported Architectures
+//
+#include <pshpack4.h>
+typedef struct _X86_DBGKD_CONTROL_SET
+{
+ ULONG TraceFlag;
+ ULONG Dr7;
+ ULONG CurrentSymbolStart;
+ ULONG CurrentSymbolEnd;
+} X86_DBGKD_CONTROL_SET, *PX86_DBGKD_CONTROL_SET;
+
+typedef struct _IA64_DBGKD_CONTROL_SET
+{
+ ULONG Continue;
+ ULONG64 CurrentSymbolStart;
+ ULONG64 CurrentSymbolEnd;
+} IA64_DBGKD_CONTROL_SET, *PIA64_DBGKD_CONTROL_SET;
+
+typedef struct _AMD64_DBGKD_CONTROL_SET
+{
+ ULONG TraceFlag;
+ ULONG64 Dr7;
+ ULONG64 CurrentSymbolStart;
+ ULONG64 CurrentSymbolEnd;
+} AMD64_DBGKD_CONTROL_SET, *PAMD64_DBGKD_CONTROL_SET;
+
+typedef struct _DBGKD_ANY_CONTROL_SET
+{
+ union
+ {
+ X86_DBGKD_CONTROL_SET X86ControlSet;
+ IA64_DBGKD_CONTROL_SET IA64ControlSet;
+ AMD64_DBGKD_CONTROL_SET Amd64ControlSet;
+ };
+} DBGKD_ANY_CONTROL_SET, *PDBGKD_ANY_CONTROL_SET;
+#include <poppack.h>
+
+typedef X86_DBGKD_CONTROL_SET DBGKD_CONTROL_SET;
+
+//
+// DBGKM Structure for Exceptions
+//
+typedef struct _DBGKM_EXCEPTION64
+{
+ EXCEPTION_RECORD64 ExceptionRecord;
+ ULONG FirstChance;
+} DBGKM_EXCEPTION64, *PDBGKM_EXCEPTION64;
+
+//
+// DBGKD Structure for State Change
+//
+typedef struct _DBGKD_CONTROL_REPORT
+{
+ ULONG Dr6;
+ ULONG Dr7;
+ USHORT InstructionCount;
+ USHORT ReportFlags;
+ UCHAR InstructionStream[DBGKD_MAXSTREAM];
+ USHORT SegCs;
+ USHORT SegDs;
+ USHORT SegEs;
+ USHORT SegFs;
+ ULONG EFlags;
+} DBGKD_CONTROL_REPORT, *PDBGKD_CONTROL_REPORT;
+
+//
+// DBGKD Structure for Debug I/O Type Print String
+//
+typedef struct _DBGKD_PRINT_STRING
+{
+ ULONG LengthOfString;
+} DBGKD_PRINT_STRING, *PDBGKD_PRINT_STRING;
+
+//
+// DBGKD Structure for Debug I/O Type Get String
+//
+typedef struct _DBGKD_GET_STRING
+{
+ ULONG LengthOfPromptString;
+ ULONG LengthOfStringRead;
+} DBGKD_GET_STRING, *PDBGKD_GET_STRING;
+
+//
+// DBGKD Structure for Debug I/O
+//
+typedef struct _DBGKD_DEBUG_IO
+{
+ ULONG ApiNumber;
+ USHORT ProcessorLevel;
+ USHORT Processor;
+ union
+ {
+ DBGKD_PRINT_STRING PrintString;
+ DBGKD_GET_STRING GetString;
+ } u;
+} DBGKD_DEBUG_IO, *PDBGKD_DEBUG_IO;
+
+//
+// DBGKD Structure for Load Symbols
+//
+typedef struct _DBGKD_LOAD_SYMBOLS64
+{
+ ULONG PathNameLength;
+ ULONG64 BaseOfDll;
+ ULONG64 ProcessId;
+ ULONG CheckSum;
+ ULONG SizeOfImage;
+ BOOLEAN UnloadSymbols;
+} DBGKD_LOAD_SYMBOLS64, *PDBGKD_LOAD_SYMBOLS64;
+
+//
+// DBGKD Structure for Wait State Change
+//
+typedef struct _DBGKD_WAIT_STATE_CHANGE64
+{
+ ULONG NewState;
+ USHORT ProcessorLevel;
+ USHORT Processor;
+ ULONG NumberProcessors;
+ ULONG64 Thread;
+ ULONG64 ProgramCounter;
+ union
+ {
+ DBGKM_EXCEPTION64 Exception;
+ DBGKD_LOAD_SYMBOLS64 LoadSymbols;
+ } u;
+ DBGKD_CONTROL_REPORT ControlReport;
+ CONTEXT Context;
+} DBGKD_WAIT_STATE_CHANGE64, *PDBGKD_WAIT_STATE_CHANGE64;
+
+//
+// DBGKD Manipulate Structures
+//
+typedef struct _DBGKD_READ_MEMORY64
+{
+ ULONG64 TargetBaseAddress;
+ ULONG TransferCount;
+ ULONG ActualBytesRead;
+} DBGKD_READ_MEMORY64, *PDBGKD_READ_MEMORY64;
+
+typedef struct _DBGKD_WRITE_MEMORY64
+{
+ ULONG64 TargetBaseAddress;
+ ULONG TransferCount;
+ ULONG ActualBytesWritten;
+} DBGKD_WRITE_MEMORY64, *PDBGKD_WRITE_MEMORY64;
+
+typedef struct _DBGKD_GET_CONTEXT
+{
+ ULONG Unused;
+} DBGKD_GET_CONTEXT, *PDBGKD_GET_CONTEXT;
+
+typedef struct _DBGKD_SET_CONTEXT
+{
+ ULONG ContextFlags;
+} DBGKD_SET_CONTEXT, *PDBGKD_SET_CONTEXT;
+
+typedef struct _DBGKD_WRITE_BREAKPOINT64
+{
+ ULONG64 BreakPointAddress;
+ ULONG BreakPointHandle;
+} DBGKD_WRITE_BREAKPOINT64, *PDBGKD_WRITE_BREAKPOINT64;
+
+typedef struct _DBGKD_RESTORE_BREAKPOINT
+{
+ ULONG BreakPointHandle;
+} DBGKD_RESTORE_BREAKPOINT, *PDBGKD_RESTORE_BREAKPOINT;
+
+typedef struct _DBGKD_CONTINUE
+{
+ NTSTATUS ContinueStatus;
+} DBGKD_CONTINUE, *PDBGKD_CONTINUE;
+
+#include <pshpack4.h>
+typedef struct _DBGKD_CONTINUE2
+{
+ NTSTATUS ContinueStatus;
+ union
+ {
+ DBGKD_CONTROL_SET ControlSet;
+ DBGKD_ANY_CONTROL_SET AnyControlSet;
+ };
+} DBGKD_CONTINUE2, *PDBGKD_CONTINUE2;
+#include <poppack.h>
+
+typedef struct _DBGKD_READ_WRITE_IO64
+{
+ ULONG64 IoAddress;
+ ULONG DataSize;
+ ULONG DataValue;
+} DBGKD_READ_WRITE_IO64, *PDBGKD_READ_WRITE_IO64;
+
+typedef struct _DBGKD_READ_WRITE_IO_EXTENDED64
+{
+ ULONG DataSize;
+ ULONG InterfaceType;
+ ULONG BusNumber;
+ ULONG AddressSpace;
+ ULONG64 IoAddress;
+ ULONG DataValue;
+} DBGKD_READ_WRITE_IO_EXTENDED64, *PDBGKD_READ_WRITE_IO_EXTENDED64;
+
+typedef struct _DBGKD_READ_WRITE_MSR
+{
+ ULONG Msr;
+ ULONG DataValueLow;
+ ULONG DataValueHigh;
+} DBGKD_READ_WRITE_MSR, *PDBGKD_READ_WRITE_MSR;
+
+typedef struct _DBGKD_QUERY_SPECIAL_CALLS
+{
+ ULONG NumberOfSpecialCalls;
+} DBGKD_QUERY_SPECIAL_CALLS, *PDBGKD_QUERY_SPECIAL_CALLS;
+
+typedef struct _DBGKD_SET_SPECIAL_CALL64
+{
+ ULONG64 SpecialCall;
+} DBGKD_SET_SPECIAL_CALL64, *PDBGKD_SET_SPECIAL_CALL64;
+
+typedef struct _DBGKD_SET_INTERNAL_BREAKPOINT64
+{
+ ULONG64 BreakpointAddress;
+ ULONG Flags;
+} DBGKD_SET_INTERNAL_BREAKPOINT64, *PDBGKD_SET_INTERNAL_BREAKPOINT64;
+
+typedef struct _DBGKD_GET_INTERNAL_BREAKPOINT64
+{
+ ULONG64 BreakpointAddress;
+ ULONG Flags;
+ ULONG Calls;
+ ULONG MaxCallsPerPeriod;
+ ULONG MinInstructions;
+ ULONG MaxInstructions;
+ ULONG TotalInstructions;
+} DBGKD_GET_INTERNAL_BREAKPOINT64, *PDBGKD_GET_INTERNAL_BREAKPOINT64;
+
+typedef struct _DBGKD_BREAKPOINTEX
+{
+ ULONG BreakPointCount;
+ NTSTATUS ContinueStatus;
+} DBGKD_BREAKPOINTEX, *PDBGKD_BREAKPOINTEX;
+
+typedef struct _DBGKD_SEARCH_MEMORY
+{
+ union
+ {
+ ULONG64 SearchAddress;
+ ULONG64 FoundAddress;
+ };
+ ULONG64 SearchLength;
+ ULONG PatternLength;
+} DBGKD_SEARCH_MEMORY, *PDBGKD_SEARCH_MEMORY;
+
+typedef struct _DBGKD_GET_SET_BUS_DATA
+{
+ ULONG BusDataType;
+ ULONG BusNumber;
+ ULONG SlotNumber;
+ ULONG Offset;
+ ULONG Length;
+} DBGKD_GET_SET_BUS_DATA, *PDBGKD_GET_SET_BUS_DATA;
+
+typedef struct _DBGKD_FILL_MEMORY
+{
+ ULONG64 Address;
+ ULONG Length;
+ USHORT Flags;
+ USHORT PatternLength;
+} DBGKD_FILL_MEMORY, *PDBGKD_FILL_MEMORY;
+
+typedef struct _DBGKD_QUERY_MEMORY
+{
+ ULONG64 Address;
+ ULONG64 Reserved;
+ ULONG AddressSpace;
+ ULONG Flags;
+} DBGKD_QUERY_MEMORY, *PDBGKD_QUERY_MEMORY;
+
+typedef struct _DBGKD_SWITCH_PARTITION
+{
+ ULONG Partition;
+} DBGKD_SWITCH_PARTITION;
+
+//
+// DBGKD Structure for Manipulate
+//
+typedef struct _DBGKD_MANIPULATE_STATE64
+{
+ ULONG ApiNumber;
+ USHORT ProcessorLevel;
+ USHORT Processor;
+ NTSTATUS ReturnStatus;
+ union
+ {
+ DBGKD_READ_MEMORY64 ReadMemory;
+ DBGKD_WRITE_MEMORY64 WriteMemory;
+ DBGKD_GET_CONTEXT GetContext;
+ DBGKD_SET_CONTEXT SetContext;
+ DBGKD_WRITE_BREAKPOINT64 WriteBreakPoint;
+ DBGKD_RESTORE_BREAKPOINT RestoreBreakPoint;
+ DBGKD_CONTINUE Continue;
+ DBGKD_CONTINUE2 Continue2;
+ DBGKD_READ_WRITE_IO64 ReadWriteIo;
+ DBGKD_READ_WRITE_IO_EXTENDED64 ReadWriteIoExtended;
+ DBGKD_QUERY_SPECIAL_CALLS QuerySpecialCalls;
+ DBGKD_SET_SPECIAL_CALL64 SetSpecialCall;
+ DBGKD_SET_INTERNAL_BREAKPOINT64 SetInternalBreakpoint;
+ DBGKD_GET_INTERNAL_BREAKPOINT64 GetInternalBreakpoint;
+ DBGKD_GET_VERSION64 GetVersion64;
+ DBGKD_BREAKPOINTEX BreakPointEx;
+ DBGKD_READ_WRITE_MSR ReadWriteMsr;
+ DBGKD_SEARCH_MEMORY SearchMemory;
+ DBGKD_GET_SET_BUS_DATA GetSetBusData;
+ DBGKD_FILL_MEMORY FillMemory;
+ DBGKD_QUERY_MEMORY QueryMemory;
+ DBGKD_SWITCH_PARTITION SwitchPartition;
+ } u;
+} DBGKD_MANIPULATE_STATE64, *PDBGKD_MANIPULATE_STATE64;
+
+FORCEINLINE
+VOID
+ExceptionRecord32To64(IN PEXCEPTION_RECORD32 Ex32,
+ OUT PEXCEPTION_RECORD64 Ex64)
+{
+ ULONG i;
+
+ Ex64->ExceptionCode = Ex32->ExceptionCode;
+ Ex64->ExceptionFlags = Ex32->ExceptionFlags;
+ Ex64->ExceptionRecord = Ex32->ExceptionRecord;
+ COPYSE(Ex64,Ex32,ExceptionAddress);
+ Ex64->NumberParameters = Ex32->NumberParameters;
+
+ for (i = 0; i < EXCEPTION_MAXIMUM_PARAMETERS; i++)
+ {
+ COPYSE(Ex64,Ex32,ExceptionInformation[i]);
+ }
+}
+
+#endif
Modified: trunk/reactos/lib/rtl/debug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/debug.c?rev=25937&…
==============================================================================
--- trunk/reactos/lib/rtl/debug.c (original)
+++ trunk/reactos/lib/rtl/debug.c Thu Mar 1 22:51:20 2007
@@ -328,7 +328,7 @@
/* Setup the symbol data */
SymbolInfo.BaseOfDll = Base;
- SymbolInfo.ProcessId = UlongToPtr(ProcessId);
+ SymbolInfo.ProcessId = (ULONG)ProcessId;
/* Get NT Headers */
NtHeader = NULL; //RtlImageNtHeader(Base);
@@ -362,7 +362,7 @@
/* Setup the symbol data */
SymbolInfo.BaseOfDll = Base;
- SymbolInfo.ProcessId = (PVOID)ProcessId;
+ SymbolInfo.ProcessId = (ULONG)ProcessId;
SymbolInfo.CheckSum = SymbolInfo.SizeOfImage = 0;
/* Load the symbols */
Modified: trunk/reactos/lib/rtl/i386/debug_asm.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/debug_asm.S?r…
==============================================================================
--- trunk/reactos/lib/rtl/i386/debug_asm.S (original)
+++ trunk/reactos/lib/rtl/i386/debug_asm.S Thu Mar 1 22:51:20 2007
@@ -16,6 +16,7 @@
.globl _DebugService@20
.globl _DebugService2@12
.globl _DbgBreakPointNoBugCheck@0
+.globl _RtlpBreakWithStatusInstruction@0
/* FUNCTIONS ***************************************************************/
@@ -35,6 +36,8 @@
.func DbgBreakPointWithStatus@4
_DbgBreakPointWithStatus@4:
mov eax, [esp+4]
+
+_RtlpBreakWithStatusInstruction@0:
int 3
ret 4
.endfunc
Modified: trunk/reactos/ntoskrnl/cm/regobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regobj.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/regobj.c (original)
+++ trunk/reactos/ntoskrnl/cm/regobj.c Thu Mar 1 22:51:20 2007
@@ -172,11 +172,11 @@
if (ObjectCreateInfo->RootDirectory == NULL)
{
- ObReferenceObjectByPointer(NameSpaceRoot,
+ ObReferenceObjectByPointer(ObpRootDirectoryObject,
DIRECTORY_TRAVERSE,
CmiKeyType,
ObjectCreateInfo->ProbeMode);
- CurrentObject = NameSpaceRoot;
+ CurrentObject = ObpRootDirectoryObject;
}
else
{
@@ -312,7 +312,7 @@
if (Status == STATUS_REPARSE)
{
/* reparse the object path */
- NextObject = NameSpaceRoot;
+ NextObject = ObpRootDirectoryObject;
current = PathString.Buffer;
ObReferenceObjectByPointer(NextObject,
Modified: trunk/reactos/ntoskrnl/ex/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=259…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/init.c (original)
+++ trunk/reactos/ntoskrnl/ex/init.c Thu Mar 1 22:51:20 2007
@@ -14,18 +14,30 @@
#include <debug.h>
//#include <ntoskrnl/cm/newcm.h>
#include "ntoskrnl/cm/cm.h"
+#include <ntverp.h>
/* DATA **********************************************************************/
-#define BUILD_OSCSDVERSION(major, minor) (((major & 0xFF) << 8) | (minor &
0xFF))
-
/* NT Version Info */
-ULONG NtMajorVersion = 5;
-ULONG NtMinorVersion = 0;
-ULONG NtOSCSDVersion = BUILD_OSCSDVERSION(4, 0);
-ULONG NtBuildNumber = KERNEL_VERSION_BUILD;
+ULONG NtMajorVersion = VER_PRODUCTMAJORVERSION;
+ULONG NtMinorVersion = VER_PRODUCTMINORVERSION;
+#if DBG
+ULONG NtBuildNumber = VER_PRODUCTBUILD | 0xC0000000;
+#else
+ULONG NtBuildNumber = VER_PRODUCTBUILD;
+#endif
+
+/* NT System Info */
ULONG NtGlobalFlag;
ULONG ExSuiteMask;
+
+/* Cm Version Info */
+ULONG CmNtSpBuildNumber;
+ULONG CmNtCSDVersion;
+ULONG CmNtCSDReleaseType;
+UNICODE_STRING CmVersionString;
+UNICODE_STRING CmCSDVersionString;
+CHAR NtBuildLab[] = KERNEL_VERSION_BUILD_STR;
/* Init flags and settings */
ULONG ExpInitializationPhase;
@@ -671,11 +683,12 @@
else
{
/* Copy the name */
- for (Count = 0; Count < Length; Count++, Name++)
+ Count = 0;
+ do
{
/* Copy the character */
- NameBuffer[Count] = (CHAR)*Name;
- }
+ NameBuffer[Count++] = (CHAR)*Name++;
+ } while (Count < Length);
/* Null-terminate */
NameBuffer[Count] = ANSI_NULL;
@@ -692,13 +705,14 @@
{
/* Buffer too small */
OverFlow = TRUE;
+ while (TRUE);
}
else
{
/* Otherwise build the name. HACKED for GCC :( */
sprintf(NameBuffer,
- "%c\\System32\\Drivers\\%S",
- SharedUserData->NtSystemRoot[2],
+ "%S\\System32\\Drivers\\%S",
+ &SharedUserData->NtSystemRoot[2],
LdrEntry->BaseDllName.Buffer);
}
}
Modified: trunk/reactos/ntoskrnl/ex/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/time.c?rev=259…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/time.c (original)
+++ trunk/reactos/ntoskrnl/ex/time.c Thu Mar 1 22:51:20 2007
@@ -23,8 +23,44 @@
LARGE_INTEGER ExpTimeZoneBias;
ULONG ExpTimeZoneId;
ULONG ExpTickCountMultiplier;
+ERESOURCE ExpTimeRefreshLock;
/* FUNCTIONS ****************************************************************/
+
+BOOLEAN
+NTAPI
+ExAcquireTimeRefreshLock(BOOLEAN Wait)
+{
+ /* Simply acquire the Resource */
+ KeEnterCriticalRegion();
+ if (!(ExAcquireResourceExclusiveLite(&ExpTimeRefreshLock, Wait)))
+ {
+ /* We failed! */
+ KeLeaveCriticalRegion();
+ return FALSE;
+ }
+
+ /* Success */
+ return TRUE;
+}
+
+VOID
+NTAPI
+ExReleaseTimeRefreshLock(VOID)
+{
+ /* Simply release the Resource */
+ ExReleaseResourceLite(&ExpTimeRefreshLock);
+ KeLeaveCriticalRegion();
+}
+
+VOID
+NTAPI
+ExUpdateSystemTimeFromCmos(IN BOOLEAN UpdateInterruptTime,
+ IN ULONG MaxSepInSeconds)
+{
+ /* FIXME: TODO */
+ return;
+}
BOOLEAN
NTAPI
Modified: trunk/reactos/ntoskrnl/include/internal/ex.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ex.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ex.h Thu Mar 1 22:51:20 2007
@@ -17,9 +17,13 @@
extern ERESOURCE ExpFirmwareTableResource;
extern LIST_ENTRY ExpFirmwareTableProviderListHead;
extern BOOLEAN ExpIsWinPEMode;
+extern LIST_ENTRY ExpSystemResourcesList;
ULONG ExpAnsiCodePageDataOffset, ExpOemCodePageDataOffset;
ULONG ExpUnicodeCaseTableDataOffset;
PVOID ExpNlsSectionPointer;
+extern CHAR NtBuildLab[];
+extern ULONG CmNtCSDVersion;
+extern ULONG NtGlobalFlag;
extern ULONG ExpInitializationPhase;
typedef struct _EXHANDLE
@@ -911,7 +915,7 @@
/* Unlock the pushlock */
OldValue.Value = InterlockedExchangeAddSizeT((PLONG)PushLock,
- -EX_PUSH_LOCK_LOCK);
+ -(LONG)EX_PUSH_LOCK_LOCK);
/* Sanity checks */
ASSERT(OldValue.Locked);
@@ -990,6 +994,19 @@
NTSTATUS
ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation);
+BOOLEAN
+NTAPI
+ExAcquireTimeRefreshLock(BOOLEAN Wait);
+
+VOID
+NTAPI
+ExReleaseTimeRefreshLock(VOID);
+
+VOID
+NTAPI
+ExUpdateSystemTimeFromCmos(IN BOOLEAN UpdateInterruptTime,
+ IN ULONG MaxSepInSeconds);
+
NTSTATUS
NTAPI
ExpAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId);
Modified: trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h Thu Mar 1 22:51:20 2007
@@ -81,17 +81,25 @@
#define Ke386FnInit() __asm__("fninit\n\t");
//
+// CR Macros
+//
+#define Ke386SetCr2(X) __asm__ __volatile__("movl %0,%%cr2" :
:"r" (X));
+
+//
// DR Macros
//
#define Ke386GetDr0() _Ke386GetDr(0)
#define Ke386GetDr1() _Ke386GetDr(1)
#define Ke386SetDr0(X) _Ke386SetDr(0,X)
+#define Ke386SetDr1(X) _Ke386SetDr(1,X)
#define Ke386GetDr2() _Ke386GetDr(2)
#define Ke386SetDr2(X) _Ke386SetDr(2,X)
#define Ke386GetDr3() _Ke386GetDr(3)
+#define Ke386SetDr3(X) _Ke386SetDr(3,X)
#define Ke386GetDr4() _Ke386GetDr(4)
#define Ke386SetDr4(X) _Ke386SetDr(4,X)
#define Ke386GetDr6() _Ke386GetDr(6)
+#define Ke386SetDr6(X) _Ke386SetDr(6,X)
#define Ke386GetDr7() _Ke386GetDr(7)
#define Ke386SetDr7(X) _Ke386SetDr(7,X)
@@ -193,6 +201,17 @@
}
//
+// CR Macros
+//
+VOID
+FORCEINLINE
+Ke386SetCr2(IN ULONG Value)
+{
+ __asm mov eax, Value;
+ __asm mov cr2, eax;
+}
+
+//
// DR Macros
//
ULONG
@@ -243,6 +262,14 @@
{
__asm mov eax, Value;
__asm mov dr0, eax;
+}
+
+VOID
+FORCEINLINE
+Ke386SetDr1(IN ULONG Value)
+{
+ __asm mov eax, Value;
+ __asm mov dr1, eax;
}
VOID
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/ke.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h Thu Mar 1 22:51:20 2007
@@ -63,8 +63,14 @@
VOID
NTAPI
+KiRestoreProcessorControlState(
+ IN PKPROCESSOR_STATE ProcessorState
+);
+
+VOID
+NTAPI
KiSaveProcessorControlState(
- IN PKPROCESSOR_STATE ProcessorState
+ OUT PKPROCESSOR_STATE ProcessorState
);
VOID
Modified: trunk/reactos/ntoskrnl/include/internal/io.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/io.h Thu Mar 1 22:51:20 2007
@@ -968,6 +968,7 @@
extern GENERIC_MAPPING IopFileMapping;
extern POBJECT_TYPE _IoFileObjectType;
extern HAL_DISPATCH _HalDispatchTable;
+extern LIST_ENTRY IopErrorLogListHead;
//
// Inlined Functions
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h Thu Mar 1 22:51:20 2007
@@ -70,11 +70,6 @@
IN PCHAR Ansi,
IN ULONG Length
);
-
-struct _KIRQ_TRAPFRAME;
-struct _KPCR;
-struct _KPRCB;
-struct _KEXCEPTION_FRAME;
extern ULONG_PTR MmFreeLdrFirstKrnlPhysAddr;
extern ULONG_PTR MmFreeLdrLastKrnlPhysAddr;
@@ -131,7 +126,7 @@
extern UCHAR KiTimeIncrementShiftCount;
extern ULONG KiTimeLimitIsrMicroseconds;
extern ULONG KiServiceLimit;
-extern LIST_ENTRY BugcheckCallbackListHead, BugcheckReasonCallbackListHead;
+extern LIST_ENTRY KeBugcheckCallbackListHead, KeBugcheckReasonCallbackListHead;
extern KSPIN_LOCK BugCheckCallbackLock;
extern KDPC KiTimerExpireDpc;
extern KTIMER_TABLE_ENTRY KiTimerTableListHead[TIMER_TABLE_SIZE];
@@ -154,6 +149,8 @@
extern PVOID KeRaiseUserExceptionDispatcher;
extern UCHAR KiDebugRegisterTrapOffsets[9];
extern UCHAR KiDebugRegisterContextOffsets[9];
+extern ULONG KeTimeIncrement;
+extern ULONG_PTR KiBugCheckData[5];
/* MACROS *************************************************************************/
@@ -193,16 +190,6 @@
/* INTERNAL KERNEL FUNCTIONS ************************************************/
-/* Readies a Thread for Execution. */
-BOOLEAN
-NTAPI
-KiDispatchThreadNoLock(ULONG NewThreadStatus);
-
-/* Readies a Thread for Execution. */
-VOID
-NTAPI
-KiDispatchThread(ULONG NewThreadStatus);
-
/* Finds a new thread to run */
NTSTATUS
FASTCALL
@@ -392,10 +379,6 @@
IN PKTRAP_FRAME TrapFrame,
IN KPROFILE_SOURCE Source
);
-
-BOOLEAN
-NTAPI
-KiRosPrintAddress(PVOID Address);
VOID
NTAPI
@@ -520,27 +503,11 @@
IN KPRIORITY Priority
);
-BOOLEAN
-NTAPI
-KiDispatcherObjectWake(
- DISPATCHER_HEADER* hdr,
- KPRIORITY increment
-);
-
VOID
FASTCALL
KiUnlinkThread(
IN PKTHREAD Thread,
IN NTSTATUS WaitStatus
-);
-
-VOID
-NTAPI
-KeExpireTimers(
- PKDPC Apc,
- PVOID Arg1,
- PVOID Arg2,
- PVOID Arg3
);
VOID
@@ -726,10 +693,6 @@
VOID
NTAPI
-KiInitializeSystemClock(VOID);
-
-VOID
-NTAPI
KiSystemStartup(
IN PLOADER_PARAMETER_BLOCK LoaderBlock
);
@@ -949,6 +912,15 @@
IN LONGLONG Value
);
+BOOLEAN
+NTAPI
+KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
+ IN PKEXCEPTION_FRAME ExceptionFrame);
+
+VOID
+NTAPI
+KeThawExecution(IN BOOLEAN Enable);
+
#include "ke_x.h"
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ob.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ob.h Thu Mar 1 22:51:20 2007
@@ -503,8 +503,8 @@
extern KEVENT ObpDefaultObject;
extern POBJECT_TYPE ObpTypeObjectType;
extern POBJECT_TYPE ObSymbolicLinkType;
-extern POBJECT_TYPE ObTypeObjectType;
-extern POBJECT_DIRECTORY NameSpaceRoot;
+extern POBJECT_TYPE ObpTypeObjectType;
+extern POBJECT_DIRECTORY ObpRootDirectoryObject;
extern POBJECT_DIRECTORY ObpTypeDirectoryObject;
extern PHANDLE_TABLE ObpKernelHandleTable;
extern WORK_QUEUE_ITEM ObpReaperWorkItem;
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ps.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ps.h Thu Mar 1 22:51:20 2007
@@ -385,6 +385,7 @@
extern LARGE_INTEGER ShortPsLockDelay;
extern UNICODE_STRING PsNtDllPathName;
extern LIST_ENTRY PsLoadedModuleList;
+extern ULONG PsNtosImageBase;
//
// Inlined Functions
Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/ntoskrnl.…
==============================================================================
--- trunk/reactos/ntoskrnl/include/ntoskrnl.h (original)
+++ trunk/reactos/ntoskrnl/include/ntoskrnl.h Thu Mar 1 22:51:20 2007
@@ -8,12 +8,16 @@
/* INCLUDES ******************************************************************/
-/* Always target Windows 2003 Service Pack 1 */
+/* Version Data */
+#include <ntverp.h>
#define _WIN32_WINNT _WIN32_WINNT_WS03
#define NTDDI_VERSION NTDDI_WS03SP1
#define NTKERNELAPI
+#define NOEXTAPI
/* DDK/IFS/NDK Headers */
+#define NTKERNELAPI
+#define NOEXTAPI
#include <ntifs.h>
#undef _KPROCESS
#undef _EPROCESS
@@ -41,15 +45,19 @@
#include <pseh/pseh.h>
/* ReactOS Headers */
-#include <reactos/version.h>
-#include <reactos/resource.h>
+#include <reactos/buildno.h>
#include <reactos/bugcodes.h>
-#include <reactos/rossym.h>
#define ExRaiseStatus RtlRaiseStatus
#include <reactos/probe.h>
+#include <reactos/rossym.h>
/* SetupLDR Support */
#include <arc/setupblk.h>
+
+/* KD Support */
+#include <windbgkd.h>
+#include <wdbgexts.h>
+#include <kddll.h>
/* PNP GUIDs */
#include <umpnpmgr/sysguid.h>
Modified: trunk/reactos/ntoskrnl/io/iomgr/error.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/error.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/error.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/error.c Thu Mar 1 22:51:20 2007
@@ -23,7 +23,7 @@
/* GLOBALS *******************************************************************/
LONG IopTotalLogSize;
-LIST_ENTRY IopLogListHead;
+LIST_ENTRY IopErrorLogListHead;
KSPIN_LOCK IopLogListLock;
BOOLEAN IopLogWorkerRunning;
@@ -59,7 +59,7 @@
/* Acquire the lock and check if the list is empty */
KeAcquireSpinLock(&IopLogListLock, &OldIrql);
- if (IsListEmpty(&IopLogListHead))
+ if (IsListEmpty(&IopErrorLogListHead))
{
/* List is empty, disable the worker and return NULL */
IopLogWorkerRunning = FALSE;
@@ -68,7 +68,7 @@
else
{
/* Otherwise, remove an entry */
- ListEntry = RemoveHeadList(&IopLogListHead);
+ ListEntry = RemoveHeadList(&IopErrorLogListHead);
}
/* Release the lock and return the entry */
@@ -420,7 +420,7 @@
if (!NT_SUCCESS(Status))
{
/* Requeue log message and restart the worker */
- ExInterlockedInsertTailList(&IopLogListHead,
+ ExInterlockedInsertTailList(&IopErrorLogListHead,
&LogEntry->ListEntry,
&IopLogListLock);
IopLogWorkerRunning = FALSE;
@@ -581,7 +581,7 @@
/* Acquire the lock and insert this write in the list */
KeAcquireSpinLock(&IopLogListLock, &Irql);
- InsertHeadList(&IopLogListHead, &LogEntry->ListEntry);
+ InsertHeadList(&IopErrorLogListHead, &LogEntry->ListEntry);
/* Check if the worker is runnign */
if (!IopLogWorkerRunning)
Modified: trunk/reactos/ntoskrnl/io/iomgr/iomgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iomgr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iomgr.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iomgr.c Thu Mar 1 22:51:20 2007
@@ -70,7 +70,7 @@
extern LIST_ENTRY DriverReinitListHead;
extern LIST_ENTRY PnpNotifyListHead;
extern LIST_ENTRY FsChangeNotifyListHead;
-extern LIST_ENTRY IopLogListHead;
+extern LIST_ENTRY IopErrorLogListHead;
extern LIST_ENTRY IopTimerQueueHead;
extern KDPC IopTimerDpc;
extern KTIMER IopTimer;
@@ -467,7 +467,7 @@
InitializeListHead(&PnpNotifyListHead);
InitializeListHead(&ShutdownListHead);
InitializeListHead(&FsChangeNotifyListHead);
- InitializeListHead(&IopLogListHead);
+ InitializeListHead(&IopErrorLogListHead);
KeInitializeSpinLock(&CancelSpinLock);
KeInitializeSpinLock(&IoVpbLock);
KeInitializeSpinLock(&IoStatisticsLock);
Modified: trunk/reactos/ntoskrnl/kd/kdmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdmain.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/kd/kdmain.c (original)
+++ trunk/reactos/ntoskrnl/kd/kdmain.c Thu Mar 1 22:51:20 2007
@@ -18,7 +18,6 @@
BOOLEAN KdDebuggerNotPresent = TRUE;
BOOLEAN KiEnableTimerWatchdog = FALSE;
BOOLEAN KdBreakAfterSymbolLoad = FALSE;
-ULONG KiBugCheckData;
BOOLEAN KdpBreakPending;
VOID STDCALL PspDumpThreads(BOOLEAN SystemThreads);
Modified: trunk/reactos/ntoskrnl/ke/bug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=2593…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/bug.c (original)
+++ trunk/reactos/ntoskrnl/ke/bug.c Thu Mar 1 22:51:20 2007
@@ -18,8 +18,8 @@
/* GLOBALS *******************************************************************/
-LIST_ENTRY BugcheckCallbackListHead;
-LIST_ENTRY BugcheckReasonCallbackListHead;
+LIST_ENTRY KeBugcheckCallbackListHead;
+LIST_ENTRY KeBugcheckReasonCallbackListHead;
KSPIN_LOCK BugCheckCallbackLock;
ULONG KeBugCheckActive, KeBugCheckOwner;
LONG KeBugCheckOwnerRecursionCount;
@@ -209,7 +209,7 @@
ULONG_PTR Checksum;
/* First make sure that the list is Initialized... it might not be */
- ListHead = &BugcheckCallbackListHead;
+ ListHead = &KeBugcheckCallbackListHead;
if ((ListHead->Flink) && (ListHead->Blink))
{
/* Loop the list */
@@ -427,13 +427,27 @@
{
CHAR AnsiName[75];
+ /* Check if bootvid is installed */
+ if (InbvIsBootDriverInstalled())
+ {
+ /* Acquire ownership and reset the display */
+ InbvAcquireDisplayOwnership();
+ InbvResetDisplay();
+
+ /* Display blue screen */
+ InbvSolidColorFill(0, 0, 639, 479, 4);
+ InbvSetTextColor(15);
+ InbvInstallDisplayStringFilter(NULL);
+ InbvEnableDisplayString(TRUE);
+ InbvSetScrollRegion(0, 0, 639, 479);
+ }
+
/* Check if this is a hard error */
if (IsHardError)
{
/* Display caption and message */
if (HardErrCaption) InbvDisplayString(HardErrCaption);
if (HardErrMessage) InbvDisplayString(HardErrMessage);
- return;
}
/* Begin the display */
@@ -514,7 +528,7 @@
CONTEXT Context;
ULONG MessageId;
CHAR AnsiName[128];
- BOOLEAN IsSystem, IsHardError = FALSE;
+ BOOLEAN IsSystem, IsHardError = FALSE, Reboot = FALSE;
PCHAR HardErrCaption = NULL, HardErrMessage = NULL;
PVOID Eip = NULL, Memory;
PVOID DriverBase;
@@ -543,9 +557,10 @@
/* Capture the CPU Context */
RtlCaptureContext(&Prcb->ProcessorState.ContextFrame);
+ KiSaveProcessorControlState(&Prcb->ProcessorState);
Context = Prcb->ProcessorState.ContextFrame;
- /* FIXME: Call the Watchdog if it's regsitered */
+ /* FIXME: Call the Watchdog if it's registered */
/* Check which bugcode this is */
switch (BugCheckCode)
@@ -560,7 +575,6 @@
case FAT_FILE_SYSTEM:
case NO_MORE_SYSTEM_PTES:
case INACCESSIBLE_BOOT_DEVICE:
- case KMODE_EXCEPTION_NOT_HANDLED:
/* Keep the same code */
MessageId = BugCheckCode;
@@ -568,33 +582,40 @@
/* Check if this is a kernel-mode exception */
case KERNEL_MODE_EXCEPTION_NOT_HANDLED:
+ //case SYSTEM_THREAD_EXCEPTION_NOT_HANDLED:
+ case KMODE_EXCEPTION_NOT_HANDLED:
/* Use the generic text message */
MessageId = KMODE_EXCEPTION_NOT_HANDLED;
+ break;
/* File-system errors */
case NTFS_FILE_SYSTEM:
/* Use the generic message for FAT */
MessageId = FAT_FILE_SYSTEM;
+ break;
/* Check if this is a coruption of the Mm's Pool */
case DRIVER_CORRUPTED_MMPOOL:
/* Use generic corruption message */
MessageId = DRIVER_CORRUPTED_EXPOOL;
+ break;
/* Check if this is a signature check failure */
case STATUS_SYSTEM_IMAGE_BAD_SIGNATURE:
/* Use the generic corruption message */
MessageId = BUGCODE_PSS_MESSAGE_SIGNATURE;
+ break;
/* All other codes */
default:
/* Use the default bugcheck message */
MessageId = BUGCODE_PSS_MESSAGE;
+ break;
}
/* Save bugcheck data */
@@ -721,9 +742,13 @@
{
/* Get EIP */
Eip = (PVOID)TrapFrame->Eip;
+ KiBugCheckData[3] = (ULONG)Eip;
/* Find out if was in the kernel or drivers */
- DriverBase = KiPcToFileHeader(Eip, &LdrEntry, FALSE, &IsSystem);
+ DriverBase = KiPcToFileHeader(Eip,
+ &LdrEntry,
+ FALSE,
+ &IsSystem);
}
/*
@@ -732,8 +757,8 @@
* and update the bugcheck code appropriately.
*/
- /* Check if we had a driver base */
- if (DriverBase)
+ /* Check if we didn't have a driver base */
+ if (!DriverBase)
{
/* Find the driver that unloaded at this address */
KiBugCheckDriver = NULL; // FIXME: ROS can't locate
@@ -757,10 +782,9 @@
/* Check if the driver consumed too many PTEs */
case DRIVER_USED_EXCESSIVE_PTES:
- /* Driver base is in parameter 1 */
- DriverBase = (PVOID)BugCheckParameter1;
- /* FIXME: LdrEntry is uninitialized for god's sake!!!
- KiBugCheckDriver = &LdrEntry->BaseDllName; */
+ /* Loader entry is in parameter 1 */
+ LdrEntry = (PVOID)BugCheckParameter1;
+ KiBugCheckDriver = &LdrEntry->BaseDllName;
break;
/* Check if the driver has a stuck thread */
@@ -794,7 +818,7 @@
}
}
- /* FIXME: Check if we need to save the context for KD */
+ /* Check if we need to save the context for KD */
/* Check if a debugger is connected */
if ((BugCheckCode != MANUALLY_INITIATED_CRASH) && (KdDebuggerEnabled))
@@ -840,24 +864,11 @@
}
}
- /* Use the boot video driver to clear, fill and write to screen. */
- if (InbvIsBootDriverInstalled())
- {
- /* FIXME: This should happen in KiDisplayBlueScreen!!! */
- InbvAcquireDisplayOwnership();
- InbvResetDisplay();
- InbvSolidColorFill(0, 0, 639, 479, 4);
- InbvSetTextColor(15);
- InbvInstallDisplayStringFilter(NULL);
- InbvEnableDisplayString(TRUE);
- InbvSetScrollRegion(0, 0, 639, 479);
- }
-
/* Raise IRQL to HIGH_LEVEL */
_disable();
KeRaiseIrql(HIGH_LEVEL, &OldIrql);
- /* Unlock the Kernel Adress Space if we own it */
+ /* ROS HACK: Unlock the Kernel Address Space if we own it */
if (KernelAddressSpaceLock.Owner == KeGetCurrentThread())
{
MmUnlockAddressSpace(MmGetKernelAddressSpace());
@@ -866,10 +877,10 @@
/* Avoid recursion */
if (!InterlockedDecrement((PLONG)&KeBugCheckCount))
{
+#ifdef CONFIG_SMP
/* Set CPU that is bug checking now */
KeBugCheckOwner = Prcb->Number;
-#ifdef CONFIG_SMP
/* Freeze the other CPUs */
for (i = 0; i < KeNumberProcessors; i++)
{
@@ -889,10 +900,17 @@
HardErrMessage,
AnsiName);
- /* FIXME: Enable debugger if it was pending */
-
- /* Print the last line */
- InbvDisplayString("\r\n");
+ /* Check if the debugger is disabled but we can enable it */
+ //if (!(KdDebuggerEnabled) && !(KdPitchDebugger))
+ {
+ /* Enable it */
+ //KdEnableDebuggerWithLock(FALSE);
+ }
+ //else
+ {
+ /* Otherwise, print the last line */
+ InbvDisplayString("\r\n");
+ }
/* Save the context */
Prcb->ProcessorState.ContextFrame = Context;
@@ -907,24 +925,34 @@
KiBugCheckData[3],
TrapFrame);
}
-
- /* Increase recursioun count */
- KeBugCheckOwnerRecursionCount++;
- if (KeBugCheckOwnerRecursionCount == 2)
- {
- /* Break in the debugger */
- KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
- }
- else if (KeBugCheckOwnerRecursionCount > 2)
- {
- /* Halt the CPU */
- for (;;) Ke386HaltProcessor();
+ else
+ {
+ /* Increase recursion count */
+ KeBugCheckOwnerRecursionCount++;
+ if (KeBugCheckOwnerRecursionCount == 2)
+ {
+ /* Break in the debugger */
+ KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
+ }
+ else if (KeBugCheckOwnerRecursionCount > 2)
+ {
+ /* Halt the CPU */
+ for (;;) Ke386HaltProcessor();
+ }
}
/* Call the Callbacks */
KiDoBugCheckCallbacks();
/* FIXME: Call Watchdog if enabled */
+
+ /* Check if we have to reboot */
+ if (Reboot)
+ {
+ /* Unload symbols */
+ DbgUnLoadImageSymbols(NULL, NtCurrentProcess(), 0);
+ HalReturnToFirmware(HalRebootRoutine);
+ }
/* Attempt to break in the debugger (otherwise halt CPU) */
KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
@@ -1013,7 +1041,7 @@
CallbackRecord->Component = Component;
CallbackRecord->CallbackRoutine = CallbackRoutine;
CallbackRecord->State = BufferInserted;
- InsertTailList(&BugcheckCallbackListHead, &CallbackRecord->Entry);
+ InsertTailList(&KeBugcheckCallbackListHead, &CallbackRecord->Entry);
Status = TRUE;
}
@@ -1047,7 +1075,7 @@
CallbackRecord->CallbackRoutine = CallbackRoutine;
CallbackRecord->State = BufferInserted;
CallbackRecord->Reason = Reason;
- InsertTailList(&BugcheckReasonCallbackListHead,
+ InsertTailList(&KeBugcheckReasonCallbackListHead,
&CallbackRecord->Entry);
Status = TRUE;
}
Modified: trunk/reactos/ntoskrnl/ke/except.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/except.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/except.c (original)
+++ trunk/reactos/ntoskrnl/ke/except.c Thu Mar 1 22:51:20 2007
@@ -143,24 +143,22 @@
Status = _SEH_GetExceptionCode();
}
_SEH_END;
+ if (!NT_SUCCESS(Status)) return Status;
- /* Make sure we didn't crash in SEH */
- if (NT_SUCCESS(Status))
- {
- /* Convert the context record */
- KeContextToTrapFrame(Context,
- ExceptionFrame,
- TrapFrame,
- Context->ContextFlags,
- PreviousMode);
+ /* Convert the context record */
+ KeContextToTrapFrame(Context,
+ ExceptionFrame,
+ TrapFrame,
+ Context->ContextFlags,
+ PreviousMode);
- /* Dispatch the exception */
- KiDispatchException(ExceptionRecord,
- ExceptionFrame,
- TrapFrame,
- PreviousMode,
- SearchFrames);
- }
+ /* Dispatch the exception */
+ ExceptionRecord->ExceptionCode &= ~KI_EXCEPTION_INTERNAL;
+ KiDispatchException(ExceptionRecord,
+ ExceptionFrame,
+ TrapFrame,
+ PreviousMode,
+ SearchFrames);
/* Return the status */
return Status;
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Thu Mar 1 22:51:20 2007
@@ -74,6 +74,10 @@
BOOLEAN KiI386PentiumLockErrataPresent;
BOOLEAN KiSMTProcessorsPresent;
+/* Freeze data */
+KIRQL KiOldIrql;
+ULONG KiFreezeFlag;
+
/* CPU Signatures */
static const CHAR CmpIntelID[] = "GenuineIntel";
static const CHAR CmpAmdID[] = "AuthenticAMD";
@@ -672,13 +676,43 @@
VOID
NTAPI
-KiSaveProcessorControlState(IN PKPROCESSOR_STATE ProcessorState)
+KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState)
+{
+ /* Restore the CR registers */
+ __writecr0(ProcessorState->SpecialRegisters.Cr0);
+ Ke386SetCr2(ProcessorState->SpecialRegisters.Cr2);
+ __writecr3(ProcessorState->SpecialRegisters.Cr3);
+ if (KeFeatureBits & KF_CR4) __writecr4(ProcessorState->SpecialRegisters.Cr4);
+
+ //
+ // Restore the DR registers
+ //
+ Ke386SetDr0(ProcessorState->SpecialRegisters.KernelDr0);
+ Ke386SetDr1(ProcessorState->SpecialRegisters.KernelDr1);
+ Ke386SetDr2(ProcessorState->SpecialRegisters.KernelDr2);
+ Ke386SetDr3(ProcessorState->SpecialRegisters.KernelDr3);
+ Ke386SetDr6(ProcessorState->SpecialRegisters.KernelDr6);
+ Ke386SetDr7(ProcessorState->SpecialRegisters.KernelDr7);
+
+ //
+ // Restore GDT, IDT, LDT and TSS
+ //
+ Ke386SetGlobalDescriptorTable(ProcessorState->SpecialRegisters.Gdtr.Base);
+ Ke386SetInterruptDescriptorTable(ProcessorState->SpecialRegisters.Idtr.Base);
+ Ke386SetTr(ProcessorState->SpecialRegisters.Tr);
+ Ke386SetLocalDescriptorTable(ProcessorState->SpecialRegisters.Ldtr);
+}
+
+VOID
+NTAPI
+KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
{
/* Save the CR registers */
ProcessorState->SpecialRegisters.Cr0 = __readcr0();
ProcessorState->SpecialRegisters.Cr2 = __readcr2();
ProcessorState->SpecialRegisters.Cr3 = __readcr3();
- ProcessorState->SpecialRegisters.Cr4 = __readcr4();
+ ProcessorState->SpecialRegisters.Cr4 = (KeFeatureBits & KF_CR4) ?
+ __readcr4() : 0;
/* Save the DR registers */
ProcessorState->SpecialRegisters.KernelDr0 = Ke386GetDr0();
@@ -690,8 +724,8 @@
Ke386SetDr7(0);
/* Save GDT, IDT, LDT and TSS */
- Ke386GetGlobalDescriptorTable(ProcessorState->SpecialRegisters.Gdtr);
- Ke386GetInterruptDescriptorTable(ProcessorState->SpecialRegisters.Idtr);
+ Ke386GetGlobalDescriptorTable(ProcessorState->SpecialRegisters.Gdtr.Base);
+ Ke386GetInterruptDescriptorTable(ProcessorState->SpecialRegisters.Idtr.Base);
Ke386GetTr(ProcessorState->SpecialRegisters.Tr);
Ke386GetLocalDescriptorTable(ProcessorState->SpecialRegisters.Ldtr);
}
@@ -807,6 +841,39 @@
MmSetPageProtect(NULL, NewIdt, PAGE_READONLY);
}
+BOOLEAN
+NTAPI
+KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
+ IN PKEXCEPTION_FRAME ExceptionFrame)
+{
+ ULONG Flags;
+
+ /* Disable interrupts and get previous state */
+ Ke386SaveFlags(Flags);
+ //Flags = __getcallerseflags();
+ _disable();
+
+ /* Save freeze flag */
+ KiFreezeFlag = 4;
+
+ /* Save the old IRQL */
+ KiOldIrql = KeGetCurrentIrql();
+
+ /* Return whether interrupts were enabled */
+ return (Flags & EFLAGS_INTERRUPT_MASK) ? TRUE: FALSE;
+}
+
+VOID
+NTAPI
+KeThawExecution(IN BOOLEAN Enable)
+{
+ /* Cleanup CPU caches */
+ KeFlushCurrentTb();
+
+ /* Re-enable interrupts */
+ if (Enable) _enable();
+}
+
/* PUBLIC FUNCTIONS **********************************************************/
/*
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/exp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/exp.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c Thu Mar 1 22:51:20 2007
@@ -90,7 +90,7 @@
ULONG DebugMask = KeGetCurrentThread()->DispatcherHeader.DebugActive;
/* Check if debugging is enabled */
- if (DebugMask & DR_ACTIVE_MASK)
+ if (DebugMask & DR_MASK(DR7_OVERRIDE_V))
{
/* Sanity checks */
ASSERT((DebugMask & DR_REG_MASK) != 0);
@@ -133,11 +133,11 @@
Result = FALSE;
/* Check the DR mask */
- NewMask &= 0x7F;
+ NewMask &= ~(DR_MASK(7));
if (NewMask & DR_REG_MASK)
{
/* Set the active mask */
- NewMask |= DR_ACTIVE_MASK;
+ NewMask |= DR_MASK(DR7_OVERRIDE_V);
/* Set DR7 override */
*DrMask = DR7_OVERRIDE_MASK;
@@ -154,8 +154,8 @@
Result = NewMask ? TRUE: FALSE;
/* Update the mask to disable debugging */
- NewMask &= ~DR_ACTIVE_MASK;
- NewMask |= 0x80;
+ NewMask &= ~(DR_MASK(DR7_OVERRIDE_V));
+ NewMask |= DR_MASK(7);
}
/* Check if caller wants the new mask */
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Thu Mar 1 22:51:20 2007
@@ -783,5 +783,3 @@
/* Jump into the idle loop */
KiIdleLoop();
}
-
-
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s Thu Mar 1 22:51:20 2007
@@ -487,7 +487,7 @@
/* Call debug service dispatcher */
mov eax, [ebp+KTRAP_FRAME_EAX]
mov ecx, [ebp+KTRAP_FRAME_ECX]
- mov edx, [ebp+KTRAP_FRAME_EAX]
+ mov edx, [ebp+KTRAP_FRAME_EDX]
/* Check for V86 mode */
test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK
@@ -642,7 +642,7 @@
mov [esp+EXCEPTION_RECORD_NUMBER_PARAMETERS], ecx
/* Check parameter count */
- cmp eax, 0
+ cmp ecx, 0
jz NoParams
/* Get information */
@@ -664,9 +664,11 @@
SetPreviousMode:
- /* Calculate the previous mode */
+ /* Get the caller's CS */
mov eax, [ebp+KTRAP_FRAME_CS]
+
MaskMode:
+ /* Check if it was user-mode or kernel-mode */
and eax, MODE_MASK
/* Dispatch the exception */
@@ -844,8 +846,8 @@
/* Setup EIP, NTSTATUS and parameter count, then dispatch */
mov ebx, [ebp+KTRAP_FRAME_EIP]
dec ebx
+ mov ecx, 3
mov eax, STATUS_BREAKPOINT
- mov ecx, 3
call _CommonDispatchException
V86Int3:
Modified: trunk/reactos/ntoskrnl/ke/krnlinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/krnlinit.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/krnlinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/krnlinit.c Thu Mar 1 22:51:20 2007
@@ -62,8 +62,8 @@
ULONG i;
/* Initialize Bugcheck Callback data */
- InitializeListHead(&BugcheckCallbackListHead);
- InitializeListHead(&BugcheckReasonCallbackListHead);
+ InitializeListHead(&KeBugcheckCallbackListHead);
+ InitializeListHead(&KeBugcheckReasonCallbackListHead);
KeInitializeSpinLock(&BugCheckCallbackLock);
/* Initialize the Timer Expiration DPC */
Modified: trunk/reactos/ntoskrnl/ke/spinlock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/spinlock.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/spinlock.c (original)
+++ trunk/reactos/ntoskrnl/ke/spinlock.c Thu Mar 1 22:51:20 2007
@@ -168,6 +168,40 @@
/*
* @implemented
*/
+BOOLEAN
+FASTCALL
+KeTryToAcquireSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK SpinLock)
+{
+#ifdef CONFIG_SMP
+ /* Check if it's already acquired */
+ if (!(*SpinLock))
+ {
+ /* Try to acquire it */
+ if (InterlockedBitTestAndSet((PLONG)SpinLock, 0))
+ {
+ /* Someone else acquired it */
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* It was already acquired */
+ return FALSE;
+ }
+
+#ifdef DBG
+ /* On debug builds, we OR in the KTHREAD */
+ *SpinLock = (ULONG_PTR)KeGetCurrentThread() | 1;
+#endif
+#endif
+
+ /* All is well, return TRUE */
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
VOID
FASTCALL
KeAcquireInStackQueuedSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock,
Modified: trunk/reactos/ntoskrnl/mm/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/process.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/process.c (original)
+++ trunk/reactos/ntoskrnl/mm/process.c Thu Mar 1 22:51:20 2007
@@ -15,8 +15,8 @@
extern ULONG NtMajorVersion;
extern ULONG NtMinorVersion;
-extern ULONG NtOSCSDVersion;
-extern ULONG NtGlobalFlag;
+extern ULONG CmNtCSDVersion;
+extern ULONG NtBuildNumber;
extern MM_SYSTEMSIZE MmSystemSize;
#define MM_HIGHEST_VAD_ADDRESS \
@@ -329,9 +329,9 @@
/* Default Version Data (could get changed below) */
Peb->OSMajorVersion = NtMajorVersion;
Peb->OSMinorVersion = NtMinorVersion;
- Peb->OSBuildNumber = 2195;
+ Peb->OSBuildNumber = (USHORT)(NtBuildNumber & 0x3FFF);
Peb->OSPlatformId = 2; /* VER_PLATFORM_WIN32_NT */
- Peb->OSCSDVersion = NtOSCSDVersion;
+ Peb->OSCSDVersion = CmNtCSDVersion;
/* Heap and Debug Data */
Peb->NumberOfProcessors = KeNumberProcessors;
Modified: trunk/reactos/ntoskrnl/mm/rpoolmgr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rpoolmgr.h?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/rpoolmgr.h (original)
+++ trunk/reactos/ntoskrnl/mm/rpoolmgr.h Thu Mar 1 22:51:20 2007
@@ -143,7 +143,7 @@
if ( Block->LastOwnerStack[i] != 0xDEADBEEF )
{
R_DEBUG(" ");
- if (!R_PRINT_ADDRESS ((PVOID)Block->LastOwnerStack[i]) )
+ //if (!R_PRINT_ADDRESS ((PVOID)Block->LastOwnerStack[i]) )
{
R_DEBUG("<%X>", Block->LastOwnerStack[i] );
}
Modified: trunk/reactos/ntoskrnl/mm/sysldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/sysldr.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/sysldr.c (original)
+++ trunk/reactos/ntoskrnl/mm/sysldr.c Thu Mar 1 22:51:20 2007
@@ -16,7 +16,7 @@
LIST_ENTRY PsLoadedModuleList;
KSPIN_LOCK PsLoadedModuleSpinLock;
-PVOID PsNtosImageBase;
+ULONG PsNtosImageBase;
KMUTANT MmSystemLoadLock;
extern ULONG NtGlobalFlag;
@@ -1218,7 +1218,7 @@
LdrEntry = CONTAINING_RECORD(NextEntry,
LDR_DATA_TABLE_ENTRY,
InLoadOrderLinks);
- PsNtosImageBase = LdrEntry->DllBase;
+ PsNtosImageBase = (ULONG)LdrEntry->DllBase;
/* Loop the loader block */
while (NextEntry != ListHead)
Modified: trunk/reactos/ntoskrnl/ntoskrnl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rc?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl.rc (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl.rc Thu Mar 1 22:51:20 2007
@@ -1,22 +1,38 @@
-/* $Id$ */
+/*
+ * PROJECT: ReactOS
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/ntoskrnl.rc
+ * PURPOSE: Kernel Resource File
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+#include <winver.h>
+#include <ntverp.h>
-#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Kernel & System\0"
-#define REACTOS_STR_INTERNAL_NAME "ntoskrnl\0"
-#define REACTOS_STR_ORIGINAL_FILENAME "ntoskrnl.exe\0"
-#include <reactos/version.rc>
+//
+// Version Data
+//
+#define VER_FILETYPE VFT_DRV
+#define VER_FILESUBTYPE VFT2_DRV_SYSTEM
+#define VER_FILEDESCRIPTION_STR "NT Kernel & System"
+#define VER_INTERNALNAME_STR "ntoskrnl.exe"
+#define VER_ORIGINALFILENAME_STR "ntoskrnl.exe"
+#define VER_LANGNEUTRAL
+#include "common.ver"
+//
+// Bug Codes and Bitmaps
+//
#include "bugcodes.rc"
-
-1 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/1.bmp"
-2 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/2.bmp"
-3 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/3.bmp"
-4 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/4.bmp"
-5 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/5.bmp"
-6 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/6.bmp"
-7 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/7.bmp"
-8 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/8.bmp"
-13 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/13.bmp"
-14 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/14.bmp"
-15 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/15.bmp"
-16 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/16.bmp"
-17 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/17.bmp"
+1 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/1.bmp"
+2 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/2.bmp"
+3 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/3.bmp"
+4 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/4.bmp"
+5 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/5.bmp"
+6 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/6.bmp"
+7 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/7.bmp"
+8 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/8.bmp"
+13 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/13.bmp"
+14 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/14.bmp"
+15 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/15.bmp"
+16 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/16.bmp"
+17 BITMAP DISCARDABLE "ntoskrnl/inbv/logo/17.bmp"
Modified: trunk/reactos/ntoskrnl/ob/obinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obinit.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obinit.c (original)
+++ trunk/reactos/ntoskrnl/ob/obinit.c Thu Mar 1 22:51:20 2007
@@ -198,7 +198,7 @@
ObjectTypeInitializer.GenericMapping = ObpTypeMapping;
ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(OBJECT_TYPE);
ObjectTypeInitializer.InvalidAttributes = OBJ_OPENLINK;
- ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL,
&ObTypeObjectType);
+ ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL,
&ObpTypeObjectType);
/* Create the Directory Type */
RtlInitUnicodeString(&Name, L"Directory");
@@ -247,7 +247,7 @@
0,
ObDirectoryType,
KernelMode,
- (PVOID*)&NameSpaceRoot,
+ (PVOID*)&ObpRootDirectoryObject,
NULL);
if (!NT_SUCCESS(Status)) return FALSE;
@@ -289,7 +289,7 @@
ObpAcquireDirectoryLockExclusive(ObpTypeDirectoryObject, &Context);
/* Loop the object types */
- ListHead = &ObTypeObjectType->TypeList;
+ ListHead = &ObpTypeObjectType->TypeList;
NextEntry = ListHead->Flink;
while (ListHead != NextEntry)
{
Modified: trunk/reactos/ntoskrnl/ob/oblife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/oblife.c (original)
+++ trunk/reactos/ntoskrnl/ob/oblife.c Thu Mar 1 22:51:20 2007
@@ -19,7 +19,7 @@
extern ULONG NtGlobalFlag;
-POBJECT_TYPE ObTypeObjectType = NULL;
+POBJECT_TYPE ObpTypeObjectType = NULL;
KEVENT ObpDefaultObject;
NPAGED_LOOKASIDE_LIST ObpNmLookasideList, ObpCiLookasideList;
@@ -1074,7 +1074,7 @@
/* Allocate the Object */
Status = ObpAllocateObject(NULL,
&ObjectName,
- ObTypeObjectType,
+ ObpTypeObjectType,
sizeof(OBJECT_TYPE),
KernelMode,
(POBJECT_HEADER*)&Header);
@@ -1098,11 +1098,11 @@
LocalObjectType->HighWaterNumberOfHandles = 0;
/* Check if this is the first Object Type */
- if (!ObTypeObjectType)
+ if (!ObpTypeObjectType)
{
/* It is, so set this as the type object */
- ObTypeObjectType = LocalObjectType;
- Header->Type = ObTypeObjectType;
+ ObpTypeObjectType = LocalObjectType;
+ Header->Type = ObpTypeObjectType;
/* Set the hard-coded key and object count */
LocalObjectType->TotalNumberOfObjects = 1;
@@ -1195,11 +1195,11 @@
/* Get creator info and insert it into the type list */
CreatorInfo = OBJECT_HEADER_TO_CREATOR_INFO(Header);
- if (CreatorInfo) InsertTailList(&ObTypeObjectType->TypeList,
+ if (CreatorInfo) InsertTailList(&ObpTypeObjectType->TypeList,
&CreatorInfo->TypeList);
/* Set the index and the entry into the object type array */
- LocalObjectType->Index = ObTypeObjectType->TotalNumberOfObjects;
+ LocalObjectType->Index = ObpTypeObjectType->TotalNumberOfObjects;
if (LocalObjectType->Index < 32)
{
/* It fits, insert it */
Modified: trunk/reactos/ntoskrnl/ob/obname.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obname.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obname.c (original)
+++ trunk/reactos/ntoskrnl/ob/obname.c Thu Mar 1 22:51:20 2007
@@ -16,7 +16,7 @@
#include <debug.h>
BOOLEAN ObpCaseInsensitive = TRUE;
-POBJECT_DIRECTORY NameSpaceRoot;
+POBJECT_DIRECTORY ObpRootDirectoryObject;
POBJECT_DIRECTORY ObpTypeDirectoryObject;
/* DOS Device Prefix \??\ and \?? */
@@ -407,7 +407,7 @@
{
/* Reparsed to the root directory, so start over */
ObDereferenceObject(RootDirectory);
- RootDirectory = NameSpaceRoot;
+ RootDirectory = ObpRootDirectoryObject;
/* Don't use this anymore, since we're starting at root */
RootHandle = NULL;
@@ -448,7 +448,7 @@
else
{
/* We did not get a Root Directory, so use the root */
- RootDirectory = NameSpaceRoot;
+ RootDirectory = ObpRootDirectoryObject;
/* It must start with a path separator */
if (!(ObjectName->Length) ||
@@ -811,7 +811,7 @@
/* Start at Root */
ParentDirectory = NULL;
- RootDirectory = NameSpaceRoot;
+ RootDirectory = ObpRootDirectoryObject;
/* Check for reparse status */
if (Status == STATUS_REPARSE_OBJECT)
@@ -838,7 +838,7 @@
goto ParseFromRoot;
}
}
- else if (RootDirectory == NameSpaceRoot)
+ else if (RootDirectory == ObpRootDirectoryObject)
{
/* We got STATUS_REPARSE but are at the Root Directory */
Object = NULL;
@@ -1025,7 +1025,7 @@
* enough right at the beginning, not work our way through
* and find out at the end
*/
- if (Object == NameSpaceRoot)
+ if (Object == ObpRootDirectoryObject)
{
/* Size of the '\' string */
NameSize = sizeof(OBJ_NAME_PATH_SEPARATOR);
@@ -1037,7 +1037,7 @@
NameSize = sizeof(OBJ_NAME_PATH_SEPARATOR) + LocalInfo->Name.Length;
/* Loop inside the directory to get the top-most one (meaning root) */
- while ((ParentDirectory != NameSpaceRoot) && (ParentDirectory))
+ while ((ParentDirectory != ObpRootDirectoryObject) && (ParentDirectory))
{
/* Get the Name Information */
LocalInfo = OBJECT_HEADER_TO_NAME_INFO(
@@ -1080,7 +1080,7 @@
*--ObjectName = UNICODE_NULL;
/* Check if the object is actually the Root directory */
- if (Object == NameSpaceRoot)
+ if (Object == ObpRootDirectoryObject)
{
/* This is already the Root Directory, return "\\" */
*--ObjectName = OBJ_NAME_PATH_SEPARATOR;
@@ -1101,7 +1101,7 @@
/* Now parse the Parent directories until we reach the top */
ParentDirectory = LocalInfo->Directory;
- while ((ParentDirectory != NameSpaceRoot) && (ParentDirectory))
+ while ((ParentDirectory != ObpRootDirectoryObject) && (ParentDirectory))
{
/* Get the name information */
LocalInfo = OBJECT_HEADER_TO_NAME_INFO(
Modified: trunk/reactos/ntoskrnl/rtl/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/misc.c?rev=25…
==============================================================================
--- trunk/reactos/ntoskrnl/rtl/misc.c (original)
+++ trunk/reactos/ntoskrnl/rtl/misc.c Thu Mar 1 22:51:20 2007
@@ -58,12 +58,12 @@
lpVersionInformation->dwMinorVersion = NtMinorVersion;
lpVersionInformation->dwBuildNumber = NtBuildNumber;
lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
- if(((NtOSCSDVersion >> 8) & 0xFF) != 0)
+ if(((CmNtCSDVersion >> 8) & 0xFF) != 0)
{
int i = _snwprintf(lpVersionInformation->szCSDVersion,
(sizeof(lpVersionInformation->szCSDVersion) /
sizeof(lpVersionInformation->szCSDVersion[0])) - 1,
L"Service Pack %d",
- ((NtOSCSDVersion >> 8) & 0xFF));
+ ((CmNtCSDVersion >> 8) & 0xFF));
lpVersionInformation->szCSDVersion[i] = L'\0';
}
else
@@ -73,8 +73,8 @@
if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
{
RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation;
- InfoEx->wServicePackMajor = (USHORT)(NtOSCSDVersion >> 8) & 0xFF;
- InfoEx->wServicePackMinor = (USHORT)(NtOSCSDVersion & 0xFF);
+ InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF;
+ InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF);
InfoEx->wSuiteMask = (USHORT)SharedUserData->SuiteMask;
InfoEx->wProductType = SharedUserData->NtProductType;
}