mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
- 1>Build Time 0:04
1>ReactOS Kernel - 0 error(s), 253 warning(s) - Add winerror.h to ps/win32.c so it can get the Win32 error definition it needs (winerror.h doesn't add any other nasty win32 headers, so this isn't really a header policy violation). - Fix prototypes of KdEnableDebugger and KdDisableDebugger. - Write one of the cleanest and most ingenious hacks I've ever come up with it, which bypasses the incompatibility of hard-coded WDK externals. svn path=/trunk/; revision=23973
This commit is contained in:
parent
254f6b62ac
commit
e6fd23de2c
14 changed files with 74 additions and 43 deletions
|
@ -4876,10 +4876,11 @@ typedef enum _REG_NOTIFY_CLASS
|
||||||
} REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS;
|
} REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS;
|
||||||
|
|
||||||
typedef NTSTATUS
|
typedef NTSTATUS
|
||||||
(DDKAPI *PEX_CALLBACK_FUNCTION)(
|
(NTAPI *PEX_CALLBACK_FUNCTION)(
|
||||||
IN PVOID CallbackContext,
|
IN PVOID CallbackContext,
|
||||||
IN REG_NOTIFY_CLASS Argument1,
|
IN PVOID Argument1,
|
||||||
IN PVOID Argument2);
|
IN PVOID Argument2
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct _REG_DELETE_KEY_INFORMATION
|
typedef struct _REG_DELETE_KEY_INFORMATION
|
||||||
{
|
{
|
||||||
|
@ -10451,13 +10452,13 @@ WmiTraceMessageVa(
|
||||||
/** Kernel debugger routines **/
|
/** Kernel debugger routines **/
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
VOID
|
NTSTATUS
|
||||||
DDKAPI
|
DDKAPI
|
||||||
KdDisableDebugger(
|
KdDisableDebugger(
|
||||||
VOID);
|
VOID);
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
VOID
|
NTSTATUS
|
||||||
DDKAPI
|
DDKAPI
|
||||||
KdEnableDebugger(
|
KdEnableDebugger(
|
||||||
VOID);
|
VOID);
|
||||||
|
|
|
@ -115,23 +115,6 @@ Author:
|
||||||
#define SYNCH_LEVEL (IPI_LEVEL - 1)
|
#define SYNCH_LEVEL (IPI_LEVEL - 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
|
||||||
// Macro to get current KPRCB
|
|
||||||
//
|
|
||||||
#ifndef __GNUC__ // fixme
|
|
||||||
FORCEINLINE
|
|
||||||
struct _KPRCB *
|
|
||||||
KeGetCurrentPrcb(VOID)
|
|
||||||
{
|
|
||||||
return (struct _KPRCB *)(ULONG_PTR)__readfsdword(FIELD_OFFSET(KPCR, Prcb));
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Macro to get current previous mode
|
|
||||||
//
|
|
||||||
#define KeGetPreviousMode ExGetPreviousMode
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Trap Frame Definition
|
// Trap Frame Definition
|
||||||
//
|
//
|
||||||
|
@ -282,6 +265,23 @@ typedef struct _DESCRIPTOR
|
||||||
|
|
||||||
#ifndef NTOS_MODE_USER
|
#ifndef NTOS_MODE_USER
|
||||||
|
|
||||||
|
//
|
||||||
|
// Macro to get current KPRCB
|
||||||
|
//
|
||||||
|
#ifndef __GNUC__ // fixme
|
||||||
|
FORCEINLINE
|
||||||
|
struct _KPRCB *
|
||||||
|
KeGetCurrentPrcb(VOID)
|
||||||
|
{
|
||||||
|
return (struct _KPRCB *)(ULONG_PTR)__readfsdword(FIELD_OFFSET(KPCR, Prcb));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Macro to get current previous mode
|
||||||
|
//
|
||||||
|
#define KeGetPreviousMode ExGetPreviousMode
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// FN/FX (FPU) Save Area Structures
|
// FN/FX (FPU) Save Area Structures
|
||||||
//
|
//
|
||||||
|
|
|
@ -36,6 +36,7 @@ static const signed char NTDLL_mostSignificant[16] = {
|
||||||
|
|
||||||
static
|
static
|
||||||
int
|
int
|
||||||
|
__cdecl
|
||||||
NTDLL_RunSortFn(const void *lhs,
|
NTDLL_RunSortFn(const void *lhs,
|
||||||
const void *rhs)
|
const void *rhs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -383,7 +383,7 @@ stringw(wchar_t* buf, wchar_t* end, const wchar_t* sw, int len, int field_width,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
|
int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
unsigned long long num;
|
unsigned long long num;
|
||||||
|
@ -726,7 +726,7 @@ int swprintf(wchar_t *buf, const wchar_t *fmt, ...)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...)
|
int __cdecl _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
int i;
|
int i;
|
||||||
|
@ -741,7 +741,7 @@ int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
int vswprintf(wchar_t *buf, const wchar_t *fmt, va_list args)
|
int __cdecl vswprintf(wchar_t *buf, const wchar_t *fmt, va_list args)
|
||||||
{
|
{
|
||||||
return _vsnwprintf(buf,MAXLONG,fmt,args);
|
return _vsnwprintf(buf,MAXLONG,fmt,args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,12 +116,6 @@ extern ERESOURCE CmiRegistryLock;
|
||||||
|
|
||||||
|
|
||||||
/* Registry Callback Function */
|
/* Registry Callback Function */
|
||||||
typedef NTSTATUS (STDCALL *PEX_CALLBACK_FUNCTION ) (
|
|
||||||
IN PVOID CallbackContext,
|
|
||||||
IN REG_NOTIFY_CLASS Argument1,
|
|
||||||
IN PVOID Argument2
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef struct _REGISTRY_CALLBACK
|
typedef struct _REGISTRY_CALLBACK
|
||||||
{
|
{
|
||||||
LIST_ENTRY ListEntry;
|
LIST_ENTRY ListEntry;
|
||||||
|
|
|
@ -257,7 +257,7 @@ CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1,
|
||||||
ExReleaseFastMutex(&CmiCallbackLock);
|
ExReleaseFastMutex(&CmiCallbackLock);
|
||||||
|
|
||||||
Status = CurrentCallback->Function(CurrentCallback->Context,
|
Status = CurrentCallback->Function(CurrentCallback->Context,
|
||||||
Argument1,
|
(PVOID)Argument1,
|
||||||
Argument2);
|
Argument2);
|
||||||
|
|
||||||
ExAcquireFastMutex(&CmiCallbackLock);
|
ExAcquireFastMutex(&CmiCallbackLock);
|
||||||
|
|
|
@ -1027,6 +1027,8 @@ extern ULONG IopTraceLevel;
|
||||||
extern NPAGED_LOOKASIDE_LIST IopMdlLookasideList;
|
extern NPAGED_LOOKASIDE_LIST IopMdlLookasideList;
|
||||||
extern GENERIC_MAPPING IopCompletionMapping;
|
extern GENERIC_MAPPING IopCompletionMapping;
|
||||||
extern GENERIC_MAPPING IopFileMapping;
|
extern GENERIC_MAPPING IopFileMapping;
|
||||||
|
extern POBJECT_TYPE _IoFileObjectType;
|
||||||
|
extern HAL_DISPATCH _HalDispatchTable;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Inlined Functions
|
// Inlined Functions
|
||||||
|
|
|
@ -13,6 +13,8 @@ typedef struct _KD_PORT_INFORMATION
|
||||||
|
|
||||||
struct _KD_DISPATCH_TABLE;
|
struct _KD_DISPATCH_TABLE;
|
||||||
extern KD_PORT_INFORMATION GdbPortInfo;
|
extern KD_PORT_INFORMATION GdbPortInfo;
|
||||||
|
extern BOOLEAN _KdDebuggerEnabled;
|
||||||
|
extern BOOLEAN _KdDebuggerNotPresent;
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
|
@ -366,6 +366,7 @@ extern PVOID PspSystemDllBase;
|
||||||
extern BOOLEAN PspUseJobSchedulingClasses;
|
extern BOOLEAN PspUseJobSchedulingClasses;
|
||||||
extern CHAR PspJobSchedulingClasses[PSP_JOB_SCHEDULING_CLASSES];
|
extern CHAR PspJobSchedulingClasses[PSP_JOB_SCHEDULING_CLASSES];
|
||||||
extern ULONG PsRawPrioritySeparation;
|
extern ULONG PsRawPrioritySeparation;
|
||||||
|
extern POBJECT_TYPE _PsThreadType;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Inlined Functions
|
// Inlined Functions
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
/* We are the Kernel */
|
/* Tells the WDK that we don't want to import */
|
||||||
#define _NTSYSTEM_
|
#define NTKERNELAPI
|
||||||
|
|
||||||
/* DDK/IFS/NDK Headers */
|
/* DDK/IFS/NDK Headers */
|
||||||
#include <ntifs.h>
|
#include <ntifs.h>
|
||||||
|
@ -53,3 +53,25 @@
|
||||||
/* Internal Headers */
|
/* Internal Headers */
|
||||||
#include "internal/ntoskrnl.h"
|
#include "internal/ntoskrnl.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// Define the internal versions of external and public global data
|
||||||
|
//
|
||||||
|
#define IoFileObjectType _IoFileObjectType
|
||||||
|
#define PsThreadType _PsThreadType
|
||||||
|
#define KdDebuggerEnabled _KdDebuggerEnabled
|
||||||
|
#define KdDebuggerNotPresent _KdDebuggerNotPresent
|
||||||
|
#define FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray
|
||||||
|
#undef LEGAL_ANSI_CHARACTER_ARRAY
|
||||||
|
#undef NLS_MB_CODE_PAGE_TAG
|
||||||
|
#undef NLS_OEM_LEAD_BYTE_INFO
|
||||||
|
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
|
||||||
|
#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag
|
||||||
|
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
|
||||||
|
#undef KD_DEBUGGER_ENABLED
|
||||||
|
#undef KD_DEBUGGER_NOT_PRESENT
|
||||||
|
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
|
||||||
|
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
|
||||||
|
#define HalDispatchTable _HalDispatchTable
|
||||||
|
#undef HALDISPATCH
|
||||||
|
#define HALDISPATCH (&HalDispatchTable)
|
||||||
|
|
|
@ -136,7 +136,7 @@ KdpEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
KdDisableDebugger(VOID)
|
KdDisableDebugger(VOID)
|
||||||
{
|
{
|
||||||
|
@ -152,12 +152,15 @@ KdDisableDebugger(VOID)
|
||||||
|
|
||||||
/* Lower the IRQL */
|
/* Lower the IRQL */
|
||||||
KeLowerIrql(OldIrql);
|
KeLowerIrql(OldIrql);
|
||||||
|
|
||||||
|
/* Return success */
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
KdEnableDebugger(VOID)
|
KdEnableDebugger(VOID)
|
||||||
{
|
{
|
||||||
|
@ -173,6 +176,9 @@ KdEnableDebugger(VOID)
|
||||||
|
|
||||||
/* Lower the IRQL */
|
/* Lower the IRQL */
|
||||||
KeLowerIrql(OldIrql);
|
KeLowerIrql(OldIrql);
|
||||||
|
|
||||||
|
/* Return success */
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -229,7 +229,7 @@ FsRtlIsNameInExpression@16
|
||||||
FsRtlIsNtstatusExpected@4
|
FsRtlIsNtstatusExpected@4
|
||||||
FsRtlIsPagingFile@4
|
FsRtlIsPagingFile@4
|
||||||
FsRtlIsTotalDeviceFailure@4
|
FsRtlIsTotalDeviceFailure@4
|
||||||
FsRtlLegalAnsiCharacterArray DATA
|
FsRtlLegalAnsiCharacterArray=_FsRtlLegalAnsiCharacterArray
|
||||||
FsRtlLookupLargeMcbEntry@32
|
FsRtlLookupLargeMcbEntry@32
|
||||||
FsRtlLookupLastLargeMcbEntry@12
|
FsRtlLookupLastLargeMcbEntry@12
|
||||||
FsRtlLookupLastLargeMcbEntryAndIndex@16
|
FsRtlLookupLastLargeMcbEntryAndIndex@16
|
||||||
|
@ -280,7 +280,7 @@ FsRtlUninitializeFileLock@4
|
||||||
FsRtlUninitializeLargeMcb@4
|
FsRtlUninitializeLargeMcb@4
|
||||||
FsRtlUninitializeMcb@4
|
FsRtlUninitializeMcb@4
|
||||||
FsRtlUninitializeOplock@4
|
FsRtlUninitializeOplock@4
|
||||||
HalDispatchTable DATA
|
HalDispatchTable=_HalDispatchTable
|
||||||
HalPrivateDispatchTable DATA
|
HalPrivateDispatchTable DATA
|
||||||
@HalExamineMBR@16
|
@HalExamineMBR@16
|
||||||
InbvAcquireDisplayOwnership@0
|
InbvAcquireDisplayOwnership@0
|
||||||
|
@ -368,7 +368,7 @@ IoDriverObjectType DATA
|
||||||
IoEnqueueIrp@4
|
IoEnqueueIrp@4
|
||||||
IoEnumerateDeviceObjectList@16
|
IoEnumerateDeviceObjectList@16
|
||||||
IoFastQueryNetworkAttributes@20
|
IoFastQueryNetworkAttributes@20
|
||||||
IoFileObjectType DATA
|
IoFileObjectType=_IoFileObjectType
|
||||||
IoForwardAndCatchIrp@8=IoForwardIrpSynchronously@8
|
IoForwardAndCatchIrp@8=IoForwardIrpSynchronously@8
|
||||||
IoForwardIrpSynchronously@8
|
IoForwardIrpSynchronously@8
|
||||||
IoFreeController@4
|
IoFreeController@4
|
||||||
|
@ -504,8 +504,8 @@ IoWriteTransferCount DATA
|
||||||
@IofCompleteRequest@8
|
@IofCompleteRequest@8
|
||||||
IoIsWdmVersionAvailable@8
|
IoIsWdmVersionAvailable@8
|
||||||
KdComPortInUse DATA
|
KdComPortInUse DATA
|
||||||
KdDebuggerEnabled DATA
|
KdDebuggerEnabled=_KdDebuggerEnabled
|
||||||
KdDebuggerNotPresent DATA
|
KdDebuggerNotPresent=_KdDebuggerNotPresent
|
||||||
KdDisableDebugger@0
|
KdDisableDebugger@0
|
||||||
KdEnableDebugger@0
|
KdEnableDebugger@0
|
||||||
KdEnteredDebugger
|
KdEnteredDebugger
|
||||||
|
@ -964,7 +964,7 @@ PsSetThreadHardErrorsAreDisabled@8
|
||||||
PsSetThreadWin32Thread@8
|
PsSetThreadWin32Thread@8
|
||||||
PsSetLoadImageNotifyRoutine@4
|
PsSetLoadImageNotifyRoutine@4
|
||||||
PsTerminateSystemThread@4
|
PsTerminateSystemThread@4
|
||||||
PsThreadType DATA
|
PsThreadType=_PsThreadType
|
||||||
READ_REGISTER_UCHAR@4
|
READ_REGISTER_UCHAR@4
|
||||||
READ_REGISTER_ULONG@4
|
READ_REGISTER_ULONG@4
|
||||||
READ_REGISTER_USHORT@4
|
READ_REGISTER_USHORT@4
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<define name="_DISABLE_TIDENTS" />
|
<define name="_DISABLE_TIDENTS" />
|
||||||
<define name="__NTOSKRNL__" />
|
<define name="__NTOSKRNL__" />
|
||||||
<define name="_NTOSKRNL_" />
|
<define name="_NTOSKRNL_" />
|
||||||
|
<define name="_NTSYSTEM_" />
|
||||||
<define name="__NO_CTYPE_INLINES" />
|
<define name="__NO_CTYPE_INLINES" />
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="WIN9X_COMPAT_SPINLOCK" />
|
<define name="WIN9X_COMPAT_SPINLOCK" />
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
/* INCLUDES ****************************************************************/
|
/* INCLUDES ****************************************************************/
|
||||||
|
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
|
#include <winerror.h>
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue