Values from the ADS_STATUS enumeration indicate if a search preference has been set and if not, why not.
typedef enum {
ADS_STATUS_S_OK = 0,
ADS_STATUS_INVALID_SEARCHPREF,
ADS_STATUS_INVALID_SEARCHPREFVALUE
} ADS_STATUSENUM;
typedef ADS_STATUSENUM ADS_STATUS, *PADS_STATUS;
The IDirectorySearch::SetSearchPreferences method writes values from the ADS_STATUS enumeration to the dwStatus member of an ADS_SEARCHPREF_INFO structure to indicate whether the corresponding search preference was set. Callers can use this status value to decide whether to execute a search.