Platform SDK: Active Directory, ADSI, and Directory Services |
The FreeADsMem function frees the memory previously allocated by AllocADsMem.
BOOL FreeADsMem( LPVOID pMem );
The function returns FALSE if the memory is not allocated by AllocADsMem. Otherwise, it return TRUE.
In ADSI, all method-allocated memory must be freed using FreeADsMem. For example,
LPWSTR pszColumn; m_pSearch->GetFirstRow(hSearch); printf("Column names are: "); while(m_pSerach->GetNextColumnName(hSearch, &pszColumn) != S_ADS_NOMORE_COLUMNS) { printf("%S ", pszColumn); // method-allocated memory, pszColumn, must be freed before // the pointer variable is used in the next GetnextColumnName call. FreeADsMem(pszColumn); }
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
Windows 95/98: Requires Windows 95 or later (with DSClient).
Header: Declared in Adshlp.h.
Library: Included as a resource in ActiveDs.dll.