(Guid guid)
| 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. |
no test coverage detected