Using ADLX in a Windows system service application
ADLX v1.4 and above can be used directly in a Windows system service application, providing access to limited ADLX functionality.
Refer to ADLX v1.3 and below if the Windows system service application requires ADLX functionality that is not available when ADLX runs in Session 0.
ADLX v1.4 and above
When ADLX v1.4 and above runs in a Windows system service application, the following functionality is available:
Note: When running in Session 0, ADLX cannot be initialized with an ADL context.
See Using ADLX in an ADL application for more information for initializing ADLX with an ADL context.
ADLX v1.3 and below
ADLX v1.3 and below cannot be used directly in a Windows system service application. However, ADLX functionality can be accessed in a system service application through a user mode process.
The functions are provided through a communication mechanism between the user mode process and the system service (such as shared memory).
To use ADLX v1.3 and below in a system service application,
-
Create a system service application.
-
For more information on how to create a system service application in C++, see ServiceCall C++ sample .
-
For more information on how to create a system service application in C, see ServiceCall C sample .
-
-
In the system service application, 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 usingCreateProcessAsUserW
.-
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 the user mode process, load ADLX and implement the desired functionality.
-
In the 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 .