标签:sap bre ase sys efi prompt ber ons log
#define ASSERT( exp ) ((!(exp)) ? (RtlAssert( #exp, __FILE__, __LINE__, NULL ),FALSE) : TRUE)
NTSYSAPI
VOID
NTAPI
RtlAssert(
__in PVOID VoidFailedAssertion,
__in PVOID VoidFileName,
__in ULONG LineNumber,
__in_opt PSTR MutableMessage
)
{
#if DBG || RTL_ASSERT_ALWAYS_ENABLED
char Response[ 2 ];
CONST PCSTR FailedAssertion = (PCSTR)VoidFailedAssertion;
CONST PCSTR FileName = (PCSTR)VoidFileName;
CONST PCSTR Message = (PCSTR)MutableMessage;
CONTEXT Context;
RtlCaptureContext( &Context );
while (TRUE) {
DbgPrint( "\n*** Assertion failed: %s%s\n*** Source File: %s, line %ld\n\n",
Message ? Message : "",
FailedAssertion,
FileName,
LineNumber
);
DbgPrompt( "Break repeatedly, break Once, Ignore, terminate Process, or terminate Thread (boipt)? ",
Response,
sizeof( Response )
);
switch (Response[0]) {
case ‘B‘:
case ‘b‘:
case ‘O‘:
case ‘o‘:
DbgPrint( "Execute ‘.cxr %p‘ to dump context\n", &Context);
DbgBreakPoint();
if (Response[0] == ‘o‘ || Response[0] == ‘O‘)
return;
break;
case ‘I‘:
case ‘i‘:
return;
case ‘P‘:
case ‘p‘:
ZwTerminateProcess( NtCurrentProcess(), STATUS_UNSUCCESSFUL );
break;
case ‘T‘:
case ‘t‘:
ZwTerminateThread( NtCurrentThread(), STATUS_UNSUCCESSFUL );
break;
}
}
DbgBreakPoint();
ZwTerminateProcess( NtCurrentProcess(), STATUS_UNSUCCESSFUL );
#endif
}
标签:sap bre ase sys efi prompt ber ons log
原文地址:http://www.cnblogs.com/aliflycoris/p/7375256.html