SmsCloseFilter

The SmsCloseFilter function closes the specified filter.

SMS_STATUS SmsCloseFilter(
  HANDLE hFilter  // Handle to filter.
);
 

Parameters

hFilter
Specifies the handle to the filter to close.

Return Values

The SmsCloseFilter 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_INVALID_HANDLE
The specified handle is not valid.

Remarks

When SmsCloseFilter is used to close a transient filter, the memory associated with the filter is deallocated. Note that a transient filter is opened when you use SmsCreateFilter to create a filter.

When SmsCloseFilter is used to close a persistent filter, the usage count is decremented, but the memory associated with the filter is not deallocated until its usage count is zero. When your application calls SmsGetFilterByID or SmsGetNextFilter to retrieve a handle to a filter, that filter's usage count increases by 1. The memory allocated to that filter will not be freed until your application closes all handles to the filter and closes the filter container.

After a filter has been applied to a container using SmsSetFilter, your application can close it. The SMS API creates its own copy for the container, which is freed when it is no longer needed.

See Also

SmsCloseFilterContainer, SmsCreateFilter, SmsGetFilterByID, SmsGetNextFilter, SmsSetFilter