ZeroFreeGlobalAllocUnicode Method
Collapse the table of content
Expand the table of content

Marshal::ZeroFreeGlobalAllocUnicode Method (IntPtr)


Frees an unmanaged string pointer that was allocated using the SecureStringToGlobalAllocUnicode method.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

static void ZeroFreeGlobalAllocUnicode(
	IntPtr s


Type: System::IntPtr

The address of the unmanaged string to free.

The ZeroFreeGlobalAllocUnicode method first zeros out and then frees unmanaged memory that was allocated using the SecureStringToGlobalAllocUnicode method.

The following example demonstrates how to use the SecureStringToGlobalAllocUnicode method with the unmanaged LogonUser function to perform impersonation with the SecureString class. The example then uses the ZeroFreeGlobalAllocUnicode method to zero out and free the unmanaged string reference.

No code example is currently available or this language may not be supported.

requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft