Please enable JavaScript to view this site.

Memory Validator Help

Navigation: Examples > Example NT Service

Building the sample service utility

Scroll Prev Top Next More

 

The serviceMutex project demonstrates a way of controlling whether Memory Validator is used without having to rebuild your service.

 

Project files

 

The example project can be found in the examples\serviceMutex subdirectory in the directory where Memory Validator was installed.

 

If the directory is not present, reinstall your software and choose custom or full installation.

 

There are two project files in the directory:

 

serviceMutex.dsp instructionStep for Microsoft® Developer Studio® 6.0  
 

serviceMutex.vcproj instructionStep for Microsoft® Visual Studio / .net
 

 

Configurations

 

There are a small number of configurations in each project:

 

Debug / Release instructionStep dynamically links to the svlMVStubService(_x64).lib demonstrating use with the NT Service API  
 

 

Using the service utility

 

The utility provides a dialog box interface to allow the control over the creation of a mutex object with the name specified in the service.h header file.

 

Only if the service is started with the mutex created, does the service load Memory Validator.

 

serviceMutexUtility

 

If you don't like using mutexes in this way, you could change the code in the service and the utility to communicate through shared memory, a registry setting or another method of your choice.