November 13th, 2023

What is the difference between UuidToString, StringFromCLSID, StringFromIID, and StringFromGUID2?

This is the counterpart article to What’s the difference between UuidFromString, IIDFromString, CLSIDFromString, GUIDFromString….

Here’s the table:

Function Output
Buffer management Character set support
Uuid­To­String xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Free with Rpc­String­Free ANSI and Unicode
String­From­IID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Free with Co­Task­Mem­Free Unicode only
String­From­CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Free with Co­Task­Mem­Free Unicode only
String­From­GUID2 {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Provided by caller Unicode only

Since the size of a stringized GUID/UUID/IID is fixed, String­From­GUID2 is probably the most convenient function to use, since you can just have it generate the string into its final destination.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

2 comments

Discussion is closed. Login to edit/delete existing comments.

  • Solomon Ucko

    What’s the difference between

    String­From­IID

    and

    String­From­CLSID

    ?

  • Neil Rashbrook · Edited

    (The atom feed contains a leading newline, which makes the XML invalid.)

    (Edit: Since fixed, thank you!)