mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
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:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user