Created
April 10, 2019 12:46
-
-
Save phraemer/57e61c0f9f82d19b9fb9ba4eaf941ddf to your computer and use it in GitHub Desktop.
Print CLSID as GUID string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
typedef unsigned long DWORD; | |
typedef unsigned short WORD; | |
typedef unsigned char BYTE; | |
struct GUID { | |
DWORD Data1; | |
WORD Data2; | |
WORD Data3; | |
BYTE Data4[8]; | |
}; | |
int main() | |
{ | |
GUID guid{ 0x177F0C4A, 0x1CD3, 0x4DE7, { 0xA3, 0x2C, 0x71, 0xDB, 0xBB, 0x9F, 0xA3, 0x6D } }; | |
printf("{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment