Changes between Initial Version and Version 1 of Ticket #4010, comment 10


Ignore:
Timestamp:
Nov 17, 2010, 8:19:45 PM (12 years ago)
Author:
Andrey Semashev

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4010, comment 10

    initial v1  
    11I took a look at the WMI code and noticed that in a few places you pass wide strings to COM methods. Strictly speaking, this is not correct because COM methods accept BSTRs, which are binary incompatible with wide C strings, unless the method implementation treats them as wide C strings. In particular, if it calls SysStringLen on the argument, the result will be undefined.
    22
    3 FWIW, from [http://article.gmane.org/gmane.comp.lib.boost.devel/208308 this thread] it seems that using WMI has its drawbacks, let alone the complexity. Perhaps, using performance counters would suffice? [http://www.osronline.com/showThread.cfm?link=10513 Here] I found an example of reading a few system counters, of which "\Process(System)\Elapsed Time" might be what you need. I did not dig deep into the code enough though, so this may be of little help to you.
     3FWIW, from [http://article.gmane.org/gmane.comp.lib.boost.devel/208308 this thread] it seems that using WMI has its drawbacks, let alone the complexity. Perhaps, using performance counters would suffice? [http://www.osronline.com/showThread.cfm?link=10513 Here] I found an example of reading a few system counters, of which "\Process(System)\Elapsed Time" might be what you need. The registry key also looks interesting but I didn't find a way to interpret it (looks like it changed its format in Vista). I did not dig deep enough into the code though, so this may be of little help to you.