After you have created a query and added counters to it, call the PdhCollectQueryData function to retrieve the current raw data for all counters in the query. Many counters, such as rate counters, require the following two data samples before a valid data value can be determined.