Debugging Proxy Generation DLLs

Proxy generation DLLs are used to generate proxy addresses, which are addresses of foreign system users as expressed on Microsoft Exchange Server. Debugging proxy generation DLLs requires a few extra steps because the library is loaded dynamically only when needed. To trace a proxy generation DLL in the Microsoft Visual C++ debugger, you must load the calling program into Visual C++. All calls into the proxy generation DLL are made from the System Attendant service of Microsoft Exchange Server, which is implemented by MAD.EXE.

  1. On a computer running Microsoft Exchange Server, check that the System Attendant Service is running. In Control Panel, click Services, then find Microsoft Exchange System Attendant. If Status is not Started, click Start.
  2. Connect the debugger to this service (see Connecting the Debugger to a Running Service). The process identifier of the System Attendant service is found by searching for MAD.EXE in the table of running processes.
  3. Check Yes for OK not to have debugging information for this file.
  4. Start the Administrator program.

    At this point, you will not be able to set any breakpoints in your code because your DLL is not yet loaded. The System Attendant service will only load your proxy generation DLL when it is required by the process. Because you are connecting to MAD.EXE when it is already running rather than starting MAD.EXE in the debugger, specifying your proxy generation DLL in the Project Settings menu box under the Additional DLLs box will cause no action.

    If you need not begin tracing within your initialization code, continue following the steps in this procedure to debug your DLL.

  5. Using the Administrator program, perform an action that will cause your proxy generation DLL to be called. For example, create a new mailbox and switch to its E-Mail Addresses page.

    The Administrator program calls MAD.EXE. This loads your DLL and calls its initialization routines, as well as any routines relevant to the action you just performed.

  6. After your proxy generation DLL is loaded, open its source and set the breakpoints.
  7. Using the Administrator program, perform additional actions that will call your proxy generation DLL. Now the debugger will stop at your breakpoints.

If you must begin tracing at your initialization code, set a hard-coded breakpoint in that code. After your proxy generation DLL is loaded by performing one of the previously described actions, the hard-coded breakpoint will be hit. You can trace your code in the debugger from that point.