Created
June 23, 2019 15:50
-
-
Save EgorBo/58e5a3a9e841d362cc41e21e75ecae58 to your computer and use it in GitHub Desktop.
sb-marshalling-repro.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace ConsoleApp162 | |
{ | |
class Program | |
{ | |
[DllImport("user32.dll", CharSet = CharSet.Unicode)] | |
static extern uint CharLowerBuffW([In, Out] StringBuilder lpsz, uint cchLength); | |
static void Main() | |
{ | |
var sb = new StringBuilder().AppendLine("HELLO").AppendLine("WORLD").AppendLine("FROM MONO"); | |
CharLowerBuffW(sb, (uint)sb.Length); | |
Console.WriteLine(sb); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment