The Microsoft Exchange Server SDK contains a library called ExchSDKd.LIB, which includes a collection of macros and asserts that can be very useful when debugging a server application. Many calls, such as the ASSERTERROR and DEBUGPUBLIC macros, can be inserted in the code as it is written. They then provide debugging information, as well as future data. The best way to become familiar with available calls is to study the ExchSDKd library and header file source code.
The asserts contained in the ExchSDKd library are not typical. Their default behavior is not to stop the process, or even to cause warnings or error messages, but rather to print silently to a log file. These log files are stored in the system's temporary directory and are given unique names each time the application is run.
You can use the asserts as they were designed and read the log file they produce, or you can change their behavior: They can be modified to cause a prompt to appear, cancel the process, or start the debugger when they execute. Environment variables that can be used to change the name and path of the log file and the debug output printed by the log file are located in the ExchSDKd source file EDKLOG.C.
ExchSDKd contains memory wrappers that allow you to control your application's memory allocation. Use these functions to find and fix memory problems. These functions wrap standard memory allocation functions such as malloc and MAPI functions such as MAPIAllocateBuffer.
The ExchSDKd library includes macros for testing the validity of pointers. Use these macros to check for nonnull values or for the correct values or data types. For example, you can check for IUnknown pointers, which identify the object as a MAPI or WIN32 object.
The assert macros include the following: