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.
);
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:
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.
// 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);