Jump to content

DosQueryMemState: Difference between revisions

From EDM2
Created page with "==Prototype:== APIRET APIENTRY DosQueryMemState ( PVOID addr, PULONG psize, PULONG pflags ) ; ==Linkage Definition:== IMPORTS DOSQUERYMEMSTATE = DOSCALL1.307 ==Paramet..."
 
Ak120 (talk | contribs)
No edit summary
Line 1: Line 1:
==Prototype:==
==Prototype==
 
  APIRET APIENTRY DosQueryMemState ( PVOID addr, PULONG psize, PULONG pflags ) ;  
  APIRET APIENTRY DosQueryMemState ( PVOID addr, PULONG psize, PULONG pflags ) ;  


==Linkage Definition:==
==Linkage Definition:==
  IMPORTS DOSQUERYMEMSTATE = DOSCALL1.307  
  IMPORTS DOSQUERYMEMSTATE = DOSCALL1.307  


==Parameters: ==
==Parameters==
 
;PVOID addr:Base address of pages to be queried.
* 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 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.
* 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.                    │
└────────────────────┴──────────┴────────────────────────────────────────┘


==Comments==
This function returns zero if successful. The attribute flags are defined as follows:
<pre>
┌────────────────────┬──────────┬──────────────────────────────────┐
│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.              │
└────────────────────┴──────────┴──────────────────────────────────┘
</pre>
The information returned by this function is extremely volatile, and decisions based upon it should reflect that volatility.   
The information returned by this function is extremely volatile, and decisions based upon it should reflect that volatility.   


 
[[Category:Dos]]
[[Category:The OS/2 API Project]]

Revision as of 05:33, 4 January 2017

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.