IDirectorySearch::SetSearchPreference

Specifies data to be obtained by a subsequent search.

HRESULT SetSearchPreference(
  PADS_SEARCHPREF_INFO pSearchPrefs,
                    //Search preferences to be set
  DWORD dwNumPrefs  //Number of preferences
);
 

Parameters

pSearchPrefs
[in] Caller-allocated array of ADS_SEARCHPREF_INFO structures containing the search preferences to be set.
dwNumPrefs
[in] The size of the pSearchPrefs array.

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 preference was set.
E_ADS_INVALID_SEARCHPREF
The specified search preference is not available in, or cannot be set by, the directory service.
E_ADS_INVALID_SEARCHPREF_VALUE
The specified search preference value is invalid. Values for the search preference must be defined in the ADS_SEARCHPREF enumeration.

See Also

ADS_SEARCHPREF_INFO, Using Directory Service Queries