IWDFIoRequest3::RetrieveActivityId method

The RetrieveActivityId method retrieves the current activity identifier associated with an I/O request.

Syntax


HRESULT RetrieveActivityId(
  [out]  LPGUID ActivityId
);

Parameters

ActivityId [out]

A pointer to a location to store the retrieved GUID.

Return value

RetrieveActivityId returns returns S_OK if the call is successful. Otherwise, this method might return one of the following values.

Return codeDescription
HRESULT_FROM_WIN32 (ERROR_NOT_FOUND)

No activity ID is associated with the request.

 

Remarks

Requests reflected from kernel mode have an activity identifier available only if the Kernel Trace provider is enabled or if the UMDF driver called IWDFIoRequest3::SetActivityId after receiving the request. For more information about Event Tracing for Windows (ETW), see Event Tracing.

Requests initiated by the UMDF driver have an activity identifier available only if the UMDF driver previously called IWDFIoRequest3::SetActivityId.

The framework does not clear a request's activity identifier when the driver calls IWdfIoRequest2::Reuse.

For more information about activity identifiers, see Using Activity Identifiers.

The UMDF 2 equivalent of this method is WdfRequestRetrieveActivityId.

Examples

The following code example shows a driver can retrieve an activity identifier from one request and then use it to set the activity identifier for another request.


hrQI = pWdfRequest->QueryInterface(IID_PPV_ARGS(&pOriginalRequest3));
ASSERT(SUCCEEDED(hrQI));

hrQI = pNewRequest->QueryInterface(IID_PPV_ARGS(&pNewRequest3));
ASSERT(SUCCEEDED(hrQI));

//
// Obtain activity id from original request and set in the new one
//

pOriginalRequest3->RetrieveActivityId(&activityId);
pNewRequest3->SetActivityId(&activityId);

pOriginalRequest3->Release();
pNewRequest3->Release();



Requirements

Minimum support

Windows 8

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

IWDFIoRequest3
IWDFIoRequest3::SetActivityId

 

 

Send comments about this topic to Microsoft

Mostrar:
© 2014 Microsoft