12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /*++
- Copyright (c) 2012 Minoca Corp. All Rights Reserved
- Module Name:
- assert.c
- Abstract:
- This module implements assertions for the kernel runtime library.
- Author:
- Evan Green 25-Jul-2012
- Environment:
- Kernel
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- #include "rtlp.h"
- #include <minoca/kernel/arch.h>
- #include <minoca/kernel/hmod.h>
- #include <minoca/kernel/kdebug.h>
- //
- // ---------------------------------------------------------------- Definitions
- //
- //
- // ----------------------------------------------- Internal Function Prototypes
- //
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // ------------------------------------------------------------------ Functions
- //
- RTL_API
- VOID
- RtlRaiseAssertion (
- PSTR Expression,
- PSTR SourceFile,
- ULONG SourceLine
- )
- /*++
- Routine Description:
- This routine raises an assertion failure exception. If a debugger is
- connected, it will attempt to connect to the debugger.
- Arguments:
- Expression - Supplies the string containing the expression that failed.
- SourceFile - Supplies the string describing the source file of the failure.
- SourceLine - Supplies the source line number of the failure.
- Return Value:
- None.
- --*/
- {
- RtlDebugPrint("\n\n *** Assertion Failure: %s\n *** File: %s, Line %d\n\n",
- Expression,
- SourceFile,
- SourceLine);
- RtlDebugService(EXCEPTION_ASSERTION_FAILURE, NULL);
- return;
- }
- //
- // --------------------------------------------------------- Internal Functions
- //
|