Microsoft Windows CE 3.0  

Assert Macros and Functions

This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The Microsoft DirectShow SDK has three assertion macros: ASSERT, EXECUTE_ASSERT, and KASSERT. The most commonly used assertion macro is ASSERT. If ASSERTfails, DirectShow displays a message box that lists the file and line number of the macro call. The EXECUTE_ASSERTmacro is similar to ASSERTexcept that the condition will still be evaluated in a build of any kind. The third assertion macro is KASSERT, which is more suitable for pure filters, such as those in the kernel, where the condition is printed onto the debugger rather than to a message box.

There are also two assertion functions: DbgAssertand DbgKernelAssert. You should call the assertion functions from assertion macros, rather than from normal code.

ASSERT Checks an assertion in a debug build.
DbgAssert Handles an assertion failure in a debug build.
DbgKernelAssert Handles a kernel assertion failure in a debug build.
EXECUTE_ASSERT Always evaluates a condition; if it is not TRUE in a debug build, treat this as an assertion failure.
KASSERT Checks a kernel assertion in a debug build.