The aim of the series is to cover a WMI Provider writing question per post. If you have a question, you'd like the WMI team to answer, do leave a comment.
Now, for the answer -
Let's take the Win32_Product class supported by the MSI provider as it is today. This class returns a complete list of installed MSI applications. When a WMI client requests all Win32_Product instances with WQL queries such as:
Or
the corresponding WMI provider gets loaded and WMI callbacks the provider at the level of:
So, in conclusion:
Of course, it is important to note that depending on the nature and complexity of the object model, returning a collection to WMI core is not always the best way to proceed. There are situations where a filtering handled by WMI core will not be efficient enough (e.g. when the collection is extremely large). In such a case, it is recommended that the WMI provider supports queries in order to perform the filtering in the provider code. This makes sense as the provider it is the only software component having a perfect understanding of the manageable entity model it surfaces.
Kapil Mathur [MSFT]