IWDFDevice2::CreateRemoteTarget method
The CreateRemoteTarget method creates a remote target object that represents a remote I/O target.
Syntax
HRESULT CreateRemoteTarget( [in, optional] IUnknown *pCallbackInterface, [in, optional] IWDFObject *pParentObject, [out] IWDFRemoteTarget **ppRemoteTarget );
Parameters
- pCallbackInterface [in, optional]
-
A pointer to an optional, driver-supplied callback interface. The IUnknown::QueryInterface method of this interface must return a pointer to the driver's IRemoteTargetCallbackRemoval interface, if the driver supports that interface. This parameter is optional and can be NULL.
- pParentObject [in, optional]
-
A pointer to a framework object. If the driver provides this optional pointer, the specified object becomes the parent of the new remote target object. If this parameter is NULL, the device object that provides the IWDFDevice2 interface becomes the parent. The framework will delete the remote target object when it deletes the parent object.
- ppRemoteTarget [out]
-
A pointer to a location that receives a pointer to the IWDFRemoteTarget interface of the new remote target object.
Return value
CreateRemoteTarget returns S_OK if the operation succeeds. Otherwise, the method might return the following value:
Return code | Description |
---|---|
|
The framework's attempt to allocate memory failed. |
|
The pParentObject parameter did not specify the device object that provides the IWDFDevice2 interface or an object whose chain of parents leads to that object. |
This method might return one of the other values that Winerror.h contains.
Remarks
After your driver has called CreateRemoteTarget, the driver can open the remote target by calling either IWDFRemoteTarget::OpenRemoteInterface (to open a device interface) or IWDFRemoteTarget::OpenFileByName (to open a file).
If the driver uses the pParentObject parameter to specify a parent object, the parent object can be the device object that provides the IWDFDevice2 interface, or it can be any object whose chain of parents leads to that device object. The framework will delete the remote target object when it (or the driver) deletes the device object.
For more information about remote I/O targets, see Using I/O Targets in UMDF.
Examples
For code examples that use CreateRemoteTarget, see the code examples at IWDFDevice2::CreateRemoteInterface and IWDFRemoteTarget::OpenFileByName.
Requirements
End of support | Unavailable in UMDF 2.0 and later. |
---|---|
Minimum UMDF version | 1.9 |
Header |
|
DLL |
|
See also