Please enable JavaScript to view this site.

Memory Validator Help

Navigation: Examples

Example Application Launched from a Service

Scroll Prev Top Next More


The example Application launched from a Service


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 Memory Validator into the application.


Loads the Memory Validator stub DLL into the application


Configures the NT Service API to communicate to Memory Validator


Does some work that can be monitored by Memory Validator





Implementation Details


For implementation details see attachToMemoryValidator(); in serviceChildProcess.cpp.


The application will need to link to the NT Service API, for example ..\..\..\svlMVStubService\release_2010_x64\svlMVStubService_x64.lib (for a release x64 EXE/DLL).


Important. Call attachToMemoryValidator() as close to the start of your application as possible, before any threads have been created.



seeAlsoRead more about working with NT Services.