Property Filters

A PropertyCollector can have one or more associated PropertyFilter objects. A PropertyFilter has one or more associated PropertyFilterSpec objects. A PropertyFilterSpec that is used with the RetrievePropertiesEx method has a limited lifespan; the server destroys the filter after returning results to your client. For a sequence of incremental property collection operations, the WaitForUpdatesEx method relies on PropertyFilterSpec objects that are available for multiple calls to the method.

To create persistent property filter specifications, use the CreateFilter method. When you call CreateFilter, you pass a PropertyFilterSpec object to the method. The method adds the new filter to the PropertyCollector associated with the method invocation and returns a reference to the new filter. After you have created the filter, you can add additional PropertyFilterSpec objects. You cannot share a filter with a PropertyCollector in another session.