IWDFFile2::GetRelatedFileObject method

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.

Syntax


void GetRelatedFileObject(
  [out]  IWDFFile **ppRelatedFileObj
);

Parameters

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.

Return value

None.

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);
    ...

Requirements

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

IWDFFile2

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft