/* KERNEL FUNCTIONS ********************************************************/
+#ifndef KeFlushIoBuffers
#define KeFlushIoBuffers(Mdl, ReadOperation, DmaOperation)
+#endif
VOID STDCALL KeAttachProcess (struct _EPROCESS* Process);
VOID STDCALL KeAcquireSpinLock (PKSPIN_LOCK SpinLock,
PKIRQL OldIrql);
-VOID STDCALL KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock);
+#ifndef __USE_W32API
+VOID STDCALL KeAcquireSpinLockAtDpcLevel (IN PKSPIN_LOCK SpinLock);
+
+#define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel
+
+VOID
+STDCALL
+KeReleaseSpinLockFromDpcLevel(
+ IN PKSPIN_LOCK SpinLock);
+
+#endif
+
/*
* FUNCTION: Brings the system down in a controlled manner when an
* inconsistency that might otherwise cause corruption has been detected
* ARGUMENTS:
* BugCheckCode = Specifies the reason for the bug check
* RETURNS: Doesn't
+ *
+ * NOTES - please use the macro KEBUGCHECK with the same argument so the end-user
+ * knows what file/line number where the bug check occured
*/
VOID STDCALL KeBugCheck (ULONG BugCheckCode);
-
/*
* FUNCTION: Brings the system down in a controlled manner when an
* inconsistency that might otherwise cause corruption has been detected
* BugCheckCode = Specifies the reason for the bug check
* BugCheckParameter[1-4] = Additional information about bug
* RETURNS: Doesn't
+ *
+ * NOTES - please use the macro KEBUGCHECKEX with the same arguments so the end-user
+ * knows what file/line number where the bug check occured
*/
VOID STDCALL KeBugCheckEx (ULONG BugCheckCode,
ULONG BugCheckParameter1,
*/
VOID STDCALL KeEnterKernelDebugger (VOID);
-VOID STDCALL KeFlushWriteBuffer (VOID);
-
KIRQL STDCALL KeGetCurrentIrql (VOID);
+#ifndef __USE_W32API
ULONG KeGetCurrentProcessorNumber(VOID);
+ULONG KeGetDcacheFillSize(VOID);
+ULONG STDCALL KeGetPreviousMode (VOID);
+#endif
struct _KTHREAD* STDCALL KeGetCurrentThread (VOID);
-ULONG KeGetDcacheFillSize(VOID);
-
-ULONG STDCALL KeGetPreviousMode (VOID);
+VOID STDCALL KeInitializeApc (IN PKAPC Apc,
+ IN PKTHREAD Thread,
+ IN UCHAR StateIndex,
+ IN PKKERNEL_ROUTINE KernelRoutine,
+ IN PKRUNDOWN_ROUTINE RundownRoutine,
+ IN PKNORMAL_ROUTINE NormalRoutine,
+ IN UCHAR Mode,
+ IN PVOID Context);
-VOID STDCALL KeInitializeApc (PKAPC Apc,
- struct _KTHREAD* Thread,
- UCHAR StateIndex,
- PKKERNEL_ROUTINE KernelRoutine,
- PKRUNDOWN_ROUTINE RundownRoutine,
- PKNORMAL_ROUTINE NormalRoutine,
- UCHAR Mode,
- PVOID Context);
/*
* VOID
* PKBUGCHECK_CALLBACK_RECORD CallbackRecord
* );
*/
+#ifndef KeInitializeCallbackRecord
#define KeInitializeCallbackRecord(CallbackRecord) \
(CallbackRecord)->State = BufferEmpty
+#endif
VOID STDCALL KeInitializeDeviceQueue (PKDEVICE_QUEUE DeviceQueue);
KeInsertQueue(IN PKQUEUE Queue,
IN PLIST_ENTRY Entry);
-VOID STDCALL KeInsertQueueApc (PKAPC Apc,
+BOOLEAN STDCALL KeInsertQueueApc (PKAPC Apc,
PVOID SystemArgument1,
PVOID SystemArgument2,
- UCHAR Mode);
+ KPRIORITY PriorityBoost);
BOOLEAN STDCALL KeInsertQueueDpc (PKDPC Dpc,
PVOID SystemArgument1,
VOID
);
-KIRQL
-STDCALL
-KeRaiseIrqlToSynchLevel (
- VOID
- );
-
/*
* FUNCTION: Raises a user mode exception
* ARGUMENTS:
KIRQL NewIrql
);
+#ifndef __USE_W32API
VOID
STDCALL
KeReleaseSpinLockFromDpcLevel (
PKSPIN_LOCK Spinlock
);
+#endif
PKDEVICE_QUEUE_ENTRY
STDCALL
-// io permission map has a 8k size
-// Each bit in the IOPM corresponds to an io port byte address. The bitmap
-// is initialized to allow IO at any port. [ all bits set ].
-
+/* io permission map has a 8k size
+ * Each bit in the IOPM corresponds to an io port byte address. The bitmap
+ * is initialized to allow IO at any port. [ all bits set ].
+ */
typedef struct _IOPM
{
UCHAR Bitmap[8192];
* is initialized to allow IO at any port. [ all bits set ]. The IOPL determines
* the minium privilege level required to perform IO prior to checking the permission map.
*/
-VOID Ke386SetIoAccessMap(ULONG NewMap, PIOPM *IoPermissionMap);
+BOOL STDCALL
+Ke386SetIoAccessMap(ULONG NewMap, PULONG IoPermissionMap);
/*
* FUNCTION: Queries the io permission map.
* is initialized to allow IO at any port. [ all bits set ]. The IOPL determines
* the minium privilege level required to perform IO prior to checking the permission map.
*/
-VOID Ke386QueryIoAccessMap(BOOLEAN NewMap, PIOPM *IoPermissionMap);
+BOOL STDCALL
+Ke386QueryIoAccessMap(ULONG NewMap, PULONG IoPermissionMap);
/*
* FUNCTION: Set the process IOPL
* Eprocess = Pointer to a executive process object
* EnableIo = Specify TRUE to enable IO and FALSE to disable
*/
-NTSTATUS Ke386IoSetAccessProcess(struct _EPROCESS* Eprocess, BOOLEAN EnableIo);
+BOOL STDCALL
+Ke386IoSetAccessProcess(struct _EPROCESS* Eprocess, BOOL EnableIo);
+
+/*
+ * FUNCTION: Sets the contents of a gdt descriptor.
+ * ARGUMENTS:
+ * Entry = The selector to set.
+ * Value1 = The value of the low dword of the descriptor.
+ * Value2 = The value of the high dword of the descriptor.
+ */
+VOID
+KeSetGdtSelector(ULONG Entry, ULONG Value1, ULONG Value2);
/*
* FUNCTION: Releases a set of Global Descriptor Table Selectors