IWDFRemoteTarget::Reopen method

The Reopen method reopens a remote I/O target after it has been temporarily closed.

Syntax


HRESULT Reopen();

Parameters

This method has no parameters.

Return value

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

Return codeDescription
E_OUTOFMEMORY

The framework's attempt to allocate memory failed.

 

This method might return one of the other values that Winerror.h contains.

The framework's verifier reports an error if the framework cannot open the file.

Remarks

Typically, a driver calls Reopen from within the IRemoteTargetCallbackRemoval::OnRemoteTargetRemoveCanceled callback function, but Reopen can instead be called after OnRemoteTargetRemoveCanceled returns.

Reopen uses the file or interface name that the driver previously specified to IWDFRemoteTarget::OpenFileByName or IWDFRemoteTarget::OpenRemoteInterface. If you want to change the file or interface that the driver is using, the driver can call IWDFRemoteTarget::Close, and then it can call OpenFileByName or OpenRemoteInterface instead of Reopen.

For more information about Reopen and how to use remote I/O targets in UMDF-based drivers, see Controlling a General I/O Target's State in UMDF.

Examples

The following code example shows an IRemoteTargetCallbackRemoval::OnRemoteTargetRemoveCanceled callback function that calls Reopen.


VOID 
STDMETHODCALLTYPE
CMyRemoteTarget::OnRemoteTargetRemoveCanceled(
    __in IWDFRemoteTarget* FxTarget
    )
{
 if (S_OK == (FxTarget->Reopen()))
    {
    //
    // Resume sending I/O requests to the remote target.
    //
    ...
    }
 else
    {
       FxTarget->Close();
    }
}

Requirements

Target platform

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.9

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFRemoteTarget
IWDFRemoteTarget::Close

 

 

Send comments about this topic to Microsoft

Show: