You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Core/Extensions/InteropExtensions.cs
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -339,6 +339,33 @@ public static IntPtr MarshalToPtr<T>(this T value, Func<int, IntPtr> memAlloc, o
339
339
}
340
340
}
341
341
342
+
/// <summary>
343
+
/// Marshals data from a managed list of specified type to an unmanaged block of memory allocated by the <paramref name="memAlloc"/> method.
344
+
/// </summary>
345
+
/// <param name="items">
346
+
/// The array of items to marshal. If this is an array of strings, it will be marshaled as a concatenated list with default character encoding.
347
+
/// </param>
348
+
/// <param name="memAlloc">
349
+
/// The function that allocates the memory for the block of items (typically <see cref="Marshal.AllocCoTaskMem(int)"/> or <see cref="Marshal.AllocHGlobal(int)"/>.
350
+
/// </param>
351
+
/// <param name="bytesAllocated">The bytes allocated by the <paramref name="memAlloc"/> method.</param>
352
+
/// <param name="prefixBytes">Number of bytes preceding the trailing strings.</param>
353
+
/// <param name="memLock">
354
+
/// The function used to lock memory before assignment. If <see langword="null"/>, the result from <paramref name="memAlloc"/> will be used.
355
+
/// </param>
356
+
/// <param name="memUnlock">The optional function to unlock memory after assignment.</param>
357
+
/// <returns>Pointer to the allocated native (unmanaged) array of items stored.</returns>
358
+
/// <exception cref="ArgumentException">Structure layout is not sequential or explicit.</exception>
0 commit comments