home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / os2tk20 / c / os2h / bsedos.h__ / BSEDOS.H
Encoding:
C/C++ Source or Header  |  1992-08-01  |  70.4 KB  |  2,074 lines

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