/// <summary> /// Returns the available memory sources. /// </summary> /// <returns>List of memory source names</returns> public static List <string> GetMemorySources() { // // Create a new struct // var structure = new MemorySource(); // // Get the memory sources // GetMemorySourcesExport(ref structure); // // Convert the pointers to strings and return the list // return((from pointer in structure.MemorySources where pointer != IntPtr.Zero select Marshal.PtrToStringAnsi(pointer)?.Split('|')[0]).ToList()); }
protected static extern void GetMemorySourcesExport([In][Out] ref MemorySource structure);