IDirectorySearch::SetSearchPreference method
The IDirectorySearch::SetSearchPreference method specifies a search preference for obtaining data in a subsequent search.
Syntax
HRESULT SetSearchPreference( [in] PADS_SEARCHPREF_INFO pSearchPrefs, [in] DWORD dwNumPrefs );
Parameters
- pSearchPrefs [in]
-
Provides a caller-allocated array of ADS_SEARCHPREF_INFO structures that contain the search preferences to be set.
- dwNumPrefs [in]
-
Provides the size of the pSearchPrefs array.
Return value
This method supports the standard return values, as well as the following:
For more information and other return values, see ADSI Error Codes.
- S_OK
-
The search preference was set.
- E_ADS_BAD_PARAMETER
-
The caller supplied an invalid array of ADS_SEARCHPREF_INFO structures.
Examples
The following C++ code example shows how to set the page size preference:
ADS_SEARCHPREF_INFO prefInfo[1]; prefInfo[0].dwSearchPref = ADS_SEARCHPREF_PAGESIZE; prefInfo[0].vValue.dwType = ADSTYPE_INTEGER; prefInfo[0].vValue.Integer = 100; hr = m_pSearch->SetSearchPreference( prefInfo, 1);
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Header |
|
|
DLL |
|
|
IID |
IID_IDirectorySearch is defined as 109BA8EC-92F0-11D0-A790-00C04FD8D5A8 |
See also