ntoskrnl header cleanups

svn path=/trunk/; revision=17847
This commit is contained in:
Alex Ionescu 2005-09-14 01:44:19 +00:00
parent e8dcb74344
commit e0eea608a6
26 changed files with 757 additions and 461 deletions

View file

@ -20,6 +20,12 @@
#define I386_INTERRUPT_GATE 0xE
#define I386_TRAP_GATE 0xF
#define IPI_APC 1
#define IPI_DPC 2
#define IPI_FREEZE 3
#define IPI_PACKET_READY 4
#define IPI_SYNCH_REQUEST 10
/* EXPORTED DATA *************************************************************/
/* ENUMERATIONS **************************************************************/

View file

@ -16,6 +16,7 @@
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
CcInit(VOID)
{
CcInitView();

View file

@ -39,6 +39,7 @@ ULONG CcFastReadResourceMiss;
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
CcInitCacheZeroPage(VOID)
{
NTSTATUS Status;
@ -58,6 +59,7 @@ CcInitCacheZeroPage(VOID)
}
NTSTATUS
NTAPI
ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
PVOID Buffer)
{
@ -187,6 +189,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
}
NTSTATUS
NTAPI
ReadCacheSegment(PCACHE_SEGMENT CacheSeg)
{
ULONG Size;
@ -228,6 +231,7 @@ ReadCacheSegment(PCACHE_SEGMENT CacheSeg)
}
NTSTATUS
NTAPI
WriteCacheSegment(PCACHE_SEGMENT CacheSeg)
{
ULONG Size;

View file

@ -159,6 +159,7 @@ CcRosTraceCacheMap (
}
NTSTATUS
NTAPI
CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSegment)
{
NTSTATUS Status;
@ -179,6 +180,7 @@ CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSegment)
}
NTSTATUS
NTAPI
CcRosFlushDirtyPages(ULONG Target, PULONG Count)
{
PLIST_ENTRY current_entry;
@ -355,6 +357,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
}
NTSTATUS
NTAPI
CcRosReleaseCacheSegment(PBCB Bcb,
PCACHE_SEGMENT CacheSeg,
BOOLEAN Valid,
@ -403,6 +406,7 @@ CcRosReleaseCacheSegment(PBCB Bcb,
}
PCACHE_SEGMENT
NTAPI
CcRosLookupCacheSegment(PBCB Bcb, ULONG FileOffset)
{
PLIST_ENTRY current_entry;
@ -434,6 +438,7 @@ CcRosLookupCacheSegment(PBCB Bcb, ULONG FileOffset)
}
NTSTATUS
NTAPI
CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset)
{
PCACHE_SEGMENT CacheSeg;
@ -470,6 +475,7 @@ CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset)
}
NTSTATUS
NTAPI
CcRosUnmapCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty)
{
PCACHE_SEGMENT CacheSeg;
@ -689,6 +695,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
}
NTSTATUS
NTAPI
CcRosGetCacheSegmentChain(PBCB Bcb,
ULONG FileOffset,
ULONG Length,
@ -752,6 +759,7 @@ CcRosGetCacheSegmentChain(PBCB Bcb,
}
NTSTATUS
NTAPI
CcRosGetCacheSegment(PBCB Bcb,
ULONG FileOffset,
PULONG BaseOffset,
@ -889,6 +897,7 @@ CcRosInternalFreeCacheSegment(PCACHE_SEGMENT CacheSeg)
}
NTSTATUS
NTAPI
CcRosFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg)
{
NTSTATUS Status;
@ -995,6 +1004,7 @@ CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointers,
}
NTSTATUS
NTAPI
CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
/*
* FUNCTION: Releases the BCB associated with a file object
@ -1065,7 +1075,9 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
return(STATUS_SUCCESS);
}
VOID CcRosReferenceCache(PFILE_OBJECT FileObject)
VOID
NTAPI
CcRosReferenceCache(PFILE_OBJECT FileObject)
{
PBCB Bcb;
ExAcquireFastMutex(&ViewLock);
@ -1086,7 +1098,9 @@ VOID CcRosReferenceCache(PFILE_OBJECT FileObject)
ExReleaseFastMutex(&ViewLock);
}
VOID CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer)
VOID
NTAPI
CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer)
{
PBCB Bcb;
DPRINT("CcRosSetRemoveOnClose()\n");
@ -1104,7 +1118,9 @@ VOID CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer)
}
VOID CcRosDereferenceCache(PFILE_OBJECT FileObject)
VOID
NTAPI
CcRosDereferenceCache(PFILE_OBJECT FileObject)
{
PBCB Bcb;
ExAcquireFastMutex(&ViewLock);
@ -1171,6 +1187,7 @@ CcRosReleaseFileCache(PFILE_OBJECT FileObject)
}
NTSTATUS
NTAPI
CcTryToInitializeFileCache(PFILE_OBJECT FileObject)
{
PBCB Bcb;
@ -1328,7 +1345,9 @@ CmLazyCloseThreadMain(PVOID Ignored)
}
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
CcInitView(VOID)
{
#ifdef CACHE_BITMAP

View file

@ -77,36 +77,45 @@ CcMdlWriteCompleteDev(
);
NTSTATUS
NTAPI
CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSegment);
NTSTATUS
NTAPI
CcRosGetCacheSegment(
PBCB Bcb,
ULONG FileOffset,
PULONG BaseOffset,
PVOID* BaseAddress,
PVOID *BaseAddress,
PBOOLEAN UptoDate,
PCACHE_SEGMENT* CacheSeg
PCACHE_SEGMENT *CacheSeg
);
VOID
NTAPI
CcInitView(VOID);
NTSTATUS
NTAPI
CcRosFreeCacheSegment(
PBCB,
PCACHE_SEGMENT
);
NTSTATUS
NTAPI
ReadCacheSegment(PCACHE_SEGMENT CacheSeg);
NTSTATUS
NTAPI
WriteCacheSegment(PCACHE_SEGMENT CacheSeg);
VOID CcInit(VOID);
VOID
NTAPI
CcInit(VOID);
NTSTATUS
NTAPI
CcRosUnmapCacheSegment(
PBCB Bcb,
ULONG FileOffset,
@ -114,12 +123,14 @@ CcRosUnmapCacheSegment(
);
PCACHE_SEGMENT
NTAPI
CcRosLookupCacheSegment(
PBCB Bcb,
ULONG FileOffset
);
NTSTATUS
NTAPI
CcRosGetCacheSegmentChain(
PBCB Bcb,
ULONG FileOffset,
@ -128,49 +139,57 @@ CcRosGetCacheSegmentChain(
);
VOID
NTAPI
CcInitCacheZeroPage(VOID);
NTSTATUS
NTAPI
CcRosMarkDirtyCacheSegment(
PBCB Bcb,
ULONG FileOffset
);
NTSTATUS
NTAPI
CcRosFlushDirtyPages(
ULONG Target,
PULONG Count
);
VOID
NTAPI
CcRosDereferenceCache(PFILE_OBJECT FileObject);
VOID
NTAPI
CcRosReferenceCache(PFILE_OBJECT FileObject);
VOID
NTAPI
CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer);
NTSTATUS
NTAPI
CcRosReleaseCacheSegment(
BCB* Bcb,
CACHE_SEGMENT* CacheSeg,
BOOLEAN Valid,
BOOLEAN Dirty,
BOOLEAN Mapped
BCB* Bcb,
CACHE_SEGMENT *CacheSeg,
BOOLEAN Valid,
BOOLEAN Dirty,
BOOLEAN Mapped
);
NTSTATUS
STDCALL
CcRosRequestCacheSegment(
BCB* Bcb,
ULONG FileOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
CACHE_SEGMENT** CacheSeg
BCB *Bcb,
ULONG FileOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
CACHE_SEGMENT **CacheSeg
);
NTSTATUS
NTAPI
CcTryToInitializeFileCache(PFILE_OBJECT FileObject);
/*

View file

@ -1,89 +0,0 @@
#ifndef __INCLUDE_INTERNAL_IFS_H
#define __INCLUDE_INTERNAL_IFS_H
typedef struct _FILE_LOCK_GRANTED {
LIST_ENTRY ListEntry;
FILE_LOCK_INFO Lock;
PVOID UnlockContext;
} FILE_LOCK_GRANTED, *PFILE_LOCK_GRANTED;
typedef struct _FILE_LOCK_TOC {
KSPIN_LOCK SpinLock;
LIST_ENTRY GrantedListHead;
LIST_ENTRY PendingListHead;
} FILE_LOCK_TOC, *PFILE_LOCK_TOC;
VOID
STDCALL INIT_FUNCTION
FsRtlpInitNotifyImplementation(VOID);
VOID STDCALL
FsRtlpInitFileLockingImplementation(VOID);
VOID STDCALL
FsRtlpFileLockCancelRoutine(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
BOOLEAN FASTCALL
FsRtlpCheckLockForReadOrWriteAccess(
IN PFILE_LOCK FileLock,
IN PLARGE_INTEGER FileOffset,
IN PLARGE_INTEGER Length,
IN ULONG Key,
IN PFILE_OBJECT FileObject,
IN PEPROCESS Process,
IN BOOLEAN Read
);
NTSTATUS FASTCALL
FsRtlpFastUnlockAllByKey(
IN PFILE_LOCK FileLock,
IN PFILE_OBJECT FileObject,
IN PEPROCESS Process,
IN DWORD Key, /* FIXME: guess */
IN BOOLEAN UseKey, /* FIXME: guess */
IN PVOID Context OPTIONAL
);
BOOLEAN FASTCALL
FsRtlpAddLock(
IN PFILE_LOCK_TOC LockToc,
IN PFILE_OBJECT FileObject,
IN PLARGE_INTEGER FileOffset,
IN PLARGE_INTEGER Length,
IN PEPROCESS Process,
IN ULONG Key,
IN BOOLEAN ExclusiveLock,
IN PVOID UnlockContext
);
VOID FASTCALL
FsRtlpCompletePendingLocks(
IN PFILE_LOCK FileLock,
IN PFILE_LOCK_TOC LockToc,
IN OUT PKIRQL oldirql,
IN PVOID Context
);
NTSTATUS FASTCALL
FsRtlpUnlockSingle(
IN PFILE_LOCK FileLock,
IN PFILE_OBJECT FileObject,
IN PLARGE_INTEGER FileOffset,
IN PLARGE_INTEGER Length,
IN PEPROCESS Process,
IN ULONG Key,
IN PVOID Context OPTIONAL,
IN BOOLEAN CallUnlockRoutine
);
VOID FASTCALL
FsRtlpDumpFileLocks(
IN PFILE_LOCK FileLock
);
#endif

