Platform SDK: DLLs, Processes, and Threads |
You can use the following methods to debug your service.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
Create a subkey with the same name as your service (for example, MYSERV.EXE). To this subkey, add a value of type REG_SZ, named Debugger. Use the full path to the debugger as the string value. In the Services control panel applet, select your service, click Startup and check Allow Service to Interact with Desktop.
Note To debug the initialization code of an auto-start service, you will have to temporarily install and run the service as a demand-start service.