IDirectorySearch::CloseSearchHandle

Closes the handle to a search result and frees the memory allocated for the search result.

HRESULT CloseSearchHandle(
  ADS_SEARCH_HANDLE hSearchResult,  //Search result to be closed
);
 

Parameters

[in] hSearchResult
Handle to the search result to be closed.

Return Values

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

S_OK
The search result was closed.

Note to Implementers

The CloseSearchHandle method must free all memory allocated by ExecuteSearch, including the search result and the search result handle.

See Also

Using Directory Service Queries