LsaFreeMemory Function

The LsaFreeMemory function frees memory allocated for an output buffer by an LSA function call. LSA functions that return variable-length output buffers always allocate the buffer on behalf of the caller. The caller must free this memory by passing the returned buffer pointer to LsaFreeMemory when the memory is no longer required.

Syntax

C++
NTSTATUS LsaFreeMemory(
  __in  PVOID Buffer
);

Parameters

Buffer [in]

Pointer to memory buffer that was allocated by an LSA function call. If LsaFreeMemory is successful, this buffer is freed.

Return Value

If the function succeeds, the return value is STATUS_SUCCESS.

If the function fails, the return value is an NTSTATUS code, which can be the following value or one of the LSA Policy Function Return Values.

Return codeDescription
STATUS_UNSUCCESSFUL

Memory could not be freed because it was not allocated by an LSA function call.

 

You can use the LsaNtStatusToWinError function to convert the NTSTATUS code to a Windows error code.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderNtsecapi.h
LibraryAdvapi32.lib
DLLAdvapi32.dll

See Also

LSA Policy Function Return Values
LsaNtStatusToWinError

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Community Content

dmex
vb.net syntax
<DllImport("advapi32.dll", SetLastError:=True)> _
Public Shared Function LsaFreeMemory(ByVal handle As IntPtr) As Integer
End Function
Tags : vb.net syntax

dmex
C# syntax
[DllImport("advapi32.dll", SetLastError=true)]
internal static extern int LsaFreeMemory(IntPtr handle);
Tags : c# syntax

Page view tracker