Checked Version
Driver development environments are usually set up to produce two different builds: an optimized retail release version, called the free build, and an unoptimised test debug build, called the checked build.
Put any debug or test code so that it appears in the checked build. The simplest way to do this is to check the value of the preprocessor variable DBG, which is set to 1 in the checked build and 0 in free build. Here is an example of how to use this technique.
#if DBG
DebugPrintInit("Wdm1 checked");
#else
DebugPrintInit("Wdm1 free");
#endif
I shall soon look at the different types of debug code that you can put in your checked version.
Running under the checked build version of NT or W2000 can also pick up driver errors as the operating system makes more internal checks.