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

  1. /*  SCCSID = src/public/include/os2c/32bit/bsedos.h, wp.386pc, c.pc, 990308.1 @(#)39    1.31  */
  2. /****************************** Module Header ******************************
  3. *
  4. *   Licensed Material -- Property of IBM
  5. *
  6. *   (c) Copyright IBM Corp. 1981,  1998   All Rights Reserved
  7. *
  8. *   Module Name: BSEDOS.H
  9. *
  10. *   OS/2 Base include file.
  11. *
  12. * ===========================================================================
  13. *
  14. * The folowing symbols are used in this file for conditional sections.
  15. *
  16. * If INCL_BSE is defined, all subcomponents are included.
  17. *
  18. * Subcomponents marked with "+" are partially included by default:
  19. *
  20. *   #define:                To include:
  21. *
  22. * + INCL_DOSPROCESS         Process and thread support
  23. * + INCL_DOSFILEMGR         File Management
  24. * + INCL_DOSMEMMGR          Memory Management
  25. * + INCL_DOSSEMAPHORES      Semaphore support
  26. * + INCL_DOSDATETIME        Date/Time and Timer support
  27. *   INCL_DOSMODULEMGR       Module manager
  28. * + INCL_DOSRESOURCES       Resource support
  29. *   INCL_DOSNLS             National Language Support
  30. *   INCL_DOSEXCEPTIONS      Exception Management Support
  31. *   INCL_DOSMISC            Miscellaneous
  32. *   INCL_DOSMONITORS        Monitors
  33. *   INCL_DOSQUEUES          Queues
  34. *   INCL_DOSSESMGR          Session Manager Support
  35. *   INCL_DOSDEVICES         Device specific, ring 2 support
  36. *   INCL_DOSNMPIPES         Named Pipes Support
  37. *   INCL_DOSPROFILE         DosProfile API
  38. *   INCL_DOSMVDM            MVDM support
  39. *
  40. * ===========================================================================
  41. *
  42. * Comments at the end of each typedef line give the name tags used in
  43. * the assembler include version of this file.
  44. *
  45. * The assembler include version of this file excludes lines between NOINC
  46. * and INC comments.
  47. *
  48. \***************************************************************************/
  49.  
  50. /* NOINC */
  51. #if __IBMC__ || __IBMCPP__
  52.    #pragma info( none )
  53.       #ifndef __CHKHDR__
  54.          #pragma info( none )
  55.       #endif
  56.    #pragma info( restore )
  57. #endif
  58. #ifdef __cplusplus
  59.       extern "C" {
  60. #endif
  61. /* INC */
  62.  
  63. #ifndef __BSEDOS__
  64.  
  65. /* NOINC */
  66. #define __BSEDOS__
  67. /* INC */
  68.  
  69. #define INCL_DOSINCLUDED
  70.  
  71. #ifdef INCL_DOS
  72.    #define INCL_DOSPROCESS
  73.    #define INCL_DOSFILEMGR
  74.    #define INCL_DOSMEMMGR
  75.    #define INCL_DOSSEMAPHORES
  76.    #define INCL_DOSDATETIME
  77.    #define INCL_DOSMODULEMGR
  78.    #define INCL_DOSRESOURCES
  79.    #define INCL_DOSNLS
  80.    #define INCL_DOSEXCEPTIONS
  81.    #define INCL_DOSMISC
  82.    #define INCL_DOSMONITORS
  83.    #define INCL_DOSQUEUES
  84.    #define INCL_DOSSESMGR
  85.    #define INCL_DOSDEVICES
  86.    #define INCL_DOSNMPIPES
  87.    #define INCL_DOSPROFILE
  88.    #define INCL_DOSMVDM
  89. #endif /* INCL_DOS */
  90.  
  91. #ifdef INCL_ERRORS
  92.    #define INCL_DOSERRORS
  93. #endif /* INCL_ERRORS */
  94.  
  95. #if (defined(INCL_DOSPROCESS) || !defined(INCL_NOCOMMON))
  96.    /*** General services */
  97.    APIRET APIENTRY DosBeep(ULONG freq,
  98.                            ULONG dur);
  99.  
  100.    /*** Process and Thread support */
  101.    VOID APIENTRY DosExit(ULONG action,
  102.                          ULONG result);
  103.  
  104.    /* DosExit codes */
  105.    #define EXIT_THREAD        0
  106.    #define EXIT_PROCESS       1
  107. #endif /* common INCL_DOSPROCESS stuff */
  108.  
  109. #ifdef INCL_DOSPROCESS
  110. /* NOINC */
  111.    #define DosCwait           DosWaitChild
  112.    #define DosSetPrty         DosSetPriority
  113. /* INC */
  114.  
  115.    #include <bsetib.h>
  116.  
  117.    typedef  VOID APIENTRY FNTHREAD(ULONG);
  118.    typedef FNTHREAD *PFNTHREAD;
  119.  
  120.    APIRET APIENTRY DosCreateThread(PTID ptid,
  121.                                    PFNTHREAD pfn,
  122.                                    ULONG param,
  123.                                    ULONG flag,
  124.                                    ULONG cbStack);
  125.  
  126.    typedef struct _THREADCREATE {                                                                                       /* F150593 */
  127.       ULONG          cbSize;
  128.       PTID           pTid;
  129.       PFNTHREAD      pfnStart;
  130.       ULONG          lParam;
  131.       ULONG          lFlag;
  132.       PBYTE          pStack;
  133.       ULONG          cbStack;
  134.    } THREADCREATE;
  135.    typedef THREADCREATE    *PTHREADCREATE;
  136.  
  137.    APIRET  APIENTRY        DosCreateThread2(PTHREADCREATE ptc); /* F150593 */
  138.  
  139.    APIRET APIENTRY DosResumeThread(TID tid);
  140.  
  141.    APIRET APIENTRY DosSuspendThread(TID tid);
  142.  
  143.    APIRET APIENTRY DosGetInfoBlocks(PTIB *pptib,
  144.                                     PPIB *pppib);
  145.  
  146.    APIRET APIENTRY DosKillThread(TID tid);
  147.  
  148.    APIRET APIENTRY DosAllocThreadLocalMemory(ULONG cb, PULONG *p);
  149.  
  150.    APIRET APIENTRY DosFreeThreadLocalMemory(ULONG *p);
  151.  
  152.    /* Action code values */
  153.  
  154.    #define DCWA_PROCESS       0
  155.    #define DCWA_PROCESSTREE   1
  156.  
  157.    /* Wait option values */
  158.  
  159.    #define DCWW_WAIT          0
  160.    #define DCWW_NOWAIT        1
  161.  
  162. /* Thread Flags for DosCreateThread options 59468 */
  163.  
  164. #define CREATE_READY        0                   /* defect 65437  */
  165. #define CREATE_SUSPENDED    1
  166. #define STACK_SPARSE        0
  167. #define STACK_COMMITTED     2
  168.  
  169.    typedef struct _RESULTCODES       /* resc */
  170.    {
  171.       ULONG codeTerminate;
  172.       ULONG codeResult;
  173.    } RESULTCODES;
  174.    typedef RESULTCODES *PRESULTCODES;
  175.  
  176.    APIRET APIENTRY DosWaitChild(ULONG action,
  177.                                 ULONG option,
  178.                                 PRESULTCODES pres,
  179.                                 PPID ppid,
  180.                                 PID pid);
  181.  
  182.    APIRET APIENTRY DosWaitThread(PTID ptid,
  183.                                  ULONG option);
  184.  
  185.    APIRET APIENTRY DosSleep(ULONG msec);
  186.  
  187.    /*  start F197445  */
  188.  
  189.    typedef struct _MPAFFINITY { /* afnty */
  190.       ULONG          mask[2]; /* CPUs 0 thru 31 in [0], CPUs 32 thru 63 in [1] */
  191.    } MPAFFINITY;
  192.    typedef MPAFFINITY *PMPAFFINITY;
  193.  
  194.    APIRET APIENTRY DosQueryThreadAffinity(ULONG scope,
  195.                                           PMPAFFINITY pAffinity);
  196.  
  197.    /* scope values for QueryThreadAffinity */
  198.  
  199.    #define AFNTY_THREAD       0
  200.    #define AFNTY_SYSTEM       1
  201.  
  202.    APIRET APIENTRY DosSetThreadAffinity(PMPAFFINITY pAffinity);
  203.    /*  end F197445  */
  204.  
  205. #ifndef DBG_INCL_DOSDEBUG
  206.  
  207. #define DBG_INCL_DOSDEBUG
  208.  
  209.  
  210. /***            User's Debug Buffer structure
  211.  *
  212.  *      A pointer to a uDB is the sole parameter to DosDebug.  It
  213.  *      contains all the information required for each DosDebug
  214.  *      command.
  215.  *
  216.  */
  217.  
  218. typedef struct _uDB {           /* uDB */
  219.         unsigned long   Pid;            /* Debuggee Process id          */
  220.         unsigned long   Tid;            /* Debuggee Thread id           */
  221.         long            Cmd;            /* Command or Notification      */
  222.         long            Value;          /* Generic Data Value           */
  223.         unsigned long   Addr;           /* Debuggee Address             */
  224.         unsigned long   Buffer;         /* Debugger Buffer Address      */
  225.         unsigned long   Len;            /* Length of Range              */
  226.         unsigned long   Index;          /* Generic Identifier Index     */
  227.         unsigned long   MTE;            /* Module Table Entry Handle    */
  228.         unsigned long   EAX;            /* Register Set                 */
  229.         unsigned long   ECX;
  230.         unsigned long   EDX;
  231.         unsigned long   EBX;
  232.         unsigned long   ESP;
  233.         unsigned long   EBP;
  234.         unsigned long   ESI;
  235.         unsigned long   EDI;
  236.         unsigned long   EFlags;
  237.         unsigned long   EIP;
  238.         unsigned long   CSLim;
  239.         unsigned long   CSBase;
  240.         unsigned char   CSAcc;
  241.         unsigned char   CSAtr;
  242.         unsigned short  CS;
  243.         unsigned long   DSLim;
  244.         unsigned long   DSBase;
  245.         unsigned char   DSAcc;
  246.         unsigned char   DSAtr;
  247.         unsigned short  DS;
  248.         unsigned long   ESLim;
  249.         unsigned long   ESBase;
  250.         unsigned char   ESAcc;
  251.         unsigned char   ESAtr;
  252.         unsigned short  ES;
  253.         unsigned long   FSLim;
  254.         unsigned long   FSBase;
  255.         unsigned char   FSAcc;
  256.         unsigned char   FSAtr;
  257.         unsigned short  FS;
  258.         unsigned long   GSLim;
  259.         unsigned long   GSBase;
  260.         unsigned char   GSAcc;
  261.         unsigned char   GSAtr;
  262.         unsigned short  GS;
  263.         unsigned long   SSLim;
  264.         unsigned long   SSBase;
  265.         unsigned char   SSAcc;
  266.         unsigned char   SSAtr;
  267.         unsigned short  SS;
  268. } uDB_t;
  269.  
  270. /***            DosDebug Command Numbers
  271.  *
  272.  *      These numbers are placed in the Cmd field of the uDB on
  273.  *      entry to DosDebug.
  274.  *
  275.  *      These numbers identify which command DosDebug is requested
  276.  *      to perform.
  277.  *
  278.  */
  279.  
  280. #define DBG_C_Null              0       /* Null                         */
  281. #define DBG_C_ReadMem           1       /* Read Word                    */
  282. #define DBG_C_ReadMem_I         1       /* Read Word                    */
  283. #define DBG_C_ReadMem_D         2       /* Read Word (same as 1)        */
  284. #define DBG_C_ReadReg           3       /* Read Register Set            */
  285. #define DBG_C_WriteMem          4       /* Write Word                   */
  286. #define DBG_C_WriteMem_I        4       /* Write Word                   */
  287. #define DBG_C_WriteMem_D        5       /* Write Word (same as 4)       */
  288. #define DBG_C_WriteReg          6       /* Write Register Set           */
  289. #define DBG_C_Go                7       /* Go                           */
  290. #define DBG_C_Term              8       /* Terminate                    */
  291. #define DBG_C_SStep             9       /* Single Step                  */
  292. #define DBG_C_Stop              10      /* Stop                         */
  293. #define DBG_C_Freeze            11      /* Freeze Thread                */
  294. #define DBG_C_Resume            12      /* Resume Thread                */
  295. #define DBG_C_NumToAddr         13      /* Object Number to Address     */
  296. #define DBG_C_ReadCoRegs        14      /* Read Coprocessor Registers   */
  297. #define DBG_C_WriteCoRegs       15      /* Write Coprocessor Registers  */
  298.                                         /* 16 is reserved               */
  299. #define DBG_C_ThrdStat          17      /* Get Thread Status            */
  300. #define DBG_C_MapROAlias        18      /* Map read-only alias          */
  301. #define DBG_C_MapRWAlias        19      /* Map read-write alias         */
  302. #define DBG_C_UnMapAlias        20      /* Unmap Alias                  */
  303. #define DBG_C_Connect           21      /* Connect to Debuggee          */
  304. #define DBG_C_ReadMemBuf        22      /* Read Memory Buffer           */
  305. #define DBG_C_WriteMemBuf       23      /* Write Memory Buffer          */
  306. #define DBG_C_SetWatch          24      /* Set Watchpoint               */
  307. #define DBG_C_ClearWatch        25      /* Clear Watchpoint             */
  308. #define DBG_C_RangeStep         26      /* Range Step                   */
  309. #define DBG_C_Continue          27      /* Continue after an Exception  */
  310. #define DBG_C_AddrToObject      28      /* Address to Object            */
  311. #define DBG_C_XchgOpcode        29      /* Exchange opcode and go       */
  312. #define DBG_C_LinToSel          30      /* 32 to 16 conversion      A001*/
  313. #define DBG_C_SelToLin          31      /* 16 to 32 conversion      A001*/
  314. #define DBG_C_RegisterSemList   32      /* Internal use only            */
  315. #define DBG_C_Attach            33      /* Attach to Debuggee           */
  316. #define DBG_C_Detach            34      /* Detach from debuggee         */
  317. #define DBG_C_RegDebug          35      /* Register Debugger            */
  318. #define DBG_C_QueryDebug        36      /* Query Currently Reg Debugger */
  319.  
  320.  
  321. /***    DBG_C_RegDebug - Register JIT Debug Information
  322.  *
  323.  *      These are the possible values which can be passed into
  324.  *      the register routine for the per-process JIT debugger
  325.  *      registration.
  326.  *
  327.  *      These values are passing through kDB_t->Value field.
  328.  */
  329.  
  330. #define JIT_REG_INHERIT         0x00010000
  331. #define JIT_REG_NOINHERIT       0x00020000
  332. #define JIT_REG_DETACH          0x00030000
  333. #define JIT_REG_FG              0x00040000
  334.  
  335. /***    DBG_C_QueryDebug - Query JIT Debug Information
  336.  *
  337.  *      These are the possible values which can be passed into
  338.  *      the query routine for the JIT debugger. These
  339.  *      bits identify query operation to perform.
  340.  *
  341.  *      These values are passing through kDB_t->Offset field.
  342.  */
  343. #define DBGQ_JIT_GLOBAL         0x10000000
  344. #define DBGQ_JIT_PERPROC        0x20000000
  345.  
  346.  
  347. /***            DosDebug Notification Numbers
  348.  *
  349.  *      These numbers are placed in the Cmd field of the uDB upon
  350.  *      exit from DosDebug.
  351.  *
  352.  *      These numbers identify which DosDebug Event just occured,
  353.  *      or whether a particular command succeeded or failed.
  354.  *
  355.  */
  356.  
  357. #define DBG_N_Success           0L      /* Command completed successfully  */
  358. #define DBG_N_Error             -1L     /* Error detected during command   */
  359. #define DBG_N_ProcTerm          -6L     /* Process exiting - ExitList done */
  360. #define DBG_N_Exception         -7L     /* Exception detected              */
  361. #define DBG_N_ModuleLoad        -8L     /* Module loaded                   */
  362. #define DBG_N_CoError           -9L     /* Coprocessor not in use error    */
  363. #define DBG_N_ThreadTerm        -10L    /* Thread exiting - Exitlist soon  */
  364. #define DBG_N_AsyncStop         -11L    /* Async Stop detected             */
  365. #define DBG_N_NewProc           -12L    /* New Process started             */
  366. #define DBG_N_AliasFree         -13L    /* Alias needs to be freed         */
  367. #define DBG_N_Watchpoint        -14L    /* Watchpoint hit                  */
  368. #define DBG_N_ThreadCreate      -15L    /* New thread created              */
  369. #define DBG_N_ModuleFree        -16L    /* Module freed                    */
  370. #define DBG_N_RangeStep         -17L    /* Range Step completed            */
  371.  
  372. /***          - Thread Status Buffer structure
  373.  *
  374.  *      A pointer to a TStat structure is required for the
  375.  *      DBG_C_ThrdStat command.
  376.  *
  377.  *      The TStat structure returns information about a thread.
  378.  *
  379.  *      DbgState in the Thread Status buffer contains info about the
  380.  *      current state of debugging, and will have one of the following
  381.  *      values upon return :
  382.  *
  383.  *      DBG_D_Thawed, DBG_D_Frozen
  384.  *
  385.  *      TState in the Thread Status buffer contains info about the
  386.  *      scheduling state of the thread, and will have one of the
  387.  *      following values upon return.
  388.  *
  389.  *      DBG_T_Runnable, DBG_T_Suspended, DBG_T_Blocked, DBG_T_CritSec
  390.  *
  391.  *      TPriority in the Thread Status buffer contains the thread's
  392.  *      base scheduling priority.  This priority will be expressed as
  393.  *      scheduling class and delta values upon return.
  394.  *
  395.  */
  396.  
  397. typedef struct _TStat {         /* TS */
  398.         unsigned char   DbgState;       /* Thread's Debugging State      */
  399.         unsigned char   TState;         /* Thread's Scheduler State     */
  400.         unsigned short  TPriority;      /* Thread's Scheduler Priority  */
  401. } TStat_t;
  402.  
  403. /***            DbgState values
  404.  *
  405.  *      These are the possible values which can be returned
  406.  *      in the DbgState field of the TStat structure. These
  407.  *      bits identify debugging information.
  408.  *
  409.  */
  410.  
  411. #define DBG_D_Thawed    0
  412. #define DBG_D_Frozen    1
  413.  
  414. /***            TState values
  415.  *
  416.  *      These are the possible values which can be returned in
  417.  *      the TState field of the TStat structure.  These values
  418.  *      identify scheduler state information.
  419.  *
  420.  */
  421.  
  422. #define DBG_T_Runnable  0
  423. #define DBG_T_Suspended 1
  424. #define DBG_T_Blocked   2
  425. #define DBG_T_CritSec   3
  426.  
  427. /***             Coprocessor Type Parameters
  428.  *
  429.  *      These are the possible values identifying the coprocessor
  430.  *      types supported by DosDebug used when accessing the
  431.  *      coprocessor register set.
  432.  *
  433.  */
  434.  
  435. #define DBG_CO_387      1
  436.  
  437. /***EK+ DBG_LEN - Coprocessor Buffer Lengths
  438.  *
  439.  *      These are the possible values identifying the length of
  440.  *      the coprocessor buffer when accessing the coprocessor
  441.  *      register set.
  442.  *
  443.  */
  444.  
  445. #define DBG_LEN_387     108
  446.  
  447. /***            Debugging Level Parameter
  448.  *
  449.  *      This is the only possible value for the DBG_C_Connect command,
  450.  *      and identifies that debugging on the 386 envoronment is desired.
  451.  *
  452.  */
  453.  
  454. #define DBG_L_386       1
  455.  
  456. /***            Watchpoint Scope and Type Parameters
  457.  *
  458.  *      These are the possible Watchpoint Scope values, as used by
  459.  *      the DBG_C_SetWatch command.     The DBG_C_SetWatch command
  460.  *      expects a  combination (using either an ADD or an OR) of
  461.  *      the Scope and Type parameters to be passed as a single value.
  462.  *
  463.  */
  464.  
  465. /*      Watchpoint Scope Parameters     */
  466.  
  467. #define DBG_W_Global    0x00000001
  468. #define DBG_W_Local     0x00000002
  469.  
  470. /*      Watchpoint Type Parameters      */
  471.  
  472. #define DBG_W_Execute   0x00010000
  473. #define DBG_W_Write     0x00020000
  474. #define DBG_W_ReadWrite 0x00030000
  475.  
  476. /***            Object flags
  477.  *
  478.  *      This flag indicates whether the MTE field contains the object's
  479.  *      MTE after a DBG_C_AddrToObject call.
  480.  *
  481.  */
  482.  
  483. #define DBG_O_OBJMTE    0x10000000
  484.  
  485. /***            Exception chances
  486.  *
  487.  *      The three scenarios under which a debug exception is reported
  488.  *      are pre-1st, 1st, and last chance. The value field of the
  489.  *      user debug buffer will indicate which chance a given call is
  490.  *      for. Additional parameter values will be:
  491.  *
  492.  *         For pre-1st chance (XCPT_BREAKPOINT):
  493.  *              Addr   = Linear address of breakpoint
  494.  *              Buffer = XCPT_BREAKPOINT
  495.  *
  496.  *         For pre-1st change (XCPT_SINGLE_STEP):
  497.  *              Addr   = Linear address of instruction after Single Step
  498.  *              Buffer = XCPT_SINGLE_STEP
  499.  *
  500.  *         For 1st chance (all exceptions):
  501.  *              Addr   = Linear address of exception
  502.  *              Buffer = Pointer to Exception Report Record in
  503.  *                       Debuggee's context
  504.  *              Len    = Pointer to Exception Context Record in
  505.  *                       Debuggee's context
  506.  *
  507.  *         For Last chance (all exceptions):
  508.  *              Addr   = Linear address of exception
  509.  *              Buffer = Pointer to Exception Report Record in
  510.  *                       Debuggee's context
  511.  *              Len    = Pointer to Exception Context Record in
  512.  *                       Debuggee's context
  513.  *
  514.  *         For Invalid stack notification (all exceptions)
  515.  *              Addr   = Linear address of exception
  516.  *              Buffer = Exception number
  517.  */
  518.  
  519. #define DBG_X_PRE_FIRST_CHANCE  0x00000000
  520. #define DBG_X_FIRST_CHANCE      0x00000001
  521. #define DBG_X_LAST_CHANCE       0x00000002
  522. #define DBG_X_STACK_INVALID     0x00000003
  523.  
  524. #endif /* DBG_INCL_DOSDEBUG */
  525.  
  526.    APIRET APIENTRY DosDebug(PVOID pdbgbuf);
  527.  
  528.  
  529.    /* codeTerminate values (also passed to ExitList routines) */
  530.  
  531.    #define TC_EXIT            0
  532.    #define TC_HARDERROR       1
  533.    #define TC_TRAP            2
  534.    #define TC_KILLPROCESS     3
  535.    #define TC_EXCEPTION       4
  536.  
  537.    typedef VOID APIENTRY FNEXITLIST(ULONG);
  538.    typedef FNEXITLIST *PFNEXITLIST;
  539.  
  540.    APIRET APIENTRY DosEnterCritSec(VOID);
  541.  
  542.    APIRET APIENTRY DosExitCritSec(VOID);
  543.  
  544.    APIRET APIENTRY DosExitList(ULONG ordercode,
  545.                                PFNEXITLIST pfn);
  546.  
  547.    /* DosExitList functions */
  548.  
  549.    #define EXLST_ADD          1
  550.    #define EXLST_REMOVE       2
  551.    #define EXLST_EXIT         3
  552.  
  553. #ifdef __cplusplus
  554.    APIRET APIENTRY DosExecPgm(PCHAR pObjname,
  555.                               LONG cbObjname,
  556.                               ULONG execFlag,
  557.                               PCSZ  pArg,
  558.                               PCSZ  pEnv,
  559.                               PRESULTCODES pRes,
  560.                               PCSZ  pName);
  561. #else
  562.    APIRET APIENTRY DosExecPgm(PCHAR pObjname,
  563.                               LONG cbObjname,
  564.                               ULONG execFlag,
  565.                               PSZ pArg,
  566.                               PSZ pEnv,
  567.                               PRESULTCODES pRes,
  568.                               PSZ pName);
  569. #endif
  570.  
  571.    /* DosExecPgm functions */
  572.  
  573.    #define EXEC_SYNC          0
  574.    #define EXEC_ASYNC         1
  575.    #define EXEC_ASYNCRESULT   2
  576.    #define EXEC_TRACE         3
  577.    #define EXEC_BACKGROUND    4
  578.    #define EXEC_LOAD          5
  579.    #define EXEC_ASYNCRESULTDB 6
  580.  
  581.  
  582.    APIRET APIENTRY  DosSetPriority(ULONG scope,
  583.                                    ULONG ulClass,
  584.                                    LONG  delta,
  585.                                    ULONG PorTid);
  586.  
  587.    /* Priority scopes */
  588.  
  589.    #define PRTYS_PROCESS      0
  590.    #define PRTYS_PROCESSTREE  1
  591.    #define PRTYS_THREAD       2
  592.  
  593.    /* Priority classes */
  594.  
  595.    #define PRTYC_NOCHANGE     0
  596.    #define PRTYC_IDLETIME     1
  597.    #define PRTYC_REGULAR      2
  598.    #define PRTYC_TIMECRITICAL 3
  599.    #define PRTYC_FOREGROUNDSERVER 4
  600.  
  601.    /* Priority deltas */
  602.  
  603.    #define PRTYD_MINIMUM     -31
  604.    #define PRTYD_MAXIMUM      31
  605.  
  606.    APIRET APIENTRY DosKillProcess(ULONG action,
  607.                                   PID pid);
  608.  
  609.    #define DKP_PROCESSTREE    0
  610.    #define DKP_PROCESS        1
  611. #endif /* INCL_DOSPROCESS */
  612.  
  613. #ifndef INCL_SAADEFS
  614.    /*************************************************************************\
  615.    * CCHMAXPATH is the maximum fully qualified path name length including  *
  616.    * the drive letter, colon, backslashes and terminating NULL.            *
  617.    \*************************************************************************/
  618.    #define CCHMAXPATH         260
  619.  
  620.    /*************************************************************************\
  621.    * CCHMAXPATHCOMP is the maximum individual path component name length   *
  622.    * including a terminating NULL.                                         *
  623.    \*************************************************************************/
  624.    #define CCHMAXPATHCOMP     256
  625. #endif  /* !INCL_SAADEFS */
  626.  
  627. #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
  628.    /*** File manager */
  629.    /* DosSetFilePtr() file position codes */
  630.  
  631.    #define FILE_BEGIN      0x0000   /* Move relative to beginning of file */
  632.    #define FILE_CURRENT    0x0001   /* Move relative to current fptr position */
  633.    #define FILE_END        0x0002   /* Move relative to end of file */
  634.    #define FILE_SECTOR     0x8000   /* Interpret offset as a sector */
  635.  
  636.    /* DosListIO() operation flags  154932 */
  637.  
  638.    #define LISTIO_READ     0x0004  /* perform seek/read */
  639.    #define LISTIO_WRITE    0x0008  /* perform seek/write */
  640.  
  641.    /* DosListIO() operation modes 154932 */
  642.  
  643.    #define LISTIO_ORDERED    0x0001  /* guarantee ordering of operations */
  644.    #define LISTIO_UNORDERED  0x0002  /* speed is king */
  645.  
  646.    /* DosFindFirst/Next Directory handle types */
  647.    #define HDIR_SYSTEM        1     /* Use system handle (1) */
  648.    #define HDIR_CREATE      (-1)    /* Allocate a new, unused handle */
  649.  
  650.    /* DosCopy control bits; may be or'ed together */
  651.    #define DCPY_EXISTING   0x0001   /* Copy even if target exists */
  652.    #define DCPY_APPEND     0x0002   /* Append to existing file, do not replace */
  653.    #define DCPY_FAILEAS    0x0004   /* Fail if EAs not supported on target*/
  654.  
  655.    /* DosOpen/DosQFHandState/DosQueryFileInfo et al file attributes; also */
  656.    /* known as Dos File Mode bits... */
  657.    #define FILE_NORMAL     0x0000
  658.    #define FILE_READONLY   0x0001
  659.    #define FILE_HIDDEN     0x0002
  660.    #define FILE_SYSTEM     0x0004
  661.    #define FILE_DIRECTORY  0x0010
  662.    #define FILE_ARCHIVED   0x0020
  663.  
  664.    #define FILE_IGNORE     0x10000     /* ignore file attribute in */
  665.    /* DosSetPath/File Info if */
  666.    /* this bit is set*/
  667.  
  668.    #define MUST_HAVE_READONLY      ( (FILE_READONLY  << 8) | FILE_READONLY  )
  669.    #define MUST_HAVE_HIDDEN        ( (FILE_HIDDEN    << 8) | FILE_HIDDEN    )
  670.    #define MUST_HAVE_SYSTEM        ( (FILE_SYSTEM    << 8) | FILE_SYSTEM    )
  671.    #define MUST_HAVE_DIRECTORY     ( (FILE_DIRECTORY << 8) | FILE_DIRECTORY )
  672.    #define MUST_HAVE_ARCHIVED      ( (FILE_ARCHIVED  << 8) | FILE_ARCHIVED  )
  673.  
  674.    /* DosOpen() actions */
  675.    #define FILE_EXISTED    0x0001
  676.    #define FILE_CREATED    0x0002
  677.    #define FILE_TRUNCATED  0x0003
  678.  
  679.    /* DosOpen() open flags */
  680.    #define FILE_OPEN       0x0001
  681.    #define FILE_TRUNCATE   0x0002
  682.    #define FILE_CREATE     0x0010
  683.  
  684.    /*     this nibble applies if file already exists                xxxx */
  685.    #define OPEN_ACTION_FAIL_IF_EXISTS     0x0000  /* ---- ---- ---- 0000 */
  686.    #define OPEN_ACTION_OPEN_IF_EXISTS     0x0001  /* ---- ---- ---- 0001 */
  687.    #define OPEN_ACTION_REPLACE_IF_EXISTS  0x0002  /* ---- ---- ---- 0010 */
  688.  
  689.    /*     this nibble applies if file does not exist           xxxx      */
  690.    #define OPEN_ACTION_FAIL_IF_NEW        0x0000  /* ---- ---- 0000 ---- */
  691.    #define OPEN_ACTION_CREATE_IF_NEW      0x0010  /* ---- ---- 0001 ---- */
  692.  
  693.    /* DosOpen/DosSetFHandState mode flags */
  694.    #define OPEN_ACCESS_READONLY           0x0000  /* ---- ---- ---- -000 */
  695.    #define OPEN_ACCESS_WRITEONLY          0x0001  /* ---- ---- ---- -001 */
  696.    #define OPEN_ACCESS_READWRITE          0x0002  /* ---- ---- ---- -010 */
  697.    #define OPEN_SHARE_DENYREADWRITE       0x0010  /* ---- ---- -001 ---- */
  698.    #define OPEN_SHARE_DENYWRITE           0x0020  /* ---- ---- -010 ---- */
  699.    #define OPEN_SHARE_DENYREAD            0x0030  /* ---- ---- -011 ---- */
  700.    #define OPEN_SHARE_DENYNONE            0x0040  /* ---- ---- -100 ---- */
  701.    #define OPEN_FLAGS_NOINHERIT           0x0080  /* ---- ---- 1--- ---- */
  702.    #define OPEN_FLAGS_NO_LOCALITY         0x0000  /* ---- -000 ---- ---- */
  703.    #define OPEN_FLAGS_SEQUENTIAL          0x0100  /* ---- -001 ---- ---- */
  704.    #define OPEN_FLAGS_RANDOM              0x0200  /* ---- -010 ---- ---- */
  705.    #define OPEN_FLAGS_RANDOMSEQUENTIAL    0x0300  /* ---- -011 ---- ---- */
  706.    #define OPEN_FLAGS_NO_CACHE            0x1000  /* ---1 ---- ---- ---- */
  707.    #define OPEN_FLAGS_FAIL_ON_ERROR       0x2000  /* --1- ---- ---- ---- */
  708.    #define OPEN_FLAGS_WRITE_THROUGH       0x4000  /* -1-- ---- ---- ---- */
  709.    #define OPEN_FLAGS_DASD                0x8000  /* 1--- ---- ---- ---- */
  710.    #define OPEN_FLAGS_NONSPOOLED          0x00040000
  711.    #define OPEN_SHARE_DENYLEGACY       0x10000000   /* 2GB */
  712.    #define OPEN_FLAGS_PROTECTED_HANDLE 0x40000000
  713.  
  714.  
  715.    /* DosSearchPath() constants */
  716.    #define SEARCH_PATH           0x0000
  717.    #define SEARCH_CUR_DIRECTORY  0x0001
  718.    #define SEARCH_ENVIRONMENT    0x0002
  719.    #define SEARCH_IGNORENETERRS  0x0004
  720.  
  721.  
  722.    /************************************************************
  723.    EA Info Levels & Find First/Next
  724.    =========================================
  725.    API's: DosFindFirst, DosQueryFileInfo, DosQueryPathInfo, DosSetFileInfo,
  726.    DosSetPathInfo
  727.    ************************************************************/
  728.  
  729.    /* File info levels&gml All listed API's */
  730.    #define FIL_STANDARD           1     /* Info level 1, standard file info */
  731.    #define FIL_QUERYEASIZE        2     /* Level 2, return Full EA size */
  732.    #define FIL_QUERYEASFROMLIST   3     /* Level 3, return requested EA's */
  733.    #define FIL_STANDARDL         11     /* LFS - Info level 11, standard file info for large files*/
  734.    #define FIL_QUERYEASIZEL      12     /* LFS - Level 12, return Full EA size for large files */
  735.    #define FIL_QUERYEASFROMLISTL 13     /* LFS - Level 13, return requested EA's */
  736.  
  737.  
  738.    /* File info levels: Dos...PathInfo only */
  739.    #define FIL_QUERYFULLNAME     5     /* Level 5, return fully qualified
  740.    name of file */
  741.  
  742.  
  743.    /* DosFsAttach() */
  744.    /* Attact or detach */
  745.    #define FS_ATTACH             0     /* Attach file server */
  746.    #define FS_DETACH             1     /* Detach file server */
  747.    #define FS_SPOOLATTACH        2     /* Register a spooler device */
  748.    #define FS_SPOOLDETACH        3     /* De-register a spooler device */
  749.  
  750.  
  751.    /* DosFsCtl() */
  752.    /* Routing type */
  753.    #define FSCTL_HANDLE          1     /* File Handle directs req routing */
  754.    #define FSCTL_PATHNAME        2     /* Path Name directs req routing   */
  755.    #define FSCTL_FSDNAME         3     /* FSD Name directs req routing    */
  756.  
  757.    /* defined FSCTL functions */
  758.    #define FSCTL_ERROR_INFO            1  /* return error info from FSD  */
  759.    #define FSCTL_MAX_EASIZE            2  /* Max ea size for the FSD     */
  760.    #define FSCTL_GET_NEXT_ROUTE_NAME   3  /* Rtrn next valid FSD name    */
  761.    #define FSCTL_DAEMON_QUERY          4  /* FSD query for daemon rqrmnt */
  762.  
  763.    /* defined FSCTL query flags */
  764.    #define FSCTL_QUERY_COMPLETE     0x0000
  765.    #define FSCTL_QUERY_AGAIN        0x0001
  766.  
  767.    typedef struct  _EASIZEBUF     /* easizebuf struct for FSCTL fn 2  */
  768.    {                              /* max ea size                      */
  769.       USHORT  cbMaxEASize;        /* max. size of one EA              */
  770.       ULONG   cbMaxEAListSize;    /* max size of the full EA List     */
  771.    } EASIZEBUF;
  772.    typedef EASIZEBUF  *PEASIZEBUF;
  773.  
  774.    typedef struct _ROUTENAMEBUF /* routenamebuf struct for FSCTL fn 3 - return next FSD name */
  775.    {
  776.       ULONG   hRouteHandle;   /* Input- set to 0 for first name, use    */
  777.                               /*   the value returned for next name     */
  778.                               /* Output- handle to use to get next name */
  779.       UCHAR   szRouteName;    /* Registered FSD name that can be used   */
  780.                               /*   for FSCTL_FSDNAME routing type       */
  781.    } ROUTENAMEBUF;
  782.    typedef ROUTENAMEBUF *PROUTENAMEBUF;
  783.  
  784.    /* Data associated with an FSD Daemon thread spawning action  */
  785.  
  786.    typedef struct _FSDTHREAD  /* fsdthread struct for FSCTL fn 4 */
  787.    {
  788.       USHORT  usFunc;
  789.       USHORT  usStackSize;
  790.       ULONG   ulPriorityClass;
  791.       LONG    lPriorityLevel;
  792.    } FSDTHREAD;
  793.  
  794.    /* Data associated with an FSD Daemon thread requirements     */
  795.    typedef struct _FSDDAEMON  /* fsddaemon struct for FSCTL fn 4 */
  796.    {
  797.       USHORT     usNumThreads;
  798.       USHORT     usMoreFlag;
  799.       USHORT     usCallInstance;
  800.       FSDTHREAD  tdThrds[16];
  801.    } FSDDAEMON;
  802.  
  803.    /* DosQueryFSAttach() */
  804.    /* Information level types (defines method of query) */
  805.    #define FSAIL_QUERYNAME       1     /* Return data for a Drive or Device */
  806.    #define FSAIL_DEVNUMBER       2     /* Return data for Ordinal Device # */
  807.    #define FSAIL_DRVNUMBER       3     /* Return data for Ordinal Drive # */
  808.  
  809.    /* Item types (from data structure item "iType") */
  810.    #define FSAT_CHARDEV          1     /* Resident character device */
  811.    #define FSAT_PSEUDODEV        2     /* Pusedu-character device */
  812.    #define FSAT_LOCALDRV         3     /* Local drive */
  813.    #define FSAT_REMOTEDRV        4     /* Remote drive attached to FSD */
  814.  
  815.    typedef struct  _FSQBUFFER       /* fsqbuf Data structure for QFSAttach*/
  816.    {
  817.       USHORT  iType;              /* Item type */
  818.       USHORT  cbName;             /* Length of item name, sans NULL */
  819.       UCHAR   szName[1];          /* ASCIIZ item name */
  820.       USHORT  cbFSDName;          /* Length of FSD name, sans NULL */
  821.       UCHAR   szFSDName[1];       /* ASCIIZ FSD name */
  822.       USHORT  cbFSAData;          /* Length of FSD Attach data returned */
  823.       UCHAR   rgFSAData[1];       /* FSD Attach data from FSD */
  824.    } FSQBUFFER;
  825.    typedef FSQBUFFER  *PFSQBUFFER;
  826.  
  827.  
  828.    typedef struct _FSQBUFFER2       /* fsqbuf2 Data structure for QFSAttach*/
  829.    {
  830.       USHORT  iType;
  831.       USHORT  cbName;
  832.       USHORT  cbFSDName;
  833.       USHORT  cbFSAData;
  834.       UCHAR   szName[1];
  835.       UCHAR   szFSDName[1];
  836.       UCHAR   rgFSAData[1];
  837.    } FSQBUFFER2;
  838.    typedef FSQBUFFER2 *PFSQBUFFER2;
  839.  
  840.    typedef struct _SPOOLATTACH      /* spool Data structure for spooler operations */
  841.    {
  842.       USHORT  hNmPipe;              /* Named pipe handle */
  843.       ULONG   ulKey;                /* Attached key */
  844.    } SPOOLATTACH;
  845.    typedef SPOOLATTACH  *PSPOOLATTACH;
  846.  
  847.  
  848.    /*****************************************************************************
  849.    * File System Drive Information&gml DosQueryFSInfo DosSetFSInfo              *
  850.    *****************************************************************************/
  851.  
  852.    /* FS Drive Info Levels */
  853.    #define FSIL_ALLOC            1     /* Drive allocation info (Query only) */
  854.    #define FSIL_VOLSER           2     /* Drive Volum/Serial info */
  855.  
  856.    /* DosQueryFHType() */
  857.    /* Handle classes (low 8 bits of Handle Type) */
  858.    #define FHT_DISKFILE          0x0000   /* Disk file handle */
  859.    #define FHT_CHRDEV            0x0001   /* Character device handle */
  860.    #define FHT_PIPE              0x0002   /* Pipe handle */
  861.  
  862.    /* Handle bits (high 8 bits of Handle Type) */
  863.    #define FHB_DSKREMOTE         0x8000   /* Remote disk */
  864.    #define FHB_CHRDEVREMOTE      0x8000   /* Remote character device */
  865.    #define FHB_PIPEREMOTE        0x8000   /* Remote pipe */
  866.  
  867.  
  868.  
  869.    #ifndef INCL_SAADEFS
  870.       /* File time and date types */
  871. #if __IBMC__ || __IBMCPP__
  872.          typedef struct _FTIME           /* ftime */
  873.          {
  874.             UINT   twosecs : 5;
  875.             UINT   minutes : 6;
  876.             UINT   hours   : 5;
  877.          } FTIME;
  878.          typedef FTIME *PFTIME;
  879.       #else
  880.          typedef struct _FTIME           /* ftime */
  881.          {
  882.             USHORT   twosecs : 5;
  883.             USHORT   minutes : 6;
  884.             USHORT   hours   : 5;
  885.          } FTIME;
  886.          typedef FTIME *PFTIME;
  887.       #endif
  888.  
  889. #if __IBMC__ || __IBMCPP__
  890.          typedef struct _FDATE           /* fdate */
  891.          {
  892.             UINT   day     : 5;
  893.             UINT   month   : 4;
  894.             UINT   year    : 7;
  895.          } FDATE;
  896.          typedef FDATE   *PFDATE;
  897.       #else
  898.          typedef struct _FDATE           /* fdate */
  899.          {
  900.             USHORT   day     : 5;
  901.             USHORT   month   : 4;
  902.             USHORT   year    : 7;
  903.          } FDATE;
  904.          typedef FDATE   *PFDATE;
  905.       #endif
  906.    #endif /* INCL_SAADEFS */
  907.  
  908.  
  909.    typedef struct _VOLUMELABEL      /* vol */
  910.    {
  911.       BYTE cch;
  912.       CHAR szVolLabel[12];
  913.    } VOLUMELABEL;
  914.    typedef VOLUMELABEL  *PVOLUMELABEL;
  915.  
  916.    typedef struct _FSINFO      /* fsinf */
  917.    {
  918.       FDATE fdateCreation;
  919.       FTIME ftimeCreation;
  920.       VOLUMELABEL vol;
  921.    } FSINFO;
  922.    typedef FSINFO *PFSINFO;
  923.  
  924.    /* HANDTYPE values */
  925.    #define HANDTYPE_FILE         0x0000
  926.    #define HANDTYPE_DEVICE       0x0001
  927.    #define HANDTYPE_PIPE         0x0002
  928.    #define HANDTYPE_PROTECTED    0x4000
  929.    #define HANDTYPE_NETWORK      0x8000
  930.  
  931.    typedef struct _FILELOCK      /* flock */
  932.    {
  933.       LONG lOffset;
  934.       LONG lRange;
  935.    } FILELOCK;
  936.    typedef FILELOCK  *PFILELOCK;
  937.  
  938.    /* Large File Support >2GB */
  939.    typedef struct _FILELOCKL     /* flock */
  940.    {
  941.       LONGLONG lOffset;
  942.       LONGLONG lRange;
  943.    } FILELOCKL;
  944.    typedef FILELOCKL  *PFILELOCKL;
  945.  
  946.    #ifndef __HEV__            /* INCL_SEMAPHORE may also define HEV */
  947.       #define __HEV__
  948.       typedef  ULONG    HEV;             /* hev */
  949.       typedef  HEV      *PHEV;
  950.    #endif
  951.  
  952.    typedef  ULONG  FHLOCK;
  953.    typedef  PULONG PFHLOCK;
  954.  
  955.    APIRET APIENTRY DosSetFileLocks(HFILE hFile,
  956.                                    PFILELOCK pflUnlock,
  957.                                    PFILELOCK pflLock,
  958.                                    ULONG timeout,
  959.                                    ULONG flags);
  960.  
  961.    /* Large File Support >2GB */
  962.    APIRET APIENTRY DosSetFileLocksL(HFILE hFile,
  963.                                     PFILELOCKL pflUnlock,
  964.                                     PFILELOCKL pflLock,
  965.                                     ULONG timeout,
  966.                                     ULONG flags);
  967.  
  968.    APIRET APIENTRY DosProtectSetFileLocks(HFILE hFile,
  969.                                           PFILELOCK pflUnlock,
  970.                                           PFILELOCK pflLock,
  971.                                           ULONG timeout, ULONG flags,
  972.                                           FHLOCK fhFileHandleLockID);
  973.  
  974.    /* Large File Support >2GB */
  975.    APIRET APIENTRY DosProtectSetFileLocksL(HFILE hFile,
  976.                                            PFILELOCKL pflUnlock,
  977.                                            PFILELOCKL pflLock,
  978.                                            ULONG timeout, ULONG flags,
  979.                                            FHLOCK fhFileHandleLockID);
  980.  
  981.    APIRET APIENTRY DosCancelLockRequest(HFILE hFile,
  982.                                         PFILELOCK pflLock);
  983.  
  984.  
  985.    /* Large File Support >2GB */
  986.    APIRET APIENTRY DosCancelLockRequestL(HFILE hFile,
  987.                                          PFILELOCKL pflLock);
  988.  
  989.    #ifndef INCL_SAADEFS
  990.  
  991.       typedef struct _FILEFINDBUF     /* findbuf */
  992.       {
  993.          FDATE  fdateCreation;
  994.          FTIME  ftimeCreation;
  995.          FDATE  fdateLastAccess;
  996.          FTIME  ftimeLastAccess;
  997.          FDATE  fdateLastWrite;
  998.          FTIME  ftimeLastWrite;
  999.          ULONG  cbFile;
  1000.          ULONG  cbFileAlloc;
  1001.          USHORT attrFile;
  1002.          UCHAR  cchName;
  1003.          CHAR   achName[CCHMAXPATHCOMP];
  1004.       } FILEFINDBUF;
  1005.  
  1006.       typedef FILEFINDBUF *PFILEFINDBUF;
  1007.  
  1008.       /*NOINC */
  1009.       #pragma pack(2)
  1010.       /*INC  */
  1011.       typedef struct _FILEFINDBUF2    /* findbuf2 */
  1012.       {
  1013.          FDATE  fdateCreation;
  1014.          FTIME  ftimeCreation;
  1015.          FDATE  fdateLastAccess;
  1016.          FTIME  ftimeLastAccess;
  1017.          FDATE  fdateLastWrite;
  1018.          FTIME  ftimeLastWrite;
  1019.          ULONG  cbFile;
  1020.          ULONG  cbFileAlloc;
  1021.          USHORT attrFile;
  1022.          ULONG  cbList;
  1023.          UCHAR  cchName;
  1024.          CHAR   achName[CCHMAXPATHCOMP];
  1025.       } FILEFINDBUF2;
  1026.       typedef FILEFINDBUF2 *PFILEFINDBUF2;
  1027.  
  1028.       typedef struct _FILEFINDBUF3                 /* findbuf3 */
  1029.       {
  1030.          ULONG   oNextEntryOffset;            /* new field */
  1031.          FDATE   fdateCreation;
  1032.          FTIME   ftimeCreation;
  1033.          FDATE   fdateLastAccess;
  1034.          FTIME   ftimeLastAccess;
  1035.          FDATE   fdateLastWrite;
  1036.          FTIME   ftimeLastWrite;
  1037.          ULONG   cbFile;
  1038.          ULONG   cbFileAlloc;
  1039.          ULONG   attrFile;                    /* widened field */
  1040.          UCHAR   cchName;
  1041.          CHAR    achName[CCHMAXPATHCOMP];
  1042.       } FILEFINDBUF3;
  1043.       typedef FILEFINDBUF3 *PFILEFINDBUF3;
  1044.  
  1045.       typedef struct _FILEFINDBUF4                 /* findbuf4 */
  1046.       {
  1047.          ULONG   oNextEntryOffset;            /* new field */
  1048.          FDATE   fdateCreation;
  1049.          FTIME   ftimeCreation;
  1050.          FDATE   fdateLastAccess;
  1051.          FTIME   ftimeLastAccess;
  1052.          FDATE   fdateLastWrite;
  1053.          FTIME   ftimeLastWrite;
  1054.          ULONG   cbFile;
  1055.          ULONG   cbFileAlloc;
  1056.          ULONG   attrFile;                    /* widened field */
  1057.          ULONG   cbList;
  1058.          UCHAR   cchName;
  1059.          CHAR    achName[CCHMAXPATHCOMP];
  1060.       } FILEFINDBUF4;
  1061.       typedef FILEFINDBUF4  *PFILEFINDBUF4;
  1062.  
  1063.       typedef struct _FILEFINDBUF3L                 /* findbuf3l */
  1064.       {
  1065.          ULONG    oNextEntryOffset;            /* new field */
  1066.          FDATE    fdateCreation;
  1067.          FTIME    ftimeCreation;
  1068.          FDATE    fdateLastAccess;
  1069.          FTIME    ftimeLastAccess;
  1070.          FDATE    fdateLastWrite;
  1071.          FTIME    ftimeLastWrite;
  1072.          LONGLONG cbFile;
  1073.          LONGLONG cbFileAlloc;
  1074.          ULONG    attrFile;                    /* widened field */
  1075.          UCHAR    cchName;
  1076.          CHAR     achName[CCHMAXPATHCOMP];
  1077.       } FILEFINDBUF3L;
  1078.       typedef FILEFINDBUF3L *PFILEFINDBUF3L;
  1079.  
  1080.       typedef struct _FILEFINDBUF4L                /* findbuf4l */
  1081.       {
  1082.          ULONG    oNextEntryOffset;            /* new field */
  1083.          FDATE    fdateCreation;
  1084.          FTIME    ftimeCreation;
  1085.          FDATE    fdateLastAccess;
  1086.          FTIME    ftimeLastAccess;
  1087.          FDATE    fdateLastWrite;
  1088.          FTIME    ftimeLastWrite;
  1089.          LONGLONG cbFile;
  1090.          LONGLONG cbFileAlloc;
  1091.          ULONG    attrFile;                    /* widened field */
  1092.          ULONG    cbList;
  1093.          UCHAR    cchName;
  1094.          CHAR     achName[CCHMAXPATHCOMP];
  1095.       } FILEFINDBUF4L;
  1096.       typedef FILEFINDBUF4L  *PFILEFINDBUF4L;
  1097.  
  1098.       /* extended attribute structures */
  1099.  
  1100.       typedef struct _GEA         /* gea */
  1101.       {
  1102.          BYTE cbName;        /* name length not including NULL */
  1103.          CHAR szName[1];     /* attribute name */
  1104.       } GEA;
  1105.       typedef GEA *PGEA;
  1106.  
  1107.       typedef struct _GEALIST     /* geal */
  1108.       {
  1109.          ULONG cbList;       /* total bytes of structure including full list */
  1110.          GEA list[1];        /* variable length GEA structures */
  1111.       } GEALIST;
  1112.       typedef GEALIST  *PGEALIST;
  1113.  
  1114.       typedef struct _FEA         /* fea */
  1115.       {
  1116.          BYTE fEA;           /* flags                              */
  1117.          BYTE cbName;        /* name length not including NULL */
  1118.          USHORT cbValue;     /* value length */
  1119.       } FEA;
  1120.       typedef FEA *PFEA;
  1121.  
  1122.       /* flags for _FEA.fEA */
  1123.       #define FEA_NEEDEA         0x80     /* need EA bit */
  1124.  
  1125.       typedef struct _FEALIST     /* feal */
  1126.       {
  1127.          ULONG cbList;       /* total bytes of structure including full list */
  1128.          FEA list[1];        /* variable length FEA structures */
  1129.       } FEALIST;
  1130.       typedef FEALIST *PFEALIST;
  1131.  
  1132.       typedef struct _EAOP        /* eaop */
  1133.       {
  1134.          PGEALIST fpGEAList; /* general EA list */
  1135.          PFEALIST fpFEAList; /* full EA list */
  1136.          ULONG oError;
  1137.       } EAOP;
  1138.       typedef EAOP *PEAOP;
  1139.  
  1140.       /*NOINC*/
  1141.       #pragma pack(1)
  1142.       /*INC*/
  1143.  
  1144.       typedef struct _FEA2         /* fea2 */
  1145.       {
  1146.          ULONG   oNextEntryOffset;    /* new field */
  1147.          BYTE    fEA;
  1148.          BYTE    cbName;
  1149.          USHORT  cbValue;
  1150.          CHAR    szName[1];           /* new field */
  1151.       } FEA2;
  1152.       typedef FEA2 *PFEA2;
  1153.  
  1154.  
  1155.       typedef struct _FEA2LIST     /* fea2l */
  1156.       {
  1157.          ULONG   cbList;
  1158.          FEA2    list[1];
  1159.       } FEA2LIST;
  1160.       typedef FEA2LIST *PFEA2LIST;
  1161.  
  1162.       typedef struct _GEA2          /* gea2 */
  1163.       {
  1164.          ULONG   oNextEntryOffset;     /* new field */
  1165.          BYTE    cbName;
  1166.          CHAR    szName[1];            /* new field */
  1167.       } GEA2;
  1168.       typedef GEA2 *PGEA2;
  1169.  
  1170.       typedef struct _GEA2LIST      /* gea2l */
  1171.       {
  1172.          ULONG   cbList;
  1173.          GEA2    list[1];
  1174.       } GEA2LIST;
  1175.       typedef GEA2LIST *PGEA2LIST;
  1176.  
  1177.       typedef struct _EAOP2         /* eaop2 */
  1178.       {
  1179.          PGEA2LIST   fpGEA2List;       /* GEA set */
  1180.          PFEA2LIST   fpFEA2List;       /* FEA set */
  1181.          ULONG       oError;           /* offset of FEA error */
  1182.       } EAOP2;
  1183.       typedef EAOP2 *PEAOP2;
  1184.  
  1185.  
  1186.       /*
  1187.       * Equates for the types of EAs that follow the convention that we have
  1188.       * established.
  1189.       *
  1190.       * Values 0xFFFE thru 0x8000 are reserved.
  1191.       * Values 0x0000 thru 0x7fff are user definable.
  1192.       * Value  0xFFFC is not used
  1193.       */
  1194.  
  1195.       #define EAT_BINARY      0xFFFE      /* length preceeded binary */
  1196.       #define EAT_ASCII       0xFFFD      /* length preceeded ASCII */
  1197.       #define EAT_BITMAP      0xFFFB      /* length preceeded bitmap */
  1198.       #define EAT_METAFILE    0xFFFA      /* length preceeded metafile */
  1199.       #define EAT_ICON        0xFFF9      /* length preceeded icon */
  1200.       #define EAT_EA          0xFFEE      /* length preceeded ASCII */
  1201.                                           /* name of associated data (#include) */
  1202.       #define EAT_MVMT        0xFFDF      /* multi-valued, multi-typed field */
  1203.       #define EAT_MVST        0xFFDE      /* multi-valued, single-typed field */
  1204.       #define EAT_ASN1        0xFFDD      /* ASN.1 field */
  1205.  
  1206.    #endif  /* !INCL_SAADEFS */
  1207.    /*NOINC*/
  1208.    #pragma pack()
  1209.    /*INC*/
  1210.  
  1211.    /* list i/o structures  154932 */
  1212.  
  1213.    typedef struct _LISTIO_CB { /* LIO */
  1214.        HFILE   hFile;          /* file handle */
  1215.        ULONG   CmdFlag;        /* command flag */
  1216.        LONG    Offset;         /* seek offset */
  1217.        PVOID   pBuffer;        /* pointer to buffer */
  1218.        ULONG   NumBytes;       /* number of bytes to r/w */
  1219.        ULONG   Actual;         /* actual number of bytes r/w */
  1220.        ULONG   RetCode;        /* operation return code */
  1221.        ULONG   Reserved;       /* (internal) */
  1222.        ULONG   Reserved2[3];   /* (internal) */
  1223.        ULONG   Reserved3[2];   /* (internal) */
  1224.    } LISTIO;
  1225.    typedef LISTIO   *PLISTIO;
  1226.  
  1227.    /* Large File Support >2GB */
  1228.    typedef struct _LISTIO_CBL { /* LIO */
  1229.        HFILE    hFile;          /* file handle */
  1230.        ULONG    CmdFlag;        /* command flag */
  1231.        LONGLONG Offset;         /* seek offset */
  1232.        PVOID    pBuffer;        /* pointer to buffer */
  1233.        ULONG    NumBytes;       /* number of bytes to r/w */
  1234.        ULONG    Actual;         /* actual number of bytes r/w */
  1235.        ULONG    RetCode;        /* operation return code */
  1236.        ULONG    Reserved;       /* (internal) */
  1237.        ULONG    Reserved2[3];   /* (internal) */
  1238.        ULONG    Reserved3[2];   /* (internal) */
  1239.    } LISTIOL;
  1240.    typedef LISTIOL   *PLISTIOL;
  1241.  
  1242. #ifdef __cplusplus
  1243.    APIRET APIENTRY  DosOpen(PCSZ     pszFileName,
  1244.                             PHFILE pHf,
  1245.                             PULONG pulAction,
  1246.                             ULONG  cbFile,
  1247.                             ULONG  ulAttribute,
  1248.                             ULONG  fsOpenFlags,
  1249.                             ULONG  fsOpenMode,
  1250.                             PEAOP2 peaop2);
  1251. #else
  1252.    APIRET APIENTRY  DosOpen(PSZ    pszFileName,
  1253.                             PHFILE pHf,
  1254.                             PULONG pulAction,
  1255.                             ULONG  cbFile,
  1256.                             ULONG  ulAttribute,
  1257.                             ULONG  fsOpenFlags,
  1258.                             ULONG  fsOpenMode,
  1259.                             PEAOP2 peaop2);
  1260. #endif
  1261.  
  1262.    /* Large File Support > 2GB */
  1263. #ifdef __cplusplus
  1264.    APIRET APIENTRY DosOpenL(PCSZ  pszFileName,
  1265.                             PHFILE phf,
  1266.                             PULONG pulAction,
  1267.                             LONGLONG cbFile,
  1268.                             ULONG ulAttribute,
  1269.                             ULONG fsOpenFlags,
  1270.                             ULONG fsOpenMode,
  1271.                             PEAOP2 peaop2);
  1272. #else
  1273.    APIRET APIENTRY DosOpenL(PSZ pszFileName,
  1274.                             PHFILE phf,
  1275.                             PULONG pulAction,
  1276.                             LONGLONG cbFile,
  1277.                             ULONG ulAttribute,
  1278.                             ULONG fsOpenFlags,
  1279.                             ULONG fsOpenMode,
  1280.                             PEAOP2 peaop2);
  1281. #endif
  1282.  
  1283. #ifdef __cplusplus
  1284.    APIRET APIENTRY  DosProtectOpen(PCSZ  pszFileName,
  1285.                                    PHFILE phf,
  1286.                                    PULONG pulAction,
  1287.                                    ULONG cbFile,
  1288.                                    ULONG ulAttribute,
  1289.                                    ULONG fsOpenFlags,
  1290.                                    ULONG fsOpenMode,
  1291.                                    PEAOP2 peaop2,
  1292.                                    PFHLOCK pfhFileHandleLockID);
  1293. #else
  1294.    APIRET APIENTRY  DosProtectOpen(PSZ pszFileName,
  1295.                                    PHFILE phf,
  1296.                                    PULONG pulAction,
  1297.                                    ULONG cbFile,
  1298.                                    ULONG ulAttribute,
  1299.                                    ULONG fsOpenFlags,
  1300.                                    ULONG fsOpenMode,
  1301.                                    PEAOP2 peaop2,
  1302.                                    PFHLOCK pfhFileHandleLockID);
  1303. #endif
  1304.  
  1305.    /* Large File Support >2GB */
  1306. #ifdef __cplusplus
  1307.    APIRET APIENTRY  DosProtectOpenL(PCSZ  pszFileName,
  1308.                                     PHFILE phf,
  1309.                                     PULONG pulAction,
  1310.                                     LONGLONG cbFile,
  1311.                                     ULONG ulAttribute,
  1312.                                     ULONG fsOpenFlags,
  1313.                                     ULONG fsOpenMode,
  1314.                                     PEAOP2 peaop2,
  1315.                                     PFHLOCK pfhFileHandleLockID);
  1316. #else
  1317.    APIRET APIENTRY  DosProtectOpenL(PSZ pszFileName,
  1318.                                     PHFILE phf,
  1319.                                     PULONG pulAction,
  1320.                                     LONGLONG cbFile,
  1321.                                     ULONG ulAttribute,
  1322.                                     ULONG fsOpenFlags,
  1323.                                     ULONG fsOpenMode,
  1324.                                     PEAOP2 peaop2,
  1325.                                     PFHLOCK pfhFileHandleLockID);
  1326. #endif
  1327.  
  1328.    APIRET APIENTRY  DosClose(HFILE hFile);
  1329.  
  1330.    APIRET APIENTRY  DosProtectClose(HFILE hFile,
  1331.                                     FHLOCK fhFileHandleLockID);
  1332.  
  1333.    APIRET APIENTRY  DosRead(HFILE hFile,
  1334.                             PVOID pBuffer,
  1335.                             ULONG cbRead,
  1336.                             PULONG pcbActual);
  1337.  
  1338.    APIRET APIENTRY  DosProtectRead(HFILE hFile,
  1339.                                    PVOID pBuffer,
  1340.                                    ULONG cbRead,
  1341.                                    PULONG pcbActual,
  1342.                                    FHLOCK fhFileHandleLockID);
  1343.  
  1344.    APIRET APIENTRY  DosWrite(HFILE hFile,
  1345.                              PVOID pBuffer,
  1346.                              ULONG cbWrite,
  1347.                              PULONG pcbActual);
  1348.  
  1349.    APIRET APIENTRY  DosProtectWrite(HFILE hFile,
  1350.                                     PVOID pBuffer,
  1351.                                     ULONG cbWrite,
  1352.                                     PULONG pcbActual,
  1353.                                     FHLOCK fhFileHandleLockID);
  1354.  
  1355.    /* 154932 */
  1356.    APIRET  APIENTRY        DosListIO(ULONG ulCmdMode, ULONG ulNumentries,
  1357.                                            PLISTIO pListIO);
  1358.  
  1359.    /* File time and date types */
  1360.  
  1361.    typedef struct _FILESTATUS      /* fsts */
  1362.    {
  1363.       FDATE  fdateCreation;
  1364.       FTIME  ftimeCreation;
  1365.       FDATE  fdateLastAccess;
  1366.       FTIME  ftimeLastAccess;
  1367.       FDATE  fdateLastWrite;
  1368.       FTIME  ftimeLastWrite;
  1369.       ULONG  cbFile;
  1370.       ULONG  cbFileAlloc;
  1371.       USHORT attrFile;
  1372.    } FILESTATUS;
  1373.    typedef FILESTATUS *PFILESTATUS;
  1374.  
  1375.    typedef struct _FILESTATUS2     /* fsts2 */
  1376.    {
  1377.       FDATE  fdateCreation;
  1378.       FTIME  ftimeCreation;
  1379.       FDATE  fdateLastAccess;
  1380.       FTIME  ftimeLastAccess;
  1381.       FDATE  fdateLastWrite;
  1382.       FTIME  ftimeLastWrite;
  1383.       ULONG  cbFile;
  1384.       ULONG  cbFileAlloc;
  1385.       USHORT attrFile;
  1386.       ULONG  cbList;
  1387.    } FILESTATUS2;
  1388.    typedef FILESTATUS2 *PFILESTATUS2;
  1389.  
  1390.    typedef struct _FILESTATUS3     /* fsts3 */
  1391.    {
  1392.       FDATE  fdateCreation;
  1393.       FTIME  ftimeCreation;
  1394.       FDATE  fdateLastAccess;
  1395.       FTIME  ftimeLastAccess;
  1396.       FDATE  fdateLastWrite;
  1397.       FTIME  ftimeLastWrite;
  1398.       ULONG  cbFile;
  1399.       ULONG  cbFileAlloc;
  1400.       ULONG  attrFile;
  1401.    } FILESTATUS3;
  1402.    typedef FILESTATUS3 *PFILESTATUS3;
  1403.  
  1404.    typedef struct _FILESTATUS4      /* fsts4 */
  1405.    {
  1406.       FDATE  fdateCreation;
  1407.       FTIME  ftimeCreation;
  1408.       FDATE  fdateLastAccess;
  1409.       FTIME  ftimeLastAccess;
  1410.       FDATE  fdateLastWrite;
  1411.       FTIME  ftimeLastWrite;
  1412.       ULONG  cbFile;
  1413.       ULONG  cbFileAlloc;
  1414.       ULONG  attrFile;
  1415.       ULONG  cbList;
  1416.    } FILESTATUS4;
  1417.    typedef FILESTATUS4  *PFILESTATUS4;
  1418.  
  1419.  
  1420.    /* Large File Support >2GB */
  1421.    typedef struct _FILESTATUS3L     /* fsts3L */
  1422.    {
  1423.       FDATE    fdateCreation;
  1424.       FTIME    ftimeCreation;
  1425.       FDATE    fdateLastAccess;
  1426.       FTIME    ftimeLastAccess;
  1427.       FDATE    fdateLastWrite;
  1428.       FTIME    ftimeLastWrite;
  1429.       LONGLONG cbFile;
  1430.       LONGLONG cbFileAlloc;
  1431.       ULONG    attrFile;
  1432.    } FILESTATUS3L;
  1433.    typedef FILESTATUS3L *PFILESTATUS3L;
  1434.  
  1435.    /* Large File Support >2GB */
  1436.    typedef struct _FILESTATUS4L      /* fsts4L */
  1437.    {
  1438.       FDATE    fdateCreation;
  1439.       FTIME    ftimeCreation;
  1440.       FDATE    fdateLastAccess;
  1441.       FTIME    ftimeLastAccess;
  1442.       FDATE    fdateLastWrite;
  1443.       FTIME    ftimeLastWrite;
  1444.       LONGLONG cbFile;
  1445.       LONGLONG cbFileAlloc;
  1446.       ULONG    attrFile;
  1447.       ULONG    cbList;
  1448.    } FILESTATUS4L;
  1449.    typedef FILESTATUS4L  *PFILESTATUS4L;
  1450.  
  1451.  
  1452.    typedef struct _FSALLOCATE      /* fsalloc */
  1453.    {
  1454.       ULONG  idFileSystem;
  1455.       ULONG  cSectorUnit;
  1456.       ULONG  cUnit;
  1457.       ULONG  cUnitAvail;
  1458.       USHORT cbSector;
  1459.    } FSALLOCATE;
  1460.    typedef FSALLOCATE *PFSALLOCATE;
  1461.  
  1462.    typedef LHANDLE HDIR;        /* hdir */
  1463.    typedef HDIR    *PHDIR;
  1464.  
  1465.    #define DosOpen2        DosOpen
  1466.    #define DosFindFirst2   DosFindFirst
  1467.    #define DosQFHandState  DosQueryFHState
  1468.    #define DosProtectQFHandState  DosProtectQueryFHState
  1469.    #define DosSetFHandState  DosSetFHState
  1470.    #define DosProtectSetFHandState  DosProtectSetFHState
  1471.    #define DosQHandType    DosQueryHType
  1472.    #define DosQFSAttach    DosQueryFSAttach
  1473.    #define DosNewSize      DosSetFileSize
  1474.    #define DosProtectNewSize  DosProtectSetFileSize
  1475.    #define DosBufReset     DosResetBuffer
  1476.    #define DosChgFilePtr   DosSetFilePtr
  1477.    #define DosProtectChgFilePtr   DosProtectSetFilePtr
  1478.    #define DosMkDir        DosCreateDir
  1479.    #define DosMkDir2       DosCreateDir
  1480.    #define DosRmDir        DosDeleteDir
  1481.    #define DosSelectDisk   DosSetDefaultDisk
  1482.    #define DosQCurDisk     DosQueryCurrentDisk
  1483.    #define DosChDir        DosSetCurrentDir
  1484.    #define DosQCurDir      DosQueryCurrentDir
  1485.    #define DosQFSInfo      DosQueryFSInfo
  1486.    #define DosQVerify      DosQueryVerify
  1487.    #define DosQFileInfo    DosQueryFileInfo
  1488.    #define DosProtectQFileInfo    DosProtectQueryFileInfo
  1489.    #define DosQPathInfo    DosQueryPathInfo
  1490.  
  1491. #ifdef __cplusplus
  1492.    APIRET APIENTRY  DosDelete(PCSZ  pszFile);
  1493. #else
  1494.    APIRET APIENTRY  DosDelete(PSZ pszFile);
  1495. #endif
  1496.  
  1497. #ifdef __cplusplus
  1498.    APIRET APIENTRY  DosForceDelete(PCSZ  pszFile);
  1499. #else
  1500.    APIRET APIENTRY  DosForceDelete(PSZ pszFile);
  1501. #endif
  1502.  
  1503.    APIRET APIENTRY  DosDupHandle(HFILE hFile,
  1504.                                  PHFILE pHfile);
  1505.  
  1506.    APIRET APIENTRY  DosQueryFHState(HFILE hFile,
  1507.                                     PULONG pMode);
  1508.    APIRET APIENTRY  DosProtectQueryFHState(HFILE hFile,
  1509.                                            PULONG pMode,
  1510.                                            FHLOCK fhFileHandleLockID);
  1511.  
  1512.    APIRET APIENTRY  DosSetFHState(HFILE hFile,
  1513.                                   ULONG mode);
  1514.  
  1515.    APIRET APIENTRY  DosProtectSetFHState(HFILE hFile,
  1516.                                          ULONG mode,
  1517.                                          FHLOCK fhFileHandleLockID);
  1518.  
  1519.    APIRET APIENTRY  DosQueryHType(HFILE hFile,
  1520.                                   PULONG pType,
  1521.                                   PULONG pAttr);
  1522.  
  1523. #ifdef __cplusplus
  1524.    APIRET APIENTRY  DosFindFirst(PCSZ     pszFileSpec,
  1525.                                  PHDIR  phdir,
  1526.                                  ULONG  flAttribute,
  1527.                                  PVOID  pfindbuf,
  1528.                                  ULONG  cbBuf,
  1529.                                  PULONG pcFileNames,
  1530.                                  ULONG  ulInfoLevel);
  1531. #else
  1532.    APIRET APIENTRY  DosFindFirst(PSZ    pszFileSpec,
  1533.                                  PHDIR  phdir,
  1534.                                  ULONG  flAttribute,
  1535.                                  PVOID  pfindbuf,
  1536.                                  ULONG  cbBuf,
  1537.                                  PULONG pcFileNames,
  1538.                                  ULONG  ulInfoLevel);
  1539. #endif
  1540.  
  1541.    APIRET APIENTRY  DosFindNext(HDIR   hDir,
  1542.                                 PVOID  pfindbuf,
  1543.                                 ULONG  cbfindbuf,
  1544.                                 PULONG pcFilenames);
  1545.  
  1546.    APIRET APIENTRY  DosFindClose(HDIR hDir);
  1547.  
  1548. #ifdef __cplusplus
  1549.    APIRET APIENTRY  DosFSAttach(PCSZ  pszDevice,
  1550.                                 PCSZ  pszFilesystem,
  1551.                                 PVOID pData,
  1552.                                 ULONG cbData,
  1553.                                 ULONG flag);
  1554. #else
  1555.    APIRET APIENTRY  DosFSAttach(PSZ pszDevice,
  1556.                                 PSZ pszFilesystem,
  1557.                                 PVOID pData,
  1558.                                 ULONG cbData,
  1559.                                 ULONG flag);
  1560. #endif
  1561.  
  1562. #ifdef __cplusplus
  1563.    APIRET APIENTRY  DosQueryFSAttach(PCSZ     pszDeviceName,
  1564.                                      ULONG  ulOrdinal,
  1565.                                      ULONG  ulFSAInfoLevel,
  1566.                                      PFSQBUFFER2 pfsqb,
  1567.                                      PULONG pcbBuffLength);
  1568. #else
  1569.    APIRET APIENTRY  DosQueryFSAttach(PSZ    pszDeviceName,
  1570.                                      ULONG  ulOrdinal,
  1571.                                      ULONG  ulFSAInfoLevel,
  1572.                                      PFSQBUFFER2 pfsqb,
  1573.                                      PULONG pcbBuffLength);
  1574. #endif
  1575.  
  1576. #ifdef __cplusplus
  1577.    APIRET APIENTRY  DosFSCtl(PVOID pData,
  1578.                              ULONG cbData,
  1579.                              PULONG pcbData,
  1580.                              PVOID pParms,
  1581.                              ULONG cbParms,
  1582.                              PULONG pcbParms,
  1583.                              ULONG function,
  1584.                              PCSZ  pszRoute,
  1585.                              HFILE hFile,
  1586.                              ULONG method);
  1587. #else
  1588.    APIRET APIENTRY  DosFSCtl(PVOID pData,
  1589.                              ULONG cbData,
  1590.                              PULONG pcbData,
  1591.                              PVOID pParms,
  1592.                              ULONG cbParms,
  1593.                              PULONG pcbParms,
  1594.                              ULONG function,
  1595.                              PSZ pszRoute,
  1596.                              HFILE hFile,
  1597.                              ULONG method);
  1598. #endif
  1599.  
  1600.    APIRET APIENTRY  DosSetFileSize(HFILE hFile,
  1601.                                    ULONG cbSize);
  1602.  
  1603.    /* Large File Support >2GB */
  1604.    APIRET APIENTRY  DosSetFileSizeL(HFILE hFile,
  1605.                                     LONGLONG cbSize);
  1606.  
  1607.    APIRET APIENTRY  DosProtectSetFileSize(HFILE hFile,
  1608.                                           ULONG cbSize,
  1609.                                           FHLOCK fhFileHandleLockID);
  1610.  
  1611.    /* Large File Support >2GB */
  1612.    APIRET APIENTRY   DosProtectSetFileSizeL(HFILE hFile,
  1613.                                             LONGLONG cbSize,
  1614.                                             FHLOCK fhFileHandleLockID);
  1615.  
  1616.    APIRET APIENTRY  DosResetBuffer(HFILE hFile);
  1617.  
  1618.    APIRET APIENTRY  DosSetFilePtr(HFILE hFile,
  1619.                                   LONG ib,
  1620.                                   ULONG method,
  1621.                                   PULONG ibActual);
  1622.  
  1623.    /* Large File Support >2GB */
  1624.    APIRET APIENTRY  DosSetFilePtrL(HFILE hFile,
  1625.                                    LONGLONG ib,
  1626.                                    ULONG method,
  1627.                                    PLONGLONG ibActual);
  1628.  
  1629.    APIRET APIENTRY  DosProtectSetFilePtr(HFILE hFile,
  1630.                                          LONG ib,
  1631.                                          ULONG method,
  1632.                                          PULONG ibActual,
  1633.                                          FHLOCK fhFileHandleLockID);
  1634.  
  1635.    /* Large File Support >2GB */
  1636.    APIRET APIENTRY  DosProtectSetFilePtrL(HFILE hFile,
  1637.                                           LONGLONG ib,
  1638.                                           ULONG method,
  1639.                                           PLONGLONG ibActual,
  1640.                                           FHLOCK fhFileHandleLockID);
  1641.  
  1642.    /* Large File Support >2GB */
  1643.    APIRET APIENTRY  DosListIOL(LONG CmdMODE,
  1644.                                LONG NumEntries,
  1645.                                VOID * pListIO);
  1646.  
  1647. #ifdef __cplusplus
  1648.    APIRET APIENTRY  DosMove(PCSZ  pszOld,
  1649.                             PCSZ  pszNew);
  1650. #else
  1651.    APIRET APIENTRY  DosMove(PSZ pszOld,
  1652.                             PSZ pszNew);
  1653. #endif
  1654.  
  1655. #ifdef __cplusplus
  1656.    APIRET APIENTRY  DosCopy(PCSZ  pszOld,
  1657.                             PCSZ  pszNew,
  1658.                             ULONG option);
  1659. #else
  1660.    APIRET APIENTRY  DosCopy(PSZ pszOld,
  1661.                             PSZ pszNew,
  1662.                             ULONG option);
  1663. #endif
  1664.  
  1665. #ifdef __cplusplus
  1666.    APIRET APIENTRY  DosEditName(ULONG metalevel,
  1667.                                 PCSZ  pszSource,
  1668.                                 PCSZ  pszEdit,
  1669.                                 PBYTE pszTarget,
  1670.                                 ULONG cbTarget);
  1671. #else
  1672.    APIRET APIENTRY  DosEditName(ULONG metalevel,
  1673.                                 PSZ pszSource,
  1674.                                 PSZ pszEdit,
  1675.                                 PBYTE pszTarget,
  1676.                                 ULONG cbTarget);
  1677. #endif
  1678.  
  1679. #ifdef __cplusplus
  1680.    APIRET APIENTRY  DosCreateDir(PCSZ  pszDirName,
  1681.                                  PEAOP2 peaop2);
  1682. #else
  1683.    APIRET APIENTRY  DosCreateDir(PSZ pszDirName,
  1684.                                  PEAOP2 peaop2);
  1685. #endif
  1686.  
  1687. #ifdef __cplusplus
  1688.    APIRET APIENTRY  DosDeleteDir(PCSZ  pszDir);
  1689. #else
  1690.    APIRET APIENTRY  DosDeleteDir(PSZ pszDir);
  1691. #endif
  1692.  
  1693.    APIRET APIENTRY  DosSetDefaultDisk(ULONG disknum);
  1694.  
  1695.    APIRET APIENTRY  DosQueryCurrentDisk(PULONG pdisknum,
  1696.                                         PULONG plogical);
  1697.  
  1698. #ifdef __cplusplus
  1699.    APIRET APIENTRY  DosSetCurrentDir(PCSZ  pszDir);
  1700. #else
  1701.    APIRET APIENTRY  DosSetCurrentDir(PSZ pszDir);
  1702. #endif
  1703.  
  1704.    APIRET APIENTRY  DosQueryCurrentDir(ULONG disknum,
  1705.                                        PBYTE pBuf,
  1706.                                        PULONG pcbBuf);
  1707.  
  1708.    APIRET APIENTRY  DosQueryFSInfo(ULONG disknum,
  1709.                                    ULONG infolevel,
  1710.                                    PVOID pBuf,
  1711.                                    ULONG cbBuf);
  1712.  
  1713.    APIRET APIENTRY  DosSetFSInfo(ULONG disknum,
  1714.                                  ULONG infolevel,
  1715.                                  PVOID pBuf,
  1716.                                  ULONG cbBuf);
  1717.  
  1718.    APIRET APIENTRY  DosQueryVerify(PBOOL32 pBool);
  1719.  
  1720.    APIRET APIENTRY  DosSetVerify(BOOL32);
  1721.  
  1722.    APIRET APIENTRY  DosSetMaxFH(ULONG cFH);
  1723.  
  1724.    APIRET APIENTRY  DosSetRelMaxFH(PLONG pcbReqCount,
  1725.                                    PULONG pcbCurMaxFH);
  1726.  
  1727.    APIRET APIENTRY  DosQueryFileInfo(HFILE hf,
  1728.                                      ULONG ulInfoLevel,
  1729.                                      PVOID pInfo,
  1730.                                      ULONG cbInfoBuf);
  1731.  
  1732.    APIRET APIENTRY  DosProtectQueryFileInfo(HFILE hf,
  1733.                                             ULONG ulInfoLevel,
  1734.                                             PVOID pInfo,
  1735.                                             ULONG cbInfoBuf,
  1736.                                             FHLOCK fhFileHandleLockID);
  1737.  
  1738.    APIRET APIENTRY  DosSetFileInfo(HFILE hf,
  1739.                                    ULONG ulInfoLevel,
  1740.                                    PVOID pInfoBuf,
  1741.                                    ULONG cbInfoBuf);
  1742.  
  1743.    APIRET APIENTRY  DosProtectSetFileInfo(HFILE hf,
  1744.                                           ULONG ulInfoLevel,
  1745.                                           PVOID pInfoBuf,
  1746.                                           ULONG cbInfoBuf,
  1747.                                           FHLOCK fhFileHandleLockID);
  1748.  
  1749. #ifdef __cplusplus
  1750.    APIRET APIENTRY  DosQueryPathInfo(PCSZ    pszPathName,
  1751.                                      ULONG ulInfoLevel,
  1752.                                      PVOID pInfoBuf,
  1753.                                      ULONG cbInfoBuf);
  1754. #else
  1755.    APIRET APIENTRY  DosQueryPathInfo(PSZ   pszPathName,
  1756.                                      ULONG ulInfoLevel,
  1757.                                      PVOID pInfoBuf,
  1758.                                      ULONG cbInfoBuf);
  1759. #endif
  1760.  
  1761. #ifdef __cplusplus
  1762.    APIRET APIENTRY  DosSetPathInfo(PCSZ    pszPathName,
  1763.                                    ULONG ulInfoLevel,
  1764.                                    PVOID pInfoBuf,
  1765.                                    ULONG cbInfoBuf,
  1766.                                    ULONG flOptions);
  1767. #else
  1768.    APIRET APIENTRY  DosSetPathInfo(PSZ   pszPathName,
  1769.                                    ULONG ulInfoLevel,
  1770.                                    PVOID pInfoBuf,
  1771.                                    ULONG cbInfoBuf,
  1772.                                    ULONG flOptions);
  1773. #endif
  1774.  
  1775.    /* defines for DosSetPathInfo -pathinfo flag */
  1776.    #define DSPI_WRTTHRU    0x10    /* write through */
  1777.  
  1778.    APIRET APIENTRY  DosShutdown(ULONG ulReserved);
  1779.  
  1780.    APIRET APIENTRY  DosEnumAttribute(ULONG  ulRefType,
  1781.                                      PVOID  pvFile,
  1782.                                      ULONG  ulEntry,
  1783.                                      PVOID  pvBuf,
  1784.                                      ULONG  cbBuf,
  1785.                                      PULONG pulCount,
  1786.                                      ULONG  ulInfoLevel);
  1787.  
  1788.    APIRET APIENTRY  DosProtectEnumAttribute(ULONG ulRefType,
  1789.                                             PVOID pvFile,
  1790.                                             ULONG ulEntry,
  1791.                                             PVOID pvBuf,
  1792.                                             ULONG cbBuf,
  1793.                                             PULONG pulCount,
  1794.                                             ULONG ulInfoLevel,
  1795.                                             FHLOCK fhFileHandleLockID );
  1796.  
  1797.    /*NOINC*/
  1798.    #pragma pack(1)
  1799.    /*INC */
  1800.  
  1801.    typedef struct _DENA1 /* _dena1 level 1 info returned from DosEnumAttribute */
  1802.    {
  1803.       UCHAR       reserved;       /* 0 */
  1804.       UCHAR       cbName;         /* length of name exculding NULL */
  1805.       USHORT      cbValue;        /* length of value */
  1806.       UCHAR       szName[1];      /* variable length asciiz name */
  1807.    } DENA1;
  1808.    typedef DENA1 *PDENA1;
  1809.  
  1810.    typedef FEA2  DENA2;
  1811.    typedef PFEA2 PDENA2;
  1812.  
  1813.    /*NOINC*/
  1814.    #pragma pack()
  1815.    /*INC */
  1816.    /* Infolevels for DosEnumAttribute  */
  1817.    #define ENUMEA_LEVEL_NO_VALUE   1L      /* FEA without value */
  1818.    /* Reference types for DosEnumAttribute */
  1819.    #define ENUMEA_REFTYPE_FHANDLE  0       /* file handle */
  1820.    #define ENUMEA_REFTYPE_PATH     1       /* path name */
  1821.    #define ENUMEA_REFTYPE_MAX      ENUMEA_REFTYPE_PATH
  1822.  
  1823. #endif /* common INCL_DOSFILEMGR */
  1824.  
  1825. #if (defined(INCL_DOSMEMMGR) || !defined(INCL_NOCOMMON))
  1826.    /*** Memory management */
  1827.  
  1828.    APIRET  APIENTRY DosAliasMem(PVOID pb,
  1829.                                 ULONG cb,
  1830.                                 PPVOID ppbAlias,
  1831.                                 ULONG fl);
  1832.  
  1833.    APIRET  APIENTRY DosQueryMemState(PVOID pb,
  1834.                                      PULONG cb,
  1835.                                      PULONG pFlag);
  1836.  
  1837.    APIRET APIENTRY  DosAllocMem(PPVOID ppb,
  1838.                                 ULONG cb,
  1839.                                 ULONG flag);
  1840.  
  1841.    APIRET APIENTRY  DosFreeMem(PVOID pb);
  1842.  
  1843.    APIRET APIENTRY  DosSetMem(PVOID pb,
  1844.                               ULONG cb,
  1845.                               ULONG flag);
  1846.  
  1847.    APIRET APIENTRY  DosGiveSharedMem(PVOID pb,
  1848.                                      PID pid,
  1849.                                      ULONG flag);
  1850.  
  1851.    APIRET APIENTRY  DosGetSharedMem(PVOID pb,
  1852.                                     ULONG flag);
  1853.  
  1854. #ifdef __cplusplus
  1855.    APIRET APIENTRY  DosGetNamedSharedMem(PPVOID ppb,
  1856.                                          PCSZ  pszName,
  1857.                                          ULONG flag);
  1858. #else
  1859.    APIRET APIENTRY  DosGetNamedSharedMem(PPVOID ppb,
  1860.                                          PSZ pszName,
  1861.                                          ULONG flag);
  1862. #endif
  1863.  
  1864. #ifdef __cplusplus
  1865.    APIRET APIENTRY  DosAllocSharedMem(PPVOID ppb,
  1866.                                       PCSZ  pszName,
  1867.                                       ULONG cb,
  1868.                                       ULONG flag);
  1869. #else
  1870.    APIRET APIENTRY  DosAllocSharedMem(PPVOID ppb,
  1871.                                       PSZ pszName,
  1872.                                       ULONG cb,
  1873.                                       ULONG flag);
  1874. #endif
  1875.  
  1876.    APIRET APIENTRY  DosQueryMem(PVOID pb,
  1877.                                 PULONG pcb,
  1878.                                 PULONG pFlag);
  1879.  
  1880.    #define DosSubAlloc     DosSubAllocMem
  1881.    #define DOSSUBALLOC     DosSubAllocMem
  1882.    APIRET APIENTRY  DosSubAllocMem(PVOID pbBase,
  1883.                                    PPVOID ppb,
  1884.                                    ULONG cb);
  1885.  
  1886.    #define DosSubFree      DosSubFreeMem
  1887.    #define DOSSUBFREE      DosSubFreeMem
  1888.    APIRET APIENTRY  DosSubFreeMem(PVOID pbBase,
  1889.                                   PVOID pb,
  1890.                                   ULONG cb);
  1891.  
  1892.    #define DosSubSet       DosSubSetMem
  1893.    #define DOSSUBSET       DosSubSetMem
  1894.    APIRET APIENTRY  DosSubSetMem(PVOID pbBase,
  1895.                                  ULONG flag,
  1896.                                  ULONG cb);
  1897.  
  1898.    #define DosSubUnset     DosSubUnsetMem
  1899.    #define DOSSUBUNSET     DosSubUnsetMem
  1900.    APIRET APIENTRY  DosSubUnsetMem(PVOID pbBase);
  1901.  
  1902.    #include <bsememf.h>    /* get flags for API                            */
  1903.  
  1904. #endif /* INCL_DOSMEMMGR */
  1905.  
  1906.  
  1907.  
  1908. #if (defined(INCL_DOSSEMAPHORES) || !defined(INCL_NOCOMMON))
  1909.  
  1910.    /*
  1911.    *     32-bit Semaphore Support
  1912.    */
  1913.  
  1914.    /* Semaphore Attributes */
  1915.  
  1916.    #define DC_SEM_SHARED   0x01   /* DosCreateMutex, DosCreateEvent, and     */
  1917.                                   /*   DosCreateMuxWait use it to indicate   */
  1918.                                   /*   whether the semaphore is shared or    */
  1919.                                   /*   private when the PSZ is null          */
  1920.    #define DCMW_WAIT_ANY   0x02   /* DosCreateMuxWait option for wait on any */
  1921.                                   /*   event/mutex to occur                  */
  1922.    #define DCMW_WAIT_ALL   0x04   /* DosCreateMuxWait option for wait on all */
  1923.                                   /*   events/mutexs to occur                */
  1924.   #define DCE_AUTORESET   0x1000  /* DosCreateEventSem option to auto-reset  */
  1925.                                   /* event semaphore on post.                */
  1926.   #define DCE_POSTONE     0x0800  /* DosCreateEventSem option to post only   */
  1927.                                   /* waiter and auto-reset the semaphore when*/
  1928.                                   /* there are multiple waiters.             */
  1929.  
  1930.  
  1931.    #define SEM_INDEFINITE_WAIT     -1L
  1932.    #define SEM_IMMEDIATE_RETURN     0L
  1933.  
  1934.    #ifndef __HSEM__
  1935. /* NOINC */
  1936.       #define __HSEM__
  1937.       typedef ULONG HSEM;
  1938.       typedef HSEM *PHSEM;
  1939. /* INC */
  1940.    #endif
  1941.  
  1942.    typedef struct _PSEMRECORD      /* psr */
  1943.    {
  1944.       HSEM        hsemCur;
  1945.       ULONG       ulUser;
  1946.    } SEMRECORD;
  1947.    typedef SEMRECORD *PSEMRECORD;
  1948.  
  1949. #endif /* common INCL_DOSSEMAPHORES */
  1950.  
  1951.  
  1952.  
  1953. #ifdef INCL_DOSSEMAPHORES
  1954.  
  1955.    #ifndef __HEV__            /* INCL_SEMAPHORE may also define HEV */
  1956.       #define __HEV__
  1957.       typedef  ULONG    HEV;             /* hev */
  1958.       typedef  HEV      *PHEV;
  1959.    #endif
  1960.  
  1961.    typedef  ULONG    HMTX;            /* hmtx */
  1962.    typedef  HMTX     *PHMTX;
  1963.    typedef  ULONG    HMUX;            /* hmux */
  1964.    typedef  HMUX     *PHMUX;
  1965.  
  1966. #ifdef __cplusplus
  1967.    APIRET APIENTRY  DosCreateEventSem (PCSZ  pszName,
  1968.                                        PHEV phev,
  1969.                                        ULONG flAttr,
  1970.                                        BOOL32 fState);
  1971. #else
  1972.    APIRET APIENTRY  DosCreateEventSem (PSZ pszName,
  1973.                                        PHEV phev,
  1974.                                        ULONG flAttr,
  1975.                                        BOOL32 fState);
  1976. #endif
  1977.  
  1978. #ifdef __cplusplus
  1979.    APIRET APIENTRY  DosOpenEventSem (PCSZ  pszName,
  1980.                                      PHEV phev);
  1981. #else
  1982.    APIRET APIENTRY  DosOpenEventSem (PSZ pszName,
  1983.                                      PHEV phev);
  1984. #endif
  1985.  
  1986.    APIRET APIENTRY  DosCloseEventSem (HEV hev);
  1987.  
  1988.    APIRET APIENTRY  DosResetEventSem (HEV hev,
  1989.                                       PULONG pulPostCt);
  1990.  
  1991.    APIRET APIENTRY  DosPostEventSem (HEV hev);
  1992.  
  1993.    APIRET APIENTRY  DosWaitEventSem (HEV hev,
  1994.                                      ULONG ulTimeout);
  1995.  
  1996.    APIRET APIENTRY  DosQueryEventSem (HEV hev,
  1997.                                       PULONG pulPostCt);
  1998.  
  1999. #ifdef __cplusplus
  2000.    APIRET APIENTRY  DosCreateMutexSem (PCSZ  pszName,
  2001.                                        PHMTX phmtx,
  2002.                                        ULONG flAttr,
  2003.                                        BOOL32 fState);
  2004. #else
  2005.    APIRET APIENTRY  DosCreateMutexSem (PSZ pszName,
  2006.                                        PHMTX phmtx,
  2007.                                        ULONG flAttr,
  2008.                                        BOOL32 fState);
  2009. #endif
  2010.  
  2011. #ifdef __cplusplus
  2012.    APIRET APIENTRY  DosOpenMutexSem (PCSZ  pszName,
  2013.                                      PHMTX phmtx);
  2014. #else
  2015.    APIRET APIENTRY  DosOpenMutexSem (PSZ pszName,
  2016.                                      PHMTX phmtx);
  2017. #endif
  2018.  
  2019.    APIRET APIENTRY  DosCloseMutexSem (HMTX hmtx);
  2020.  
  2021.    APIRET APIENTRY  DosRequestMutexSem (HMTX hmtx,
  2022.                                         ULONG ulTimeout);
  2023.  
  2024.    APIRET APIENTRY  DosReleaseMutexSem (HMTX hmtx);
  2025.  
  2026.    APIRET APIENTRY  DosQueryMutexSem (HMTX hmtx,
  2027.                                       PID *ppid,
  2028.                                       TID *ptid,
  2029.                                       PULONG pulCount);
  2030.  
  2031. #ifdef __cplusplus
  2032.    APIRET APIENTRY  DosCreateMuxWaitSem (PCSZ  pszName,
  2033.                                          PHMUX phmux,
  2034.                                          ULONG cSemRec,
  2035.                                          PSEMRECORD pSemRec,
  2036.                                          ULONG flAttr);
  2037. #else
  2038.    APIRET APIENTRY  DosCreateMuxWaitSem (PSZ pszName,
  2039.                                          PHMUX phmux,
  2040.                                          ULONG cSemRec,
  2041.                                          PSEMRECORD pSemRec,
  2042.                                          ULONG flAttr);
  2043. #endif
  2044.  
  2045. #ifdef __cplusplus
  2046.    APIRET APIENTRY  DosOpenMuxWaitSem (PCSZ  pszName,
  2047.                                        PHMUX phmux);
  2048. #else
  2049.    APIRET APIENTRY  DosOpenMuxWaitSem (PSZ pszName,
  2050.                                        PHMUX phmux);
  2051. #endif
  2052.  
  2053.    APIRET APIENTRY  DosCloseMuxWaitSem (HMUX hmux);
  2054.  
  2055.    APIRET APIENTRY  DosWaitMuxWaitSem (HMUX hmux,
  2056.                                        ULONG ulTimeout,
  2057.                                        PULONG pulUser);
  2058.  
  2059.    APIRET APIENTRY  DosAddMuxWaitSem (HMUX hmux,
  2060.                                       PSEMRECORD pSemRec);
  2061.  
  2062.    APIRET APIENTRY  DosDeleteMuxWaitSem (HMUX hmux,
  2063.                                          HSEM hSem);
  2064.  
  2065.    APIRET APIENTRY  DosQueryMuxWaitSem (HMUX hmux,
  2066.                                         PULONG pcSemRec,
  2067.                                         PSEMRECORD pSemRec,
  2068.                                         PULONG pflAttr);
  2069.  
  2070. #endif /* INCL_DOSSEMAPHORES */
  2071.  
  2072.  
  2073.  
  2074. #if (defined(INCL_DOSDATETIME) || !defined(INCL_NOCOMMON))
  2075.  
  2076.    /*** Time support */
  2077.  
  2078.    typedef struct _DATETIME      /* date */
  2079.    {
  2080.       UCHAR   hours;
  2081.       UCHAR   minutes;
  2082.       UCHAR   seconds;
  2083.       UCHAR   hundredths;
  2084.       UCHAR   day;
  2085.       UCHAR   month;
  2086.       USHORT  year;
  2087.       SHORT   timezone;
  2088.       UCHAR   weekday;
  2089.    } DATETIME;
  2090.    typedef DATETIME *PDATETIME;
  2091.  
  2092.    APIRET APIENTRY   DosGetDateTime(PDATETIME pdt);
  2093.  
  2094.    APIRET APIENTRY   DosSetDateTime(PDATETIME pdt);
  2095.  
  2096. #endif /* common INCL_DOSDATETIME */
  2097.  
  2098.  
  2099.  
  2100. #ifdef INCL_DOSDATETIME
  2101.  
  2102.    #define DosTimerAsync   DosAsyncTimer
  2103.    #define DosTimerStart   DosStartTimer
  2104.    #define DosTimerStop    DosStopTimer
  2105.  
  2106.    typedef LHANDLE HTIMER;
  2107.    typedef HTIMER  *PHTIMER;
  2108.  
  2109.    APIRET APIENTRY   DosAsyncTimer(ULONG msec,
  2110.                                    HSEM hsem,
  2111.                                    PHTIMER phtimer);
  2112.  
  2113.    APIRET APIENTRY   DosStartTimer(ULONG msec,
  2114.                                    HSEM hsem,
  2115.                                    PHTIMER phtimer);
  2116.  
  2117.    APIRET APIENTRY   DosStopTimer(HTIMER htimer);
  2118.  
  2119. #endif /* INCL_DOSDATETIME */
  2120.  
  2121.  
  2122.  
  2123.  
  2124. /*** Module manager */
  2125.  
  2126. #ifdef INCL_DOSMODULEMGR
  2127.  
  2128.  
  2129. #ifdef __cplusplus
  2130.    APIRET APIENTRY  DosLoadModule(PCSZ  pszName,
  2131.                                   ULONG cbName,
  2132.                                   PCSZ  pszModname,
  2133.                                   PHMODULE phmod);
  2134. #else
  2135.    APIRET APIENTRY  DosLoadModule(PSZ pszName,
  2136.                                   ULONG cbName,
  2137.                                   PSZ pszModname,
  2138.                                   PHMODULE phmod);
  2139. #endif
  2140.  
  2141.    APIRET APIENTRY  DosFreeModule(HMODULE hmod);
  2142.  
  2143. #ifdef __cplusplus
  2144.    APIRET APIENTRY  DosQueryProcAddr(HMODULE hmod,
  2145.                                      ULONG ordinal,
  2146.                                      PCSZ  pszName,
  2147.                                      PFN* ppfn);
  2148. #else
  2149.    APIRET APIENTRY  DosQueryProcAddr(HMODULE hmod,
  2150.                                      ULONG ordinal,
  2151.                                      PSZ pszName,
  2152.                                      PFN* ppfn);
  2153. #endif
  2154.  
  2155. #ifdef __cplusplus
  2156.    APIRET APIENTRY  DosQueryModuleHandle(PCSZ  pszModname,
  2157.                                          PHMODULE phmod);
  2158. #else
  2159.    APIRET APIENTRY  DosQueryModuleHandle(PSZ pszModname,
  2160.                                          PHMODULE phmod);
  2161. #endif
  2162.  
  2163.    APIRET APIENTRY  DosQueryModuleName(HMODULE hmod,
  2164.                                        ULONG cbName,
  2165.                                        PCHAR pch);
  2166.  
  2167.    #define PT_16BIT        0
  2168.    #define PT_32BIT        1
  2169.  
  2170. #ifdef __cplusplus
  2171.    APIRET APIENTRY  DosQueryProcType(HMODULE hmod,
  2172.                                      ULONG ordinal,
  2173.                                      PCSZ  pszName,
  2174.                                      PULONG pulproctype);
  2175. #else
  2176.    APIRET APIENTRY  DosQueryProcType(HMODULE hmod,
  2177.                                      ULONG ordinal,
  2178.                                      PSZ pszName,
  2179.                                      PULONG pulproctype);
  2180. #endif
  2181.  
  2182.    APIRET APIENTRY  DosQueryModFromEIP(HMODULE *phMod,
  2183.                                         ULONG *pObjNum,
  2184.                                         ULONG BuffLen,
  2185.                                         PCHAR pBuff,
  2186.                                         ULONG *pOffset,
  2187.                                         ULONG Address);
  2188.  
  2189.    #define HW_CFG_MCA              0x00000001
  2190.    #define HW_CFG_EISA             0x00000002
  2191.    #define HW_CFG_ABIOS_SUPPORTED  0x00000004
  2192.    #define HW_CFG_ABIOS_PRESENT    0x00000008
  2193.    #define HW_CFG_PCI              0x00000010
  2194.    #define HW_CFG_IBM_ABIOS        0x00000000  /* OEM flag is OFF, ABIOS is IBM */
  2195.    #define HW_CFG_OEM_ABIOS        0x00000020
  2196.    #define HW_CFG_PENTIUM_CPU      0x00000040
  2197.  
  2198.    APIRET  APIENTRY DosQueryABIOSSupport(ULONG reserved);
  2199.  
  2200. #ifdef __cplusplus
  2201.    APIRET  APIENTRY DosReplaceModule(PCSZ  pszOldModule,
  2202.                                      PCSZ  pszNewModule,
  2203.                                      PCSZ  pszBackupModule);
  2204. #else
  2205.    APIRET  APIENTRY DosReplaceModule(PSZ pszOldModule,
  2206.                                      PSZ pszNewModule,
  2207.                                      PSZ pszBackupModule);
  2208. #endif
  2209.  
  2210. #if __IBMC__ || __IBMCPP__
  2211.    /* structure returned by DosQueryModFromCS */
  2212.  
  2213.    typedef struct _QMRESULT { /* qmres */
  2214.       USHORT seg;
  2215.       USHORT hmte;
  2216.       char   name[CCHMAXPATH];
  2217.    } QMRESULT;
  2218.    typedef QMRESULT * PQMRESULT;
  2219.  
  2220.  
  2221.    APIRET16 APIENTRY16 Dos16QueryModFromCS(SEL, PQMRESULT);
  2222. #endif
  2223.  
  2224. #endif /* INCL_DOSMODULEMGR */
  2225.  
  2226.  
  2227.  
  2228. #if (defined(INCL_DOSRESOURCES) || !defined(INCL_NOCOMMON))
  2229.  
  2230.    /*** Resource support */
  2231.  
  2232.    /* Predefined resource types */
  2233.  
  2234.    #define RT_POINTER      1   /* mouse pointer shape */
  2235.    #define RT_BITMAP       2   /* bitmap */
  2236.    #define RT_MENU         3   /* menu template */
  2237.    #define RT_DIALOG       4   /* dialog template */
  2238.    #define RT_STRING       5   /* string tables */
  2239.    #define RT_FONTDIR      6   /* font directory */
  2240.    #define RT_FONT         7   /* font */
  2241.    #define RT_ACCELTABLE   8   /* accelerator tables */
  2242.    #define RT_RCDATA       9   /* binary data */
  2243.    #define RT_MESSAGE      10  /* error msg     tables */
  2244.    #define RT_DLGINCLUDE   11  /* dialog include file name */
  2245.    #define RT_VKEYTBL      12  /* key to vkey tables */
  2246.    #define RT_KEYTBL       13  /* key to UGL tables */
  2247.    #define RT_CHARTBL      14  /* glyph to character tables */
  2248.    #define RT_DISPLAYINFO  15  /* screen display information */
  2249.  
  2250.    #define RT_FKASHORT     16  /* function key area short form */
  2251.    #define RT_FKALONG      17  /* function key area long form */
  2252.  
  2253.    #define RT_HELPTABLE    18  /* Help table for Cary Help manager */
  2254.    #define RT_HELPSUBTABLE 19  /* Help subtable for Cary Help manager */
  2255.  
  2256.    #define RT_FDDIR        20  /* DBCS uniq/font driver directory */
  2257.    #define RT_FD           21  /* DBCS uniq/font driver */
  2258.  
  2259.    #define RT_MAX          22  /* 1st unused Resource Type */
  2260.    #define RT_RESNAMES     255 /* Resource ID of the resource names table */
  2261.  
  2262.  
  2263.    #define RF_ORDINALID    0x80000000L     /* ordinal id flag in resource table */
  2264.  
  2265. #endif /* common INCL_DOSRESOURCES */
  2266.  
  2267.  
  2268.  
  2269.  
  2270. #ifdef INCL_DOSRESOURCES
  2271.  
  2272.    #define DosGetResource2 DosGetResource
  2273.  
  2274.    APIRET APIENTRY  DosGetResource(HMODULE hmod,
  2275.                                    ULONG idType,
  2276.                                    ULONG idName,
  2277.                                    PPVOID ppb);
  2278.  
  2279.    APIRET APIENTRY  DosFreeResource(PVOID pb);
  2280.  
  2281.    APIRET APIENTRY  DosQueryResourceSize(HMODULE hmod,
  2282.                                          ULONG idt,
  2283.                                          ULONG idn,
  2284.                                          PULONG pulsize);
  2285.  
  2286. #endif /* INCL_DOSRESOURCES */
  2287.  
  2288.  
  2289.  
  2290.  
  2291. /*** NLS Support */
  2292.  
  2293. #ifdef INCL_DOSNLS
  2294.  
  2295.    typedef struct _COUNTRYCODE   /* ctryc */
  2296.    {
  2297.       ULONG       country;
  2298.       ULONG       codepage;
  2299.    } COUNTRYCODE;
  2300.    typedef COUNTRYCODE *PCOUNTRYCODE;
  2301.  
  2302.    typedef struct _COUNTRYINFO   /* ctryi */
  2303.    {
  2304.       ULONG       country;
  2305.       ULONG       codepage;
  2306.       ULONG       fsDateFmt;
  2307.       CHAR        szCurrency[5];
  2308.       CHAR        szThousandsSeparator[2];
  2309.       CHAR        szDecimal[2];
  2310.       CHAR        szDateSeparator[2];
  2311.       CHAR        szTimeSeparator[2];
  2312.       UCHAR       fsCurrencyFmt;
  2313.       UCHAR       cDecimalPlace;
  2314.       UCHAR       fsTimeFmt;
  2315.       USHORT      abReserved1[2];
  2316.       CHAR        szDataSeparator[2];
  2317.       USHORT      abReserved2[5];
  2318.    } COUNTRYINFO, *PCOUNTRYINFO;
  2319.  
  2320.    #define DosGetCtryInfo  DosQueryCtryInfo
  2321.    #define DosGetDBCSEv    DosQueryDBCSEnv
  2322.    #define DosCaseMap      DosMapCase
  2323.    #define DosGetCollate   DosQueryCollate
  2324.    #define DosGetCp        DosQueryCp
  2325.    #define DosSetProcCp    DosSetProcessCp
  2326.  
  2327.    APIRET APIENTRY  DosQueryCtryInfo(ULONG cb,
  2328.                                      PCOUNTRYCODE pcc,
  2329.                                      PCOUNTRYINFO pci,
  2330.                                      PULONG pcbActual);
  2331.  
  2332.    APIRET APIENTRY  DosQueryDBCSEnv(ULONG cb,
  2333.                                     PCOUNTRYCODE pcc,
  2334.                                     PCHAR pBuf);
  2335.  
  2336.    APIRET APIENTRY  DosMapCase(ULONG cb,
  2337.                                PCOUNTRYCODE pcc,
  2338.                                PCHAR pch);
  2339.  
  2340.    APIRET APIENTRY  DosQueryCollate(ULONG cb,
  2341.                                     PCOUNTRYCODE pcc,
  2342.                                     PCHAR pch,
  2343.                                     PULONG pcch);
  2344.  
  2345.    APIRET APIENTRY  DosQueryCp(ULONG cb,
  2346.                                PULONG arCP,
  2347.                                PULONG pcCP);
  2348.  
  2349.    APIRET APIENTRY  DosSetProcessCp(ULONG cp);
  2350.  
  2351. #endif /* INCL_DOSNLS */
  2352.  
  2353.  
  2354.  
  2355.  
  2356. /*** Signal support */
  2357.  
  2358. #ifdef INCL_DOSEXCEPTIONS
  2359.  
  2360.    /* DosSetSigExceptionFocus codes */
  2361.  
  2362.    #define SIG_UNSETFOCUS 0
  2363.    #define SIG_SETFOCUS 1
  2364.  
  2365.    #include <bsexcpt.h>
  2366.  
  2367.    APIRET APIENTRY  DosSetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec);
  2368.  
  2369.    APIRET APIENTRY  DosUnsetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec);
  2370.  
  2371.    APIRET APIENTRY  DosRaiseException(PEXCEPTIONREPORTRECORD pexcept);
  2372.  
  2373.    APIRET APIENTRY  DosSendSignalException(PID pid,
  2374.                                            ULONG exception);
  2375.  
  2376.    APIRET APIENTRY  DosUnwindException(PEXCEPTIONREGISTRATIONRECORD phandler,
  2377.                                        PVOID pTargetIP,
  2378.                                        PEXCEPTIONREPORTRECORD pERepRec);
  2379.  
  2380.    APIRET APIENTRY  DosSetSignalExceptionFocus(BOOL32 flag,
  2381.                                                PULONG pulTimes);
  2382.  
  2383.    APIRET APIENTRY  DosEnterMustComplete(PULONG pulNesting);
  2384.  
  2385.    APIRET APIENTRY  DosExitMustComplete(PULONG pulNesting);
  2386.  
  2387.    APIRET APIENTRY  DosAcknowledgeSignalException(ULONG ulSignalNum);
  2388.  
  2389.    APIRET APIENTRY  DosQueryThreadContext(TID tid,
  2390.                                           ULONG level,
  2391.                                           PCONTEXTRECORD pcxt);
  2392.  
  2393. #endif /* INCL_DOSEXCEPTIONS */
  2394.  
  2395.  
  2396. /*** Pipe and queue support */
  2397.  
  2398. #ifdef INCL_DOSQUEUES
  2399.    #if (defined(INCL_DOSFILEMGR) || !defined(INCL_NOCOMMON))
  2400.  
  2401.       typedef LHANDLE HQUEUE;  /* hq */
  2402.       typedef HQUEUE  *PHQUEUE;
  2403.       typedef struct _REQUESTDATA     /* reqqdata */
  2404.       {
  2405.          PID         pid;
  2406.          ULONG       ulData;
  2407.       } REQUESTDATA;
  2408.       typedef REQUESTDATA *PREQUESTDATA;
  2409.  
  2410.       #define QUE_FIFO              0L
  2411.       #define QUE_LIFO              1L
  2412.       #define QUE_PRIORITY          2L
  2413.       #define QUE_NOCONVERT_ADDRESS 0L
  2414.       #define QUE_CONVERT_ADDRESS   4L
  2415.  
  2416.  
  2417.       APIRET APIENTRY  DosCreatePipe(PHFILE phfRead,
  2418.                                      PHFILE phfWrite,
  2419.                                      ULONG cb);
  2420.  
  2421.       APIRET APIENTRY  DosCloseQueue(HQUEUE hq);
  2422.  
  2423. #ifdef __cplusplus
  2424.       APIRET APIENTRY  DosCreateQueue(PHQUEUE phq,
  2425.                                       ULONG priority,
  2426.                                       PCSZ  pszName);
  2427. #else
  2428.       APIRET APIENTRY  DosCreateQueue(PHQUEUE phq,
  2429.                                       ULONG priority,
  2430.                                       PSZ pszName);
  2431. #endif
  2432.  
  2433. #ifdef __cplusplus
  2434.       APIRET APIENTRY  DosOpenQueue(PPID ppid,
  2435.                                     PHQUEUE phq,
  2436.                                     PCSZ  pszName);
  2437. #else
  2438.       APIRET APIENTRY  DosOpenQueue(PPID ppid,
  2439.                                     PHQUEUE phq,
  2440.                                     PSZ pszName);
  2441. #endif
  2442.  
  2443.       APIRET APIENTRY  DosPeekQueue(HQUEUE hq,
  2444.                                     PREQUESTDATA pRequest,
  2445.                                     PULONG pcbData,
  2446.                                     PPVOID ppbuf,
  2447.                                     PULONG element,
  2448.                                     BOOL32 nowait,
  2449.                                     PBYTE ppriority,
  2450.                                     HEV hsem);
  2451.  
  2452.       APIRET APIENTRY  DosPurgeQueue(HQUEUE hq);
  2453.  
  2454.       APIRET APIENTRY  DosQueryQueue(HQUEUE hq,
  2455.                                      PULONG pcbEntries);
  2456.  
  2457.       APIRET APIENTRY  DosReadQueue(HQUEUE hq,
  2458.                                     PREQUESTDATA pRequest,
  2459.                                     PULONG pcbData,
  2460.                                     PPVOID ppbuf,
  2461.                                     ULONG element,
  2462.                                     BOOL32 wait,
  2463.                                     PBYTE ppriority,
  2464.                                     HEV hsem);
  2465.  
  2466.       APIRET APIENTRY  DosWriteQueue(HQUEUE hq,
  2467.                                      ULONG request,
  2468.                                      ULONG cbData,
  2469.                                      PVOID pbData,
  2470.                                      ULONG priority);
  2471.  
  2472.    #else /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
  2473.       #error PHFILE not defined - define INCL_DOSFILEMGR or undefine INCL_NOCOMMON
  2474.    #endif /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
  2475. #endif /* INCL_DOSQUEUES */
  2476.  
  2477.  
  2478.  
  2479. #ifdef INCL_DOSMISC
  2480.  
  2481.    /* definitions for DosSearchPath control word */
  2482.    #define DSP_IMPLIEDCUR          1 /* current dir will be searched first */
  2483.    #define DSP_PATHREF             2 /* from env.variable */
  2484.    #define DSP_IGNORENETERR        4 /* ignore net errs & continue search */
  2485.  
  2486.    /* indices for DosQuerySysInfo */
  2487.    #define QSV_MAX_PATH_LENGTH        1
  2488.    #define Q_MAX_PATH_LENGTH          QSV_MAX_PATH_LENGTH
  2489.    #define QSV_MAX_TEXT_SESSIONS      2
  2490.    #define QSV_MAX_PM_SESSIONS        3
  2491.    #define QSV_MAX_VDM_SESSIONS       4
  2492.    #define QSV_BOOT_DRIVE             5 /* 1=A, 2=B, etc.                     */
  2493.    #define QSV_DYN_PRI_VARIATION      6 /* 0=Absolute, 1=Dynamic              */
  2494.    #define QSV_MAX_WAIT               7 /* seconds                            */
  2495.    #define QSV_MIN_SLICE              8 /* milli seconds                      */
  2496.    #define QSV_MAX_SLICE              9 /* milli seconds                      */
  2497.    #define QSV_PAGE_SIZE             10
  2498.    #define QSV_VERSION_MAJOR         11
  2499.    #define QSV_VERSION_MINOR         12
  2500.    #define QSV_VERSION_REVISION      13 /* Revision letter                    */
  2501.    #define QSV_MS_COUNT              14 /* Free running millisecond counter   */
  2502.    #define QSV_TIME_LOW              15 /* Low dword of time in seconds       */
  2503.    #define QSV_TIME_HIGH             16 /* High dword of time in seconds      */
  2504.    #define QSV_TOTPHYSMEM            17 /* Physical memory on system          */
  2505.    #define QSV_TOTRESMEM             18 /* Resident memory on system          */
  2506.    #define QSV_TOTAVAILMEM           19 /* Available memory for all processes */
  2507.    #define QSV_MAXPRMEM              20 /* Avail private mem for calling proc */
  2508.    #define QSV_MAXSHMEM              21 /* Avail shared mem for calling proc  */
  2509.    #define QSV_TIMER_INTERVAL        22 /* Timer interval in tenths of ms     */
  2510.    #define QSV_MAX_COMP_LENGTH       23 /* max len of one component in a name */
  2511.    #define QSV_FOREGROUND_FS_SESSION 24 /* Session ID of current fgnd FS session*/
  2512.    #define QSV_FOREGROUND_PROCESS    25 /* Process ID of current fgnd process */
  2513.    #define QSV_NUMPROCESSORS         26
  2514.    #define QSV_MAXHPRMEM             27
  2515.    #define QSV_MAXHSHMEM             28
  2516.    #define QSV_MAXPROCESSES          29
  2517.    #define QSV_VIRTUALADDRESSLIMIT   30
  2518.    #define QSV_INT10ENABLED          31
  2519.    #define QSV_MAX                   QSV_INT10ENABLED
  2520.  
  2521.    /* definitions for DosError - combine with | */
  2522.    #define FERR_DISABLEHARDERR     0x00000000L     /* disable hard error popups */
  2523.    #define FERR_ENABLEHARDERR      0x00000001L     /* enable hard error popups */
  2524.    #define FERR_ENABLEEXCEPTION    0x00000000L     /* enable exception popups */
  2525.    #define FERR_DISABLEEXCEPTION   0x00000002L     /* disable exception popups */
  2526.  
  2527.    /* definitions for DosDumpProcess */
  2528.    #define DDP_DISABLEPROCDUMP     0x00000000L     /* disable process dumps */
  2529.    #define DDP_ENABLEPROCDUMP      0x00000001L     /* enable process dumps */
  2530.    #define DDP_PERFORMPROCDUMP     0x00000002L     /* perform process dump */
  2531.  
  2532.    /* definitions for DosSuppressPopUps */
  2533.    #define SPU_DISABLESUPPRESSION  0x00000000L     /* disable popup suppression */
  2534.    #define SPU_ENABLESUPPRESSION   0x00000001L     /* enable popup suppression */
  2535.    #define SPU_NOLOGCHANGE         0x00000002L     /* do not reset the log drive */
  2536.  
  2537.    /* definitions for DosQueryRASInfo Index */
  2538.    #define SIS_MMIOADDR            0
  2539.    #define SIS_MEC_TABLE           1
  2540.    #define SIS_SYS_LOG             2
  2541.    #define SIS_PERF_MEC_TABLE      3
  2542.  
  2543.    /* definitions for DosQueryExtLIBPATH and DosSetExtLIBPATH flags parameter */
  2544.    #define BEGIN_LIBPATH   1
  2545.    #define END_LIBPATH     2
  2546.  
  2547.    #define DosInsMessage   DosInsertMessage
  2548.    #define DosQSysInfo     DosQuerySysInfo
  2549.  
  2550.    APIRET APIENTRY  DosError(ULONG error);
  2551.  
  2552. #ifdef __cplusplus
  2553.    APIRET APIENTRY  DosGetMessage(PCHAR* pTable,
  2554.                                   ULONG cTable,
  2555.                                   PCHAR pBuf,
  2556.                                   ULONG cbBuf,
  2557.                                   ULONG msgnumber,
  2558.                                   PCSZ  pszFile,
  2559.                                   PULONG pcbMsg);
  2560. #else
  2561.    APIRET APIENTRY  DosGetMessage(PCHAR* pTable,
  2562.                                   ULONG cTable,
  2563.                                   PCHAR pBuf,
  2564.                                   ULONG cbBuf,
  2565.                                   ULONG msgnumber,
  2566.                                   PSZ pszFile,
  2567.                                   PULONG pcbMsg);
  2568. #endif
  2569.  
  2570.    APIRET APIENTRY  DosErrClass(ULONG code,
  2571.                                 PULONG pClass,
  2572.                                 PULONG pAction,
  2573.                                 PULONG pLocus);
  2574.  
  2575. #ifdef __cplusplus
  2576.    APIRET APIENTRY  DosInsertMessage(PCHAR* pTable,
  2577.                                      ULONG cTable,
  2578.                                      PCSZ  pszMsg,
  2579.                                      ULONG cbMsg,
  2580.                                      PCHAR pBuf,
  2581.                                      ULONG cbBuf,
  2582.                                      PULONG pcbMsg);
  2583. #else
  2584.    APIRET APIENTRY  DosInsertMessage(PCHAR* pTable,
  2585.                                      ULONG cTable,
  2586.                                      PSZ pszMsg,
  2587.                                      ULONG cbMsg,
  2588.                                      PCHAR pBuf,
  2589.                                      ULONG cbBuf,
  2590.                                      PULONG pcbMsg);
  2591. #endif
  2592.  
  2593.    APIRET APIENTRY  DosPutMessage(HFILE hfile,
  2594.                                   ULONG cbMsg,
  2595.                                   PCHAR pBuf);
  2596.  
  2597.    APIRET APIENTRY  DosQuerySysInfo(ULONG iStart,
  2598.                                     ULONG iLast,
  2599.                                     PVOID pBuf,
  2600.                                     ULONG cbBuf);
  2601.  
  2602. #ifdef __cplusplus
  2603.    APIRET APIENTRY  DosScanEnv(PCSZ  pszName,
  2604.                                PCSZ  *ppszValue);
  2605. #else
  2606.    APIRET APIENTRY  DosScanEnv(PSZ pszName,
  2607.                                PSZ *ppszValue);
  2608. #endif
  2609.  
  2610. #ifdef __cplusplus
  2611.    APIRET APIENTRY  DosSearchPath(ULONG flag,
  2612.                                   PCSZ  pszPathOrName,
  2613.                                   PCSZ  pszFilename,
  2614.                                   PBYTE pBuf,
  2615.                                   ULONG cbBuf);
  2616. #else
  2617.    APIRET APIENTRY  DosSearchPath(ULONG flag,
  2618.                                   PSZ pszPathOrName,
  2619.                                   PSZ pszFilename,
  2620.                                   PBYTE pBuf,
  2621.                                   ULONG cbBuf);
  2622. #endif
  2623.  
  2624. #ifdef __cplusplus
  2625.    APIRET APIENTRY  DosQueryMessageCP(PCHAR pb,
  2626.                                       ULONG cb,
  2627.                                       PCSZ  pszFilename,
  2628.                                       PULONG cbBuf);
  2629. #else
  2630.    APIRET APIENTRY  DosQueryMessageCP(PCHAR pb,
  2631.                                       ULONG cb,
  2632.                                       PSZ pszFilename,
  2633.                                       PULONG cbBuf);
  2634. #endif
  2635.  
  2636.    APIRET APIENTRY  DosQueryRASInfo(ULONG Index,
  2637.                                     PPVOID Addr);
  2638.  
  2639. #ifdef __cplusplus
  2640.    APIRET  APIENTRY DosSetExtLIBPATH(PCSZ  pszExtLIBPATH,
  2641.                                      ULONG flags);
  2642. #else
  2643.    APIRET  APIENTRY DosSetExtLIBPATH(PSZ pszExtLIBPATH,
  2644.                                      ULONG flags);
  2645. #endif
  2646.  
  2647. #ifdef __cplusplus
  2648.    APIRET  APIENTRY DosQueryExtLIBPATH(PCSZ  pszExtLIBPATH,
  2649.                                        ULONG flags);
  2650. #else
  2651.    APIRET  APIENTRY DosQueryExtLIBPATH(PSZ pszExtLIBPATH,
  2652.                                        ULONG flags);
  2653. #endif
  2654.  
  2655.    APIRET  APIENTRY DosVerifyPidTid(PID Pid,
  2656.                                     TID Tid);
  2657.  
  2658. #if __IBMC__ || __IBMCPP__
  2659.    APIRET16  APIENTRY16 Dos16SysTrace(USHORT major,
  2660.                                       USHORT cpBuf,
  2661.                                       USHORT minor,
  2662.                                       PCHAR pBuf);
  2663. #endif
  2664.  
  2665. #endif /* INCL_DOSMISC */
  2666.  
  2667.  
  2668. /*** Session manager support */
  2669.  
  2670. #ifdef INCL_DOSSESMGR
  2671.  
  2672.    typedef struct _STARTDATA     /* stdata */
  2673.    {
  2674.       USHORT  Length;
  2675.       USHORT  Related;
  2676.       USHORT  FgBg;
  2677.       USHORT  TraceOpt;
  2678.       PSZ     PgmTitle;
  2679.       PSZ     PgmName;
  2680.       PBYTE   PgmInputs;
  2681.       PBYTE   TermQ;
  2682.       PBYTE   Environment;
  2683.       USHORT  InheritOpt;
  2684.       USHORT  SessionType;
  2685.       PSZ     IconFile;
  2686.       ULONG   PgmHandle;
  2687.       USHORT  PgmControl;
  2688.       USHORT  InitXPos;
  2689.       USHORT  InitYPos;
  2690.       USHORT  InitXSize;
  2691.       USHORT  InitYSize;
  2692.       USHORT  Reserved;
  2693.       PSZ     ObjectBuffer;
  2694.       ULONG   ObjectBuffLen;
  2695.    } STARTDATA;
  2696.    typedef STARTDATA *PSTARTDATA;
  2697.  
  2698.    #define SSF_RELATED_INDEPENDENT 0
  2699.    #define SSF_RELATED_CHILD       1
  2700.  
  2701.    #define SSF_FGBG_FORE           0
  2702.    #define SSF_FGBG_BACK           1
  2703.  
  2704.    #define SSF_TRACEOPT_NONE       0
  2705.    #define SSF_TRACEOPT_TRACE      1
  2706.    #define SSF_TRACEOPT_TRACEALL   2
  2707.  
  2708.    #define SSF_INHERTOPT_SHELL     0
  2709.    #define SSF_INHERTOPT_PARENT    1
  2710.  
  2711.    /* note that these types are identical to those in pmshl.h for PROG_* */
  2712.    #define SSF_TYPE_DEFAULT        0
  2713.    #define SSF_TYPE_FULLSCREEN     1
  2714.    #define SSF_TYPE_WINDOWABLEVIO  2
  2715.    #define SSF_TYPE_PM             3
  2716.    #define SSF_TYPE_VDM            4
  2717.    #define SSF_TYPE_GROUP          5
  2718.    #define SSF_TYPE_DLL            6
  2719.    #define SSF_TYPE_WINDOWEDVDM    7
  2720.    #define SSF_TYPE_PDD            8
  2721.    #define SSF_TYPE_VDD            9
  2722.  
  2723.    /* note that these flags are identical to those in pmshl.h for SHE_* */
  2724.    #define SSF_CONTROL_VISIBLE     0x0000
  2725.    #define SSF_CONTROL_INVISIBLE   0x0001
  2726.    #define SSF_CONTROL_MAXIMIZE    0x0002
  2727.    #define SSF_CONTROL_MINIMIZE    0x0004
  2728.    #define SSF_CONTROL_NOAUTOCLOSE 0x0008
  2729.    #define SSF_CONTROL_SETPOS      0x8000
  2730.  
  2731.    typedef struct _STATUSDATA   /* stsdata */
  2732.    {
  2733.       USHORT Length;
  2734.       USHORT SelectInd;
  2735.       USHORT BondInd;
  2736.    } STATUSDATA;
  2737.    typedef STATUSDATA *PSTATUSDATA;
  2738.  
  2739.    /* SelectInd and BondInd paramater values for DosSetSession */
  2740.    #define SET_SESSION_UNCHANGED      0
  2741.    #define SET_SESSION_SELECTABLE     1
  2742.    #define SET_SESSION_NON_SELECTABLE 2
  2743.    #define SET_SESSION_BOND           1
  2744.    #define SET_SESSION_NO_BOND        2
  2745.  
  2746.    /* TargetOption (scope) parameter values for DosStopSession */
  2747.    #define STOP_SESSION_SPECIFIED     0
  2748.    #define STOP_SESSION_ALL           1
  2749.  
  2750.  
  2751. /* NOINC */
  2752.    #define DosQAppType     DosQueryAppType
  2753. /* INC */
  2754.  
  2755.    APIRET APIENTRY  DosStartSession(PSTARTDATA psd,
  2756.                                     PULONG pidSession,
  2757.                                     PPID ppid);
  2758.  
  2759.    APIRET APIENTRY  DosSetSession(ULONG idSession,
  2760.                                   PSTATUSDATA psd);
  2761.  
  2762.    APIRET APIENTRY  DosSelectSession(ULONG idSession);
  2763.  
  2764.    APIRET APIENTRY  DosStopSession(ULONG scope,
  2765.                                    ULONG idSession);
  2766.  
  2767. #ifdef __cplusplus
  2768.    APIRET APIENTRY DosQueryAppType(PCSZ  pszName,
  2769.                                    PULONG pFlags);
  2770. #else
  2771.    APIRET APIENTRY DosQueryAppType(PSZ pszName,
  2772.                                    PULONG pFlags);
  2773. #endif
  2774.  
  2775. #endif /* INCL_DOSSESMGR */
  2776.  
  2777.  
  2778.  
  2779. #if (defined(INCL_DOSSESMGR) || defined(INCL_DOSFILEMGR))
  2780.  
  2781.    /* AppType returned in by DosQueryAppType in pFlags as follows          */
  2782.    #define FAPPTYP_NOTSPEC         0x0000
  2783.    #define FAPPTYP_NOTWINDOWCOMPAT 0x0001
  2784.    #define FAPPTYP_WINDOWCOMPAT    0x0002
  2785.    #define FAPPTYP_WINDOWAPI       0x0003
  2786.    #define FAPPTYP_BOUND           0x0008
  2787.    #define FAPPTYP_DLL             0x0010
  2788.    #define FAPPTYP_DOS             0x0020
  2789.    #define FAPPTYP_PHYSDRV         0x0040  /* physical device driver       */
  2790.    #define FAPPTYP_VIRTDRV         0x0080  /* virtual device driver        */
  2791.    #define FAPPTYP_PROTDLL         0x0100  /* 'protected memory' dll       */
  2792.    #define FAPPTYP_WINDOWSREAL     0x0200  /* Windows real mode app        */
  2793.    #define FAPPTYP_WINDOWSPROT     0x0400  /* Windows protect mode app     */
  2794.    #define FAPPTYP_WINDOWSPROT31   0x1000  /* Windows 3.1 protect mode app */
  2795.    #define FAPPTYP_32BIT           0x4000
  2796.    #define FAPPTYP_EXETYPE         FAPPTYP_WINDOWAPI
  2797.  
  2798.    #define FAPPTYP_RESERVED        ~(FAPPTYP_WINDOWAPI | FAPPTYP_BOUND | FAPPTYP_DLL | FAPPTYP_DOS | FAPPTYP_PHYSDRV | FAPPTYP_VIRTDRV | FAPPTYP_PROTDLL | FAPPTYP_32BIT)
  2799.  
  2800.    #ifdef INCL_DOSFILEMGR
  2801.  
  2802.       #define EAT_APPTYP_PMAPI        0x00            /* Uses PM API */
  2803.       #define EAT_APPTYP_DOS          0x01            /* DOS APP */
  2804.       #define EAT_APPTYP_PMW          0x02            /* Window compatible */
  2805.       #define EAT_APPTYP_NOPMW        0x03            /* Not Window compatible */
  2806.       #define EAT_APPTYP_EXETYPE      0x03            /* EXE type mask */
  2807.       #define EAT_APPTYP_RESERVED     ~(EAT_APPTYP_EXETYPE)
  2808.  
  2809.    #endif /* INCL_DOSFILEMGR */
  2810.  
  2811. #endif /* INCL_DOSSESMGR || INCL_DOSFILEMGR */
  2812.  
  2813.  
  2814.  
  2815.  
  2816. /*** Device support */
  2817.  
  2818. #ifdef INCL_DOSDEVICES
  2819.  
  2820.    #define DosDevIOCtl2    DosDevIOCtl
  2821.  
  2822.    APIRET APIENTRY  DosDevConfig(PVOID pdevinfo,
  2823.                                  ULONG item);
  2824.  
  2825.    #define DEVINFO_PRINTER         0       /* Number of printers attached */
  2826.    #define DEVINFO_RS232           1       /* Number of RS232 ports */
  2827.    #define DEVINFO_FLOPPY          2       /* Number of diskette drives */
  2828.    #define DEVINFO_COPROCESSOR     3       /* Presence of math coprocessor */
  2829.    #define DEVINFO_SUBMODEL        4       /* PC Submodel Type */
  2830.    #define DEVINFO_MODEL           5       /* PC Model Type */
  2831.    #define DEVINFO_ADAPTER         6       /* Primary display adapter type */
  2832.  
  2833.    APIRET APIENTRY  DosDevIOCtl(HFILE hDevice,
  2834.                                 ULONG category,
  2835.                                 ULONG function,
  2836.                                 PVOID pParams,
  2837.                                 ULONG cbParmLenMax,
  2838.                                 PULONG pcbParmLen,
  2839.                                 PVOID pData,
  2840.                                 ULONG cbDataLenMax,
  2841.                                 PULONG pcbDataLen);
  2842.  
  2843.  
  2844.    APIRET APIENTRY  DosPhysicalDisk(ULONG function,
  2845.                                     PVOID pBuf,
  2846.                                     ULONG cbBuf,
  2847.                                     PVOID pParams,
  2848.                                     ULONG cbParams);
  2849.  
  2850.    #define INFO_COUNT_PARTITIONABLE_DISKS  1       /* # of partitionable disks */
  2851.    #define INFO_GETIOCTLHANDLE             2       /* Obtain handle            */
  2852.    #define INFO_FREEIOCTLHANDLE            3       /* Release handle           */
  2853.  
  2854. #endif /* INCL_DOSDEVICES */
  2855.  
  2856.  
  2857. /*** DosNamedPipes API Support */
  2858.  
  2859. #ifdef INCL_DOSNMPIPES
  2860.  
  2861.    /*** Data structures used with named pipes ***/
  2862.  
  2863.    typedef LHANDLE HPIPE;     /* hp */
  2864.    typedef HPIPE   *PHPIPE;
  2865.  
  2866.    typedef struct _AVAILDATA              /* AVAILDATA */
  2867.    {
  2868.       USHORT      cbpipe;            /* bytes left in the pipe */
  2869.       USHORT      cbmessage;         /* bytes left in the current message */
  2870.    } AVAILDATA;
  2871.    typedef AVAILDATA *PAVAILDATA;
  2872.  
  2873.    typedef struct _PIPEINFO               /* nmpinf */
  2874.    {
  2875.       USHORT cbOut;                  /* length of outgoing I/O buffer */
  2876.       USHORT cbIn;                   /* length of incoming I/O buffer */
  2877.       BYTE   cbMaxInst;              /* maximum number of instances   */
  2878.       BYTE   cbCurInst;              /* current number of instances   */
  2879.       BYTE   cbName;                 /* length of pipe name           */
  2880.       CHAR   szName[1];              /* start of name                 */
  2881.    } PIPEINFO;
  2882.    typedef PIPEINFO  *PPIPEINFO;
  2883.  
  2884.    typedef struct _PIPESEMSTATE    /* nmpsmst */
  2885.    {
  2886.       BYTE   fStatus;         /* type of record, 0 = EOI, 1 = read ok, */
  2887.                               /* 2 = write ok, 3 = pipe closed         */
  2888.       BYTE   fFlag;           /* additional info, 01 = waiting thread  */
  2889.       USHORT usKey;           /* user's key value                      */
  2890.       USHORT usAvail;         /* available data/space if status = 1/2  */
  2891.    } PIPESEMSTATE;
  2892.    typedef PIPESEMSTATE *PPIPESEMSTATE;
  2893.  
  2894.    #define NP_INDEFINITE_WAIT      -1
  2895.    #define NP_DEFAULT_WAIT         0L
  2896.  
  2897.    /* DosPeekNmPipe() pipe states */
  2898.  
  2899.    #define NP_STATE_DISCONNECTED   0x0001
  2900.    #define NP_STATE_LISTENING      0x0002
  2901.    #define NP_STATE_CONNECTED      0x0003
  2902.    #define NP_STATE_CLOSING        0x0004
  2903.  
  2904.    /* DosCreateNPipe open modes */
  2905.  
  2906.    #define NP_ACCESS_INBOUND       0x0000
  2907.    #define NP_ACCESS_OUTBOUND      0x0001
  2908.    #define NP_ACCESS_DUPLEX        0x0002
  2909.    #define NP_INHERIT              0x0000
  2910.    #define NP_NOINHERIT            0x0080
  2911.    #define NP_WRITEBEHIND          0x0000
  2912.    #define NP_NOWRITEBEHIND        0x4000
  2913.  
  2914.    /* DosCreateNPipe and DosQueryNPHState state */
  2915.  
  2916.    #define NP_READMODE_BYTE        0x0000
  2917.    #define NP_READMODE_MESSAGE     0x0100
  2918.    #define NP_TYPE_BYTE            0x0000
  2919.    #define NP_TYPE_MESSAGE         0x0400
  2920.    #define NP_END_CLIENT           0x0000
  2921.    #define NP_END_SERVER           0x4000
  2922.    #define NP_WAIT                 0x0000
  2923.    #define NP_NOWAIT               0x8000
  2924.    #define NP_UNLIMITED_INSTANCES  0x00FF
  2925.  
  2926.  
  2927. #ifdef __cplusplus
  2928.    APIRET APIENTRY  DosCallNPipe(PCSZ  pszName,
  2929.                                  PVOID pInbuf,
  2930.                                  ULONG cbIn,
  2931.                                  PVOID pOutbuf,
  2932.                                  ULONG cbOut,
  2933.                                  PULONG pcbActual,
  2934.                                  ULONG msec);
  2935. #else
  2936.    APIRET APIENTRY  DosCallNPipe(PSZ pszName,
  2937.                                  PVOID pInbuf,
  2938.                                  ULONG cbIn,
  2939.                                  PVOID pOutbuf,
  2940.                                  ULONG cbOut,
  2941.                                  PULONG pcbActual,
  2942.                                  ULONG msec);
  2943. #endif
  2944.  
  2945.    APIRET APIENTRY  DosConnectNPipe(HPIPE hpipe);
  2946.  
  2947.    APIRET APIENTRY  DosDisConnectNPipe(HPIPE hpipe);
  2948.  
  2949. #ifdef __cplusplus
  2950.    APIRET APIENTRY  DosCreateNPipe(PCSZ  pszName,
  2951.                                    PHPIPE pHpipe,
  2952.                                    ULONG openmode,
  2953.                                    ULONG pipemode,
  2954.                                    ULONG cbInbuf,
  2955.                                    ULONG cbOutbuf,
  2956.                                    ULONG msec);
  2957. #else
  2958.    APIRET APIENTRY  DosCreateNPipe(PSZ pszName,
  2959.                                    PHPIPE pHpipe,
  2960.                                    ULONG openmode,
  2961.                                    ULONG pipemode,
  2962.                                    ULONG cbInbuf,
  2963.                                    ULONG cbOutbuf,
  2964.                                    ULONG msec);
  2965. #endif
  2966.  
  2967.    APIRET APIENTRY  DosPeekNPipe(HPIPE hpipe,
  2968.                                  PVOID pBuf,
  2969.                                  ULONG cbBuf,
  2970.                                  PULONG pcbActual,
  2971.                                  PAVAILDATA pAvail,
  2972.                                  PULONG pState);
  2973.  
  2974.    APIRET APIENTRY  DosQueryNPHState(HPIPE hpipe,
  2975.                                      PULONG pState);
  2976.  
  2977.    APIRET APIENTRY  DosQueryNPipeInfo(HPIPE hpipe,
  2978.                                       ULONG infolevel,
  2979.                                       PVOID pBuf,
  2980.                                       ULONG cbBuf);
  2981.  
  2982.    APIRET APIENTRY  DosQueryNPipeSemState(HSEM hsem,
  2983.                                           PPIPESEMSTATE pnpss,
  2984.                                           ULONG cbBuf);
  2985.  
  2986.   APIRET  APIENTRY  DosRawReadNPipe(HPIPE hPipe,
  2987.                                     PVOID pBuffer,
  2988.                                     ULONG cbRead,
  2989.                                     PULONG pcbActual);
  2990.  
  2991.   APIRET  APIENTRY  DosRawWriteNPipe(HPIPE hPipe,
  2992.                                      PVOID pBuffer,
  2993.                                      ULONG cbWrite,
  2994.                                      PULONG pcbActual);
  2995.  
  2996.    APIRET APIENTRY  DosSetNPHState(HPIPE hpipe,
  2997.                                    ULONG state);
  2998.  
  2999.    APIRET APIENTRY  DosSetNPipeSem(HPIPE hpipe,
  3000.                                    HSEM hsem,
  3001.                                    ULONG key);
  3002.  
  3003.    APIRET APIENTRY  DosTransactNPipe(HPIPE hpipe,
  3004.                                      PVOID pOutbuf,
  3005.                                      ULONG cbOut,
  3006.                                      PVOID pInbuf,
  3007.                                      ULONG cbIn,
  3008.                                      PULONG pcbRead);
  3009.  
  3010. #ifdef __cplusplus
  3011.    APIRET APIENTRY  DosWaitNPipe(PCSZ  pszName,
  3012.                                  ULONG msec);
  3013. #else
  3014.    APIRET APIENTRY  DosWaitNPipe(PSZ pszName,
  3015.                                  ULONG msec);
  3016. #endif
  3017.  
  3018.    /* values in fStatus */
  3019.    #define NPSS_EOI                   0     /* End Of Information    */
  3020.    #define NPSS_RDATA                 1     /* read data available   */
  3021.    #define NPSS_WSPACE                2     /* write space available */
  3022.    #define NPSS_CLOSE                 3     /* pipe in CLOSING state */
  3023.  
  3024.    /* values in npss_flag */
  3025.    #define NPSS_WAIT                  0x01  /* waiting thread on end of pipe */
  3026.  
  3027.    /* defined bits in pipe mode */
  3028.    #define NP_NBLK                    0x8000 /* non-blocking read/write */
  3029.    #define NP_SERVER                  0x4000 /* set if server end       */
  3030.    #define NP_WMESG                   0x0400 /* write messages          */
  3031.    #define NP_RMESG                   0x0100 /* read as messages        */
  3032.    #define NP_ICOUNT                  0x00FF /* instance count field    */
  3033.  
  3034.  
  3035.    /*Named pipes may be in one of several states depending on the actions
  3036.    * that have been taken on it by the server end and client end.  The
  3037.    * following state/action table summarizes the valid state transitions:
  3038.    *
  3039.    * Current state           Action                  Next state
  3040.    *
  3041.    *  <none>             server DosMakeNmPipe        DISCONNECTED
  3042.    *  DISCONNECTED       server connect              LISTENING
  3043.    *  LISTENING          client open                 CONNECTED
  3044.    *  CONNECTED          server disconn              DISCONNECTED
  3045.    *  CONNECTED          client close                CLOSING
  3046.    *  CLOSING            server disconn              DISCONNECTED
  3047.    *  CONNECTED          server close                CLOSING
  3048.    *  <any other>        server close                <pipe deallocated>
  3049.    *
  3050.    * If a server disconnects his end of the pipe, the client end will enter a
  3051.    * special state in which any future operations (except close) on the file
  3052.    * descriptor associated with the pipe will return an error.
  3053.    */
  3054.  
  3055.    /*
  3056.    *      Values for named pipe state
  3057.    */
  3058.  
  3059.    #define NP_DISCONNECTED       1         /* after pipe creation or Disconnect */
  3060.    #define NP_LISTENING          2         /* after DosNmPipeConnect            */
  3061.    #define NP_CONNECTED          3         /* after Client open                 */
  3062.    #define NP_CLOSING            4         /* after Client or Server close      */
  3063.  
  3064.  
  3065. #endif /* INCL_DOSNMPIPES */
  3066.  
  3067.  
  3068.  
  3069. /*** DosProfile API support */
  3070.  
  3071. #ifdef INCL_DOSPROFILE
  3072.  
  3073.    /*** Perfview API support */
  3074.  
  3075.    APIRET APIENTRY DosTmrQueryFreq(PULONG pulTmrFreq);
  3076.  
  3077.    APIRET APIENTRY DosTmrQueryTime(PQWORD pqwTmrTime);
  3078.  
  3079.    APIRET APIENTRY DosRegisterPerfCtrs(PBYTE pbDataBlk,
  3080.                                        PBYTE pbTextBlk,
  3081.                                        ULONG flFlags);
  3082.  
  3083.    /* DosProfile ordinal number */
  3084.  
  3085.    #define PROF_ORDINAL        133
  3086.  
  3087.    /* DosProfile usType */
  3088.  
  3089.    #define PROF_SYSTEM           0
  3090.    #define PROF_USER             1
  3091.    #define PROF_USEDD            2
  3092.    #define PROF_KERNEL           4
  3093.    #define PROF_VERBOSE          8
  3094.    #define PROF_ENABLE          16
  3095.  
  3096.    /* DosProfile usFunc */
  3097.  
  3098.    #define PROF_ALLOC            0
  3099.    #define PROF_CLEAR            1
  3100.    #define PROF_ON               2
  3101.    #define PROF_OFF              3
  3102.    #define PROF_DUMP             4
  3103.    #define PROF_FREE             5
  3104.  
  3105.    /* DosProfile tic count granularity (DWORD) */
  3106.  
  3107.    #define PROF_SHIFT            2
  3108.  
  3109.    /* DosProfile module name string length */
  3110.  
  3111.    #define PROF_MOD_NAME_SIZE   10
  3112.  
  3113.    /* DosProfile error code for end of data */
  3114.  
  3115.    #define PROF_END_OF_DATA     13
  3116.  
  3117.    /* defines and structures for DosQuerySysState */
  3118.  
  3119.    /* record types */
  3120.    #define QS_PROCESS      0x0001
  3121.    #define QS_SEMAPHORE    0x0002
  3122.    #define QS_MTE          0x0004
  3123.    #define QS_FILESYS      0x0008
  3124.    #define QS_SHMEMORY     0x0010
  3125.    #define QS_DISK         0x0020
  3126.    #define QS_HWCONFIG     0x0040
  3127.    #define QS_NAMEDPIPE    0x0080
  3128.    #define QS_THREAD       0x0100
  3129.    #define QS_MODVER       0x0200
  3130.  
  3131.    /* valid EntityList bit settings */
  3132.    #define QS_SUPPORTED    (QS_PROCESS|QS_SEMAPHORE|QS_MTE|QS_FILESYS|QS_SHMEMORY|QS_MODVER)
  3133.  
  3134.    /* All structures must be padded to dword boundaries if necessary  */
  3135.    /* The semicolon that is needed to terminate the structure field   */
  3136.    /* must be added in the structure definition itself, because H2INC */
  3137.    /* ignores it in a #define statement. */
  3138.    #define PADSHORT        USHORT        pad_sh
  3139.    #define PADCHAR         UCHAR         pad_ch
  3140.  
  3141.    #define QS_END          0L       /* last FILESYS record */
  3142.  
  3143.    /* Global Record structure
  3144.     * Holds all global system information. Placed first in user buffer
  3145.     */
  3146.    typedef struct qsGrec_s {  /* qsGrec */
  3147.            ULONG         cThrds;
  3148.            ULONG         c32SSem;
  3149.            ULONG         cMFTNodes;
  3150.    }qsGrec_t;
  3151.  
  3152.    /* Thread Record structure
  3153.     *      Holds all per thread information.
  3154.     */
  3155.    typedef struct qsTrec_s {  /* qsTrec */
  3156.            ULONG         RecType;        /* Record Type */
  3157.            USHORT        tid;            /* thread ID */
  3158.            USHORT        slot;           /* "unique" thread slot number */
  3159.            ULONG         sleepid;        /* sleep id thread is sleeping on */
  3160.            ULONG         priority;       /* thread priority */
  3161.            ULONG         systime;        /* thread system time */
  3162.            ULONG         usertime;       /* thread user time */
  3163.            UCHAR         state;          /* thread state */
  3164.            PADCHAR;
  3165.            PADSHORT;
  3166.    } qsTrec_t;
  3167.  
  3168.    /* Process Record structure
  3169.     *      Holds all per process information.
  3170.     *      ________________________________
  3171.     *      |       RecType                 |
  3172.     *      |-------------------------------|
  3173.     *      |       pThrdRec                |----|
  3174.     *      |-------------------------------|    |
  3175.     *      |       pid                     |    |
  3176.     *      |-------------------------------|    |
  3177.     *      |       ppid                    |    |
  3178.     *      |-------------------------------|    |
  3179.     *      |       type                    |    |
  3180.     *      |-------------------------------|    |
  3181.     *      |       stat                    |    |
  3182.     *      |-------------------------------|    |
  3183.     *      |       sgid                    |    |
  3184.     *      |-------------------------------|    |
  3185.     *      |       hMte                    |    |
  3186.     *      |-------------------------------|    |
  3187.     *      |       cTCB                    |    |
  3188.     *      |-------------------------------|    |
  3189.     *      |       c32PSem                 |    |
  3190.     *      |-------------------------------|    |
  3191.     *      |       p32SemRec               |----|---|
  3192.     *      |-------------------------------|    |   |
  3193.     *      |       c16Sem                  |    |   |
  3194.     *      |-------------------------------|    |   |
  3195.     *      |       cLib                    |    |   |
  3196.     *      |-------------------------------|    |   |
  3197.     *      |       cShrMem                 |    |   |
  3198.     *      |-------------------------------|    |   |
  3199.     *      |       cFS                     |    |   |
  3200.     *      |-------------------------------|    |   |
  3201.     *      |       p16SemRec               |----|---|----|
  3202.     *      |-------------------------------|    |   |    |
  3203.     *      |       pLibRec                 |----|---|----|------|
  3204.     *      |-------------------------------|    |   |    |      |
  3205.     *      |       pShrMemRec              |----|---|----|------|----|
  3206.     *      |-------------------------------|    |   |    |      |    |
  3207.     *      |       pFSRec                  |----|---|----|------|----|-----|
  3208.     *      |-------------------------------|    |   |    |      |    |     |
  3209.     *      |       32SemPPRUN[0]           |<---|---|    |      |    |     |
  3210.     *      |          .                    |    |        |      |    |     |
  3211.     *      |          .                    |    |        |      |    |     |
  3212.     *      |          .                    |    |        |      |    |     |
  3213.     *      |       32SemPPRUN[c32PSem-1]   |    |        |      |    |     |
  3214.     *      |-------------------------------|    |        |      |    |     |
  3215.     *      |       16SemIndx[0]            |<---|--------|      |    |     |
  3216.     *      |          .                    |    |               |    |     |
  3217.     *      |          .                    |    |               |    |     |
  3218.     *      |          .                    |    |               |    |     |
  3219.     *      |       16SemIndx[c16Sem-1]     |    |               |    |     |
  3220.     *      |-------------------------------|    |               |    |     |
  3221.     *      |       hmte[0] (or "name str") |<---|---------------|    |     |
  3222.     *      |          .                    |    |                    |     |
  3223.     *      |          .                    |    |                    |     |
  3224.     *      |          .                    |    |                    |     |
  3225.     *      |       hmte[cLib-1]            |    |                    |     |
  3226.     *      |-------------------------------|    |                    |     |
  3227.     *      |       hshmem[0]               |<---|--------------------|     |
  3228.     *      |          .                    |    |                          |
  3229.     *      |          .                    |    |                          |
  3230.     *      |          .                    |    |                          |
  3231.     *      |       hshmem[cShrMem-1]       |    |                          |
  3232.     *      |-------------------------------|    |                          |
  3233.     *      |       fsinfo[0]               |<---|--------------------------|
  3234.     *      |          .                    |    |
  3235.     *      |          .                    |    |
  3236.     *      |          .                    |    |
  3237.     *      |       fsinfo[cFS-1]           |    |
  3238.     *      |-------------------------------|    |
  3239.     *                                      <-----
  3240.     *      NOTE that the process name string will be stored in place of hmtes
  3241.     *              if MTE information is NOT being requested.
  3242.     *      NOTE that following this structure in the user buffer is
  3243.     *              an array c32Sems long of PRUN structures for 32 bit sems
  3244.     *              an array c16Sems long of indices for 16 bit sems
  3245.     *              the process name string
  3246.     */
  3247.    typedef struct qsPrec_s {  /* qsPrec */
  3248.            ULONG         RecType;        /* type of record being processed */
  3249.            qsTrec_t  FAR *pThrdRec;      /* ptr to thread recs for this proc */
  3250.            USHORT        pid;            /* process ID */
  3251.            USHORT        ppid;           /* parent process ID */
  3252.            ULONG         type;           /* process type */
  3253.            ULONG         stat;           /* process status */
  3254.            ULONG         sgid;           /* process screen group */
  3255.            USHORT        hMte;           /* program module handle for process */
  3256.            USHORT        cTCB;           /* # of TCBs in use */
  3257.            ULONG         c32PSem;        /* # of private 32-bit sems in use */
  3258.            void      FAR *p32SemRec;     /* pointer to head of 32bit sem info */
  3259.            USHORT        c16Sem;         /* # of 16 bit system sems in use */
  3260.            USHORT        cLib;           /* number of runtime linked libraries */
  3261.            USHORT        cShrMem;        /* number of shared memory handles */
  3262.            USHORT        cFH;            /* number of open files */
  3263.            USHORT   FAR  *p16SemRec;     /* pointer to head of 16 bit sem info */
  3264.            USHORT   FAR  *pLibRec;       /* ptr to list of runtime libraries */
  3265.            USHORT   FAR  *pShrMemRec;    /* ptr to list of shared mem handles */
  3266.            USHORT   FAR  *pFSRec;        /* pointer to list of file handles */
  3267.    } qsPrec_t;
  3268.  
  3269.    /*
  3270.     *      16 bit system semaphore structure
  3271.     *      ________________________________
  3272.     *      |       pNextRec                |----|
  3273.     *      |-------------------------------|    |
  3274.     *      |SysSemData     :               |    |
  3275.     *      |       SysSemOwner             |    |
  3276.     *      |       SysSemFlag              |    |
  3277.     *      |       SysSemRecCnt            |    |
  3278.     *      |       SysSemProcCnt           |    |
  3279.     *      |-------------------------------|    |
  3280.     *      |-------------------------------|    |
  3281.     *      |-------------------------------|    |
  3282.     *      |       SysSemPtr               |    |
  3283.     *      |-------------------------------|    |
  3284.     *      |SysSemName:                    |    |
  3285.     *      |       "pathname"              |    |
  3286.     *      |-------------------------------|    |
  3287.     *                                      <-----
  3288.     */
  3289.  
  3290.  
  3291.    /* SysSemFlag values */
  3292.  
  3293.    #define QS_SYSSEM_WAITING 0x01               /* a thread is waiting on the sem */
  3294.    #define QS_SYSSEM_MUXWAITING 0x02            /* a thread is muxwaiting on the sem */
  3295.    #define QS_SYSSEM_OWNER_DIED 0x04            /* the process/thread owning the sem died */
  3296.    #define QS_SYSSEM_EXCLUSIVE 0x08             /* indicates a exclusive system semaphore */
  3297.    #define QS_SYSSEM_NAME_CLEANUP 0x10          /* name table entry needs to be removed */
  3298.    #define QS_SYSSEM_THREAD_OWNER_DIED 0x20     /* the thread owning the sem died */
  3299.    #define QS_SYSSEM_EXITLIST_OWNER 0x40        /* the exitlist thread owns the sem */
  3300.  
  3301.    typedef struct qsS16rec_s {   /* qsS16rec */
  3302.            ULONG         NextRec;        /* offset to next record in buffer */
  3303.                                          /* System Semaphore Table Structure */
  3304.            USHORT        SysSemOwner ;   /* thread owning this semaphore */
  3305.            UCHAR         SysSemFlag ;    /* system semaphore flag bit field */
  3306.            UCHAR         SysSemRefCnt ;  /* number of references to this sys sem */
  3307.            UCHAR         SysSemProcCnt ; /* number of requests for this owner */
  3308.            UCHAR         SysSemPad ;     /* pad byte to round structure up to word */
  3309.            USHORT        pad_sh;
  3310.            USHORT        SemPtr;         /* RMP SysSemPtr field */
  3311.            char          SemName;        /* start of semaphore name string */
  3312.    } qsS16rec_t;
  3313.  
  3314.    typedef struct qsS16Headrec_s {  /* qsS16Hrec */
  3315.            ULONG         SRecType;       /* offset of SysSemDataTable */
  3316.            ULONG         SpNextRec;      /* overlays NextRec of 1st qsS16rec_t*/
  3317.            ULONG         S32SemRec;
  3318.            ULONG         S16TblOff;
  3319.            ULONG         pSem16Rec;
  3320.    } qsS16Headrec_t;
  3321.  
  3322.    /*
  3323.     *      System wide Shared Mem information
  3324.     *      ________________________________
  3325.     *      |       NextRec                 |
  3326.     *      |-------------------------------|
  3327.     *      |       hmem                    |
  3328.     *      |-------------------------------|
  3329.     *      |       sel                     |
  3330.     *      |-------------------------------|
  3331.     *      |       refcnt                  |
  3332.     *      |-------------------------------|
  3333.     *      |       name                    |
  3334.     *      |_______________________________|
  3335.     *
  3336.     */
  3337.    typedef struct qsMrec_s {  /* qsMrec */
  3338.            ULONG         MemNextRec;       /* offset to next record in buffer */
  3339.            USHORT        hmem;             /* handle for shared memory */
  3340.            USHORT        sel;              /* selector */
  3341.            USHORT        refcnt;           /* reference count */
  3342.            char          Memname;          /* start of shared memory name string */
  3343.    } qsMrec_t;
  3344.  
  3345.    /*
  3346.     *      32 bit system semaphore structure
  3347.     *      ________________________________
  3348.     *      |       pNextRec                |----|
  3349.     *      |-------------------------------|    |
  3350.     *      |       QSHUN[0]                |    |
  3351.     *      |-------------------------------|    |
  3352.     *      |         MuxQ                  |    |
  3353.     *      |-------------------------------|    |
  3354.     *      |         OpenQ                 |    |
  3355.     *      |-------------------------------|    |
  3356.     *      |         SemName               |    |
  3357.     *      |-------------------------------|<---|
  3358.     *      |          .                    |
  3359.     *      |          .                    |
  3360.     *      |-------------------------------|<---|
  3361.     *      |       pNextRec                |----|
  3362.     *      |-------------------------------|    |
  3363.     *      |       QSHUN[c32SSem-1]        |    |
  3364.     *      |-------------------------------|    |
  3365.     *      |         MuxQ                  |    |
  3366.     *      |-------------------------------|    |
  3367.     *      |         OpenQ                 |    |
  3368.     *      |-------------------------------|    |
  3369.     *      |         SemName               |    |
  3370.     *      |-------------------------------|<---|
  3371.     */
  3372.  
  3373.    /*
  3374.     *  32- bit Semaphore flags
  3375.     */
  3376.  
  3377.    #define QS_DC_SEM_SHARED   0x0001   //  Shared Mutex, Event or MUX semaphore
  3378.    #define QS_DCMW_WAIT_ANY   0x0002   //  Wait on any event/mutex to occur
  3379.    #define QS_DCMW_WAIT_ALL   0x0004   //  Wait on all events/mutexs to occur
  3380.    #define QS_DCM_MUTEX_SEM   0x0008   //  Mutex semaphore
  3381.    #define QS_DCE_EVENT_SEM   0x0010   //  Event semaphore
  3382.    #define QS_DCMW_MUX_SEM    0x0020   //  Muxwait semaphore
  3383.    #define QS_DC_SEM_PM       0x0040   //  PM Shared Event Semphore
  3384.    #define QS_DE_POSTED       0x0040   //  event sem is in the posted state
  3385.    #define QS_DM_OWNER_DIED   0x0080   //  The owning process died
  3386.    #define QS_DMW_MTX_MUX     0x0100   //  MUX contains mutex sems
  3387.    #define QS_DHO_SEM_OPEN    0x0200   //  Device drivers have opened this semaphore
  3388.    #define QS_DE_16BIT_MW     0x0400   //  Part of a 16-bit MuxWait
  3389.    #define QS_DCE_POSTONE     0x0800   //  Post one flag event semaphore
  3390.    #define QS_DCE_AUTORESET   0x1000   //  Auto-reset event semaphore
  3391.  
  3392.    typedef struct qsopenq_s {    /* qsopenq */
  3393.            PID           pidOpener;      /* process id of opening process */
  3394.            USHORT        OpenCt;         /* number of opens for this process */
  3395.    } QSOPENQ;
  3396.    typedef struct qsevent_s {    /* qsevent */
  3397.            QSOPENQ       *pOpenQ;        /* pointer to open q entries */
  3398.            UCHAR         *pName;         /* pointer to semaphore name */
  3399.            ULONG         *pMuxQ;         /* pointer to the mux queue */
  3400.            USHORT        flags;
  3401.            USHORT        PostCt;         /* # of posts */
  3402.    } QSEVENT;
  3403.    typedef struct qsmutex_s {    /* qsmutex */
  3404.            QSOPENQ       *pOpenQ;        /* pointer to open q entries */
  3405.            UCHAR         *pName;         /* pointer to semaphore name */
  3406.            ULONG         *pMuxQ;         /* pointer to the mux queue */
  3407.            USHORT        flags;
  3408.            USHORT        ReqCt;          /* # of requests */
  3409.            USHORT        SlotNum;        /* slot # of owning thread */
  3410.            PADSHORT;
  3411.    } QSMUTEX;
  3412.    typedef struct qsmux_s {   /* qsmux */
  3413.            QSOPENQ         *pOpenQ;        /* pointer to open q entries */
  3414.            UCHAR           *pName;         /* pointer to semaphore name */
  3415.            void            *pSemRec;       /* array of semaphore record entries */
  3416.            USHORT          flags;
  3417.            USHORT          cSemRec;        /* count of semaphore records */
  3418.            USHORT          WaitCt;         /* # threads waiting on the mux */
  3419.            PADSHORT;
  3420.    } QSMUX;
  3421.    typedef struct qsshun_s {  /* qsshun */
  3422.            QSEVENT         qsSEvt;         /* shared event sem */
  3423.            QSMUTEX         qsSMtx;         /* shared mutex sem */
  3424.            QSMUX           qsSMux;         /* shared mux sem */
  3425.    } QSHUN;
  3426.    typedef struct qsS32rec_s {   /* qsS32rec */
  3427.            void            *pNextRec;      /* pointer to next record in buffer */
  3428.            QSHUN           qsh;            /* qstate version of SHUN record */
  3429.    } qsS32rec_t;
  3430.  
  3431.    /*
  3432.     *      System wide MTE information
  3433.     *      ________________________________
  3434.     *      |       pNextRec                |----|
  3435.     *      |-------------------------------|    |
  3436.     *      |       hmte                    |    |
  3437.     *      |-------------------------------|    |
  3438.     *      |       ctImpMod                |    |
  3439.     *      |-------------------------------|    |
  3440.     *      |       ctObj                   |    |
  3441.     *      |-------------------------------|    |
  3442.     *      |       pObjInfo                |----|----------|
  3443.     *      |-------------------------------|    |          |
  3444.     *      |       pName                   |----|----|     |
  3445.     *      |-------------------------------|    |    |     |
  3446.     *      |       imported module handles |    |    |     |
  3447.     *      |          .                    |    |    |     |
  3448.     *      |          .                    |    |    |     |
  3449.     *      |          .                    |    |    |     |
  3450.     *      |-------------------------------| <--|----|     |
  3451.     *      |       "pathname"              |    |          |
  3452.     *      |-------------------------------| <--|----------|
  3453.     *      |       Object records          |    |
  3454.     *      |       (if requested)          |    |
  3455.     *      |_______________________________|    |
  3456.     *                                      <-----
  3457.     *      NOTE that if the level bit is set to QS_MTE, the base Lib record will be followed
  3458.     *      by a series of object records (qsLObj_t); one for each object of the
  3459.     *      module.
  3460.     */
  3461.  
  3462.    typedef struct qsLObjrec_s {  /* qsLOrec */
  3463.            ULONG         oaddr;  /* object address */
  3464.            ULONG         osize;  /* object size */
  3465.            ULONG         oflags; /* object flags */
  3466.    } qsLObjrec_t;
  3467.  
  3468.    typedef struct qsLrec_s {     /* qsLrec */
  3469.            void  FAR        *pNextRec;      /* pointer to next record in buffer */
  3470.            USHORT           hmte;           /* handle for this mte */
  3471.            USHORT           fFlat;          /* true if 32 bit module */
  3472.            ULONG            ctImpMod;       /* # of imported modules in table */
  3473.            ULONG            ctObj;          /* # of objects in module (mte_objcnt)*/
  3474.            qsLObjrec_t FAR  *pObjInfo;      /* pointer to per object info if any */
  3475.            UCHAR     FAR    *pName;         /* -> name string following struc */
  3476.    } qsLrec_t;
  3477.  
  3478.    /* Used for 9th bit (Extended Module Data Summary)*/
  3479.    typedef struct qsExLrec_s {   /* qsELrec */
  3480.            struct          qsExLrec_s *next; /*  Pointer to next Extended Module Data */
  3481.            USHORT          hndmod;           /*  Module Handle */
  3482.            USHORT          pid;              /*  Process ID */
  3483.            USHORT          type;             /*  Type of Module */
  3484.            ULONG           refcnt;           /*  Size of reference array */
  3485.            ULONG           segcnt;           /*  Number of segments in module */
  3486.            void            *_reserved_;
  3487.            UCHAR FAR       *name;            /*  Pointer to Module Name  */
  3488.            ULONG           ModuleVersion;    /*  Module version value  */
  3489.            UCHAR FAR       *ShortModName;    /*  New Pointer to Module short name */
  3490.            ULONG           modref;           /*  Start of array of handles of module */
  3491.    }qsExLrec_t;
  3492.  
  3493.    /*
  3494.     *      System wide FILE information
  3495.     *      ________________________________
  3496.     *      |       RecType                 |
  3497.     *      |-------------------------------|
  3498.     *      |       pNextRec                |-------|
  3499.     *      |-------------------------------|       |
  3500.     *      |       ctSft                   |       |
  3501.     *      |-------------------------------|       |
  3502.     *      |       pSft                    |---|   |
  3503.     *      |-------------------------------|   |   |
  3504.     *      |       name                    |   |   |
  3505.     *      |-------------------------------|<--|   |
  3506.     *      |       qsSft[0]                |       |
  3507.     *      |-------------------------------|       |
  3508.     *      |       ...                     |       |
  3509.     *      |-------------------------------|       |
  3510.     *      |       qsSft[ctSft -1]         |       |
  3511.     *      |_______________________________|       |
  3512.     *      |       name                    |
  3513.     *      |_______________________________|
  3514.     *                                      <-------|
  3515.     */
  3516.    typedef struct qsSft_s {   /* qsSft */
  3517.            USHORT        sfn;            /* SFN sf_fsi.sfi_selfSFN */
  3518.            USHORT        refcnt;         /* sf_ref_count */
  3519.            USHORT        flags;          /* sf_flags */
  3520.            USHORT        flags2;         /* sf_flags2 */
  3521.            USHORT        mode;           /* sf_fsi.sfi_mode - mode of access */
  3522.            USHORT        mode2;          /* sf_fsi.sfi_mode2 - mode of access */
  3523.            ULONG         size;           /* sf_fsi.sfi_size */
  3524.            USHORT        hVPB;           /* sf_fsi.sfi_hVPB handle of volume */
  3525.            USHORT        attr;           /* sf_attr */
  3526.            PADSHORT;
  3527.    } qsSft_t;
  3528.  
  3529.    typedef struct qsFrec_s {  /* qsFrec */
  3530.            ULONG         RecType;        /* Record Type */
  3531.            void          *pNextRec;      /* pointer to next record in buffer */
  3532.            ULONG         ctSft;          /* # sft entries for this MFT entry */
  3533.            qsSft_t       *pSft;          /* -> start of sft entries in buf */
  3534.    } qsFrec_t;
  3535.  
  3536.  
  3537.    /* Pointer Record Structure
  3538.     *      This structure is the first in the user buffer.
  3539.     *      It contains pointers to heads of record types that are loaded
  3540.     *      into the buffer.
  3541.     */
  3542.  
  3543.    typedef struct qsPtrRec_s {   /* qsPRec */
  3544.            qsGrec_t        *pGlobalRec;
  3545.            qsPrec_t        *pProcRec;      /* ptr to head of process records */
  3546.            qsS16Headrec_t  *p16SemRec;     /* ptr to head of 16 bit sem recds */
  3547.            qsS32rec_t      *p32SemRec;     /* ptr to head of 32 bit sem recds */
  3548.            qsMrec_t        *pMemRec;       /* ptr to head of shared mem recs */
  3549.            qsLrec_t        *pLibRec;       /* ptr to head of mte records */
  3550.            qsMrec_t        *pShrMemRec;    /* ptr to head of shared mem records */
  3551.            qsFrec_t        *pFSRec;        /* ptr to head of file sys records */
  3552.    } qsPtrRec_t;
  3553.  
  3554.    APIRET  APIENTRY DosQuerySysState(ULONG EntityList,
  3555.                                      ULONG EntityLevel,
  3556.                                      PID pid,
  3557.                                      TID tid,
  3558.                                      PVOID pDataBuf,
  3559.                                      ULONG cbBuf);
  3560.  
  3561.    APIRET  APIENTRY DosAliasPerfCtrs(ULONG ulRangeType,
  3562.                                      ULONG ulInfo,
  3563.                                      PBYTE *ppbRangeStart,
  3564.                                      ULONG *pulRangeSize);
  3565.  
  3566.    #ifdef INCL_32  /* BOOL32 is only defined in INCL_32 */
  3567. #ifdef __cplusplus
  3568.    APIRET  APIENTRY DosConfigurePerf(ULONG ulEntityType,
  3569.                                      ULONG ulConfigType,
  3570.                                      ULONG ulInfo1,
  3571.                                      ULONG ulInfo2,
  3572.                                      PCSZ  pszConfigSpec,
  3573.                                      BOOL32 fExclude);
  3574. #else
  3575.    APIRET  APIENTRY DosConfigurePerf(ULONG ulEntityType,
  3576.                                      ULONG ulConfigType,
  3577.                                      ULONG ulInfo1,
  3578.                                      ULONG ulInfo2,
  3579.                                      PSZ pszConfigSpec,
  3580.                                      BOOL32 fExclude);
  3581. #endif
  3582.    #endif
  3583.  
  3584.    APIRET  APIENTRY DosDeconPerf(VOID);
  3585.  
  3586.    APIRET APIENTRY DosPerfSysCall(ULONG ulCommand,
  3587.                                   ULONG ulParm1,
  3588.                                   ULONG ulParm2,
  3589.                                   ULONG ulParm3);
  3590.  
  3591. #endif /* INCL_DOSPROFILE */
  3592.  
  3593.  
  3594.  
  3595. /* Virtual DOS Machine API support */
  3596. #ifdef INCL_DOSMVDM
  3597.  
  3598.    typedef LHANDLE   HVDD;     /* hvdd */
  3599.    typedef HVDD     *PHVDD;    /* phvdd */
  3600.  
  3601. #ifdef __cplusplus
  3602.    APIRET APIENTRY  DosOpenVDD(PCSZ  pszVDD,
  3603.                                PHVDD phvdd);
  3604. #else
  3605.    APIRET APIENTRY  DosOpenVDD(PSZ pszVDD,
  3606.                                PHVDD phvdd);
  3607. #endif
  3608.  
  3609.    APIRET APIENTRY  DosRequestVDD(HVDD hvdd,
  3610.                                   SGID sgid,
  3611.                                   ULONG cmd,
  3612.                                   ULONG cbInput,
  3613.                                   PVOID pInput,
  3614.                                   ULONG cbOutput,
  3615.                                   PVOID pOutput);
  3616.  
  3617.    APIRET APIENTRY  DosCloseVDD(HVDD hvdd);
  3618.  
  3619. #ifdef __cplusplus
  3620.    APIRET APIENTRY  DosQueryDOSProperty(SGID sgid,
  3621.                                         PCSZ  pszName,
  3622.                                         ULONG cb,
  3623.                                         PCSZ  pch);
  3624. #else
  3625.    APIRET APIENTRY  DosQueryDOSProperty(SGID sgid,
  3626.                                         PSZ pszName,
  3627.                                         ULONG cb,
  3628.                                         PSZ pch);
  3629. #endif
  3630.  
  3631. #ifdef __cplusplus
  3632.    APIRET APIENTRY  DosSetDOSProperty(SGID sgid,
  3633.                                       PCSZ  pszName,
  3634.                                       ULONG cb,
  3635.                                       PCSZ  pch);
  3636. #else
  3637.    APIRET APIENTRY  DosSetDOSProperty(SGID sgid,
  3638.                                       PSZ pszName,
  3639.                                       ULONG cb,
  3640.                                       PSZ pch);
  3641. #endif
  3642. #endif /* INCL_DOSMVDM */
  3643.  
  3644.    #ifdef INCL_DOSSPINLOCK
  3645.  
  3646.  
  3647.    /* Processor state (used by DosGetProcessorStatus and DosSetProcessorStatus) */
  3648.    #define PROC_OFFLINE    0x00000000      /* processor is offline */
  3649.    #define PROC_ONLINE     0x00000001      /* processor is online */
  3650.  
  3651.    APIRET APIENTRY DosGetProcessorStatus(ULONG procid,
  3652.                                          PULONG status);
  3653.  
  3654.    APIRET APIENTRY DosSetProcessorStatus(ULONG procid,
  3655.                                          ULONG status);
  3656.  
  3657.    typedef ULONG HSPINLOCK;
  3658.    typedef HSPINLOCK FAR *PHSPINLOCK;
  3659.  
  3660.    APIRET APIENTRY DosCreateSpinLock(PHSPINLOCK pHandle);
  3661.  
  3662.    VOID   APIENTRY DosAcquireSpinLock(HSPINLOCK hSpinLock);
  3663.  
  3664.    VOID   APIENTRY DosReleaseSpinLock(HSPINLOCK hSpinLock);
  3665.  
  3666.    APIRET APIENTRY DosFreeSpinLock(HSPINLOCK Handle);
  3667.  
  3668.    APIRET APIENTRY DosPerfSysCall(ULONG ulCommand,
  3669.                                   ULONG ulParm1,
  3670.                                   ULONG ulParm2,
  3671.                                   ULONG ulParm3);
  3672.  
  3673.    APIRET APIENTRY DosGetProcessorStatus(ULONG ProcNum,
  3674.                                          PULONG pStatus);
  3675.  
  3676.    APIRET APIENTRY DosSetProcessorStatus(ULONG ProcNum,
  3677.                                          ULONG pStatus);
  3678.  
  3679. #ifdef __cplusplus
  3680.    APIRET APIENTRY DosTestPSD(PCSZ  pszPSDFileName);
  3681. #else
  3682.    APIRET APIENTRY DosTestPSD(PSZ pszPSDFileName);
  3683. #endif
  3684.  
  3685.    #endif
  3686.  
  3687.  
  3688. #ifdef INCL_BDCALLS
  3689.  
  3690.    #include "bdcalls.h"
  3691.  
  3692. #endif /*INCL_BDCALLS */
  3693.  
  3694. #endif /* __BSEDOS__ */
  3695.  
  3696. /* NOINC */
  3697. #ifdef __cplusplus
  3698.         }
  3699. #endif
  3700. #if __IBMC__ || __IBMCPP__
  3701.    #pragma info( none )
  3702.       #ifndef __CHKHDR__
  3703.          #pragma info( restore )
  3704.       #endif
  3705.    #pragma info( restore )
  3706. #endif
  3707. /* INC */
  3708. /**************************** end of file **********************************/
  3709.