View file

@ -0,0 +1,96 @@
#ifndef __INCLUDE_INTERNAL_IFS_H
#define __INCLUDE_INTERNAL_IFS_H
typedef struct _FILE_LOCK_GRANTED
{
LIST_ENTRY ListEntry;
FILE_LOCK_INFO Lock;
PVOID UnlockContext;
} FILE_LOCK_GRANTED, *PFILE_LOCK_GRANTED;
typedef struct _FILE_LOCK_TOC
{
KSPIN_LOCK SpinLock;
LIST_ENTRY GrantedListHead;
LIST_ENTRY PendingListHead;
} FILE_LOCK_TOC, *PFILE_LOCK_TOC;
VOID
INIT_FUNCTION
STDCALL
FsRtlpInitNotifyImplementation(VOID);
VOID
STDCALL
FsRtlpInitFileLockingImplementation(VOID);
VOID
STDCALL
FsRtlpFileLockCancelRoutine(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
BOOLEAN
FASTCALL
FsRtlpCheckLockForReadOrWriteAccess(
IN PFILE_LOCK FileLock,
IN PLARGE_INTEGER FileOffset,
IN PLARGE_INTEGER Length,
IN ULONG Key,
IN PFILE_OBJECT FileObject,
IN PEPROCESS Process,
IN BOOLEAN Read
);
NTSTATUS
FASTCALL
FsRtlpFastUnlockAllByKey(
IN PFILE_LOCK FileLock,
IN PFILE_OBJECT FileObject,
IN PEPROCESS Process,
IN DWORD Key,
IN BOOLEAN UseKey,
IN PVOID Context OPTIONAL
);
BOOLEAN
FASTCALL
FsRtlpAddLock(
IN PFILE_LOCK_TOC LockToc,
IN PFILE_OBJECT FileObject,
IN PLARGE_INTEGER FileOffset,
IN PLARGE_INTEGER Length,
IN PEPROCESS Process,
IN ULONG Key,
IN BOOLEAN ExclusiveLock,
IN PVOID UnlockContext
);
VOID
FASTCALL
FsRtlpCompletePendingLocks(
IN PFILE_LOCK FileLock,
IN PFILE_LOCK_TOC LockToc,
IN OUT PKIRQL oldirql,
IN PVOID Context
);
NTSTATUS
FASTCALL
FsRtlpUnlockSingle(
IN PFILE_LOCK FileLock,
IN PFILE_OBJECT FileObject,
IN PLARGE_INTEGER FileOffset,
IN PLARGE_INTEGER Length,
IN PEPROCESS Process,
IN ULONG Key,
IN PVOID Context OPTIONAL,
IN BOOLEAN CallUnlockRoutine
);
VOID
FASTCALL
FsRtlpDumpFileLocks(IN PFILE_LOCK FileLock);
#endif

View file

@ -71,6 +71,61 @@ typedef struct _KIRQ_TRAPFRAME
ULONG Eflags;
} KIRQ_TRAPFRAME, *PKIRQ_TRAPFRAME;
/* Emulate cli/sti instructions */
#define KV86M_EMULATE_CLI_STI (0x1)
/* Allow the v86 mode code to access i/o ports */
#define KV86M_ALLOW_IO_PORT_ACCESS (0x2)
typedef struct _KV86M_REGISTERS
{
/*
* General purpose registers
*/
ULONG Ebp;
ULONG Edi;
ULONG Esi;
ULONG Edx;
ULONG Ecx;
ULONG Ebx;
ULONG Eax;
ULONG Ds;
ULONG Es;
ULONG Fs;
ULONG Gs;
/*
* Control registers
*/
ULONG Eip;
ULONG Cs;
ULONG Eflags;
ULONG Esp;
ULONG Ss;
/*
* Control structures
*/
ULONG RecoveryAddress;
UCHAR RecoveryInstruction[4];
ULONG Vif;
ULONG Flags;
PNTSTATUS PStatus;
} KV86M_REGISTERS, *PKV86M_REGISTERS;
typedef struct _KV86M_TRAP_FRAME
{
KTRAP_FRAME Tf;
ULONG SavedExceptionStack;
/*
* These are put on the top of the stack by the routine that entered
* v86 mode so the exception handlers can find the control information
*/
struct _KV86M_REGISTERS* regs;
ULONG orig_ebp;
} KV86M_TRAP_FRAME, *PKV86M_TRAP_FRAME;
extern ULONG Ke386CacheAlignment;
struct _KPCR;

View file

@ -1,6 +1,8 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_IO_H
#define __NTOSKRNL_INCLUDE_INTERNAL_IO_H
#include <ddk/ntdddisk.h>
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
extern POBJECT_TYPE IoCompletionType;
@ -478,4 +480,59 @@ IopInitIoCompletionImplementation(VOID);
: \
FIELD_OFFSET(CM_RESOURCE_LIST, List)
/* xhal.c */
NTSTATUS
FASTCALL
xHalQueryDriveLayout(
IN PUNICODE_STRING DeviceName,
OUT PDRIVE_LAYOUT_INFORMATION *LayoutInfo
);
#undef HalExamineMBR
VOID
FASTCALL
HalExamineMBR(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG MBRTypeIdentifier,
OUT PVOID *Buffer
);
VOID
FASTCALL
xHalIoAssignDriveLetters(
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString
);
NTSTATUS
FASTCALL
xHalIoReadPartitionTable(
PDEVICE_OBJECT DeviceObject,
ULONG SectorSize,
BOOLEAN ReturnRecognizedPartitions,
PDRIVE_LAYOUT_INFORMATION *PartitionBuffer
);
NTSTATUS
FASTCALL
xHalIoSetPartitionInformation(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG PartitionNumber,
IN ULONG PartitionType
);
NTSTATUS
FASTCALL
xHalIoWritePartitionTable(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG SectorsPerTrack,
IN ULONG NumberOfHeads,
IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer
);
#endif

View file

@ -12,7 +12,23 @@ typedef struct _WOW64_PROCESS
PVOID Wow64;
} WOW64_PROCESS, *PWOW64_PROCESS;
/* INTERNAL KERNEL FUNCTIONS ************************************************/
typedef struct _KPROFILE_SOURCE_OBJECT
{
KPROFILE_SOURCE Source;
LIST_ENTRY ListEntry;
} KPROFILE_SOURCE_OBJECT, *PKPROFILE_SOURCE_OBJECT;
/* Cached modules from the loader block */
typedef enum _CACHED_MODULE_TYPE
{
AnsiCodepage,
OemCodepage,
UnicodeCasemap,
SystemRegistry,
HardwareRegistry,
MaximumCachedModuleType,
} CACHED_MODULE_TYPE, *PCACHED_MODULE_TYPE;
extern PLOADER_MODULE CachedModules[MaximumCachedModuleType];
struct _KIRQ_TRAPFRAME;
struct _KPCR;
@ -23,11 +39,8 @@ extern PVOID KeUserApcDispatcher;
extern PVOID KeUserCallbackDispatcher;
extern PVOID KeUserExceptionDispatcher;
extern PVOID KeRaiseUserExceptionDispatcher;
#define IPI_REQUEST_FUNCTIONCALL 0
#define IPI_REQUEST_APC 1
#define IPI_REQUEST_DPC 2
#define IPI_REQUEST_FREEZE 3
extern LARGE_INTEGER SystemBootTime;
extern ULONG_PTR KERNEL_BASE;
/* MACROS *************************************************************************/
@ -49,6 +62,14 @@ extern PVOID KeRaiseUserExceptionDispatcher;
} \
}
#define KEBUGCHECKWITHTF(a,b,c,d,e,f) \
DbgPrint("KeBugCheckWithTf at %s:%i\n",__FILE__,__LINE__), KeBugCheckWithTf(a,b,c,d,e,f)
#define MAXIMUM_PROCESSORS 32
/* INTERNAL KERNEL FUNCTIONS ************************************************/
/* threadsch.c ********************************************************************/
/* Thread Scheduler Functions */
@ -66,17 +87,21 @@ KiDispatchThread(ULONG NewThreadStatus);
/* Puts a Thread into a block state. */
VOID
STDCALL
KiBlockThread(PNTSTATUS Status,
UCHAR Alertable,
ULONG WaitMode,
UCHAR WaitReason);
KiBlockThread(
PNTSTATUS Status,
UCHAR Alertable,
ULONG WaitMode,
UCHAR WaitReason
);
/* Removes a thread out of a block state. */
VOID
STDCALL
KiUnblockThread(PKTHREAD Thread,
PNTSTATUS WaitStatus,
KPRIORITY Increment);
KiUnblockThread(
PKTHREAD Thread,
PNTSTATUS WaitStatus,
KPRIORITY Increment
);
NTSTATUS
STDCALL
@ -108,62 +133,59 @@ KeSignalGateBoostPriority(PKGATE Gate);
VOID
FASTCALL
KeWaitForGate(PKGATE Gate,
KWAIT_REASON WaitReason,
KPROCESSOR_MODE WaitMode);
KeWaitForGate(
PKGATE Gate,
KWAIT_REASON WaitReason,
KPROCESSOR_MODE WaitMode
);
/* ipi.c ********************************************************************/
BOOLEAN STDCALL
KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame,
IN struct _KEXCEPTION_FRAME* ExceptionFrame);
BOOLEAN
STDCALL
KiIpiServiceRoutine(
IN PKTRAP_FRAME TrapFrame,
IN struct _KEXCEPTION_FRAME* ExceptionFrame
);
VOID
KiIpiSendRequest(KAFFINITY TargetSet,
ULONG IpiRequest);
NTAPI
KiIpiSendRequest(
KAFFINITY TargetSet,
ULONG IpiRequest
);
VOID
KeIpiGenericCall(VOID (STDCALL *WorkerRoutine)(PVOID),
PVOID Argument);
NTAPI
KeIpiGenericCall(
VOID (STDCALL *WorkerRoutine)(PVOID),
PVOID Argument
);
/* next file ***************************************************************/
typedef struct _KPROFILE_SOURCE_OBJECT
{
KPROFILE_SOURCE Source;
LIST_ENTRY ListEntry;
} KPROFILE_SOURCE_OBJECT, *PKPROFILE_SOURCE_OBJECT;
/* Cached modules from the loader block */
typedef enum _CACHED_MODULE_TYPE
{
AnsiCodepage,
OemCodepage,
UnicodeCasemap,
SystemRegistry,
HardwareRegistry,
MaximumCachedModuleType,
} CACHED_MODULE_TYPE, *PCACHED_MODULE_TYPE;
extern PLOADER_MODULE CachedModules[MaximumCachedModuleType];
VOID
STDCALL
DbgBreakPointNoBugCheck(VOID);
VOID
STDCALL
KeInitializeProfile(struct _KPROFILE* Profile,
struct _KPROCESS* Process,
PVOID ImageBase,
ULONG ImageSize,
ULONG BucketSize,
KPROFILE_SOURCE ProfileSource,
KAFFINITY Affinity);
KeInitializeProfile(
struct _KPROFILE* Profile,
struct _KPROCESS* Process,
PVOID ImageBase,
ULONG ImageSize,
ULONG BucketSize,
KPROFILE_SOURCE ProfileSource,
KAFFINITY Affinity
);
VOID
STDCALL
KeStartProfile(struct _KPROFILE* Profile,
PVOID Buffer);
KeStartProfile(
struct _KPROFILE* Profile,
PVOID Buffer
);
VOID
STDCALL
@ -175,8 +197,10 @@ KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource);
VOID
STDCALL
KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
ULONG Interval);
KeSetIntervalProfile(
KPROFILE_SOURCE ProfileSource,
ULONG Interval
);
VOID
STDCALL
@ -187,40 +211,77 @@ KeProfileInterrupt(
VOID
STDCALL
KeProfileInterruptWithSource(
IN PKTRAP_FRAME TrapFrame,
IN KPROFILE_SOURCE Source
IN PKTRAP_FRAME TrapFrame,
IN KPROFILE_SOURCE Source
);
BOOLEAN
STDCALL
KiRosPrintAddress(PVOID Address);
VOID STDCALL KeUpdateSystemTime(PKTRAP_FRAME TrapFrame, KIRQL Irql);
VOID STDCALL KeUpdateRunTime(PKTRAP_FRAME TrapFrame, KIRQL Irql);
VOID STDCALL KiExpireTimers(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2);
KIRQL inline FASTCALL KeAcquireDispatcherDatabaseLock(VOID);
VOID inline FASTCALL KeAcquireDispatcherDatabaseLockAtDpcLevel(VOID);
VOID inline FASTCALL KeReleaseDispatcherDatabaseLock(KIRQL Irql);
VOID inline FASTCALL KeReleaseDispatcherDatabaseLockFromDpcLevel(VOID);
VOID
STDCALL
KeUpdateSystemTime(
PKTRAP_FRAME TrapFrame,
KIRQL Irql
);
VOID
STDCALL
KeInitializeThread(struct _KPROCESS* Process,
PKTHREAD Thread,
PKSYSTEM_ROUTINE SystemRoutine,
PKSTART_ROUTINE StartRoutine,
PVOID StartContext,
PCONTEXT Context,
PVOID Teb,
PVOID KernelStack);
KeUpdateRunTime(
PKTRAP_FRAME TrapFrame,
KIRQL Irql
);
VOID
STDCALL
KiExpireTimers(
PKDPC Dpc,
PVOID DeferredContext,
PVOID SystemArgument1,
PVOID SystemArgument2
);
KIRQL
inline
FASTCALL
KeAcquireDispatcherDatabaseLock(VOID);
VOID
__inline
FASTCALL
KeAcquireDispatcherDatabaseLockAtDpcLevel(VOID);
VOID
__inline
FASTCALL
KeReleaseDispatcherDatabaseLock(KIRQL Irql);
VOID
__inline
FASTCALL
KeReleaseDispatcherDatabaseLockFromDpcLevel(VOID);
VOID
STDCALL
KeInitializeThread(
struct _KPROCESS* Process,
PKTHREAD Thread,
PKSYSTEM_ROUTINE SystemRoutine,
PKSTART_ROUTINE StartRoutine,
PVOID StartContext,
PCONTEXT Context,
PVOID Teb,
PVOID KernelStack
);
VOID
STDCALL
KeRundownThread(VOID);
NTSTATUS KeReleaseThread(PKTHREAD Thread);
NTSTATUS
NTAPI
KeReleaseThread(PKTHREAD Thread);
LONG
STDCALL
@ -228,45 +289,62 @@ KeQueryBasePriorityThread(IN PKTHREAD Thread);
VOID
STDCALL
KiSetPriorityThread(PKTHREAD Thread,
KPRIORITY Priority,
PBOOLEAN Released);
KiSetPriorityThread(
PKTHREAD Thread,
KPRIORITY Priority,
PBOOLEAN Released
);
BOOLEAN
NTAPI
KiDispatcherObjectWake(
DISPATCHER_HEADER* hdr,
KPRIORITY increment
);
VOID
STDCALL
KeStackAttachProcess (
IN struct _KPROCESS* Process,
OUT PKAPC_STATE ApcState
);
KeExpireTimers(
PKDPC Apc,
PVOID Arg1,
PVOID Arg2,
PVOID Arg3
);
VOID
STDCALL
KeUnstackDetachProcess (
IN PKAPC_STATE ApcState
);
__inline
FASTCALL
KeInitializeDispatcherHeader(
DISPATCHER_HEADER* Header,
ULONG Type,
ULONG Size,
ULONG SignalState
);
BOOLEAN KiDispatcherObjectWake(DISPATCHER_HEADER* hdr, KPRIORITY increment);
VOID STDCALL KeExpireTimers(PKDPC Apc,
PVOID Arg1,
PVOID Arg2,
PVOID Arg3);
VOID inline FASTCALL KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
ULONG Size, ULONG SignalState);
VOID KeDumpStackFrames(PULONG Frame);
BOOLEAN KiTestAlert(VOID);
VOID
NTAPI
KeDumpStackFrames(PULONG Frame);
BOOLEAN
NTAPI
KiTestAlert(VOID);
VOID
FASTCALL
KiAbortWaitThread(PKTHREAD Thread,
NTSTATUS WaitStatus,
KPRIORITY Increment);
KiAbortWaitThread(
PKTHREAD Thread,
NTSTATUS WaitStatus,
KPRIORITY Increment
);
VOID
STDCALL
KeInitializeProcess(struct _KPROCESS *Process,
KPRIORITY Priority,
KAFFINITY Affinity,
LARGE_INTEGER DirectoryTableBase);
KeInitializeProcess(
struct _KPROCESS *Process,
KPRIORITY Priority,
KAFFINITY Affinity,
LARGE_INTEGER DirectoryTableBase
);
ULONG
STDCALL
@ -276,215 +354,302 @@ BOOLEAN
STDCALL
KeDisableThreadApcQueueing(IN PKTHREAD Thread);
BOOLEAN STDCALL KiInsertTimer(PKTIMER Timer, LARGE_INTEGER DueTime);
BOOLEAN
STDCALL
KiInsertTimer(
PKTIMER Timer,
LARGE_INTEGER DueTime
);
VOID inline FASTCALL KiSatisfyObjectWait(PDISPATCHER_HEADER Object, PKTHREAD Thread);
VOID
inline
FASTCALL
KiSatisfyObjectWait(
PDISPATCHER_HEADER Object,
PKTHREAD Thread
);
BOOLEAN inline FASTCALL KiIsObjectSignaled(PDISPATCHER_HEADER Object, PKTHREAD Thread);
BOOLEAN
inline
FASTCALL
KiIsObjectSignaled(
PDISPATCHER_HEADER Object,
PKTHREAD Thread
);
VOID inline FASTCALL KiSatisifyMultipleObjectWaits(PKWAIT_BLOCK WaitBlock);
VOID
inline
FASTCALL
KiSatisifyMultipleObjectWaits(PKWAIT_BLOCK WaitBlock);
VOID FASTCALL KiWaitTest(PDISPATCHER_HEADER Object, KPRIORITY Increment);
VOID
FASTCALL
KiWaitTest(
PDISPATCHER_HEADER Object,
KPRIORITY Increment
);
PULONG
NTAPI
KeGetStackTopThread(struct _ETHREAD* Thread);
BOOLEAN
STDCALL
KeContextToTrapFrame(
PCONTEXT Context,
PKEXCEPTION_FRAME ExeptionFrame,
PKTRAP_FRAME TrapFrame,
KPROCESSOR_MODE PreviousMode
);
VOID
STDCALL
KiDeliverApc(
KPROCESSOR_MODE PreviousMode,
PVOID Reserved,
PKTRAP_FRAME TrapFrame
);
PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
BOOLEAN STDCALL KeContextToTrapFrame(PCONTEXT Context,
PKEXCEPTION_FRAME ExeptionFrame,
PKTRAP_FRAME TrapFrame,
KPROCESSOR_MODE PreviousMode);
VOID STDCALL KiDeliverApc(KPROCESSOR_MODE PreviousMode,
PVOID Reserved,
PKTRAP_FRAME TrapFrame);
VOID
STDCALL
KiKernelApcDeliveryCheck(VOID);
LONG
STDCALL
KiInsertQueue(IN PKQUEUE Queue,
IN PLIST_ENTRY Entry,
BOOLEAN Head);
KiInsertQueue(
IN PKQUEUE Queue,
IN PLIST_ENTRY Entry,
BOOLEAN Head
);
ULONG
STDCALL
KeSetProcess(struct _KPROCESS* Process,
KPRIORITY Increment);
KeSetProcess(
struct _KPROCESS* Process,
KPRIORITY Increment
);
VOID
STDCALL
KeInitializeEventPair(PKEVENT_PAIR EventPair);
VOID STDCALL KeInitializeEventPair(PKEVENT_PAIR EventPair);
VOID STDCALL KiInitializeUserApc(IN PKEXCEPTION_FRAME Reserved,
IN PKTRAP_FRAME TrapFrame,
IN PKNORMAL_ROUTINE NormalRoutine,
IN PVOID NormalContext,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2);
VOID
STDCALL
KiInitializeUserApc(
IN PKEXCEPTION_FRAME Reserved,
IN PKTRAP_FRAME TrapFrame,
IN PKNORMAL_ROUTINE NormalRoutine,
IN PVOID NormalContext,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2
);
PLIST_ENTRY
STDCALL
KeFlushQueueApc(IN PKTHREAD Thread,
IN KPROCESSOR_MODE PreviousMode);
KeFlushQueueApc(
IN PKTHREAD Thread,
IN KPROCESSOR_MODE PreviousMode
);
VOID
STDCALL
KiAttachProcess(
struct _KTHREAD *Thread,
struct _KPROCESS *Process,
KIRQL ApcLock,
struct _KAPC_STATE *SavedApcState
);
VOID STDCALL KiAttachProcess(struct _KTHREAD *Thread, struct _KPROCESS *Process, KIRQL ApcLock, struct _KAPC_STATE *SavedApcState);
VOID STDCALL KiSwapProcess(struct _KPROCESS *NewProcess, struct _KPROCESS *OldProcess);
VOID
STDCALL
KiSwapProcess(
struct _KPROCESS *NewProcess,
struct _KPROCESS *OldProcess
);
BOOLEAN
STDCALL
KeTestAlertThread(IN KPROCESSOR_MODE AlertMode);
BOOLEAN STDCALL KeRemoveQueueApc (PKAPC Apc);
VOID FASTCALL KiWakeQueue(IN PKQUEUE Queue);
PLIST_ENTRY STDCALL KeRundownQueue(IN PKQUEUE Queue);
BOOLEAN
STDCALL
KeRemoveQueueApc(PKAPC Apc);
extern LARGE_INTEGER SystemBootTime;
VOID
FASTCALL
KiWakeQueue(IN PKQUEUE Queue);
PLIST_ENTRY
STDCALL
KeRundownQueue(IN PKQUEUE Queue);
/* INITIALIZATION FUNCTIONS *************************************************/
extern ULONG_PTR KERNEL_BASE;
VOID
NTAPI
KeInitExceptions(VOID);
VOID KeInitExceptions(VOID);
VOID KeInitInterrupts(VOID);
VOID KeInitTimer(VOID);
VOID KeInitDpc(struct _KPRCB* Prcb);
VOID KeInitDispatcher(VOID);
VOID inline FASTCALL KeInitializeDispatcher(VOID);
VOID KiInitializeSystemClock(VOID);
VOID KiInitializeBugCheck(VOID);
VOID Phase1Initialization(PVOID Context);
VOID
NTAPI
KeInitInterrupts(VOID);
VOID KeInit1(PCHAR CommandLine, PULONG LastKernelAddress);
VOID KeInit2(VOID);
VOID
NTAPI
KeInitTimer(VOID);
BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
VOID
NTAPI
KeInitDpc(struct _KPRCB* Prcb);
VOID
NTAPI
KeInitDispatcher(VOID);
VOID
__inline
FASTCALL
KeInitializeDispatcher(VOID);
VOID
NTAPI
KiInitializeSystemClock(VOID);
VOID
NTAPI
KiInitializeBugCheck(VOID);
VOID
NTAPI
Phase1Initialization(PVOID Context);
VOID
NTAPI
KeInit1(
PCHAR CommandLine,
PULONG LastKernelAddress
);
VOID
NTAPI
KeInit2(VOID);
BOOLEAN
NTAPI
KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
VOID
STDCALL
KiMoveApcState (PKAPC_STATE OldState,
PKAPC_STATE NewState);
KiMoveApcState(
PKAPC_STATE OldState,
PKAPC_STATE NewState
);
VOID
KiAddProfileEvent(KPROFILE_SOURCE Source, ULONG Pc);
NTAPI
KiAddProfileEvent(
KPROFILE_SOURCE Source,
ULONG Pc
);
VOID
NTAPI
KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
PKEXCEPTION_FRAME ExceptionFrame,
PKTRAP_FRAME Tf,
KPROCESSOR_MODE PreviousMode,
BOOLEAN SearchFrames);
KiDispatchException(
PEXCEPTION_RECORD ExceptionRecord,
PKEXCEPTION_FRAME ExceptionFrame,
PKTRAP_FRAME Tf,
KPROCESSOR_MODE PreviousMode,
BOOLEAN SearchFrames
);
VOID
NTAPI
KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame,
IN OUT PCONTEXT Context);
KeTrapFrameToContext(
IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame,
IN OUT PCONTEXT Context
);
VOID
NTAPI
KeApplicationProcessorInit(VOID);
VOID
NTAPI
KePrepareForApplicationProcessorInit(ULONG id);
ULONG
KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2);
VOID STDCALL
KePushAndStackSwitchAndSysRet(ULONG Push, PVOID NewStack);
VOID STDCALL
KeStackSwitchAndRet(PVOID NewStack);
VOID STDCALL
KeBugCheckWithTf(ULONG BugCheckCode,
ULONG BugCheckParameter1,
ULONG BugCheckParameter2,
ULONG BugCheckParameter3,
ULONG BugCheckParameter4,
PKTRAP_FRAME Tf);
#define KEBUGCHECKWITHTF(a,b,c,d,e,f) DbgPrint("KeBugCheckWithTf at %s:%i\n",__FILE__,__LINE__), KeBugCheckWithTf(a,b,c,d,e,f)
NTAPI
KiUserTrapHandler(
PKTRAP_FRAME Tf,
ULONG ExceptionNr,
PVOID Cr2
);
VOID
KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG ExceptionNr, ULONG cr2);
STDCALL
KePushAndStackSwitchAndSysRet(
ULONG Push,
PVOID NewStack
);
VOID
STDCALL
KeStackSwitchAndRet(PVOID NewStack);
VOID
STDCALL
KeBugCheckWithTf(
ULONG BugCheckCode,
ULONG BugCheckParameter1,
ULONG BugCheckParameter2,
ULONG BugCheckParameter3,
ULONG BugCheckParameter4,
PKTRAP_FRAME Tf
);
VOID
STDCALL
KiDumpTrapFrame(
PKTRAP_FRAME Tf,
ULONG ExceptionNr,
ULONG cr2
);
VOID
STDCALL
KeFlushCurrentTb(VOID);
/* REACTOS SPECIFIC */
VOID STDCALL
KeRosDumpStackFrames(
PULONG Frame,
ULONG FrameCount);
ULONG STDCALL
KeRosGetStackFrames(
PULONG Frames,
ULONG FrameCount);
VOID
STDCALL
KeRosDumpStackFrames(
PULONG Frame,
ULONG FrameCount
);
ULONG
STDCALL
KeRosGetStackFrames(
PULONG Frames,
ULONG FrameCount
);
VOID
NTAPI
KiSetSystemTime(PLARGE_INTEGER NewSystemTime);
/* Emulate cli/sti instructions */
#define KV86M_EMULATE_CLI_STI (0x1)
/* Allow the v86 mode code to access i/o ports */
#define KV86M_ALLOW_IO_PORT_ACCESS (0x2)
typedef struct _KV86M_REGISTERS
{
/*
* General purpose registers
*/
ULONG Ebp;
ULONG Edi;
ULONG Esi;
ULONG Edx;
ULONG Ecx;
ULONG Ebx;
ULONG Eax;
ULONG Ds;
ULONG Es;
ULONG Fs;
ULONG Gs;
/*
* Control registers
*/
ULONG Eip;
ULONG Cs;
ULONG Eflags;
ULONG Esp;
ULONG Ss;
/*
* Control structures
*/
ULONG RecoveryAddress;
UCHAR RecoveryInstruction[4];
ULONG Vif;
ULONG Flags;
PNTSTATUS PStatus;
} KV86M_REGISTERS, *PKV86M_REGISTERS;
typedef struct _KV86M_TRAP_FRAME
{
KTRAP_FRAME Tf;
ULONG SavedExceptionStack;
/*
* These are put on the top of the stack by the routine that entered
* v86 mode so the exception handlers can find the control information
*/
struct _KV86M_REGISTERS* regs;
ULONG orig_ebp;
} KV86M_TRAP_FRAME, *PKV86M_TRAP_FRAME;
NTSTATUS
STDCALL
Ke386CallBios(
UCHAR Int,
UCHAR Int,
PKV86M_REGISTERS Regs
);
ULONG
NTAPI
KeV86Exception(
ULONG ExceptionNr,
PKTRAP_FRAME Tf,
ULONG ExceptionNr,
PKTRAP_FRAME Tf,
ULONG address
);
#define MAXIMUM_PROCESSORS 32
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */

View file

@ -1,33 +1,38 @@
#ifndef __INCLUDE_INTERNAL_LDR_H
#define __INCLUDE_INTERNAL_LDR_H
#define KERNEL_MODULE_NAME L"ntoskrnl.exe"
#define HAL_MODULE_NAME L"hal.dll"
#define DRIVER_ROOT_NAME L"\\Driver\\"
#define FILESYSTEM_ROOT_NAME L"\\FileSystem\\"
#define KERNEL_MODULE_NAME L"ntoskrnl.exe"
#define HAL_MODULE_NAME L"hal.dll"
#define DRIVER_ROOT_NAME L"\\Driver\\"
#define FILESYSTEM_ROOT_NAME L"\\FileSystem\\"
extern ULONG_PTR LdrHalBase;
NTSTATUS
NTAPI
LdrLoadInitialProcess(
PHANDLE ProcessHandle,
PHANDLE ThreadHandle
);
VOID
LdrLoadAutoConfigDrivers (VOID);
NTAPI
LdrLoadAutoConfigDrivers(VOID);
VOID
LdrInitModuleManagement (VOID);
NTAPI
LdrInitModuleManagement(VOID);
NTSTATUS
NTAPI
LdrpMapImage(
HANDLE ProcessHandle,
HANDLE SectionHandle,
PVOID * ImageBase
HANDLE ProcessHandle,
HANDLE SectionHandle,
PVOID *ImageBase
);
NTSTATUS
NTAPI
LdrpLoadImage(
PUNICODE_STRING DriverName,
PVOID *ModuleBase,
@ -37,12 +42,15 @@ LdrpLoadImage(
);
NTSTATUS
NTAPI
LdrpUnloadImage(PVOID ModuleBase);
NTSTATUS
NTAPI
LdrpLoadAndCallImage(PUNICODE_STRING DriverName);
NTSTATUS
NTAPI
LdrpQueryModuleInformation(
PVOID Buffer,
ULONG Size,
@ -50,15 +58,18 @@ LdrpQueryModuleInformation(
);
VOID
NTAPI
LdrInit1(VOID);
VOID
NTAPI
LdrInitDebug(
PLOADER_MODULE Module,
PLOADER_MODULE Module,
PWCH Name
);
PVOID
NTAPI
LdrSafePEProcessModule(
PVOID ModuleLoadBase,
PVOID DriverBase,
@ -67,15 +78,18 @@ LdrSafePEProcessModule(
);
NTSTATUS
NTAPI
LdrLoadModule(
PUNICODE_STRING Filename,
PLDR_DATA_TABLE_ENTRY *ModuleObject
);
NTSTATUS
NTAPI
LdrUnloadModule(PLDR_DATA_TABLE_ENTRY ModuleObject);
PLDR_DATA_TABLE_ENTRY
NTAPI
LdrGetModuleObject(PUNICODE_STRING ModuleName);
#endif /* __INCLUDE_INTERNAL_LDR_H */

View file

@ -24,10 +24,8 @@
#include "ldr.h"
#include "kd.h"
#include "ex.h"
#include "xhal.h"
#include "v86m.h"
#include "fs.h"
#include "port.h"
#include "fsrtl.h"
#include "lpc.h"
#include "rtl.h"
#ifdef KDBG
#include "../kdbg/kdb.h"

View file

@ -1,15 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Kernel
* FILE: ntoskrnl/include/internal/v86m.h
* PURPOSE: V86 Headers
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
*/
/* INCLUDES ******************************************************************/
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_V86M_H
#define __NTOSKRNL_INCLUDE_INTERNAL_V86M_H
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_V86M_H */

View file

@ -1,69 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Kernel
* FILE: ntoskrnl/include/internal/xhal.h
* PURPOSE: HAL Callbacks
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
*/
/* INCLUDES ******************************************************************/
#ifndef __INCLUDE_INTERNAL_XHAL_H
#define __INCLUDE_INTERNAL_XHAL_H
#include <ddk/ntdddisk.h>
NTSTATUS
FASTCALL
xHalQueryDriveLayout(
IN PUNICODE_STRING DeviceName,
OUT PDRIVE_LAYOUT_INFORMATION *LayoutInfo
);
#undef HalExamineMBR
VOID
FASTCALL
HalExamineMBR(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG MBRTypeIdentifier,
OUT PVOID *Buffer
);
VOID
FASTCALL
xHalIoAssignDriveLetters(
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString
);
NTSTATUS
FASTCALL
xHalIoReadPartitionTable(
PDEVICE_OBJECT DeviceObject,
ULONG SectorSize,
BOOLEAN ReturnRecognizedPartitions,
PDRIVE_LAYOUT_INFORMATION *PartitionBuffer
);
NTSTATUS
FASTCALL
xHalIoSetPartitionInformation(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG PartitionNumber,
IN ULONG PartitionType
);
NTSTATUS
FASTCALL
xHalIoWritePartitionTable(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG SectorsPerTrack,
IN ULONG NumberOfHeads,
IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer
);
#endif

View file

@ -27,6 +27,7 @@ static ULONG KeBugCheckCount = 1;
VOID
INIT_FUNCTION
NTAPI
KiInitializeBugCheck(VOID)
{
PRTL_MESSAGE_RESOURCE_DATA BugCheckData;

View file

@ -73,6 +73,7 @@ EXPORTED ULONG KeMinimumIncrement = 100000;
*/
VOID
INIT_FUNCTION
NTAPI
KiInitializeSystemClock(VOID)
{
TIME_FIELDS TimeFields;
@ -100,6 +101,7 @@ KiInitializeSystemClock(VOID)
}
VOID
NTAPI
KiSetSystemTime(PLARGE_INTEGER NewSystemTime)
{
LARGE_INTEGER OldSystemTime;

View file

@ -32,6 +32,7 @@
*/
VOID
INIT_FUNCTION
NTAPI
KeInitDpc(PKPRCB Prcb)
{
InitializeListHead(&Prcb->DpcData[0].DpcListHead);

View file

@ -400,6 +400,7 @@ KiDoubleFaultHandler(VOID)
}
VOID
NTAPI
KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2)
{
ULONG cr3_;
@ -926,6 +927,7 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame,
}
VOID
NTAPI
KeDumpStackFrames(PULONG Frame)
{
PULONG StackBase, StackEnd;
@ -1109,7 +1111,9 @@ set_task_gate(unsigned int sel, unsigned task_sel)
KiIdt[sel].b = 0x8500;
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
KeInitExceptions(VOID)
/*
* FUNCTION: Initalize CPU exception handling

View file

@ -137,7 +137,9 @@ static ISR_TABLE IsrTable[NR_IRQS][1];
#define PRESENT (0x8000)
#define I486_INTERRUPT_GATE (0xe00)
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
KeInitInterrupts (VOID)
{
int i, j;

View file

@ -165,7 +165,9 @@ KeCreateApplicationProcessorIdleThread(ULONG Id)
Id, IdleThread->Cid.UniqueThread);
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
KePrepareForApplicationProcessorInit(ULONG Id)
{
DPRINT("KePrepareForApplicationProcessorInit(Id %d)\n", Id);
@ -205,6 +207,7 @@ KePrepareForApplicationProcessorInit(ULONG Id)
}
VOID
NTAPI
KeApplicationProcessorInit(VOID)
{
ULONG Offset;
@ -266,7 +269,9 @@ KeApplicationProcessorInit(VOID)
Ke386EnableInterrupts();
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
{
PKIPCR KPCR;
@ -401,7 +406,9 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
}
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
KeInit2(VOID)
{
PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();

View file

@ -78,6 +78,7 @@ print_user_address(PVOID address)
}
ULONG
NTAPI
KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
{
EXCEPTION_RECORD Er;

View file

@ -681,6 +681,7 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
}
ULONG
NTAPI
KeV86Exception(ULONG ExceptionNr, PKTRAP_FRAME Tf, ULONG address)
{
PUCHAR Ip;

View file

@ -22,6 +22,7 @@ KSPIN_LOCK KiIpiLock;
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
KiIpiSendRequest(KAFFINITY TargetSet, ULONG IpiRequest)
{
LONG i;
@ -59,18 +60,18 @@ KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame,
Prcb = KeGetCurrentPrcb();
if (Ke386TestAndClearBit(IPI_REQUEST_APC, &Prcb->IpiFrozen))
if (Ke386TestAndClearBit(IPI_APC, &Prcb->IpiFrozen))
{
HalRequestSoftwareInterrupt(APC_LEVEL);
}
if (Ke386TestAndClearBit(IPI_REQUEST_DPC, &Prcb->IpiFrozen))
if (Ke386TestAndClearBit(IPI_DPC, &Prcb->IpiFrozen))
{
Prcb->DpcInterruptRequested = TRUE;
HalRequestSoftwareInterrupt(DISPATCH_LEVEL);
}
if (Ke386TestAndClearBit(IPI_REQUEST_FUNCTIONCALL, &Prcb->IpiFrozen))
if (Ke386TestAndClearBit(IPI_SYNCH_REQUEST, &Prcb->IpiFrozen))
{
InterlockedDecrementUL(&Prcb->SignalDone->CurrentPacket[1]);
if (InterlockedCompareExchangeUL(&Prcb->SignalDone->CurrentPacket[2], 0, 0))
@ -140,7 +141,7 @@ KiIpiSendPacket(KAFFINITY TargetSet, VOID (STDCALL*WorkerRoutine)(PVOID), PVOID
{
Prcb = ((PKPCR)(KPCR_BASE + i * PAGE_SIZE))->Prcb;
while(0 != InterlockedCompareExchangeUL(&Prcb->SignalDone, (LONG)CurrentPrcb, 0));
Ke386TestAndSetBit(IPI_REQUEST_FUNCTIONCALL, &Prcb->IpiFrozen);
Ke386TestAndSetBit(IPI_SYNCH_REQUEST, &Prcb->IpiFrozen);
if (Processor != CurrentPrcb->SetMember)
{
HalRequestIpi(i);
@ -156,6 +157,7 @@ KiIpiSendPacket(KAFFINITY TargetSet, VOID (STDCALL*WorkerRoutine)(PVOID), PVOID
}
VOID
NTAPI
KeIpiGenericCall(VOID (STDCALL *Function)(PVOID), PVOID Argument)
{
KIRQL oldIrql;

View file

@ -38,7 +38,7 @@ KiRequestReschedule(CCHAR Processor)
Pcr = (PKPCR)(KPCR_BASE + Processor * PAGE_SIZE);
Pcr->Prcb->QuantumEnd = TRUE;
KiIpiSendRequest(1 << Processor, IPI_REQUEST_DPC);
KiIpiSendRequest(1 << Processor, IPI_DPC);
}
STATIC

View file

@ -89,18 +89,23 @@ LdrPEFixupImports ( PLDR_DATA_TABLE_ENTRY Module );
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
LdrInitDebug ( PLOADER_MODULE Module, PWCH Name )
{
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
LdrInit1 ( VOID )
{
/* Hook for KDB on initialization of the loader. */
KDB_LOADERINIT_HOOK(&NtoskrnlModuleObject, &HalModuleObject);
}
VOID INIT_FUNCTION
VOID
INIT_FUNCTION
NTAPI
LdrInitModuleManagement ( VOID )
{
PIMAGE_NT_HEADERS NtHeader;
@ -138,6 +143,7 @@ LdrInitModuleManagement ( VOID )
}
NTSTATUS
NTAPI
LdrpLoadImage (
PUNICODE_STRING DriverName,
PVOID *ModuleBase,
@ -175,6 +181,7 @@ LdrpLoadImage (
NTSTATUS
NTAPI
LdrpUnloadImage ( PVOID ModuleBase )
{
return(STATUS_NOT_IMPLEMENTED);
@ -182,6 +189,7 @@ LdrpUnloadImage ( PVOID ModuleBase )
NTSTATUS
NTAPI
LdrpLoadAndCallImage ( PUNICODE_STRING ModuleName )
{
PDRIVER_INITIALIZE DriverEntry;
@ -217,6 +225,7 @@ LdrpLoadAndCallImage ( PUNICODE_STRING ModuleName )
NTSTATUS
NTAPI
LdrLoadModule(
PUNICODE_STRING Filename,
PLDR_DATA_TABLE_ENTRY *ModuleObject )
@ -321,6 +330,7 @@ LdrLoadModule(
NTSTATUS
NTAPI
LdrUnloadModule ( PLDR_DATA_TABLE_ENTRY ModuleObject )
{
KIRQL Irql;
@ -365,6 +375,7 @@ LdrProcessModule(
}
NTSTATUS
NTAPI
LdrpQueryModuleInformation (
PVOID Buffer,
ULONG Size,
@ -542,6 +553,7 @@ LdrpCompareModuleNames (
}
PLDR_DATA_TABLE_ENTRY
NTAPI
LdrGetModuleObject ( PUNICODE_STRING ModuleName )
{
PLDR_DATA_TABLE_ENTRY Module;
@ -870,7 +882,9 @@ LdrPEProcessModule(
}
PVOID INIT_FUNCTION
PVOID
INIT_FUNCTION
NTAPI
LdrSafePEProcessModule (
PVOID ModuleLoadBase,
PVOID DriverBase,