diff --git a/Core/InteropServices/SafeCoTaskMemHandle.cs b/Core/InteropServices/SafeCoTaskMemHandle.cs index 07e5e402..affc40c3 100644 --- a/Core/InteropServices/SafeCoTaskMemHandle.cs +++ b/Core/InteropServices/SafeCoTaskMemHandle.cs @@ -29,6 +29,10 @@ namespace Vanara.InteropServices public Action FreeSecureStringUni => Marshal.ZeroFreeCoTaskMemUnicode; /// Gets the Ansi free method. public Action FreeSecureStringAnsi => Marshal.ZeroFreeCoTaskMemAnsi; + + + /// Static instance to methods. + public static IMemoryMethods Instance { get; } = new CoTaskMemoryMethods(); } /// A for memory allocated via COM. diff --git a/Core/InteropServices/SafeHGlobalHandle.cs b/Core/InteropServices/SafeHGlobalHandle.cs index 4cf7625d..2e1660ee 100644 --- a/Core/InteropServices/SafeHGlobalHandle.cs +++ b/Core/InteropServices/SafeHGlobalHandle.cs @@ -29,6 +29,9 @@ namespace Vanara.InteropServices public Action FreeSecureStringUni => Marshal.ZeroFreeGlobalAllocUnicode; /// Gets the Ansi free method. public Action FreeSecureStringAnsi => Marshal.ZeroFreeGlobalAllocAnsi; + + /// Static instance to methods. + public static IMemoryMethods Instance { get; } = new HGlobalMemoryMethods(); } /// A for memory allocated via LocalAlloc.