Post · 4 min read· pp. 2371–2373

CPER.H

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

d:\th.public.fre\sdk\inc

and draws from it the type definitions that are tablulated below.

Nowadays, CPER.H is among the headers in the Software Development Kit (SDK) for Windows 10. It is there in the “um” subdirectory with many other headers that are intended only for user-mode programming. It dates from Windows 7, again in the SDK. CPER.H seems never to have been supplied with a Windows Driver Kit (WDK) except in bundles with the SDK. All its significant content is anyway duplicated in NTDDK.H and in NTOSP.H, but no sign is known of how this happens.

NTDDK.H is, of course, a standard header for kernel-mode programming, and NTOSP.H is similar but for Microsoft’s private use (notwithstanding its disclosure in two early editions of the WDK for Windows 10). The kernel’s own source code does not #include either NTDDK.H or NTOSP.H. Of the definitions that these headers share with CPER.H, those that the kernel’s public symbols files also report for the kernel are there from including CPER.H.

Since CPER.H is published, it is readily seen that the user-defined types that the kernel’s public symbol files attribute to CPER.H are not all that are defined in CPER.H. Indeed, they are barely a quarter. In the table below, the line numbers on the left are from CPER.H as supplied with the SDK for the original Windows 10. Line numbers for types that don’t show in the public symbols are in parentheses. The line numbers on the right are from the NTDDK.H and NTOSP.H in the contemporaneous WDK.

Line NumberTypeNTDDK.HNTOSP.H
134union _WHEA_REVISION1468849605
142enum _WHEA_ERROR_SEVERITY1469649613
149union _WHEA_TIMESTAMP1470349620
164union _WHEA_PERSISTENCE_INFO1471849635
195union _WHEA_ERROR_STATUS1474949666
213union _WHEA_ERROR_RECORD_HEADER_VALIDBITS1476749684
227union _WHEA_ERROR_RECORD_HEADER_FLAGS1478149698
241struct _WHEA_ERROR_RECORD_HEADER1479549712
296union _WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_FLAGS1485049767
317union _WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_VALIDBITS1487149788
327struct _WHEA_ERROR_RECORD_SECTION_DESCRIPTOR1488149798
367struct _WHEA_ERROR_RECORD1492149838
(406)union _WHEA_PROCESSOR_FAMILY_INFO1496049877
(421)union _WHEA_PROCESSOR_GENERIC_ERROR_SECTION_VALIDBITS1497549892
(442)struct _WHEA_PROCESSOR_GENERIC_ERROR_SECTION1499649913
(516)union _WHEA_XPF_CACHE_CHECK1507049987
(558)union _WHEA_XPF_TLB_CHECK1511250029
(609)union _WHEA_XPF_BUS_CHECK1516350080
(651)union _WHEA_XPF_MS_CHECK1520550122
(676)union _WHEA_XPF_PROCINFO_VALIDBITS1523050147
(688)struct _WHEA_XPF_PROCINFO1524250159
(708)struct _WHEA_X86_REGISTER_STATE1526250179
(736)struct _WHEA128A1529050207
(748)struct _WHEA_X64_REGISTER_STATE1530250219
(801)struct _WHEA_XPF_CONTEXT_INFO1535550272
(817)union _WHEA_XPF_PROCESSOR_ERROR_SECTION_VALIDBITS1537150288
(829)struct _WHEA_XPF_PROCESSOR_ERROR_SECTION1538350300
943union _WHEA_MEMORY_ERROR_SECTION_VALIDBITS1549750414
980struct _WHEA_MEMORY_ERROR_SECTION1553450451
(1037)union _WHEA_PCIEXPRESS_ERROR_SECTION_VALIDBITS1559150508
(1053)struct _WHEA_PCIEXPRESS_DEVICE_ID1560750524
(1067)union _WHEA_PCIEXPRESS_VERSION1562150538
(1076)union _WHEA_PCIEXPRESS_COMMAND_STATUS1563050547
(1084)union _WHEA_PCIEXPRESS_BRIDGE_CONTROL_STATUS1563850555
(1093)enum _WHEA_PCIEXPRESS_DEVICE_TYPE1564750564
(1105)struct _WHEA_PCIEXPRESS_ERROR_SECTION1565950576
(1156)union _WHEA_PCIXBUS_ERROR_SECTION_VALIDBITS1571050627
(1172)union _WHEA_PCIXBUS_ID1572650643
(1180)union _WHEA_PCIXBUS_COMMAND1573450651
(1189)struct _WHEA_PCIXBUS_ERROR_SECTION1574350660
(1228)union _WHEA_PCIXDEVICE_ERROR_SECTION_VALIDBITS1578250669
(1241)struct _WHEA_PCIXDEVICE_ID1579550712
(1253)struct WHEA_PCIXDEVICE_REGISTER_PAIR1580750724
(1258)struct _WHEA_PCIXDEVICE_ERROR_SECTION1581250729
(1288)struct _WHEA_FIRMWARE_ERROR_RECORD_REFERENCE1584250759
(1314)union _MCG_STATUS1586850785
(1325)union _MCI_STATUS1587950796
(1343)enum _WHEA_CPU_VENDOR1589750814
(1352)struct _WHEA_XPF_MCA_SECTION1590650823
(1370)union _WHEA_NMI_ERROR_SECTION_FLAGS1592450841
(1378)struct _WHEA_NMI_ERROR_SECTION1593250849

For the record, lines 41 to 1384 inclusive of the 1391-line CPER.H are duplicated as lines 14595 to 15938 of NTDDK.H and 49512 to 50855 of NTOSP.H. In both these standard headers, the definitions they share with CPER.H immediately follow those from WHEADEF.H. The difference apparently doesn’t matter but when building the kernel—or, to be precise, when compiling the separate source file ntsym.c for merging type information into the kernel’s public symbols—the CPER.H definitions come first.