#define NDEBUG\r
#include <debug.h>\r
\r
+//\r
+// Retrieves the ComponentId and Level for BREAKPOINT_PRINT\r
+// and OutputString and OutputStringLength for BREAKPOINT_PROMPT.\r
+//\r
+#if defined(_M_IX86)\r
+\r
+//\r
+// EBX/EDI on x86\r
+//\r
+#define KdpGetFirstParameter(Context) ((Context)->Ebx)\r
+#define KdpGetSecondParameter(Context) ((Context)->Edi)\r
+\r
+#elif defined(_M_AMD64)\r
+\r
+//\r
+// R8/R9 on AMD64\r
+//\r
+#define KdpGetFirstParameter(Context) ((Context)->R8)\r
+#define KdpGetSecondParameter(Context) ((Context)->R9)\r
+\r
+#elif defined(_M_ARM)\r
+\r
+#error Yo Ninjas!\r
+\r
+#else\r
+#error Unsupported Architecture\r
+#endif\r
+\r
/* FUNCTIONS *****************************************************************/\r
\r
BOOLEAN\r
PKPRCB Prcb;\r
NTSTATUS ExceptionCode = ExceptionRecord->ExceptionCode;\r
\r
- /* Check if this is INT1 or 3, or if we're forced to handle it */\r
+ /* Check if this is single step or a breakpoint, or if we're forced to handle it */\r
if ((ExceptionCode == STATUS_BREAKPOINT) ||\r
(ExceptionCode == STATUS_SINGLE_STEP) ||\r
(ExceptionCode == STATUS_ASSERTION_FAILURE) ||\r
case BREAKPOINT_PRINT:\r
\r
/* Call the worker routine */\r
- ReturnValue = KdpPrint((ULONG)ContextRecord->Ebx,\r
- (ULONG)ContextRecord->Edi,\r
+ ReturnValue = KdpPrint((ULONG)KdpGetFirstParameter(ContextRecord),\r
+ (ULONG)KdpGetSecondParameter(ContextRecord),\r
(LPSTR)ExceptionRecord->\r
ExceptionInformation[1],\r
(USHORT)ExceptionRecord->\r
ExceptionInformation[1],\r
(USHORT)ExceptionRecord->\r
ExceptionInformation[2],\r
- (LPSTR)ContextRecord->Ebx,\r
- (USHORT)ContextRecord->Edi,\r
+ (LPSTR)KdpGetFirstParameter(ContextRecord),\r
+ (USHORT)KdpGetSecondParameter(ContextRecord),\r
PreviousMode,\r
TrapFrame,\r
ExceptionFrame);\r
KeSetContextReturnRegister(ContextRecord, ReturnValue);\r
break;\r
\r
- /* DbgUnloadImageSymbols */\r
+ /* DbgUnLoadImageSymbols */\r
case BREAKPOINT_UNLOAD_SYMBOLS:\r
\r
/* Drop into the load case below, with the unload parameter */\r