Post · 2 min read· pp. 1271–1272

ETW_QUEUE_ENTRY

Each ETW_QUEUE_ENTRY structure supports the delivery of a notification to one user-mode registration of an event provider.

Documentation Status

The ETW_QUEUE_ENTRY structure is not documented.

Layout

Though the ETW_QUEUE_ENTRY is very much an implementation detail of the kernel’s own bookkeeping, it has not changed much. The following changes of size are known:

VersionsSize (x86)Size (x64)
6.0 to 6.10x180x28
6.2 to 10.00x200x38

The preceding sizes, and the offsets, types and names in the table below are from Microsoft’s public symbol files for the kernel, starting with Windows 8. Since symbol files for earlier versions do not contain type information for the ETW_QUEUE_ENTRY, what’s shown for them is instead inferred from what use these versions of the kernel are seen to make of the structure in comparison with those for which Microsoft’s names and types are known. Where the correspondence is close, it seems reasonable to infer continuity.

Offset (x86)Offset (x64)DefinitionVersions
0x000x00LIST_ENTRY ListEntry;6.0 and higher
0x080x10ETWP_NOTIFICATION_HEADER *DataBlock;6.0 and higher
0x0C0x18ETW_REG_ENTRY *RegEntry;6.0 and higher
0x100x20ETW_REG_ENTRY *ReplyObject;6.2 and higher
0x140x28PVOID WakeReference;6.2 and higher
0x10 (6.0 to 6.1); 0x180x20 (6.0 to 6.1); 0x30ULONG RegIndex;6.0 to 6.1
USHORT RegIndex;6.2 and higher
0x14 (6.0 to 6.1); 0x1A0x24 (6.0 to 6.1); 0x32ULONG ReplyIndex;6.0 to 6.1
USHORT ReplyIndex;6.2 and higher
0x1C0x34ULONG Flags;6.2 and higher

The one notification may be sent to multiple registrations. All receive the same (referenced-counted) copy of the sending process’s data block but each transmission has its own ETW_QUEUE_ENTRY. The one process may have multiple notifications in progress. All the queue entries are kept in a double-linked list linked through the ListEntry. The queue itself is a LIST_ENTRY in an ETW_DATA_SOURCE structure whose address is kept as the EtwDataSource in the process’s EPROCESS.

The RegIndex is the system-wide 0-based Index of the notifyee ETW_REG_ENTRY, apparently included just for convenience. What the ReplyIndex indexes is the ReplySlot array in the notifyee ETW_REG_ENTRY. Before version 6.2, the indexed ReplySlot points to the reply object. The ReplyIndex is thus the queue entry’s access to the reply object. This access is reversed in later versions: the queue entry holds the reply object’s address and the indexed ReplySlot points to the queue entry.