Ignore:
Timestamp:
Feb 11, 2001, 4:31:08 PM (25 years ago)
Author:
bird
Message:

Added new K32QUERYSYSTEMMEMINFO IOCtl with lib call and structs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/win32k.h

    r5052 r5112  
    1 /* $Id: win32k.h,v 1.4 2001-02-02 08:42:56 bird Exp $
     1/* $Id: win32k.h,v 1.5 2001-02-11 15:31:08 bird Exp $
    22 *
    33 * Top level make file for the Win32k library.
     
    3030#define K32_PROCESSREADWRITE    0x05
    3131#define K32_HANDLESYSTEMEVENT   0x06
     32#define K32_QUERYSYSTEMMEMINFO  0x07
    3233
    3334/*
     
    5455#define K32_SYSEVENT_LAST                   K32_SYSEVENT_CTRL_ALT_2xNUMLOCK
    5556
     57/*
     58 * System Memory Info flags.
     59 */
     60#define K32_SYSMEMINFO_ALL                  0       /* Everything is queried. */
     61#define K32_SYSMEMINFO_SWAPFILE             0x01    /* Swapfile stuff is queried. */
     62#define K32_SYSMEMINFO_PAGING               0x02    /* Paging and Physical memory stuff is queried. */
     63#define K32_SYSMEMINFO_VM                   0x04    /* Virtual memory stuff is all queried. */
     64
    5665
    5766#ifndef INCL_16                         /* We don't need this in 16-bit code. */
     
    173182
    174183
     184/*
     185 * Memory information struct.
     186 */
     187typedef struct _k32SystemMemInfo
     188{
     189    ULONG       cb;                     /* Size of this structure - must be set. */
     190                                        /* This will be used to distinguish futher versions. */
     191    ULONG       flFlags;                /* This is used to limit amount of information collected - must be set. (K32_SYSMEMINFO_*) */
     192                                        /* Some conciderations.
     193                                         *    - VM uses worker functions which traverses internal lists.
     194                                         *    - Page and physical memory traverses one internal structure (PGPhysAvail())
     195                                         *    - Swap File only accesses variables.
     196                                         */
     197
     198    /* SwapFile Info */
     199    BOOL        fSwapFile;              /* Swap File: Swapping enabled or disabled. (SMswapping) */
     200                                        /*            (The SwapFile data below is valid when swapping is enbled!) */
     201    ULONG       cbSwapFileSize;         /* Swap File: Current size. (smFileSize<<PAGESIZE) */
     202    ULONG       cbSwapFileAvail;        /* Swap File: Available within current file. ((smFileSize-smcBrokenDF-SMcDFInuse)<<PAGESIZE) */
     203    ULONG       cbSwapFileUsed;         /* Swap File: Used within current file. (SMcDFInuse<<PAGESIZE) */
     204    ULONG       cbSwapFileMinFree;      /* Swap File: Addjusted min free on swap volume. (SMMinFree<<PAGESHIFT) */
     205    ULONG       cbSwapFileCFGMinFree;   /* Swap File: Configured min free on swap volume. ((SMCFGMinFree<<PAGESHIFT)/4) */
     206    ULONG       cbSwapFileCFGSwapSize;  /* Swap File: Configured initial swap file size. ((SMCFGSwapSize<<PAGESHIFT)/4) */
     207    ULONG       cSwapFileBrokenDF;      /* Swap File: Number of broken disk frames (DF). (smcBrokenDF) */
     208    ULONG       cSwapFileGrowFails;     /* Swap File: Number of times growoperation has failed. (smcGrowFails) */
     209    ULONG       cSwapFileInMemFile;     /* Swap File: Number of pages in the "In-Memory-swapFile". (SMcInMemFile) */
     210                                        /*            These pages are not counted into the SMcDFInuse count I think. */
     211
     212    /* Physical Memory Info */
     213    ULONG       cbPhysSize;             /* Physical memory: total (bytes). (pgPhysPages<<PAGESHIFT) */
     214    ULONG       cbPhysAvail;            /* Physical memory: available (bytes). (PGPhysAvail()) */
     215    ULONG       cbPhysUsed;             /* Physical memory: used (bytes). (PGPhysPresent()<<PAGESHIFT) */
     216
     217    /* Other paging info */
     218    BOOL        fPagingSwapEnabled;     /* Paging: TRUE when swapping is enabled, else false. (PGSwapEnabled) */
     219    ULONG       cPagingPageFaults;      /* Paging: Number of pagefaults which has occured since boot. (pgcPageFaults) */
     220    ULONG       cPagingPageFaultsActive;/* Paging: Number of pagefaults currently being processed. (pgcPageFaultsActive) */
     221    ULONG       cPagingPhysPages;       /* Paging: Count of physical pages. (hope this is correct) (pgPhysPages) */
     222    ULONG       ulPagingPhysMax;        /* Paging: Top of physical memory (physical page number) (pgPhysMax) */
     223    ULONG       cPagingResidentPages;   /* Paging: Count of resident pages. (pgResidentPages) */
     224    ULONG       cPagingSwappablePages;  /* Paging: Count of swappable pages which is currently present in memory. (pgSwappablePages) */
     225    ULONG       cPagingDiscardableInmem;/* Paging: Count of discardable pages which is currently present in memory. (pgDiscardableInmem) */
     226    ULONG       cPagingDiscardablePages;/* Paging: Count of discardable pages allocated. (pgDiscardablePages) */
     227
     228    /* Virtual Memory manager info. */
     229    ULONG       ulAddressLimit;         /* VM: Current user virtual address limit - use this for high arena check. (VirtualAddressLimit / 0x20000000) */
     230    ULONG       ulVMArenaPrivMax;       /* VM: Current highest address in the private arena. (vmRecalcShrBound()) */
     231    ULONG       ulVMArenaSharedMin;     /* VM: Current lowest address in the shared arena. (ahvmShr) */
     232    ULONG       ulVMArenaSharedMax;     /* VM: Current highest address in the shared arena. (ahvmShr) */
     233    ULONG       ulVMArenaSystemMin;     /* VM: Current lowest address in the system arena. (ahvmhSys) */
     234    ULONG       ulVMArenaSystemMax;     /* VM: Current highest address in the system arena. (ahvmhSys) */
     235    ULONG       ulVMArenaHighPrivMax;   /* VM: Current highest address in the high private arena - aurora/smp only. (vmRecalcShrBound) */
     236    ULONG       ulVMArenaHighSharedMin; /* VM: Current lowest address in the high shared arena - aurora/smp only. (ahvmhShr) */
     237    ULONG       ulVMArenaHighSharedMax; /* VM: Current highest address in the high shared arena - aurora/smp only. (ahvmhShr) */
     238
     239} K32SYSTEMMEMINFO, *PK32SYSTEMMEMINFO;
     240
    175241
    176242/*
     
    231297    ULONG       rc;                     /* Return code. */
    232298} K32HANDLESYSTEMEVENT, *PK32HANDLESYSTEMEVENT;
     299
     300typedef struct _k32QuerySystemMemInfo
     301{
     302    PK32SYSTEMMEMINFO   pMemInfo;       /* Pointer to system memory info structure with cb set. */
     303                                        /* The other members will be filled on successful return. */
     304    APIRET      rc;                     /* Return code. */
     305} K32QUERYSYSTEMMEMINFO, *PK32QUERYSYSTEMMEMINFO;
    233306
    234307
     
    250323APIRET APIENTRY  DosAllocMemEx(PPVOID ppv, ULONG cb, ULONG flag);
    251324APIRET APIENTRY  W32kQueryOTEs(HMODULE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte);
     325APIRET APIENTRY  W32kQuerySystemMemInfo(PK32SYSTEMMEMINFO pMemInfo);
    252326APIRET APIENTRY  W32kProcessReadWrite(PID pid, ULONG cb, PVOID pvSource, PVOID pvTarget, BOOL fRead);
    253327APIRET APIENTRY  W32kHandleSystemEvent(ULONG ulEvent, HEV hev, BOOL fHandle);
Note: See TracChangeset for help on using the changeset viewer.