Added static Instance properties to IMemoryMethods implementations

pull/60/head
David Hall 2019-04-08 11:42:16 -06:00
parent 180dc255d8
commit 51edbded7c
2 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,10 @@ namespace Vanara.InteropServices
public Action<IntPtr> FreeSecureStringUni => Marshal.ZeroFreeCoTaskMemUnicode;
/// <summary>Gets the Ansi <see cref="SecureString"/> free method.</summary>
public Action<IntPtr> FreeSecureStringAnsi => Marshal.ZeroFreeCoTaskMemAnsi;
/// <summary>Static instance to methods.</summary>
public static IMemoryMethods Instance { get; } = new CoTaskMemoryMethods();
}
/// <summary>A <see cref="SafeHandle"/> for memory allocated via COM.</summary>

View File

@ -29,6 +29,9 @@ namespace Vanara.InteropServices
public Action<IntPtr> FreeSecureStringUni => Marshal.ZeroFreeGlobalAllocUnicode;
/// <summary>Gets the Ansi <see cref="SecureString"/> free method.</summary>
public Action<IntPtr> FreeSecureStringAnsi => Marshal.ZeroFreeGlobalAllocAnsi;
/// <summary>Static instance to methods.</summary>
public static IMemoryMethods Instance { get; } = new HGlobalMemoryMethods();
}
/// <summary>A <see cref="SafeHandle"/> for memory allocated via LocalAlloc.</summary>