IWDFDevice2::CreateRemoteTarget 方法

The CreateRemoteTarget method creates a remote target object that represents a remote I/O target.

语法

HRESULT CreateRemoteTarget(
  [in, optional]  IUnknown *pCallbackInterface,
  [in, optional]  IWDFObject *pParentObject,
  [out]           IWDFRemoteTarget **ppRemoteTarget
);

参数

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.

返回值

CreateRemoteTarget returns S_OK if the operation succeeds. Otherwise, the method might return the following value:

返回代码说明
E_OUTOFMEMORY

The framework's attempt to allocate memory failed.

HRESULT_FROM_WIN32 (ERROR_INVALID_PARAMETER)

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.

评论

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.

示例

For code examples that use CreateRemoteTarget, see the code examples at IWDFDevice2::CreateRemoteInterface and IWDFRemoteTarget::OpenFileByName.

要求

版本

Available in UMDF versions 1.9 and later.

标头

Wudfddi.h (包括Wudfddi.h)

另请参见

IWDFRemoteTarget::OpenFileByName
IWDFRemoteTarget::OpenRemoteInterface

 

 

社区附加资源

添加
显示:
© 2015 Microsoft