If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

help with c# ntdll.dll NtQuerySystemInformation

Hello guys,

This is my last resort... I'm trying to get the value of Peak Commit Charge on a win xp 32 machine.
I've searched and searched but the only ways to get this info are in PowerShell and Python.
In either case I can't produce an acceptable sized exe. I need to run it on remote computers without installing PowerShell or Python on 200+ machines.

So the solution as I see it is to compile an simple c# code that return that value.

The ps1 and py scripts look basically the same, I've tried, unsuccessfully, to find a c# code. I have to confess I'm a total newbie when it comes to c#.

Could anyone look over the following pwershell script and "translate" it into c# code from witch I could build an .exe with an online c# compiler...

Thank a lot.

$sig = @'
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_PERFORMANCE_INFORMATION {
public Int64 IdleTime;
public Int64 ReadTransferCount;
public Int64 WriteTransferCount;
public Int64 OtherTransferCount;
public uint ReadOperationCount;
public uint WriteOperationCount;
public uint OtherOperationCount;
public uint AvailablePages;
public uint TotalCommittedPages;
public uint TotalCommitLimit;
public uint PeakCommitment;
public uint PageFaults;
public uint WriteCopyFaults;
public uint TransitionFaults;
public uint Reserved1;
public uint DemandZeroFaults;
public uint PagesRead;
public uint PageReadIos;
public ulong Reserved2;
public uint PagefilePagesWritten;
public uint PagefilePageWriteIos;
public uint MappedFilePagesWritten;
public uint MappedFilePageWriteIos;
public uint PagedPoolUsage;
public uint NonPagedPoolUsage;
public uint PagedPoolAllocs;
public uint PagedPoolFrees;
public uint NonPagedPoolAllocs;
public uint NonPagedPoolFrees;
public uint TotalFreeSystemPtes;
public uint SystemCodePage;
public uint TotalSystemDriverPages;
public uint TotalSystemCodePages;
public uint SmallNonPagedLookasideListAllocateHits;
public uint SmallPagedLookasideListAllocateHits;
public uint Reserved3;
public uint MmSystemCachePage;
public uint PagedPoolPage;
public uint SystemDriverPage;
public uint FastReadNoWait;
public uint FastReadWait;
public uint FastReadResourceMiss;
public uint FastReadNotPossible;
public uint FastMdlReadNoWait;
public uint FastMdlReadWait;
public uint FastMdlReadResourceMiss;
public uint FastMdlReadNotPossible;
public uint MapDataNoWait;
public uint MapDataWait;
public uint MapDataNoWaitMiss;
public uint MapDataWaitMiss;
public uint PinMappedDataCount;
public uint PinReadNoWait;
public uint PinReadWait;
public uint PinReadNoWaitMiss;
public uint PinReadWaitMiss;
public uint CopyReadNoWait;
public uint CopyReadWait;
public uint CopyReadNoWaitMiss;
public uint CopyReadWaitMiss;
public uint MdlReadNoWait;
public uint MdlReadWait;
public uint MdlReadNoWaitMiss;
public uint MdlReadWaitMiss;
public uint ReadAheadIos;
public uint LazyWriteIos;
public uint LazyWritePages;
public uint DataFlushes;
public uint DataPages;
public uint ContextSwitches;
public uint FirstLevelTbFills;
public uint SecondLevelTbFills;
public uint SystemCalls;
}

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.