UEFI News and Commentary

Wednesday, August 15, 2012

HOW-TO: EFI_GUID vs. Registry GUID Format

Did you ever wonder how to translate a GUID in registry format (i.e. 7133e7ab-cc00-416a-84d3-2e84c583b14f) into an EFI_GUID structure initializer? Well, so did I, today. I'll give you the rule and then I'll teach you the simple way to remember:

Here is the original GUID format:

aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
Here's the translated version:

EFI_GUID gXGuid = \
  {0xaabbccdd, 0xeeff, 0xgghh, \
  {0xii, 0xjj, 0xkk, 0xll, 0xmm, 0xnn, 0xoo, 0xpp}};
Or, if you forget, the uuidgen utility has an option -S which displays like this:

INTERFACENAME = { /* 7133e7ab-cc00-416a-84d3-2e84c583b14f */
    0x7133e7ab,
    0xcc00,
    0x416a,
    {0x84, 0xd3, 0x2e, 0x84, 0xc5, 0x83, 0xb1, 0x4f}
  };


The registry GUID format is in the /* */ comment.

No comments: