示例#1
0
文件: marshal.cs 项目: ydunk/masters
 public static String PtrToStringAuto(IntPtr ptr)
 {
     if (Win32Native.NULL == ptr)
     {
         return(null);
     }
     else if (IsWin32Atom(ptr))
     {
         return(null);
     }
     else
     {
         int           nc = Win32Native.lstrlen(ptr);
         StringBuilder sb = new StringBuilder(nc);
         Win32Native.lstrcpy(sb, ptr);
         return(sb.ToString());
     }
 }