Bewerken

Delen via


IWDFRemoteTarget::Reopen method (wudfddi.h)

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

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

Syntax

HRESULT Reopen();

Return value

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

Return code Description
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

Requirement Value
End of support Unavailable in UMDF 2.0 and later.
Target Platform Desktop
Minimum UMDF version 1.9
Header wudfddi.h (include Wudfddi.h)
DLL WUDFx.dll

See also

IWDFRemoteTarget

IWDFRemoteTarget::Close