Closing a Log File
You can call either PdhCloseQuery or PdhCloseLog to close a log file. Which function you use depends on which function you used to open the log file.
- If you used PdhOpenQuery to open the log file for reading, call PdhCloseQuery to close it. You would do this if, for example, the data in one log file is converted to another format and written to another log file.
- If you used PdhOpenLog to open the log file for writing, call PdhCloseLog to close it.
PdhCloseQuery and PdhCloseLog close both local counters and counters located on other machines.