mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +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;
|
||||
|
||||
typedef NTSTATUS
|
||||
(DDKAPI *PEX_CALLBACK_FUNCTION)(
|
||||
IN PVOID CallbackContext,
|
||||
IN REG_NOTIFY_CLASS Argument1,
|
||||
IN PVOID Argument2);
|
||||
(NTAPI *PEX_CALLBACK_FUNCTION)(
|
||||
IN PVOID CallbackContext,
|
||||
IN PVOID Argument1,
|
||||
IN PVOID Argument2
|
||||
);
|
||||
|
||||
typedef struct _REG_DELETE_KEY_INFORMATION
|
||||
{
|
||||
|
@ -10451,13 +10452,13 @@ WmiTraceMessageVa(
|
|||
/** Kernel debugger routines **/
|
||||
|
||||
NTOSAPI
|
||||
VOID
|
||||
NTSTATUS
|
||||
DDKAPI
|
||||
KdDisableDebugger(
|
||||
VOID);
|
||||
|
||||
NTOSAPI
|
||||
VOID
|
||||
NTSTATUS
|
||||
DDKAPI
|
||||
KdEnableDebugger(
|
||||
VOID);
|
||||
|
|
|
@ -115,23 +115,6 @@ Author:
|
|||
#define SYNCH_LEVEL (IPI_LEVEL - 1)
|
||||
#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
|
||||
//
|
||||
|
@ -282,6 +265,23 @@ typedef struct _DESCRIPTOR
|
|||
|
||||
#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
|
||||
//
|
||||
|
|
|
@ -36,6 +36,7 @@ static const signed char NTDLL_mostSignificant[16] = {
|
|||
|
||||
static
|
||||
int
|
||||
__cdecl
|
||||
NTDLL_RunSortFn(const void *lhs,
|
||||
const void *rhs)
|
||||
{
|
||||
|
|
|
@ -383,7 +383,7 @@ stringw(wchar_t* buf, wchar_t* end, const wchar_t* sw, int len, int field_width,
|
|||
/*
|
||||
* @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;
|
||||
unsigned long long num;
|
||||
|
@ -726,7 +726,7 @@ int swprintf(wchar_t *buf, const wchar_t *fmt, ...)
|
|||
/*
|
||||
* @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;
|
||||
int i;
|
||||
|
@ -741,7 +741,7 @@ int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...)
|
|||
/*
|
||||
* @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);
|
||||
}
|
||||
|
|
|
@ -116,12 +116,6 @@ extern ERESOURCE CmiRegistryLock;
|
|||
|
||||
|
||||
/* Registry Callback Function */
|
||||
typedef NTSTATUS (STDCALL *PEX_CALLBACK_FUNCTION ) (
|
||||
IN PVOID CallbackContext,
|
||||
IN REG_NOTIFY_CLASS Argument1,
|
||||
IN PVOID Argument2
|
||||
);
|
||||
|
||||
typedef struct _REGISTRY_CALLBACK
|
||||
{
|
||||
LIST_ENTRY ListEntry;
|
||||
|
|
|
@ -257,7 +257,7 @@ CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1,
|
|||
ExReleaseFastMutex(&CmiCallbackLock);
|
||||
|
||||
Status = CurrentCallback->Function(CurrentCallback->Context,
|
||||
Argument1,
|
||||
(PVOID)Argument1,
|
||||
Argument2);
|
||||
|
||||
ExAcquireFastMutex(&CmiCallbackLock);
|
||||
|
|
|
@ -1027,6 +1027,8 @@ extern ULONG IopTraceLevel;
|
|||
extern NPAGED_LOOKASIDE_LIST IopMdlLookasideList;
|
||||
extern GENERIC_MAPPING IopCompletionMapping;
|
||||
extern GENERIC_MAPPING IopFileMapping;
|
||||
extern POBJECT_TYPE _IoFileObjectType;
|
||||
extern HAL_DISPATCH _HalDispatchTable;
|
||||
|
||||
//
|
||||
// Inlined Functions
|
||||
|
|
|
@ -13,6 +13,8 @@ typedef struct _KD_PORT_INFORMATION
|
|||
|
||||
struct _KD_DISPATCH_TABLE;
|
||||
extern KD_PORT_INFORMATION GdbPortInfo;
|
||||
extern BOOLEAN _KdDebuggerEnabled;
|
||||
extern BOOLEAN _KdDebuggerNotPresent;
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
|
|
|
@ -366,6 +366,7 @@ extern PVOID PspSystemDllBase;
|
|||
extern BOOLEAN PspUseJobSchedulingClasses;
|
||||
extern CHAR PspJobSchedulingClasses[PSP_JOB_SCHEDULING_CLASSES];
|
||||
extern ULONG PsRawPrioritySeparation;
|
||||
extern POBJECT_TYPE _PsThreadType;
|
||||
|
||||
//
|
||||
// Inlined Functions
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
/* We are the Kernel */
|
||||
#define _NTSYSTEM_
|
||||
/* Tells the WDK that we don't want to import */
|
||||
#define NTKERNELAPI
|
||||
|
||||
/* DDK/IFS/NDK Headers */
|
||||
#include <ntifs.h>
|
||||
|
@ -53,3 +53,25 @@
|
|||
/* Internal Headers */
|
||||
#include "internal/ntoskrnl.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
|
||||
*/
|
||||
VOID
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
KdDisableDebugger(VOID)
|
||||
{
|
||||
|
@ -152,12 +152,15 @@ KdDisableDebugger(VOID)
|
|||
|
||||
/* Lower the IRQL */
|
||||
KeLowerIrql(OldIrql);
|
||||
|
||||
/* Return success */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VOID
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
KdEnableDebugger(VOID)
|
||||
{
|
||||
|
@ -173,6 +176,9 @@ KdEnableDebugger(VOID)
|
|||
|
||||
/* Lower the IRQL */
|
||||
KeLowerIrql(OldIrql);
|
||||
|
||||
/* Return success */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -229,7 +229,7 @@ FsRtlIsNameInExpression@16
|
|||
FsRtlIsNtstatusExpected@4
|
||||
FsRtlIsPagingFile@4
|
||||
FsRtlIsTotalDeviceFailure@4
|
||||
FsRtlLegalAnsiCharacterArray DATA
|
||||
FsRtlLegalAnsiCharacterArray=_FsRtlLegalAnsiCharacterArray
|
||||
FsRtlLookupLargeMcbEntry@32
|
||||
FsRtlLookupLastLargeMcbEntry@12
|
||||
FsRtlLookupLastLargeMcbEntryAndIndex@16
|
||||
|
@ -280,7 +280,7 @@ FsRtlUninitializeFileLock@4
|
|||
FsRtlUninitializeLargeMcb@4
|
||||
FsRtlUninitializeMcb@4
|
||||
FsRtlUninitializeOplock@4
|
||||
HalDispatchTable DATA
|
||||
HalDispatchTable=_HalDispatchTable
|
||||
HalPrivateDispatchTable DATA
|
||||
@HalExamineMBR@16
|
||||
InbvAcquireDisplayOwnership@0
|
||||
|
@ -368,7 +368,7 @@ IoDriverObjectType DATA
|
|||
IoEnqueueIrp@4
|
||||
IoEnumerateDeviceObjectList@16
|
||||
IoFastQueryNetworkAttributes@20
|
||||
IoFileObjectType DATA
|
||||
IoFileObjectType=_IoFileObjectType
|
||||
IoForwardAndCatchIrp@8=IoForwardIrpSynchronously@8
|
||||
IoForwardIrpSynchronously@8
|
||||
IoFreeController@4
|
||||
|
@ -504,8 +504,8 @@ IoWriteTransferCount DATA
|
|||
@IofCompleteRequest@8
|
||||
IoIsWdmVersionAvailable@8
|
||||
KdComPortInUse DATA
|
||||
KdDebuggerEnabled DATA
|
||||
KdDebuggerNotPresent DATA
|
||||
KdDebuggerEnabled=_KdDebuggerEnabled
|
||||
KdDebuggerNotPresent=_KdDebuggerNotPresent
|
||||
KdDisableDebugger@0
|
||||
KdEnableDebugger@0
|
||||
KdEnteredDebugger
|
||||
|
@ -964,7 +964,7 @@ PsSetThreadHardErrorsAreDisabled@8
|
|||
PsSetThreadWin32Thread@8
|
||||
PsSetLoadImageNotifyRoutine@4
|
||||
PsTerminateSystemThread@4
|
||||
PsThreadType DATA
|
||||
PsThreadType=_PsThreadType
|
||||
READ_REGISTER_UCHAR@4
|
||||
READ_REGISTER_ULONG@4
|
||||
READ_REGISTER_USHORT@4
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<define name="_DISABLE_TIDENTS" />
|
||||
<define name="__NTOSKRNL__" />
|
||||
<define name="_NTOSKRNL_" />
|
||||
<define name="_NTSYSTEM_" />
|
||||
<define name="__NO_CTYPE_INLINES" />
|
||||
<define name="__USE_W32API" />
|
||||
<define name="WIN9X_COMPAT_SPINLOCK" />
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
/* INCLUDES ****************************************************************/
|
||||
|
||||
#include <ntoskrnl.h>
|
||||
#include <winerror.h>
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue