mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 01:40:36 +00:00
- 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. svn path=/trunk/; revision=25937
This commit is contained in:
commit
5928240766
47 changed files with 1669 additions and 227 deletions
|
@ -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 @@ KdPortEnableInterrupts()
|
|||
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 */
|
||||
|
|
|
@ -44,7 +44,9 @@ extern "C" {
|
|||
|
||||
#pragma pack(push,4)
|
||||
|
||||
#ifndef VER_PRODUCTBUILD
|
||||
#define VER_PRODUCTBUILD 10000
|
||||
#endif
|
||||
|
||||
#ifndef NTSYSAPI
|
||||
#define NTSYSAPI
|
||||
|
|
|
@ -637,6 +637,28 @@ typedef IO_ALLOCATION_ACTION
|
|||
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)(
|
||||
IN struct _EXCEPTION_RECORD *ExceptionRecord,
|
||||
|
@ -5425,6 +5447,13 @@ KfReleaseSpinLock(
|
|||
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)
|
||||
|
|
|
@ -494,6 +494,7 @@ Author:
|
|||
#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 @@ Author:
|
|||
#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
|
||||
|
||||
|
|
|
@ -350,7 +350,6 @@ typedef struct _KSPECIAL_REGISTERS
|
|||
//
|
||||
// Processor State Data
|
||||
//
|
||||
#pragma pack(push,4)
|
||||
typedef struct _KPROCESSOR_STATE
|
||||
{
|
||||
CONTEXT ContextFrame;
|
||||
|
@ -360,6 +359,7 @@ typedef struct _KPROCESSOR_STATE
|
|||
//
|
||||
// Processor Region Control Block
|
||||
//
|
||||
#pragma pack(push,4)
|
||||
typedef struct _KPRCB
|
||||
{
|
||||
USHORT MinorVersion;
|
||||
|
|
|
@ -27,29 +27,6 @@ Author:
|
|||
|
||||
#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
|
||||
//
|
||||
|
@ -65,6 +42,12 @@ KdSystemDebugControl(
|
|||
KPROCESSOR_MODE PreviousMode
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
KdPollBreakIn(
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
|
|
|
@ -52,6 +52,7 @@ Author:
|
|||
#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 _SYSDBG_TRIAGE_DUMP
|
|||
typedef struct _KD_SYMBOLS_INFO
|
||||
{
|
||||
PVOID BaseOfDll;
|
||||
PVOID ProcessId;
|
||||
ULONG_PTR ProcessId;
|
||||
ULONG CheckSum;
|
||||
ULONG SizeOfImage;
|
||||
} KD_SYMBOLS_INFO, *PKD_SYMBOLS_INFO;
|
||||
|
|
|
@ -97,6 +97,12 @@ Author:
|
|||
#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
|
||||
//
|
||||
|
@ -297,6 +303,17 @@ typedef enum _ADJUST_REASON
|
|||
AdjustBoost = 2
|
||||
} ADJUST_REASON;
|
||||
|
||||
//
|
||||
// Continue Status
|
||||
//
|
||||
typedef enum _KCONTINUE_STATUS
|
||||
{
|
||||
ContinueError = 0,
|
||||
ContinueSuccess,
|
||||
ContinueProcessorReselected,
|
||||
ContinueNextProcessor
|
||||
} KCONTINUE_STATUS;
|
||||
|
||||
//
|
||||
// Process States
|
||||
//
|
||||
|
|
|
@ -2511,7 +2511,7 @@ NTAPI
|
|||
DbgLoadImageSymbols(
|
||||
IN PANSI_STRING Name,
|
||||
IN PVOID Base,
|
||||
IN ULONG ProcessId
|
||||
IN ULONG_PTR ProcessId
|
||||
);
|
||||
|
||||
VOID
|
||||
|
|
207
reactos/include/psdk/common.ver
Normal file
207
reactos/include/psdk/common.ver
Normal file
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
* PROJECT: ReactOS
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: include/psdk/common.ver
|
||||
* PURPOSE: Common Version File.
|
||||
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
||||
*/
|
||||
|
||||
//
|
||||
// Copyright Year
|
||||
//
|
||||
#ifndef VER_LEGALCOPYRIGHT_YEARS
|
||||
#define VER_LEGALCOPYRIGHT_YEARS "2007"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Copyright String
|
||||
//
|
||||
#ifndef VER_LEGALCOPYRIGHT_STR
|
||||
#if defined(RC_INVOKED) && !defined(WIN16)
|
||||
#define VER_LEGALCOPYRIGHT_STR L"\251 ReactOS Foundation. All rights reserved."
|
||||
#else
|
||||
#define VER_LEGALCOPYRIGHT_STR "Copyright (c) ReactOS Foundation. All rights reserved."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Product Name String
|
||||
//
|
||||
#ifndef VER_PRODUCTNAME_STR
|
||||
#ifdef RC_INVOKED
|
||||
#define VER_PRODUCTNAME_STR L"ReactOS\256 Operating System"
|
||||
#else
|
||||
#define VER_PRODUCTNAME_STR "ReactOS (R) Operating System"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// The File Version is the same as the Product Version
|
||||
//
|
||||
#ifndef VER_FILEVERSION
|
||||
#define VER_FILEVERSION VER_PRODUCTVERSION
|
||||
#endif
|
||||
#ifndef VER_FILEVERSION_STR
|
||||
#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR
|
||||
#endif
|
||||
|
||||
//
|
||||
// If no Original Name was given, use the Internal NAme
|
||||
//
|
||||
#ifndef VER_ORIGINALFILENAME_STR
|
||||
#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR
|
||||
#endif
|
||||
|
||||
//
|
||||
// Allow tagging a Build by Machine/Date
|
||||
//
|
||||
#if defined(__BUILDMACHINE__)
|
||||
#if defined(__BUILDDATE__)
|
||||
#define B2(x,y) " (" #x "." #y ")"
|
||||
#define B1(x,y) B2(x, y)
|
||||
#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__)
|
||||
#else
|
||||
#define B2(x) " built by: " #x
|
||||
#define B1(x) B2(x)
|
||||
#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__)
|
||||
#endif
|
||||
#if defined(__BUILDMACHINE_LEN__)
|
||||
#if __BUILDMACHINE_LEN__ >= 25
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG
|
||||
#elif __BUILDMACHINE_LEN__ == 24
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 23
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 22
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 21
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 20
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 19
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 18
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 17
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 16
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 15
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 14
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 13
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 12
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 11
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 10
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 9
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 8
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 7
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 6
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 5
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 4
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 3
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 2
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#elif __BUILDMACHINE_LEN__ == 1
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " "
|
||||
#else
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG
|
||||
#endif
|
||||
#else
|
||||
#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG
|
||||
#endif
|
||||
#else
|
||||
#define BUILD_MACHINE_TAG
|
||||
#define BUILD_MACHINE_TAG_PADDED
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set default neutral Unicode Language ID
|
||||
//
|
||||
#ifndef VER_VERSION_UNICODE_LANG
|
||||
#define VER_VERSION_UNICODE_LANG "000004B0"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set default netural ANSI Language ID
|
||||
//
|
||||
#ifndef VER_VERSION_ANSI_LANG
|
||||
#define VER_VERSION_ANSI_LANG "000004E4"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set default netural translation ID
|
||||
//
|
||||
#ifndef VER_VERSION_TRANSLATION
|
||||
#define VER_VERSION_TRANSLATION 0x0000, 0x04B0
|
||||
#endif
|
||||
|
||||
//
|
||||
// Make sure the Resource Compiler called us.
|
||||
// If so, then build the actual version resource.
|
||||
//
|
||||
#ifdef RC_INVOKED
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
PRODUCTVERSION VER_PRODUCTVERSION
|
||||
FILEFLAGSMASK VER_FILEFLAGSMASK
|
||||
FILEFLAGS VER_FILEFLAGS
|
||||
FILEOS VER_FILEOS
|
||||
FILETYPE VER_FILETYPE
|
||||
FILESUBTYPE VER_FILESUBTYPE
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK VER_VERSION_UNICODE_LANG
|
||||
BEGIN
|
||||
VALUE "CompanyName", VER_COMPANYNAME_STR
|
||||
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR BUILD_MACHINE_TAG_PADDED
|
||||
VALUE "InternalName", VER_INTERNALNAME_STR
|
||||
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
|
||||
VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR
|
||||
VALUE "ProductName", VER_PRODUCTNAME_STR
|
||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||
#ifdef VER_OLESELFREGISTER
|
||||
VALUE "OleSelfRegister", "\0"
|
||||
#endif
|
||||
END
|
||||
|
||||
#ifdef VER_ANSICP
|
||||
BLOCK VER_VERSION_ANSI_LANG
|
||||
BEGIN
|
||||
VALUE "CompanyName", VER_COMPANYNAME_STR
|
||||
VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||
VALUE "InternalName", VER_INTERNALNAME_STR
|
||||
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
|
||||
VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR
|
||||
VALUE "ProductName", VER_PRODUCTNAME_STR
|
||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||
#ifdef VER_OLESELFREGISTER
|
||||
VALUE "OleSelfRegister", "\0"
|
||||
#endif
|
||||
END
|
||||
#endif
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", VER_VERSION_TRANSLATION
|
||||
END
|
||||
END
|
||||
|
||||
#endif
|
|
@ -89,6 +89,21 @@ typedef struct _OBJECT_ATTRIBUTES {
|
|||
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 )
|
||||
|
|
151
reactos/include/psdk/ntverp.h
Normal file
151
reactos/include/psdk/ntverp.h
Normal file
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
* PROJECT: ReactOS
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: include/psdk/ntverp.h
|
||||
* PURPOSE: Master Version File.
|
||||
* This file should be modified only by the official builder
|
||||
* to update VERSION, VER_PRODUCTVERSION, VER_PRODUCTVERSION_
|
||||
* STR and VER_PRODUCTBETA_STR values.
|
||||
* The VER_PRODUCTBUILD lines must contain the product
|
||||
* comments and end with the build#<CR><LF>.
|
||||
* The VER_PRODUCTBETA_STR lines must contain the product
|
||||
* comments and end with "somestring"<CR><LF.
|
||||
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
||||
*/
|
||||
|
||||
//
|
||||
// Windows NT Build 3790.1830
|
||||
//
|
||||
#define VER_PRODUCTBUILD 3790
|
||||
#define VER_PRODUCTBUILD_QFE 1830
|
||||
|
||||
//
|
||||
// Windows NT Version 5.2
|
||||
//
|
||||
#define VER_PRODUCTMAJORVERSION 5
|
||||
#define VER_PRODUCTMINORVERSION 2
|
||||
#define VER_PRODUCTVERSION_W (0x0502)
|
||||
#define VER_PRODUCTVERSION_DW (0x05020000 | VER_PRODUCTBUILD)
|
||||
|
||||
//
|
||||
// Not a beta
|
||||
//
|
||||
#define VER_PRODUCTBETA_STR ""
|
||||
|
||||
//
|
||||
// ANSI String Generating Macros
|
||||
//
|
||||
#define VER_PRODUCTVERSION_MAJORMINOR2(x,y) \
|
||||
#x "." #y
|
||||
#define VER_PRODUCTVERSION_MAJORMINOR1(x,y) \
|
||||
VER_PRODUCTVERSION_MAJORMINOR2(x, y)
|
||||
#define VER_PRODUCTVERSION_STRING \
|
||||
VER_PRODUCTVERSION_MAJORMINOR1(VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION)
|
||||
|
||||
//
|
||||
// Unicode String Generating Macros
|
||||
//
|
||||
#define LVER_PRODUCTVERSION_MAJORMINOR2(x,y)\
|
||||
L#x L"." L#y
|
||||
#define LVER_PRODUCTVERSION_MAJORMINOR1(x,y)\
|
||||
LVER_PRODUCTVERSION_MAJORMINOR2(x, y)
|
||||
#define LVER_PRODUCTVERSION_STRING \
|
||||
LVER_PRODUCTVERSION_MAJORMINOR1(VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION)
|
||||
|
||||
//
|
||||
// Full Product Version
|
||||
//
|
||||
#define VER_PRODUCTVERSION \
|
||||
VER_PRODUCTMAJORVERSION,VER_PRODUCTMINORVERSION,VER_PRODUCTBUILD,VER_PRODUCTBUILD_QFE
|
||||
|
||||
//
|
||||
// Padding for ANSI Version String
|
||||
//
|
||||
#if (VER_PRODUCTBUILD < 10)
|
||||
#define VER_BPAD "000"
|
||||
#elif (VER_PRODUCTBUILD < 100)
|
||||
#define VER_BPAD "00"
|
||||
#elif (VER_PRODUCTBUILD < 1000)
|
||||
#define VER_BPAD "0"
|
||||
#else
|
||||
#define VER_BPAD
|
||||
#endif
|
||||
|
||||
//
|
||||
// Padding for Unicode Version String
|
||||
//
|
||||
#if (VER_PRODUCTBUILD < 10)
|
||||
#define LVER_BPAD L"000"
|
||||
#elif (VER_PRODUCTBUILD < 100)
|
||||
#define LVER_BPAD L"00"
|
||||
#elif (VER_PRODUCTBUILD < 1000)
|
||||
#define LVER_BPAD L"0"
|
||||
#else
|
||||
#define LVER_BPAD
|
||||
#endif
|
||||
|
||||
//
|
||||
// ANSI Product Version String
|
||||
//
|
||||
#define VER_PRODUCTVERSION_STR2(x,y) \
|
||||
VER_PRODUCTVERSION_STRING "." VER_BPAD #x "." #y
|
||||
#define VER_PRODUCTVERSION_STR1(x,y) \
|
||||
VER_PRODUCTVERSION_STR2(x, y)
|
||||
#define VER_PRODUCTVERSION_STR \
|
||||
VER_PRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
|
||||
//
|
||||
// Unicode Product Version String
|
||||
//
|
||||
#define LVER_PRODUCTVERSION_STR2(x,y) \
|
||||
LVER_PRODUCTVERSION_STRING L"." LVER_BPAD L#x L"." L#y
|
||||
#define LVER_PRODUCTVERSION_STR1(x,y) \
|
||||
LVER_PRODUCTVERSION_STR2(x, y)
|
||||
#define LVER_PRODUCTVERSION_STR \
|
||||
LVER_PRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
|
||||
//
|
||||
// Debug Flag
|
||||
//
|
||||
#if DBG
|
||||
#define VER_DEBUG VS_FF_DEBUG
|
||||
#else
|
||||
#define VER_DEBUG 0
|
||||
#endif
|
||||
|
||||
//
|
||||
// Beta Flag
|
||||
//
|
||||
#if BETA
|
||||
#define VER_PRERELEASE VS_FF_PRERELEASE
|
||||
#else
|
||||
#define VER_PRERELEASE 0
|
||||
#endif
|
||||
|
||||
//
|
||||
// Internal Flag
|
||||
//
|
||||
#if OFFICIAL_BUILD
|
||||
#define VER_PRIVATE 0
|
||||
#else
|
||||
#define VER_PRIVATE VS_FF_PRIVATEBUILD
|
||||
#endif
|
||||
|
||||
//
|
||||
// Other Flags
|
||||
//
|
||||
#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#define VER_FILEOS VOS_NT_WINDOWS32
|
||||
#define VER_FILEFLAGS (VER_PRERELEASE | \
|
||||
VER_DEBUG | \
|
||||
VER_PRIVATE)
|
||||
|
||||
//
|
||||
// Company and Trademarks
|
||||
//
|
||||
#define VER_COMPANYNAME_STR \
|
||||
"ReactOS(R) Foundation"
|
||||
#define VER_PRODUCTNAME_STR \
|
||||
"ReactOS(R) Operating System"
|
||||
#define VER_LEGALTRADEMARKS_STR \
|
||||
"ReactOS(R) is a registered trademark of the ReactOS Foundation."
|
191
reactos/include/psdk/wdbgexts.h
Normal file
191
reactos/include/psdk/wdbgexts.h
Normal file
|
@ -0,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
|
54
reactos/include/reactos/kddll.h
Normal file
54
reactos/include/reactos/kddll.h
Normal file
|
@ -0,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
|
488
reactos/include/reactos/windbgkd.h
Normal file
488
reactos/include/reactos/windbgkd.h
Normal file
|
@ -0,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
|
|
@ -328,7 +328,7 @@ DbgLoadImageSymbols(IN PANSI_STRING Name,
|
|||
|
||||
/* 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 @@ DbgUnLoadImageSymbols(IN PANSI_STRING Name,
|
|||
|
||||
/* Setup the symbol data */
|
||||
SymbolInfo.BaseOfDll = Base;
|
||||
SymbolInfo.ProcessId = (PVOID)ProcessId;
|
||||
SymbolInfo.ProcessId = (ULONG)ProcessId;
|
||||
SymbolInfo.CheckSum = SymbolInfo.SizeOfImage = 0;
|
||||
|
||||
/* Load the symbols */
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
.globl _DebugService@20
|
||||
.globl _DebugService2@12
|
||||
.globl _DbgBreakPointNoBugCheck@0
|
||||
.globl _RtlpBreakWithStatusInstruction@0
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
|
@ -35,6 +36,8 @@ _DbgUserBreakPoint@0:
|
|||
.func DbgBreakPointWithStatus@4
|
||||
_DbgBreakPointWithStatus@4:
|
||||
mov eax, [esp+4]
|
||||
|
||||
_RtlpBreakWithStatusInstruction@0:
|
||||
int 3
|
||||
ret 4
|
||||
.endfunc
|
||||
|
|
|
@ -172,11 +172,11 @@ CmFindObject(POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
|||
|
||||
if (ObjectCreateInfo->RootDirectory == NULL)
|
||||
{
|
||||
ObReferenceObjectByPointer(NameSpaceRoot,
|
||||
ObReferenceObjectByPointer(ObpRootDirectoryObject,
|
||||
DIRECTORY_TRAVERSE,
|
||||
CmiKeyType,
|
||||
ObjectCreateInfo->ProbeMode);
|
||||
CurrentObject = NameSpaceRoot;
|
||||
CurrentObject = ObpRootDirectoryObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -312,7 +312,7 @@ Next:
|
|||
if (Status == STATUS_REPARSE)
|
||||
{
|
||||
/* reparse the object path */
|
||||
NextObject = NameSpaceRoot;
|
||||
NextObject = ObpRootDirectoryObject;
|
||||
current = PathString.Buffer;
|
||||
|
||||
ObReferenceObjectByPointer(NextObject,
|
||||
|
|
|
@ -14,19 +14,31 @@
|
|||
#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;
|
||||
BOOLEAN ExpInTextModeSetup;
|
||||
|
@ -671,11 +683,12 @@ ExpLoadBootSymbols(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
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 @@ ExpLoadBootSymbols(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
{
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,45 @@ ULONG ExpLastTimeZoneBias = -1;
|
|||
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
|
||||
ExRefreshTimeZoneInformation(IN PLARGE_INTEGER CurrentBootTime)
|
||||
|
|
|
@ -17,9 +17,13 @@ extern FAST_MUTEX ExpEnvironmentLock;
|
|||
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 @@ ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
|
|||
|
||||
/* 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 @@ ExfpInterlockedExchange64(
|
|||
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);
|
||||
|
|
|
@ -80,18 +80,26 @@ static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULO
|
|||
|
||||
#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)
|
||||
|
||||
|
@ -192,6 +200,17 @@ Ke386GetTr(IN USHORT Tr)
|
|||
__asm str Tr;
|
||||
}
|
||||
|
||||
//
|
||||
// CR Macros
|
||||
//
|
||||
VOID
|
||||
FORCEINLINE
|
||||
Ke386SetCr2(IN ULONG Value)
|
||||
{
|
||||
__asm mov eax, Value;
|
||||
__asm mov cr2, eax;
|
||||
}
|
||||
|
||||
//
|
||||
// DR Macros
|
||||
//
|
||||
|
@ -245,6 +264,14 @@ Ke386SetDr0(IN ULONG Value)
|
|||
__asm mov dr0, eax;
|
||||
}
|
||||
|
||||
VOID
|
||||
FORCEINLINE
|
||||
Ke386SetDr1(IN ULONG Value)
|
||||
{
|
||||
__asm mov eax, Value;
|
||||
__asm mov dr1, eax;
|
||||
}
|
||||
|
||||
VOID
|
||||
FORCEINLINE
|
||||
Ke386SetDr2(IN ULONG Value)
|
||||
|
|
|
@ -63,10 +63,16 @@ Ki386InitializeTss(
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
KiSaveProcessorControlState(
|
||||
KiRestoreProcessorControlState(
|
||||
IN PKPROCESSOR_STATE ProcessorState
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KiSaveProcessorControlState(
|
||||
OUT PKPROCESSOR_STATE ProcessorState
|
||||
);
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
KiIdleLoop(VOID);
|
||||
|
|
|
@ -968,6 +968,7 @@ extern GENERIC_MAPPING IopCompletionMapping;
|
|||
extern GENERIC_MAPPING IopFileMapping;
|
||||
extern POBJECT_TYPE _IoFileObjectType;
|
||||
extern HAL_DISPATCH _HalDispatchTable;
|
||||
extern LIST_ENTRY IopErrorLogListHead;
|
||||
|
||||
//
|
||||
// Inlined Functions
|
||||
|
|
|
@ -71,11 +71,6 @@ typedef PCHAR
|
|||
IN ULONG Length
|
||||
);
|
||||
|
||||
struct _KIRQ_TRAPFRAME;
|
||||
struct _KPCR;
|
||||
struct _KPRCB;
|
||||
struct _KEXCEPTION_FRAME;
|
||||
|
||||
extern ULONG_PTR MmFreeLdrFirstKrnlPhysAddr;
|
||||
extern ULONG_PTR MmFreeLdrLastKrnlPhysAddr;
|
||||
extern ULONG_PTR MmFreeLdrLastKernelAddress;
|
||||
|
@ -131,7 +126,7 @@ extern LARGE_INTEGER KiTimeIncrementReciprocal;
|
|||
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 KeUserExceptionDispatcher;
|
|||
extern PVOID KeRaiseUserExceptionDispatcher;
|
||||
extern UCHAR KiDebugRegisterTrapOffsets[9];
|
||||
extern UCHAR KiDebugRegisterContextOffsets[9];
|
||||
extern ULONG KeTimeIncrement;
|
||||
extern ULONG_PTR KiBugCheckData[5];
|
||||
|
||||
/* MACROS *************************************************************************/
|
||||
|
||||
|
@ -193,16 +190,6 @@ extern UCHAR KiDebugRegisterContextOffsets[9];
|
|||
|
||||
/* 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
|
||||
|
@ -393,10 +380,6 @@ KeProfileInterruptWithSource(
|
|||
IN KPROFILE_SOURCE Source
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
KiRosPrintAddress(PVOID Address);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KeUpdateRunTime(
|
||||
|
@ -520,13 +503,6 @@ KiSetPriorityThread(
|
|||
IN KPRIORITY Priority
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
KiDispatcherObjectWake(
|
||||
DISPATCHER_HEADER* hdr,
|
||||
KPRIORITY increment
|
||||
);
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
KiUnlinkThread(
|
||||
|
@ -534,15 +510,6 @@ KiUnlinkThread(
|
|||
IN NTSTATUS WaitStatus
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KeExpireTimers(
|
||||
PKDPC Apc,
|
||||
PVOID Arg1,
|
||||
PVOID Arg2,
|
||||
PVOID Arg3
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KeDumpStackFrames(PULONG Frame);
|
||||
|
@ -724,10 +691,6 @@ VOID
|
|||
NTAPI
|
||||
KiInitializeBugCheck(VOID);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KiInitializeSystemClock(VOID);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KiSystemStartup(
|
||||
|
@ -949,6 +912,15 @@ WRMSR(
|
|||
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 */
|
||||
|
|
|
@ -503,8 +503,8 @@ extern ULONG ObpTraceLevel;
|
|||
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;
|
||||
|
|
|
@ -385,6 +385,7 @@ extern POBJECT_TYPE PsJobType;
|
|||
extern LARGE_INTEGER ShortPsLockDelay;
|
||||
extern UNICODE_STRING PsNtDllPathName;
|
||||
extern LIST_ENTRY PsLoadedModuleList;
|
||||
extern ULONG PsNtosImageBase;
|
||||
|
||||
//
|
||||
// Inlined Functions
|
||||
|
|
|
@ -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,16 +45,20 @@
|
|||
#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>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ typedef struct _IOP_ERROR_LOG_WORKER_DPC
|
|||
/* GLOBALS *******************************************************************/
|
||||
|
||||
LONG IopTotalLogSize;
|
||||
LIST_ENTRY IopLogListHead;
|
||||
LIST_ENTRY IopErrorLogListHead;
|
||||
KSPIN_LOCK IopLogListLock;
|
||||
|
||||
BOOLEAN IopLogWorkerRunning;
|
||||
|
@ -59,7 +59,7 @@ IopGetErrorLogEntry(VOID)
|
|||
|
||||
/* 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 @@ IopGetErrorLogEntry(VOID)
|
|||
else
|
||||
{
|
||||
/* Otherwise, remove an entry */
|
||||
ListEntry = RemoveHeadList(&IopLogListHead);
|
||||
ListEntry = RemoveHeadList(&IopErrorLogListHead);
|
||||
}
|
||||
|
||||
/* Release the lock and return the entry */
|
||||
|
@ -420,7 +420,7 @@ IopLogWorker(IN PVOID Parameter)
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Requeue log message and restart the worker */
|
||||
ExInterlockedInsertTailList(&IopLogListHead,
|
||||
ExInterlockedInsertTailList(&IopErrorLogListHead,
|
||||
&LogEntry->ListEntry,
|
||||
&IopLogListLock);
|
||||
IopLogWorkerRunning = FALSE;
|
||||
|
@ -581,7 +581,7 @@ IoWriteErrorLogEntry(IN PVOID ElEntry)
|
|||
|
||||
/* 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)
|
||||
|
|
|
@ -70,7 +70,7 @@ extern LIST_ENTRY DriverBootReinitListHead;
|
|||
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 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
InitializeListHead(&PnpNotifyListHead);
|
||||
InitializeListHead(&ShutdownListHead);
|
||||
InitializeListHead(&FsChangeNotifyListHead);
|
||||
InitializeListHead(&IopLogListHead);
|
||||
InitializeListHead(&IopErrorLogListHead);
|
||||
KeInitializeSpinLock(&CancelSpinLock);
|
||||
KeInitializeSpinLock(&IoVpbLock);
|
||||
KeInitializeSpinLock(&IoStatisticsLock);
|
||||
|
|
|
@ -18,7 +18,6 @@ BOOLEAN KdEnteredDebugger = FALSE;
|
|||
BOOLEAN KdDebuggerNotPresent = TRUE;
|
||||
BOOLEAN KiEnableTimerWatchdog = FALSE;
|
||||
BOOLEAN KdBreakAfterSymbolLoad = FALSE;
|
||||
ULONG KiBugCheckData;
|
||||
BOOLEAN KdpBreakPending;
|
||||
VOID STDCALL PspDumpThreads(BOOLEAN SystemThreads);
|
||||
|
||||
|
|
|
@ -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 @@ KiDoBugCheckCallbacks(VOID)
|
|||
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 @@ KiDisplayBlueScreen(IN ULONG MessageId,
|
|||
{
|
||||
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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
|
||||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
|
||||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
{
|
||||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
}
|
||||
}
|
||||
|
||||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
}
|
||||
}
|
||||
|
||||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
/* 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 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
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,18 +925,20 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
KiBugCheckData[3],
|
||||
TrapFrame);
|
||||
}
|
||||
|
||||
/* Increase recursioun count */
|
||||
KeBugCheckOwnerRecursionCount++;
|
||||
if (KeBugCheckOwnerRecursionCount == 2)
|
||||
else
|
||||
{
|
||||
/* Break in the debugger */
|
||||
KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
|
||||
}
|
||||
else if (KeBugCheckOwnerRecursionCount > 2)
|
||||
{
|
||||
/* Halt the CPU */
|
||||
for (;;) Ke386HaltProcessor();
|
||||
/* 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 */
|
||||
|
@ -926,6 +946,14 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
|
||||
/* 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 @@ KeRegisterBugCheckCallback(IN PKBUGCHECK_CALLBACK_RECORD CallbackRecord,
|
|||
CallbackRecord->Component = Component;
|
||||
CallbackRecord->CallbackRoutine = CallbackRoutine;
|
||||
CallbackRecord->State = BufferInserted;
|
||||
InsertTailList(&BugcheckCallbackListHead, &CallbackRecord->Entry);
|
||||
InsertTailList(&KeBugcheckCallbackListHead, &CallbackRecord->Entry);
|
||||
Status = TRUE;
|
||||
}
|
||||
|
||||
|
@ -1047,7 +1075,7 @@ KeRegisterBugCheckReasonCallback(
|
|||
CallbackRecord->CallbackRoutine = CallbackRoutine;
|
||||
CallbackRecord->State = BufferInserted;
|
||||
CallbackRecord->Reason = Reason;
|
||||
InsertTailList(&BugcheckReasonCallbackListHead,
|
||||
InsertTailList(&KeBugcheckReasonCallbackListHead,
|
||||
&CallbackRecord->Entry);
|
||||
Status = TRUE;
|
||||
}
|
||||
|
|
|
@ -143,24 +143,22 @@ KiRaiseException(IN PEXCEPTION_RECORD ExceptionRecord,
|
|||
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;
|
||||
|
|
|
@ -74,6 +74,10 @@ KAFFINITY KeActiveProcessors = 1;
|
|||
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 @@ KeFlushCurrentTb(VOID)
|
|||
|
||||
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 @@ KiSaveProcessorControlState(IN PKPROCESSOR_STATE ProcessorState)
|
|||
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 @@ KiI386PentiumLockErrataFixup(VOID)
|
|||
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 **********************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
@ -90,7 +90,7 @@ KiUpdateDr7(IN ULONG Dr7)
|
|||
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 @@ KiRecordDr7(OUT PULONG Dr7Ptr,
|
|||
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 @@ KiRecordDr7(OUT PULONG Dr7Ptr,
|
|||
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 */
|
||||
|
|
|
@ -783,5 +783,3 @@ AppCpuInit:
|
|||
/* Jump into the idle loop */
|
||||
KiIdleLoop();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -487,7 +487,7 @@ _KiDebugService:
|
|||
/* 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 @@ _CommonDispatchException:
|
|||
mov [esp+EXCEPTION_RECORD_NUMBER_PARAMETERS], ecx
|
||||
|
||||
/* Check parameter count */
|
||||
cmp eax, 0
|
||||
cmp ecx, 0
|
||||
jz NoParams
|
||||
|
||||
/* Get information */
|
||||
|
@ -664,9 +664,11 @@ NoParams:
|
|||
|
||||
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 @@ PrepInt3:
|
|||
/* Setup EIP, NTSTATUS and parameter count, then dispatch */
|
||||
mov ebx, [ebp+KTRAP_FRAME_EIP]
|
||||
dec ebx
|
||||
mov eax, STATUS_BREAKPOINT
|
||||
mov ecx, 3
|
||||
mov eax, STATUS_BREAKPOINT
|
||||
call _CommonDispatchException
|
||||
|
||||
V86Int3:
|
||||
|
|
|
@ -62,8 +62,8 @@ KiInitSystem(VOID)
|
|||
ULONG i;
|
||||
|
||||
/* Initialize Bugcheck Callback data */
|
||||
InitializeListHead(&BugcheckCallbackListHead);
|
||||
InitializeListHead(&BugcheckReasonCallbackListHead);
|
||||
InitializeListHead(&KeBugcheckCallbackListHead);
|
||||
InitializeListHead(&KeBugcheckReasonCallbackListHead);
|
||||
KeInitializeSpinLock(&BugCheckCallbackLock);
|
||||
|
||||
/* Initialize the Timer Expiration DPC */
|
||||
|
|
|
@ -165,6 +165,40 @@ KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
|
|||
KxReleaseSpinLock(SpinLock);
|
||||
}
|
||||
|
||||
/*
|
||||
* @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
|
||||
*/
|
||||
|
|
|
@ -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 @@ MmCreatePeb(PEPROCESS Process)
|
|||
/* 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;
|
||||
|
|
|
@ -143,7 +143,7 @@ RiPrintLastOwner ( PR_USED Block )
|
|||
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] );
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
LIST_ENTRY PsLoadedModuleList;
|
||||
KSPIN_LOCK PsLoadedModuleSpinLock;
|
||||
PVOID PsNtosImageBase;
|
||||
ULONG PsNtosImageBase;
|
||||
KMUTANT MmSystemLoadLock;
|
||||
extern ULONG NtGlobalFlag;
|
||||
|
||||
|
@ -1218,7 +1218,7 @@ MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
LdrEntry = CONTAINING_RECORD(NextEntry,
|
||||
LDR_DATA_TABLE_ENTRY,
|
||||
InLoadOrderLinks);
|
||||
PsNtosImageBase = LdrEntry->DllBase;
|
||||
PsNtosImageBase = (ULONG)LdrEntry->DllBase;
|
||||
|
||||
/* Loop the loader block */
|
||||
while (NextEntry != ListHead)
|
||||
|
|
|
@ -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@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"
|
||||
|
|
|
@ -198,7 +198,7 @@ ObInit(VOID)
|
|||
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 @@ ObPostPhase0:
|
|||
0,
|
||||
ObDirectoryType,
|
||||
KernelMode,
|
||||
(PVOID*)&NameSpaceRoot,
|
||||
(PVOID*)&ObpRootDirectoryObject,
|
||||
NULL);
|
||||
if (!NT_SUCCESS(Status)) return FALSE;
|
||||
|
||||
|
@ -289,7 +289,7 @@ ObPostPhase0:
|
|||
ObpAcquireDirectoryLockExclusive(ObpTypeDirectoryObject, &Context);
|
||||
|
||||
/* Loop the object types */
|
||||
ListHead = &ObTypeObjectType->TypeList;
|
||||
ListHead = &ObpTypeObjectType->TypeList;
|
||||
NextEntry = ListHead->Flink;
|
||||
while (ListHead != NextEntry)
|
||||
{
|
||||
|
|
|
@ -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 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
|
|||
/* Allocate the Object */
|
||||
Status = ObpAllocateObject(NULL,
|
||||
&ObjectName,
|
||||
ObTypeObjectType,
|
||||
ObpTypeObjectType,
|
||||
sizeof(OBJECT_TYPE),
|
||||
KernelMode,
|
||||
(POBJECT_HEADER*)&Header);
|
||||
|
@ -1098,11 +1098,11 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
|
|||
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 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
|
|||
|
||||
/* 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 */
|
||||
|
|
|
@ -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 @@ ObpLookupObjectName(IN HANDLE RootHandle OPTIONAL,
|
|||
{
|
||||
/* 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 @@ ObpLookupObjectName(IN HANDLE RootHandle OPTIONAL,
|
|||
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 @@ ReparseObject:
|
|||
|
||||
/* Start at Root */
|
||||
ParentDirectory = NULL;
|
||||
RootDirectory = NameSpaceRoot;
|
||||
RootDirectory = ObpRootDirectoryObject;
|
||||
|
||||
/* Check for reparse status */
|
||||
if (Status == STATUS_REPARSE_OBJECT)
|
||||
|
@ -838,7 +838,7 @@ ReparseObject:
|
|||
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 @@ ObQueryNameString(IN PVOID Object,
|
|||
* 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 @@ ObQueryNameString(IN PVOID Object,
|
|||
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 @@ ObQueryNameString(IN PVOID Object,
|
|||
*--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 @@ ObQueryNameString(IN PVOID Object,
|
|||
|
||||
/* 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(
|
||||
|
|
|
@ -58,12 +58,12 @@ RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
|
|||
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 @@ RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue