};
PFAST_SYSTEM_CALL_EXIT KiFastCallExitHandler;
+#if DBG && !defined(_WINKD_)
+PKDBG_PRESERVICEHOOK KeWin32PreServiceHook = NULL;
+PKDBG_POSTSERVICEHOOK KeWin32PostServiceHook = NULL;
+#endif
/* TRAP EXIT CODE *************************************************************/
KiDebugHandler(TrapFrame, TrapFrame->Eax, TrapFrame->Ecx, TrapFrame->Edx);
}
+
+FORCEINLINE
+VOID
+KiDbgPreServiceHook(ULONG SystemCallNumber, PULONG_PTR Arguments)
+{
+#if DBG && !defined(_WINKD_)
+ if (SystemCallNumber >= 0x1000 && KeWin32PreServiceHook)
+ KeWin32PreServiceHook(SystemCallNumber, Arguments);
+#endif
+}
+
+FORCEINLINE
+ULONG_PTR
+KiDbgPostServiceHook(ULONG SystemCallNumber, ULONG_PTR Result)
+{
+#if DBG && !defined(_WINKD_)
+ if (SystemCallNumber >= 0x1000 && KeWin32PostServiceHook)
+ return KeWin32PostServiceHook(SystemCallNumber, Result);
+#endif
+ return Result;
+}
+
DECLSPEC_NORETURN
VOID
FORCEINLINE
while (TRUE);
}
+ /* Call pre-service debug hook */
+ KiDbgPreServiceHook(SystemCallNumber, Arguments);
+
/* Get the handler and make the system call */
Handler = (PVOID)DescriptorTable->Base[Id];
Result = KiSystemCallTrampoline(Handler, Arguments, StackBytes);
+ /* Call post-service debug hook */
+ Result = KiDbgPostServiceHook(SystemCallNumber, Result);
+
/* Make sure we're exiting correctly */
KiExitSystemCallDebugChecks(Id, TrapFrame);