IWDFFile3::GetInitiatorProcessId method

The GetInitiatorProcessId method retrieves the initiator process ID associated with an IWDFFile interface.

Syntax


void GetInitiatorProcessId(
  [out]  DWORD *pdwProcessId
);

Parameters

pdwProcessId [out]

Specifies the address of a location that receives the initiator process identifier associated with the file, if any exists. Otherwise, the location receives 0.

Return value

This method does not return a value.

Remarks

Starting in Windows 8, a system component may issue a create on behalf of a Windows Store app. The driver can call GetInitiatorProcessId to determine which process the create operation is ultimately intended for.

GetInitiatorProcessId returns zero if no initiator process is associated with the create operation.

For more information about framework file objects, see Driver-Created Versus Application-Created File Objects.

Examples


VOID
STDMETHODCALLTYPE
CMyQueue::OnCreateFile(
    __in IWDFIoQueue *pWdfQueue,
    __in IWDFIoRequest *pWdfRequest,
    __in IWDFFile*  pWdfFileObject
    )
 ...
    IWDFFile3*  pWdfFileObject3 = NULL;
    HRESULT  hr = S_OK;
    DWORD initiatorProcessId;

    //
    // Obtain IWDFFile3 interface from IWDFFile.
    //
    hr = pWdfFileObject->QueryInterface(IID_PPV_ARGS(&pWdfFileObject3));
    if (!SUCCEEDED(hr))
    {
        goto Done;
    }
    pWdfFileObject3->GetInitiatorProcessId(&initiatorProcessId);
    ...



Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.11

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFFile3

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft