Skip to content

Latest commit

 

History

History
99 lines (78 loc) · 4.1 KB

nf-wudfddi-iwdffile2-getrelatedfileobject.md

File metadata and controls

99 lines (78 loc) · 4.1 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:wudfddi.IWDFFile2.GetRelatedFileObject
IWDFFile2::GetRelatedFileObject (wudfddi.h)
The GetRelatedFileObject method retrieves the IWDFFile interface of a related file object, which is a file object that has a technology-specific relationship with another file object.
wdf\iwdffile2_getrelatedfileobject.htm
wdf
02/26/2018
IWDFFile2::GetRelatedFileObject
GetRelatedFileObject, GetRelatedFileObject method, GetRelatedFileObject method,IWDFFile2 interface, IWDFFile2 interface,GetRelatedFileObject method, IWDFFile2.GetRelatedFileObject, IWDFFile2::GetRelatedFileObject, UMDFFileObjectRef_f65433dc-ba63-456e-beff-ef7c9e2dffa8.xml, umdf.iwdffile2_getrelatedfileobject, wdf.iwdffile2_getrelatedfileobject, wudfddi/IWDFFile2::GetRelatedFileObject
wudfddi.h
Wudfddi.h
Desktop
1.9
Unavailable in UMDF 2.0 and later.
WUDFx.dll
Windows
IWDFFile2::GetRelatedFileObject
wudfddi/IWDFFile2::GetRelatedFileObject
APIRef
kbSyntax
COM
WUDFx.dll
IWDFFile2::GetRelatedFileObject

IWDFFile2::GetRelatedFileObject

-description

[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 GetRelatedFileObject method retrieves the IWDFFile interface of a related file object, which is a file object that has a technology-specific relationship with another file object.

-parameters

-param ppRelatedFileObj [out]

The address of a location that receives a pointer to the IWDFFile interface of a UMDF file object. This file object is related to the file object that exposes the IWDFFile2 interface's parent IWDFFile interface.

-remarks

Use of related file objects is technology-specific. For example, kernel streaming uses related file objects to represent the parent filters of child pins.

For more information about related file objects, see the GetRelatedFileObject member of the kernel-mode FILE_OBJECT structure.

Examples

The following code example retrieves the IWDFFile interface of a related file object, from the IWDFFile interface that a driver's IQueueCallbackCreate::OnCreateFile callback function receives.

VOID
STDMETHODCALLTYPE
CMyQueue::OnCreateFile(
    __in IWDFIoQueue *pWdfQueue,
    __in IWDFIoRequest *pWdfRequest,
    __in IWDFFile*  pWdfFileObject
    )
 ...
    IWDFFile*  pWdfRelatedFileObject = NULL;
    IWDFFile2*  pWdfFileObject2 = NULL;
    HRESULT  hr = S_OK;

    //
    // Obtain IWDFFile2 interface from IWDFFile.
    //
    hr = pWdfFileObject->QueryInterface(IID_PPV_ARGS(&pWdfFileObject2));
    if (!SUCCEEDED(hr))
    {
        goto Done;
    }
    pWdfFileObject2->GetRelatedFileObject(&pWdfRelatedFileObject);
    ...

-see-also

IWDFFile2