SmsEnumFilters

The SmsEnumFilters function retrieves an array of FILTER_INFO structures that contain information about each filter type supported by SMS API.

SMS_STATUS SmsEnumFilters(
  FILTER_INFO *paFI,
                 // Pointer to an array of FILTER_INFO structures.
  DWORD *pCount  // Pointer to the count of filter types supported 
                 // by the SMS API.
);
 

Parameters

paFI
Specifies a pointer to an array of FILTER_INFO structures. This array will receive information about each filter type supported by the SMS API. Your application must ensure that the array specified by paFI is large enough to contain the number of filter types supported by the SMS API. See the following remarks.
pCount
Points to a DWORD that specifies the count of filter types supported by the SMS API.

Return Values

The SmsEnumFilters function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns the following manifest constant:

SMS_MORE_DATA
The buffer specified by paFI is not big enough, and the function returns the count of container types in the DWORD specified by pCount. Or paFI or pCount were set to NULL and the count of container types was returned to the pCount.

Remarks

Your application must ensure that the array specified by paFI is large enough to contain the number of filter types supported by the SMS API.

To get the correct size for the paFI array, call the SmsEnumFilters function with paFI set to NULL or with pCount set to zero. SmsEnumFilters will assign the count of filter types to pCount and return a status of SMS_MORE_DATA. After getting the correct value for pCount, call the SmsEnumFilters function again using the correct value for pCount and a paFI array with a size that matches the count specified by pCount.

If the value for pCount is less than the number of filter types, the function writes the number of filter types specified by pCount to the paFI array and returns a status of SMS_MORE_DATA.

If the value for pCount is greater than the number of filter types, the function writes all filter types to the paFI array and returns a status of SMS_OK.

Example

// Get information about all filter types.

DWORD ctFilters = 0;
FILTER_INFO *pAvailFilterList = NULL;

// Use SmsEnumFilters to get the number of filter types.
SmsEnumFilters(0, &ctFilters);

// Allocate memory for the array of 
// FILTER_INFO structures
pAvailFilterList = new FILTER_INFO[ctFilters];
SmsEnumFilters(pAvailFilterList, &ctFilters);
 

See Also

FILTER_INFO