Two PDH functions open log files: PdhOpenQuery and PdhOpenLog. The function you use to open a log file depends on whether you are opening the log file for a read or a write operation.