In the System event log is an event with the following details:
Source: Kernel-General
Event ID: 1
Details: The system time has changed to 2010-07-17T02:58:20.285000000Z from 2010-07-17T02:58:20.285868600Z.
The EVENTLOGRECORD also has a 1 for the EventID field, so it matches what we see in the Event Log viewer.
So far so good.
The problem is, when you look in advapi32.dll which is where this source gets it's messages from, you see this:
ID:01000001
String: The system time has changed to %1 from %2.
How does the Event Log Viewer magically know to add those extra bits to the ID to find the right string? Not all event strings have that upper bit, and some have other upper bits set.
Calling FormatMessage with 1 fails. Calling it with x01000001 succeeds. But that's not what the event log record contains... :(
No docs that I can find discuss this at all (other that describing the ID format which shows error/severity/facility/code bits).