Getting (Exception from HRESULT: 0x80070020) when trying to start performance counters


  • Hello All,

    I am developing a monitoring software for windows in which I am changing the threshold values of  process, memory and network related performance counters continuously, and then I commit my changes, stop the datacollector, and then start the collector.  The application runs fine for certain time and then all of a sudden one of the datacollector's stop's and doesn't start and throws an exception "(Exception from HRESULT: 0x80070020) The process cannot access the file because it is being used by another process", and other datacollector sets works fine. When I tried to dump the .exe, its showing error

    " This was probably caused by the following module: kernel32.sys (kernel32!WaitForSingleObjectEx+0x43)
    Bugcheck code: 0x0 (0x0, 0x0, 0x0, 0x0)
    A third party driver was identified as
    the probable root cause of this system error. It is suggested you look for an
    update for the following driver: kernel32.sys .
    Google query: kernel32.sys CUSTOM_ERROR"

    I am not able to understand where the problem is and how to solve it, as the behaviour is not consistent, this happens to different coounters at different times.

    Thanks in advance.

    Mittwoch, 6. Juni 2012 10:13

Alle Antworten

  • Raju,

    The service you are attempting to start is most likely running on a port listening on another service or web server causing a conflict. To find out what service is listening on the port, run a netstat -anon from command prompt. You may find more details at:

    Good Luck!

    Freitag, 8. Juni 2012 01:56
  • Hello Dillaman,

        Thanks a lot for replying. I tried to open the website provided by you, but I am unable to open it. Actually we are creating a windows service(Local Service) which monitors system resoures for different threshold at different times for which we are changing the threshold values, starting, stopping the collectors on regular basis. So, do you want to say that this local service and the admin user both are trying to access the DataCollector at same time, if so then how this access can be avoided.


    Raju Chowdhury

    Samstag, 9. Juni 2012 11:18