Post · 3 min read· pp. 2517–2519

NTRTL_X.H

The public symbol file NTKRPAMP.PDB for the original release of Windows 10 tells that the kernel is built with the NTRTL_X.H header at

d:\th.public.fre\internal\minwin\priv_sdk\inc

and draws from it the type definitions that are shown in the table below.

The header NTRTL_X.H is not known in any Device Driver Kit (DDK) or Windows Driver Kit (WDK), but all the types that the kernel is known to pick up from NTRTL_X.H are defined in at least one of the standard headers that are included by the source code for almost all kernel-mode projects (even the HAL).

Line NumberTypeWDM.HNTDDK.HNTIFS.HNTOSP.H
129union _SLIST_HEADER10527190
1058enum _RTL_GENERIC_COMPARE_RESULTS1947
1181struct _RTL_BALANCED_LINKS2070
1198struct _RTL_AVL_TABLE2087
1611struct _RTL_SPLAY_LINKS2500
2270struct _RTL_DYNAMIC_HASH_TABLE_ENTRY3159
2303struct _RTL_DYNAMIC_HASH_TABLE_CONTEXT3192
2309struct _RTL_DYNAMIC_HASH_TABLE_ENUMERATOR3198
2318struct _RTL_DYNAMIC_HASH_TABLE3207
4810struct _COMPRESSED_DATA_INFO3065
5987struct _TIME_FIELDS12718
6501struct _RTL_BITMAP13054

Clues have abounded since version 3.10 that these standard headers are constructed from others. If NTRTL_X.H is among these others, then it is the first that is known to contribute to NTOSP.H. As far as can be seen from consistency in line numbering, the lines in NTDDK.H are extracted intact.

Anti-Trust Settlement Forensics

For the record, here are the many more types that Microsoft’s freely published URLMON.PDB reveals were accessible to the source code for URLMON.DLL from including this same NTRTL_X.H when building Internet Explorer for the original release of 32-bit Windows 10:

Line NumberType
257union _RTL_RUN_ONCE_INTERNAL
348unnamed struct for DUMMYRESERVEDSTRUCTNAME in unnamed union in struct _RTL_BARRIER
370union _RTL_ELEVATION_FLAGS
1047enum _TABLE_SEARCH_RESULT
1058enum _RTL_GENERIC_COMPARE_RESULTS
1181struct _RTL_BALANCED_LINKS
1198struct _RTL_AVL_TABLE
1611struct _RTL_SPLAY_LINKS
1985struct _RTL_GENERIC_TABLE
2270struct _RTL_DYNAMIC_HASH_TABLE_ENTRY
2303struct _RTL_DYNAMIC_HASH_TABLE_CONTEXT
2309struct _RTL_DYNAMIC_HASH_TABLE_ENUMERATOR
2318struct _RTL_DYNAMIC_HASH_TABLE
2660struct _RTL_HEAP_PARAMETERS
3067struct _RTL_QUERY_REGISTRY_TABLE
3334struct _RTL_LFG_RNG_STATE
4542struct _GENERATE_NAME_CONTEXT
4633struct _PREFIX_TABLE_ENTRY
4642struct _PREFIX_TABLE
4703struct _UNICODE_PREFIX_TABLE_ENTRY
4713struct _UNICODE_PREFIX_TABLE
4810struct _COMPRESSED_DATA_INFO
5987struct _TIME_FIELDS
6501struct _RTL_BITMAP
6689struct _RTL_BITMAP_RUN
7793struct _OSVERSIONINFOEX2A
7808struct _OSVERSIONINFOEX2W
7861struct _OSVERSIONINFOEXA
7874struct _OSVERSIONINFOEXW
8244struct _RTL_UMS_CONTEXT
8324struct _RTL_UMS_COMPLETION_LIST
8381struct _RTL_UMS_SCHEDULER_STARTUP_INFO
8529enum _APPCONTAINER_SID_TYPE

URLMON knows the _RTL_BARRIER structure from including WINNT.H, but what it gets from this is only a reduced definition. The _RTL_BARRIER in NTRTL_X.H has this same reduced definition nested two levels within as a member named DUMMYRESERVEDSTRUCTNAME. WINNT.H retains nothing of the nesting except for its (otherwise excessive) indentation.

The _RTL_RUN_ONCE_INTERNAL at line 257 is named _RTL_RUN_ONCE in other symbol files. It too has a reduced definition in WINNT.H. URLMON has both definitions, the one in NTRTL_X.H apparently being renamed by macro to avoid confusion. Further study may be worthwhile.