diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-05-08 01:28:31 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-05-08 01:28:31 +1000 |
| commit | 8ef09f9fed656bacc3a25e790796e9f144a5fac8 (patch) | |
| tree | db940e9fe93eaf7cb226037d8d7ab1b1f6704c78 /Util.cs | |
| parent | 7984d2ecd4bdba7061429f98fdfae88f44f4a358 (diff) | |
v0.14av0.14a
Diffstat (limited to 'Util.cs')
| -rw-r--r-- | Util.cs | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +using System.Runtime.InteropServices; +using System.Security; + +namespace HyperBooru.PowerShell; + +internal static class Util { + internal static string ToInsecureString(this SecureString x) { + IntPtr rawString = IntPtr.Zero; + try { + rawString = Marshal.SecureStringToBSTR(x); + return Marshal.PtrToStringBSTR(rawString); + } finally { + if(rawString != IntPtr.Zero) + Marshal.FreeBSTR(rawString); + } + } +} |
