Saturday, 15 September 2012

c# - Using pinvoke to get access to system objects and query about a process -


While I learn about p / invoke, I use some noteworthy performance benefits using those .net methods I can see, because this system information through DLS

For example, by importing the DLL into this code

I can get information about the process related to this question, so I want to know about that memory usage.

But as I can note in that link and it seems that I can use a category which has not been used by P / Invoice and is very specific information query uint64 IODataOperationsPerSec; Uint64 IOOtherOperationsPerSec; Uint64 IOReadBytesPerSec; Uint64 IOReadOperationsPerSec; UINT64 IOWriteBytesPerSec; UINT64 IOWriteOperationsPerSec; Uint64 IODataBytesPerSec; Uint64 IOOtherBytesPerSec; UIT 32 PagesFullsFrasek; Uint64 PageFileBytes; Uint64 PageFileBytesPeak;

As you can see, there are separate jobs for both 32bit / 64bit processes. So here I knew to make sure that I That's definitely getting what I need to do the query and then I saw that I can need all through that class, which I could get a guess (wmi), but I was actually searching , For 1 class, I will definitely know I ask 32bit functions and 64 bit tasks correctly and 2 counter are all in one class, I / O , CPU time , memory usage And the execution issue is that it has a specific performance gain, which is compared to using net search.

Then The question is :

How can I gain access to that class by using a method like P / invoice and the pure class of mine?

And in fact the most interesting link that I've found about the counters for managed, is in the description, I think equal to the above win32 link.

The last time I worked with P / Invoke, the whole of the managed C ++ library It was very easy to do, and then import it into my C # app. If you know C ++, you will save yourself a lot of trouble while talking about those types of operations.

No comments:

Post a Comment