Exemple #1
0
 /// <summary>Gets the array from an <see cref="IArrayStruct{T}"/> instance.</summary>
 /// <typeparam name="T">The type of the array.</typeparam>
 /// <param name="ias">The <see cref="IArrayStruct{T}"/> instance.</param>
 /// <returns>The array contained in the instance.</returns>
 public static T[] GetArray <T>(this IArrayStruct <T> ias) where T : struct
 {
     using var pin = new PinnedObject(ias);
     return(((IntPtr)pin).ToArray <T>((int)((IntPtr)pin).ToStructure <uint>(), sizeof(uint)));
 }
Exemple #2
0
 public PIDL GetFolderPIDL()
 {
     using (var pinned = new PinnedObject(this))
         return(new PIDL(((IntPtr)pinned).Offset(offsets[0]), true));
 }
Exemple #3
0
 /// <summary>Initializes a new instance of the <see cref="PIDL"/> class from an array of bytes.</summary>
 /// <param name="bytes">The bytes.</param>
 public PIDL(byte[] bytes)
 {
     using var p = new PinnedObject(bytes); SetHandle(IntILClone(p));
 }