Windows Service Program debugging method-start direct into debug

Source: Internet
Author: User

Reference article:

1, http://www.abin.cn/?p=263

2, HTTPS://SUPPORT.MICROSOFT.COM/ZH-CN/KB/824344/ZH-CN

Step 1:
Method One: Use the WinDbg global flag to set the command Gflags.exe settings, the image file in the dialog box to set the name of the service to debug, debugger Select the path to set the debugger; (Note: I'm actually working on it, This place is set debugger when a write registry error occurs, uninstalling the 360 software solves the problem. )

Method Two: Use Registry Editor to open the registry path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options, Add a primary key, named the service name to be debugged, such as MyService.exe, and then create a new string value under the primary key, named "Debugger", with the value of the debugger path;

Step 2:

To set up the services to be debugged interact with the desktop:

  (1) Open "Administrative Tools", select "Services", open the Service Management window, select the name of the service ready to debug, right click to select "Properties", select "Login", tick "allow service to interact with desktop";
  
(2) Using Registry Editor, open the registry path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services \servicename (the service name to debug), select "Type", Modify its value to: the original value or 0x00000100 (if the original value is: 0x00000010 or 0x00000100 =0x00000110);

Step 3:

Set the service startup time-out (system defaults to 30 seconds), start Registry Editor, open the registry path: HKEY_LOCAL_MACHINE\System \currentcontrolset\control, new DWORD Value " ServicesPipeTimeout ", whose value is the time-out to set, such as setting 24 hours, the value is 86400000 milliseconds;
Step 4:

Start the service ready to debug, open "Administrative Tools", select "Services", open the Service Management window, select the name of the service ready for debugging, right click to select "Start"

Step 5:

After launching the Interactive Message service window will pop up, click "View Message" to go directly to the debugging;

Windows Service Program debugging method-start direct into debug

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.