summaryrefslogtreecommitdiff
path: root/src/vm/ilmarshalers.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-02-10Remove always defined FEATURE_CORECLRdanmosemsft1-129/+0
2016-12-04Fix several misspellings of exception and "a exception". (#8442)Jon Hanna1-1/+1
2016-07-07MarshalAs(UnManaged.ByValArray) overflow.Tijoy Tom Kalathiparambil1-9/+7
For non-blittable embedded array in structs we ignored the SizeConst and wrote past the buffer when number of elementsin the arrayis greater than SizeConst.Fix is to truncate the array at SizeConst MarshalAs(UnManaged.ByValTStr) Very subtle case when the SizeConst == Number of bytes required to marshal , we write the null one past the buffer.This happens only on machine with non-english (multi-byte) locale as default. Fix is to check the number of bytes required and truncate the correctly leaving space for the terminating null.
2016-05-06UTF8 Marshaling support(UnmanagedType.LPUTF8Str)Tijoy Tom Kalathiparambil1-0/+242
Usage: [MarshalAs(UnmanagedType.LPUTF8Str)] applied to string and stringbuilder. Implementation mostly use Encoding.UTF8 API to do the byte buffer to string roundtripping. Introducing two new marshalers, UTF8StringMarshaler and UTF8BufferMarshaler which handle string and StringBuilder respectively. [Out] StringBuilder marshaling use builder capacity as the buffer size ie (builder. Capacity + 1) *3 which is enough for any UTF8 char in BMP plane, infact Encoding.UTF8 mscorlib APIs use the same length.All marshaling flags(ThrowOnUnmapable, defaultchar) are ignored since they do not make sense in UTF16 to UTD8 context. The public contracts are not yet updated, the public contracts and public marshaling API (Marshal.PtrToStringUtf8 and StringToHGlobalUtf8) will be added once the implementation is in. The marshal api are anyway going to be a wrapper around Encoding.GetBytes and GetChars.
2016-01-27Update license headersdotnet-bot1-4/+3
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+6140
[tfs-changeset: 1407945]