public static IntPtr AllocHGlobal(int cb) { // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/201505/20150503/udp var p = new CMalloc(cb); return((IntPtr)p); }
// https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/201505/20150503/udp // X:\jsc.svn\examples\java\hybrid\JVMCLRLoadLibrary\JVMCLRLoadLibrary\Program.cs public static IntPtr StringToHGlobalAnsi(string s) { if (s == null) { return((IntPtr)CPtr.NULL); } var bytes = (sbyte[])(object)Encoding.ASCII.GetBytes(s); var p = new CMalloc(bytes.Length + 1); p.copyIn(0, bytes, 0, bytes.Length); return((IntPtr)p); }
public static IntPtr AllocHGlobal(int cb) { var p = new CMalloc(cb); return((IntPtr)p); }