PtrToStringAnsi() public static method

public static PtrToStringAnsi ( IntPtr ptr, bool hasOwnership ) : string
ptr IntPtr
hasOwnership bool
return string
Exemplo n.º 1
0
        private void OnObjectName(IntPtr ptr, IntPtr arg)
        {
            var name = (OBJ_NAME)Marshal.PtrToStructure(ptr, typeof(OBJ_NAME));
            var str  = Native.PtrToStringAnsi(name.name, false);

            list.Add(str);
        }
Exemplo n.º 2
0
        private static void OnMemoryLeak(uint order, IntPtr file, int line, int num_bytes, IntPtr addr)
        {
            string filename;

            if (file != IntPtr.Zero)
            {
                filename = Native.PtrToStringAnsi(file, false);
            }
            else
            {
                filename = "<null>";
            }

            Console.WriteLine("[{0}] file: {1} line: {2} bytes: {3}", order, filename, line, num_bytes);
            leaked += num_bytes;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Calls BN_bn2hex()
 /// </summary>
 /// <returns></returns>
 public string ToHexString()
 {
     return(Native.PtrToStringAnsi(Native.BN_bn2hex(this.ptr), true));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Calls BN_bn2dec()
 /// </summary>
 /// <returns></returns>
 public string ToDecimalString()
 {
     return(Native.PtrToStringAnsi(Native.BN_bn2dec(this.ptr), true));
 }