sasethia Posted July 22, 2011 Posted July 22, 2011 Hi , I am trying to use openThread() to get cpu utilization of an agent from process a .So i just want to check if its possible ? I am trying to open agent thread from a different process b not from process a.The below code is used for the same tempTID = kernelTID thrdHand=OpenThread(THREAD_QUERY_INFORMATION,FALSE,tempTID) The above function return error code as 5 ie thrHand is found to be Null. I dont see any issue on tempTID. I have all the privileges and rights which allows me to use the above function . Quote
ICTCity Posted July 22, 2011 Posted July 22, 2011 Hi, Can you post the entire code? Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
sasethia Posted July 22, 2011 Author Posted July 22, 2011 Sorry but as these are confidential data i can post the entire code and also its a huge code too Quote
ICTCity Posted July 22, 2011 Posted July 22, 2011 I don't think you can get the AGENT status from another process. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
sasethia Posted July 23, 2011 Author Posted July 23, 2011 I don't think you can get the AGENT status from another process. But the same code was working on window server 2003. Is this a limitation for window 2008 Quote
ICTCity Posted July 24, 2011 Posted July 24, 2011 No idea... sorry. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
sasethia Posted July 25, 2011 Author Posted July 25, 2011 Just to add more on the above topic . I am trying to get cpu utilization of a thread from a different process b not from process a. Quote
ICTCity Posted July 25, 2011 Posted July 25, 2011 http://msdn.microsoft.com/en-us/library/ms686769(v=vs.85).aspx It looks like this code doesn't work anymore... You can use performance counter: http://msdn.microsoft.com/en-us/library/aa373088(v=VS.85).aspx Or you can get it by using WMI: http://msdn.microsoft.com/en-us/library/aa392397%28VS.85%29.aspx Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Recommended Posts