home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / bsememf.h < prev    next >
C/C++ Source or Header  |  1999-04-30  |  6KB  |  180 lines

  1. /*static char *SCCSID = "@(#)bsememf.h  6.8 92/03/15";*/
  2.  
  3.  /******************************************************************************\
  4.  *                                                                             *
  5.  * Module Name: BSEMEMF.H                                                      *
  6.  *                                                                             *
  7.  * OS/2 Base MEMory Flags include file                                         *
  8.  *                                                                             *
  9.  * Copyright (c) 1989  - 1992 IBM Corporation                                  *
  10.  *                                                                             *
  11.  *******************************************************************************/
  12.  
  13. /* NOINC */
  14. #if __IBMC__ || __IBMCPP__
  15.    #pragma info( none )
  16.       #ifndef __CHKHDR__
  17.          #pragma info( none )
  18.       #endif
  19.    #pragma info( restore )
  20. #endif
  21. #ifdef __cplusplus
  22.       extern "C" {
  23. #endif
  24. /* INC */
  25.  
  26. #ifndef __BSEMEMF__
  27. /* NOINC */
  28. #define __BSEMEMF__
  29. /* INC */
  30.  
  31.  /* Access protection                                                          */
  32.  
  33.  #define PAG_READ          0x00000001U      /* read access                      */
  34.  
  35.  #define PAG_WRITE         0x00000002U      /* write access                     */
  36.  
  37.  #define PAG_EXECUTE       0x00000004U      /* execute access                   */
  38.  
  39.  #define PAG_GUARD         0x00000008U      /* guard protection                 */
  40.  
  41.  #define PAG_DEFAULT       0x00000400U      /* default (initial) access         */
  42.  
  43.  
  44.  
  45.  /* Commit                                                                     */
  46.  
  47.  #define PAG_COMMIT        0x00000010U      /* commit storage                   */
  48.  
  49.  #define PAG_DECOMMIT      0x00000020U      /* decommit storage                 */
  50.  
  51.  
  52.  
  53.  /* Allocation attributes                                                      */
  54.  
  55.  #define OBJ_TILE          0x00000040U      /* tile object                      */
  56.  
  57.  #define OBJ_PROTECTED     0x00000080U      /* protect object
  58.  
  59.                                             NOTE: This flag is NOT available at
  60.  
  61.                                             the api level */
  62.  
  63.  #define OBJ_GETTABLE      0x00000100U      /* gettable by other processes      */
  64.  
  65.  #define OBJ_GIVEABLE      0x00000200U      /* giveable to other processes      */
  66.  
  67.  #define OBJ_ANY           0x00000400U      /* allocate memory anywhere         */
  68.  
  69.  
  70.  
  71.  #define fPERM             (PAG_EXECUTE | PAG_READ | PAG_WRITE)
  72.  
  73.  #define fSHARE            (OBJ_GETTABLE | OBJ_GIVEABLE)
  74.  
  75.  
  76.  
  77.  /* DosAllocMem flags                                                          */
  78.  
  79.  #define fALLOC            (OBJ_TILE | PAG_COMMIT | fPERM)
  80.  
  81.  
  82.  
  83.  /* DosAllocSharedMem flags                                                    */
  84.  
  85.  #define fALLOCSHR         (OBJ_TILE | PAG_COMMIT | fSHARE | fPERM)
  86.  
  87.  
  88.  
  89.  /* DosGetNamedSharedMem flags                                                 */
  90.  
  91.  #define fGETNMSHR         (fPERM)
  92.  
  93.  
  94.  
  95.  /* DosGetSharedMem flags                                                      */
  96.  
  97.  #define fGETSHR           (fPERM)
  98.  
  99.  
  100.  
  101.  /* DosGiveSharedMem flags                                                     */
  102.  
  103.  #define fGIVESHR          (fPERM)
  104.  
  105.  
  106.  
  107.  /* DosSetMem flags                                                            */
  108.  
  109.  #define fSET              (PAG_COMMIT + PAG_DECOMMIT + PAG_DEFAULT + fPERM)
  110.  
  111.  
  112.  
  113.  /* Dos32SubSet flags                                                          */
  114.  
  115.  #define DOSSUB_INIT       0x01U           /* initialize memory object for     */
  116.  
  117.                                            /* suballocation                    */
  118.  
  119.  #define DOSSUB_GROW       0x02U           /* increase size of memory pool     */
  120.  
  121.                                            /* for suballocation                */
  122.  
  123.  #define DOSSUB_SPARSE_OBJ 0x04U           /* indicator for DosSub to          */
  124.  
  125.                                            /* manage the commitment of         */
  126.  
  127.                                            /* pages spanned by the memory      */
  128.  
  129.                                            /* pool                             */
  130.  
  131.  #define DOSSUB_SERIALIZE  0x08U           /* indicates that access to the     */
  132.  
  133.                                            /* memory pool is to be             */
  134.  
  135.                                            /* serialized by DosSub             */
  136.  
  137.  
  138.  
  139.  /* Allocation type (returned from DosQueryMem)                                */
  140.  
  141.  #define PAG_SHARED        0x00002000U     /* shared object                    */
  142.  
  143.  #define PAG_FREE          0x00004000U     /* pages are free                   */
  144.  
  145.  #define PAG_BASE          0x00010000U     /* first page in object             */
  146.  
  147.  /* for DosAllocMem and DosAliasMem */
  148.  #define OBJ_SELMAPALL   0x00000800      /* First sel map all of object */
  149.  
  150.  /* for DosAliasMem */
  151.  /* In addition to OBJ_TILE (defined in bsememf.h) and OBJ_SELMAPALL */
  152.  #define SEL_CODE        0x00000001      /* Selector is code */
  153.  #define SEL_USE32       0x00000002      /* Selector is USE32 */
  154.  
  155.  /* Page state (returned from DosQueryMemState) */
  156.  #define PAG_NPOUT       0x00000000      /* page is not present, not in core */
  157.  #define PAG_PRESENT     0x00000001      /* page is present */
  158.  #define PAG_NPIN        0x00000002      /* page is not present, in core */
  159.  #define PAG_PRESMASK    0x00000003      /* present state mask */
  160.  #define PAG_INVALID     0x00000000      /* page is invalid */
  161.  #define PAG_RESIDENT    0x00000010      /* page is resident */
  162.  #define PAG_SWAPPABLE   0x00000020      /* page is swappable */
  163.  #define PAG_DISCARDABLE 0x00000030      /* page is discardable */
  164.  #define PAG_TYPEMASK    0x00000030      /* type mask */
  165.  
  166. #endif /* __BSEMEMF__ */
  167.  
  168. /* NOINC */
  169. #ifdef __cplusplus
  170.         }
  171. #endif
  172. #if __IBMC__ || __IBMCPP__
  173.    #pragma info( none )
  174.       #ifndef __CHKHDR__
  175.          #pragma info( restore )
  176.       #endif
  177.    #pragma info( restore )
  178. #endif
  179. /* INC */
  180.