Jump to content

DosQueryMemState

From EDM2
Revision as of 05:11, 8 April 2015 by Martini (talk | contribs) (Created page with "==Prototype:== APIRET APIENTRY DosQueryMemState ( PVOID addr, PULONG psize, PULONG pflags ) ; ==Linkage Definition:== IMPORTS DOSQUERYMEMSTATE = DOSCALL1.307 ==Paramet...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Prototype:

APIRET APIENTRY DosQueryMemState ( PVOID addr, PULONG psize, PULONG pflags ) ; 

Linkage Definition:

IMPORTS DOSQUERYMEMSTATE = DOSCALL1.307 

Parameters:

  • PVOID addr Base address of pages to be queried.
  • PULONG psize Pointer to location in user space that contains the requested size of the region to query.
  • PULONG pflags Pointer to location in user space that will receive the attribute flags describing the region.

Comments:

This function returns zero if successful. The attribute flags are defined as follows:

┌────────────────────┬──────────┬────────────────────────────────────────┐ │PAG_NPOUT │0x00000000│Page is not present, not in core. │ ├────────────────────┼──────────┼────────────────────────────────────────┤ │PAG_PRESENT │0x00000001│Page is present. │ ├────────────────────┼──────────┼────────────────────────────────────────┤ │PAG_NPIN │0x00000002│Page is not present, but in core. │ ├────────────────────┼──────────┼────────────────────────────────────────┤ │PAG_PRESMASK │0x00000003│Present state mask. │ ├────────────────────┼──────────┼────────────────────────────────────────┤ │PAG_RESIDENT │0x00000010│Page is resident (non-swappable). │ ├────────────────────┼──────────┼────────────────────────────────────────┤ │PAG_SWAPPABLE │0x00000020│Page is swappable. │ ├────────────────────┼──────────┼────────────────────────────────────────┤ │PAG_DISCARDABLE │0x00000030│Page is discardable. │ └────────────────────┴──────────┴────────────────────────────────────────┘

The information returned by this function is extremely volatile, and decisions based upon it should reflect that volatility.