Microsoft KB Archive/239535: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - """ to """)
 
(One intermediate revision by the same user not shown)
Line 38: Line 38:
<ol>
<ol>
<li><p>Set the CreateProcessAsUser Metabase property to FALSE using either the ADSUTIL or the Metabase Editor (MetaEdit) to force IIS to use the CreateProcess API to start a CGI application. After changing the property all CGIs will be running under the Local System account. For example:</p>
<li><p>Set the CreateProcessAsUser Metabase property to FALSE using either the ADSUTIL or the Metabase Editor (MetaEdit) to force IIS to use the CreateProcess API to start a CGI application. After changing the property all CGIs will be running under the Local System account. For example:</p>
<pre class="CODESAMP">C:\&gt;adsutil SET W3SVC/1/Root/Scripts/MYCGI.exe/CreateProcessAsUser 0 </pre>
<pre class="CODESAMP">C:\>adsutil SET W3SVC/1/Root/Scripts/MYCGI.exe/CreateProcessAsUser 0 </pre>
<p>ADSUTIL could be found in the following directory (if Windows Script Host optional component of the Windows NT Option Pack is installed).:</p>
<p>ADSUTIL could be found in the following directory (if Windows Script Host optional component of the Windows NT Option Pack is installed).:</p>
<pre class="CODESAMP">WINNT\Sytem32\Inetsrv\Adminsamples </pre>
<pre class="CODESAMP">WINNT\Sytem32\Inetsrv\Adminsamples </pre>
Line 49: Line 49:


Runtime error!<br />
Runtime error!<br />
Program: <MSDevDir\bin&gt;\MSDEV.exe<br />
Program: <MSDevDir\bin>\MSDEV.exe<br />
abnormal program termination<br />
abnormal program termination<br />


Line 56: Line 56:
<p>This error does not occur on Windows NT 3.51. It occurs on Windows NT 4.0 because the CGI application does not have the proper security access to the interactive window station and desktop. Therefore, the Visual C debugger cannot initialize properly.</p></li></ol>
<p>This error does not occur on Windows NT 3.51. It occurs on Windows NT 4.0 because the CGI application does not have the proper security access to the interactive window station and desktop. Therefore, the Visual C debugger cannot initialize properly.</p></li></ol>


==== Method 2 (Applying NULL DACL to the interactive window station and desktop, &quot;winsta0\\default&quot;) ====
==== Method 2 (Applying NULL DACL to the interactive window station and desktop, "winsta0\\default") ====


<ol>
<ol>

Latest revision as of 13:47, 21 July 2020

HOWTO: Debug CGI Using Visual C++ Just-In-Time Debugger

Q239535



The information in this article applies to:


  • Microsoft Windows NT Server versions 4.0, 4.0 SP4
  • Microsoft Windows NT Workstation versions 4.0, 4.0 SP4





SUMMARY

Debugging a Common Gateway Interface (CGI) application is different from debugging it as a console application. This article illustrates the correct way to debug a CGI application under Windows Windows NT Service Pack 4 (SP4) using the Microsoft Visual C++ Just-In-Time (JIT) debugger.



MORE INFORMATION

Specify Microsoft Visual C++ as your JIT debugger (check the JIT debugging box on the VC Tools menu and then Options). Then add a DebugBreak() statement to the CGI source code.


Method 1 (Launching CGI as LocalSystem)

  1. Set the CreateProcessAsUser Metabase property to FALSE using either the ADSUTIL or the Metabase Editor (MetaEdit) to force IIS to use the CreateProcess API to start a CGI application. After changing the property all CGIs will be running under the Local System account. For example:

    C:\>adsutil SET W3SVC/1/Root/Scripts/MYCGI.exe/CreateProcessAsUser 0 

    ADSUTIL could be found in the following directory (if Windows Script Host optional component of the Windows NT Option Pack is installed).:

    WINNT\Sytem32\Inetsrv\Adminsamples 

    MetaEdit is available in IIS Resource Kit.

  2. Invoke the CGI application from a browser.
  3. An error dialog box will display on the server after a breakpoint has been reached. Click Cancel to start debugging.

    Note that configuring either the Basic or NTLM authentication for the CGI application won't help JIT debugging. The following error message will be generated when you click Cancel:

    Runtime error!
    Program: <MSDevDir\bin>\MSDEV.exe
    abnormal program termination


    This error does not occur on Windows NT 3.51. It occurs on Windows NT 4.0 because the CGI application does not have the proper security access to the interactive window station and desktop. Therefore, the Visual C debugger cannot initialize properly.

Method 2 (Applying NULL DACL to the interactive window station and desktop, "winsta0\\default")

  1. Build a helper application and run it before start debugging CGI.

    The following KB article provides a sample:

    Q98890 HOWTO: Debugging a service

  2. Invoke the CGI application from a browser.
  3. Once the application error dialog box displays on the server click Cancel to start debugging.

    You can debug a CGI application running under any account with this approach. The DACLs for the interactive window station and desktop objects can be reset by logging off and then logging on again.



REFERENCES

For additional information, please click the article number(s) below to view the article(s) in the Microsoft Knowledge Base:

Q98890 HOWTO: Debugging a service

Q238788 HOWTO: Debug CGI applications running under IIS

Additional query words:

Keywords : kbOSWinNT400 kbOSWinNT400sp4 kbGrpDSInetServer kbDSupport kbhowto
Issue type : kbhowto
Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTW400sp4 kbWinNTSsearch kbWinNTS400sp4 kbWinNTS400xsearch kbWinNTS400


Last Reviewed: October 26, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.