WTSFreeMemoryExA function

Frees memory that contains WTS_PROCESS_INFO_EX or WTS_SESSION_INFO_1 structures allocated by a Remote Desktop Services function.

Syntax

BOOL WTSFreeMemoryExA(
  WTS_TYPE_CLASS WTSTypeClass,
  PVOID          pMemory,
  ULONG          NumberOfEntries
);

Parameters

WTSTypeClass

A value of the WTS_TYPE_CLASS enumeration type that specifies the type of structures contained in the buffer referenced by the pMemory parameter.

pMemory

A pointer to the buffer to free.

NumberOfEntries

The number of elements in the buffer referenced by the pMemory parameter.

Return Value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call the GetLastError function.

Remarks

Several Remote Desktop Services functions allocate buffers to return information. To free buffers that contain WTS_PROCESS_INFO_EX or WTS_SESSION_INFO_1 structures, you must call the WTSFreeMemoryEx function. To free other buffers, you can call either the WTSFreeMemory function or the WTSFreeMemoryEx function.

Requirements

   
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Target Platform Windows
Header wtsapi32.h
Library Wtsapi32.lib
DLL Wtsapi32.dll

See Also

WTSEnumerateProcesses

WTSEnumerateProcessesEx

WTSEnumerateSessions

WTSFreeMemory

WTSQuerySessionInformation

WTSQueryUserConfig

WTS_PROCESS_INFO_EX

WTS_SESSION_INFO_1