SmsCommitFilter

The SmsCommitFilter function causes the specified transient filter to be written to the site database.

SMS_STATUS SmsCommitFilter(
  HANDLE hFilter,     // Handle to filter to commit.
  HANDLE hFContainer  // Handle to filter container.
);
 

Parameters

hFilter
Specifies the handle to the filter to be committed. The filter must be of a type that supports persistence, and all mandatory scalars for the filter must be set. Currently, only filters of the MACHINE_FILTER type support persistence.

Note that the Name and Architecture scalars for the specified filter must be set before a persistent filter can be added to the site database by using SmsCommitFilter.

In addition, your application cannot commit filters that have already been committed.

hFContainer
Specifies the handle to the filter container where the filter will be added.

Return Values

The SmsCommitFilter function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns one of the following manifest constants:

SMS_INVALID_HANDLE
The specified handle is not valid.
SMS_INVALID_FILTER_ID
The filter type is not valid. Currently, only machine filters can be committed.
SMS_FILTER_NO_MODIFY
Your application attempted to commit a persistent filter. Only transient filters can be committed.

Remarks

When a filter is written to the site database, it becomes a persistent filter. In the SMS Administrator, persistent filters are represented as queries.

Note that the filter must be of a type that supports persistence. Currently, only filters of the MACHINE_FILTER type support persistence.

Only transient filters can be committed—your application cannot commit filters that have already been committed.

In addition, before a transient filter can be written to the site database by using SmsCommitFilter, your application must set the following scalars for the filter:

Name
Corresponds to the Query Name in the Query Properties of the query in the SMS Administrator. This scalar must be set when adding a persistent filter to the site database.
Architecture
Corresponds to Architecture in the Query Properties of the query in the SMS Administrator. This scalar must be set when adding a persistent filter to the site database.

See Also

SmsCreateFilter