Using ADLX in a system service application
While ADLX cannot be used directly in a system service application, its functionality can be accessed in a system service application through a user mode process. A communication mechanism between the user mode process and the system service, such as shared memory, will provide the ADLX functionality to the system service.
To use ADLX in a system service,
-
Create a system service application.
Note: For more information on how to create a system service in C++, see ServiceCall C++ sample . For more information on how to create a system service in C, see ServiceCall C sample .
-
In the system service, start a thread to complete the service work, such as ServiceWorkerThread.
-
On the ServiceWorkerThread, get the token of the current process to create a user process using CreateProcessAsUserW.
Note: For more information on how to create a user process into a service application in C++, see UserProcess C++ sample . For more information on how to create a user process into a service application in C, see UserProcess C sample .
-
In user mode, process load ADLX and implement the desired functionality.
-
In user mode, process implement a communication mechanism suitable for communicating with the system service – such as shared memory – and tie the ADLX data with the communication mechanism.
-
Run the user mode process and the service application.
For more information, see GPUServiceCall C++ samples and GPUServiceCall C samples .