Use Marshal.ZeroFreeCoTaskMemUnicode

This removes the ClrFacade function of the same name as this API is in
.NET Core 1.0 Marhsal class, not SecureStringMarshal.
This commit is contained in:
Andrew Schwartzmeyer committed 2016-06-27 15:30:47 -07:00
1 parent 8be714ff68
commit 2f892e8127
11 files changed
+14 -26

No files matched your search

@@ -160,7 +160,7 @@ namespace System.Management.Automation.SecurityAccountsManager.Extensions
#if CORECLR
IntPtr buffer = SecureStringMarshal.SecureStringToCoTaskMemUnicode(str);
string clear = Marshal.PtrToStringUni(buffer);
SecureStringMarshal.ZeroFreeCoTaskMemUnicode(buffer);
Marshal.ZeroFreeCoTaskMemUnicode(buffer);
#else
var bstr = Marshal.SecureStringToBSTR(str);
string clear = Marshal.PtrToStringAuto(bstr);
@@ -200,4 +200,4 @@ namespace System.Management.Automation.SecurityAccountsManager.Extensions
return ex.MakeErrorRecord(ex.ErrorName, ex.ErrorCategory, target ?? ex.Target);
}
}
}
}