public static unsafe void ZeroFreeGlobalAllocUnicode(IntPtr s) { if (s == IntPtr.Zero) { return; } NativeMemory.Clear((void *)s, (nuint)string.wcslen((char *)s) * sizeof(char)); FreeHGlobal(s); }
public static unsafe void ZeroFreeCoTaskMemUTF8(IntPtr s) { if (s == IntPtr.Zero) { return; } NativeMemory.Clear((void *)s, (nuint)string.strlen((byte *)s)); FreeCoTaskMem(s); }
public static unsafe void ZeroFreeGlobalAllocAnsi(IntPtr s) { if (s == IntPtr.Zero) { return; } NativeMemory.Clear((void *)s, (nuint)string.strlen((byte *)s)); FreeHGlobal(s); }
public static unsafe void ZeroFreeBSTR(IntPtr s) { if (s == IntPtr.Zero) { return; } NativeMemory.Clear((void *)s, SysStringByteLen(s)); FreeBSTR(s); }