MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / FromGuid

Method FromGuid

src/Squirrel/ShellFile.cs:73–83  ·  view source on GitHub ↗
(Guid guid)

Source from the content-addressed store, hash-verified

71 }
72
73 public static PropVariant FromGuid(Guid guid)
74 {
75 byte[] bytes = guid.ToByteArray();
76 var pv = new PropVariant() {
77 variantType = 72, // VT_CLSID
78 pointerValue = Marshal.AllocCoTaskMem(bytes.Length),
79 };
80 Marshal.Copy(bytes, 0, pv.pointerValue, bytes.Length);
81
82 return pv;
83 }
84
85 /// <summary>
86 /// Called to properly clean up the memory referenced by a PropVariant instance.

Callers 1

Calls 1

CopyMethod · 0.45

Tested by

no test coverage detected