Re: Getting Peak Commit from NtQuerySystemInformation
Mike Driscoll <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
On 3/4/2010 1:22 AM, Thomas Heller wrote:
> Mike Driscoll schrieb:
>
>> Hi Thomas,
>>
>> On 3/3/2010 3:14 AM, Thomas Heller wrote:
>>
> [...]
>
>> When I run this on my machine, it gives me 368456 as the result, whereas
>> Task Manager give me 1473824. Stupid question, but do I need to convert
>> the long to a kilobyte or something? I tried, but that was way off, so
>> I must be doing something wrong. Thank you for your help!
>>
> Mike, I said this snippet is not really tested.
> I created the definition of the SYSTEM_PERFORMANCE_INFORMATION
> structure from some sample C++ code I found on the internet;
> it may be wrong, it may be that I made a mistake or whatever.
>
> You have to do some research: Find out the real definition of this structure,
> (I don't known if it is in some MS header file), you have to compare it to my code,
> you have to find out what the field contents really means: kilobyte, pages, or whatever.
>
>
Sorry...I did do some research, but MSDN is confusing. According to this
page, http://msdn.microsoft.com/en-us/library/ms724509%28VS.85%29.aspx,
SystemPerformanceInformation "returns an opaque
*SYSTEM_PERFORMANCE_INFORMATION* structure that can be used to generate
an unpredictable seed for a random number generator. Use the
*CryptGenRandom*
<http://msdn.microsoft.com/en-us/library/aa379942%28VS.85%29.aspx>
function instead."
My understanding of that sentence is that it's just a randomization seed
function that may or may not return the same number. The struct
definition looks like this:
|typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
BYTE Reserved1[312];
} SYSTEM_PERFORMANCE_INFORMATION;|
Unfortunately, my C++ programming didn't go beyond anything more than
bare bones crap in college, so I'm not sure what this is saying other
than type definition and I think it might be reserving some space in
memory. I've looked on several websites that purport to know about this
class, but they all end up talking about listing open files or say that
it's undocumented.
Thanks for your help. I apologize for bothering you.
- Mike
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users