home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / incla / bsedos.h__ / BSEDOS.H
Encoding:
C/C++ Source or Header  |  1992-09-27  |  61.9 KB  |  1,777 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: BSEDOS.H
  4. *
  5. * OS/2 Base Include File
  6. *
  7. * Copyright (c) 1987 - 1992  IBM Corporation
  8. *
  9. *****************************************************************************
  10. *
  11. * Subcomponents marked with "+" are partially included by default
  12. *
  13. *   #define:                To include:
  14. *
  15. * + INCL_DOSPROCESS         Process and thread support
  16. * + INCL_DOSFILEMGR         File Management
  17. * + INCL_DOSMEMMGR          Memory Management
  18. * + INCL_DOSSEMAPHORES      Semaphore support
  19. * + INCL_DOSDATETIME        Date/Time and Timer support
  20. *   INCL_DOSMODULEMGR       Module manager
  21. * + INCL_DOSRESOURCES       Resource support
  22. *   INCL_DOSNLS             National Language Support
  23. *   INCL_DOSEXCEPTIONS      Exception Management Support
  24. *   INCL_DOSMISC            Miscellaneous
  25. *   INCL_DOSMONITORS        Monitors
  26. *   INCL_DOSQUEUES          Queues
  27. *   INCL_DOSSESMGR          Session Manager Support
  28. *   INCL_DOSDEVICES         Device specific, ring 2 support
  29. *   INCL_DOSNMPIPES         Named Pipes Support
  30. *   INCL_DOSPROFILE         DosProfile API
  31. *   INCL_DOSMVDM            MVDM support
  32. *
  33. \***************************************************************************/
  34. #ifdef __IBMC__
  35.    #pragma info( none )
  36.    #ifndef __CHKHDR__
  37.       #pragma info( none )
  38.    #endif
  39.    #pragma info( restore )
  40. #endif
  41.  
  42. #ifndef __BSEDOS__
  43. #define __BSEDOS__
  44.  
  45. #define INCL_DOSINCLUDED
  46.  
  47. #ifdef INCL_DOS
  48.    #define INCL_DOSPROCESS
  49.    #define INCL_DOSFILEMGR
  50.    #define INCL_DOSMEMMGR
  51.    #define INCL_DOSSEMAPHORES
  52.    #define INCL_DOSDATETIME
  53.    #define INCL_DOSMODULEMGR
  54.    #define INCL_DOSRESOURCES
  55.    #define INCL_DOSNLS
  56.    #define INCL_DOSEXCEPTIONS
  57.    #define INCL_DOSMISC
  58.    #define INCL_DOSMONITORS
  59.    #define INCL_DOSQUEUES
  60.    #define INCL_DOSSESMGR
  61.    #define INCL_DOSDEVICES
  62.    #define INCL_DOSNMPIPES
  63.    #define INCL_DOSPROFILE
  64.    #define INCL_DOSMVDM
  65. #endif /* INCL_DOS */
  66.  
  67. #ifdef INCL_ERRORS
  68.    #define INCL_DOSERRORS
  69. #endif /* INCL_ERRORS */
  70.  
  71. #if (defined(INCL_DOSPROCESS) || !defined(INCL_NOCOMMON))
  72.    /*** General services */
  73.    APIRET APIENTRY DosBeep(ULONG freq, ULONG dur);
  74.  
  75.    /*** Process and Thread support */
  76.    VOID APIENTRY DosExit(ULONG action, ULONG result);
  77.  
  78.    /* DosExit codes */
  79.    #define EXIT_THREAD        0
  80.    #define EXIT_PROCESS       1
  81. #endif /* common INCL_DOSPROCESS stuff */
  82.  
  83. #ifdef INCL_DOSPROCESS
  84.    #define DosCwait           DosWaitChild
  85.    #define DosSetPrty         DosSetPriority
  86.  
  87.    #include <bsetib.h>
  88.  
  89.    typedef  VOID APIENTRY FNTHREAD(ULONG);
  90.    typedef FNTHREAD *PFNTHREAD;
  91.  
  92.    APIRET APIENTRY DosCreateThread(PTID ptid, PFNTHREAD pfn, ULONG param, ULONG flag, ULONG cbStack);
  93.  
  94.    APIRET APIENTRY DosResumeThread(TID tid);
  95.  
  96.    APIRET APIENTRY DosSuspendThread(TID tid);
  97.  
  98.    APIRET APIENTRY DosGetInfoBlocks(PTIB *pptib,PPIB *pppib);
  99.  
  100.    APIRET APIENTRY DosKillThread(TID tid);
  101.  
  102.    /* Action code values */
  103.  
  104.    #define DCWA_PROCESS       0
  105.    #define DCWA_PROCESSTREE   1
  106.  
  107.    /* Wait option values */
  108.  
  109.    #define DCWW_WAIT          0
  110.    #define DCWW_NOWAIT        1
  111.  
  112.    typedef struct _RESULTCODES       /* resc */
  113.            {
  114.            ULONG codeTerminate;
  115.            ULONG codeResult;
  116.            } RESULTCODES;
  117.    typedef RESULTCODES *PRESULTCODES;
  118.  
  119.    APIRET APIENTRY DosWaitChild(ULONG action, ULONG option, PRESULTCODES pres, PPID ppid, PID pid);
  120.  
  121.    APIRET APIENTRY DosWaitThread(PTID ptid, ULONG option);
  122.  
  123.    APIRET APIENTRY DosSleep(ULONG msec);
  124.  
  125.    APIRET APIENTRY DosDebug(PVOID pdbgbuf);
  126.  
  127.  
  128.    /* codeTerminate values (also passed to ExitList routines) */
  129.  
  130.    #define TC_EXIT            0
  131.    #define TC_HARDERROR       1
  132.    #define TC_TRAP            2
  133.    #define TC_KILLPROCESS     3
  134.    #define TC_EXCEPTION       4
  135.  
  136.    typedef VOID APIENTRY FNEXITLIST(ULONG);
  137.    typedef FNEXITLIST *PFNEXITLIST;
  138.  
  139.    APIRET APIENTRY DosEnterCritSec(VOID);
  140.  
  141.    APIRET APIENTRY DosExitCritSec(VOID);
  142.  
  143.    APIRET APIENTRY DosExitList(ULONG ordercode, PFNEXITLIST pfn);
  144.  
  145.    /* DosExitList functions */
  146.  
  147.    #define EXLST_ADD          1
  148.    #define EXLST_REMOVE       2
  149.    #define EXLST_EXIT         3
  150.  
  151.    APIRET APIENTRY DosExecPgm(PCHAR pObjname, LONG cbObjname, ULONG execFlag, PSZ pArg, PSZ pEnv, PRESULTCODES pRes, PSZ pName);
  152.  
  153.    /* DosExecPgm functions */
  154.  
  155.    #define EXEC_SYNC          0
  156.    #define EXEC_ASYNC         1
  157.    #define EXEC_ASYNCRESULT   2
  158.    #define EXEC_TRACE         3
  159.    #define EXEC_BACKGROUND    4
  160.    #define EXEC_LOAD          5
  161.    #define EXEC_ASYNCRESULTDB 6
  162.  
  163.  
  164.    APIRET APIENTRY  DosSetPriority(ULONG scope, ULONG pclass, LONG delta, ULONG PorTid);
  165.  
  166.    /* Priority scopes */
  167.  
  168.    #define PRTYS_PROCESS      0
  169.    #define PRTYS_PROCESSTREE  1
  170.    #define PRTYS_THREAD       2
  171.  
  172.    /* Priority classes */
  173.  
  174.    #define PRTYC_NOCHANGE     0
  175.    #define PRTYC_IDLETIME     1
  176.    #define PRTYC_REGULAR      2
  177.    #define PRTYC_TIMECRITICAL 3
  178.    #define PRTYC_FOREGROUNDSERVER 4
  179.  
  180.    /* Priority deltas */
  181.  
  182.    #define PRTYD_MINIMUM     -31
  183.    #define PRTYD_MAXIMUM      31
  184.  
  185.    APIRET APIENTRY DosKillProcess(ULONG action, PID pid);
  186.  
  187.    #define DKP_PROCESSTREE    0
  188.    #define DKP_PROCESS        1
  189. #endif /* INCL_DOSPROCESS */
  190.  
  191. #ifndef INCL_SAADEFS
  192.    /*************************************************************************\
  193.     * CCHMAXPATH is the maximum fully qualified path name length including  *
  194.     * the drive letter, colon, backslashes and terminating NULL.            *
  195.    \*************************************************************************/
  196.    #define CCHMAXPATH         260
  197.  
  198.    /*************************************************************************\
  199.     * CCHMAXPATHCOMP is the maximum individual path component name length   *
  200.     * including a terminating NULL.                                         *
  201.    \*************************************************************************/
  202.    #define CCHMAXPATHCOMP     256
  203. #endif  /* !INCL_SAADEFS */
  204.  
  205. #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
  206.    /*** File manager */
  207.    /* DosSetFilePtr() file position codes */
  208.  
  209.    #define FILE_BEGIN      0x0000   /* Move relative to beginning of file */
  210.    #define FILE_CURRENT    0x0001   /* Move relative to current fptr position */
  211.    #define FILE_END        0x0002   /* Move relative to end of file */
  212.  
  213.    /* DosFindFirst/Next Directory handle types */
  214.    #define HDIR_SYSTEM        1     /* Use system handle (1) */
  215.    #define HDIR_CREATE      (-1)    /* Allocate a new, unused handle */
  216.  
  217.    /* DosCopy control bits; may be or'ed together */
  218.    #define DCPY_EXISTING   0x0001   /* Copy even if target exists */
  219.    #define DCPY_APPEND     0x0002   /* Append to existing file, do not replace */
  220.    #define DCPY_FAILEAS    0x0004   /* Fail if EAs not supported on target*/
  221.  
  222.    /* DosOpen/DosQFHandState/DosQueryFileInfo et al file attributes; also */
  223.    /* known as Dos File Mode bits... */
  224.    #define FILE_NORMAL     0x0000
  225.    #define FILE_READONLY   0x0001
  226.    #define FILE_HIDDEN     0x0002
  227.    #define FILE_SYSTEM     0x0004
  228.    #define FILE_DIRECTORY  0x0010
  229.    #define FILE_ARCHIVED   0x0020
  230.  
  231.    #define FILE_IGNORE     0x10000     /* ignore file attribute in */
  232.                                        /* DosSetPath/File Info if */
  233.                                        /* this bit is set*/
  234.  
  235.    #define MUST_HAVE_READONLY      ( (FILE_READONLY  << 8) | FILE_READONLY  )
  236.    #define MUST_HAVE_HIDDEN        ( (FILE_HIDDEN    << 8) | FILE_HIDDEN    )
  237.    #define MUST_HAVE_SYSTEM        ( (FILE_SYSTEM    << 8) | FILE_SYSTEM    )
  238.    #define MUST_HAVE_DIRECTORY     ( (FILE_DIRECTORY << 8) | FILE_DIRECTORY )
  239.    #define MUST_HAVE_ARCHIVED      ( (FILE_ARCHIVED  << 8) | FILE_ARCHIVED  )
  240.  
  241.    /* DosOpen() actions */
  242.    #define FILE_EXISTED    0x0001
  243.    #define FILE_CREATED    0x0002
  244.    #define FILE_TRUNCATED  0x0003
  245.  
  246.    /* DosOpen() open flags */
  247.    #define FILE_OPEN       0x0001
  248.    #define FILE_TRUNCATE   0x0002
  249.    #define FILE_CREATE     0x0010
  250.  
  251.    /*     this nibble applies if file already exists                xxxx */
  252.    #define OPEN_ACTION_FAIL_IF_EXISTS     0x0000  /* ---- ---- ---- 0000 */
  253.    #define OPEN_ACTION_OPEN_IF_EXISTS     0x0001  /* ---- ---- ---- 0001 */
  254.    #define OPEN_ACTION_REPLACE_IF_EXISTS  0x0002  /* ---- ---- ---- 0010 */
  255.  
  256.    /*     this nibble applies if file does not exist           xxxx      */
  257.    #define OPEN_ACTION_FAIL_IF_NEW        0x0000  /* ---- ---- 0000 ---- */
  258.    #define OPEN_ACTION_CREATE_IF_NEW      0x0010  /* ---- ---- 0001 ---- */
  259.  
  260.    /* DosOpen/DosSetFHandState flags */
  261.    #define OPEN_ACCESS_READONLY           0x0000  /* ---- ---- ---- -000 */
  262.    #define OPEN_ACCESS_WRITEONLY          0x0001  /* ---- ---- ---- -001 */
  263.    #define OPEN_ACCESS_READWRITE          0x0002  /* ---- ---- ---- -010 */
  264.    #define OPEN_SHARE_DENYREADWRITE       0x0010  /* ---- ---- -001 ---- */
  265.    #define OPEN_SHARE_DENYWRITE           0x0020  /* ---- ---- -010 ---- */
  266.    #define OPEN_SHARE_DENYREAD            0x0030  /* ---- ---- -011 ---- */
  267.    #define OPEN_SHARE_DENYNONE            0x0040  /* ---- ---- -100 ---- */
  268.    #define OPEN_FLAGS_NOINHERIT           0x0080  /* ---- ---- 1--- ---- */
  269.    #define OPEN_FLAGS_NO_LOCALITY         0x0000  /* ---- -000 ---- ---- */
  270.    #define OPEN_FLAGS_SEQUENTIAL          0x0100  /* ---- -001 ---- ---- */
  271.    #define OPEN_FLAGS_RANDOM              0x0200  /* ---- -010 ---- ---- */
  272.    #define OPEN_FLAGS_RANDOMSEQUENTIAL    0x0300  /* ---- -011 ---- ---- */
  273.    #define OPEN_FLAGS_NO_CACHE            0x1000  /* ---1 ---- ---- ---- */
  274.    #define OPEN_FLAGS_FAIL_ON_ERROR       0x2000  /* --1- ---- ---- ---- */
  275.    #define OPEN_FLAGS_WRITE_THROUGH       0x4000  /* -1-- ---- ---- ---- */
  276.    #define OPEN_FLAGS_DASD                0x8000  /* 1--- ---- ---- ---- */
  277.    #define OPEN_FLAGS_NONSPOOLED          0x00040000
  278.  
  279.  
  280.    /* DosSearchPath() constants */
  281.    #define SEARCH_PATH           0x0000
  282.    #define SEARCH_CUR_DIRECTORY  0x0001
  283.    #define SEARCH_ENVIRONMENT    0x0002
  284.    #define SEARCH_IGNORENETERRS  0x0004
  285.  
  286.  
  287.    /************************************************************
  288.    EA Info Levels & Find First/Next
  289.    =========================================
  290.    API's: DosFindFirst, DosQueryFileInfo, DosQueryPathInfo, DosSetFileInfo,
  291.           DosSetPathInfo
  292.    ************************************************************/
  293.  
  294.    /* File info levels&gml All listed API's */
  295.    #define FIL_STANDARD          1     /* Info level 1, standard file info */
  296.    #define FIL_QUERYEASIZE       2     /* Level 2, return Full EA size */
  297.    #define FIL_QUERYEASFROMLIST  3     /* Level 3, return requested EA's */
  298.  
  299.    /* File info levels: Dos...PathInfo only */
  300.    #define FIL_QUERYFULLNAME     5     /* Level 5, return fully qualified
  301.                                            name of file */
  302.  
  303.  
  304.    /* DosFsAttach() */
  305.    /* Attact or detach */
  306.    #define FS_ATTACH             0     /* Attach file server */
  307.    #define FS_DETACH             1     /* Detach file server */
  308.    #define FS_SPOOLATTACH        2     /* Register a spooler device */
  309.    #define FS_SPOOLDETACH        3     /* De-register a spooler device */
  310.  
  311.  
  312.    /* DosFsCtl() */
  313.    /* Routing type */
  314.    #define FSCTL_HANDLE          1     /* File Handle directs req routing */
  315.    #define FSCTL_PATHNAME        2     /* Path Name directs req routing */
  316.    #define FSCTL_FSDNAME         3     /* FSD Name directs req routing */
  317.  
  318.    /* defined FSCTL functions */
  319.    #define FSCTL_ERROR_INFO      1     /* return error info from FSD */
  320.    #define FSCTL_MAX_EASIZE      2     /* Max ea size for the FSD */
  321.  
  322.    typedef struct  _EASIZEBUF       /* struct for FSCTL fn 2 - max ea size */
  323.            {
  324.            USHORT  cbMaxEASize;        /* max. size of one EA */
  325.            ULONG   cbMaxEAListSize;    /* max size of the full EA List */
  326.            } EASIZEBUF;
  327.    typedef EASIZEBUF  *PEASIZEBUF;
  328.  
  329.  
  330.  
  331.    /* DosQueryFSAttach() */
  332.    /* Information level types (defines method of query) */
  333.    #define FSAIL_QUERYNAME       1     /* Return data for a Drive or Device */
  334.    #define FSAIL_DEVNUMBER       2     /* Return data for Ordinal Device # */
  335.    #define FSAIL_DRVNUMBER       3     /* Return data for Ordinal Drive # */
  336.  
  337.    /* Item types (from data structure item "iType") */
  338.    #define FSAT_CHARDEV          1     /* Resident character device */
  339.    #define FSAT_PSEUDODEV        2     /* Pusedu-character device */
  340.    #define FSAT_LOCALDRV         3     /* Local drive */
  341.    #define FSAT_REMOTEDRV        4     /* Remote drive attached to FSD */
  342.  
  343.    typedef struct  _FSQBUFFER       /* fsqbuf Data structure for QFSAttach*/
  344.            {
  345.            USHORT  iType;              /* Item type */
  346.            USHORT  cbName;             /* Length of item name, sans NULL */
  347.            UCHAR   szName[1];          /* ASCIIZ item name */
  348.            USHORT  cbFSDName;          /* Length of FSD name, sans NULL */
  349.            UCHAR   szFSDName[1];       /* ASCIIZ FSD name */
  350.            USHORT  cbFSAData;          /* Length of FSD Attach data returned */
  351.            UCHAR   rgFSAData[1];       /* FSD Attach data from FSD */
  352.            } FSQBUFFER;
  353.    typedef FSQBUFFER  *PFSQBUFFER;
  354.  
  355.  
  356.    typedef struct _FSQBUFFER2       /* fsqbuf Data structure for QFSAttach*/
  357.            {
  358.            USHORT  iType;
  359.            USHORT  cbName;
  360.            USHORT  cbFSDName;
  361.            USHORT  cbFSAData;
  362.            UCHAR   szName[1];
  363.            UCHAR   szFSDName[1];
  364.            UCHAR   rgFSAData[1];
  365.            } FSQBUFFER2;
  366.    typedef FSQBUFFER2 *PFSQBUFFER2;
  367.  
  368.    typedef struct _SPOOLATTACH      /* Data structure for spooler operations */
  369.            {
  370.            USHORT  hNmPipe;            /* Named pipe handle */
  371.            ULONG   ulKey;              /* Attached key */
  372.            } SPOOLATTACH;
  373.    typedef SPOOLATTACH  *PSPOOLATTACH;
  374.  
  375.  
  376.    /*****************************************************************************
  377.    * File System Drive Information&gml DosQueryFSInfo DosSetFSInfo              *
  378.    *****************************************************************************/
  379.  
  380.    /* FS Drive Info Levels */
  381.    #define FSIL_ALLOC            1     /* Drive allocation info (Query only) */
  382.    #define FSIL_VOLSER           2     /* Drive Volum/Serial info */
  383.  
  384.    /* DosQueryFHType() */
  385.    /* Handle classes (low 8 bits of Handle Type) */
  386.    #define FHT_DISKFILE          0x0000   /* Disk file handle */
  387.    #define FHT_CHRDEV            0x0001   /* Character device handle */
  388.    #define FHT_PIPE              0x0002   /* Pipe handle */
  389.  
  390.    /* Handle bits (high 8 bits of Handle Type) */
  391.    #define FHB_DSKREMOTE         0x8000   /* Remote disk */
  392.    #define FHB_CHRDEVREMOTE      0x8000   /* Remote character device */
  393.    #define FHB_PIPEREMOTE        0x8000   /* Remote pipe */
  394.  
  395.  
  396.  
  397.    #ifndef INCL_SAADEFS
  398.       /* File time and date types */
  399.       #ifdef __IBMC__
  400.       typedef struct _FTIME           /* ftime */
  401.               {
  402.               UINT   twosecs : 5;
  403.               UINT   minutes : 6;
  404.               UINT   hours   : 5;
  405.               } FTIME;
  406.       typedef FTIME *PFTIME;
  407.  
  408.       #else
  409.       typedef struct _FTIME           /* ftime */
  410.               {
  411.               USHORT   twosecs : 5;
  412.               USHORT   minutes : 6;
  413.               USHORT   hours   : 5;
  414.               } FTIME;
  415.       typedef FTIME *PFTIME;
  416.       #endif
  417.  
  418.       #ifdef __IBMC__
  419.       typedef struct _FDATE           /* fdate */
  420.               {
  421.               UINT   day     : 5;
  422.               UINT   month   : 4;
  423.               UINT   year    : 7;
  424.               } FDATE;
  425.       typedef FDATE   *PFDATE;
  426.  
  427.       #else
  428.       typedef struct _FDATE           /* fdate */
  429.               {
  430.               USHORT   day     : 5;
  431.               USHORT   month   : 4;
  432.               USHORT   year    : 7;
  433.               } FDATE;
  434.       typedef FDATE   *PFDATE;
  435.       #endif
  436.    #endif /* INCL_SAADEFS */
  437.  
  438.  
  439.  
  440.    typedef struct _VOLUMELABEL      /* vol */
  441.            {
  442.            BYTE cch;
  443.            CHAR szVolLabel[12];
  444.            } VOLUMELABEL;
  445.    typedef VOLUMELABEL  *PVOLUMELABEL;
  446.  
  447.    typedef struct _FSINFO      /* fsinf */
  448.            {
  449.            FDATE fdateCreation;
  450.            FTIME ftimeCreation;
  451.            VOLUMELABEL vol;
  452.            } FSINFO;
  453.     typedef FSINFO *PFSINFO;
  454.  
  455.    /* HANDTYPE values */
  456.    #define HANDTYPE_FILE         0x0000
  457.    #define HANDTYPE_DEVICE       0x0001
  458.    #define HANDTYPE_PIPE         0x0002
  459.    #define HANDTYPE_NETWORK      0x8000
  460.  
  461.    typedef struct _FILELOCK      /* flock */
  462.            {
  463.            LONG lOffset;
  464.            LONG lRange;
  465.            } FILELOCK;
  466.    typedef FILELOCK  *PFILELOCK;
  467.  
  468.    typedef LHANDLE HFILE;     /* hf */
  469.    typedef HFILE   *PHFILE;
  470.  
  471.    #ifndef __HEV__            /* INCL_SEMAPHORE may also define HEV */
  472.       #define __HEV__
  473.       typedef  ULONG    HEV;             /* hev */
  474.       typedef  HEV      *PHEV;
  475.    #endif
  476.  
  477.    APIRET APIENTRY DosSetFileLocks(HFILE hFile, PFILELOCK pflUnlock, PFILELOCK pflLock, ULONG timeout, ULONG flags);
  478.    APIRET APIENTRY DosCancelLockRequest(HFILE hFile, PFILELOCK pflLock);
  479.  
  480.  
  481.    #ifndef INCL_SAADEFS
  482.  
  483.       typedef struct _FILEFINDBUF     /* findbuf */
  484.               {
  485.               FDATE  fdateCreation;
  486.               FTIME  ftimeCreation;
  487.               FDATE  fdateLastAccess;
  488.               FTIME  ftimeLastAccess;
  489.               FDATE  fdateLastWrite;
  490.               FTIME  ftimeLastWrite;
  491.               ULONG  cbFile;
  492.               ULONG  cbFileAlloc;
  493.               USHORT attrFile;
  494.               UCHAR  cchName;
  495.               CHAR   achName[CCHMAXPATHCOMP];
  496.               } FILEFINDBUF;
  497.  
  498.       typedef FILEFINDBUF *PFILEFINDBUF;
  499.  
  500. /*XLATOFF */
  501. #pragma pack(2)
  502. /*XLATON  */
  503.       typedef struct _FILEFINDBUF2    /* findbuf2 */
  504.               {
  505.               FDATE  fdateCreation;
  506.               FTIME  ftimeCreation;
  507.               FDATE  fdateLastAccess;
  508.               FTIME  ftimeLastAccess;
  509.               FDATE  fdateLastWrite;
  510.               FTIME  ftimeLastWrite;
  511.               ULONG  cbFile;
  512.               ULONG  cbFileAlloc;
  513.               USHORT attrFile;
  514.               ULONG  cbList;
  515.               UCHAR  cchName;
  516.               CHAR   achName[CCHMAXPATHCOMP];
  517.               } FILEFINDBUF2;
  518.       typedef FILEFINDBUF2 *PFILEFINDBUF2;
  519.  
  520.       typedef struct _FILEFINDBUF3                 /* findbuf3 */
  521.               {
  522.               ULONG   oNextEntryOffset;            /* new field */
  523.               FDATE   fdateCreation;
  524.               FTIME   ftimeCreation;
  525.               FDATE   fdateLastAccess;
  526.               FTIME   ftimeLastAccess;
  527.               FDATE   fdateLastWrite;
  528.               FTIME   ftimeLastWrite;
  529.               ULONG   cbFile;
  530.               ULONG   cbFileAlloc;
  531.               ULONG   attrFile;                    /* widened field */
  532.               UCHAR   cchName;
  533.               CHAR    achName[CCHMAXPATHCOMP];
  534.               } FILEFINDBUF3;
  535.       typedef FILEFINDBUF3 *PFILEFINDBUF3;
  536.  
  537.       typedef struct _FILEFINDBUF4                 /* findbuf4 */
  538.               {
  539.               ULONG   oNextEntryOffset;            /* new field */
  540.               FDATE   fdateCreation;
  541.               FTIME   ftimeCreation;
  542.               FDATE   fdateLastAccess;
  543.               FTIME   ftimeLastAccess;
  544.               FDATE   fdateLastWrite;
  545.               FTIME   ftimeLastWrite;
  546.               ULONG   cbFile;
  547.               ULONG   cbFileAlloc;
  548.               ULONG   attrFile;                    /* widened field */
  549.               ULONG   cbList;
  550.               UCHAR   cchName;
  551.               CHAR    achName[CCHMAXPATHCOMP];
  552.               } FILEFINDBUF4;
  553.       typedef FILEFINDBUF4  *PFILEFINDBUF4;
  554.  
  555.       /* extended attribute structures */
  556.  
  557.       typedef struct _GEA         /* gea */
  558.               {
  559.               BYTE cbName;        /* name length not including NULL */
  560.               CHAR szName[1];     /* attribute name */
  561.               } GEA;
  562.       typedef GEA *PGEA;
  563.  
  564.       typedef struct _GEALIST     /* geal */
  565.               {
  566.               ULONG cbList;       /* total bytes of structure including full list */
  567.               GEA list[1];        /* variable length GEA structures */
  568.               } GEALIST;
  569.       typedef GEALIST  *PGEALIST;
  570.  
  571.       typedef struct _FEA         /* fea */
  572.               {
  573.               BYTE fEA;           /* flags                              */
  574.               BYTE cbName;        /* name length not including NULL */
  575.               USHORT cbValue;     /* value length */
  576.               } FEA;
  577.       typedef FEA *PFEA;
  578.  
  579.       /* flags for _FEA.fEA */
  580.       #define FEA_NEEDEA         0x80     /* need EA bit */
  581.  
  582.       typedef struct _FEALIST     /* feal */
  583.               {
  584.               ULONG cbList;       /* total bytes of structure including full list */
  585.               FEA list[1];        /* variable length FEA structures */
  586.               } FEALIST;
  587.       typedef FEALIST *PFEALIST;
  588.  
  589.       typedef struct _EAOP        /* eaop */
  590.               {
  591.               PGEALIST fpGEAList; /* general EA list */
  592.               PFEALIST fpFEAList; /* full EA list */
  593.               ULONG oError;
  594.               } EAOP;
  595.        typedef EAOP *PEAOP;
  596.  
  597. /*XLATOFF*/
  598. #pragma pack(1)
  599. /*XLATON*/
  600.  
  601.       typedef struct _FEA2         /* fea2 */
  602.               {
  603.               ULONG   oNextEntryOffset;    /* new field */
  604.               BYTE    fEA;
  605.               BYTE    cbName;
  606.               USHORT  cbValue;
  607.               CHAR    szName[1];           /* new field */
  608.               } FEA2;
  609.       typedef FEA2 *PFEA2;
  610.  
  611.       /* flags for _FEA.fEA */
  612.       #define FEA_NEEDEA         0x80      /* need EA bit */
  613.  
  614.       typedef struct _FEA2LIST     /* fea2l */
  615.               {
  616.               ULONG   cbList;
  617.               FEA2    list[1];
  618.               } FEA2LIST;
  619.       typedef FEA2LIST *PFEA2LIST;
  620.  
  621.       typedef struct _GEA2          /* gea2 */
  622.               {
  623.               ULONG   oNextEntryOffset;     /* new field */
  624.               BYTE    cbName;
  625.               CHAR    szName[1];            /* new field */
  626.               } GEA2;
  627.       typedef GEA2 *PGEA2;
  628.  
  629.       typedef struct _GEA2LIST      /* gea2l */
  630.               {
  631.               ULONG   cbList;
  632.               GEA2    list[1];
  633.               } GEA2LIST;
  634.       typedef GEA2LIST *PGEA2LIST;
  635.  
  636.       typedef struct _EAOP2         /* eaop2 */
  637.               {
  638.               PGEA2LIST   fpGEA2List;       /* GEA set */
  639.               PFEA2LIST   fpFEA2List;       /* FEA set */
  640.               ULONG       oError;           /* offset of FEA error */
  641.               } EAOP2;
  642.       typedef EAOP2 *PEAOP2;
  643.  
  644.  
  645.       /*
  646.        * Equates for the types of EAs that follow the convention that we have
  647.        * established.
  648.        *
  649.        * Values 0xFFFE thru 0x8000 are reserved.
  650.        * Values 0x0000 thru 0x7fff are user definable.
  651.        * Value  0xFFFC is not used
  652.        */
  653.  
  654.       #define EAT_BINARY      0xFFFE      /* length preceeded binary */
  655.       #define EAT_ASCII       0xFFFD      /* length preceeded ASCII */
  656.       #define EAT_BITMAP      0xFFFB      /* length preceeded bitmap */
  657.       #define EAT_METAFILE    0xFFFA      /* length preceeded metafile */
  658.       #define EAT_ICON        0xFFF9      /* length preceeded icon */
  659.       #define EAT_EA          0xFFEE      /* length preceeded ASCII */
  660.                                           /* name of associated data (#include) */
  661.       #define EAT_MVMT        0xFFDF      /* multi-valued, multi-typed field */
  662.       #define EAT_MVST        0xFFDE      /* multi-valued, single-typed field */
  663.       #define EAT_ASN1        0xFFDD      /* ASN.1 field */
  664.  
  665.    #endif  /* !INCL_SAADEFS */
  666. /*XLATOFF*/
  667. #pragma pack()
  668. /*XLATON*/
  669.  
  670.  
  671.  
  672.    APIRET APIENTRY  DosOpen(PSZ    pszFileName,
  673.                             PHFILE pHf,
  674.                             PULONG pulAction,
  675.                             ULONG  cbFile,
  676.                             ULONG  ulAttribute,
  677.                             ULONG  fsOpenFlags,
  678.                             ULONG  fsOpenMode,
  679.                             PEAOP2 peaop2);
  680.  
  681.    APIRET APIENTRY  DosClose(HFILE hFile);
  682.  
  683.    APIRET APIENTRY  DosRead(HFILE hFile, PVOID pBuffer, ULONG cbRead, PULONG pcbActual);
  684.  
  685.    APIRET APIENTRY  DosWrite(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual);
  686.  
  687.    /* File time and date types */
  688.  
  689.    typedef struct _FILESTATUS      /* fsts */
  690.            {
  691.            FDATE  fdateCreation;
  692.            FTIME  ftimeCreation;
  693.            FDATE  fdateLastAccess;
  694.            FTIME  ftimeLastAccess;
  695.            FDATE  fdateLastWrite;
  696.            FTIME  ftimeLastWrite;
  697.            ULONG  cbFile;
  698.            ULONG  cbFileAlloc;
  699.            USHORT attrFile;
  700.            } FILESTATUS;
  701.    typedef FILESTATUS *PFILESTATUS;
  702.  
  703.    typedef struct _FILESTATUS2     /* fsts2 */
  704.            {
  705.            FDATE  fdateCreation;
  706.            FTIME  ftimeCreation;
  707.            FDATE  fdateLastAccess;
  708.            FTIME  ftimeLastAccess;
  709.            FDATE  fdateLastWrite;
  710.            FTIME  ftimeLastWrite;
  711.            ULONG  cbFile;
  712.            ULONG  cbFileAlloc;
  713.            USHORT attrFile;
  714.            ULONG  cbList;
  715.            } FILESTATUS2;
  716.    typedef FILESTATUS2 *PFILESTATUS2;
  717.  
  718.    typedef struct _FILESTATUS3     /* fsts3 */
  719.            {
  720.            FDATE  fdateCreation;
  721.            FTIME  ftimeCreation;
  722.            FDATE  fdateLastAccess;
  723.            FTIME  ftimeLastAccess;
  724.            FDATE  fdateLastWrite;
  725.            FTIME  ftimeLastWrite;
  726.            ULONG  cbFile;
  727.            ULONG  cbFileAlloc;
  728.            ULONG  attrFile;
  729.            } FILESTATUS3;
  730.    typedef FILESTATUS3 *PFILESTATUS3;
  731.  
  732.    typedef struct _FILESTATUS4      /* fsts4 */
  733.            {
  734.            FDATE  fdateCreation;
  735.            FTIME  ftimeCreation;
  736.            FDATE  fdateLastAccess;
  737.            FTIME  ftimeLastAccess;
  738.            FDATE  fdateLastWrite;
  739.            FTIME  ftimeLastWrite;
  740.            ULONG  cbFile;
  741.            ULONG  cbFileAlloc;
  742.            ULONG  attrFile;
  743.            ULONG  cbList;
  744.            } FILESTATUS4;
  745.    typedef FILESTATUS4  *PFILESTATUS4;
  746.  
  747.  
  748.    typedef struct _FSALLOCATE      /* fsalloc */
  749.            {
  750.            ULONG  idFileSystem;
  751.            ULONG  cSectorUnit;
  752.            ULONG  cUnit;
  753.            ULONG  cUnitAvail;
  754.            USHORT cbSector;
  755.            } FSALLOCATE;
  756.    typedef FSALLOCATE *PFSALLOCATE;
  757.  
  758.    typedef LHANDLE HDIR;        /* hdir */
  759.    typedef HDIR    *PHDIR;
  760.  
  761.    #define DosOpen2        DosOpen
  762.    #define DosFindFirst2   DosFindFirst
  763.    #define DosQFHandState  DosQueryFHState
  764.    #define DosSetFHandState        DosSetFHState
  765.    #define DosQHandType    DosQueryHType
  766.    #define DosQFSAttach    DosQueryFSAttach
  767.    #define DosNewSize      DosSetFileSize
  768.    #define DosBufReset     DosResetBuffer
  769.    #define DosChgFilePtr   DosSetFilePtr
  770.    #define DosMkDir        DosCreateDir
  771.    #define DosMkDir2       DosCreateDir
  772.    #define DosRmDir        DosDeleteDir
  773.    #define DosSelectDisk   DosSetDefaultDisk
  774.    #define DosQCurDisk     DosQueryCurrentDisk
  775.    #define DosChDir        DosSetCurrentDir
  776.    #define DosQCurDir      DosQueryCurrentDir
  777.    #define DosQFSInfo      DosQueryFSInfo
  778.    #define DosQVerify      DosQueryVerify
  779.    #define DosQFileInfo    DosQueryFileInfo
  780.    #define DosQPathInfo    DosQueryPathInfo
  781.  
  782.    APIRET APIENTRY  DosDelete(PSZ pszFile);
  783.  
  784.    APIRET APIENTRY  DosForceDelete(PSZ pszFile);
  785.  
  786.    APIRET APIENTRY  DosDupHandle(HFILE hFile, PHFILE pHfile);
  787.  
  788.    APIRET APIENTRY  DosQueryFHState(HFILE hFile, PULONG pMode);
  789.  
  790.    APIRET APIENTRY  DosSetFHState(HFILE hFile, ULONG mode);
  791.  
  792.    APIRET APIENTRY  DosQueryHType(HFILE hFile, PULONG pType, PULONG pAttr);
  793.  
  794.    APIRET APIENTRY  DosFindFirst(PSZ    pszFileSpec,
  795.                                  PHDIR  phdir,
  796.                                  ULONG  flAttribute,
  797.                                  PVOID  pfindbuf,
  798.                                  ULONG  cbBuf,
  799.                                  PULONG pcFileNames,
  800.                                  ULONG  ulInfoLevel);
  801.  
  802.    APIRET APIENTRY  DosFindNext(HDIR   hDir,
  803.                                 PVOID  pfindbuf,
  804.                                 ULONG  cbfindbuf,
  805.                                 PULONG pcFilenames);
  806.  
  807.    APIRET APIENTRY  DosFindClose(HDIR hDir);
  808.  
  809.    APIRET APIENTRY  DosFSAttach(PSZ pszDevice, PSZ pszFilesystem, PVOID pData, ULONG cbData, ULONG flag);
  810.  
  811.    APIRET APIENTRY  DosQueryFSAttach(PSZ    pszDeviceName,
  812.                                      ULONG  ulOrdinal,
  813.                                      ULONG  ulFSAInfoLevel,
  814.                                      PFSQBUFFER2 pfsqb,
  815.                                      PULONG pcbBuffLength);
  816.  
  817.    APIRET APIENTRY  DosFSCtl(PVOID pData, ULONG cbData, PULONG pcbData, PVOID pParms, ULONG cbParms, PULONG pcbParms, ULONG function, PSZ pszRoute, HFILE hFile, ULONG method);
  818.  
  819.    APIRET APIENTRY  DosSetFileSize(HFILE hFile, ULONG cbSize);
  820.  
  821.    APIRET APIENTRY  DosResetBuffer(HFILE hFile);
  822.  
  823.    APIRET APIENTRY  DosSetFilePtr(HFILE hFile, LONG ib, ULONG method, PULONG ibActual);
  824.  
  825.    APIRET APIENTRY  DosMove(PSZ pszOld, PSZ pszNew);
  826.  
  827.    APIRET APIENTRY  DosCopy(PSZ pszOld, PSZ pszNew, ULONG option);
  828.  
  829.    APIRET APIENTRY  DosEditName(ULONG metalevel, PSZ pszSource, PSZ pszEdit, PBYTE pszTarget, ULONG cbTarget);
  830.  
  831.    APIRET APIENTRY  DosCreateDir(PSZ pszDirName, PEAOP2 peaop2);
  832.  
  833.    APIRET APIENTRY  DosDeleteDir(PSZ pszDir);
  834.  
  835.    APIRET APIENTRY  DosSetDefaultDisk(ULONG disknum);
  836.  
  837.    APIRET APIENTRY  DosQueryCurrentDisk(PULONG pdisknum, PULONG plogical);
  838.  
  839.    APIRET APIENTRY  DosSetCurrentDir(PSZ pszDir);
  840.  
  841.    APIRET APIENTRY  DosQueryCurrentDir(ULONG disknum, PBYTE pBuf, PULONG pcbBuf);
  842.  
  843.    APIRET APIENTRY  DosQueryFSInfo(ULONG disknum, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
  844.  
  845.    APIRET APIENTRY  DosSetFSInfo(ULONG disknum, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
  846.  
  847.    APIRET APIENTRY  DosQueryVerify(PBOOL32 pBool);
  848.  
  849.    APIRET APIENTRY  DosSetVerify(BOOL32);
  850.  
  851.    APIRET APIENTRY  DosSetMaxFH(ULONG cFH);
  852.  
  853.    APIRET APIENTRY  DosSetRelMaxFH(PLONG pcbReqCount, PULONG pcbCurMaxFH);
  854.  
  855.    APIRET APIENTRY  DosQueryFileInfo(HFILE hf,
  856.                                      ULONG ulInfoLevel,
  857.                                      PVOID pInfo,
  858.                                      ULONG cbInfoBuf);
  859.  
  860.    APIRET APIENTRY  DosSetFileInfo(HFILE hf,
  861.                                    ULONG ulInfoLevel,
  862.                                    PVOID pInfoBuf,
  863.                                    ULONG cbInfoBuf);
  864.  
  865.    APIRET APIENTRY  DosQueryPathInfo(PSZ   pszPathName,
  866.                                      ULONG ulInfoLevel,
  867.                                      PVOID pInfoBuf,
  868.                                      ULONG cbInfoBuf);
  869.  
  870.    APIRET APIENTRY  DosSetPathInfo(PSZ   pszPathName,
  871.                                    ULONG ulInfoLevel,
  872.                                    PVOID pInfoBuf,
  873.                                    ULONG cbInfoBuf,
  874.                                    ULONG flOptions);
  875.  
  876.    /* defines for DosSetPathInfo -pathinfo flag */
  877.    #define DSPI_WRTTHRU    0x10    /* write through */
  878.  
  879.    APIRET APIENTRY  DosShutdown(ULONG ulReserved);
  880.  
  881.    APIRET APIENTRY  DosEnumAttribute(ULONG  ulRefType,
  882.                                      PVOID  pvFile,
  883.                                      ULONG  ulEntry,
  884.                                      PVOID  pvBuf,
  885.                                      ULONG  cbBuf,
  886.                                      PULONG pulCount,
  887.                                      ULONG  ulInfoLevel);
  888. /*XLATOFF*/
  889. #pragma pack(1)
  890. /*XLATON */
  891.  
  892.    typedef struct _DENA1 /* _dena1 level 1 info returned from DosEnumAttribute */
  893.            {
  894.            UCHAR       reserved;       /* 0 */
  895.            UCHAR       cbName;         /* length of name exculding NULL */
  896.            USHORT      cbValue;        /* length of value */
  897.            UCHAR       szName[1];      /* variable length asciiz name */
  898.            } DENA1;
  899.    typedef DENA1 *PDENA1;
  900.  
  901.    typedef FEA2  DENA2;
  902.    typedef PFEA2 PDENA2;
  903.  
  904. /*XLATOFF*/
  905. #pragma pack()
  906. /*XLATON */
  907.    /* Infolevels for DosEnumAttribute  */
  908.    #define ENUMEA_LEVEL_NO_VALUE   1L      /* FEA without value */
  909.    /* Reference types for DosEnumAttribute */
  910.    #define ENUMEA_REFTYPE_FHANDLE  0       /* file handle */
  911.    #define ENUMEA_REFTYPE_PATH     1       /* path name */
  912.    #define ENUMEA_REFTYPE_MAX      ENUMEA_REFTYPE_PATH
  913.  
  914. #endif /* common INCL_DOSFILEMGR */
  915.  
  916. #if (defined(INCL_DOSMEMMGR) || !defined(INCL_NOCOMMON))
  917.    /*** Memory management */
  918.  
  919.    APIRET APIENTRY  DosAllocMem(PPVOID ppb, ULONG cb, ULONG flag);
  920.  
  921.    APIRET APIENTRY  DosFreeMem(PVOID pb);
  922.  
  923.    APIRET APIENTRY  DosSetMem(PVOID pb, ULONG cb, ULONG flag);
  924.  
  925.    APIRET APIENTRY  DosGiveSharedMem(PVOID pb, PID pid, ULONG flag);
  926.  
  927.    APIRET APIENTRY  DosGetSharedMem(PVOID pb, ULONG flag);
  928.  
  929.    APIRET APIENTRY  DosGetNamedSharedMem(PPVOID ppb, PSZ pszName, ULONG flag);
  930.  
  931.    APIRET APIENTRY  DosAllocSharedMem(PPVOID ppb, PSZ pszName, ULONG cb, ULONG flag);
  932.  
  933.    APIRET APIENTRY  DosQueryMem(PVOID pb, PULONG pcb, PULONG pFlag);
  934.  
  935.    #define DosSubAlloc     DosSubAllocMem
  936.    #define DOSSUBALLOC     DosSubAllocMem
  937.    APIRET APIENTRY  DosSubAllocMem(PVOID pbBase, PPVOID ppb, ULONG cb);
  938.  
  939.    #define DosSubFree      DosSubFreeMem
  940.    #define DOSSUBFREE      DosSubFreeMem
  941.    APIRET APIENTRY  DosSubFreeMem(PVOID pbBase, PVOID pb, ULONG cb);
  942.  
  943.    #define DosSubSet       DosSubSetMem
  944.    #define DOSSUBSET       DosSubSetMem
  945.    APIRET APIENTRY  DosSubSetMem(PVOID pbBase, ULONG flag, ULONG cb);
  946.  
  947.    #define DosSubUnset     DosSubUnsetMem
  948.    #define DOSSUBUNSET     DosSubUnsetMem
  949.    APIRET APIENTRY  DosSubUnsetMem(PVOID pbBase);
  950.  
  951.    #include <bsememf.h>    /* get flags for API                            */
  952.  
  953. #endif /* INCL_DOSMEMMGR */
  954.  
  955.  
  956.  
  957. #if (defined(INCL_DOSSEMAPHORES) || !defined(INCL_NOCOMMON))
  958.  
  959.    /*
  960.     *     32-bit Semaphore Support
  961.     */
  962.  
  963.    /* Semaphore Attributes */
  964.  
  965.    #define DC_SEM_SHARED   0x01   /* DosCreateMutex, DosCreateEvent, and     */
  966.                                   /*   DosCreateMuxWait use it to indicate   */
  967.                                   /*   whether the semaphore is shared or    */
  968.                                   /*   private when the PSZ is null          */
  969.    #define DCMW_WAIT_ANY   0x02   /* DosCreateMuxWait option for wait on any */
  970.                                   /*   event/mutex to occur                  */
  971.    #define DCMW_WAIT_ALL   0x04   /* DosCreateMuxWait option for wait on all */
  972.                                   /*   events/mutexs to occur                */
  973.  
  974.    #define SEM_INDEFINITE_WAIT     -1L
  975.    #define SEM_IMMEDIATE_RETURN     0L
  976.  
  977.    #ifndef __HSEM__
  978.       #define __HSEM__
  979.       typedef VOID *HSEM;
  980.       typedef HSEM *PHSEM;
  981.    #endif
  982.  
  983.    typedef struct _PSEMRECORD      /* psr */
  984.            {
  985.            HSEM        hsemCur;
  986.            ULONG       ulUser;
  987.            } SEMRECORD;
  988.    typedef SEMRECORD *PSEMRECORD;
  989.  
  990. #endif /* common INCL_DOSSEMAPHORES */
  991.  
  992.  
  993.  
  994. #ifdef INCL_DOSSEMAPHORES
  995.  
  996.    #ifndef __HEV__            /* INCL_SEMAPHORE may also define HEV */
  997.       #define __HEV__
  998.       typedef  ULONG    HEV;             /* hev */
  999.       typedef  HEV      *PHEV;
  1000.    #endif
  1001.  
  1002.    typedef  ULONG    HMTX;            /* hmtx */
  1003.    typedef  HMTX     *PHMTX;
  1004.    typedef  ULONG    HMUX;            /* hmux */
  1005.    typedef  HMUX     *PHMUX;
  1006.  
  1007.    APIRET APIENTRY  DosCreateEventSem (PSZ pszName, PHEV phev, ULONG flAttr, BOOL32 fState);
  1008.  
  1009.    APIRET APIENTRY  DosOpenEventSem (PSZ pszName, PHEV phev);
  1010.  
  1011.    APIRET APIENTRY  DosCloseEventSem (HEV hev);
  1012.  
  1013.    APIRET APIENTRY  DosResetEventSem (HEV hev, PULONG pulPostCt);
  1014.  
  1015.    APIRET APIENTRY  DosPostEventSem (HEV hev);
  1016.  
  1017.    APIRET APIENTRY  DosWaitEventSem (HEV hev, ULONG ulTimeout);
  1018.  
  1019.    APIRET APIENTRY  DosQueryEventSem (HEV hev, PULONG pulPostCt);
  1020.  
  1021.    APIRET APIENTRY  DosCreateMutexSem (PSZ pszName, PHMTX phmtx, ULONG flAttr, BOOL32 fState);
  1022.  
  1023.    APIRET APIENTRY  DosOpenMutexSem (PSZ pszName, PHMTX phmtx);
  1024.  
  1025.    APIRET APIENTRY  DosCloseMutexSem (HMTX hmtx);
  1026.  
  1027.    APIRET APIENTRY  DosRequestMutexSem (HMTX hmtx, ULONG ulTimeout);
  1028.  
  1029.    APIRET APIENTRY  DosReleaseMutexSem (HMTX hmtx);
  1030.  
  1031.    APIRET APIENTRY  DosQueryMutexSem (HMTX hmtx, PID *ppid, TID *ptid, PULONG pulCount);
  1032.  
  1033.    APIRET APIENTRY  DosCreateMuxWaitSem (PSZ pszName, PHMUX phmux, ULONG cSemRec, PSEMRECORD pSemRec, ULONG flAttr);
  1034.  
  1035.    APIRET APIENTRY  DosOpenMuxWaitSem (PSZ pszName, PHMUX phmux);
  1036.  
  1037.    APIRET APIENTRY  DosCloseMuxWaitSem (HMUX hmux);
  1038.  
  1039.    APIRET APIENTRY  DosWaitMuxWaitSem (HMUX hmux, ULONG ulTimeout, PULONG pulUser);
  1040.  
  1041.    APIRET APIENTRY  DosAddMuxWaitSem (HMUX hmux, PSEMRECORD pSemRec);
  1042.  
  1043.    APIRET APIENTRY  DosDeleteMuxWaitSem (HMUX hmux, HSEM hSem);
  1044.  
  1045.    APIRET APIENTRY  DosQueryMuxWaitSem (HMUX hmux, PULONG pcSemRec, PSEMRECORD pSemRec, PULONG pflAttr);
  1046.  
  1047. #endif /* INCL_DOSSEMAPHORES */
  1048.  
  1049.  
  1050.  
  1051. #if (defined(INCL_DOSDATETIME) || !defined(INCL_NOCOMMON))
  1052.  
  1053.    /*** Time support */
  1054.  
  1055.    typedef struct _DATETIME      /* date */
  1056.            {
  1057.            UCHAR   hours;
  1058.            UCHAR   minutes;
  1059.            UCHAR   seconds;
  1060.            UCHAR   hundredths;
  1061.            UCHAR   day;
  1062.            UCHAR   month;
  1063.            USHORT  year;
  1064.            SHORT   timezone;
  1065.            UCHAR   weekday;
  1066.            } DATETIME;
  1067.   typedef DATETIME *PDATETIME;
  1068.  
  1069.   APIRET APIENTRY   DosGetDateTime(PDATETIME pdt);
  1070.  
  1071.   APIRET APIENTRY   DosSetDateTime(PDATETIME pdt);
  1072.  
  1073. #endif /* common INCL_DOSDATETIME */
  1074.  
  1075.  
  1076.  
  1077. #ifdef INCL_DOSDATETIME
  1078.  
  1079.    #define DosTimerAsync   DosAsyncTimer
  1080.    #define DosTimerStart   DosStartTimer
  1081.    #define DosTimerStop    DosStopTimer
  1082.  
  1083.    typedef LHANDLE HTIMER;
  1084.    typedef HTIMER  *PHTIMER;
  1085.  
  1086.   APIRET APIENTRY   DosAsyncTimer(ULONG msec, HSEM hsem, PHTIMER phtimer);
  1087.  
  1088.   APIRET APIENTRY   DosStartTimer(ULONG msec, HSEM hsem, PHTIMER phtimer);
  1089.  
  1090.   APIRET APIENTRY   DosStopTimer(HTIMER htimer);
  1091.  
  1092. #endif /* INCL_DOSDATETIME */
  1093.  
  1094.  
  1095.  
  1096.  
  1097. /*** Module manager */
  1098.  
  1099. #ifdef INCL_DOSMODULEMGR
  1100.  
  1101.  
  1102.    APIRET APIENTRY  DosLoadModule(PSZ pszName, ULONG cbName, PSZ pszModname, PHMODULE phmod);
  1103.  
  1104.    APIRET APIENTRY  DosFreeModule(HMODULE hmod);
  1105.  
  1106.    APIRET APIENTRY  DosQueryProcAddr(HMODULE hmod, ULONG ordinal, PSZ pszName,PFN* ppfn);
  1107.  
  1108.    APIRET APIENTRY  DosQueryModuleHandle(PSZ pszModname, PHMODULE phmod);
  1109.  
  1110.    APIRET APIENTRY  DosQueryModuleName(HMODULE hmod, ULONG cbName, PCHAR pch);
  1111.  
  1112.    #define PT_16BIT        0
  1113.    #define PT_32BIT        1
  1114.  
  1115.    APIRET APIENTRY  DosQueryProcType(HMODULE hmod, ULONG ordinal, PSZ pszName, PULONG pulproctype);
  1116.  
  1117. #endif /* INCL_DOSMODULEMGR */
  1118.  
  1119.  
  1120.  
  1121. #if (defined(INCL_DOSRESOURCES) || !defined(INCL_NOCOMMON))
  1122.  
  1123.    /*** Resource support */
  1124.  
  1125.    /* Predefined resource types */
  1126.  
  1127.    #define RT_POINTER      1   /* mouse pointer shape */
  1128.    #define RT_BITMAP       2   /* bitmap */
  1129.    #define RT_MENU         3   /* menu template */
  1130.    #define RT_DIALOG       4   /* dialog template */
  1131.    #define RT_STRING       5   /* string tables */
  1132.    #define RT_FONTDIR      6   /* font directory */
  1133.    #define RT_FONT         7   /* font */
  1134.    #define RT_ACCELTABLE   8   /* accelerator tables */
  1135.    #define RT_RCDATA       9   /* binary data */
  1136.    #define RT_MESSAGE      10  /* error msg     tables */
  1137.    #define RT_DLGINCLUDE   11  /* dialog include file name */
  1138.    #define RT_VKEYTBL      12  /* key to vkey tables */
  1139.    #define RT_KEYTBL       13  /* key to UGL tables */
  1140.    #define RT_CHARTBL      14  /* glyph to character tables */
  1141.    #define RT_DISPLAYINFO  15  /* screen display information */
  1142.  
  1143.    #define RT_FKASHORT     16  /* function key area short form */
  1144.    #define RT_FKALONG      17  /* function key area long form */
  1145.  
  1146.    #define RT_HELPTABLE    18  /* Help table for Cary Help manager */
  1147.    #define RT_HELPSUBTABLE 19  /* Help subtable for Cary Help manager */
  1148.  
  1149.    #define RT_FDDIR        20  /* DBCS uniq/font driver directory */
  1150.    #define RT_FD           21  /* DBCS uniq/font driver */
  1151.  
  1152.    #define RT_MAX          22  /* 1st unused Resource Type */
  1153.  
  1154.  
  1155.    #define RF_ORDINALID    0x80000000L     /* ordinal id flag in resource table */
  1156.  
  1157. #endif /* common INCL_DOSRESOURCES */
  1158.  
  1159.  
  1160.  
  1161.  
  1162. #ifdef INCL_DOSRESOURCES
  1163.  
  1164.    #define DosGetResource2 DosGetResource
  1165.  
  1166.    APIRET APIENTRY  DosGetResource(HMODULE hmod, ULONG idType, ULONG idName, PPVOID ppb);
  1167.  
  1168.    APIRET APIENTRY  DosFreeResource(PVOID pb);
  1169.  
  1170.    APIRET APIENTRY  DosQueryResourceSize(HMODULE hmod, ULONG idt, ULONG idn, PULONG pulsize);
  1171.  
  1172. #endif /* INCL_DOSRESOURCES */
  1173.  
  1174.  
  1175.  
  1176.  
  1177. /*** NLS Support */
  1178.  
  1179. #ifdef INCL_DOSNLS
  1180.  
  1181.    typedef struct _COUNTRYCODE   /* ctryc */
  1182.            {
  1183.            ULONG       country;
  1184.            ULONG       codepage;
  1185.            } COUNTRYCODE;
  1186.    typedef COUNTRYCODE *PCOUNTRYCODE;
  1187.  
  1188.    typedef struct _COUNTRYINFO   /* ctryi */
  1189.            {
  1190.            ULONG       country;
  1191.            ULONG       codepage;
  1192.            ULONG       fsDateFmt;
  1193.            CHAR        szCurrency[5];
  1194.            CHAR        szThousandsSeparator[2];
  1195.            CHAR        szDecimal[2];
  1196.            CHAR        szDateSeparator[2];
  1197.            CHAR        szTimeSeparator[2];
  1198.            UCHAR       fsCurrencyFmt;
  1199.            UCHAR       cDecimalPlace;
  1200.            UCHAR       fsTimeFmt;
  1201.            USHORT      abReserved1[2];
  1202.            CHAR        szDataSeparator[2];
  1203.            USHORT      abReserved2[5];
  1204.            } COUNTRYINFO, *PCOUNTRYINFO;
  1205.  
  1206.    #define DosGetCtryInfo  DosQueryCtryInfo
  1207.    #define DosGetDBCSEv    DosQueryDBCSEnv
  1208.    #define DosCaseMap      DosMapCase
  1209.    #define DosGetCollate   DosQueryCollate
  1210.    #define DosGetCp        DosQueryCp
  1211.    #define DosSetProcCp    DosSetProcessCp
  1212.  
  1213.    APIRET APIENTRY  DosQueryCtryInfo(ULONG cb, PCOUNTRYCODE pcc, PCOUNTRYINFO pci, PULONG pcbActual);
  1214.  
  1215.    APIRET APIENTRY  DosQueryDBCSEnv(ULONG cb, PCOUNTRYCODE pcc, PCHAR pBuf);
  1216.  
  1217.    APIRET APIENTRY  DosMapCase(ULONG cb, PCOUNTRYCODE pcc, PCHAR pch);
  1218.  
  1219.    APIRET APIENTRY  DosQueryCollate(ULONG cb, PCOUNTRYCODE pcc, PCHAR pch, PULONG pcch);
  1220.  
  1221.    APIRET APIENTRY  DosQueryCp(ULONG cb, PULONG arCP, PULONG pcCP);
  1222.  
  1223.    APIRET APIENTRY  DosSetProcessCp(ULONG cp);
  1224.  
  1225. #endif /* INCL_DOSNLS */
  1226.  
  1227.  
  1228.  
  1229.  
  1230. /*** Signal support */
  1231.  
  1232. #ifdef INCL_DOSEXCEPTIONS
  1233.  
  1234.    /* DosSetSigExceptionFocus codes */
  1235.  
  1236.    #define SIG_UNSETFOCUS 0
  1237.    #define SIG_SETFOCUS 1
  1238.  
  1239.    #include <bsexcpt.h>
  1240.  
  1241.    APIRET APIENTRY  DosSetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec);
  1242.  
  1243.    APIRET APIENTRY  DosUnsetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec);
  1244.  
  1245.    APIRET APIENTRY  DosRaiseException(PEXCEPTIONREPORTRECORD pexcept);
  1246.  
  1247.    APIRET APIENTRY  DosSendSignalException(PID pid, ULONG exception);
  1248.  
  1249.    APIRET APIENTRY  DosUnwindException(PEXCEPTIONREGISTRATIONRECORD phandler, PVOID pTargetIP, PEXCEPTIONREPORTRECORD pERepRec);
  1250.  
  1251.    APIRET APIENTRY  DosSetSignalExceptionFocus(BOOL32 flag, PULONG pulTimes);
  1252.  
  1253.    APIRET APIENTRY  DosEnterMustComplete(PULONG pulNesting);
  1254.  
  1255.    APIRET APIENTRY  DosExitMustComplete(PULONG pulNesting);
  1256.  
  1257.    APIRET APIENTRY  DosAcknowledgeSignalException(ULONG ulSignalNum);
  1258.  
  1259. #endif /* INCL_DOSEXCEPTIONS */
  1260.  
  1261.  
  1262. /*** Pipe and queue support */
  1263.  
  1264. #ifdef INCL_DOSQUEUES
  1265.    #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
  1266.  
  1267.       typedef LHANDLE HQUEUE;  /* hq */
  1268.       typedef HQUEUE  *PHQUEUE;
  1269.       typedef struct _REQUESTDATA     /* reqqdata */
  1270.               {
  1271.               PID         pid;
  1272.               ULONG       ulData;
  1273.               } REQUESTDATA;
  1274.       typedef REQUESTDATA *PREQUESTDATA;
  1275.  
  1276.       #define QUE_FIFO              0L
  1277.       #define QUE_LIFO              1L
  1278.       #define QUE_PRIORITY          2L
  1279.       #define QUE_NOCONVERT_ADDRESS 0L
  1280.       #define QUE_CONVERT_ADDRESS   4L
  1281.  
  1282.  
  1283.       APIRET APIENTRY  DosCreatePipe(PHFILE phfRead, PHFILE phfWrite, ULONG cb);
  1284.  
  1285.       APIRET APIENTRY  DosCloseQueue(HQUEUE hq);
  1286.  
  1287.       APIRET APIENTRY  DosCreateQueue(PHQUEUE phq, ULONG priority, PSZ pszName);
  1288.  
  1289.       APIRET APIENTRY  DosOpenQueue(PPID ppid, PHQUEUE phq, PSZ pszName);
  1290.  
  1291.       APIRET APIENTRY  DosPeekQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, PULONG element, BOOL32 nowait, PBYTE ppriority, HEV hsem);
  1292.  
  1293.       APIRET APIENTRY  DosPurgeQueue(HQUEUE hq);
  1294.  
  1295.       APIRET APIENTRY  DosQueryQueue(HQUEUE hq, PULONG pcbEntries);
  1296.  
  1297.       APIRET APIENTRY  DosReadQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, ULONG element, BOOL32 wait, PBYTE ppriority, HEV hsem);
  1298.  
  1299.       APIRET APIENTRY  DosWriteQueue(HQUEUE hq, ULONG request, ULONG cbData, PVOID pbData, ULONG priority);
  1300.  
  1301.    #else /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
  1302.       #error PHFILE not defined - define INCL_DOSFILEMGR or undefine INCL_NOCOMMON
  1303.    #endif /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
  1304. #endif /* INCL_DOSQUEUES */
  1305.  
  1306.  
  1307.  
  1308. #ifdef INCL_DOSMISC
  1309.  
  1310.    /* definitions for DosSearchPath control word */
  1311.    #define DSP_IMPLIEDCUR          1 /* current dir will be searched first */
  1312.    #define DSP_PATHREF             2 /* from env.variable */
  1313.    #define DSP_IGNORENETERR        4 /* ignore net errs & continue search */
  1314.  
  1315.    /* indices for DosQuerySysInfo */
  1316.    #define QSV_MAX_PATH_LENGTH     1
  1317.    #define Q_MAX_PATH_LENGTH       QSV_MAX_PATH_LENGTH
  1318.    #define QSV_MAX_TEXT_SESSIONS   2
  1319.    #define QSV_MAX_PM_SESSIONS     3
  1320.    #define QSV_MAX_VDM_SESSIONS    4
  1321.    #define QSV_BOOT_DRIVE          5       /* 1=A, 2=B, etc. */
  1322.    #define QSV_DYN_PRI_VARIATION   6       /* 0=Absolute, 1=Dynamic */
  1323.    #define QSV_MAX_WAIT            7       /* seconds */
  1324.    #define QSV_MIN_SLICE           8       /* milli seconds */
  1325.    #define QSV_MAX_SLICE           9       /* milli seconds */
  1326.    #define QSV_PAGE_SIZE           10
  1327.    #define QSV_VERSION_MAJOR       11
  1328.    #define QSV_VERSION_MINOR       12
  1329.    #define QSV_VERSION_REVISION    13      /* Revision letter */
  1330.    #define QSV_MS_COUNT            14      /* Free running millisecond counter */
  1331.    #define QSV_TIME_LOW            15      /* Low dword of time in seconds */
  1332.    #define QSV_TIME_HIGH           16      /* High dword of time in seconds */
  1333.    #define QSV_TOTPHYSMEM          17      /* Physical memory on system */
  1334.    #define QSV_TOTRESMEM           18      /* Resident memory on system */
  1335.    #define QSV_TOTAVAILMEM         19      /* Available memory for all processes */
  1336.    #define QSV_MAXPRMEM            20      /* Avail private mem for calling proc */
  1337.    #define QSV_MAXSHMEM            21      /* Avail shared mem for calling proc */
  1338.    #define QSV_TIMER_INTERVAL      22      /* Timer interval in tenths of ms */
  1339.    #define QSV_MAX_COMP_LENGTH     23      /* max len of one component in a name */
  1340.    #define QSV_MAX                 QSV_MAX_COMP_LENGTH
  1341.  
  1342.    /* definitions for DosError - combine with | */
  1343.    #define FERR_DISABLEHARDERR     0x00000000L     /* disable hard error popups */
  1344.    #define FERR_ENABLEHARDERR      0x00000001L     /* enable hard error popups */
  1345.    #define FERR_ENABLEEXCEPTION    0x00000000L     /* enable exception popups */
  1346.    #define FERR_DISABLEEXCEPTION   0x00000002L     /* disable exception popups */
  1347.  
  1348.    /* definitions for DosQueryRASInfo Index */
  1349.    #define SIS_MMIOADDR            0
  1350.    #define SIS_MEC_TABLE           1
  1351.    #define SIS_SYS_LOG             2
  1352.  
  1353.    #define DosInsMessage   DosInsertMessage
  1354.    #define DosQSysInfo     DosQuerySysInfo
  1355.  
  1356.    APIRET APIENTRY  DosError(ULONG error);
  1357.  
  1358.    APIRET APIENTRY  DosGetMessage(PCHAR* pTable, ULONG cTable, PCHAR pBuf, ULONG cbBuf, ULONG msgnumber, PSZ pszFile, PULONG pcbMsg);
  1359.  
  1360.    APIRET APIENTRY  DosErrClass(ULONG code, PULONG pClass, PULONG pAction, PULONG pLocus);
  1361.  
  1362.    APIRET APIENTRY  DosInsertMessage(PCHAR* pTable, ULONG cTable, PSZ pszMsg, ULONG cbMsg, PCHAR pBuf, ULONG cbBuf, PULONG pcbMsg);
  1363.  
  1364.    APIRET APIENTRY  DosPutMessage(HFILE hfile, ULONG cbMsg, PCHAR pBuf);
  1365.  
  1366.    APIRET APIENTRY  DosQuerySysInfo(ULONG iStart, ULONG iLast, PVOID pBuf, ULONG cbBuf);
  1367.  
  1368.    APIRET APIENTRY  DosScanEnv(PSZ pszName, PSZ *ppszValue);
  1369.  
  1370.    APIRET APIENTRY  DosSearchPath(ULONG flag, PSZ pszPathOrName, PSZ pszFilename, PBYTE pBuf, ULONG cbBuf);
  1371.  
  1372.    APIRET APIENTRY  DosQueryMessageCP(PCHAR pb, ULONG cb, PSZ pszFilename, PULONG cbBuf);
  1373.  
  1374.    APIRET APIENTRY  DosQueryRASInfo(ULONG Index, PPVOID Addr);
  1375.  
  1376. #endif /* INCL_DOSMISC */
  1377.  
  1378.  
  1379. /*** Session manager support */
  1380.  
  1381. #ifdef INCL_DOSSESMGR
  1382.  
  1383.    typedef struct _STARTDATA     /* stdata */
  1384.            {
  1385.            USHORT  Length;
  1386.            USHORT  Related;
  1387.            USHORT  FgBg;
  1388.            USHORT  TraceOpt;
  1389.            PSZ     PgmTitle;
  1390.            PSZ     PgmName;
  1391.            PBYTE   PgmInputs;
  1392.            PBYTE   TermQ;
  1393.            PBYTE   Environment;
  1394.            USHORT  InheritOpt;
  1395.            USHORT  SessionType;
  1396.            PSZ     IconFile;
  1397.            ULONG   PgmHandle;
  1398.            USHORT  PgmControl;
  1399.            USHORT  InitXPos;
  1400.            USHORT  InitYPos;
  1401.            USHORT  InitXSize;
  1402.            USHORT  InitYSize;
  1403.            USHORT  Reserved;
  1404.            PSZ     ObjectBuffer;
  1405.            ULONG   ObjectBuffLen;
  1406.            } STARTDATA;
  1407.    typedef STARTDATA *PSTARTDATA;
  1408.  
  1409.    #define SSF_RELATED_INDEPENDENT 0
  1410.    #define SSF_RELATED_CHILD       1
  1411.  
  1412.    #define SSF_FGBG_FORE           0
  1413.    #define SSF_FGBG_BACK           1
  1414.  
  1415.    #define SSF_TRACEOPT_NONE       0
  1416.    #define SSF_TRACEOPT_TRACE      1
  1417.    #define SSF_TRACEOPT_TRACEALL   2
  1418.  
  1419.    #define SSF_INHERTOPT_SHELL     0
  1420.    #define SSF_INHERTOPT_PARENT    1
  1421.  
  1422.    /* note that these types are identical to those in pmshl.h for PROG_* */
  1423.    #define SSF_TYPE_DEFAULT        0
  1424.    #define SSF_TYPE_FULLSCREEN     1
  1425.    #define SSF_TYPE_WINDOWABLEVIO  2
  1426.    #define SSF_TYPE_PM             3
  1427.    #define SSF_TYPE_VDM            4
  1428.    #define SSF_TYPE_GROUP          5
  1429.    #define SSF_TYPE_DLL            6
  1430.    #define SSF_TYPE_WINDOWEDVDM    7
  1431.    #define SSF_TYPE_PDD            8
  1432.    #define SSF_TYPE_VDD            9
  1433.  
  1434.    /* note that these flags are identical to those in pmshl.h for SHE_* */
  1435.    #define SSF_CONTROL_VISIBLE     0x0000
  1436.    #define SSF_CONTROL_INVISIBLE   0x0001
  1437.    #define SSF_CONTROL_MAXIMIZE    0x0002
  1438.    #define SSF_CONTROL_MINIMIZE    0x0004
  1439.    #define SSF_CONTROL_NOAUTOCLOSE 0x0008
  1440.    #define SSF_CONTROL_SETPOS      0x8000
  1441.  
  1442.    typedef struct _STATUSDATA   /* stsdata */
  1443.            {
  1444.            USHORT Length;
  1445.            USHORT SelectInd;
  1446.            USHORT BondInd;
  1447.            } STATUSDATA;
  1448.    typedef STATUSDATA *PSTATUSDATA;
  1449.  
  1450.    /* SelectInd and BondInd paramater values for DosSetSession */
  1451.    #define SET_SESSION_UNCHANGED      0
  1452.    #define SET_SESSION_SELECTABLE     1
  1453.    #define SET_SESSION_NON_SELECTABLE 2
  1454.    #define SET_SESSION_BOND           1
  1455.    #define SET_SESSION_NO_BOND        2
  1456.  
  1457.    /* TargetOption (scope) parameter values for DosStopSession */
  1458.    #define STOP_SESSION_SPECIFIED     0
  1459.    #define STOP_SESSION_ALL           1
  1460.  
  1461.  
  1462.  
  1463.    #define DosQAppType     DosQueryAppType
  1464.  
  1465.    APIRET APIENTRY  DosStartSession(PSTARTDATA psd, PULONG pidSession, PPID ppid);
  1466.  
  1467.    APIRET APIENTRY  DosSetSession(ULONG idSession, PSTATUSDATA psd);
  1468.  
  1469.    APIRET APIENTRY  DosSelectSession(ULONG idSession);
  1470.  
  1471.    APIRET APIENTRY  DosStopSession(ULONG scope, ULONG idSession);
  1472.  
  1473.    APIRET APIENTRY DosQueryAppType(PSZ pszName, PULONG pFlags);
  1474.  
  1475. #endif /* INCL_DOSSESMGR */
  1476.  
  1477.  
  1478.  
  1479. #if (defined(INCL_DOSSESMGR) || defined(INCL_DOSFILEMGR))
  1480.  
  1481.    /* AppType returned in by DosQueryAppType in pFlags as follows          */
  1482.    #define FAPPTYP_NOTSPEC         0x0000
  1483.    #define FAPPTYP_NOTWINDOWCOMPAT 0x0001
  1484.    #define FAPPTYP_WINDOWCOMPAT    0x0002
  1485.    #define FAPPTYP_WINDOWAPI       0x0003
  1486.    #define FAPPTYP_BOUND           0x0008
  1487.    #define FAPPTYP_DLL             0x0010
  1488.    #define FAPPTYP_DOS             0x0020
  1489.    #define FAPPTYP_PHYSDRV         0x0040  /* physical device driver       */
  1490.    #define FAPPTYP_VIRTDRV         0x0080  /* virtual device driver        */
  1491.    #define FAPPTYP_PROTDLL         0x0100  /* 'protected memory' dll       */
  1492.    #define FAPPTYP_WINDOWSREAL     0x0200  /* Windows real mode app        */
  1493.    #define FAPPTYP_WINDOWSPROT     0x0400  /* Windows protect mode app     */
  1494.    #define FAPPTYP_32BIT           0x4000
  1495.    #define FAPPTYP_EXETYPE         FAPPTYP_WINDOWAPI
  1496.  
  1497.    #define FAPPTYP_RESERVED        ~(FAPPTYP_WINDOWAPI | FAPPTYP_BOUND | FAPPTYP_DLL | FAPPTYP_DOS | FAPPTYP_PHYSDRV | FAPPTYP_VIRTDRV | FAPPTYP_PROTDLL | FAPPTYP_32BIT)
  1498.  
  1499.    #ifdef INCL_DOSFILEMGR
  1500.  
  1501.       #define EAT_APPTYP_PMAPI        0x00            /* Uses PM API */
  1502.       #define EAT_APPTYP_DOS          0x01            /* DOS APP */
  1503.       #define EAT_APPTYP_PMW          0x02            /* Window compatible */
  1504.       #define EAT_APPTYP_NOPMW        0x03            /* Not Window compatible */
  1505.       #define EAT_APPTYP_EXETYPE      0x03            /* EXE type mask */
  1506.       #define EAT_APPTYP_RESERVED     ~(EAT_APPTYP_EXETYPE)
  1507.  
  1508.    #endif /* INCL_DOSFILEMGR */
  1509.  
  1510. #endif /* INCL_DOSSESMGR || INCL_DOSFILEMGR */
  1511.  
  1512.  
  1513.  
  1514.  
  1515. /*** Device support */
  1516.  
  1517. #ifdef INCL_DOSDEVICES
  1518.  
  1519.    #define DosDevIOCtl2    DosDevIOCtl
  1520.  
  1521.    APIRET APIENTRY  DosDevConfig(PVOID pdevinfo, ULONG item);
  1522.    #define DEVINFO_PRINTER         0       /* Number of printers attached */
  1523.    #define DEVINFO_RS232           1       /* Number of RS232 ports */
  1524.    #define DEVINFO_FLOPPY          2       /* Number of diskette drives */
  1525.    #define DEVINFO_COPROCESSOR     3       /* Presence of math coprocessor */
  1526.    #define DEVINFO_SUBMODEL        4       /* PC Submodel Type */
  1527.    #define DEVINFO_MODEL           5       /* PC Model Type */
  1528.    #define DEVINFO_ADAPTER         6       /* Primary display adapter type */
  1529.  
  1530.    APIRET APIENTRY  DosDevIOCtl(HFILE hDevice, ULONG category, ULONG function, PVOID pParams, ULONG cbParmLenMax, PULONG pcbParmLen, PVOID pData, ULONG cbDataLenMax, PULONG pcbDataLen);
  1531.  
  1532.  
  1533.    APIRET APIENTRY  DosPhysicalDisk(ULONG function, PVOID pBuf, ULONG cbBuf, PVOID pParams, ULONG cbParams);
  1534.    #define INFO_COUNT_PARTITIONABLE_DISKS  1       /* # of partitionable disks */
  1535.    #define INFO_GETIOCTLHANDLE             2       /* Obtain handle            */
  1536.    #define INFO_FREEIOCTLHANDLE            3       /* Release handle           */
  1537.  
  1538. #endif /* INCL_DOSDEVICES */
  1539.  
  1540.  
  1541. /*** DosNamedPipes API Support */
  1542.  
  1543. #ifdef INCL_DOSNMPIPES
  1544.  
  1545.    /*** Data structures used with named pipes ***/
  1546.  
  1547.    typedef LHANDLE HPIPE;     /* hp */
  1548.    typedef HPIPE   *PHPIPE;
  1549.  
  1550.    typedef struct _AVAILDATA              /* AVAILDATA */
  1551.            {
  1552.            USHORT      cbpipe;            /* bytes left in the pipe */
  1553.            USHORT      cbmessage;         /* bytes left in the current message */
  1554.            } AVAILDATA;
  1555.    typedef AVAILDATA *PAVAILDATA;
  1556.  
  1557.    typedef struct _PIPEINFO               /* nmpinf */
  1558.            {
  1559.            USHORT cbOut;                  /* length of outgoing I/O buffer */
  1560.            USHORT cbIn;                   /* length of incoming I/O buffer */
  1561.            BYTE   cbMaxInst;              /* maximum number of instances   */
  1562.            BYTE   cbCurInst;              /* current number of instances   */
  1563.            BYTE   cbName;                 /* length of pipe name           */
  1564.            CHAR   szName[1];              /* start of name                 */
  1565.            } PIPEINFO;
  1566.    typedef PIPEINFO  *PPIPEINFO;
  1567.  
  1568.    typedef struct _PIPESEMSTATE    /* nmpsmst */
  1569.            {
  1570.            BYTE   fStatus;         /* type of record, 0 = EOI, 1 = read ok, */
  1571.                                    /* 2 = write ok, 3 = pipe closed         */
  1572.            BYTE   fFlag;           /* additional info, 01 = waiting thread  */
  1573.            USHORT usKey;           /* user's key value                      */
  1574.            USHORT usAvail;         /* available data/space if status = 1/2  */
  1575.            } PIPESEMSTATE;
  1576.    typedef PIPESEMSTATE *PPIPESEMSTATE;
  1577.  
  1578.    #define NP_INDEFINITE_WAIT      -1
  1579.    #define NP_DEFAULT_WAIT         0L
  1580.  
  1581.    /* DosPeekNmPipe() pipe states */
  1582.  
  1583.    #define NP_STATE_DISCONNECTED   0x0001
  1584.    #define NP_STATE_LISTENING      0x0002
  1585.    #define NP_STATE_CONNECTED      0x0003
  1586.    #define NP_STATE_CLOSING        0x0004
  1587.  
  1588.    /* DosCreateNPipe open modes */
  1589.  
  1590.    #define NP_ACCESS_INBOUND       0x0000
  1591.    #define NP_ACCESS_OUTBOUND      0x0001
  1592.    #define NP_ACCESS_DUPLEX        0x0002
  1593.    #define NP_INHERIT              0x0000
  1594.    #define NP_NOINHERIT            0x0080
  1595.    #define NP_WRITEBEHIND          0x0000
  1596.    #define NP_NOWRITEBEHIND        0x4000
  1597.  
  1598.    /* DosCreateNPipe and DosQueryNPHState state */
  1599.  
  1600.    #define NP_READMODE_BYTE        0x0000
  1601.    #define NP_READMODE_MESSAGE     0x0100
  1602.    #define NP_TYPE_BYTE            0x0000
  1603.    #define NP_TYPE_MESSAGE         0x0400
  1604.    #define NP_END_CLIENT           0x0000
  1605.    #define NP_END_SERVER           0x4000
  1606.    #define NP_WAIT                 0x0000
  1607.    #define NP_NOWAIT               0x8000
  1608.    #define NP_UNLIMITED_INSTANCES  0x00FF
  1609.  
  1610.  
  1611.    APIRET APIENTRY  DosCallNPipe(PSZ pszName, PVOID pInbuf, ULONG cbIn, PVOID pOutbuf, ULONG cbOut, PULONG pcbActual, ULONG msec);
  1612.  
  1613.    APIRET APIENTRY  DosConnectNPipe(HPIPE hpipe);
  1614.  
  1615.    APIRET APIENTRY  DosDisConnectNPipe(HPIPE hpipe);
  1616.  
  1617.    APIRET APIENTRY  DosCreateNPipe(PSZ pszName, PHPIPE pHpipe, ULONG openmode, ULONG pipemode, ULONG cbInbuf, ULONG cbOutbuf, ULONG msec);
  1618.  
  1619.    APIRET APIENTRY  DosPeekNPipe(HPIPE hpipe, PVOID pBuf, ULONG cbBuf, PULONG pcbActual, PAVAILDATA pAvail, PULONG pState);
  1620.  
  1621.    APIRET APIENTRY  DosQueryNPHState(HPIPE hpipe, PULONG pState);
  1622.  
  1623.    APIRET APIENTRY  DosQueryNPipeInfo(HPIPE hpipe, ULONG infolevel, PVOID pBuf, ULONG cbBuf);
  1624.  
  1625.    APIRET APIENTRY  DosQueryNPipeSemState(HSEM hsem, PPIPESEMSTATE pnpss, ULONG cbBuf);
  1626.  
  1627.    APIRET APIENTRY  DosRawReadNPipe(PSZ pszName, ULONG cb, PULONG pLen, PVOID pBuf);
  1628.  
  1629.    APIRET APIENTRY  DosRawWriteNPipe(PSZ pszName, ULONG cb);
  1630.  
  1631.    APIRET APIENTRY  DosSetNPHState(HPIPE hpipe, ULONG state);
  1632.  
  1633.    APIRET APIENTRY  DosSetNPipeSem(HPIPE hpipe, HSEM hsem, ULONG key);
  1634.  
  1635.    APIRET APIENTRY  DosTransactNPipe(HPIPE hpipe, PVOID pOutbuf, ULONG cbOut, PVOID pInbuf, ULONG cbIn, PULONG pcbRead);
  1636.  
  1637.    APIRET APIENTRY  DosWaitNPipe(PSZ pszName, ULONG msec);
  1638.  
  1639.    /* values in fStatus */
  1640.    #define NPSS_EOI                   0     /* End Of Information    */
  1641.    #define NPSS_RDATA                 1     /* read data available   */
  1642.    #define NPSS_WSPACE                2     /* write space available */
  1643.    #define NPSS_CLOSE                 3     /* pipe in CLOSING state */
  1644.  
  1645.    /* values in npss_flag */
  1646.    #define NPSS_WAIT                  0x01  /* waiting thread on end of pipe */
  1647.  
  1648.    /* defined bits in pipe mode */
  1649.    #define NP_NBLK                    0x8000 /* non-blocking read/write */
  1650.    #define NP_SERVER                  0x4000 /* set if server end       */
  1651.    #define NP_WMESG                   0x0400 /* write messages          */
  1652.    #define NP_RMESG                   0x0100 /* read as messages        */
  1653.    #define NP_ICOUNT                  0x00FF /* instance count field    */
  1654.  
  1655.  
  1656.    /*      Named pipes may be in one of several states depending on the actions
  1657.     *      that have been taken on it by the server end and client end.  The
  1658.     *      following state/action table summarizes the valid state transitions:
  1659.     *
  1660.     *      Current state           Action                  Next state
  1661.     *
  1662.     *       <none>             server DosMakeNmPipe        DISCONNECTED
  1663.     *       DISCONNECTED       server connect              LISTENING
  1664.     *       LISTENING          client open                 CONNECTED
  1665.     *       CONNECTED          server disconn              DISCONNECTED
  1666.     *       CONNECTED          client close                CLOSING
  1667.     *       CLOSING            server disconn              DISCONNECTED
  1668.     *       CONNECTED          server close                CLOSING
  1669.     *       <any other>        server close                <pipe deallocated>
  1670.     *
  1671.     *      If a server disconnects his end of the pipe, the client end will enter a
  1672.     *      special state in which any future operations (except close) on the file
  1673.     *      descriptor associated with the pipe will return an error.
  1674.     */
  1675.  
  1676.    /*
  1677.     *      Values for named pipe state
  1678.     */
  1679.  
  1680.    #define NP_DISCONNECTED       1         /* after pipe creation or Disconnect */
  1681.    #define NP_LISTENING          2         /* after DosNmPipeConnect            */
  1682.    #define NP_CONNECTED          3         /* after Client open                 */
  1683.    #define NP_CLOSING            4         /* after Client or Server close      */
  1684.  
  1685.  
  1686. #endif /* INCL_DOSNMPIPES */
  1687.  
  1688.  
  1689.  
  1690. /*** DosProfile API support */
  1691.  
  1692. #ifdef INCL_DOSPROFILE
  1693.  
  1694.    /*** Perfview API support */
  1695.  
  1696.    APIRET APIENTRY DosTmrQueryFreq(PULONG pulTmrFreq);
  1697.  
  1698.    APIRET APIENTRY DosTmrQueryTime(PQWORD pqwTmrTime);
  1699.  
  1700.    APIRET APIENTRY DosRegisterPerfCtrs(PBYTE pbDataBlk, PBYTE pbTextBlk, ULONG flFlags);
  1701.  
  1702.    /* DosProfile ordinal number */
  1703.  
  1704.    #define PROF_ORDINAL        133
  1705.  
  1706.    /* DosProfile usType */
  1707.  
  1708.    #define PROF_SYSTEM           0
  1709.    #define PROF_USER             1
  1710.    #define PROF_USEDD            2
  1711.    #define PROF_KERNEL           4
  1712.    #define PROF_VERBOSE          8
  1713.    #define PROF_ENABLE          16
  1714.  
  1715.    /* DosProfile usFunc */
  1716.  
  1717.    #define PROF_ALLOC            0
  1718.    #define PROF_CLEAR            1
  1719.    #define PROF_ON               2
  1720.    #define PROF_OFF              3
  1721.    #define PROF_DUMP             4
  1722.    #define PROF_FREE             5
  1723.  
  1724.    /* DosProfile tic count granularity (DWORD) */
  1725.  
  1726.    #define PROF_SHIFT            2
  1727.  
  1728.    /* DosProfile module name string length */
  1729.  
  1730.    #define PROF_MOD_NAME_SIZE   10
  1731.  
  1732.    /* DosProfile error code for end of data */
  1733.  
  1734.    #define PROF_END_OF_DATA     13
  1735.  
  1736. #endif /* INCL_DOSPROFILE */
  1737.  
  1738.  
  1739.  
  1740. /* Virtual DOS Machine API support */
  1741. #ifdef INCL_DOSMVDM
  1742.  
  1743.    typedef LHANDLE   HVDD;     /* hvdd */
  1744.    typedef HVDD     *PHVDD;    /* phvdd */
  1745.  
  1746.    APIRET APIENTRY  DosOpenVDD(PSZ pszVDD, PHVDD phvdd);
  1747.  
  1748.    APIRET APIENTRY  DosRequestVDD(HVDD hvdd, SGID sgid, ULONG cmd,
  1749.                                   ULONG cbInput, PVOID pInput,
  1750.                                   ULONG cbOutput, PVOID pOutput);
  1751.  
  1752.    APIRET APIENTRY  DosCloseVDD(HVDD hvdd);
  1753.  
  1754.    APIRET APIENTRY  DosQueryDOSProperty(SGID sgid, PSZ pszName,
  1755.                                         ULONG cb, PSZ pch);
  1756.  
  1757.    APIRET APIENTRY  DosSetDOSProperty(SGID sgid, PSZ pszName,
  1758.                                       ULONG cb, PSZ pch);
  1759. #endif /* INCL_DOSMVDM */
  1760.  
  1761.  
  1762. #ifdef INCL_BDCALLS
  1763.  
  1764. #include "bdcalls.h"
  1765.  
  1766. #endif /*INCL_BDCALLS */
  1767.  
  1768. #endif /* __BSEDOS__ */
  1769.  
  1770. #ifdef __IBMC__
  1771.    #pragma info( none )
  1772.    #ifndef __CHKHDR__
  1773.       #pragma info( restore )
  1774.    #endif
  1775.    #pragma info( restore )
  1776. #endif
  1777.