Debugging Proxy Generation DLLs

Debugging Proxy Generation DLLs

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Proxy generation DLLs are used to generate proxy addresses, which are addresses of third-party mail system users as expressed on Microsoft® Exchange Server 2003. 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 Exchange, which is implemented by mad.exe.

To debug a proxy generation dynamic-link library (DLL)

  1. On a computer running Exchange, check that the System Attendant Service is running. In Control Panel, click Services, and then find Microsoft Exchange System Attendant. If Status is not Started, click Start.

  2. Connect the debugger to the Microsoft Exchange System Attendant service. The process identifier of the System Attendant service is found by searching for mad.exe in the table of running processes. Read the Visual C++ documentation for instructions about how to attach the debugger to a running process.

  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 loaded yet. The System Attendant service will only open your proxy generation DLL when the process requires it. Because you are connecting to mad.exe when it is already running rather than starting mad.exe in the debuffer, specifying your proxy generation DLL in the Project Settings menu box under the Additional DLLs box will cause no action.

    If you do not need to 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.

For more information about proxy addresses, read the Proxy Addresses section.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.