Open jozefizso opened 16 years ago
Comment from Wed, 05 Nov 2008 01:07:58 GMT
Should be this whole structure converted to System.Guid?
Comment from Wed, 05 Nov 2008 16:15:10 GMT
Yes it should. The tool attempts to map a set of native types into the corresponding managed type. It looks like GUID slipped through in this case.
Comment from Thu, 06 Nov 2008 16:21:58 GMT
Yes. The intention of this part of the tool is to not display a native type when there is a better equivalent managed type.
Issue from Mon, 13 Oct 2008 17:55:38 GMT
Originally opened at https://clrinterop.codeplex.com/workitem/2453
When converting a GUID, the interop assistant thinks that Data4 should be a string: [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet=System.Runtime.InteropServices.CharSet.Ansi)] public struct GUID { /// unsigned int public uint Data1;
} It’s really an array of bytes, and even calling System.Text.Encoding.Unicode.GetString(bytes) or System.Text.Encoding.ASCII.GetString(bytes) didn’t create the correct string. Changing the marshalling definition to an array of bytes worked: [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] internal byte[] Data4; This came from generating the definition for WINTRUST_BLOB_INFO from the SDK (by pasting it in.)