IDeviceAgentTransport::RegisterShutdownCallback
Registers a callback to receive notification before the agent is shut down.
HRESULT RegisterShutdownCallback([in] IAgentTransportShutdownCallback *in_pCallback, [in] IUnknown *in_pUnknown)
Parameters
in_pCallback
The object to receive shutdown notification. The object must implement IAgentTransportShutdownCallback.in_pUnknown
Interface cookie to be passed as a parameter to the callback routine.
Return Value
An HRESULT value that indicates the outcome of the method call.
Remarks
An agent will be shut down either when the desktop makes an explicit shutdown or when conmanclient2.exe is shutdown by running clientshutdown.exe. A device agent can request to receive shutdown notification to perform cleanup and exit gracefully. In order to receive shutdown notification, the device agent must define a class that implements IAgentTransportShutdownCallback and then register it using this method.
Example
This example registers a custom shutdown callback object with the device agent. For the complete example, see IDeviceAgentTransport.
Managed Equivalent
IDeviceAgentTransport..::.RegisterShutdownCallback
Requirements
DeviceAgentTransport.h