This pair of projects create an application that is launched from a service.
The purpose of this example is to show how to monitor the application that is launched from the service. This is also the same process for monitoring an application launched by an application launched from a service.
This process is subtly different to the method for working with services (see the example service for that).
The service project is serviceWithAChildProcess.vcxproj
The following tasks are performed when the service is started:
•the test application is launched from the service
The application project is serviceChildProcess.vcxproj
The application's first task is to load Bug Validator into the application.
•Loads the Bug Validator stub DLL into the application
•Configures the NT Service API to communicate to Bug Validator
•Does some work that can be monitored by Bug Validator
•Exits
For implementation details see attachToBugValidator(); in serviceChildProcess.cpp.
The application will need to link to the NT Service API, for example ..\..\..\svlBVStubService\release_2010\svlBVStubService.lib (for a release EXE/DLL).
Important. Call attachToBugValidator() as close to the start of your application as possible, before any threads have been created.
Read more about working with NT Services.