Bewerken

Delen via


IWDFIoRequest3::RetrieveActivityId 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 RetrieveActivityId method retrieves the current activity identifier associated with an I/O request.

Syntax

HRESULT RetrieveActivityId(
  [out] LPGUID ActivityId
);

Parameters

[out] ActivityId

A pointer to a location to store the retrieved GUID.

Return value

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

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

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

See also

IWDFIoRequest3

IWDFIoRequest3::SetActivityId