Solved

Debug ISAPI DLL!!!!

Posted on 1998-10-23
2
417 Views
Last Modified: 2013-11-20
How do I debug a ISAPI Dll with IIS 4.0 & Visual C++ 5.0?

I have tried all the tricks that work with C++ 4.0..and IIS 1/2....but how do I debug with the NEW stuff?
0
Comment
Question by:spacedog2
2 Comments
 

Accepted Solution

by:
rakeshkalra earned 100 total points
Comment Utility
Getting the Microsoft Internet Information Server up and running with your DLL in the debugger is possible, but a little tricky. You will need to first find a quiet server where you can debug your DLL in a controlled setting. Once you've found such a resource, you can start debugging your DLL by following these steps:

1.Stop the Internet Information Server publishing services by using the Internet Information Server Manager, or by stopping the services with the Services icon in the Windows NT Advanced Server Control Panel. Note that you must stop all three services even though you are only debugging extensions to the World-Wide Web publishing service. To make things easier, you might wish to make the services "Manually" started in Control Panel so you can avoid this step later in your development.

2.Start Microsoft Developer Studio, and click the Close Workspace command on the File menu to close any opened workspace.

3.On the File menu, click Open Workspace to open the INETINFO.EXE program. This file is in the directory where you installed the Microsoft Internet Information Server.

4.On the Build menu, click Settings, then click the Debug tab in the Project Settings dialog box.

5.With General selected in the Category box, type the following in the Program Arguments text box:

-e W3Svc

6.Choose Additional DLLs from the Category drop-down list. Then, in the Local Names box, specify the complete path and name of your extension DLL or DLLs. Make sure the check box next to each is marked.

7.Click OK to close the Project Settings dialog box.

8.Make sure that the .PDB file for your DLL is in the same directory as the DLLs you plan to debug.

Debugging Tips
--------------
The Internet server can be run as an interactive application. This makes debugging it much easier. To do this you need to make a few changes to your system. For the user account that you are going to run the server under, you need to add a few privileges.

To add privileges, run User Manager (MUSRMGR.EXE), and select User Rights from the Policies menu. Check the Show Advanced User Rights check box. Then select "Act as part of the operating system" from the Right drop-down list, and add the user account.

Repeat this process with "Generate Security Audits" (also in the Rights drop-down list). Make sure that all Internet Services (WWW, ftp & gopher) are stopped and INetInfo.Exe is not running (use TLIST to check). Log off and log back on. You can then load the Internet Server with the command line:

INetInfo.Exe -e W3Svc

If you want to load this under a debugger just make sure that the command line to INetInfo.Exe is "-e W3Svc". (For example, to load it into WinDbg the command line is: WinDbg INetInfo.Exe -e W3Svc

You are ready to go. In Developer Studio, point to Debug on the Build menu and then choose Go. This action starts the WWW publishing service, and the debugger will be aware of symbols in your DLL. You'll get a warning that this file doesn't have debugging information in it, but you can ignore that message.

When you leave Microsoft Developer Studio, you will probably want to make sure that you let Developer Studio save the workspace for INETINFO.EXE. This will let you avoid reentering all of the settings you need to make—instead, you can just open the INETINFO.MDS workspace file when you are ready to start the debugger again.

Cached DLLs
-----------
You can adjust the registry setting at HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W3SVC/Parameters/CacheExtensions to have the server reinitialize DLLs each time they are used. If this setting is 1, the server will keep DLLs loaded in memory as long as possible. This is the default setting for the server, since it helps the server achieve peak performance, and should only be changed if you are using the server for debugging. If you make the setting zero, the server will always reload extension DLLs each time they are used.

Forcing the server to reload your DLL is very helpful when your DLL might be crashing or upsetting any per-instance data that it maintains. By forcing the server to reinitialize the DLL, you can get your DLL back into a predictable state with very little effort. You should make sure you test your DLL using the normal CacheExtensions setting, however, to make sure code in your DLL isn't completely dependent on that initial state.

0
 

Author Comment

by:spacedog2
Comment Utility
I found a much easier method off of http://support.microsoft.com!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now