Frontier Kernel Lab Notebook
Lab Notebook for Frontier Kernel Hacking

Home

About


Discussion

Recent Discussion

Create New Topic


Membership

Join Now

Login

Creating new sys.memInfo verb

Author:   David Gewirtz  
Posted: 5/30/2009; 2:22:32 PM
Topic: Creating new sys.memInfo verb
Msg #: 36 (top msg in thread)
Prev/Next: 35/
Reads: 1473

Designed to expose more details about Frontier memory for Windows machines. Works identically to sys.memAvail on Macintosh.

In kernelverbs.rc, added meminfo to /*idsysverbs*/ as:

"unixshellcommand\0",
"winshellcommand\0", /* 2006-03-09 aradke */
"meminfo\0" /* 2009-05-30 dgewirtz */

Changed verb count in same resource from 16 to 17 as in:

1013 /*idsysverbs*/ EFP DISCARDABLE
  BEGIN
    1,
//Number of "blocks" in this resource
      "sys\0", //Function Processor Name
      false, //Window required
        17, //Count of verbs
        "osversion\0", /*sys*/

Added a new Windows API call into WinBase.h (located it right after the GlobalMemoryStatusEx definition):

typedef struct _PERFORMANCE_INFORMATION {
DWORD cb;
SIZE_T CommitTotal;
SIZE_T CommitLimit;
SIZE_T CommitPeak;
SIZE_T PhysicalTotal;
SIZE_T PhysicalAvailable;
SIZE_T SystemCache;
SIZE_T KernelTotal;
SIZE_T KernelPaged;
SIZE_T KernelNonpaged;
SIZE_T PageSize;
DWORD HandleCount;
DWORD ProcessCount;
DWORD ThreadCount;
} PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION;

WINBASEAPI
BOOL
WINAPI
GetPerformanceInfo(
__out PPERFORMANCE_INFORMATION pPerformanceInformation,
__in DWORD cb
);

In VC2K8, in the menu Project->Frontier Properties..., in the Linker tree, in the Input node, added psapi.dll to the additional dependencies. Also added it to the Release configuration.

 

 

This page was last updated: Saturday, May 30, 2009 at 7:30:38 PM
Copyright 2010 ZATZ Publishing
Create your own Manila site in minutes. Everyone's doing it!

This site is using the Default theme.