home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / BSEDOS16.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  78KB  |  2,085 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /*static char *SCCSID = "@(#)bsedos16.h    6.17 92/03/06";*/
  14. /*static char *SCCSID = "@(#)bsedos16.h    6.17 92/03/06";*/
  15. /***************************************************************************\
  16. *
  17. * Module Name: BSEDOS16.H
  18. *
  19. * OS/2 Base Include File for 16-bit API
  20. *
  21. *
  22. * =======================================================================
  23. *
  24. * Subcomponents marked with "+" are partially included by default
  25. *
  26. *   #define:                To include:
  27. *
  28. * + INCL_DOSPROCESS         Process and thread support
  29. *   INCL_DOSINFOSEG         InfoSeg support
  30. * + INCL_DOSFILEMGR         File Management
  31. * + INCL_DOSMEMMGR          Memory Management
  32. * + INCL_DOSSEMAPHORES      Semaphore support
  33. * + INCL_DOSDATETIME        Date/Time and Timer support
  34. *   INCL_DOSMODULEMGR       Module manager
  35. * + INCL_DOSRESOURCES       Resource support
  36. *   INCL_DOSNLS             National Language Support
  37. *   INCL_DOSSIGNALS         Signals
  38. *   INCL_DOSMISC            Miscellaneous
  39. *   INCL_DOSMONITORS        Monitors
  40. *   INCL_DOSQUEUES          Queues
  41. *   INCL_DOSSESMGR          Session Manager Support
  42. *   INCL_DOSDEVICES         Device specific, ring 2 support
  43. *   INCL_DOSNMPIPES         Named Pipes Support
  44. *   INCL_DOSPROFILE         DosProfile API
  45. *   INCL_DOSMVDM            MVDM support
  46. *
  47. *
  48. *
  49. \***************************************************************************/
  50.  
  51. #define INCL_DOSINCLUDED
  52.  
  53. #ifndef INCL_BASEINCLUDED
  54. #if !(defined(INCL_32) || defined(INCL_16))
  55. #ifdef M_I386
  56.     #define INCL_32
  57. #else /* not M_I386 */
  58.     #define INCL_16
  59. #endif /* M_I386 */
  60. #endif /* INCL_32 || INCL_16 */
  61.  
  62. #if !defined(INCL_16)
  63. #pragma message ("16-bit Base API included when using 32-bit compiler")
  64. #endif /* INCL_32 */
  65. #endif /* INCL_BASEINCLUDED */
  66.  
  67. #ifdef INCL_DOS
  68.  
  69. #define INCL_DOSPROCESS
  70. #define INCL_DOSINFOSEG
  71. #define INCL_DOSFILEMGR
  72. #define INCL_DOSMEMMGR
  73. #define INCL_DOSSEMAPHORES
  74. #define INCL_DOSDATETIME
  75. #define INCL_DOSMODULEMGR
  76. #define INCL_DOSRESOURCES
  77. #define INCL_DOSNLS
  78. #define INCL_DOSSIGNALS
  79. #define INCL_DOSMISC
  80. #define INCL_DOSMONITORS
  81. #define INCL_DOSQUEUES
  82. #define INCL_DOSSESMGR
  83. #define INCL_DOSDEVICES
  84. #define INCL_DOSNMPIPES
  85. #define INCL_DOSPROFILE
  86. #define INCL_DOSMVDM
  87.  
  88. #endif /* INCL_DOS */
  89.  
  90. #ifdef INCL_ERRORS
  91. #define INCL_DOSERRORS
  92. #endif /* INCL_ERRORS */
  93.  
  94. #if (defined(INCL_DOSPROCESS) || !defined(INCL_NOCOMMON))
  95.  
  96. /* XLATOFF */
  97. #ifndef INCL_NOXLATE_DOS16
  98. #define DosBeep         Dos16Beep
  99. #define DosExit         Dos16Exit
  100. #endif /* INCL_NOXLATE_DOS16 */
  101. /* XLATON */
  102.  
  103. /*** General services */
  104.  
  105. APIRET  APIENTRY DosBeep(USHORT usFrequency, USHORT usDuration);
  106.  
  107. /*** Process and Thread support */
  108.  
  109. VOID APIENTRY DosExit(USHORT fTerminate, USHORT usExitCode);
  110.  
  111. /* DosExit codes */
  112. #define EXIT_THREAD                0
  113. #define EXIT_PROCESS               1
  114.  
  115. #endif /* common INCL_DOSPROCESS definitions */
  116.  
  117. #ifdef INCL_DOSPROCESS
  118.  
  119. typedef struct _PIDINFO {       /* pidi */
  120.     PID     pid;
  121.     TID     tid;
  122.     PID     pidParent;
  123. } PIDINFO;
  124. typedef PIDINFO FAR *PPIDINFO;
  125.  
  126. typedef VOID (APIENTRY *PFNTHREAD)(VOID);
  127.  
  128. /* XLATOFF */
  129. #ifndef INCL_NOXLATE_DOS16
  130. #define DosCreateThread Dos16CreateThread
  131. #define DosResumeThread Dos16ResumeThread
  132. #define DosSuspendThread        Dos16SuspendThread
  133. #define DosCwait        Dos16Cwait
  134. #define DosSleep        Dos16Sleep
  135. #define DosExecPgm      Dos16ExecPgm
  136. #define DosEnterCritSec Dos16EnterCritSec
  137. #define DosExitCritSec  Dos16ExitCritSec
  138. #define DosExitList     Dos16ExitList
  139. #define DosGetPrty      Dos16GetPrty
  140. #define DosSetPrty      Dos16SetPrty
  141. #define DosGetPID       Dos16GetPID
  142. #define DosGetPPID      Dos16GetPPID
  143. #define DosKillProcess  Dos16KillProcess
  144. #endif /* INCL_NOXLATE_DOS16 */
  145. /* XLATON */
  146.  
  147. APIRET  APIENTRY DosCreateThread(PFNTHREAD pfnFun, PTID pTid, PBYTE pbStack);
  148. APIRET  APIENTRY DosResumeThread(TID tid);
  149. APIRET  APIENTRY DosSuspendThread(TID tid);
  150.  
  151. /* Action code values */
  152. #define DCWA_PROCESS               0
  153. #define DCWA_PROCESSTREE           1
  154.  
  155. /* Wait option values */
  156. #define DCWW_WAIT                  0
  157. #define DCWW_NOWAIT                1
  158.  
  159. typedef struct _RESULTCODES {   /* resc */
  160.     USHORT  codeTerminate;
  161.     USHORT  codeResult;
  162. } RESULTCODES;
  163. typedef RESULTCODES FAR *PRESULTCODES;
  164.  
  165. APIRET  APIENTRY DosCwait(USHORT fScope, USHORT fWait, PRESULTCODES prescResults,
  166.                          PPID ppidProcess, PID pidWaitProcess);
  167. APIRET  APIENTRY DosSleep(ULONG ulTime);
  168.  
  169. /* codeTerminate values (also passed to ExitList routines) */
  170. #define TC_EXIT                    0
  171. #define TC_HARDERROR               1
  172. #define TC_TRAP                    2
  173. #define TC_KILLPROCESS             3
  174. #define TC_EXCEPTION               4
  175.  
  176. typedef VOID (PASCAL FAR *PFNEXITLIST)(USHORT);
  177.  
  178. APIRET  APIENTRY DosEnterCritSec(VOID);
  179. APIRET  APIENTRY DosExitCritSec(VOID);
  180. APIRET  APIENTRY DosExitList(USHORT fFnCode, PFNEXITLIST pfnFunction);
  181.  
  182. /* DosExitList functions */
  183. #define EXLST_ADD                  1
  184. #define EXLST_REMOVE               2
  185. #define EXLST_EXIT                 3
  186.  
  187. APIRET  APIENTRY DosExecPgm(PCHAR pchFailName, SHORT cbFailName,
  188.                            USHORT fExecFlags, PSZ pszArgs, PSZ pszEnv,
  189.                            PRESULTCODES prescResults, PSZ pszPgmName);
  190.  
  191. /* DosExecPgm functions */
  192. #define EXEC_SYNC                  0
  193. #define EXEC_ASYNC                 1
  194. #define EXEC_ASYNCRESULT           2
  195. #define EXEC_TRACE                 3
  196. #define EXEC_BACKGROUND            4
  197. #define EXEC_LOAD                  5
  198.  
  199. APIRET  APIENTRY DosGetPID(PPIDINFO ppidInfo);
  200. APIRET  APIENTRY DosGetPPID(USHORT pidChild, PUSHORT ppidParent);
  201.  
  202. APIRET  APIENTRY DosGetPrty(USHORT usScope, PUSHORT pusPriority, USHORT pid);
  203. APIRET  APIENTRY DosSetPrty(USHORT usScope, USHORT fPrtyClass, SHORT sChange,
  204.                            USHORT id);
  205.  
  206. /* Priority scopes */
  207. #define PRTYS_PROCESS              0
  208. #define PRTYS_PROCESSTREE          1
  209. #define PRTYS_THREAD               2
  210.  
  211. /* Priority classes */
  212. #define PRTYC_NOCHANGE             0
  213. #define PRTYC_IDLETIME             1
  214. #define PRTYC_REGULAR              2
  215. #define PRTYC_TIMECRITICAL         3
  216. #define PRTYC_FOREGROUNDSERVER     4
  217.  
  218. /* Priority deltas */
  219. #define PRTYD_MINIMUM             -31
  220. #define PRTYD_MAXIMUM              31
  221.  
  222. APIRET  APIENTRY DosKillProcess(USHORT usScope, PID pidProcess);
  223.  
  224. #define DKP_PROCESSTREE            0
  225. #define DKP_PROCESS                1
  226.  
  227. #endif /* INCL_DOSPROCESS */
  228.  
  229.  
  230. /*** InfoSeg support */
  231.  
  232. #ifdef INCL_DOSINFOSEG
  233.  
  234. /* Global Information Segment */
  235.  
  236. typedef struct _GINFOSEG {      /* gis */
  237.     ULONG   time;
  238.     ULONG   msecs;
  239.     UCHAR   hour;
  240.     UCHAR   minutes;
  241.     UCHAR   seconds;
  242.     UCHAR   hundredths;
  243.     USHORT  timezone;
  244.     USHORT  cusecTimerInterval;
  245.     UCHAR   day;
  246.     UCHAR   month;
  247.     USHORT  year;
  248.     UCHAR   weekday;
  249.     UCHAR   uchMajorVersion;
  250.     UCHAR   uchMinorVersion;
  251.     UCHAR   chRevisionLetter;
  252.     UCHAR   sgCurrent;
  253.     UCHAR   sgMax;
  254.     UCHAR   cHugeShift;
  255.     UCHAR   fProtectModeOnly;
  256.     USHORT  pidForeground;
  257.     UCHAR   fDynamicSched;
  258.     UCHAR   csecMaxWait;
  259.     USHORT  cmsecMinSlice;
  260.     USHORT  cmsecMaxSlice;
  261.     USHORT  bootdrive;
  262.     UCHAR   amecRAS[32];
  263.     UCHAR   csgWindowableVioMax;
  264.     UCHAR   csgPMMax;
  265. } GINFOSEG;
  266. typedef GINFOSEG FAR *PGINFOSEG;
  267.  
  268. /* Local Information Segment */
  269.  
  270. typedef struct _LINFOSEG {      /* lis */
  271.     PID     pidCurrent;
  272.     PID     pidParent;
  273.     USHORT  prtyCurrent;
  274.     TID     tidCurrent;
  275.     USHORT  sgCurrent;
  276.     UCHAR   rfProcStatus;
  277.     UCHAR   dummy1;
  278.     BOOL    fForeground;
  279.     UCHAR   typeProcess;
  280.     UCHAR   dummy2;
  281.     SEL     selEnvironment;
  282.     USHORT  offCmdLine;
  283.     USHORT  cbDataSegment;
  284.     USHORT  cbStack;
  285.     USHORT  cbHeap;
  286.     HMODULE hmod;
  287.     SEL     selDS;
  288. } LINFOSEG;
  289. typedef LINFOSEG FAR *PLINFOSEG;
  290.  
  291. /* Process Type codes (local information segment typeProcess field)           */
  292.  
  293. #define PT_FULLSCREEN              0 /* Full screen application               */
  294. #define PT_REALMODE                1 /* Real mode process                     */
  295. #define PT_WINDOWABLEVIO           2 /* VIO windowable application            */
  296. #define PT_PM                      3 /* Presentation Manager application      */
  297. #define PT_DETACHED                4 /* Detached application                  */
  298.  
  299. /* Process Status Flag definitions (local info seg rfProcStatus field)        */
  300.  
  301. #define PS_EXITLIST                1 /* Thread is in exitlist routine         */
  302.  
  303.  
  304. /* XLATOFF */
  305. #ifndef INCL_NOXLATE_DOS16
  306. #define DosGetInfoSeg   Dos16GetInfoSeg
  307. #endif /* INCL_NOXLATE_DOS16 */
  308. /* XLATON */
  309.  
  310. APIRET  APIENTRY DosGetInfoSeg(PSEL pselGlobal, PSEL pselLocal);
  311.  
  312. /* Helper macros used to convert selector to PINFOSEG or LINFOSEG             */
  313.  
  314. #define MAKEPGINFOSEG(sel)  ((PGINFOSEG)MAKEP(sel, 0))
  315. #define MAKEPLINFOSEG(sel)  ((PLINFOSEG)MAKEP(sel, 0))
  316.  
  317. #endif /* INCL_DOSINFOSEG */
  318.  
  319. #ifndef INCL_SAADEFS
  320.  
  321. /*
  322.  * CCHMAXPATH is the maximum fully qualified path name length including
  323.  * the drive letter, colon, backslashes and terminating NULL.
  324.  */
  325. #define CCHMAXPATH                 260
  326.  
  327. /*
  328.  * CCHMAXPATHCOMP is the maximum individual path component name length
  329.  * including a terminating NULL.
  330.  */
  331. #define CCHMAXPATHCOMP             256
  332.  
  333. #endif  /* !INCL_SAADEFS */
  334.  
  335. #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
  336.  
  337. /*** File manager */
  338.  
  339. /* DosSetFilePtr() file position codes */
  340.  
  341. #define FILE_BEGIN                 0x0000 /* relative to beginning of file    */
  342. #define FILE_CURRENT               0x0001 /* relative to current fptr position*/
  343. #define FILE_END                   0x0002 /* relative to end of file          */
  344.  
  345. /* DosFindFirst/Next Directory handle types */
  346.  
  347. #define HDIR_SYSTEM                1    /* Use system handle (1)              */
  348. #define HDIR_CREATE                (-1) /* Allocate a new, unused handle   */
  349.  
  350. /* DosCopy control bits - may be or'ed together */
  351. #define DCPY_EXISTING              0x00001 /* Copy even if target exists      */
  352. #define DCPY_APPEND                0x00002 /* Append to existing file, don't replace*/
  353. #define DCPY_FAILEAS               0x00004 /* Fail if EAs not supported on target*/
  354.  
  355. /* Dosopen/DosQFHandState/DosQueryFileInfo et al file attributes; also        */
  356. /* known as Dos File Mode bits...                                             */
  357. #define FILE_NORMAL                0x0000
  358. #define FILE_READONLY              0x0001
  359. #define FILE_HIDDEN                0x0002
  360. #define FILE_SYSTEM                0x0004
  361. #define FILE_DIRECTORY             0x0010
  362. #define FILE_ARCHIVED              0x0020
  363.  
  364. /* DosOpen() actions */
  365. #define FILE_EXISTED               0x0001
  366. #define FILE_CREATED               0x0002
  367. #define FILE_TRUNCATED             0x0003
  368.  
  369. /* DosOpen() open flags */
  370. #define FILE_OPEN                  0x0001
  371. #define FILE_TRUNCATE              0x0002
  372. #define FILE_CREATE                0x0010
  373.  
  374. /* applies if file already exists */
  375.  
  376. #define OPEN_ACTION_FAIL_IF_EXISTS     0x0000  /* ---- ---- ---- 0000         */
  377. #define OPEN_ACTION_OPEN_IF_EXISTS     0x0001  /* ---- ---- ---- 0001         */
  378. #define OPEN_ACTION_REPLACE_IF_EXISTS  0x0002  /* ---- ---- ---- 0010         */
  379.  
  380. /* applies if file does not exist */
  381.  
  382. #define OPEN_ACTION_FAIL_IF_NEW        0x0000  /* ---- ---- 0000 ----         */
  383. #define OPEN_ACTION_CREATE_IF_NEW      0x0010  /* ---- ---- 0001 ----         */
  384.  
  385. /* DosOpen/DosSetFHandState flags */
  386.  
  387. #define OPEN_ACCESS_READONLY           0x0000  /* ---- ---- ---- -000         */
  388. #define OPEN_ACCESS_WRITEONLY          0x0001  /* ---- ---- ---- -001         */
  389. #define OPEN_ACCESS_READWRITE          0x0002  /* ---- ---- ---- -010         */
  390. #define OPEN_SHARE_DENYREADWRITE       0x0010  /* ---- ---- -001 ----         */
  391. #define OPEN_SHARE_DENYWRITE           0x0020  /* ---- ---- -010 ----         */
  392. #define OPEN_SHARE_DENYREAD            0x0030  /* ---- ---- -011 ----         */
  393. #define OPEN_SHARE_DENYNONE            0x0040  /* ---- ---- -100 ----         */
  394. #define OPEN_FLAGS_NOINHERIT           0x0080  /* ---- ---- 1--- ----         */
  395. #define OPEN_FLAGS_NO_LOCALITY         0x0000  /* ---- -000 ---- ----         */
  396. #define OPEN_FLAGS_SEQUENTIAL          0x0100  /* ---- -001 ---- ----         */
  397. #define OPEN_FLAGS_RANDOM              0x0200  /* ---- -010 ---- ----         */
  398. #define OPEN_FLAGS_RANDOMSEQUENTIAL    0x0300  /* ---- -011 ---- ----         */
  399. #define OPEN_FLAGS_NO_CACHE            0x1000  /* ---1 ---- ---- ----         */
  400. #define OPEN_FLAGS_FAIL_ON_ERROR       0x2000  /* --1- ---- ---- ----         */
  401. #define OPEN_FLAGS_WRITE_THROUGH       0x4000  /* -1-- ---- ---- ----         */
  402. #define OPEN_FLAGS_DASD                0x8000  /* 1--- ---- ---- ----         */
  403. #define OPEN_FLAGS_NONSPOOLED      0x00040000
  404.  
  405. #define MUST_HAVE_READONLY      ( (FILE_READONLY  << 8) | FILE_READONLY  )
  406. #define MUST_HAVE_HIDDEN        ( (FILE_HIDDEN    << 8) | FILE_HIDDEN    )
  407. #define MUST_HAVE_SYSTEM        ( (FILE_SYSTEM    << 8) | FILE_SYSTEM    )
  408. #define MUST_HAVE_DIRECTORY     ( (FILE_DIRECTORY << 8) | FILE_DIRECTORY )
  409. #define MUST_HAVE_ARCHIVED      ( (FILE_ARCHIVED  << 8) | FILE_ARCHIVED  )
  410.  
  411. /* DosSearchPath() constants */
  412.  
  413. #define SEARCH_PATH                0x0000
  414. #define SEARCH_CUR_DIRECTORY       0x0001
  415. #define SEARCH_ENVIRONMENT         0x0002
  416. #define SEARCH_IGNORENETERRS       0x0004
  417.  
  418. /*
  419.  * DosFileIO
  420.  */
  421. /* File IO command words */
  422. #define FIO_LOCK                   0       /* Lock Files                      */
  423. #define FIO_UNLOCK                 1       /* Unlock Files                    */
  424. #define FIO_SEEK                   2       /* Seek (set file ptr)             */
  425. #define FIO_READ                   3       /* File Read                       */
  426. #define FIO_WRITE                  4       /* File Write                      */
  427.  
  428. /* Lock Sharing Modes */
  429. #define FIO_NOSHARE                0       /* None                            */
  430. #define FIO_SHAREREAD              1       /* Read-Only                       */
  431.  
  432. typedef struct  _FIOLOCKCMD {   /* FLC  FileLockCmd prefix           */
  433.     USHORT  usCmd;              /* Cmd = FIO_LOCK                    */
  434.     USHORT  cLockCnt;           /* Lock records that follow          */
  435.     ULONG   cTimeOut;           /* in Msec                           */
  436. } FIOLOCKCMD;
  437. typedef FIOLOCKCMD FAR *PFIOLOCKCMD;
  438.  
  439. /* XLATOFF */
  440. #pragma pack(2)
  441. /* XLATON */
  442.  
  443. typedef struct  _FIOLOCKREC {   /* FLR FileLockRecord                */
  444.      USHORT fShare;             /* FIO_NOSHARE or FIO_SHAREREAD      */
  445.      ULONG  cbStart;            /* Starting offset for lock region   */
  446.      ULONG  cbLength;           /* Length of lock region             */
  447. } FIOLOCKREC;
  448. typedef FIOLOCKREC FAR *PFIOLOCKREC;
  449.  
  450. /* XLATOFF */
  451. #pragma pack()
  452. /* XLATON */
  453.  
  454. typedef struct  _FIOUNLOCKCMD { /* FUC FileUnlockCmd prefix          */
  455.     USHORT  usCmd;              /* Cmd = FIO_UNLOCK                  */
  456.     USHORT  cUnlockCnt;         /* Unlock records that follow        */
  457. } FIOUNLOCKCMD;
  458. typedef FIOUNLOCKCMD FAR *PFIOUNLOCKCMD;
  459.  
  460.  
  461. typedef struct  _FIOUNLOCKREC { /* FUR FileUnlockRecord              */
  462.     ULONG   cbStart;            /* Starting offset for unlock region */
  463.     ULONG   cbLength;           /* Length of unlock region           */
  464. } FIOUNLOCKREC;
  465. typedef FIOUNLOCKREC FAR *PFIOUNLOCKREC;
  466.  
  467.  
  468. typedef struct  _FIOSEEKCMD {   /* FSC Seek command structure             */
  469.     USHORT  usCmd;              /* Cmd = FIO_SEEK                         */
  470.     USHORT  fsMethod;           /* One of&gml FPM_BEGINNING, FPM_CURRENT, */
  471.                                 /* or FPM_END                             */
  472.     ULONG   cbDistance;         /* Byte offset for seek                   */
  473.     ULONG   cbNewPosition;      /* Bytes from start of file after seek    */
  474. } FIOSEEKCMD;
  475. typedef FIOSEEKCMD FAR *PFIOSEEKCMD;
  476.  
  477. /* XLATOFF */
  478. #pragma pack(2)
  479. /* XLATON */
  480.  
  481. typedef struct  _FIOREADWRITE { /* RWC Read&Write command structure       */
  482.     USHORT      usCmd;          /* Cmd = FIO_READ or FIO_WRITE            */
  483.     PVOID       pbBuffer;       /* Pointer to data buffer                 */
  484.     USHORT      cbBufferLen;    /* Bytes in buffer or max size            */
  485.     USHORT      cbActualLen;    /* Bytes actually read/written            */
  486. } FIOREADWRITE;
  487. typedef FIOREADWRITE FAR *PFIOREADWRITE;
  488.  
  489. /* XLATOFF */
  490. #pragma pack()
  491. /* XLATON */
  492.  
  493. /***
  494.  * EA Info Levels & Find First/Next
  495.  * API's: DosFindFirst, DosQueryFileInfo, DosQueryPathInfo, DosSetFileInfo,
  496.  *      DosSetPathInfo
  497.  */
  498.  
  499. /* File info levels : All listed API's */
  500. #define FIL_STANDARD               1   /* Info level 1, standard file info */
  501. #define FIL_QUERYEASIZE            2   /* Level 2, return Full EA size     */
  502. #define FIL_QUERYEASFROMLIST       3   /* Level 3, return requested EA's   */
  503. #define FIL_QUERYALLEAS            4   /* Level 4, return all EA's         */
  504.  
  505. /* File info levels: Dos...PathInfo only */
  506. #define FIL_QUERYFULLNAME          5   /* Level 5, return fully qualified  */
  507.                                        /*   name of file                   */
  508. #define FIL_NAMEISVALID            6   /* Level 6, check validity of       */
  509.                                        /* file/path name for this FSD      */
  510.  
  511. /* DosFindNotifyFirst() */
  512. #define FNOTIL_STANDARD            1   /* Find-Notify Info level 1&gml Return */
  513.                                        /* standard directory change info      */
  514.  
  515. /* DosFsAttach() */
  516. /* Attact or detach */
  517. #define FSATTACH                   0       /* Attach file server              */
  518. #define FSDETACH                   1       /* Detach file server              */
  519. #define FS_SPOOLATTACH             2       /* Register a spooler device */
  520. #define FS_SPOOLDETACH             3       /* De-register a spooler device */
  521.  
  522. /* DosFsCtl() */
  523. /* Routing type */
  524. #define FSCTL_HANDLE               1       /* File Handle directs req routing */
  525. #define FSCTL_PATHNAME             2       /* Path Name directs req routing   */
  526. #define FSCTL_FSDNAME              3       /* FSD Name directs req routing    */
  527.  
  528. /* DosQueryFSAttach() */
  529. /* Information level types (defines method of query) */
  530. #define FSAIL_QUERYNAME            1       /* Return data for a Drive or Device */
  531. #define FSAIL_DEVNUMBER            2       /* Return data for Ordinal Device #  */
  532. #define FSAIL_DRVNUMBER            3       /* Return data for Ordinal Drive #   */
  533.  
  534. /* Item types (from data structure item "iType") */
  535. #define FSAT_CHARDEV               1       /* Resident character device    */
  536. #define FSAT_PSEUDODEV             2       /* Pusedu-character device      */
  537. #define FSAT_LOCALDRV              3       /* Local drive                  */
  538. #define FSAT_REMOTEDRV             4       /* Remote drive attached to FSD */
  539.  
  540. /* XLATOFF */
  541. #pragma pack(1)
  542. /* XLATON */
  543.  
  544. typedef struct  _FSQBUFFER {    /* fsqbuf Data structure for QFSAttach*/
  545.     USHORT  iType;              /* Item type                          */
  546.     USHORT  cbName;             /* Length of item name, sans NULL     */
  547.     UCHAR   szName[1];          /* ASCIIZ item name                   */
  548.     USHORT  cbFSDName;          /* Length of FSD name, sans NULL      */
  549.     UCHAR   szFSDName[1];       /* ASCIIZ FSD name                    */
  550.     USHORT  cbFSAData;          /* Length of FSD Attach data returned */
  551.     UCHAR   rgFSAData[1];       /* FSD Attach data from FSD           */
  552. } FSQBUFFER;
  553. typedef FSQBUFFER FAR *PFSQBUFFER;
  554.  
  555. /* XLATOFF */
  556. #pragma pack()
  557.  
  558. #pragma pack(2)
  559. /* XLATON */
  560.  
  561. typedef struct _SPOOLATTACH {   /* Data structure for spooler operations */
  562.     USHORT      hNmPipe;        /* Named pipe handle                     */
  563.     ULONG       ulKey;          /* Attached Key                          */
  564. } SPOOLATTACH;
  565. typedef SPOOLATTACH FAR *PSPOOLATTACH;
  566.  
  567. /* XLATOFF */
  568. #pragma pack()
  569. /* XLATON */
  570.  
  571. /*
  572.  * File System Drive Information&gml DosQueryFSInfo DosSetFSInfo
  573.  */
  574.  
  575. /* FS Drive Info Levels                                                    */
  576. #define FSIL_ALLOC                 1 /* Drive allocation info (Query only) */
  577. #define FSIL_VOLSER                2 /* Drive Volume/Serial information    */
  578.  
  579. /* DosQueryFHType() */
  580. /* Handle classes (low 8 bits of Handle Type)                              */
  581. #define FHT_DISKFILE               0x0000  /* Disk file handle             */
  582. #define FHT_CHRDEV                 0x0001  /* Character device handle      */
  583. #define FHT_PIPE                   0x0002  /* Pipe handle                  */
  584.  
  585. /* Handle bits (high 8 bits of Handle Type)                                */
  586. #define FHB_DSKREMOTE              0x8000  /* Remote disk                  */
  587. #define FHB_CHRDEVREMOTE           0x8000  /* Remote character device      */
  588. #define FHB_PIPEREMOTE             0x8000  /* Remote pipe                  */
  589.  
  590.  
  591. typedef SHANDLE HFILE;          /* hf */
  592. typedef HFILE FAR *PHFILE;
  593.  
  594. #ifndef INCL_SAADEFS
  595.  
  596. /* File time and date types */
  597.  
  598. typedef struct _FTIME {         /* ftime */
  599.     USHORT twosecs : 5;
  600.     USHORT minutes : 6;
  601.     USHORT hours   : 5;
  602. } FTIME;
  603. typedef FTIME FAR *PFTIME;
  604.  
  605. typedef struct _FDATE {         /* fdate */
  606.     USHORT day     : 5;
  607.     USHORT month   : 4;
  608.     USHORT year    : 7;
  609. } FDATE;
  610. typedef FDATE FAR *PFDATE;
  611.  
  612. typedef struct _FILEFINDBUF {   /* findbuf */
  613.     FDATE   fdateCreation;
  614.     FTIME   ftimeCreation;
  615.     FDATE   fdateLastAccess;
  616.     FTIME   ftimeLastAccess;
  617.     FDATE   fdateLastWrite;
  618.     FTIME   ftimeLastWrite;
  619.     ULONG   cbFile;
  620.     ULONG   cbFileAlloc;
  621.     USHORT  attrFile;
  622.     UCHAR   cchName;
  623.     CHAR    achName[CCHMAXPATHCOMP];
  624. } FILEFINDBUF;
  625. typedef FILEFINDBUF FAR *PFILEFINDBUF;
  626.  
  627. /* XLATOFF */
  628. #pragma pack(1)
  629. /* XLATON */
  630.  
  631. typedef struct _FILEFINDBUF2 {  /* findbuf2 */
  632.     FDATE   fdateCreation;
  633.     FTIME   ftimeCreation;
  634.     FDATE   fdateLastAccess;
  635.     FTIME   ftimeLastAccess;
  636.     FDATE   fdateLastWrite;
  637.     FTIME   ftimeLastWrite;
  638.     ULONG   cbFile;
  639.     ULONG   cbFileAlloc;
  640.     USHORT  attrFile;
  641.     ULONG   cbList;
  642.     UCHAR   cchName;
  643.     CHAR    achName[CCHMAXPATHCOMP];
  644. } FILEFINDBUF2;
  645. typedef FILEFINDBUF2 FAR *PFILEFINDBUF2;
  646.  
  647. /* XLATOFF */
  648. #pragma pack()
  649. /* XLATON */
  650.  
  651. /* extended attribute structures */
  652. typedef struct _GEA {          /* gea */
  653.     BYTE    cbName;            /* name length not including NULL          */
  654.     CHAR    szName[1];         /* attribute name                          */
  655. } GEA;
  656. typedef GEA FAR *PGEA;
  657.  
  658. typedef struct _GEALIST {       /* geal */
  659.     ULONG  cbList;              /* total bytes of structure inc full list */
  660.     GEA    list[1];             /* variable length GEA structures         */
  661. } GEALIST;
  662. typedef GEALIST FAR * PGEALIST;
  663.  
  664. typedef struct _FEA {           /* fea */
  665.     BYTE    fEA;                /* flags                                  */
  666.     BYTE    cbName;             /* name length not including NULL         */
  667.     USHORT  cbValue;            /* value length                           */
  668. } FEA;
  669. typedef FEA FAR *PFEA;
  670.  
  671. /* flags for _FEA.fEA */
  672.  
  673. #define FEA_NEEDEA 0x80     /* need EA bit */
  674.  
  675. typedef struct _FEALIST {       /* feal */
  676.     ULONG  cbList;              /* total bytes of structure inc full list */
  677.     FEA    list[1];             /* variable length FEA structures         */
  678. } FEALIST;
  679. typedef FEALIST FAR * PFEALIST;
  680.  
  681. typedef struct _EAOP {          /* eaop */
  682.     PGEALIST fpGEAList;         /* general EA list */
  683.     PFEALIST fpFEAList;         /* full EA list    */
  684.     ULONG    oError;
  685. } EAOP;
  686. typedef EAOP FAR * PEAOP;
  687.  
  688.  
  689. /*
  690.  * Equates for EA types
  691.  *
  692.  * Values 0xFFFE thru 0x8000 are reserved.
  693.  * Values 0x0000 thru 0x7fff are user definable.
  694.  * Value  0xFFFC is not used
  695.  */
  696.  
  697. #define     EAT_BINARY             0xFFFE /* length preceeded binary          */
  698. #define     EAT_ASCII              0xFFFD /* length preceeded ASCII           */
  699. #define     EAT_BITMAP             0xFFFB /* length preceeded bitmap          */
  700. #define     EAT_METAFILE           0xFFFA /* length preceeded metafile        */
  701. #define     EAT_ICON               0xFFF9 /* length preceeded icon            */
  702. #define     EAT_EA                 0xFFEE /* length preceeded ASCII extended attribute */
  703.                                           /* name of associated data (#include)*/
  704. #define     EAT_MVMT               0xFFDF /* multi-valued, multi-typed field  */
  705. #define     EAT_MVST               0xFFDE /* multi-valued, single-typed field */
  706. #define     EAT_ASN1               0xFFDD /* ASN.1 field                      */
  707.  
  708. /* XLATOFF */
  709. #pragma pack(1)
  710. /* XLATON */
  711.  
  712. typedef struct _CNPATH {      /* CHANGENOTIFYPATH */
  713.     ULONG   oNextEntryOffset;
  714.     ULONG   wFlags;
  715.     BYTE    cbName;
  716.     CHAR    szName[1];
  717. } CNPATH;
  718.  
  719. typedef CNPATH *PCNPATH;
  720.  
  721. typedef struct _CNINFO {      /* CHANGENOTIFYINFO */
  722.     ULONG   oNextEntryOffset;
  723.     CHAR    bAction;
  724.     USHORT  cbName;
  725.     CHAR    szName[1];
  726. } CNINFO;
  727.  
  728. typedef CNINFO *PCNINFO;
  729.  
  730. typedef  ULONG  FHLOCK;
  731. typedef  PULONG  PFHLOCK;
  732.  
  733. /* XLATOFF */
  734. #pragma pack()
  735. /* XLATON */
  736.  
  737. /*
  738.  *  Equates for ChangeNotifyInfo baction field
  739.  *
  740.  */
  741.  
  742. #define             RCNF_FILE_ADDED        0x0001
  743. #define             RCNF_FILE_DELETED      0x0002
  744. #define             RCNF_DIR_ADDED         0x0003
  745. #define             RCNF_DIR_DELETED       0x0004
  746. #define             RCNF_MOVED_IN          0x0005
  747. #define             RCNF_MOVED_OUT         0x0006
  748. #define             RCNF_CHANGED           0x0007
  749. #define             RCNF_OLDNAME           0x0008
  750. #define             RCNF_NEWNAME           0x0009
  751. #define             RCNF_DEVICE_ATTACHED   0x000A
  752. #define             RCNF_DEVICE_DETACHED   0x000B
  753.  
  754. #endif  /* !INCL_SAADEFS */
  755.  
  756. /* XLATOFF */
  757. #ifndef INCL_NOXLATE_DOS16
  758. #define DosBufReset     Dos16BufReset
  759. #define DosChDir        Dos16ChDir
  760. #define DosChgFilePtr   Dos16ChgFilePtr
  761. #define DosProtectChgFilePtr   Dos16ProtectChgFilePtr
  762. #define DosClose        Dos16Close
  763. #define DosProtectClose        Dos16ProtectClose
  764. #define DosCloseChangeNotify         Dos16CloseChangeNotify
  765. #define DosCopy         Dos16Copy
  766. #define DosForceDelete  Dos16ForceDelete
  767. #define DosDelete       Dos16Delete
  768. #define DosDupHandle    Dos16DupHandle
  769. #define DosEditName     Dos16EditName
  770. #define DosEnumAttribute        Dos16EnumAttribute
  771. #define DosProtectEnumAttribute        Dos16ProtectEnumAttribute
  772. #define DosFileIO       Dos16FileIO
  773. #define DosProtectFileIO       Dos16ProtectFileIO
  774. #define DosFileLocks    Dos16FileLocks
  775. #define DosProtectFileLocks    Dos16ProtectFileLocks
  776. #define DosFindClose    Dos16FindClose
  777. #define DosFindFirst    Dos16FindFirst
  778. #define DosFindFirst2   Dos16FindFirst2
  779. #define DosFindNext     Dos16FindNext
  780. #define DosFindNotifyClose      Dos16FindNotifyClose
  781. #define DosFindNotifyFirst      Dos16FindNotifyFirst
  782. #define DosFindNotifyNext       Dos16FindNotifyNext
  783. #define DosFSAttach     Dos16FSAttach
  784. #define DosFSCtl        Dos16FSCtl
  785. #define DosMkDir        Dos16MkDir
  786. #define DosMkDir2       Dos16MkDir2
  787. #define DosMove         Dos16Move
  788. #define DosNewSize      Dos16NewSize
  789. #define DosProtectNewSize      Dos16ProtectNewSize
  790. #define DosOpen         Dos16Open
  791. #define DosOpen2        Dos16Open2
  792. #define DosProtectOpen         Dos16ProtectOpen
  793. #define DosOpenChangeNotify         Dos16OpenChangeNotify
  794. #define DosQCurDir      Dos16QCurDir
  795. #define DosQCurDisk     Dos16QCurDisk
  796. #define DosQFHandState  Dos16QFHandState
  797. #define DosProtectQFHandState  Dos16ProtectQFHandState
  798. #define DosQFileInfo    Dos16QFileInfo
  799. #define DosProtectQFileInfo    Dos16ProtectQFileInfo
  800. #define DosQFileMode    Dos16QFileMode
  801. #define DosQFSAttach    Dos16QFSAttach
  802. #define DosQFSInfo      Dos16QFSInfo
  803. #define DosQHandType    Dos16QHandType
  804. #define DosQPathInfo    Dos16QPathInfo
  805. #define DosQVerify      Dos16QVerify
  806. #define DosRead         Dos16Read
  807. #define DosProtectRead         Dos16ProtectRead
  808. #define DosReadAsync    Dos16ReadAsync
  809. #define DosResetChangeNotify         Dos16ResetChangeNotify
  810. #define DosRmDir        Dos16RmDir
  811. #define DosSelectDisk   Dos16SelectDisk
  812. #define DosSetFHandState        Dos16SetFHandState
  813. #define DosSetFileInfo  Dos16SetFileInfo
  814. #define DosSetFileMode  Dos16SetFileMode
  815. #define DosSetFilePtr   Dos16SetFilePtr
  816. #define DosProtectSetFilePtr   Dos16ProtectSetFilePtr
  817. #define DosSetFSInfo    Dos16SetFSInfo
  818. #define DosSetMaxFH     Dos16SetMaxFH
  819. #define DosSetPathInfo  Dos16SetPathInfo
  820. #define DosSetVerify    Dos16SetVerify
  821. #define DosShutdown     Dos16Shutdown
  822. #define DosWrite        Dos16Write
  823. #define DosProtectWrite        Dos16ProtectWrite
  824. #define DosWriteAsync   Dos16WriteAsync
  825. #endif /* INCL_NOXLATE_DOS16 */
  826. /* XLATON */
  827.  
  828. APIRET  APIENTRY DosOpen(PSZ pszFname, PHFILE phfOpen, PUSHORT pusAction,
  829.                         ULONG ulFSize, USHORT usAttr, USHORT fsOpenFlags,
  830.                         USHORT fsOpenMode, ULONG ulReserved);
  831. APIRET  APIENTRY DosOpen2(PSZ pszFname, PHFILE phf, PUSHORT pusAction,
  832.                          ULONG ulFSize, USHORT usAttr, USHORT usOpenFlags,
  833.                          ULONG usOpenMode, PEAOP pvEABuf, ULONG ulReserved);
  834. APIRET  APIENTRY DosProtectOpen(PSZ pszFname, PHFILE phf, PUSHORT pusAction,
  835.                          ULONG ulFSize, USHORT usAttr, USHORT usOpenFlags,
  836.                          ULONG usOpenMode, PEAOP pvEABuf,
  837.                          PFHLOCK pfhFileHandleLockID, ULONG ulReserved);
  838. APIRET  APIENTRY DosClose(HFILE hf);
  839. APIRET  APIENTRY DosProtectClose(HFILE hf, FHLOCK fhFileHandleLockID);
  840. APIRET  APIENTRY DosRead(HFILE hf, PVOID pBuf, USHORT cbBuf,
  841.                         PUSHORT pcbBytesRead);
  842. APIRET  APIENTRY DosProtectRead(HFILE hf, PVOID pBuf, USHORT cbBuf,
  843.                         PUSHORT pcbBytesRead, FHLOCK fhFileHandleLockID);
  844. APIRET  APIENTRY DosWrite(HFILE hf, PVOID bBuf, USHORT cbBuf,
  845.                          PUSHORT pcbBytesWritten);
  846. APIRET  APIENTRY DosProtectWrite(HFILE hf, PVOID bBuf, USHORT cbBuf,
  847.                          PUSHORT pcbBytesWritten, FHLOCK fhFileHandleLockID);
  848.  
  849. /* File system shutdown */
  850.  
  851. APIRET  APIENTRY DosShutdown(ULONG ulReserved);
  852.  
  853. /* File time and date types */
  854.  
  855. typedef struct _FILESTATUS {    /* fsts */
  856.     FDATE   fdateCreation;
  857.     FTIME   ftimeCreation;
  858.     FDATE   fdateLastAccess;
  859.     FTIME   ftimeLastAccess;
  860.     FDATE   fdateLastWrite;
  861.     FTIME   ftimeLastWrite;
  862.     ULONG   cbFile;
  863.     ULONG   cbFileAlloc;
  864.     USHORT  attrFile;
  865. } FILESTATUS;
  866. typedef FILESTATUS FAR *PFILESTATUS;
  867.  
  868. /* XLATOFF */
  869. #pragma pack(2)
  870. /* XLATON */
  871.  
  872. typedef struct _FILESTATUS2 {  /* fsts2 */
  873.     FDATE   fdateCreation;
  874.     FTIME   ftimeCreation;
  875.     FDATE   fdateLastAccess;
  876.     FTIME   ftimeLastAccess;
  877.     FDATE   fdateLastWrite;
  878.     FTIME   ftimeLastWrite;
  879.     ULONG   cbFile;
  880.     ULONG   cbFileAlloc;
  881.     USHORT  attrFile;
  882.     ULONG   cbList;
  883. } FILESTATUS2;
  884. typedef FILESTATUS2 FAR *PFILESTATUS2;
  885.  
  886. /* XLATOFF */
  887. #pragma pack()
  888. /* XLATON */
  889.  
  890. typedef struct _FSALLOCATE {    /* fsalloc */
  891.     ULONG   idFileSystem;
  892.     ULONG   cSectorUnit;
  893.     ULONG   cUnit;
  894.     ULONG   cUnitAvail;
  895.     USHORT  cbSector;
  896. } FSALLOCATE;
  897. typedef FSALLOCATE FAR *PFSALLOCATE;
  898.  
  899. typedef struct _VOLUMELABEL {   /* vol */
  900.     BYTE    cch;
  901.     CHAR    szVolLabel[12];
  902. } VOLUMELABEL;
  903. typedef VOLUMELABEL FAR *PVOLUMELABEL;
  904.  
  905. typedef struct _FSINFO {        /* fsinf */
  906.     ULONG ulVSN;
  907.     VOLUMELABEL vol;
  908. } FSINFO;
  909. typedef FSINFO FAR *PFSINFO;
  910.  
  911. /* HANDTYPE values */
  912.  
  913. #define HANDTYPE_FILE              0x0000
  914. #define HANDTYPE_DEVICE            0x0001
  915. #define HANDTYPE_PIPE              0x0002
  916. #define HANDTYPE_NETWORK           0x8000
  917.  
  918. typedef struct _FILELOCK {      /* flock */
  919.     LONG    lOffset;
  920.     LONG    lRange;
  921. } FILELOCK;
  922. typedef FILELOCK FAR *PFILELOCK;
  923.  
  924. typedef SHANDLE HDIR;           /* hdir */
  925. typedef HDIR FAR *PHDIR;
  926.  
  927. APIRET  APIENTRY DosOpenChangeNotify(PCNPATH PathBuf, ULONG LogSize, PHDIR hdir,
  928.                                      ULONG ulReserved);
  929. APIRET  APIENTRY DosResetChangeNotify(PCNINFO LogBuf, ULONG BufferSize,
  930.                                       PULONG LogCount, HDIR hdir);
  931. APIRET  APIENTRY DosCloseChangeNotify(HDIR hdir);
  932.  
  933. APIRET  APIENTRY DosForceDelete(PSZ pszFName, ULONG ulReserverd);
  934. APIRET  APIENTRY DosDelete(PSZ pszFName, ULONG ulReserverd);
  935. APIRET  APIENTRY DosDupHandle(HFILE hfOld, PHFILE phfNew);
  936.  
  937. APIRET  APIENTRY DosQFHandState(HFILE hf, PUSHORT pfsOpenMode);
  938. APIRET  APIENTRY DosProtectQFHandState(HFILE hf, PUSHORT pfsOpenMode,
  939.                                        FHLOCK fhFileHandleLockID);
  940. APIRET  APIENTRY DosSetFHandState(HFILE hf, USHORT fsState);
  941. APIRET  APIENTRY DosProtectSetFHandState(HFILE hf, USHORT fsState,
  942.                                          FHLOCK fhFileHandleLockID);
  943. APIRET  APIENTRY DosQHandType(HFILE hf, PUSHORT pfsType, PUSHORT pusDevAttr);
  944.  
  945. APIRET  APIENTRY DosReadAsync (HFILE hf, PULONG hsemRam, PUSHORT pusErrCode,
  946.                               PVOID pBuf, USHORT cbBuf, PUSHORT pcbBytesRead);
  947. APIRET  APIENTRY DosWriteAsync(HFILE hf, PULONG hsemRam, PUSHORT pusErrCode,
  948.                               PVOID pBuf, USHORT cbBuf, PUSHORT pcbBytesWritten);
  949.  
  950. APIRET  APIENTRY DosFindFirst(PSZ pszFSpec, PHDIR phdir, USHORT usAttr,
  951.                              PFILEFINDBUF pffb, USHORT cbBuf, PUSHORT pcSearch,
  952.                              ULONG ulReserved);
  953. APIRET  APIENTRY DosFindFirst2(PSZ pszFSpec, PHDIR phdir, USHORT usAttr,
  954.                               PVOID pBuf, USHORT cbBuf, PUSHORT pcSearch,
  955.                               USHORT usInfoLevel, ULONG ulReserved);
  956. APIRET  APIENTRY DosFindNext(HDIR hdir, PFILEFINDBUF pffb, USHORT cbBuf,
  957.                             PUSHORT pcSearch);
  958. APIRET  APIENTRY DosFindClose(HDIR hdir);
  959. APIRET  APIENTRY DosFindNotifyFirst(PSZ pszPath, PHDIR hdir, USHORT usAttr,
  960.                                    PVOID pBuf, USHORT cbBuf, PUSHORT pcChg,
  961.                                    USHORT usInfoLevel, ULONG ulTimeOut,
  962.                                    ULONG ulReserved);
  963. APIRET  APIENTRY DosFindNotifyNext(HDIR hDir, PVOID pBuf, USHORT cbBuf,
  964.                                   PUSHORT pcChg, ULONG ulTimeOut);
  965. APIRET  APIENTRY DosFindNotifyClose(HDIR hDir);
  966.  
  967. APIRET  APIENTRY DosFSAttach(PSZ pszDevName, PSZ pszFSD, PVOID pData,
  968.                             USHORT cbData, USHORT fsOp, ULONG ulReserved);
  969. APIRET  APIENTRY DosQFSAttach(PSZ pszDev, USHORT usOrdinal, USHORT usInfoLevel,
  970.                              PVOID pFSAttBuf, PUSHORT cbBuf, ULONG ulReserved);
  971. APIRET  APIENTRY DosFSCtl(PVOID pData, USHORT cbData, PUSHORT pcbData,
  972.                          PVOID pParms, USHORT cbParms, PUSHORT pcbParms,
  973.                          USHORT usFunCode, PSZ pszRoute, HFILE hf,
  974.                          USHORT usRouteMethod, ULONG ulReserved);
  975.  
  976. APIRET  APIENTRY DosNewSize(HFILE hf, ULONG ulNewSize);
  977. APIRET  APIENTRY DosProtectNewSize(HFILE hf, ULONG ulNewSize,
  978.                                    FHLOCK fhFileHandleLockID);
  979. APIRET  APIENTRY DosBufReset(HFILE hf);
  980.  
  981. APIRET  APIENTRY DosChgFilePtr(HFILE hf, LONG lOffset, USHORT fsMethod,
  982.                               PULONG pulNewOffset);
  983. APIRET  APIENTRY DosProtectChgFilePtr(HFILE hf, LONG lOffset, USHORT fsMethod,
  984.                                       PULONG pulNewOffset,
  985.                                       FHLOCK fhFileHandleLockID);
  986.  
  987. APIRET  APIENTRY DosSetFilePtr(HFILE hf, LONG lOffset, USHORT fsMethod,
  988.                               PULONG pulNewOffset);
  989. APIRET  APIENTRY DosProtectSetFilePtr(HFILE hf, LONG lOffset, USHORT fsMethod,
  990.                                       PULONG pulNewOffset,
  991.                                       FHLOCK fhFileHandleLockID);
  992.  
  993. APIRET  APIENTRY DosFileLocks(HFILE hf, PFILELOCK pUnlock, PFILELOCK pLock);
  994. APIRET  APIENTRY DosProtectFileLocks(HFILE hf, PFILELOCK pUnlock,
  995.                                      PFILELOCK pLock,
  996.                                      FHLOCK fhFileHandleLockID);
  997.  
  998. APIRET  APIENTRY DosMove(PSZ pszOld, PSZ pszNew, ULONG ulReserved);
  999. APIRET  APIENTRY DosCopy(PSZ pszSrc, PSZ pszDst, USHORT usOpt, ULONG ulReserved);
  1000. APIRET  APIENTRY DosEditName(USHORT usEditLevel, PSZ pszSrc, PSZ pszEdit,
  1001.                             PBYTE pszDst, USHORT cbDst);
  1002.  
  1003. APIRET  APIENTRY DosFileIO(HFILE hf, PVOID pbCmd, USHORT cbCmd, PUSHORT pusErr);
  1004. APIRET  APIENTRY DosProtectFileIO(HFILE hf, PVOID pbCmd, USHORT cbCmd,
  1005.                                   PUSHORT pusErr,
  1006.                                   FHLOCK fhFileHandleLockID);
  1007. APIRET  APIENTRY DosMkDir(PSZ pszDirName, ULONG usReserved);
  1008. APIRET  APIENTRY DosMkDir2(PSZ pszDir, PEAOP pBuf, ULONG ulReserved);
  1009. APIRET  APIENTRY DosRmDir(PSZ pszDir, ULONG ulReserved);
  1010. APIRET  APIENTRY DosSelectDisk(USHORT usDrvNum);
  1011. APIRET  APIENTRY DosQCurDisk(PUSHORT pusDrvNum, PULONG pulLogDrvMap);
  1012.  
  1013. APIRET  APIENTRY DosChDir(PSZ pszDir, ULONG ulReserved);
  1014. APIRET  APIENTRY DosQCurDir(USHORT usDrvNum, PBYTE pszPathBuf,
  1015.                            PUSHORT pcbPathBuf);
  1016.  
  1017. APIRET  APIENTRY DosQFSInfo(USHORT usDrvNum, USHORT usInfoLevel, PVOID pbInfo,
  1018.                            USHORT cbInfo);
  1019. APIRET  APIENTRY DosSetFSInfo(USHORT usDrvNum, USHORT usInfoLevel, PVOID pBuf,
  1020.                              USHORT cbBuf);
  1021. APIRET  APIENTRY DosQVerify(PUSHORT pfVerifyOn);
  1022. APIRET  APIENTRY DosSetVerify(USHORT fVerify);
  1023. APIRET  APIENTRY DosSetMaxFH(USHORT usHandles);
  1024.  
  1025. APIRET  APIENTRY DosQFileInfo(HFILE hf, USHORT usInfoLevel, PVOID pInfoBuf,
  1026.                              USHORT cbInfoBuf);
  1027. APIRET  APIENTRY DosProtectQFileInfo(HFILE hf, USHORT usInfoLevel, PVOID pInfoBuf,
  1028.                                      USHORT cbInfoBuf,
  1029.                                      FHLOCK fhFileHandleLockID);
  1030. APIRET  APIENTRY DosSetFileInfo(HFILE hf, USHORT usInfoLevel, PVOID pInfoBuf,
  1031.                                USHORT cbInfoBuf);
  1032. APIRET  APIENTRY DosProtectSetFileInfo(HFILE hf, USHORT usInfoLevel, PVOID pInfoBuf,
  1033.                                        USHORT cbInfoBuf,
  1034.                                        FHLOCK fhFileHandleLockID);
  1035. APIRET  APIENTRY DosQPathInfo(PSZ pszPath, USHORT usInfoLevel, PVOID pInfoBuf,
  1036.                              USHORT cbInfoBuf, ULONG ulReserved);
  1037. APIRET  APIENTRY DosSetPathInfo(PSZ pszPath, USHORT usInfoLevel, PVOID pInfoBuf,
  1038.                                USHORT cbInfoBuf, USHORT usFlags,
  1039.                                ULONG ulReserved);
  1040.  
  1041. /* defines for dossetpathinfo -pathinfo flag */
  1042. #define DSPI_WRTTHRU    0x10    /* write through */
  1043.  
  1044. APIRET  APIENTRY DosQFileMode(PSZ pszFName, PUSHORT pusAttr, ULONG ulReserved);
  1045. APIRET  APIENTRY DosSetFileMode(PSZ pszFName, USHORT usAttr, ULONG ulReserved);
  1046.  
  1047. APIRET  APIENTRY DosEnumAttribute(USHORT fRefType, PVOID pFileRef, ULONG iStartEntry, PVOID pEnumBuf, ULONG cbBuf, PULONG pcbActual, ULONG infoLevel, ULONG reserved);
  1048. APIRET  APIENTRY DosProtectEnumAttribute(USHORT fRefType, PVOID pFileRef, ULONG iStartEntry, PVOID pEnumBuf, ULONG cbBuf, PULONG pcbActual, ULONG infoLevel, FHLOCK fhFileHandleLockID, ULONG reserved);
  1049.  
  1050. typedef struct _DENA1 { /* _dena1 level 1 info returned from DosEnumAttribute */
  1051.     UCHAR   reserved;         /* 0                                           */
  1052.     UCHAR   cbName;           /* length of name exculding NULL               */
  1053.     USHORT  cbValue;          /* length of value                             */
  1054.     UCHAR   szName[1];        /* variable length asciiz name                 */
  1055. } DENA1;
  1056. typedef DENA1 FAR *PDENA1;
  1057.  
  1058. /* Infolevels for DosEnumAttribute  */
  1059. #define ENUMEA_LEVEL_NO_VALUE   1L      /* FEA without value */
  1060. /* Reference types for DosEnumAttribute */
  1061. #define ENUMEA_REFTYPE_FHANDLE  0       /* file handle */
  1062. #define ENUMEA_REFTYPE_PATH     1       /* path name */
  1063. #define ENUMEA_REFTYPE_MAX      ENUMEA_REFTYPE_PATH
  1064.  
  1065. #endif /* common INCL_DOSFILEMGR */
  1066.  
  1067. #if (defined(INCL_DOSMEMMGR) || !defined(INCL_NOCOMMON))
  1068. /*** Memory management */
  1069.  
  1070. /* XLATOFF */
  1071. #ifndef INCL_NOXLATE_DOS16
  1072. #define DosAllocSeg     Dos16AllocSeg
  1073. #define DosFreeSeg      Dos16FreeSeg
  1074. #define DosGetSeg       Dos16GetSeg
  1075. #define DosGiveSeg      Dos16GiveSeg
  1076. #define DosReallocSeg   Dos16ReallocSeg
  1077. #define DosSizeSeg      Dos16SizeSeg
  1078. #endif /* INCL_NOXLATE_DOS16 */
  1079. /* XLATON */
  1080.  
  1081.  
  1082. APIRET  APIENTRY DosAllocSeg(USHORT cbSize, PSEL pSel, USHORT fsAlloc);
  1083. APIRET  APIENTRY DosFreeSeg(SEL sel);
  1084. APIRET  APIENTRY DosGetSeg(SEL sel);
  1085. APIRET  APIENTRY DosGiveSeg(SEL sel, PID pid, PSEL pSelRecipient);
  1086. APIRET  APIENTRY DosReallocSeg(USHORT cbNewSize, SEL sel);
  1087. APIRET  APIENTRY DosSizeSeg(SEL sel, PULONG pcbSize);
  1088.  
  1089. /* Segment attribute flags (used with DosAllocSeg) */
  1090.  
  1091. #define SEG_NONSHARED              0x0000
  1092. #define SEG_GIVEABLE               0x0001
  1093. #define SEG_GETTABLE               0x0002
  1094. #define SEG_DISCARDABLE            0x0004
  1095.  
  1096. #endif /* common INCL_DOSMEMMGR */
  1097.  
  1098. #ifdef INCL_DOSMEMMGR
  1099.  
  1100. /* XLATOFF */
  1101. #ifndef INCL_NOXLATE_DOS16
  1102. #define DosAllocHuge    Dos16AllocHuge
  1103. #define DosAllocShrSeg  Dos16AllocShrSeg
  1104. #define DosCreateCSAlias        Dos16CreateCSAlias
  1105. #define DosGetHugeShift Dos16GetHugeShift
  1106. #define DosGetShrSeg    Dos16GetShrSeg
  1107. #define DosLockSeg      Dos16LockSeg
  1108. #define DosMemAvail     Dos16MemAvail
  1109. #define DosReallocHuge  Dos16ReallocHuge
  1110. #define DosSubAlloc     Dos16SubAlloc
  1111. #define DosSubFree      Dos16SubFree
  1112. #define DosSubSet       Dos16SubSet
  1113. #define DosUnlockSeg    Dos16UnlockSeg
  1114. #endif /* INCL_NOXLATE_DOS16 */
  1115. /* XLATON */
  1116.  
  1117. APIRET  APIENTRY DosAllocHuge(USHORT cSegs, USHORT cbPartialSeg, PSEL psel,
  1118.                              USHORT cMaxSegs, USHORT fsAlloc);
  1119. APIRET  APIENTRY DosReallocHuge(USHORT cSegs, USHORT cbPartialSeg, SEL sel);
  1120. APIRET  APIENTRY DosGetHugeShift(PUSHORT pusShiftCount);
  1121.  
  1122. APIRET  APIENTRY DosAllocShrSeg(USHORT cbSeg, PSZ pszSegName, PSEL psel);
  1123.  
  1124. APIRET  APIENTRY DosLockSeg(SEL sel);
  1125. APIRET  APIENTRY DosUnlockSeg(SEL sel);
  1126.  
  1127. APIRET  APIENTRY DosGetShrSeg(PSZ pszSegName, PSEL psel);
  1128.  
  1129. APIRET  APIENTRY DosMemAvail(PULONG pcbFree);
  1130. APIRET  APIENTRY DosCreateCSAlias(SEL selDS, PSEL pselCS);
  1131.  
  1132. APIRET  APIENTRY DosSubAlloc(SEL sel, PUSHORT pusOffset, USHORT cb);
  1133. APIRET  APIENTRY DosSubFree(SEL sel, USHORT offBlock, USHORT cb);
  1134. APIRET  APIENTRY DosSubSet(SEL sel, USHORT fFlags, USHORT cbNew);
  1135.  
  1136. #endif /* INCL_DOSMEMMGR */
  1137.  
  1138. #if (defined(INCL_DOSSEMAPHORES) || !defined(INCL_NOCOMMON))
  1139.  
  1140. /*** Semaphore support */
  1141.  
  1142. #define SEM_INDEFINITE_WAIT       -1L
  1143. #define SEM_IMMEDIATE_RETURN       0L
  1144.  
  1145. /* XLATOFF */
  1146. #ifndef INCL_NOXLATE_DOS16
  1147. #define DosSemClear     Dos16SemClear
  1148. #define DosSemRequest   Dos16SemRequest
  1149. #define DosSemSet       Dos16SemSet
  1150. #define DosSemSetWait   Dos16SemSetWait
  1151. #define DosSemWait      Dos16SemWait
  1152. #endif /* INCL_NOXLATE_DOS16 */
  1153. /* XLATON */
  1154.  
  1155. APIRET  APIENTRY DosSemClear(HSEM hsem);
  1156. APIRET  APIENTRY DosSemSet(HSEM hsem);
  1157. APIRET  APIENTRY DosSemWait(HSEM hsem, LONG lTimeOut);
  1158. APIRET  APIENTRY DosSemSetWait(HSEM hsem, LONG lTimeOut);
  1159. APIRET  APIENTRY DosSemRequest(HSEM hsem, LONG lTimeOut);
  1160.  
  1161. #endif /* common INCL_DOSSEMAPHORES */
  1162.  
  1163. #ifdef INCL_DOSSEMAPHORES
  1164.  
  1165. typedef LHANDLE HSYSSEM;        /* hssm */
  1166. typedef HSYSSEM FAR *PHSYSSEM;
  1167.  
  1168. #define CSEM_PRIVATE               0
  1169. #define CSEM_PUBLIC                1
  1170.  
  1171. /* XLATOFF */
  1172. #ifndef INCL_NOXLATE_DOS16
  1173. #define DosCloseSem     Dos16CloseSem
  1174. #define DosCreateSem    Dos16CreateSem
  1175. #define DosFSRamSemClear        Dos16FSRamSemClear
  1176. #define DosFSRamSemRequest      Dos16FSRamSemRequest
  1177. #define DosMuxSemWait   Dos16MuxSemWait
  1178. #define DosOpenSem      Dos16OpenSem
  1179. #endif /* INCL_NOXLATE_DOS16 */
  1180. /* XLATON */
  1181.  
  1182. APIRET  APIENTRY DosCreateSem(USHORT fExclusive,PHSYSSEM phsem,PSZ pszSemName);
  1183. APIRET  APIENTRY DosOpenSem(PHSEM phsem, PSZ pszSemName);
  1184. APIRET  APIENTRY DosCloseSem(HSEM hsem);
  1185.  
  1186. /* XLATOFF */
  1187. #pragma pack(2)
  1188. /* XLATON */
  1189.  
  1190. typedef struct _MUXSEM {        /* mxs */
  1191.     USHORT  zero;
  1192.     HSEM    hsem;
  1193. } MUXSEM;
  1194. typedef MUXSEM FAR *PMUXSEM;
  1195.  
  1196. typedef struct _MUXSEMLIST {    /* mxsl */
  1197.     USHORT  cmxs;
  1198.     MUXSEM  amxs[16];
  1199. } MUXSEMLIST;
  1200. typedef MUXSEMLIST FAR *PMUXSEMLIST;
  1201.  
  1202. /*
  1203.  * Since a MUXSEMLIST structure is actually a variable length
  1204.  * structure, the following macro may be used to define a MUXSEMLIST
  1205.  * structure having size elements, named "name".
  1206.  */
  1207. #define DEFINEMUXSEMLIST(name, size) \
  1208.     struct {                         \
  1209.         USHORT cmxs;                 \
  1210.         MUXSEM amxs[size];           \
  1211.     } name;
  1212.  
  1213. /* XLATOFF */
  1214. #pragma pack()
  1215. /* XLATON */
  1216.  
  1217. /*
  1218.  * This function actually takes a far pointer to a MUXSEMLIST structure
  1219.  * as its second parameter, but in order to allow its use with the
  1220.  * DEFINEMUXSEMLIST macro, it is declared here as PVOID.
  1221.  */
  1222. APIRET  APIENTRY DosMuxSemWait(PUSHORT pisemCleared,PVOID pmsxl,LONG lTimeOut);
  1223.  
  1224.  
  1225. /*** Fast safe ram semaphores */
  1226.  
  1227. typedef struct _DOSFSRSEM {     /* dosfsrs */
  1228.     USHORT  cb;
  1229.     PID     pid;
  1230.     TID     tid;
  1231.     USHORT  cUsage;
  1232.     USHORT  client;
  1233.     ULONG   sem;
  1234. } DOSFSRSEM;
  1235. typedef DOSFSRSEM FAR *PDOSFSRSEM;
  1236.  
  1237. APIRET  APIENTRY DosFSRamSemRequest(PDOSFSRSEM pdosfsrs, LONG lTimeOut);
  1238. APIRET  APIENTRY DosFSRamSemClear(PDOSFSRSEM pdosfsrs);
  1239.  
  1240. #endif /* INCL_DOSSEMAPHORES */
  1241.  
  1242. #if (defined(INCL_DOSDATETIME) || !defined(INCL_NOCOMMON))
  1243.  
  1244. /*** Time support */
  1245.  
  1246. typedef struct _DATETIME {      /* date */
  1247.     UCHAR   hours;
  1248.     UCHAR   minutes;
  1249.     UCHAR   seconds;
  1250.     UCHAR   hundredths;
  1251.     UCHAR   day;
  1252.     UCHAR   month;
  1253.     USHORT  year;
  1254.     SHORT   timezone;
  1255.     UCHAR   weekday;
  1256. } DATETIME;
  1257. typedef DATETIME FAR *PDATETIME;
  1258.  
  1259. /* XLATOFF */
  1260. #ifndef INCL_NOXLATE_DOS16
  1261. #define DosGetDateTime  Dos16GetDateTime
  1262. #define DosSetDateTime  Dos16SetDateTime
  1263. #endif /* INCL_NOXLATE_DOS16 */
  1264. /* XLATON */
  1265.  
  1266. APIRET  APIENTRY DosGetDateTime(PDATETIME pdatetime);
  1267. APIRET  APIENTRY DosSetDateTime(PDATETIME pdatetime);
  1268.  
  1269. #endif /* common INCL_DOSDATETIME */
  1270.  
  1271. #ifdef INCL_DOSDATETIME
  1272.  
  1273. typedef SHANDLE HTIMER;
  1274. typedef HTIMER FAR *PHTIMER;
  1275.  
  1276. /* XLATOFF */
  1277. #ifndef INCL_NOXLATE_DOS16
  1278. #define DosTimerAsync   Dos16TimerAsync
  1279. #define DosTimerStart   Dos16TimerStart
  1280. #define DosTimerStop    Dos16TimerStop
  1281. #endif /* INCL_NOXLATE_DOS16 */
  1282. /* XLATON */
  1283.  
  1284. APIRET  APIENTRY DosTimerAsync(ULONG ulTime, HSEM hsem, PHTIMER phtimer);
  1285. APIRET  APIENTRY DosTimerStart(ULONG ulTime, HSEM hsem, PHTIMER phtimer);
  1286. APIRET  APIENTRY DosTimerStop(HTIMER htimer);
  1287.  
  1288. #endif /* INCL_DOSDATETIME */
  1289.  
  1290.  
  1291. /*** Module manager */
  1292.  
  1293. #ifdef INCL_DOSMODULEMGR
  1294.  
  1295. /* XLATOFF */
  1296. #ifndef INCL_NOXLATE_DOS16
  1297. #define DosFreeModule   Dos16FreeModule
  1298. #define DosGetModHandle Dos16GetModHandle
  1299. #define DosGetModName   Dos16GetModName
  1300. #define DosGetProcAddr  Dos16GetProcAddr
  1301. #define DosLoadModule   Dos16LoadModule
  1302. #define DosQueryProcType      Dos16QueryProcType
  1303. #define DosQueryABIOSSupport  DosQueryABIOSSupport
  1304. #endif /* INCL_NOXLATE_DOS16 */
  1305. /* XLATON */
  1306.  
  1307. APIRET  APIENTRY DosLoadModule(PSZ pszFailName, USHORT cbFileName,
  1308.                               PSZ pszModName, PHMODULE phmod);
  1309. APIRET  APIENTRY DosFreeModule(HMODULE hmod);
  1310. APIRET  APIENTRY DosGetProcAddr(HMODULE hmod, PSZ pszProcName,
  1311.                                PFN FAR * ppfnProcAddr);
  1312. APIRET  APIENTRY DosGetModHandle(PSZ pszModName, PHMODULE phMod);
  1313. APIRET  APIENTRY DosGetModName(HMODULE hmod, USHORT cbBuf, PCHAR pchBuf);
  1314.  
  1315. #define PT_16BIT        0L
  1316. #define PT_32BIT        1L
  1317.  
  1318. APIRET  APIENTRY DosQueryProcType(HMODULE hmod, ULONG ordinal, PSZ pszName, PULONG pulprocType);
  1319.  
  1320. #define HW_CFG_MCA              0x0001
  1321. #define HW_CFG_EISA             0x0002
  1322. #define HW_CFG_ABIOS_SUPPORTED  0x0004
  1323. #define HW_CFG_ABIOS_PRESENT    0x0008
  1324.  
  1325. APIRET  APIENTRY DosQueryABIOSSupport(ULONG reserved);
  1326.  
  1327. #endif /* INCL_DOSMODULEMGR */
  1328.  
  1329. #if (defined(INCL_DOSRESOURCES) || !defined(INCL_NOCOMMON))
  1330.  
  1331. /*** Resource support */
  1332.  
  1333. /* Predefined resource types */
  1334.  
  1335. #define RT_POINTER                 1   /* mouse pointer shape                 */
  1336. #define RT_BITMAP                  2   /* bitmap                              */
  1337. #define RT_MENU                    3   /* menu template                       */
  1338. #define RT_DIALOG                  4   /* dialog template                     */
  1339. #define RT_STRING                  5   /* string tables                       */
  1340. #define RT_FONTDIR                 6   /* font directory                      */
  1341. #define RT_FONT                    7   /* font                                */
  1342. #define RT_ACCELTABLE              8   /* accelerator tables                  */
  1343. #define RT_RCDATA                  9   /* binary data                         */
  1344. #define RT_MESSAGE                 10  /* error mesage tables                 */
  1345. #define RT_DLGINCLUDE              11  /* dialog include file name            */
  1346. #define RT_VKEYTBL                 12  /* key to vkey tables                  */
  1347. #define RT_KEYTBL                  13  /* key to UGL tables                   */
  1348. #define RT_CHARTBL                 14
  1349. #define RT_DISPLAYINFO             15  /* screen display information          */
  1350.  
  1351. #define RT_FKASHORT                16  /* function key area short form        */
  1352. #define RT_FKALONG                 17  /* function key area long form         */
  1353.  
  1354. #define RT_HELPTABLE               18  /* Help table for Cary Help manager    */
  1355. #define RT_HELPSUBTABLE            19  /* Help subtable for Cary Help manager */
  1356.  
  1357. #define RT_FDDIR                   20  /* DBCS uniq/font driver directory     */
  1358. #define RT_FD                      21  /* DBCS uniq/font driver               */
  1359.  
  1360. #define RT_MAX                     22  /* 1st unused Resource Type            */
  1361.  
  1362.  
  1363. #endif /* common INCL_DOSRESOURCES */
  1364.  
  1365. #ifdef INCL_DOSRESOURCES
  1366.  
  1367. /* XLATOFF */
  1368. #ifndef INCL_NOXLATE_DOS16
  1369. #define DosFreeResource Dos16FreeResource
  1370. #define DosGetResource  Dos16GetResource
  1371. #define DosGetResource2 Dos16GetResource2
  1372. #define DosQueryResourceSize    Dos16QueryResourceSize
  1373. #endif /* INCL_NOXLATE_DOS16 */
  1374. /* XLATON */
  1375.  
  1376. APIRET  APIENTRY DosGetResource(HMODULE hmod, USHORT idType, USHORT idName,
  1377.                                PSEL psel);
  1378. APIRET  APIENTRY DosGetResource2(HMODULE hmod, USHORT idType, USHORT idName,
  1379.                                 PVOID FAR * ppData);
  1380. APIRET  APIENTRY DosFreeResource(PVOID pData);
  1381. APIRET  APIENTRY DosQueryResourceSize(HMODULE hmod, ULONG idt, ULONG idn,
  1382.                                              PULONG pulsize);
  1383.  
  1384. #endif /* INCL_DOSRESOURCES */
  1385.  
  1386.  
  1387. /*** NLS Support */
  1388.  
  1389. #ifdef INCL_DOSNLS
  1390.  
  1391. typedef struct _COUNTRYCODE {   /* ctryc */
  1392.     USHORT  country;
  1393.     USHORT  codepage;
  1394. } COUNTRYCODE;
  1395. typedef COUNTRYCODE FAR *PCOUNTRYCODE;
  1396.  
  1397. /* XLATOFF */
  1398. #pragma pack(1)
  1399. /* XLATON */
  1400.  
  1401. typedef struct _COUNTRYINFO {   /* ctryi */
  1402.     USHORT  country;
  1403.     USHORT  codepage;
  1404.     USHORT  fsDateFmt;
  1405.     CHAR    szCurrency[5];
  1406.     CHAR    szThousandsSeparator[2];
  1407.     CHAR    szDecimal[2];
  1408.     CHAR    szDateSeparator[2];
  1409.     CHAR    szTimeSeparator[2];
  1410.     UCHAR   fsCurrencyFmt;
  1411.     UCHAR   cDecimalPlace;
  1412.     UCHAR   fsTimeFmt;
  1413.     USHORT  abReserved1[2];
  1414.     CHAR    szDataSeparator[2];
  1415.     USHORT  abReserved2[5];
  1416. } COUNTRYINFO;
  1417. typedef COUNTRYINFO FAR *PCOUNTRYINFO;
  1418.  
  1419. /* XLATOFF */
  1420. #pragma pack()
  1421. /* XLATON */
  1422.  
  1423. /* XLATOFF */
  1424. #ifndef INCL_NOXLATE_DOS16
  1425. #define DosCaseMap      Dos16CaseMap
  1426. #define DosGetCollate   Dos16GetCollate
  1427. #define DosGetCp        Dos16GetCp
  1428. #define DosGetCtryInfo  Dos16GetCtryInfo
  1429. #define DosGetDBCSEv    Dos16GetDBCSEv
  1430. #define DosSetCp        Dos16SetCp
  1431. #define DosSetProcCp    Dos16SetProcCp
  1432. #endif /* INCL_NOXLATE_DOS16 */
  1433. /* XLATON */
  1434.  
  1435. APIRET  APIENTRY DosGetCtryInfo(USHORT cbBuf, PCOUNTRYCODE pctryc,
  1436.                                PCOUNTRYINFO pctryi, PUSHORT pcbCtryInfo);
  1437. APIRET  APIENTRY DosGetDBCSEv(USHORT cbBuf, PCOUNTRYCODE pctryc, PCHAR pchBuf);
  1438. APIRET  APIENTRY DosCaseMap(USHORT usLen, PCOUNTRYCODE pctryc, PCHAR pchStr);
  1439. APIRET  APIENTRY DosGetCollate(USHORT cbBuf, PCOUNTRYCODE pctryc, PCHAR pchBuf,
  1440.                               PUSHORT pcbTable);
  1441. APIRET  APIENTRY DosGetCp(USHORT cbBuf, PUSHORT pBuf, PUSHORT pcbCodePgLst);
  1442. APIRET  APIENTRY DosSetCp(USHORT usCodePage, USHORT usReserved);
  1443. APIRET  APIENTRY DosSetProcCp(USHORT usCodePage, USHORT usReserved);
  1444.  
  1445. #endif /* INCL_DOSNLS */
  1446.  
  1447.  
  1448. /*** Signal support */
  1449.  
  1450. #ifdef INCL_DOSSIGNALS
  1451.  
  1452. /* Signal Numbers for DosSetSigHandler  */
  1453.  
  1454. #define SIG_CTRLC                  1       /* Control C                  */
  1455. #define SIG_BROKENPIPE             2       /* Broken Pipe                */
  1456. #define SIG_KILLPROCESS            3       /* Program Termination        */
  1457. #define SIG_CTRLBREAK              4       /* Control Break              */
  1458. #define SIG_PFLG_A                 5       /* Process Flag A             */
  1459. #define SIG_PFLG_B                 6       /* Process Flag B             */
  1460. #define SIG_PFLG_C                 7       /* Process Flag C             */
  1461. #define SIG_CSIGNALS               8       /* number of signals plus one */
  1462.  
  1463. /* Flag Numbers for DosFlagProcess */
  1464.  
  1465. #define PFLG_A                     0       /* Process Flag A             */
  1466. #define PFLG_B                     1       /* Process Flag B             */
  1467. #define PFLG_C                     2       /* Process Flag C             */
  1468.  
  1469. /* Signal actions */
  1470.  
  1471. #define SIGA_KILL                  0
  1472. #define SIGA_IGNORE                1
  1473. #define SIGA_ACCEPT                2
  1474. #define SIGA_ERROR                 3
  1475. #define SIGA_ACKNOWLEDGE           4
  1476.  
  1477. /* DosHoldSignal constants */
  1478.  
  1479. #define HLDSIG_ENABLE              0
  1480. #define HLDSIG_DISABLE             1
  1481.  
  1482. /* DosFlagProcess codes */
  1483.  
  1484. #define FLGP_SUBTREE               0
  1485. #define FLGP_PID                   1
  1486.  
  1487. typedef VOID (PASCAL FAR *PFNSIGHANDLER)(USHORT, USHORT);
  1488.  
  1489. /* XLATOFF */
  1490. #ifndef INCL_NOXLATE_DOS16
  1491. #define DosFlagProcess  Dos16FlagProcess
  1492. #define DosHoldSignal   Dos16HoldSignal
  1493. #define DosSendSignal   Dos16SendSignal
  1494. #define DosSetSigHandler        Dos16SetSigHandler
  1495. #endif /* INCL_NOXLATE_DOS16 */
  1496. /* XLATON */
  1497.  
  1498. APIRET  APIENTRY DosSetSigHandler(PFNSIGHANDLER pfnSigHandler,
  1499.                                  PFNSIGHANDLER FAR * ppfnPrev, PUSHORT pfAction,
  1500.                                  USHORT fAction, USHORT usSigNum);
  1501. APIRET  APIENTRY DosFlagProcess(PID pid, USHORT fScope, USHORT usFlagNum,
  1502.                                USHORT usFlagArg);
  1503. APIRET  APIENTRY DosHoldSignal(USHORT fDisable);
  1504. APIRET  APIENTRY DosSendSignal(USHORT idProcess, USHORT usSigNumber);
  1505.  
  1506. #endif /* INCL_DOSSIGNALS */
  1507.  
  1508.  
  1509. /*** Monitor support */
  1510.  
  1511. #ifdef INCL_DOSMONITORS
  1512.  
  1513. typedef SHANDLE HMONITOR;       /* hmon */
  1514. typedef HMONITOR FAR *PHMONITOR;
  1515.  
  1516. /* XLATOFF */
  1517. #ifndef INCL_NOXLATE_DOS16
  1518. #define DosMonClose     Dos16MonClose
  1519. #define DosMonOpen      Dos16MonOpen
  1520. #define DosMonRead      Dos16MonRead
  1521. #define DosMonReg       Dos16MonReg
  1522. #define DosMonWrite     Dos16MonWrite
  1523. #endif /* INCL_NOXLATE_DOS16 */
  1524. /* XLATON */
  1525.  
  1526. APIRET  APIENTRY DosMonOpen(PSZ pszDevName, PHMONITOR phmon);
  1527. APIRET  APIENTRY DosMonClose(HMONITOR hmon);
  1528. APIRET  APIENTRY DosMonReg(HMONITOR hmon, PBYTE pbInBuf, PBYTE pbOutBuf,
  1529.                           USHORT fPosition, USHORT usIndex);
  1530. APIRET  APIENTRY DosMonRead(PBYTE pbInBuf, USHORT fWait, PBYTE pbDataBuf,
  1531.                            PUSHORT pcbData);
  1532. APIRET  APIENTRY DosMonWrite(PBYTE pbOutBuf, PBYTE pbDataBuf, USHORT cbData);
  1533.  
  1534. #endif /* INCL_DOSMONITORS */
  1535.  
  1536.  
  1537. /*** Pipe and queue support */
  1538.  
  1539. #ifdef INCL_DOSQUEUES
  1540. #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
  1541.  
  1542. typedef SHANDLE HQUEUE;         /* hq */
  1543. typedef HQUEUE FAR *PHQUEUE;
  1544.  
  1545. /* XLATOFF */
  1546. #ifndef INCL_NOXLATE_DOS16
  1547. #define DosCloseQueue   Dos16CloseQueue
  1548. #define DosCreateQueue  Dos16CreateQueue
  1549. #define DosMakePipe     Dos16MakePipe
  1550. #define DosOpenQueue    Dos16OpenQueue
  1551. #define DosPeekQueue    Dos16PeekQueue
  1552. #define DosPurgeQueue   Dos16PurgeQueue
  1553. #define DosQueryQueue   Dos16QueryQueue
  1554. #define DosReadQueue    Dos16ReadQueue
  1555. #define DosWriteQueue   Dos16WriteQueue
  1556. #endif /* INCL_NOXLATE_DOS16 */
  1557. /* XLATON */
  1558.  
  1559. APIRET  APIENTRY DosMakePipe(PHFILE phfRead, PHFILE phfWrite, USHORT cb);
  1560. APIRET  APIENTRY DosCloseQueue(HQUEUE hqueue);
  1561. APIRET  APIENTRY DosCreateQueue(PHQUEUE phqueue, USHORT fQueueOrder,
  1562.                                PSZ pszQueueName);
  1563. APIRET  APIENTRY DosOpenQueue(PUSHORT ppidOwner, PHQUEUE phqueue,
  1564.                              PSZ pszQueueName);
  1565. APIRET  APIENTRY DosPeekQueue(HQUEUE hqueue, PULONG pqresc, PUSHORT pcbElement,
  1566.                              PPVOID ppBuf, PUSHORT pElemCode, UCHAR fWait,
  1567.                              PBYTE pbElemPrty, ULONG hsem);
  1568. APIRET  APIENTRY DosPurgeQueue(HQUEUE hqueue);
  1569. APIRET  APIENTRY DosQueryQueue(HQUEUE hqueue, PUSHORT pcElem);
  1570. APIRET  APIENTRY DosReadQueue(HQUEUE hqueue, PULONG pqresc, PUSHORT pcbElem,
  1571.                              PPVOID ppBuf, USHORT usElem, UCHAR fWait,
  1572.                              PBYTE pbElemPrty, HSEM hsem);
  1573. APIRET  APIENTRY DosWriteQueue(HQUEUE hqueue, USHORT usRequest, USHORT cbBuf,
  1574.                               PVOID pBuf, UCHAR fPriority);
  1575.  
  1576. #else /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
  1577. #error PHFILE not defined - define INCL_DOSFILEMGR or undefine INCL_NOCOMMON
  1578. #endif /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
  1579. #endif /* INCL_DOSQUEUES */
  1580.  
  1581. #ifdef INCL_DOSMISC
  1582.  
  1583. /* definitions for DOSSEARCHPATH control word */
  1584. #define DSP_IMPLIEDCUR             1 /* current dir will be searched first */
  1585. #define DSP_PATHREF                2 /* from envirnoment variable          */
  1586. #define DSP_IGNORENETERR           4 /* ignore net errs & continue search  */
  1587.  
  1588. /* definition for DOSQSYSINFO */
  1589. #define Q_MAX_PATH_LENGTH         (0) /* index for query max path length   */
  1590.  
  1591. /* definitions for DosError - combine with | */
  1592. #define FERR_DISABLEHARDERR     0x00000000L     /* disable hard error popups */
  1593. #define FERR_ENABLEHARDERR      0x00000001L     /* enable hard error popups */
  1594. #define FERR_ENABLEEXCEPTION    0x00000000L     /* enable exception popups */
  1595. #define FERR_DISABLEEXCEPTION   0x00000002L     /* disable exception popups */
  1596.  
  1597. /* XLATOFF */
  1598. #ifndef INCL_NOXLATE_DOS16
  1599. #define DosErrClass     Dos16ErrClass
  1600. #define DosError        Dos16Error
  1601. #define DosGetEnv       Dos16GetEnv
  1602. #define DosGetMachineMode       Dos16GetMachineMode
  1603. #define DosGetMessage   Dos16GetMessage
  1604. #define DosGetVersion   Dos16GetVersion
  1605. #define DosInsMessage   Dos16InsMessage
  1606. #define DosPutMessage   Dos16PutMessage
  1607. #define DosQSysInfo     Dos16QSysInfo
  1608. #define DosQueryMessageCP       Dos16QueryMessageCP
  1609. #define DosScanEnv      Dos16ScanEnv
  1610. #define DosSearchPath   Dos16SearchPath
  1611. #define DosSetVec       Dos16SetVec
  1612. #define DosSysTrace     Dos16SysTrace
  1613. #endif /* INCL_NOXLATE_DOS16 */
  1614. /* XLATON */
  1615.  
  1616. APIRET  APIENTRY DosError(USHORT fEnable);
  1617. APIRET  APIENTRY DosSetVec(USHORT usVecNum, PFN pfnFun, PFN FAR *ppfnPrev);
  1618. APIRET  APIENTRY DosGetMessage(PCHAR FAR * ppchVTable, USHORT usVCount,
  1619.                               PCHAR pchBuf, USHORT cbBuf, USHORT usMsgNum,
  1620.                               PSZ pszFileName, PUSHORT pcbMsg);
  1621. APIRET  APIENTRY DosErrClass(USHORT usErrCode, PUSHORT pusClass,
  1622.                             PUSHORT pfsAction, PUSHORT pusLocus);
  1623. APIRET  APIENTRY DosInsMessage(PCHAR FAR * ppchVTable, USHORT usVCount,
  1624.                               PSZ pszMsg, USHORT cbMsg, PCHAR pchBuf,
  1625.                               USHORT cbBuf, PUSHORT pcbMsg);
  1626. APIRET  APIENTRY DosPutMessage(USHORT hf, USHORT cbMsg, PCHAR pchMsg);
  1627. APIRET  APIENTRY DosQueryMessageCP(PCHAR pb, USHORT cb, PSZ pszFilename,
  1628.                               PUSHORT cbBuf);
  1629. APIRET  APIENTRY DosSysTrace(USHORT, USHORT, USHORT, PCHAR);
  1630. APIRET  APIENTRY DosQSysInfo(USHORT index, PVOID pBuf, USHORT cbBuf);
  1631. APIRET  APIENTRY DosGetEnv(PSEL pselEnv, PUSHORT pOffsetCmd);
  1632. APIRET  APIENTRY DosScanEnv(PSZ pszVarName, PSZ FAR * ppszResult);
  1633. APIRET  APIENTRY DosSearchPath(USHORT fsSearch, PSZ pszPath, PSZ pszFName,
  1634.                               PBYTE pBuf, USHORT cbBuf);
  1635. APIRET  APIENTRY DosGetVersion(PUSHORT pVer);
  1636. APIRET  APIENTRY DosGetMachineMode(PBYTE pMachMode);
  1637.  
  1638. #endif /* INCL_DOSMISC */
  1639.  
  1640.  
  1641. /*** Session manager support */
  1642.  
  1643. #ifdef INCL_DOSSESMGR
  1644.  
  1645. typedef struct _STARTDATA {     /* stdata */
  1646.     USHORT  Length;
  1647.     USHORT  Related;
  1648.     USHORT  FgBg;
  1649.     USHORT  TraceOpt;
  1650.     PSZ     PgmTitle;
  1651.     PSZ     PgmName;
  1652.     PBYTE   PgmInputs;
  1653.     PBYTE   TermQ;
  1654.     PBYTE   Environment;
  1655.     USHORT  InheritOpt;
  1656.     USHORT  SessionType;
  1657.     PSZ     IconFile;
  1658.     ULONG   PgmHandle;
  1659.     USHORT  PgmControl;
  1660.     USHORT  InitXPos;
  1661.     USHORT  InitYPos;
  1662.     USHORT  InitXSize;
  1663.     USHORT  InitYSize;
  1664.     USHORT  Reserved;
  1665.     PSZ     ObjectBuffer;
  1666.     ULONG   ObjectBuffLen;
  1667. } STARTDATA;
  1668. typedef STARTDATA FAR *PSTARTDATA;
  1669.  
  1670. #define SSF_RELATED_INDEPENDENT 0
  1671. #define SSF_RELATED_CHILD       1
  1672.  
  1673. #define SSF_FGBG_FORE           0
  1674. #define SSF_FGBG_BACK           1
  1675.  
  1676. #define SSF_TRACEOPT_NONE       0
  1677. #define SSF_TRACEOPT_TRACE      1
  1678. #define SSF_TRACEOPT_TRACEALL   2
  1679.  
  1680. #define SSF_INHERTOPT_SHELL     0
  1681. #define SSF_INHERTOPT_PARENT    1
  1682.  
  1683. /* note that these types are identical to those in pmshl.h for PROG_* */
  1684. #define SSF_TYPE_DEFAULT        0
  1685. #define SSF_TYPE_FULLSCREEN     1
  1686. #define SSF_TYPE_WINDOWABLEVIO  2
  1687. #define SSF_TYPE_PM             3
  1688. #define SSF_TYPE_VDM            4
  1689. #define SSF_TYPE_GROUP          5
  1690. #define SSF_TYPE_DLL            6
  1691. #define SSF_TYPE_WINDOWEDVDM    7
  1692. #define SSF_TYPE_PDD            8
  1693. #define SSF_TYPE_VDD            9
  1694.  
  1695. /* note that these flags are identical to those in pmshl.h for SHE_* */
  1696. #define SSF_CONTROL_VISIBLE     0x0000
  1697. #define SSF_CONTROL_INVISIBLE   0x0001
  1698. #define SSF_CONTROL_MAXIMIZE    0x0002
  1699. #define SSF_CONTROL_MINIMIZE    0x0004
  1700. #define SSF_CONTROL_NOAUTOCLOSE 0x0008
  1701. #define SSF_CONTROL_SETPOS      0x8000
  1702.  
  1703. typedef struct _STATUSDATA {    /* stsdata */
  1704.     USHORT  Length;
  1705.     USHORT  SelectInd;
  1706.     USHORT  BondInd;
  1707. } STATUSDATA;
  1708. typedef STATUSDATA FAR *PSTATUSDATA;
  1709.  
  1710. /* SelectInd and BondInd paramater values for DosSetSession */
  1711. #define SET_SESSION_UNCHANGED      0
  1712. #define SET_SESSION_SELECTABLE     1
  1713. #define SET_SESSION_NON_SELECTABLE 2
  1714. #define SET_SESSION_BOND           1
  1715. #define SET_SESSION_NO_BOND        2
  1716.  
  1717. /* TargetOption (fScope) parameter values for DosStopSession */
  1718. #define STOP_SESSION_SPECIFIED     0
  1719. #define STOP_SESSION_ALL           1
  1720.  
  1721. typedef struct _REGISTERDATA {  /* regdata */
  1722.     USHORT      Length;
  1723.     USHORT      NotifType;
  1724.     PSZ         DDName;
  1725. } REGISTERDATA;
  1726. typedef REGISTERDATA FAR *PREGISTERDATA;
  1727.  
  1728. /* XLATOFF */
  1729. #ifndef INCL_NOXLATE_DOS16
  1730. #define DosQAppType     Dos16QAppType
  1731. #define DosSMRegisterDD Dos16SMRegisterDD
  1732. #define DosSelectSession        Dos16SelectSession
  1733. #define DosSetSession   Dos16SetSession
  1734. #define DosStartSession Dos16StartSession
  1735. #define DosStopSession  Dos16StopSession
  1736. #endif /* INCL_NOXLATE_DOS16 */
  1737. /* XLATON */
  1738.  
  1739. APIRET  APIENTRY        DosSMRegisterDD(PREGISTERDATA);
  1740. APIRET  APIENTRY DosStartSession(PSTARTDATA pstdata, PUSHORT pidSession,
  1741.                                 PUSHORT ppid);
  1742. APIRET  APIENTRY DosSetSession(USHORT idSession, PSTATUSDATA pstsdata);
  1743. APIRET  APIENTRY DosSelectSession(USHORT idSession, ULONG ulReserved);
  1744. APIRET  APIENTRY DosStopSession(USHORT fScope, USHORT idSession,
  1745.                                ULONG ulReserved);
  1746. APIRET  APIENTRY DosQAppType(PSZ pszPrgName, PUSHORT pusType);
  1747.  
  1748. #endif /* INCL_DOSSESMGR */
  1749.  
  1750. #if (defined(INCL_DOSSESMGR) || defined(INCL_DOSFILEMGR))
  1751.  
  1752. /* AppType returned in by DosQueryAppType in pFlags as follows          */
  1753. #define FAPPTYP_NOTSPEC         0x0000
  1754. #define FAPPTYP_NOTWINDOWCOMPAT 0x0001
  1755. #define FAPPTYP_WINDOWCOMPAT    0x0002
  1756. #define FAPPTYP_WINDOWAPI       0x0003
  1757. #define FAPPTYP_BOUND           0x0008
  1758. #define FAPPTYP_DLL             0x0010
  1759. #define FAPPTYP_DOS             0x0020
  1760. #define FAPPTYP_PHYSDRV         0x0040  /* physical device driver       */
  1761. #define FAPPTYP_VIRTDRV         0x0080  /* virtual device driver        */
  1762. #define FAPPTYP_PROTDLL         0x0100  /* 'protected memory' dll       */
  1763. #define FAPPTYP_WINDOWSREAL     0x0200  /*         real mode app        */
  1764. #define FAPPTYP_WINDOWSPROT     0x0400  /*         protect mode app     */
  1765. #define FAPPTYP_WINDOWSPROT31   0x1000  /*         3.1 protect mode app */
  1766. #define FAPPTYP_32BIT           0x4000
  1767. #define FAPPTYP_EXETYPE         FAPPTYP_WINDOWAPI
  1768.  
  1769. #define FAPPTYP_RESERVED        ~(FAPPTYP_WINDOWAPI | FAPPTYP_BOUND | FAPPTYP_DLL | FAPPTYP_DOS | FAPPTYP_PHYSDRV | FAPPTYP_VIRTDRV | FAPPTYP_PROTDLL | FAPPTYP_32BIT)
  1770.  
  1771. #ifdef INCL_DOSFILEMGR
  1772.  
  1773. #define EAT_APPTYP_PMAPI        0x00            /* Uses PM API */
  1774. #define EAT_APPTYP_DOS          0x01            /* DOS APP */
  1775. #define EAT_APPTYP_PMW          0x02            /* Window compatible */
  1776. #define EAT_APPTYP_NOPMW        0x03            /* Not Window compatible */
  1777. #define EAT_APPTYP_EXETYPE      0x03            /* EXE type mask */
  1778. #define EAT_APPTYP_RESERVED     ~(EAT_APPTYP_EXETYPE)
  1779.  
  1780. #endif /* INCL_DOSFILEMGR */
  1781.  
  1782. #endif /* INCL_DOSSESMGR || INCL_DOSFILEMGR */
  1783.  
  1784. /*** Device support */
  1785.  
  1786. #ifdef INCL_DOSDEVICES
  1787.  
  1788. /* XLATOFF */
  1789. #ifndef INCL_NOXLATE_DOS16
  1790. #define DosCLIAccess    Dos16CLIAccess
  1791. #define DosDevConfig    Dos16DevConfig
  1792. #define DosDevIOCtl     Dos16DevIOCtl
  1793. #define DosDevIOCtl2    Dos16DevIOCtl2
  1794. #define DosPhysicalDisk Dos16PhysicalDisk
  1795. #define DosPortAccess   Dos16PortAccess
  1796. #define DosR2StackRealloc       Dos16R2StackRealloc
  1797. #define DosSystemService        Dos16SystemService
  1798. #define DosCallback     Dos16Callback
  1799. #endif /* INCL_NOXLATE_DOS16 */
  1800. /* XLATON */
  1801.  
  1802.  
  1803. APIRET  APIENTRY DosDevConfig(PVOID pDevInfo, USHORT usItem, USHORT usReserved);
  1804. #define DEVINFO_PRINTER         0       /* Number of printers attached */
  1805. #define DEVINFO_RS232           1       /* Number of RS232 ports */
  1806. #define DEVINFO_FLOPPY          2       /* Number of diskette drives */
  1807. #define DEVINFO_COPROCESSOR     3       /* Presence of math coprocessor */
  1808. #define DEVINFO_SUBMODEL        4       /* PC Submodel Type */
  1809. #define DEVINFO_MODEL           5       /* PC Model Type */
  1810. #define DEVINFO_ADAPTER         6       /* Primary display adapter type */
  1811. #define DEVINFO_COPROCESSORTYPE 7       /* Type of coprocessor functionality */
  1812.  
  1813. APIRET  APIENTRY DosDevIOCtl(PVOID pData, PVOID pParms, USHORT usFun,
  1814.                             USHORT usCategory, HFILE hDev);
  1815. APIRET  APIENTRY DosDevIOCtl2(PVOID pData, USHORT cbData, PVOID pParm,
  1816.                              USHORT cbParm, USHORT usFun, USHORT usCategory,
  1817.                              HFILE hDev);
  1818. APIRET  APIENTRY DosSystemService(USHORT usCategory, PVOID pRequest,
  1819.                                  PVOID pResponse);
  1820.  
  1821. APIRET  APIENTRY DosCLIAccess(VOID);
  1822. APIRET  APIENTRY DosPortAccess(USHORT usReserved, USHORT fRelease,
  1823.                               USHORT usFirstPort, USHORT usLastPort);
  1824. APIRET  APIENTRY DosPhysicalDisk(USHORT usFun, PVOID pOut, USHORT cbOut,
  1825.                                 PVOID pParm, USHORT cbParm);
  1826. #define INFO_COUNT_PARTITIONABLE_DISKS  1       /* # of partitionable disks */
  1827. #define INFO_GETIOCTLHANDLE             2       /* Obtain handle            */
  1828. #define INFO_FREEIOCTLHANDLE            3       /* Release handle           */
  1829.  
  1830. APIRET  APIENTRY DosR2StackRealloc(USHORT cbStack);
  1831. VOID    APIENTRY DosCallback(PFN pfn);
  1832.  
  1833. #endif /* INCL_DOSDEVICES */
  1834.  
  1835.  
  1836. /*** DosNamedPipes API Support */
  1837.  
  1838. #ifdef INCL_DOSNMPIPES
  1839.  
  1840. typedef SHANDLE HPIPE;          /* hp */
  1841. typedef HPIPE FAR *PHPIPE;
  1842.  
  1843. typedef struct _AVAILDATA   {       /* AVAILDATA  */
  1844.     USHORT      cbpipe;             /* bytes left in the pipe             */
  1845.     USHORT      cbmessage;          /* bytes left in current message      */
  1846. } AVAILDATA;
  1847. typedef AVAILDATA FAR *PAVAILDATA;
  1848.  
  1849. typedef struct _PIPEINFO {              /* nmpinf */
  1850.     USHORT cbOut;                       /* length of outgoing I/O buffer */
  1851.     USHORT cbIn;                        /* length of incoming I/O buffer */
  1852.     BYTE   cbMaxInst;                   /* maximum number of instances   */
  1853.     BYTE   cbCurInst;                   /* current number of instances   */
  1854.     BYTE   cbName;                      /* length of pipe name           */
  1855.     CHAR   szName[1];                   /* start of name                 */
  1856. } PIPEINFO;
  1857. typedef PIPEINFO FAR *PPIPEINFO;
  1858.  
  1859. typedef struct _PIPESEMSTATE {  /* nmpsmst */
  1860.     BYTE   fStatus;             /* type of record, 0 = EOI, 1 = read ok, */
  1861.                                 /* 2 = write ok, 3 = pipe closed         */
  1862.     BYTE   fFlag;               /* additional info, 01 = waiting thread  */
  1863.     USHORT usKey;               /* user's key value                      */
  1864.     USHORT usAvail;             /* available data/space if status = 1/2  */
  1865. } PIPESEMSTATE;
  1866. typedef PIPESEMSTATE FAR *PPIPESEMSTATE;
  1867.  
  1868. #define NP_INDEFINITE_WAIT      -1
  1869. #define NP_DEFAULT_WAIT         0L
  1870.  
  1871. /* DosPeekNmPipe() pipe states */
  1872.  
  1873. #define NP_STATE_DISCONNECTED   0x0001
  1874. #define NP_STATE_LISTENING      0x0002
  1875. #define NP_STATE_CONNECTED      0x0003
  1876. #define NP_STATE_CLOSING        0x0004
  1877.  
  1878. /* DosCreateNPipe open modes */
  1879.  
  1880. #define NP_ACCESS_INBOUND       0x0000
  1881. #define NP_ACCESS_OUTBOUND      0x0001
  1882. #define NP_ACCESS_DUPLEX        0x0002
  1883. #define NP_INHERIT              0x0000
  1884. #define NP_NOINHERIT            0x0080
  1885. #define NP_WRITEBEHIND          0x0000
  1886. #define NP_NOWRITEBEHIND        0x4000
  1887.  
  1888. /* DosCreateNPipe and DosQueryNPHState state */
  1889.  
  1890. #define NP_READMODE_BYTE        0x0000
  1891. #define NP_READMODE_MESSAGE     0x0100
  1892. #define NP_TYPE_BYTE            0x0000
  1893. #define NP_TYPE_MESSAGE         0x0400
  1894. #define NP_END_CLIENT           0x0000
  1895. #define NP_END_SERVER           0x4000
  1896. #define NP_WAIT                 0x0000
  1897. #define NP_NOWAIT               0x8000
  1898. #define NP_UNLIMITED_INSTANCES  0x00FF
  1899.  
  1900.  
  1901. /* XLATOFF */
  1902. #ifndef INCL_NOXLATE_DOS16
  1903. #define DosCallNmPipe   Dos16CallNmPipe
  1904. #define DosConnectNmPipe        Dos16ConnectNmPipe
  1905. #define DosDisConnectNmPipe     Dos16DisConnectNmPipe
  1906. #define DosMakeNmPipe   Dos16MakeNmPipe
  1907. #define DosPeekNmPipe   Dos16PeekNmPipe
  1908. #define DosQNmPHandState        Dos16QNmPHandState
  1909. #define DosQNmPipeInfo  Dos16QNmPipeInfo
  1910. #define DosQNmPipeSemState      Dos16QNmPipeSemState
  1911. #define DosSetNmPHandState      Dos16SetNmPHandState
  1912. #define DosSetNmPipeSem Dos16SetNmPipeSem
  1913. #define DosTransactNmPipe       Dos16TransactNmPipe
  1914. #define DosWaitNmPipe   Dos16WaitNmPipe
  1915. #endif /* INCL_NOXLATE_DOS16 */
  1916. /* XLATON */
  1917.  
  1918. APIRET  APIENTRY DosCallNmPipe(PSZ pszName, PVOID pInBuf, USHORT cbInBuf,
  1919.                               PVOID pbOutBuf, USHORT cbOutBuf, PUSHORT pcbRead,
  1920.                               ULONG ulTimeOut);
  1921. APIRET  APIENTRY DosConnectNmPipe(HPIPE hp);
  1922. APIRET  APIENTRY DosDisConnectNmPipe(HPIPE hp);
  1923. APIRET  APIENTRY DosMakeNmPipe(PSZ pszName, PHPIPE php, USHORT fsOpenMode,
  1924.                               USHORT fsPipeMode, USHORT cbOutBuf,
  1925.                               USHORT cbInBuf, ULONG ulTimeOut);
  1926. APIRET  APIENTRY DosPeekNmPipe(HPIPE hp, PVOID pBuf, USHORT cbBuf,
  1927.                               PUSHORT pcbRead, PAVAILDATA pcbAvail,
  1928.                               PUSHORT pfsState);
  1929. APIRET  APIENTRY DosQNmPHandState(HPIPE hp, PUSHORT pfsState);
  1930. APIRET  APIENTRY DosQNmPipeInfo(HPIPE hp, USHORT usInfoLevel, PVOID pBuf,
  1931.                                USHORT cb);
  1932. APIRET  APIENTRY DosQNmPipeSemState(HSEM hsem, PPIPESEMSTATE pnpss, USHORT cb);
  1933. APIRET  APIENTRY DosSetNmPHandState(HPIPE hp, USHORT fsState);
  1934. APIRET  APIENTRY DosSetNmPipeSem(HPIPE hp, HSEM hsem, USHORT usKeyVal);
  1935. APIRET  APIENTRY DosTransactNmPipe(HPIPE hp, PVOID bOutBuf, USHORT cbOut,
  1936.                                   PVOID pInBuf, USHORT cbIn, PUSHORT pcbRead);
  1937. APIRET  APIENTRY DosWaitNmPipe(PSZ pszName, ULONG ulTimeOut);
  1938.  
  1939. /* values in npss_status */
  1940. #define NPSS_EOI                   0     /* End Of Information    */
  1941. #define NPSS_RDATA                 1     /* read data available   */
  1942. #define NPSS_WSPACE                2     /* write space available */
  1943. #define NPSS_CLOSE                 3     /* pipe in CLOSING state */
  1944.  
  1945. /* values in npss_flag */
  1946. #define NPSS_WAIT                  0x01  /* waiting thread on end of pipe */
  1947.  
  1948. /* defined bits in pipe mode */
  1949. #define NP_NBLK                    0x8000 /* non-blocking read/write */
  1950. #define NP_SERVER                  0x4000 /* set if server end       */
  1951. #define NP_WMESG                   0x0400 /* write messages          */
  1952. #define NP_RMESG                   0x0100 /* read as messages        */
  1953. #define NP_ICOUNT                  0x00FF /* instance count field    */
  1954.  
  1955.  
  1956. /*      Named pipes may be in one of several states depending on the actions
  1957.  *      that have been taken on it by the server end and client end.  The
  1958.  *      following state/action table summarizes the valid state transitions:
  1959.  *
  1960.  *      Current state           Action                  Next state
  1961.  *
  1962.  *       <none>             server DosMakeNmPipe        DISCONNECTED
  1963.  *       DISCONNECTED       server connect              LISTENING
  1964.  *       LISTENING          client open                 CONNECTED
  1965.  *       CONNECTED          server disconn              DISCONNECTED
  1966.  *       CONNECTED          client close                CLOSING
  1967.  *       CLOSING            server disconn              DISCONNECTED
  1968.  *       CONNECTED          server close                CLOSING
  1969.  *       <any other>        server close                <pipe deallocated>
  1970.  *
  1971.  *      If a server disconnects his end of the pipe, the client end will enter a
  1972.  *      special state in which any future operations (except close) on the file
  1973.  *      descriptor associated with the pipe will return an error.
  1974.  */
  1975.  
  1976. /*
  1977.  *      Values for named pipe state
  1978.  */
  1979.  
  1980. #define NP_DISCONNECTED            1    /* after pipe creation or Disconnect */
  1981. #define NP_LISTENING               2    /* after DosNmPipeConnect            */
  1982. #define NP_CONNECTED               3    /* after Client open                 */
  1983. #define NP_CLOSING                 4    /* after Client or Server close      */
  1984.  
  1985.  
  1986. #endif /* INCL_DOSNMPIPES */
  1987.  
  1988.  
  1989. /*** DosProfile API support */
  1990.  
  1991. #ifdef INCL_DOSPROFILE
  1992.  
  1993. /* XLATOFF */
  1994. #ifndef INCL_NOXLATE_DOS16
  1995. #define DosTmrQueryFreq         Dos16TmrQueryFreq
  1996. #define DosTmrQueryTime         Dos16TmrQueryTime
  1997. #define DosRegisterPerfCtrs     Dos16RegisterPerfCtrs
  1998. #endif /* INCL_NOXLATE_DOS16 */
  1999. /* XLATON */
  2000.  
  2001. /*** Perfview API support */
  2002.  
  2003. APIRET  APIENTRY        DosTmrQueryFreq(PULONG pulTmrFreq);
  2004. APIRET  APIENTRY        DosTmrQueryTime(PQWORD pqwTmrTime);
  2005. APIRET  APIENTRY        DosRegisterPerfCtrs(PBYTE pbDataBlk, PBYTE pbTextBlk, ULONG flFlags);
  2006.  
  2007. /* DosProfile ordinal number */
  2008.  
  2009. #define PROF_ORDINAL               133
  2010.  
  2011. /* DosProfile usType */
  2012.  
  2013. #define PROF_SYSTEM                0
  2014. #define PROF_USER                  1
  2015. #define PROF_USEDD                 2
  2016. #define PROF_KERNEL                4
  2017. #define PROF_VERBOSE               8
  2018. #define PROF_ENABLE                16
  2019.  
  2020. /* DosProfile usFunc */
  2021.  
  2022. #define PROF_ALLOC                 0
  2023. #define PROF_CLEAR                 1
  2024. #define PROF_ON                    2
  2025. #define PROF_OFF                   3
  2026. #define PROF_DUMP                  4
  2027. #define PROF_FREE                  5
  2028.  
  2029. /* DosProfile tic count granularity (DWORD) */
  2030.  
  2031. #define PROF_SHIFT                 2
  2032.  
  2033. /* DosProfile module name string length     */
  2034.  
  2035. #define PROF_MOD_NAME_SIZE         10
  2036.  
  2037. /* DosProfile error code for end of data    */
  2038.  
  2039. #define PROF_END_OF_DATA           13
  2040.  
  2041. #endif /* INCL_DOSPROFILE */
  2042.  
  2043.  
  2044. /*** Virtual DOS Machine API support */
  2045.  
  2046. #ifdef INCL_DOSMVDM
  2047.  
  2048. /* XLATOFF */
  2049. #ifndef INCL_NOXLATE_DOS16
  2050. #define DosOpenVDD              Dos16OpenVDD
  2051. #define DosRequestVDD           Dos16RequestVDD
  2052. #define DosCloseVDD             Dos16CloseVDD
  2053. #define DosQueryDOSProperty     Dos16QueryDOSProperty
  2054. #define DosSetDOSProperty       Dos16SetDOSProperty
  2055. #endif /* INCL_NOXLATE_DOS16 */
  2056. /* XLATON */
  2057.  
  2058. typedef LHANDLE   HVDD;     /* hvdd */
  2059. typedef HVDD FAR *PHVDD;    /* phvdd */
  2060.  
  2061. APIRET  APIENTRY DosOpenVDD(PSZ pszvdd, PHVDD phvdd);
  2062.  
  2063. APIRET  APIENTRY DosRequestVDD(HVDD hvdd, SGID sgid, USHORT cmd,
  2064.                                ULONG cbInput, PVOID pInput,
  2065.                                ULONG cbOutput, PVOID pOutput);
  2066.  
  2067. APIRET  APIENTRY DosCloseVDD(HVDD hVDD);
  2068.  
  2069. APIRET  APIENTRY DosQueryDOSProperty(SGID sgid, PSZ pszName,
  2070.                                      USHORT cb, PSZ pch);
  2071.  
  2072. APIRET  APIENTRY DosSetDOSProperty(SGID sgid, PSZ pszName,
  2073.                                    USHORT cb, PSZ pch);
  2074.  
  2075. #endif /* INCL_DOSMVDM */
  2076.  
  2077. /* Bidirectional Calls Include File */
  2078.  
  2079. #ifdef INCL_BDCALLS
  2080.  
  2081. #include "bdcalls.h"
  2082.  
  2083. #endif /*INCL_BDCALLS */
  2084.  
  2085.