Obtaining a Provider and Class GUID

To obtain a provider GUID or event trace class GUIDs, you can use the Uuidgen.exe or Guidgen.exe tool.

If you use the Uuidgen.exe tool, use the -d option to create a DEFINE_GUID C macro, as shown in the following example. For information about using the Uuidgen.exe tool, use the -? option. If you use the DEFINE_GUID C macro to define your GUID, you must include #define INITGUID before your GUID definitions, as shown in the following example.

#define INITGUID

DEFINE_GUID (
  ProviderGuid,
  0xf4dc272d, 
  0x88dd, 
  0x4472, 
  0xa3, 0xb1, 0xcb, 0x6d, 0xa4, 0x86, 0xf0, 0xbe
  );

The Microsoft Windows Software Development Kit (SDK) and Microsoft Visual Studio include the Guidgen.exe tool. The Guidgen.exe tool has a user interface that lets you select from several formats. You should use the format that creates a static constant GUID, as shown in the following example.

// {7C214FB1-9CAC-4b8d-BAED-7BF48BF63BB3}
static const GUID ProviderGuid = 
{ 0x7c214fb1, 0x9cac, 0x4b8d, { 0xba, 0xed, 0x7b, 0xf4, 0x8b, 0xf6, 0x3b, 0xb3 } };