https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170738&feed=atom&action=history
Microsoft KB Archive/170738 - Revision history
2024-03-28T12:44:56Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170738&diff=342853&oldid=prev
X010: Text replacement - """ to """
2020-07-21T10:04:53Z
<p>Text replacement - """ to """</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:04, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l78">Line 78:</td>
<td colspan="2" class="diff-lineno">Line 78:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </pre></li></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </pre></li></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><li>Create a subkey with the name of your Service executable (for example, Myservice.exe)</li></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><li>Create a subkey with the name of your Service executable (for example, Myservice.exe)</li></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><li>To this subkey, add the REG_SZ value called Debugger and the full path to the debugger you want to use, but omit the <del style="font-weight: bold; text-decoration: none;">&quot;</del>.exe<del style="font-weight: bold; text-decoration: none;">&quot; </del>extension. You can add any command-line option for the debugger as well.</li></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><li>To this subkey, add the REG_SZ value called Debugger and the full path to the debugger you want to use, but omit the <ins style="font-weight: bold; text-decoration: none;">"</ins>.exe<ins style="font-weight: bold; text-decoration: none;">" </ins>extension. You can add any command-line option for the debugger as well.</li></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><li>Close Registry Editor.</li></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><li>Close Registry Editor.</li></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><li>Start the Service.<br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><li>Start the Service.<br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''NOTE''': The service must run as Local System and have <del style="font-weight: bold; text-decoration: none;">&quot;</del>Interact with Desktop<del style="font-weight: bold; text-decoration: none;">&quot; </del>enabled in order for the debugger to show up on the default desktop. For example:</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''NOTE''': The service must run as Local System and have <ins style="font-weight: bold; text-decoration: none;">"</ins>Interact with Desktop<ins style="font-weight: bold; text-decoration: none;">" </ins>enabled in order for the debugger to show up on the default desktop. For example:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div class="indent"></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div class="indent"></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\yourapp.exe <del style="font-weight: bold; text-decoration: none;">&quot;</del>Debugger<del style="font-weight: bold; text-decoration: none;">&quot;</del>=<del style="font-weight: bold; text-decoration: none;">&quot;</del>C:\windbg -g<del style="font-weight: bold; text-decoration: none;">&quot;</del></p></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\yourapp.exe <ins style="font-weight: bold; text-decoration: none;">"</ins>Debugger<ins style="font-weight: bold; text-decoration: none;">"</ins>=<ins style="font-weight: bold; text-decoration: none;">"</ins>C:\windbg -g<ins style="font-weight: bold; text-decoration: none;">"</ins></p></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></li></ol></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></li></ol></div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170738&diff=90015&oldid=prev
3155ffGd: importing KB archive
2020-07-18T15:35:24Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB170738"></span>Debugging a Windows NT Service =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 170738<br />
<br />
Article Last Modified on 2/27/2007<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft Windows 2000 Server<br />
* Microsoft Windows 2000 Advanced Server<br />
* Microsoft Windows 2000 Professional Edition<br />
* Microsoft Windows 2000 Datacenter Server<br />
* Microsoft Windows NT Workstation 4.0 Developer Edition<br />
* Microsoft Windows NT Server 4.0 Standard Edition<br />
<br />
<br />
-----<br />
<br />
<div class="notice_section"><br />
<br />
This article was previously published under Q170738<br />
<br />
</div><br />
<div class="notice_section"><br />
<br />
'''IMPORTANT''': This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:<br />
<div class="indent"><br />
<br />
[[../256986|256986]] Description of the Microsoft Windows Registry<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div class="summary_section"><br />
<br />
== SUMMARY ==<br />
<br />
Debugging a Windows NT service can be done in several ways. You can debug a service while it is running by attaching to the process ID of the Service through a debugger such as NTSD or WINDBG. You can also set Windows NT so that it will start the process in a debugger when you start the service.<br /><br />
<br /><br />
These techniques are useful for different debug scenarios. This article discusses the steps that you need to take when you want to debug a service during the initialization.<br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
'''WARNING''': If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.<br /><br />
<br /><br />
In order to set up Windows NT so that it will start the Service in a debugger, the following registry key needs to be set during the Service initialization:<br />
<ol><br />
<li><p>Start Registry Editor and locate the following Registry subkey in the HKEY_LOCAL_MACHINE subtree:</p><br />
<pre class="fixed_text"> SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution<br />
Options<br />
</pre></li><br />
<li>Create a subkey with the name of your Service executable (for example, Myservice.exe)</li><br />
<li>To this subkey, add the REG_SZ value called Debugger and the full path to the debugger you want to use, but omit the &quot;.exe&quot; extension. You can add any command-line option for the debugger as well.</li><br />
<li>Close Registry Editor.</li><br />
<li>Start the Service.<br /><br />
<br /><br />
'''NOTE''': The service must run as Local System and have &quot;Interact with Desktop&quot; enabled in order for the debugger to show up on the default desktop. For example:<br />
<div class="indent"><br />
<br />
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\yourapp.exe &quot;Debugger&quot;=&quot;C:\windbg -g&quot;</p><br />
<br />
</div></li></ol><br />
<br />
The debugger will start when the image for the Service executable is loaded into memory.<br /><br />
<br /><br />
For additional information about Windows NT debuggers, click the article number below to view the article in the Microsoft Knowledge Base:<br />
<div class="indent"><br />
<br />
[[../121434|121434]] Specifying the Debugger for Unhandled User Mode Exceptions<br />
<br />
<br />
</div><br />
<br />
</div><br />
Keywords: kbhowto KB170738<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd