ReactOS 0.4.16-dev-106-g10b08aa
nmidebug.c File Reference
#include <ntifs.h>
#include <ndk/ketypes.h>
Include dependency graph for nmidebug.c:

Go to the source code of this file.

Functions

FORCEINLINE VOID NmiClearFlag (VOID)
 
BOOLEAN NTAPI NmiDbgCallback (IN PVOID Context, IN BOOLEAN Handled)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 

Variables

PCHAR NmiBegin = "NMI4NMI@"
 

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 57 of file nmidebug.c.

59{
60 PAGED_CODE();
61
62 /* Register NMI callback */
64
65 /* Return success */
66 return STATUS_SUCCESS;
67}
#define PAGED_CODE()
PVOID NTAPI KeRegisterNmiCallback(IN PNMI_CALLBACK CallbackRoutine, IN PVOID Context)
Definition: bug.c:1330
#define NULL
Definition: types.h:112
BOOLEAN NTAPI NmiDbgCallback(IN PVOID Context, IN BOOLEAN Handled)
Definition: nmidebug.c:38
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ NmiClearFlag()

FORCEINLINE VOID NmiClearFlag ( VOID  )

Definition at line 20 of file nmidebug.c.

21{
22 ((PCHAR)&KiBugCheckData[4])[0] -= (NmiBegin[3] | NmiBegin[7]);
23 ((PCHAR)&KiBugCheckData[4])[3] |= 1;
24#ifdef _M_IX86
25#if defined(_MSC_VER) && !defined(__clang__)
26 __asm
27 {
28 rcr KiBugCheckData[4], 8
29 }
30#else
31 __asm__("rcrl %b[shift], %k[retval]" : [retval] "=rm" (KiBugCheckData[4]) : "[retval]" (KiBugCheckData[4]), [shift] "Nc" (8));
32#endif
33#endif
34}
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
#define PCHAR
Definition: match.c:90
#define shift
Definition: input.c:1755
PCHAR NmiBegin
Definition: nmidebug.c:16
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

Referenced by NmiDbgCallback().

◆ NmiDbgCallback()

BOOLEAN NTAPI NmiDbgCallback ( IN PVOID  Context,
IN BOOLEAN  Handled 
)

Definition at line 38 of file nmidebug.c.

40{
41 /* Clear the NMI flag */
43
44 /* Get NMI status signature */
46 ((void(*)())&KiBugCheckData[4])();
47
48 /* Handle the NMI safely */
49#ifdef _M_IX86
51#endif
52 return TRUE;
53}
#define TRUE
Definition: types.h:120
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
PPC_QUAL void __indwordstring(unsigned long Port, unsigned long *Buffer, unsigned long Count)
Definition: intrin_ppc.h:598
FORCEINLINE VOID NmiClearFlag(VOID)
Definition: nmidebug.c:20
BOOLEAN KiEnableTimerWatchdog
Definition: timerobj.c:20
uint32_t * PULONG
Definition: typedefs.h:59

Referenced by DriverEntry().

Variable Documentation

◆ NmiBegin

PCHAR NmiBegin = "NMI4NMI@"

Definition at line 16 of file nmidebug.c.

Referenced by NmiClearFlag(), and NmiDbgCallback().