private static object MarshalToString(PropertyDataPointerInfo propInfo) { string text = Marshal.PtrToStringAuto(propInfo.Ptr).ToString(); Marshal.FreeHGlobal(propInfo.Ptr); return(text.ToString()); }
private static IEnumerable <int> MarshalToIntArray(PropertyDataPointerInfo propInfo) { int numResults = propInfo.SizeInBytes / Marshal.SizeOf(typeof(int)); int[] results = new int[numResults]; Marshal.Copy(propInfo.Ptr, results, 0, numResults); Marshal.FreeHGlobal(propInfo.Ptr); return(results); }