IoPropagateActivityIdToThread function (ntddk.h)
The IoPropagateActivityIdToThread routine associates the activity ID from an IRP with the current thread.
NTSTATUS IoPropagateActivityIdToThread( PIRP Irp, LPGUID PropagatedId, LPCGUID *OriginalId );
[in] The IRP whose ID will be propagated to the thread.
[out] A pointer to memory allocated by the caller to store the ID in the thread.
Upon successfully returning from the call, holds the ID that was previously set on the thread. The driver must call IoClearActivityIdThread with this pointer when tracing is completed within the same thread context.
IoPropagateActivityIdToThread returns STATUS_SUCCESS if the call is successful. Possible error return values include the following.
||The IRP does not have an ID associated with it.|
This routine should be used by drivers that are tracing aware and are issuing I/O on a worker thread. Note that such drivers must call IoClearActivityIdThread with the OriginalId before they return control from the thread, if the call was successful.
Drivers that use I/O work items do not need to call this routine because the I/O subsystem takes care of propagating activity IDs to threads in that case.
|Minimum supported client||Available starting with Windows 8.|
|Header||ntddk.h (include Ntddk.h)|