Export (0) Print
Expand All

Marshal::ZeroFreeGlobalAllocAnsi Method

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

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

public:
static void ZeroFreeGlobalAllocAnsi(
	IntPtr s
)

Parameters

s
Type: System::IntPtr

The address of the unmanaged string to free.

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

The following example uses the SecureStringToGlobalAllocAnsi method to marshal and decrypt the contents of a SecureString object to a block of unmanaged memory. It then uses the ZeroFreeGlobalAllocAnsi method to zero out and dispose the unmanaged block.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

  • SecurityCriticalAttribute 

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

Show:
© 2015 Microsoft