home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos13.zip / bsedos.pas next >
Pascal/Delphi Source File  |  1993-11-24  |  138KB  |  3,344 lines

  1. {| Unit: BseDos
  2.  | Version: 1.00
  3.  | translated from file BseDos.H
  4.  | Original translation: Peter Sawatzki (ps)
  5.  | Contributing:
  6.  |   (fill in)
  7.  |
  8.  | change history:
  9.  | Date:    Ver: Author:
  10.  | 11/13/93 1.00 ps     original translation by ps
  11. }
  12. Unit BseDos;
  13. Interface
  14. Uses
  15.   Os2Def;
  16. {**************************************************************************\
  17. *
  18. * Module Name: BSEDOS.H
  19. *
  20. * OS/2 Base Include File
  21. *
  22. * Copyright
  23. *
  24. \**************************************************************************}
  25.  
  26. {** General services }
  27.  
  28. {**   DosBeep - Generates sound from speaker                   }
  29.  
  30.   Function DosBeep (usFrequency,                            { frequency of sound in Hertz }
  31.                     usDuration: USHORT): USHORT;             { length of sound in milliseconds }
  32.  
  33. {** Process and Thread support }
  34.  
  35. {**    DosExit - Exit a program
  36.  *
  37.  *      This call is issued when a thread completes its execution.
  38.  *      The current thread is ended.
  39.  }
  40.  
  41.   Procedure DosExit (fTerminate,                          { 0=end current thread, 1=end all }
  42.                     usExitCode: USHORT);                  { program completion code         }
  43.  
  44. { DosExit codes }
  45.  
  46. Const
  47.   EXIT_THREAD                      = 0;
  48.   EXIT_PROCESS                     = 1;
  49.  
  50. {**    _PIDINFO  structure of the address of the area where the
  51.  *      ID's will be placed
  52.  }
  53.  
  54.  
  55. Type
  56.   PIDINFO = Record
  57.     pid: PID;                           { current process' process ID }
  58.     tid: TID;                           { current process' thread ID }
  59.     pidParent: PID                      { process ID of the parent }
  60.   End;
  61.   pPIDINFO = ^PIDINFO;
  62.  
  63.   pFnThread = Procedure;
  64.  
  65. {**    DosCreateThread - Create another thread of execution
  66.  *
  67.  *      Creates an asynchronous thread of execution under the
  68.  *      current process
  69.  }
  70.  
  71.   Function DosCreateThread (pfnFun: PFNTHREAD;              { Starting Address for new thread }
  72.                             pTid: PTID;                     { Address to put new thread ID }
  73.                             pbStack: PBYTE): USHORT;                 { Address of stack for new thread }
  74.  
  75. {**    DosResumeThread - Resume the execution of a thread
  76.  *
  77.  *      This call restarts the execution of a thread
  78.  *      previously stopped by a call to DosSuspendThread.
  79.  }
  80.  
  81.   Function DosResumeThread (tid: TID): USHORT;                       { Thread ID }
  82.  
  83.  
  84. {**    DosSuspendThread - Suspend the execution of a thread
  85.  *
  86.  *      This call temporarily suspends a thread's execution
  87.  *      until a DosResumeThread call is made for that thread ID.
  88.  }
  89.  
  90.   Function DosSuspendThread (tid: TID): USHORT;                       { Thread ID }
  91.  
  92. { Action code values }
  93.  
  94.  
  95. Const
  96.   DCWA_PROCESS                     = 0;
  97.   DCWA_PROCESSTREE                 = 1;
  98.  
  99. { Wait option values }
  100.  
  101.   DCWW_WAIT                        = 0;
  102.   DCWW_NOWAIT                      = 1;
  103.  
  104. {**   _RESULTCODES - structure used by DosExecPgm and DosCWait
  105.  *              First word is Termination code, second word is Exit code.
  106.  *              For DosExecPgm, first word may instead be the Process ID.
  107.  }
  108.  
  109.  
  110. Type
  111.   RESULTCODES = Record
  112.     codeTerminate,                      { Termination Code -or- Process ID }
  113.     codeResult: USHORT                  { Exit Code }
  114.   End;
  115.   pRESULTCODES = ^RESULTCODES;
  116.  
  117.  
  118. {**    DosCwait - Wait for child termination
  119.  *
  120.  *      Places the current thread in a wait state until a child process
  121.  *      has terminated, then returns the ending process' process ID and
  122.  *      termination code.
  123.  }
  124.  
  125.   Function DosCwait (fScope,                                { Action (execution) codes }
  126.                      fwait: USHORT;                         { Wait options }
  127.                      prescResults: PRESULTCODES;            { Address to put return codes }
  128.                      ppidProcess: PPID;                     { Address to put process ID }
  129.                      pidWaitProcess: PID): USHORT;            { ProcessID of process to wait for }
  130.  
  131. {**   DosSleep - Delay Process Execution
  132.  *
  133.  *     Suspends the current thread for a specified time.
  134.  *
  135.  }
  136.  
  137.   Function DosSleep (ulTime: ULONG): USHORT;         { interval in milliseconds to delay execution }
  138.  
  139. { codeTerminate values }
  140.  
  141.  
  142. Const
  143.   TC_EXIT                          = 0;
  144.   TC_HARDERROR                     = 1;
  145.   TC_TRAP                          = 2;
  146.   TC_KILLPROCESS                   = 3;
  147.  
  148. Type
  149.   pFnExitList = Procedure (aShort: USHORT);
  150.  
  151. {**    DosEnterCritSec - Enter critical section of execution
  152.  *
  153.  *      Disables thread switching for the current process
  154.  }
  155.  
  156.   Function DosEnterCritSec: USHORT;
  157.  
  158. {**    DosExitCritSec - Exit critical section of execution
  159.  *
  160.  *      Re-enables thread switching for the current process
  161.  *}
  162.  
  163.   Function DosExitCritSec: USHORT;
  164.  
  165. {**    DosExitList - Routine list for process termination
  166.  *
  167.  *      Maintains a list of routines which are to be executed when the
  168.  *      current process ends, normally or otherwise
  169.  }
  170.  
  171.   Function DosExitList (fFnCode: USHORT;                    { Function request code }
  172.                         pfnFunction: PFNEXITLIST): USHORT;       { Address of routine to be executed }
  173.  
  174. { DosExitList functions }
  175.  
  176.  
  177. Const
  178.   EXLST_ADD                        = 1;
  179.   EXLST_REMOVE                     = 2;
  180.   EXLST_EXIT                       = 3;
  181.  
  182. {**    DosExecPgm - Execute a program
  183.  *
  184.  *      Allows a program to request another program be executed as a
  185.  *      child process.  The requestor's process may optionally continue
  186.  *      to execute asynchronous to the new program
  187.  }
  188.  
  189.   Function DosExecPgm (pchFailName: PCHAR;                  { Object name buffer (address) }
  190.                        cbFailName: SHORT;                   { Object name buffer length }
  191.                        fExecFlag: USHORT;                   { 0=synchronous, 1=asynchronous with }
  192.                                                             { return code discarded, 2=async }
  193.                                                             { with return code saved, 3=trace }
  194.                                                             { 4=asynch detached, 5=loaded but }
  195.                                                             { not executed }
  196.                        pszArgs,                             { Address of argument strings }
  197.                        pszEnv: PSZ;                         { Address of environment strings }
  198.                        prescResults: PRESULTCODES;          { Address to put return codes }
  199.                        pszPgmName: PSZ): USHORT;            { Address of program filename        }
  200.  
  201. { DosExecPgm functions }
  202.  
  203.  
  204. Const
  205.   EXEC_SYNC                        = 0;
  206.   EXEC_ASYNC                       = 1;
  207.   EXEC_ASYNCRESULT                 = 2;
  208.   EXEC_TRACE                       = 3;
  209.   EXEC_BACKGROUND                  = 4;
  210.   EXEC_LOAD                        = 5;
  211.  
  212. {**    DosGetPID - Return process ID
  213.  *
  214.  *      Returns the current process's process ID
  215.  *      and the PID of the process that spawned it
  216.  }
  217.  
  218.   Function DosGetPID (ppidInfo: PPIDINFO): USHORT;             { _PIDINFO structure }
  219.  
  220.  
  221. {**   DosGetPPid - Get a process's parent's PID
  222.  *
  223.  *     Allows the caller to obtain the parent process ID for any process
  224.  *
  225.  }
  226.  
  227.   Function DosGetPPID (pidChild: USHORT;                    { process id of process to find the parent pid }
  228.                        ppidParent: PUSHORT): USHORT;  { where pid will be placed                     }
  229.  
  230. {**    DosGetPrty - Get Process's Priority
  231.  *
  232.  *      Allows the caller to learn the priority of a process or thread
  233.  }
  234.  
  235.   Function DosGetPrty (usScope: USHORT;                     { scope the request will have }
  236.                        pusPriority: PUSHORT;                { Address to put priority }
  237.                        pid: USHORT): USHORT;                    { PID of process/thread of interest }
  238.  
  239. {**    DosSetPrty - Set Process Priority
  240.  *
  241.  *      Allows the caller to change the base priority or priority
  242.  *      class of a child process or a thread in the current process
  243.  }
  244.  
  245.   Function DosSetPrty (usScope,                             { Indicate scope of change }
  246.                        fPrtyClass: USHORT;                  { Priority class to set }
  247.                        sChange: SHORT;                      { Priority delta to apply }
  248.                        id: USHORT): USHORT;                     { Process or Thread ID of target }
  249.  
  250. { Priority scopes }
  251.  
  252.  
  253. Const
  254.   PRTYS_PROCESS                    = 0;
  255.   PRTYS_PROCESSTREE                = 1;
  256.   PRTYS_THREAD                     = 2;
  257.  
  258. { Priority classes }
  259.  
  260.   PRTYC_NOCHANGE                   = 0;
  261.   PRTYC_IDLETIME                   = 1;
  262.   PRTYC_REGULAR                    = 2;
  263.   PRTYC_TIMECRITICAL               = 3;
  264.   PRTYC_FOREGROUNDSERVER           = 4;
  265.  
  266. { Priority deltas }
  267.  
  268.   PRTYD_MINIMUM                    = -31;
  269.   PRTYD_MAXIMUM                    = 31;
  270.  
  271. {**    DosKillProcess - Terminate a Process
  272.  *
  273.  *      Terminates a child process and returns its termination code
  274.  *      to its parent
  275.  }
  276.  
  277.   Function DosKillProcess (usScope: USHORT;                 { 0=kill child processes also, }{ 1=kill only indicated process }
  278.                            pidProcess: PID): USHORT;                { Process ID of process to end  }
  279.  
  280.  
  281. Const
  282.   DKP_PROCESSTREE                  = 0;
  283.   DKP_PROCESS                      = 1;
  284.  
  285.  
  286.  
  287. {** InfoSeg support }
  288.  
  289.  
  290. { Global Info Seg }
  291.  
  292.  
  293. Type
  294.   GINFOSEG = Record
  295.     time,                               { time in seconds }
  296.     msecs: ULONG;                       { milliseconds }
  297.     hour,                               { hours }
  298.     minutes,                            { minutes }
  299.     seconds,                            { seconds }
  300.     hundredths: UCHAR;                  { hundredths }
  301.     timezone,                           { minutes from UTC }
  302.     cusecTimerInterval: USHORT;         { timer interval (units = 0.0001 seconds) }
  303.     day,                                { day }
  304.     month: UCHAR;                       { month }
  305.     year: USHORT;                       { year }
  306.     weekday,                            { day of week }
  307.     uchMajorVersion,                    { major version number }
  308.     uchMinorVersion,                    { minor version number }
  309.     chRevisionLetter,                   { revision letter }
  310.     sgCurrent,                          { current foreground session }
  311.     sgMax,                              { maximum number of sessions }
  312.     cHugeShift,                         { shift count for huge elements }
  313.     fProtectModeOnly: UCHAR;            { protect mode only indicator }
  314.     pidForeground: USHORT;              { pid of last process in forground session }
  315.     fDynamicSched,                      { dynamic variation flag }
  316.     csecMaxWait: UCHAR;                 { max wait in seconds }
  317.     cmsecMinSlice,                      { minimum timeslice (milliseconds) }
  318.     cmsecMaxSlice,                      { maximum timeslice (milliseconds) }
  319.     bootdrive: USHORT;                  { drive from which the system was booted }
  320.     amecRAS: Array[0..31] Of UCHAR;     { system trace major code flag bits }
  321.     csgWindowableVioMax,                { maximum number of VIO windowable sessions }
  322.     csgPMMax: UCHAR                     { maximum number of pres. services sessions }
  323.   End;
  324.   pGINFOSEG = ^GINFOSEG;
  325.  
  326. { Local Info Seg }
  327.  
  328.   LINFOSEG = Record
  329.     pidCurrent,                         { current process id }
  330.     pidParent: PID;                     { process id of parent }
  331.     prtyCurrent: USHORT;                { priority of current thread }
  332.     tidCurrent: TID;                    { thread ID of current thread }
  333.     sgCurrent: USHORT;                  { session }
  334.     rfProcStatus,                       { process status }
  335.     dummy1: UCHAR;
  336.     fForeground: BOOL;                  { current process has keyboard focus }
  337.     typeProcess,                        { process type }
  338.     dummy2: UCHAR;
  339.     selEnvironment: SEL;                { environment selector }
  340.     offCmdLine,                         { command line offset }
  341.     cbDataSegment,                      { length of data segment }
  342.     cbStack,                            { stack size }
  343.     cbHeap: USHORT;                     { heap size }
  344.     hmod: HMODULE;                      { module handle of the application }
  345.     selDS: SEL                          { data segment handle of the application }
  346.   End;
  347.   pLINFOSEG = ^LINFOSEG;
  348.  
  349. { Process Type codes }
  350.  
  351.  
  352. Const
  353.   PT_FULLSCREEN                    = 0;                     { Full screen app.          }
  354.   PT_REALMODE                      = 1;                     { Real mode process         }
  355.   PT_WINDOWABLEVIO                 = 2;                     { VIO windowable app.       }
  356.   PT_PM                            = 3;                     { Presentation Manager app. }
  357.   PT_DETACHED                      = 4;                     { Detached app.             }
  358.  
  359. { Process Status Flag definitions
  360.  
  361.   PS_EXITLIST                      = 1;                     { Thread is in exitlist routine }
  362.  
  363.  
  364. {**    DosGetInfoSeg - Get address of system variables segment
  365.  *
  366.  *      Returns the address of a global and process local data segment used to
  367.  *      determine the value of several items of general information.
  368.  *
  369.  }
  370.  
  371.   Function DosGetInfoSeg (pselGlobal,                       { global segment selector (returned) }
  372.                           pselLocal: PSEL): USHORT;                { local segment selector (returned)  }
  373.  
  374. { Helper macros used to convert selector to PINFOSEG or LINFOSEG }
  375.  
  376.  
  377.  
  378.  
  379. {
  380.  * CCHMAXPATH is the maximum fully qualified path name length including
  381.  * the drive letter, colon, backslashes and terminating NULL.
  382.  }
  383.  
  384. Const
  385.   CCHMAXPATH                       = 260;
  386.  
  387. {
  388.  * CCHMAXPATHCOMP is the maximum individual path component name length
  389.  * including a terminating NULL.
  390.  }
  391.   CCHMAXPATHCOMP                   = 256;
  392.  
  393.  
  394.  
  395. {** File manager }
  396.  
  397.  
  398.  
  399. { DosChgFilePtr
  400.  
  401.   FILE_BEGIN                       =  $0000;                { Move relative to beginning of file     }
  402.   FILE_CURRENT                     =  $0001;                { Move relative to current fptr position }
  403.   FILE_END                         =  $0002;                { Move relative to end of file           }
  404.  
  405. { DosFindFirst/Next Directory handle types }
  406.  
  407.   HDIR_SYSTEM                      =  $0001;                { Use system handle (1)         }
  408.   HDIR_CREATE                      =  $FFFF;                { Allocate a new, unused handle }
  409.  
  410. { DosCopy control bits; may be or'ed together }
  411.   DCPY_EXISTING                    =  $00001;               { Copy even if target exists }
  412.   DCPY_APPEND                      =  $00002;               { Append to existing file,   }
  413.                                         { do not replace             }
  414.  
  415. { Dosopen/DosQFHandState/DosQueryFileInfo et al file attributes; also }
  416. { known as Dso File Mode bits... }
  417.  
  418.   FILE_NORMAL                      =  $0000;
  419.   FILE_READONLY                    =  $0001;
  420.   FILE_HIDDEN                      =  $0002;
  421.   FILE_SYSTEM                      =  $0004;
  422.   FILE_DIRECTORY                   =  $0010;
  423.   FILE_ARCHIVED                    =  $0020;
  424.  
  425. { DosOpen
  426.  
  427.   FILE_EXISTED                     =  $0001;
  428.   FILE_CREATED                     =  $0002;
  429.   FILE_TRUNCATED                   =  $0003;
  430.  
  431. { DosOpen
  432.  
  433.   FILE_OPEN                        =  $0001;
  434.   FILE_TRUNCATE                    =  $0002;
  435.   FILE_CREATE                      =  $0010;
  436.  
  437. {     this nibble applies if file already exists                xxxx }
  438.  
  439.   OPEN_ACTION_FAIL_IF_EXISTS       =  $0000;                { ---- ---- ---- 0000 }
  440.   OPEN_ACTION_OPEN_IF_EXISTS       =  $0001;                { ---- ---- ---- 0001 }
  441.   OPEN_ACTION_REPLACE_IF_EXISTS    =  $0002;                { ---- ---- ---- 0010 }
  442.  
  443. {     this nibble applies if file does not exist           xxxx      }
  444.  
  445.   OPEN_ACTION_FAIL_IF_NEW          =  $0000;                { ---- ---- 0000 ---- }
  446.   OPEN_ACTION_CREATE_IF_NEW        =  $0010;                { ---- ---- 0001 ---- }
  447.  
  448. { DosOpen/DosSetFHandState flags }
  449.  
  450.   OPEN_ACCESS_READONLY             =  $0000;                { ---- ---- ---- -000 }
  451.   OPEN_ACCESS_WRITEONLY            =  $0001;                { ---- ---- ---- -001 }
  452.   OPEN_ACCESS_READWRITE            =  $0002;                { ---- ---- ---- -010 }
  453.   OPEN_SHARE_DENYREADWRITE         =  $0010;                { ---- ---- -001 ---- }
  454.   OPEN_SHARE_DENYWRITE             =  $0020;                { ---- ---- -010 ---- }
  455.   OPEN_SHARE_DENYREAD              =  $0030;                { ---- ---- -011 ---- }
  456.   OPEN_SHARE_DENYNONE              =  $0040;                { ---- ---- -100 ---- }
  457.   OPEN_FLAGS_NOINHERIT             =  $0080;                { ---- ---- 1--- ---- }
  458.   OPEN_FLAGS_NO_LOCALITY           =  $0000;                { ---- -000 ---- ---- }
  459.   OPEN_FLAGS_SEQUENTIAL            =  $0100;                { ---- -001 ---- ---- }
  460.   OPEN_FLAGS_RANDOM                =  $0200;                { ---- -010 ---- ---- }
  461.   OPEN_FLAGS_RANDOMSEQUENTIAL      =  $0300;                { ---- -011 ---- ---- }
  462.   OPEN_FLAGS_NO_CACHE              =  $1000;                { ---1 ---- ---- ---- }
  463.   OPEN_FLAGS_FAIL_ON_ERROR         =  $2000;                { --1- ---- ---- ---- }
  464.   OPEN_FLAGS_WRITE_THROUGH         =  $4000;                { -1-- ---- ---- ---- }
  465.   OPEN_FLAGS_DASD                  =  $8000;                { 1--- ---- ---- ---- }
  466.  
  467.  
  468. { DosSearchPath
  469.  
  470.   SEARCH_PATH                      =  $0000;
  471.   SEARCH_CUR_DIRECTORY             =  $0001;
  472.   SEARCH_ENVIRONMENT               =  $0002;
  473.   SEARCH_IGNORENETERRS             =  $0004;
  474.  
  475. {***********************************************************
  476. DosFileIO
  477. =========================================
  478. ***********************************************************}
  479. { File IO command words }
  480.   FIO_LOCK                         = 0;                     { Lock Files          }
  481.   FIO_UNLOCK                       = 1;                     { Unlock Files        }
  482.   FIO_SEEK                         = 2;                     { Seek (set file ptr) }
  483.   FIO_READ                         = 3;                     { File Read           }
  484.   FIO_WRITE                        = 4;                     { File Write          }
  485.  
  486. { Lock Sharing Modes }
  487.   FIO_NOSHARE                      = 0;                     { None      }
  488.   FIO_SHAREREAD                    = 1;                     { Read-Only }
  489.  
  490.  
  491. Type
  492.   FIOLOCKCMD = Record                   { FLC  FileLockCmd prefix }
  493.     usCmd,                              { Cmd = FIO_LOCK }
  494.     cLockCnt: USHORT;                   { Lock records that follow }
  495.     cTimeOut: ULONG                     { in Msec }
  496.   End;
  497.   pFIOLOCKCMD = ^FIOLOCKCMD;
  498.  
  499.  
  500.   FIOLOCKREC = Record                   { FLR FileLockRecord              }
  501.     fShare: USHORT;                     { FIO_NOSHARE or FIO_SHAREREAD }
  502.     cbStart,                            { Starting offset for lock region }
  503.     cbLength: ULONG                     { Length of lock region }
  504.   End;
  505.   pFIOLOCKREC = ^FIOLOCKREC;
  506.  
  507.  
  508.   FIOUNLOCKCMD = Record                 { FUC FileUnlockCmd prefix   }
  509.     usCmd,                              { Cmd = FIO_UNLOCK }
  510.     cUnlockCnt: USHORT                  { Unlock records that follow }
  511.   End;
  512.   pFIOUNLOCKCMD =^FIOUNLOCKCMD;
  513.  
  514.  
  515.   FIOUNLOCKREC = Record                 { FUR FileUnlockRecord              }
  516.     cbStart,                            { Starting offset for unlock region }
  517.     cbLength: ULONG                     { Length of unlock region }
  518.   End;
  519.   pFIOUNLOCKREC =^FIOUNLOCKREC;
  520.  
  521.  
  522.   FIOSEEKCMD = Record                   { Seek command structure             }
  523.     usCmd,                              { Cmd = FIO_SEEK }
  524.     fsMethod: USHORT;                   { One of : FPM_BEGINNING, }{ FPM_CURRENT,or FPM_END }
  525.     cbDistance,                         { Byte offset for seek }
  526.     cbNewPosition: ULONG                { Bytes from start of file after }{ seek }
  527.   End;
  528.   pFIOSEEKCMD = ^FIOSEEKCMD;
  529.  
  530.  
  531.   FIOREADWRITE = Record                 { RWC Read&Write command structure }
  532.     usCmd: USHORT;                      { Cmd = FIO_READ or FIO_WRITE }
  533.     pbBuffer: PVOID;                    { Pointer to data buffer }
  534.     cbBufferLen,                        { Bytes in buffer or max size }
  535.     cbActualLen: USHORT                 { Bytes actually read/written }
  536.   End;
  537.   pFIOREADWRITE =^FIOREADWRITE;
  538.  
  539.  
  540. {***********************************************************
  541. EA Info Levels & Find First/Next
  542. =========================================
  543. API's: DosFindFirst, DosQueryFileInfo, DosQueryPathInfo, DosSetFileInfo,
  544.        DosSetPathInfo
  545. ***********************************************************}
  546.  
  547. { File info levels: All listed API's }
  548.  
  549. Const
  550.   FIL_STANDARD                     = 1;                     { Info level 1, standard file info }
  551.   FIL_QUERYEASIZE                  = 2;                     { Level 2, return Full EA size     }
  552.   FIL_QUERYEASFROMLIST             = 3;                     { Level 3, return requested EA's   }
  553.  
  554. { File info levels: Dos...PathInfo only }
  555.   FIL_QUERYFULLNAME                = 5;                     { Level 5, return fully qualified  }
  556.                                         { name of file                     }
  557.   FIL_NAMEISVALID                  = 6;                     { Level 6, check validity of file/path
  558.                                            name for this FSD                }
  559.  
  560.  
  561.  
  562. { DosFindNotifyFirst
  563.   FNOTIL_STANDARD                  = 1;                     { Find-Notify Info level 1: Return
  564.                                    standard directory change info }
  565.  
  566.  
  567. { DosFsAttach
  568. { Attact or detach }
  569.   FSATTACH                         = 0;                     { Attach file server }
  570.   FSDETACH                         = 1;                     { Detach file server }
  571.  
  572.  
  573. { DosFsCtl
  574. { Routing type }
  575.   FSCTL_HANDLE                     = 1;                     { File Handle directs req routing }
  576.   FSCTL_PATHNAME                   = 2;                     { Path Name directs req routing   }
  577.   FSCTL_FSDNAME                    = 3;                     { FSD Name directs req routing    }
  578.  
  579.  
  580. { DosQueryFSAttach
  581. { Information level types
  582.   FSAIL_QUERYNAME                  = 1;                     { Return data for a Drive or Device }
  583.   FSAIL_DEVNUMBER                  = 2;                     { Return data for Ordinal Device #  }
  584.   FSAIL_DRVNUMBER                  = 3;                     { Return data for Ordinal Drive #   }
  585.  
  586. { Item types
  587.   FSAT_CHARDEV                     = 1;                     { Resident character device    }
  588.   FSAT_PSEUDODEV                   = 2;                     { Pusedu-character device      }
  589.   FSAT_LOCALDRV                    = 3;                     { Local drive                  }
  590.   FSAT_REMOTEDRV                   = 4;                     { Remote drive attached to FSD }
  591.  
  592.  
  593. Type
  594.   FSQBUFFER = Record                    { Data structure for QFSAttach       }
  595.     iType,                              { Item type }
  596.     cbName: USHORT;                     { Length of item name, sans NULL }
  597.     szName: Array[0..0] Of UCHAR;       { ASCIIZ item name }
  598.     cbFSDName: USHORT;                  { Length of FSD name, sans NULL }
  599.     szFSDName: Array[0..0] Of UCHAR;    { ASCIIZ FSD name }
  600.     cbFSAData: USHORT;                  { Length of FSD Attach data returned }
  601.     rgFSAData: Array[0..0] Of UCHAR     { FSD Attach data from FSD }
  602.   End;
  603.   pFSQBUFFER = ^FSQBUFFER;
  604.  
  605.  
  606. {**********
  607. File System Drive Information&gml DosQueryFSInfo DosSetFSInfo
  608. **********}
  609.  
  610. { FS Drive Info Levels }
  611.  
  612. Const
  613.   FSIL_ALLOC                       = 1;                     { Drive allocation info (Query only) }
  614.   FSIL_VOLSER                      = 2;                     { Drive Volum/Serial info            }
  615.  
  616. { DosQueryFHType }
  617. { Handle classes }
  618.   FHT_DISKFILE                     =  $0000;                { Disk file handle        }
  619.   FHT_CHRDEV                       =  $0001;                { Character device handle }
  620.   FHT_PIPE                         =  $0002;                { Pipe handle             }
  621.  
  622. { Handle bits }
  623.   FHB_DSKREMOTE                    =  $8000;                { Remote disk             }
  624.   FHB_CHRDEVREMOTE                 =  $8000;                { Remote character device }
  625.   FHB_PIPEREMOTE                   =  $8000;                { Remote pipe             }
  626.  
  627. Type
  628.   HFILE = SHANDLE;      { hf }
  629.   pHFILE = ^HFILE;
  630.  
  631.  
  632. { File time and date types }
  633.  
  634. Type
  635.   FTIME = Word;
  636.     {[0..4]: twosecs;
  637.      [5..10]: minutes;
  638.      [11..15]: hours; }
  639.   pFTIME = ^FTIME;
  640.  
  641.   FDATE = Word;
  642.     {[0..4]: day;
  643.      [5..8]: month;
  644.      [9..15]: year; }
  645.   pFDATE = ^FDATE;
  646.  
  647.   FILEFINDBUF = Record                  { findbuf }
  648.     fdateCreation: FDATE;
  649.     ftimeCreation: FTIME;
  650.     fdateLastAccess: FDATE;
  651.     ftimeLastAccess: FTIME;
  652.     fdateLastWrite: FDATE;
  653.     ftimeLastWrite: FTIME;
  654.     cbFile,
  655.     cbFileAlloc: ULONG;
  656.     attrFile: USHORT;
  657.     cchName: UCHAR;
  658.     achName: Array[0..CCHMAXPATHCOMP-1] Of Char
  659.   End;
  660.   pFILEFINDBUF = ^FILEFINDBUF;
  661.  
  662.   FILEFINDBUF2 = Record                 { findbuf2 }
  663.     fdateCreation: FDATE;
  664.     ftimeCreation: FTIME;
  665.     fdateLastAccess: FDATE;
  666.     ftimeLastAccess: FTIME;
  667.     fdateLastWrite: FDATE;
  668.     ftimeLastWrite: FTIME;
  669.     cbFile,
  670.     cbFileAlloc: ULONG;
  671.     attrFile: USHORT;
  672.     cbList: ULONG;
  673.     cchName: UCHAR;
  674.     achName: Array[0..CCHMAXPATHCOMP-1] Of Char
  675.   End;
  676.   pFILEFINDBUF2 =^FILEFINDBUF2;
  677.  
  678. { extended attribute structures }
  679.  
  680.   GEA = Record                          { gea                            }
  681.     cbName: BYTE;                       { name length not including NULL }
  682.     szName: Array[0..0] Of Char         { attribute name }
  683.   End;
  684.   pGEA =  ^GEA;
  685.  
  686.   GEALIST = Record                      { geal                                         }
  687.     cbList: ULONG;                      { total bytes of structure including full list }
  688.     list: Array[0..0] Of GEA            { variable length GEA structures }
  689.   End;
  690.   pGEALIST = ^GEALIST;
  691.  
  692.   FEA = Record                          { fea                            }
  693.     fea,                                { flags }
  694.     cbName: BYTE;                       { name length not including NULL }
  695.     cbValue: USHORT                     { value length }
  696.   End;
  697.   pFEA =  ^FEA;
  698.  
  699. { flags for _FEA.fEA }
  700.  
  701.  
  702. Const
  703.   FEA_NEEDEA                       =  $80;                  { need EA bit }
  704.  
  705.  
  706. Type
  707.   FEALIST = Record                      { feal                                         }
  708.     cbList: ULONG;                      { total bytes of structure including full list }
  709.     list: Array[0..0] Of FEA            { variable length FEA structures }
  710.   End;
  711.   pFEALIST = ^FEALIST;
  712.  
  713.   EAOP = Record                         { eaop            }
  714.     fpGEAList: PGEALIST;                { general EA list }
  715.     fpFEAList: PFEALIST;                { full EA list }
  716.     oError: ULONG
  717.   End;
  718.   pEAOP = ^EAOP;
  719.  
  720. {
  721.  * Equates for the types of EAs that follow the convention that we have
  722.  * established.
  723.  *
  724.  * Values 0xFFFE thru 0x8000 are reserved.
  725.  * Values 0x0000 thru 0x7fff are user definable.
  726.  }
  727.  
  728.  
  729. Const
  730.   EAT_BINARY                       =  $FFFE;                { length preceeded binary            }
  731.   EAT_ASCII                        =  $FFFD;                { length preceeded ASCII             }
  732.   EAT_BITMAP                       =  $FFFB;                { length preceeded bitmap            }
  733.   EAT_METAFILE                     =  $FFFA;                { length preceeded metafile          }
  734.   EAT_ICON                         =  $FFF9;                { length preceeded icon              }
  735.   EAT_EA                           =  $FFEE;                { length preceeded ASCII ext. attr.  }
  736.                                         { name of associated data
  737.   EAT_MVMT                         =  $FFDF;                { multi-valued, multi-typed field    }
  738.   EAT_MVST                         =  $FFDE;                { multi-valued, single-typed field   }
  739.   EAT_ASN1                         =  $FFDD;                { ASN.1 field                        }
  740.  
  741.  
  742. {**   DosOpen - Open file
  743.  *
  744.  *     Creates or opens a specified file.
  745.  *
  746.  }
  747.  
  748.   Function DosOpen (pszFname: PSZ;                          { path name of file to be opened }
  749.                     phfOpen: PHFILE;                        { file handle (returned ) }
  750.                     pusAction: PUSHORT;                     { action taken (returned) }
  751.                     ulFSize: ULONG;                         { file's new size }
  752.                     usAttr,                                 { file attribute }
  753.                     fsOpenFlags,                            { action take if file exists }
  754.                     fsOpenMode: USHORT;                     { open mode }
  755.                     ulReserved: ULONG): USHORT;              { reserved (must be 0)           }
  756.  
  757.  
  758. {**    DosOpen2 - Open a File
  759.  *
  760.  *
  761.  *
  762.  *      Creates the specified file
  763.  *
  764.  *      Supports Extended Attributes
  765.  }
  766.  
  767.   Function DosOpen2 (pszFname: PSZ;                         { File path name }
  768.                      phfOpen: PHFILE;                       { New file's handle }
  769.                      pusAction: PUSHORT;                    { Action taken - 1=file existed, }{ 2=file was created }
  770.                      ulFSize: ULONG;                        { File primary allocation }
  771.                      usAttr,                                { File attributes }
  772.                      usOpenFlags: USHORT;                   { Open function type }
  773.                      usOpenMode: ULONG;                     { Open mode of the file }
  774.                      pvEABuf: PEAOP;                        { EA structure pointer }
  775.                      ulReserved: ULONG): USHORT;              { Reserved (must be zero)        }
  776.  
  777. {**   DosClose - Close file handle
  778.  *
  779.  *     Closes a specific file handle.
  780.  *
  781.  }
  782.  
  783.   Function DosClose (hf: HFILE): USHORT;                      { file handle }
  784.  
  785.  
  786. {**   DosRead - Read from file
  787.  *
  788.  *     Reads the specified number of bytes from a file or device to a buffer
  789.  *     location.
  790.  *
  791.  }
  792.  
  793.   Function DosRead (hf: HFILE;                              { file handle }
  794.                     pBuf: PVOID;                            { input buffer }
  795.                     cbBuf: USHORT;                          { number of bytes to be read }
  796.                     pcbBytesRead: PUSHORT): USHORT;          { number of bytes read (returned) }
  797.  
  798.  
  799. {**   DosWrite - Synchronous Write to file
  800.  *
  801.  *     Transfers the specified number of bytes from a buffer to the specified
  802.  *     file, synchronously with respect to the requesting process's execution.
  803.  *
  804.  }
  805.  
  806.   Function DosWrite (hf: HFILE;                             { file handle }
  807.                      pBuf: PVOID;                           { output buffer }
  808.                      cbBuf: USHORT;                         { number of bytes to be written }
  809.                      pcbBytesWritten: PUSHORT): USHORT;      { number of bytes written (returned) }
  810.  
  811.  
  812. {**   DosShutdown - File System Shutdown
  813.  *
  814.  *
  815.  *
  816.  }
  817.  
  818.   Function DosShutdown (ulReserved: ULONG): USHORT;     { reserved }
  819.  
  820.  
  821. {**    FileStatus - structure of information list used by DosQFileInfo }
  822.  
  823.  
  824. Type
  825.   FILESTATUS = Record                   { fsts  }
  826.     fdateCreation: FDATE;               { date of file creation }
  827.     ftimeCreation: FTIME;               { time of file creation }
  828.     fdateLastAccess: FDATE;             { date of last access }
  829.     ftimeLastAccess: FTIME;             { time of last access }
  830.     fdateLastWrite: FDATE;              { date of last write }
  831.     ftimeLastWrite: FTIME;              { time of last write }
  832.     cbFile,                             { file size (end of data) }
  833.     cbFileAlloc: ULONG;                 { file allocated size }
  834.     attrFile: USHORT                    { attributes of the file }
  835.   End;
  836.   pFILESTATUS = ^FILESTATUS;
  837.  
  838.   FILESTATUS2 = Record                  { fsts2 }
  839.     fdateCreation: FDATE;
  840.     ftimeCreation: FTIME;
  841.     fdateLastAccess: FDATE;
  842.     ftimeLastAccess: FTIME;
  843.     fdateLastWrite: FDATE;
  844.     ftimeLastWrite: FTIME;
  845.     cbFile,
  846.     cbFileAlloc: ULONG;
  847.     attrFile: USHORT;
  848.     cbList: ULONG
  849.   End;
  850.   pFILESTATUS2 = ^FILESTATUS2;
  851.  
  852. {**    FSAllocate - structure of file system allocation }
  853.  
  854.   FSALLOCATE = Record
  855.     idFileSystem,                       { file system ID }
  856.     cSectorUnit,                        { number sectors per allocation unit }
  857.     cUnit,                              { number of allocation units }
  858.     cUnitAvail: ULONG;                  { avalaible allocation units }
  859.     cbSector: USHORT                    { bytes per sector }
  860.   End;
  861.   pFSALLOCATE = ^FSALLOCATE;
  862.  
  863.   VOLUMELABEL = Record                  { vol }
  864.     cch: BYTE;
  865.     szVolLabel: Array[0..11] Of Char
  866.   End;
  867.   pVOLUMELABEL = ^VOLUMELABEL;
  868.  
  869.   FSINFO = Record                       { fsinf }
  870.     fdateCreation: FDATE;
  871.     ftimeCreation: FTIME;
  872.     vol: VOLUMELABEL
  873.   End;
  874.   pFSINFO = ^FSINFO;
  875.  
  876. { HANDTYPE values }
  877.  
  878.  
  879. Const
  880.   HANDTYPE_FILE                    =  $0000;
  881.   HANDTYPE_DEVICE                  =  $0001;
  882.   HANDTYPE_PIPE                    =  $0002;
  883.   HANDTYPE_NETWORK                 =  $8000;
  884.  
  885. Type
  886.   FILELOCK = Record                     { flock }
  887.     lOffset,
  888.     lRange: LongInt
  889.   End;
  890.   pFILELOCK = ^FILELOCK;
  891.  
  892.   HDIR = SHANDLE;        { hdir }
  893.   pHDIR = ^HDIR;
  894.  
  895.  
  896. {**    DosDelete - Delete file
  897.  *
  898.  *      Removes a directory entry associated with a filename.
  899.  *
  900.  }
  901.  
  902.   Function DosDelete (pszFName: PSZ;                        { name of file to be deleted }
  903.                       ulReserved: ULONG): USHORT;              { reserved (must be 0)       }
  904.  
  905.  
  906. {**   DosDupHandle - Duplicate file handle
  907.  *
  908.  *     Returns a new file handle for an open file that refers to the same file
  909.  *     at the same position.
  910.  *
  911.  }
  912.  
  913.   Function DosDupHandle (hfOld: HFILE;                      { current file handle }
  914.                          phfNew: PHFILE): USHORT;                 { new file handle (returned) }
  915. {**   DosQFHandState - Query file handle state
  916.  *
  917.  *     Queries the state of the specified file.
  918.  *
  919.  }
  920.  
  921.   Function DosQFHandState (hf: HFILE;                       { file handle }
  922.                            pfsOpenMode: PUSHORT): USHORT;           { file handle state (returned) }
  923.  
  924.  
  925. {**   DosSetFHandState - Set file handle state
  926.  *
  927.  *     Sets the state of the specified file.
  928.  *
  929.  }
  930.  
  931.   Function DosSetFHandState (hf: HFILE;                     { file handle }
  932.                              fsState: USHORT): USHORT;                { file handle state }
  933.  
  934.  
  935. {**   DosQHandType - Query handle type
  936.  *
  937.  *     Determines whether a handle references a file or a device.
  938.  *
  939.  }
  940.  
  941.   Function DosQHandType (hf: HFILE;                         { file handle }
  942.                          pfsType,                           { handle type (returned) }
  943.                          pusDevAttr: PUSHORT): USHORT;            { device driver attribute (returned) }
  944.  
  945. {**   DosReadAsync - Asynchronous read from file
  946.  *
  947.  *     Transfers the specified number of bytes from a file to a buffer,
  948.  *     asynchronously with the requesting process execution.
  949.  *
  950.  }
  951.  
  952.   Function DosReadAsync (hf: HFILE;                         { file handle }
  953.                          hsemRam: PULONG;                   { ram semaphore }{ (signals end of read operation) }
  954.                          pusErrCode: PUSHORT;               { return code (returned) }
  955.                          pBuf: PVOID;                       { input buffer }
  956.                          cbBuf: USHORT;                     { number of bytes to be read }
  957.                          pcbBytesRead: PUSHORT): USHORT;          { number of bytes read (returned) }
  958.  
  959.  
  960. {**   DosWriteAsync - Asynchronous write to file
  961.  *
  962.  *     Transers the specified number of bytes to a file from a buffer
  963.  *     asynchronously with respect to the requesting process's execution.
  964.  *
  965.  }
  966.  
  967.   Function DosWriteAsync (hf: HFILE;                        { file handle }
  968.                           hsemRam: PULONG;                  { ram semaphore }{ (indicates end of write operation) }
  969.                           pusErrCode: PUSHORT;              { return code (returned) }
  970.                           pBuf: PVOID;                      { output buffer }
  971.                           cbBuf: USHORT;                    { number of bytes to be written }
  972.                           pcbBytesWritten: PUSHORT): USHORT;       { number of bytes written (returned) }
  973.  
  974.  
  975. {**   DosFindFirst - Find first matching file
  976.  *
  977.  *     Finds the first set of filenames that match a given file specification.
  978.  *
  979.  }
  980.  
  981.   Function DosFindFirst (pszFSpec: PSZ;                     { path name of files to be found }
  982.                          phdir: PHDIR;                      { directory handle }
  983.                          usAttr: USHORT;                    { attribute used to search for the files }
  984.                          pffb: PFILEFINDBUF;                { result buffer }
  985.                          cbBuf: USHORT;                     { length of result buffer }
  986.                          pcSearch: PUSHORT;                 { number of matching entries in result buffer }
  987.                          ulReserved: ULONG): USHORT;     { reserved (must be 0)                        }
  988.  
  989. {**    DosFindFirst2 - Find First Matching File, version 2
  990.  *
  991.  *
  992.  *
  993.  *      Finds the first filename that matches the specified file
  994.  *      specification
  995.  *
  996.  *      Supports FileInfoLevel
  997.  }
  998.  
  999.   Function DosFindFirst2 (pszFSpec: PSZ;                    { File path name }
  1000.                           phdir: PHDIR;                     { Directory search handle }
  1001.                           usAttr: USHORT;                   { Search attribute }
  1002.                           pBuf: PVOID;                      { Result buffer }
  1003.                           cbBuf: USHORT;                    { Result buffer length }
  1004.                           pcSearch: PUSHORT;                { Number of entries to find }
  1005.                           usInfoLevel: USHORT;              { Request level }
  1006.                           ulReserved: ULONG): USHORT;              { Reserved (must be 0)      }
  1007.  
  1008. {**   DosFindNext - Find next matching file
  1009.  *
  1010.  *     Locates the next set of directory entries that match the name specified
  1011.  *     in the previous DosFindFirst or DosFindNext call.
  1012.  *
  1013.  }
  1014.  
  1015.   Function DosFindNext (hdir: HDIR;                         { directory handle }
  1016.                         pffb: PFILEFINDBUF;                 { result buffer }
  1017.                         cbBuf: USHORT;                      { length of result buffer }
  1018.                         pcSearch: PUSHORT): USHORT;              { number of entries to find }
  1019.  
  1020. {**   DosFindClose - Close find handle
  1021.  *
  1022.  *     Closes the association between a directory handle and a DosFindFirst or
  1023.  *     DosFindNext directory search function.
  1024.  *
  1025.  }
  1026.  
  1027.   Function DosFindClose (hdir: HDIR): USHORT;                     { directory handle }
  1028.  
  1029.  
  1030. {**    DosFindNotifyFirst - Start Monitoring a Directory for Change
  1031.  *
  1032.  *      Waits for changes
  1033.  *      to take place against the specified path.  The number of changes
  1034.  *      is specified in the change count parameter.
  1035.  *
  1036.  }
  1037.  
  1038.   Function DosFindNotifyFirst (pszPath: PSZ;                { Path spec }
  1039.                                hdir: PHDIR;                 { Directory search handle }
  1040.                                usAttr: USHORT;              { Search attribute }
  1041.                                pBuf: PBYTE;                 { Result buffer }
  1042.                                cbBuf: USHORT;               { Result buffer length }
  1043.                                pcChg: PUSHORT;              { Number of changes required }
  1044.                                usInfoLevel: USHORT;         { Request level }
  1045.                                ulTimeOut,                   { Timeout or Duration of call }
  1046.                                ulReserved: ULONG): USHORT;              { Reserved (must be 0)        }
  1047.  
  1048. {**    DosFindNotifyNext - Return Directory Change Information
  1049.  *
  1050.  *      Waits for changes
  1051.  *      to take place against the specified DirHandle.  The number of changes
  1052.  *      is specified in the change count parameter.
  1053.  *
  1054.  }
  1055.  
  1056.   Function DosFindNotifyNext (hdir: HDIR;                   { Directory handle }
  1057.                               pBuf: PVOID;                  { Result buffer }
  1058.                               cbBuf: USHORT;                { Result buffer length }
  1059.                               pcChg: PUSHORT;               { Number of required }
  1060.                               ulTimeOut: ULONG): USHORT;               { Timeout or Duration of call }
  1061.  
  1062.  
  1063. {**    DosFindNotifyClose - Close FindNotify Handle
  1064.  *
  1065.  *      Closes the association between a directory handle and a
  1066.  *      osFindNotifyFirst or DosFindNotifyNext function
  1067.  }
  1068.  
  1069.   Function DosFindNotifyClose (hdir: HDIR): USHORT;                    { Directory watch handle }
  1070.  
  1071.  
  1072.  
  1073. {**    DosFsAttach - Creates and Detroys FSD Connections
  1074.  *
  1075.  *      Attaches or detaches drive from a remote FSD or a psuedo-character
  1076.  *      device name to/from a local or remote FSD
  1077.  }
  1078.  
  1079.   Function DosFSAttach (pszDevName,                         { device name }
  1080.                         pszFSD: PSZ;                        { FSD name }
  1081.                         pData: PBYTE;                       { data buffer }
  1082.                         cbData,                             { data buffer length }
  1083.                         fsOp: USHORT;                       { open flag }
  1084.                         ulReserved: ULONG): USHORT;              { reserved           }
  1085.  
  1086.  
  1087.  
  1088. {**    DosQFsAttach - Query Attached FSD Information
  1089.  *
  1090.  *      Query information about an attached remote file system or about
  1091.  *      a character device or about a psuedo-character device attacted
  1092.  *      to a local or remote FSD
  1093.  }
  1094.  
  1095.   Function DosQFSAttach (pszDev: PSZ;                       { device name }
  1096.                          usOrdinal,                         { ordinal }
  1097.                          usInfoLevel: USHORT;               { FSAinfolevel }
  1098.                          pFSAttBuf: PBYTE;                  { Data buffer }
  1099.                          cbBuf: PUSHORT;                    { Data buffer length }
  1100.                          ulReserved: ULONG): USHORT;              { reserved           }
  1101.  
  1102.  
  1103.  
  1104. {**    DosFSCtl - File System Control
  1105.  *
  1106.  *      Allow an extended standard interface between an application
  1107.  *      and an FSD
  1108.  }
  1109.  
  1110.   Function DosFSCtl (pDate: PBYTE;                          { Data area }
  1111.                      cbData: USHORT;                        { Data length maximum }
  1112.                      pcbData: PUSHORT;                      { Data length }
  1113.                      pParms: PBYTE;                         { Parameter list }
  1114.                      cbParms: USHORT;                       { Parameter length max }
  1115.                      pcbParms: PUSHORT;                     { Parameter length }
  1116.                      usFunCode: USHORT;                     { Function code }
  1117.                      pszRoute: PSZ;                         { Route name }
  1118.                      hf: HFILE;                             { File handle }
  1119.                      usRouteMethod: USHORT;                 { Route method }
  1120.                      ulReserved: ULONG): USHORT;              { reserved             }
  1121.  
  1122.  
  1123.  
  1124. {**   DosNewSize - Change file size
  1125.  *
  1126.  *     Changes the size of a file.
  1127.  *
  1128.  }
  1129.  
  1130.   Function DosNewSize (hf: HFILE;                           { file handle }
  1131.                        ulNewSize: ULONG): USHORT;               { file's new size }
  1132.  
  1133.  
  1134. {**   DosBufReset - Commit File's cache buffers
  1135.  *
  1136.  *     Flushes a requesting process's cache buffers for a specific file handle.
  1137.  *
  1138.  }
  1139.  
  1140.   Function DosBufReset (hf: HFILE): USHORT;                      { file handle                    }
  1141.  
  1142.  
  1143. {**   DosChgFilePtr - Change
  1144.  *
  1145.  *     moves the read/write pointer in accordance with the method specified.
  1146.  *
  1147.  }
  1148.  
  1149.   Function DosChgFilePtr (hf: HFILE;                        { file handle }
  1150.                           lOffset: LongInt;                 { distance to move in bytes }
  1151.                           fsMethod: USHORT;                 { method of moving }
  1152.                           pulNewOffset: PULONG): USHORT;           { new pointer location (returned) }
  1153.  
  1154.  
  1155. {**  DosFileLocks - File lock manager
  1156.  *
  1157.  *    Locks and unlocks a range in an opened file
  1158.  *
  1159.  }
  1160.  
  1161.   Function DosFileLocks (hf: HFILE;                         { file handle }
  1162.                          pUnlock,                           { range to be unlocked }
  1163.                          pLock: PLONG): USHORT;                   { range to be locked   }
  1164.  
  1165.  
  1166. {**   DosMove - Move a file
  1167.  *
  1168.  *     moves a specified file.
  1169.  *
  1170.  }
  1171.  
  1172.   Function DosMove (pszOld,                                 { old path name }
  1173.                     pszNew: PSZ;                            { new path name }
  1174.                     ulReserved: ULONG): USHORT;              { reserved (must be 0)           }
  1175.  
  1176. {**   DosCopy - Copy file
  1177.  *
  1178.  *     copies file
  1179.  *
  1180.  }
  1181.  
  1182.   Function DosCopy (pszSrc,                                 { old path name }
  1183.                     pszDst: PSZ;                            { new path name }
  1184.                     usOpt: USHORT;                          { operation mode }
  1185.                     ulReserved: ULONG): USHORT;              { reserved (must be 0)            }
  1186.  
  1187.  
  1188. {**    DosEditName - Transform source string using editing string
  1189.  *
  1190.  *      Transform a source string into a destination string using an
  1191.  *      editing string and OS/2 meta editing semantics.
  1192.  *
  1193.  }
  1194.  
  1195.   Function DosEditName (usEditLevel: USHORT;                { Level of meta editing semantics }
  1196.                         pszSrc,                             { String to transform }
  1197.                         pszEdit: PSZ;                       { Editing string }
  1198.                         pszDst: PBYTE;                      { Destination string buffer }
  1199.                         cbDst: USHORT): USHORT;                  { Destination string buffer length }
  1200.  
  1201.  
  1202. {**    DosFileIO - Multiple Lock, Unlock, Seek, Read and Write I/O.
  1203.  *
  1204.  *      Combines the above File I/O operations into a single API providing
  1205.  *      improved performance.
  1206.  }
  1207.  
  1208.   Function DosFileIO (hf: HFILE;                            { File handle }
  1209.                       pbCmd: PBYTE;                         { Pointer to command list buffer }
  1210.                       cbCmd: USHORT;                        { Command list length }
  1211.                       pulErr: PLONG): USHORT;                  { Pointer to error offset        }
  1212.  
  1213. {**   DosMkDir - make subdirectory
  1214.  *
  1215.  *     Creates a specified directory
  1216.  *
  1217.  }
  1218.  
  1219.   Function DosMkDir (pszDirName: PSZ;                       { new directory name }
  1220.                      usReserved: ULONG): USHORT;              { reserved (must be 0)           }
  1221.  
  1222. {**    DosMkdir2 - Make Subdirectory
  1223.  *
  1224.  *
  1225.  *
  1226.  *      Creates the specified directory
  1227.  }
  1228.  
  1229.   Function DosMkDir2 (pszDir: PSZ;                          { New directory name }
  1230.                       pBuf: PEAOP;                          { EA structure pointer }
  1231.                       ulReserved: ULONG): USHORT;              { Reserved (must be 0) }
  1232.  
  1233. {**   DosRmDir - Remove subdirectory
  1234.  *
  1235.  *     Removes a subdirectory from the specified disk.
  1236.  *
  1237.  }
  1238.  
  1239.   Function DosRmDir (pszDir: PSZ;                           { directory name }
  1240.                      ulReserved: ULONG): USHORT;              { reserved (must be 0)           }
  1241.  
  1242.  
  1243. {**   DosSelectDisk - Select default drive
  1244.  *
  1245.  *     Selects the drive specified as the default drive for the calling
  1246.  *     process.
  1247.  *
  1248.  }
  1249.  
  1250.   Function DosSelectDisk (usDrvNum: USHORT): USHORT;               { new default drive number       }
  1251.  
  1252.  
  1253. {**   DosQCurDisk - Query current disk
  1254.  *
  1255.  *     Determines the current default drive for the requesting process.
  1256.  *
  1257.  }
  1258.  
  1259.   Function DosQCurDisk (pusDrvNum: PUSHORT;                 { default drive number (returned) }
  1260.                         pulLogDrvMap: PULONG): USHORT;         { bit map of logical drives (returned)}
  1261.  
  1262.  
  1263. {**   DosChDir - Change current directory
  1264.  *
  1265.  *     Defines the current directory for the requesting process.
  1266.  *
  1267.  }
  1268.  
  1269.   Function DosChDir (pszDir: PSZ;                           { directory path name }
  1270.                      ulReserved: ULONG): USHORT;              { reserved (must be 0)           }
  1271.  
  1272.  
  1273. {**   DosQCurDir - Query current directory
  1274.  *
  1275.  *     Gets the full path name of the current directory for the requesting
  1276.  *     process for the specified drive.
  1277.  *
  1278.  }
  1279.  
  1280.   Function DosQCurDir (usDrvNum: USHORT;                    { drive number }
  1281.                        pszPathBuf: PBYTE;                   { directory path name (returned) }
  1282.                        pcbPathBuf: PUSHORT): USHORT;            { length of directory path buffer }
  1283.                                         {
  1284.  
  1285.  
  1286. {**   DosQFSInfo - Query file system information
  1287.  *
  1288.  *     Queries information from a file system device.
  1289.  *
  1290.  }
  1291.  
  1292.   Function DosQFSInfo (usDrvNum,                            { logical drive number }
  1293.                        usInfoLevel: USHORT;                 { level of file information required }
  1294.                        pbInfo: PBYTE;                       { storage area for information returned }
  1295.                        cbInfo: USHORT): USHORT;              { length of storage area                }
  1296.  
  1297.  
  1298. {**   DosSetFSInfo - Set file system information
  1299.  *
  1300.  *     Sets information for a file system device.
  1301.  *
  1302.  }
  1303.  
  1304.   Function DosSetFSInfo (usDrvNum,                          { drive number }
  1305.                          usInfoLevel: USHORT;               { level of file information to be set }
  1306.                          pBuf: PBYTE;                       { storage area for new file system information }
  1307.                          cbBuf: USHORT): USHORT;        { length of storage area                       }
  1308.  
  1309.  
  1310. {**   DosQVerify - Query verify setting
  1311.  *
  1312.  *     Returns the value of the verify flag.
  1313.  *
  1314.  }
  1315.  
  1316.   Function DosQVerify (pfVerifyOn: PUSHORT): USHORT;            { current verify mode (returned)     }
  1317.  
  1318.  
  1319. {**   DosSetVerify - Set/reset verify switch
  1320.  *
  1321.  *     Sets the verify switch.
  1322.  *
  1323.  }
  1324.  
  1325.   Function DosSetVerify (fVerify: USHORT): USHORT;                { new verify mode                    }
  1326.  
  1327.  
  1328. {**   DosSetMaxFH - Set maximum file handles
  1329.  *
  1330.  *     Defines the maximum number of file handles for the current process.
  1331.  *
  1332.  }
  1333.  
  1334.   Function DosSetMaxFH (usHandles: USHORT): USHORT;           { number of file handles to be provided }
  1335.  
  1336. {**   DosQFileInfo - Query file information
  1337.  *
  1338.  *     Returns information for a specific file.
  1339.  *
  1340.  }
  1341.  
  1342.   Function DosQFileInfo (hf: HFILE;                         { file handle }
  1343.                          usInfoLevel: USHORT;               { level of file information required }
  1344.                          pInfoBuf: PBYTE;                   { storage area for returned information }
  1345.                          cbInfoBuf: USHORT): USHORT;           { length of storage area                }
  1346.  
  1347.  
  1348. {**   DosSetFileInfo - Set file information
  1349.  *
  1350.  *     Specifies information for a file
  1351.  *
  1352.  }
  1353.  
  1354.   Function DosSetFileInfo (hf: HFILE;                       { file handle }
  1355.                            usInfoLevel: USHORT;             { level of file information being set }
  1356.                            pInfoBuf: PBYTE;                 { storage area for file information }
  1357.                            cbInfoBuf: USHORT): USHORT;             { length of storage area              }
  1358.  
  1359.  
  1360. {**    DosQPathInfo - Query a Path's Information
  1361.  *
  1362.  *      Returns information for a specific file or directory
  1363.  }
  1364.  
  1365.   Function DosQPathInfo (pszPath: PSZ;                      { Path string }
  1366.                          usInfoLevel: USHORT;               { Path data required }
  1367.                          pInfoBuf: PBYTE;                   { Path data buffer }
  1368.                          cbInfoBuf: USHORT;                 { Path data buffer size }
  1369.                          ulReserved: ULONG): USHORT;              { Reserved (must be zero) }
  1370.  
  1371.  
  1372. {**    DosSetPathInfo - Set a Path's Information
  1373.  *
  1374.  *      Specifies information for a file or directory
  1375.  }
  1376.  
  1377.   Function DosSetPathInfo (pszPath: PSZ;                    { Path string }
  1378.                            usInfoLevel: USHORT;             { Path info data required }
  1379.                            pInfoBuf: PBYTE;                 { Path info buffer }
  1380.                            cbInfoBuf,                       { Path info buffer size }
  1381.                            usFlags: USHORT;                 { Path info flags }
  1382.                            ulReserved: ULONG): USHORT;              { Reserved (must be zero) }
  1383.  
  1384.  
  1385. {**   DosQFileMode - Query file mode
  1386.  *
  1387.  *     Queries the mode
  1388.  *
  1389.  }
  1390.  
  1391.   Function DosQFileMode (pszFname: PSZ;                     { file path name }
  1392.                          pusAttr: PUSHORT;                  { current file attribute (returned) }
  1393.                          ulReserved: ULONG): USHORT;              { reserved (must be 0)               }
  1394.  
  1395.  
  1396. {**   DosSetFileMode - Set file mode
  1397.  *
  1398.  *     Changes the mode
  1399.  *
  1400.  }
  1401.  
  1402.   Function DosSetFileMode (pszFName: PSZ;                   { file path name }
  1403.                            usAttr: USHORT;                  { new attribute of file }
  1404.                            ulReserved: ULONG): USHORT;              { reserved (must be 0)               }
  1405.  
  1406. {**    DosEnumAttribute - Enumerate a file or directory's extended attributes
  1407.  *
  1408.  *      Enumerates information for a specific file or subdirectory
  1409.  *
  1410.  }
  1411.  
  1412.   Function DosEnumAttribute (Par1: USHORT;                  { RefType - indicates handle or path }
  1413.                              Par2: PVOID;                   { Pointer to file handle or path }
  1414.                              Par3: ULONG;                   { Starting entry in EA list }
  1415.                              Par4: PVOID;                   { Data buffer }
  1416.                              Par5: ULONG;                   { Data buffer size }
  1417.                          Var Par6: ULONG;                   { Number of entries to return }
  1418.                              Par7: ULONG;                   { Info level }
  1419.                              Par8: ULONG): USHORT;          { Reserved (must be zero)            }
  1420.  
  1421. Type
  1422.   DENA1 = Record                        { level 1 info returned from DosEnumAttribute }
  1423.     reserved,                           { 0 }
  1424.     cbName: UCHAR;                      { length of name exculding NULL }
  1425.     cbValue: USHORT;                    { length of value }
  1426.     szName: Array[0..0] Of UCHAR        { variable length asciiz name }
  1427.   End;
  1428.   pDENA1 = ^DENA1;
  1429.  
  1430.  
  1431.  
  1432. {** Memory management }
  1433.  
  1434.  
  1435. {**   DosAllocSeg - Allocate segment
  1436.  *
  1437.  *     Allocates a segment of memory to a requesting process.
  1438.  *
  1439.  }
  1440.  
  1441.   Function DosAllocSeg (cbSize: USHORT;                     { number of bytes requested }
  1442.                         pSel: PSEL;                         { sector allocated (returned) }
  1443.                         fsAlloc: USHORT): USHORT;       { sharing attributes of the allocated segment }
  1444.  
  1445.  
  1446. {**   DosReallocSeg - Change segment size
  1447.  *
  1448.  *     Changes the size of a segment already allocated.
  1449.  *
  1450.  }
  1451.  
  1452.   Function DosReallocSeg (cbNewSize: USHORT;                { new size requested in bytes }
  1453.                           sel: SEL): USHORT;                    { selector of the segment to be resized }
  1454.  
  1455.  
  1456. {**   DosFreeSeg - Free segment
  1457.  *
  1458.  *     Deallocates a memory segment.
  1459.  *
  1460.  }
  1461.  
  1462.   Function DosFreeSeg (sel: SEL): USHORT;                      { selector of the segment to be freed }
  1463.  
  1464.  
  1465. {**   DosGivSeg - Give access to segment
  1466.  *
  1467.  *     Gives another process access to a shared memory segment.
  1468.  *
  1469.  }
  1470.  
  1471.   Function DosGiveSeg (sel: SEL;                            { segment selector of the memory }{ segment to be shared }
  1472.                        pid: PID;                            { process ID of recipient }
  1473.                        pSelRecipient: PSEL): USHORT;            { recipients segment selector    }
  1474.                                         {
  1475.  
  1476.  
  1477. {**   DosGetSeg - Access segment
  1478.  *
  1479.  *     Gets access to a shared memory segment.
  1480.  *
  1481.  }
  1482.  
  1483.   Function DosGetSeg (sel: SEL): USHORT;                       { selector to access                 }
  1484.  
  1485.  
  1486. {**   DosSizeSeg - Get size of a segment.                      }
  1487.  
  1488.   Function DosSizeSeg (sel: SEL;                            { segment selector of which size }{ is to be found }
  1489.                        pcbSize: PULONG): USHORT;                { size in bytes (returned)       }
  1490.  
  1491. { Segment attribute flags
  1492.  
  1493.  
  1494. Const
  1495.   SEG_NONSHARED                    =  $0000;
  1496.   SEG_GIVEABLE                     =  $0001;
  1497.   SEG_GETTABLE                     =  $0002;
  1498.   SEG_DISCARDABLE                  =  $0004;
  1499.  
  1500.  
  1501.  
  1502.  
  1503. {**   DosAllocHuge - Allocate huge memory
  1504.  *
  1505.  *     Allocates multiple segments of memory.
  1506.  *
  1507.  }
  1508.  
  1509.   Function DosAllocHuge (cSegs,                             { number of 64k segments }
  1510.                          cbPartialSeg: USHORT;              { number of bytes in last non-64k segment }
  1511.                          psel: PSEL;                        { selector allocated (returned) }
  1512.                          cMaxSegs,                          { max number of 64k segments }
  1513.                          fsAlloc: USHORT): USHORT;       { sharing attributes of the allocated segment }
  1514.  
  1515.  
  1516. {**   DosReallocHuge - Change huge memory size
  1517.  *
  1518.  *     Changes the size of memory originally allocated by DosAllocHuge.
  1519.  *
  1520.  }
  1521.  
  1522.   Function DosReallocHuge (cSegs,                           { number of 64k segments requested }
  1523.                            cbPartialSeg: USHORT;            { number of bytes in last non-64k segment }
  1524.                            sel: SEL): USHORT;                  { selector                                }
  1525.  
  1526.  
  1527. {**   DosGetHugeShift - Get shift count
  1528.  *
  1529.  *    Returns a shift count used to derive the selectors that address memory
  1530.  *    allocated with DosAllocHuge.
  1531.  *
  1532.  }
  1533.  
  1534.   Function DosGetHugeShift (pusShiftCount: PUSHORT): USHORT;         { shift count (returned)             }
  1535.  
  1536.  
  1537. {**   DosAllocShrSeg - Allocate shared segment
  1538.  *
  1539.  *     Allocates a shared memory segment to a process.
  1540.  *
  1541.  }
  1542.  
  1543.   Function DosAllocShrSeg (cbSeg: USHORT;                   { number of bytes requested }
  1544.                            pszSegName: PSZ;                 { symbolic name associated with shared memory }
  1545.                            psel: PSEL): USHORT;            { selector of allocated segment (returned)    }
  1546.  
  1547.  
  1548. {**   DosLockSeg - Lock segment in memory
  1549.  *
  1550.  *     Locks a discardable segment in memory.
  1551.  *
  1552.  }
  1553.  
  1554.   Function DosLockSeg (sel: SEL): USHORT;                       { selector of segment to be locked   }
  1555.  
  1556.  
  1557. {**   DosUnlockSeg - Unlock segment
  1558.  *
  1559.  *     Unlocks a discardable segment.
  1560.  *
  1561.  }
  1562.  
  1563.   Function DosUnlockSeg (sel: SEL): USHORT;                       { selector of segment to be unlocked }
  1564.  
  1565.  
  1566. {**   DosGetShrSeg - Access shared segment
  1567.  *
  1568.  *     Accesses a shared memory segment previously allocated by another
  1569.  *     process.
  1570.  *
  1571.  }
  1572.  
  1573.   Function DosGetShrSeg (pszSegName: PSZ;                   { name string associated with the }{ shared memory segment }
  1574.                          psel: PSEL): USHORT;                     { selector of shared memory segment }
  1575.                                         {
  1576.  
  1577.  
  1578. {**   DosMemAvail - Get size of largest free memory block
  1579.  *
  1580.  *     Returns the size of the largest block of free memory.
  1581.  *
  1582.  }
  1583.  
  1584.   Function DosMemAvail (pcbFree: PULONG): USHORT;             { size of largest free block (returned) }
  1585.  
  1586.  
  1587. {**   DosCreateCSAlias - Create CS alias
  1588.  *
  1589.  *     Creates a code segment alias descriptor for a data segment passed as
  1590.  *     input.
  1591.  *
  1592.  }
  1593.  
  1594.   Function DosCreateCSAlias (selDs: SEL;                    { data segment selector }
  1595.                              pselCS: PSEL): USHORT;                   { selector of code segment allias }
  1596.                                         { descriptor
  1597.  
  1598.  
  1599. {**   DosSubAlloc - Suballocate memory within segment
  1600.  *
  1601.  *     Allocates memory from a segment previously allocated by DosAllocSeg or
  1602.  *     DosAllocShrSeg and initialized by DosSubSet.
  1603.  *
  1604.  }
  1605.  
  1606.   Function DosSubAlloc (sel: SEL;                           { segment selector from which memory }{ is to be allocated }
  1607.                         ousOffset: PUSHORT;                 { offset to the block allocated (returned) }
  1608.                         cb: USHORT): USHORT;               { size of memory block requested in bytes  }
  1609.  
  1610.  
  1611. {**   DosSubFree - Free memory suballocated within segment
  1612.  *
  1613.  *     Frees memory previously allocated by DosSubAlloc.
  1614.  *
  1615.  }
  1616.  
  1617.   Function DosSubFree (sel: SEL;                            { segment selector from which }{ memory is to be freed }
  1618.                        offBlock,                            { offset of memory block to free }
  1619.                        cb: USHORT): USHORT;                 { size of the block to be freed in bytes }
  1620.  
  1621.  
  1622. {**   DosSubSet - Initialize or set allocated memory
  1623.  *
  1624.  *     Used to initialize a segment for suballocation or to increase the size
  1625.  *     a previously initialized, suballocated segment.
  1626.  *
  1627.  }
  1628.  
  1629.   Function DosSubSet (sel: SEL;                             { selector of the target data segment }
  1630.                       fFlags,                               { 0=increasing size of a segment }{ 1=initializing a segment }
  1631.                       cbNew: USHORT): USHORT;                 { size of the segment in bytes        }
  1632.  
  1633.  
  1634.  
  1635. {** Semaphore support }
  1636.  
  1637.  
  1638. Const
  1639.   SEM_INDEFINITE_WAIT              = -1 ;
  1640.   SEM_IMMEDIATE_RETURN             = 0 ;
  1641.  
  1642. {**   DosSemClear - Clear
  1643.  *
  1644.  *     Unconditionally clears a semaphore. If any threads were blocked on the
  1645.  *     semaphore, they are restarted.
  1646.  *
  1647.  }
  1648.  
  1649.   Function DosSemClear (hsem: HSEM): USHORT;                     { semaphore handle                   }
  1650.  
  1651.  
  1652. {**   DosSemSet - Set Semaphore Owned
  1653.  *
  1654.  *     Unconditionally sets a seaphore.
  1655.  *
  1656.  }
  1657.  
  1658.   Function DosSemSet (hsem: HSEM): USHORT;                     { semaphore handle                   }
  1659.  
  1660.  
  1661. {**   DosSemWait - Wait for semaphore to clear
  1662.  *
  1663.  *     Blocks the current thread until an indicated semaphore clears, but does
  1664.  *     not establish ownership of this semaphore.
  1665.  *
  1666.  }
  1667.  
  1668.   Function DosSemWait (hsem: HSEM;                          { semaphore handle }
  1669.                        lTimeOut: LongInt): USHORT;                 { timeout (in milliseconds)          }
  1670.  
  1671.  
  1672. {**   DosSemSetWait - Set semaphore and wait for next clear
  1673.  *
  1674.  *     Blocks the current thread until the next DosSemClear is issued. However,
  1675.  *     DosSemSetWait does not establish ownership of this semaphore.
  1676.  *
  1677.  }
  1678.  
  1679.   Function DosSemSetWait (hsem: HSEM;                       { semaphore handle }
  1680.                           lTimeOut: LongInt): USHORT;                 { timeout (in milliseconds)          }
  1681.  
  1682.  
  1683. {**   DosSemRequest - Request semaphore
  1684.  *
  1685.  *     Obtains a semaphore. If the semaphore is already owned, the requesting
  1686.  *     thread is placed in a wait state until the semaphore is released or
  1687.  *     until a time out occures.
  1688.  *
  1689.  }
  1690.  
  1691.   Function DosSemRequest (hsem: HSEM;                       { semaphore handle }
  1692.                           lTimeOut: LongInt): USHORT;                 { timeout (in milliseconds)          }
  1693.  
  1694.  
  1695. Type
  1696.   HSYSSEM = LHANDLE;
  1697.   pHSYSSEM = ^HSYSSEM;
  1698.  
  1699.  
  1700. {**   DosCreateSem - Create system semaphore
  1701.  *
  1702.  *     Creates a system semaphore used by semaphore manipulation calls such as
  1703.  *     DosSemRequest, DosSemClear, DosSemSet, DosSemSetWait, DosSemWait, and
  1704.  *     DosMuxSemWait.
  1705.  *
  1706.  }
  1707.  
  1708.   Function DosCreateSem (fExclusive: USHORT;                { indicate no exclusive ownership }
  1709.                          phsem: PHSYSSEM;                   { semaphore handle (returned) }
  1710.                          pszSemName: PSZ): USHORT;                { semaphore name string              }
  1711.  
  1712.  
  1713. Const
  1714.   CSEM_PRIVATE                     = 0;
  1715.   CSEM_PUBLIC                      = 1;
  1716.  
  1717.  
  1718. {**   DosOpenSem - Open existing system semaphore
  1719.  *
  1720.  *     Opens a system semaphore.
  1721.  *
  1722.  }
  1723.  
  1724.   Function DosOpenSem (phsem: PHSEM;                        { semaphore handle (returned) }
  1725.                        pszSemName: PSZ): USHORT;                { semaphore name string              }
  1726.  
  1727.  
  1728. {**   DosCloseSem - Close system semaphore
  1729.  *
  1730.  *     Closes a specific system semaphore.
  1731.  *
  1732.  }
  1733.  
  1734.   Function DosCloseSem (hsem: HSEM): USHORT;                     { semaphore handle                   }
  1735.  
  1736.  
  1737. Type
  1738.   MUXSEM = Record
  1739.     zero: USHORT;                       { zero }
  1740.     hsem: HSEM                          { semaphore handle }
  1741.   End;
  1742.   pMUXSEM = ^MUXSEM;
  1743.  
  1744.   MUXSEMLIST = Record
  1745.     cmxs: USHORT;                       { count of MUXSEM structures }
  1746.     amxs: Array[0..15] Of MUXSEM        { array of MUXSEM structures }
  1747.   End;
  1748.   pMUXSEMLIST = ^MUXSEMLIST;
  1749.  
  1750. {
  1751.  * Since a MUXSEMLIST structure is actually a variable length
  1752.  * structure, the following macro may be used to define a MUXSEMLIST
  1753.  * structure having size elements, named "name".
  1754. }
  1755. (******
  1756. #define DEFINEMUXSEMLIST(name, size) \
  1757.     struct {                         \
  1758.         USHORT cmxs;                 \
  1759.         MUXSEM amxs[size];           \
  1760.     } name;
  1761. *******)
  1762.  
  1763. {
  1764.  * This function actually takes a far pointer to a MUXSEMLIST structure
  1765.  * as its second parameter, but in order to allow its use with the
  1766.  * DEFINEMUXSEMLIST macro, it is declared here as PVOID.
  1767.  }
  1768.  
  1769.  
  1770. {**   DosMuxSemWait - Wait for one of n semaphores to clear
  1771.  *
  1772.  *     Blocks a current thread until one of the specefied semaphores clear.
  1773.  *
  1774.  }
  1775.  
  1776.   Function DosMuxSemWait (pisemCleared: PUSHORT;            { index number of event (returned) }
  1777.                           pmsxl: PVOID;                     { semaphore list }
  1778.                           lTimeOut: LongInt): USHORT;                 { timeout (in milliseconds)          }
  1779.  
  1780.  
  1781. {** Fast safe ram semaphores }
  1782.  
  1783.  
  1784. Type
  1785.   DOSFSRSEM = Record
  1786.     cb: USHORT;                         { length of this structure (bytes) }
  1787.     pid: PID;                           { Process ID of the owner or zero }
  1788.     tid: TID;                           { Thread ID of the owner or zero }
  1789.     cUsage,                             { Reference count }
  1790.     client: USHORT;                     { 16 bit field for use by owner }
  1791.     sem: ULONG                          { OS/2 Ram Semaphore }
  1792.   End;
  1793.   pDOSFSRSEM = ^DOSFSRSEM;
  1794.  
  1795.  
  1796. {**   DosFSRamSemRequest - Safe ram semaphore request
  1797.  *
  1798.  *     Obtains a ram seaphore and records the current owner for potential
  1799.  *     cleanup by a dos exit list routine.
  1800.  *
  1801.  }
  1802.  
  1803.   Function DosFSRamSemRequest (pdosfsrs: PDOSFSRSEM;        { Address of the fast-safe }{ RamSemaphore data structure }
  1804.                                lTimeOut: LongInt): USHORT;                 { timeout, in milliseconds    }
  1805.  
  1806.  
  1807. {**   DosFSRamSemClear - Clear (release) a fast-safe ram semaphore}
  1808.  
  1809. Function DosFSRamSemClear(pdosfsrs: pDOSFSRSEM): USHORT; {Address of the fast-safe}
  1810.                                                          {RamSemaphore data structure}
  1811.  
  1812.  
  1813.  
  1814.  
  1815. {** Time support }
  1816.  
  1817.  
  1818. Type
  1819.   DATETIME = Record
  1820.     hours,                              { current hour }
  1821.     minutes,                            { current minute }
  1822.     seconds,                            { current second }
  1823.     hundredths,                         { current hundredths of a second }
  1824.     day,                                { current day }
  1825.     month: UCHAR;                       { current month }
  1826.     year: USHORT;                       { current year }
  1827.     timezone: SHORT;                    { minutes of time west of GMT }
  1828.     weekday: UCHAR                      { current day of week }
  1829.   End;
  1830.   pDATETIME = ^DATETIME;
  1831.  
  1832.  
  1833. {**   DosGetDateTime - Get current date and time
  1834.  *
  1835.  *     Gets the current date and time maintained by the operating system.
  1836.  *
  1837.  }
  1838.  
  1839.   Function DosGetDateTime (pdatetime: PDATETIME): USHORT;           { date/time structure (returned)     }
  1840.  
  1841.  
  1842. {**   DosSetDateTime - Set current date and time
  1843.  *
  1844.  *     Used to set the date and time that are maintained by the operating
  1845.  *     system.
  1846.  *
  1847.  }
  1848.  
  1849.   Function DosSetDateTime (pdatetime: PDATETIME): USHORT;           { date/time structure                }
  1850.  
  1851. Type
  1852.   HTIMER = SHANDLE;
  1853.   pHTIMER = ^HTIMER;
  1854.  
  1855.  
  1856. {**   DosTimerAsync - Start asynchronous time delay
  1857.  *
  1858.  *     Starts a timer that runs asynchronously to the thread issuing the
  1859.  *     request and clears a sytem semaphore when the specified interval
  1860.  *     expires.
  1861.  *
  1862.  }
  1863.  
  1864.   Function DosTimerAsync (ulTime: ULONG;                    { time (in milliseconds) before }{ semaphore is cleared }
  1865.                           hsem: HSEM;                       { system semaphore handle }
  1866.                           phtimer: PHTIMER): USHORT;               { timer handle (returned)            }
  1867.  
  1868.  
  1869. {**   DosTimerStart - Start periodic interval timer
  1870.  *
  1871.  *     Starts a periodic interval timer that runs asynchronously to the thread
  1872.  *     issuing the request.
  1873.  *
  1874.  }
  1875.  
  1876.   Function DosTimerStart (ulTime: ULONG;                    { time (in milliseconds) before }{ semaphore is cleared }
  1877.                           hsem: HSEM;                       { system semaphore handle }
  1878.                           phtimer: PHTIMER): USHORT;               { timer handle (returned)            }
  1879.  
  1880.  
  1881. {**   DosTimerStop - Stop interval timer
  1882.  *
  1883.  *     Stops a periodic interval timer started by DosTimerStart, or an
  1884.  *     asynchronous timer started by DosTimerAsync.
  1885.  *
  1886.  }
  1887.  
  1888.   Function DosTimerStop (htimer: HTIMER): USHORT;                 { handle of the timer                }
  1889.  
  1890.  
  1891.  
  1892. {** Module manager }
  1893.  
  1894.  
  1895.  
  1896. {**   DosLoadModule - Load dynamic link module
  1897.  *
  1898.  *     Loads a dynamic link module and returns a handle for the module.
  1899.  *
  1900.  }
  1901.  
  1902.   Function DosLoadModule (pszFailName: PSZ;                 { object name buffer }
  1903.                           cbFileName: USHORT;               { length of object name buffer }
  1904.                           pszModName: PSZ;                  { dynamic link module name string }
  1905.                           hmod: PHMODULE): USHORT;                 { module handle (returned)           }
  1906.  
  1907.  
  1908. {**   DosFreeModule - Free dynamic link module
  1909.  *
  1910.  *     Frees the reference to a dynamic link module for a process. When the
  1911.  *     dynamic link module is no longer needed by any process, the module is
  1912.  *     freed from system memory.
  1913.  *
  1914.  }
  1915.  
  1916.   Function DosFreeModule (hmod: HMODULE): USHORT;                  { module handle                      }
  1917.  
  1918.  
  1919. {**   DosGetProcAddr - Get dynamic link procedure address
  1920.  *
  1921.  *     Returns a far address to a desired procedure within a dynamic link
  1922.  *     module.
  1923.  *
  1924.  }
  1925.  
  1926.   Function DosGetProcAddr (hmod: HMODULE;                   { handle of module where procedure is located }
  1927.                            pszProcName: PSZ;                { name of module where procedure is located }
  1928.                       Var  ppfnProcAddr: pFn): USHORT;      { procedure address (returned)       }
  1929.  
  1930.  
  1931.  
  1932. {**   DosGetModHandle - Get dynamic link module handle
  1933.  *
  1934.  *     Returns a handle to a previously loaded dynamic link module.
  1935.  *
  1936.  }
  1937.  
  1938.   Function DosGetModHandle (pszModName: PSZ;                { dynamic link module name }
  1939.                             phmod: PHMODULE): USHORT;                { module handle (returned)           }
  1940.  
  1941.  
  1942. {**   DosGetModName - Get dynamic link module name
  1943.  *
  1944.  *     Returns the fully qualified drive, path, filename, and extension
  1945.  *     associated with a referenced module handle.
  1946.  *
  1947.  }
  1948.  
  1949.   Function DosGetModName (hmod: HMODULE;                    { module handle }
  1950.                           cbBuf: USHORT;                    { max length of buffer where name is stored }
  1951.                           pchBuf: PCHAR): USHORT;           { buffer (returned) where info is stored    }
  1952.  
  1953.  
  1954.  
  1955. {** Resource support }
  1956.  
  1957. { Predefined resource types }
  1958.  
  1959.  
  1960. Const
  1961.   RT_POINTER              = 1;                     { mouse pointer shape }
  1962.   RT_BITMAP                        = 2;                     { bitmap }
  1963.   RT_MENU                          = 3;                     { menu template }
  1964.   RT_DIALOG                        = 4;                     { dialog template }
  1965.   RT_STRING                        = 5;                     { string tables }
  1966.   RT_FONTDIR                       = 6;                     { font directory }
  1967.   RT_FONT                          = 7;                     { font }
  1968.   RT_ACCELTABLE                    = 8;                     { accelerator tables }
  1969.   RT_RCDATA                        = 9;                     { binary data }
  1970.   RT_MESSAGE                       = 10;                    { error msg     tables }
  1971.   RT_DLGINCLUDE                    = 11;                    { dialog include file name }
  1972.   RT_VKEYTBL                       = 12;                    { key to vkey tables }
  1973.   RT_KEYTBL                        = 13;                    { key to UGL tables }
  1974.   RT_CHARTBL                       = 14;                    { glyph to character tables }
  1975.   RT_DISPLAYINFO                   = 15;                    { screen display information }
  1976.   RT_FKASHORT                      = 16;                    { function key area short form }
  1977.   RT_FKALONG                       = 17;                    { function key area long form }
  1978.  
  1979.   RT_HELPTABLE                     = 18;                    { Help table for IPFC }
  1980.   RT_HELPSUBTABLE                  = 19;                    { Help subtable for IPFC }
  1981.  
  1982.   RT_FDDIR                         = 20;                    { DBCS uniq/font driver directory }
  1983.   RT_FD                            = 21;                    { DBCS uniq/font driver }
  1984.   RT_MAX                           = 22;                    { 1st unused Resource Type }
  1985.  
  1986.  
  1987.  
  1988.  
  1989. {**   DosGetResource - Get resource segment selector
  1990.  *
  1991.  *     Returns the segment selector of the specified resource segment.
  1992.  *
  1993.  }
  1994.  
  1995.   Function DosGetResource (hmod: HMODULE;                   { module handle }
  1996.                            idType,                          { resource type ID }
  1997.                            idName: USHORT;                  { resource name ID }
  1998.                            psel: PSEL): USHORT;                     { resource selector (returned) }
  1999.  
  2000.  
  2001. {**   DosGetResource2 - Get resource far pointer
  2002.  *
  2003.  *     Returns a far pointer to the specified resource data.
  2004.  *
  2005.  }
  2006.  
  2007.   Function DosGetResource2 (hmod: HMODULE;                  { module handle }
  2008.                             idType,                         { resource type ID }
  2009.                             idName: USHORT;                 { resource name ID }
  2010.                         Var ppData: Pointer): USHORT;            { resource far pointer (returned) }
  2011.  
  2012.  
  2013. {**   DosFreeResource - Free Resource
  2014.  *
  2015.  *     Deallocates memory of a resource.
  2016.  *
  2017.  }
  2018.  
  2019.   Function DosFreeResource (pData: PVOID): USHORT;                   { resource pointer }
  2020.  
  2021.  
  2022.  
  2023.  
  2024. {** NLS Support }
  2025.  
  2026.  
  2027. {**   _COUNTRYCODE is used by DOSGETCTRYINFO to store
  2028.  *              the country code and code page
  2029.  }
  2030.  
  2031.  
  2032. Type
  2033.   COUNTRYCODE = Record
  2034.     country,                            { country code }
  2035.     codepage: USHORT                    { code page }
  2036.   End;
  2037.   pCOUNTRYCODE = ^COUNTRYCODE;
  2038.  
  2039. {**   _COUNTRYINFO is used by DOSGETCTRYINFO to store
  2040.  *              various country-dependent data items
  2041.  }
  2042.  
  2043.   COUNTRYINFO = Record
  2044.     country,                            { country code }
  2045.     codepage,                           { code page }
  2046.     fsDateFmt: USHORT;                  { date format }
  2047.     szCurrency: Array[0..4] Of Char;    { currency indicator }
  2048.     szThousandsSeparator,               { thousands separator }
  2049.     szDecimal,                          { decimal separator }
  2050.     szDateSeparator,                    { date separator }
  2051.     szTimeSeparator: Array[0..1] Of Char; { time separator }
  2052.     fsCurrencyFmt,                      { bit fields for currency format }
  2053.     cDecimalPlace,                      { currency decimal places }
  2054.     fsTimeFmt: UCHAR;                   { Time format (AM/PM or 24 hr) }
  2055.     abReserved1: Array[0..1] Of USHORT; { reserved (0) }
  2056.     szDataSeparator: Array[0..1] Of Char; { Data list separator }
  2057.     abReserved2: Array[0..4] Of USHORT  { reserved (0) }
  2058.   End;
  2059.   pCOUNTRYINFO = ^COUNTRYINFO;
  2060.  
  2061.  
  2062. {**   DosGetCtryInfo - Get country information
  2063.  *
  2064.  *     Obtains contry dependent formatting information that resides in the
  2065.  *     country information file.
  2066.  *
  2067.  }
  2068.  
  2069.   Function DosGetCtryInfo (cbBuf: USHORT;                   { length of data area provided }
  2070.                            pctryc: PCOUNTRYCODE;            { input data structure }
  2071.                            pctryi: PCOUNTRYINFO;            { data area to be filled by the function }
  2072.                            pcbCtryInfo: PUSHORT): USHORT;       { length of data (returned)              }
  2073.  
  2074.  
  2075. {**   DosGetDBCSEv - Get DBCS environmental vector
  2076.  *
  2077.  *     Obtains a DBCS
  2078.  *     resides in the country information file
  2079.  *
  2080.  }
  2081.  
  2082.   Function DosGetDBCSEv (cbBuf: USHORT;                     { length of data area provided }
  2083.                          pctryc: PCOUNTRYCODE;              { input data structure }
  2084.                          pchBuf: PCHAR): USHORT;                { data area to contain the information }
  2085.  
  2086.  
  2087. {**   DosCaseMap - Perform case mapping
  2088.  *
  2089.  *     Performs case mapping on a string of binary values that represent ASCII
  2090.  *     characters.
  2091.  *
  2092.  }
  2093.  
  2094.   Function DosCaseMap (usLen: USHORT;                       { length of string to case map }
  2095.                        pctryc: PCOUNTRYCODE;                { input data structure }
  2096.                        pchStr: PCHAR): USHORT;                 { address of string to be case mapped }
  2097.  
  2098.  
  2099. {**   DosGetCollate - Get collate table
  2100.  *
  2101.  *     Obtains a collating sequence table
  2102.  *     resides in the country information file. It is used by the SORT utility
  2103.  *     to sort text according to the collating sequence.
  2104.  *
  2105.  }
  2106.  
  2107.   Function DosGetCollate (usLen: USHORT;                    { length of data area provided }
  2108.                           pctryc: PCOUNTRYCODE;             { input data structure }
  2109.                           pchBuf: PCHAR;                    { data area to contain the collate table }
  2110.                           pcbTable: PUSHORT): USHORT;          { length of table (returned)             }
  2111.  
  2112.  
  2113. {**   DosGetCp - Get process code page
  2114.  *
  2115.  *     Allows a process to query the current process code page and the prepared
  2116.  *     system code pages.
  2117.  *
  2118.  }
  2119.  
  2120.   Function DosGetCp (cbBuf: USHORT;                         { length of CodePageList in bytes }
  2121.                      pBuf,                                  { CodePageList (returned) }
  2122.                      pcbCodePgLst: PUSHORT): USHORT;          { length of returned list            }
  2123.  
  2124.  
  2125. {**   DosSetCp - Set code page
  2126.  *
  2127.  *     Allows a process to set its code page and the session's display code
  2128.  *     page and keyboard code page.
  2129.  *
  2130.  }
  2131.  
  2132.   Function DosSetCp (usCodePage,                            { code page identifier }
  2133.                      usReserved: USHORT): USHORT;             { reserved (must be set to 0)        }
  2134.  
  2135. {** DosSetProcCp - Set process code page
  2136.  *
  2137.  *     Allows a process to set it's own code page.
  2138.  }
  2139.  
  2140.   Function DosSetProcCp (usCodePage,                        { Code page identifier word }
  2141.                          usReserved: USHORT): USHORT;             { Reserved (must be set to 0)        }
  2142.  
  2143.  
  2144.  
  2145. {** Signal support }
  2146.  
  2147.  
  2148. { Signal Numbers for DosSetSigHandler  }
  2149.  
  2150.  
  2151. Const
  2152.   SIG_CTRLC               = 1;                     { Control C            }
  2153.   SIG_BROKENPIPE                   = 2;                     { Broken Pipe          }
  2154.   SIG_KILLPROCESS                  = 3;                     { Program Termination  }
  2155.   SIG_CTRLBREAK                    = 4;                     { Control Break        }
  2156.   SIG_PFLG_A                       = 5;                     { Process Flag A       }
  2157.   SIG_PFLG_B                       = 6;                     { Process Flag B       }
  2158.   SIG_PFLG_C                       = 7;                     { Process Flag C       }
  2159.   SIG_CSIGNALS                     = 8;                     { number of signals plus one }
  2160.  
  2161. { Flag Numbers for DosFlagProcess      }
  2162.  
  2163.   PFLG_A                           = 0;                     { Process Flag A       }
  2164.   PFLG_B                           = 1;                     { Process Flag B       }
  2165.   PFLG_C                           = 2;                     { Process Flag C       }
  2166.  
  2167. { Signal actions }
  2168.  
  2169.   SIGA_KILL                        = 0;
  2170.   SIGA_IGNORE                      = 1;
  2171.   SIGA_ACCEPT                      = 2;
  2172.   SIGA_ERROR                       = 3;
  2173.   SIGA_ACKNOWLEDGE                 = 4;
  2174.  
  2175. { DosHoldSignal constants }
  2176.  
  2177.   HLDSIG_ENABLE                    = 0;
  2178.   HLDSIG_DISABLE                   = 1;
  2179.  
  2180. { DosFlagProcess codes }
  2181.  
  2182.   FLGP_SUBTREE                     = 0;
  2183.   FLGP_PID                         = 1;
  2184.  
  2185. Type
  2186.   pFnSigHandler = Procedure (a,b: UShort);
  2187.  
  2188. {**    DosSetSigHandler - Handle Signal
  2189.  *
  2190.  *      Notifies OS/2 of a handler for a signal.  It may also be used
  2191.  *      to ignore a signal or install a default action for a signal.
  2192.  }
  2193.  
  2194.   Function DosSetSigHandler (pfnSigHandler: PFNSIGHANDLER;  { Signal handler address }
  2195.                          Var ppfnPrev: PFNSIGHANDLER;       { Address of previous handler }
  2196.                              pfAction: PUSHORT;             { Address of previous action }
  2197.                              fAction,                       { Indicate request type }
  2198.                              usSigNum: USHORT): USHORT;               { Signal number               }
  2199.  
  2200.  
  2201. {**    DosFlagProcess - Issue signal
  2202.  *
  2203.  *      Used to send a signal event to an arbitrary process or
  2204.  *      command subtree.
  2205.  }
  2206.  
  2207.   Function DosFlagProcess (pid: PID;                        { Process ID to signal }
  2208.                            fScope,                          { 0=notify entire subtree, 1=notify }{ only the indicated process }
  2209.                            usFlagNum,                       { Flag number }
  2210.                            usFlagArg: USHORT): USHORT;              { Flag argument                     }
  2211.  
  2212. {**    DosHoldSignal - Disable / Enable signals
  2213.  *
  2214.  *      Used to termporarily disable or enable signal processing
  2215.  *      for the current process.
  2216.  }
  2217.  
  2218.   Function DosHoldSignal (fDisable: USHORT): USHORT;               { 0=enable signal, 1=disable signal }
  2219.  
  2220. {**    DosSendSignal - Send Signal to Command Subtree Process Handler
  2221.  *
  2222.  *      Used to send a signal to last process
  2223.  *      that has a handler installed
  2224.  }
  2225.  
  2226.   Function DosSendSignal (idProcess,                        { process ID of the root process }{ of the subtree }
  2227.                           usSigNumber: USHORT): USHORT;           { signal number to send          }
  2228.  
  2229.  
  2230.  
  2231. {** Monitor support }
  2232.  
  2233. Type
  2234.   HMONITOR = SHANDLE;    { hmon }
  2235.   pHMONITOR = ^HMONITOR;
  2236.  
  2237.  
  2238. {**   DosMonOpen - Open connection to device monitor
  2239.  *
  2240.  *     Gains access to a character device data stream.
  2241.  *
  2242.  }
  2243.  
  2244.   Function DosMonOpen (pszDevName: PSZ;                     { Device name string (returned) }
  2245.                        phmon: PHMONITOR): USHORT;               { Monitor handle (returned)          }
  2246.  
  2247.  
  2248. {**   DosMonClose - Close connection to device monitor
  2249.  *
  2250.  *     Terminates character device monitoring. All monitor buffers associated
  2251.  *     with this process are flushed and closed.
  2252.  *
  2253.  }
  2254.  
  2255.   Function DosMonClose (hmon: HMONITOR): USHORT;                 { handle from previous DosMonOpen }
  2256.  
  2257.  
  2258. {**   DosMonReg - Register set of buffers as monitor
  2259.  *
  2260.  *     Establishes an input and output buffer structure to monitor an I/O
  2261.  *     stream for a character device.
  2262.  *
  2263.  }
  2264.  
  2265.   Function DosMonReg (hmon: HMONITOR;                       { handle from DosMonOpen }
  2266.                       pbInBuf,                              { input buffer }
  2267.                       pbOutBuf: PBYTE;                      { output buffer }
  2268.                       fPosition,                            { position preference flag }
  2269.                       usIndex: USHORT): USHORT;                { index of data stream for the }
  2270.                                         { device being monitered       }
  2271.  
  2272.  
  2273. {**   DosMonRead - Read input from monitor structure
  2274.  *
  2275.  *     Waits for and moves a data recorrd from the input buffer of a registered
  2276.  *     character device monitor and places it in a private data area where the
  2277.  *     monitor can freely access it.
  2278.  *
  2279.  }
  2280.  
  2281.   Function DosMonRead (pbInBuf: PBYTE;                      { monitor input buffer }
  2282.                        fWait: UCHAR;                        { block/run indicator }
  2283.                        pbDataBuf: PBYTE;                    { buffer into which records are read }
  2284.                        pcbData: PUSHORT): USHORT;               { length of the data buffer/number   }
  2285.                                         { of bytes moved                     }
  2286.  
  2287.  
  2288. {**   DosMonWrite - Write output to monitor structure
  2289.  *
  2290.  *     Moves a filtered data record from the monitor's private data area into
  2291.  *     the monitor's output buffer.
  2292.  *
  2293.  }
  2294.  
  2295.   Function DosMonWrite (pbOutBuf,                           { monitor output buffer }
  2296.                         pbDataBuf: PBYTE;                   { buffer from which records are taken }
  2297.                         cbData: USHORT): USHORT;                { number of bytes in the data record  }
  2298.  
  2299.  
  2300.  
  2301.  
  2302. {** Pipe and queue support }
  2303.  
  2304. Type
  2305.   HQUEUE = SHANDLE;  { hq }
  2306.   pHQUEUE = ^HQUEUE;
  2307.  
  2308. {**    DosMakePipe - Create a Pipe }
  2309.  
  2310.   Function DosMakePipe (phfRead,                            { Addr to place the read handle }
  2311.                         phfWrite: PHFILE;                   { Addr to place the write handle }
  2312.                         cb: USHORT): USHORT;                     { Size to reserve for the pipe   }
  2313.  
  2314. {**    DosCloseQueue - Close a Queue
  2315.  *
  2316.  *      close a queue which is in use by the requesting process
  2317.  *
  2318.  }
  2319.  
  2320.   Function DosCloseQueue (hqueue: HQUEUE): USHORT;                 { queue handle }
  2321.  
  2322. {**    DosCreateQueue - Create a Queue
  2323.  *
  2324.  *      creates a queue to be owned by the requesting process
  2325.  *
  2326.  }
  2327.  
  2328.   Function DosCreateQueue (phqueue: PHQUEUE;                { read/write handle of queue }
  2329.                            fQueueOrder: USHORT;             { 0=FIFO queue, 1=LIFO queue, }{ 2=Priority queue }
  2330.                            pszQueueName: PSZ): USHORT;              { name of the queue           }
  2331.  
  2332. {**    DosOpenQueue - Open a Queue
  2333.  *
  2334.  *      opens a queue for the current process
  2335.  *
  2336.  }
  2337.  
  2338.   Function DosOpenQueue (ppidOwner: PUSHORT;                { PID of queue owner }
  2339.                          phqueue: PHQUEUE;                  { queue handle }
  2340.                          pszQueueName: PSZ): USHORT;              { queue name         }
  2341.  
  2342. {**    DosPeekQueue - Peek at a Queue
  2343.  *
  2344.  *      retrieves an element from a queue without removing it from the queue
  2345.  *
  2346.  }
  2347.  
  2348.   Function DosPeekQueue (hqueue: HQUEUE;                    { queue handle }
  2349.                          pqresc: PULONG;                    { pointer to request }
  2350.                          pcbElement: PUSHORT;               { length of datum returned }
  2351.                          ppBuf: PULONG;                     { pointer to address of datum }
  2352.                          pElemCode: PUSHORT;                { indicator of datum returned }
  2353.                          fwait: UCHAR;                      { wait indicator for empty queue }
  2354.                          pbElemPrty: PBYTE;                 { priority of element }
  2355.                          hsem: ULONG): USHORT;                    { semaphore handle               }
  2356.  
  2357. {**    DosPurgeQueue - Purge a Queue
  2358.  *
  2359.  *      purges all elements from a queue
  2360.  *
  2361.  }
  2362.  
  2363.   Function DosPurgeQueue (hqueue: HQUEUE): USHORT;                 { queue handle }
  2364.  
  2365. {**    DosQueryQueue - Query size of a Queue
  2366.  *
  2367.  *      returns the number of elements in a queue
  2368.  *
  2369.  }
  2370.  
  2371.   Function DosQueryQueue (hqueue: HQUEUE;                   { queue handle }
  2372.                           pcElem: PUSHORT): USHORT;                { pointer for number of elements }
  2373.  
  2374. {**    DosReadQueue - Read from a Queue
  2375.  *
  2376.  *      retrieves an element from a queue
  2377.  *
  2378.  }
  2379.  
  2380.   Function DosReadQueue (hqueue: HQUEUE;                    { queue handle }
  2381.                          pqresc: PULONG;                    { pointer to request }
  2382.                          pcbElem: PUSHORT;                  { length of datum returned }
  2383.                          ppBuf: PULONG;                     { pointer to address of datum }
  2384.                          usElem: USHORT;                    { indicator of datum returned }
  2385.                          fWait: UCHAR;                      { wait indicator for empty queue }
  2386.                          pbElemPrty: PBYTE;                 { priority of element }
  2387.                          hsem: HSEM): USHORT;                     { semaphore handle               }
  2388.  
  2389. {**    DosWriteQueue - Write to a Queue
  2390.  *
  2391.  *      adds an element to a queue
  2392.  *
  2393.  }
  2394.  
  2395.   Function DosWriteQueue (hqueue: HQUEUE;                   { queue handle }
  2396.                           usRequest,                        { request }
  2397.                           cbBuf: USHORT;                    { length of datum }
  2398.                           pBuf: PBYTE;                      { address of datum }
  2399.                           fPriority: UCHAR): USHORT;               { priority of element }
  2400.  
  2401.  
  2402.  
  2403.  
  2404. {**   DosError - Enable hard error processing
  2405.  *
  2406.  *     Allows a process to disable user notification
  2407.  *     and program exceptions.
  2408.  *
  2409.  }
  2410.  
  2411.   Function DosError (fEnable: USHORT): USHORT;                { action flag (bit field)            }
  2412.  
  2413.  
  2414. {**   DosSetVec - Establish handler for exception vector
  2415.  *
  2416.  *     Allows a process to register an address to be used when a machine
  2417.  *     exception occurs.
  2418.  *
  2419.  }
  2420.  
  2421.   Function DosSetVec (usVecNum: USHORT;                     { number of the vector to be }{ serviced by this routine }
  2422.                       pfnFun,                               { handler routine }
  2423.                       ppfnPrev: PFN): USHORT;                 { previous handler address (returned) }
  2424.  
  2425.  
  2426. {**   DosGetMessage - System message with variable text
  2427.  *
  2428.  *     Retrieves a message from a message file and inserts variable information
  2429.  *     into the body of the message.
  2430.  *
  2431.  }
  2432.  
  2433.   Function DosGetMessage (Var ppchVTable: pChar;            { table of variables to insert }
  2434.                           usVCount: USHORT;                 { number of variables }
  2435.                           pchBuf: PCHAR;                    { data area (where message is returned) }
  2436.                           cbBuf,                            { length of data area }
  2437.                           usMsgNum: USHORT;                 { number of the message requested }
  2438.                           pszFileName: PSZ;                 { message path and file name }
  2439.                           pcbMsg: PUSHORT): USHORT;             { length of message (returned)          }
  2440.  
  2441.  
  2442. {**   DosErrClass - Classify error codes
  2443.  *
  2444.  *     Helps OS/2 applications respnd to error codes
  2445.  *     from the OS/2 API.
  2446.  *
  2447.  }
  2448.  
  2449.   Function DosErrClass (usErrCode: USHORT;                  { error code for analysis }
  2450.                         pusClass,                           { error classification (returned) }
  2451.                         pfsAction,                          { recommended action (returned) }
  2452.                         pusLocus: PUSHORT): USHORT;              { origin of the error (returned)     }
  2453.  
  2454.  
  2455. {**   DosInsMessage - Insert variable text strings in message
  2456.  *
  2457.  *     Inserts variable text string information into the body of a message.
  2458.  *     This is useful when messages are loaded before insertion text strings
  2459.  *     are known.
  2460.  *
  2461.  }
  2462.  
  2463.   Function DosInsMessage (Var ppchVTable: pChar;            { table of variables to insert }
  2464.                           usVCount: USHORT;                 { number of variables }
  2465.                           pszMsg: PSZ;                      { address of input message }
  2466.                           cbMsg: USHORT;                    { length of input message }
  2467.                           pchBuf: PCHAR;                    { data area address to return }{ message to }
  2468.                           cbBuf: USHORT;                    { length of data area (returned) }
  2469.                           pcbMsg: PUSHORT): USHORT;                { length of updated messsage     }
  2470.  
  2471.  
  2472. {**   DosPutMessage - Output message text to indicated handle
  2473.  *
  2474.  *     Outputs the message in a buffer passed by a caller to the specified
  2475.  *     handle. The function formats the buffer to prevent words from wrapping
  2476.  *     if displayed to a screen.
  2477.  *
  2478.  }
  2479.  
  2480.   Function DosPutMessage (hf,                               { handle of output file/device }
  2481.                           cbMsg: USHORT;                    { length of message }
  2482.                           pchMsg: PCHAR): USHORT;                  { message buffer that contains the }
  2483.                                         { message to be output             }
  2484.  
  2485.  
  2486.  
  2487. {**   DosPtrace - Interface for program debugging
  2488.  *
  2489.  *     Provides an interface into the OS/2 kernel to facilitate program
  2490.  *     debugging.
  2491.  *
  2492.  }
  2493.  
  2494.   Function DosPtrace (pPtraceBuf: PBYTE): USHORT;               { Ptrace buffer }
  2495.  
  2496. { definition for DOSQSYSINFO }
  2497.  
  2498. Const
  2499.   Q_MAX_PATH_LENGTH       = (0);                   { index for query max path length }
  2500.  
  2501. {**    DosQSysInfo - query system constants
  2502.  *
  2503.  *      Returns system constants like the maximum path name length.
  2504.  *
  2505.  }
  2506.  
  2507.   Function DosQSysInfo (index: USHORT;                      { Index of constant requested }
  2508.                         pBuf: PBYTE;                        { Pointer to return buffer }
  2509.                         cbBuf: USHORT): USHORT;                  { return buffer size          }
  2510.  
  2511. {**   DosGetEnv - Get address of process environment string
  2512.  *
  2513.  *     Returns the address of the process environment string for the current
  2514.  *     process.
  2515.  *
  2516.  }
  2517.  
  2518.   Function DosGetEnv (pselEnv,                              { selector for the environment }{ segment (returned) }
  2519.                       pOffsetCmd: PUSHORT): USHORT;            { command line offset (returned) }
  2520.  
  2521.  
  2522. {**   DosScanEnv - Scan an environment segment
  2523.  *
  2524.  *     Scans
  2525.  *
  2526.  }
  2527.  
  2528.   Function DosScanEnv (pszVarName: PSZ;                     { environment variable name }
  2529.                    Var ppszResult: PSZ): USHORT;            { search result pointer (returned)    }
  2530.  
  2531.  
  2532. {**   DosSearchPath - Search path for file name
  2533.  *
  2534.  *     Provides a general path search mechanism which allows applications to
  2535.  *     find files residing along paths. The path string may come from the
  2536.  *     process environment, or be supplied directly by the caller.
  2537.  *
  2538.  }
  2539.  
  2540.   Function DosSearchPath (fsSearch: USHORT;                 { function control vector }
  2541.                           pszPath,                          { search path reference }
  2542.                           pszFName: PSZ;                    { file name }
  2543.                           pBuf: PBYTE;                      { search result buffer }
  2544.                           cbBuf: USHORT): USHORT;                  { search result buffer length        }
  2545.  
  2546.  
  2547. {**   DosGetVersion - Get OS/2 version number   }
  2548.  
  2549.   Function DosGetVersion (pVer: PUSHORT): USHORT;                  { version number (returned)          }
  2550.  
  2551.  
  2552. {** DosGetMachineMode - Return current mode of processor
  2553.  *
  2554.  *   Returns the current mode of the processor, whether the processor is
  2555.  *   running in the DOS mode or the OS/2 mode. This allows an application to
  2556.  *   determine whether a dynamic link call is valid or not.
  2557.  *
  2558.  }
  2559.  
  2560.   Function DosGetMachineMode (pMachMode: PBYTE): USHORT;               { current processor mode (returned)  }
  2561.  
  2562.  
  2563.  
  2564. {** Session manager support }
  2565.  
  2566.  
  2567. { DOSSTARTSESSION data structure definition }
  2568.  
  2569.  
  2570. Type
  2571.   STARTDATA = Record
  2572.     Length,                             { length of data structure in bytes }
  2573.     Related,                            { 0 = independent session, 1 = child session }
  2574.     FgBg,                               { 0 = start in foreground, 1 = start in background }
  2575.     TraceOpt: USHORT;                   { 0 = no trace, 1 = trace }
  2576.     PgmTitle,                           { address of program title }
  2577.     PgmName: PSZ;                       { address of program name }
  2578.     PgmInputs,                          { input arguments }
  2579.     TermQ,                              { address of program queue name }
  2580.     Environment: PBYTE;                 { environment string }
  2581.     InheritOpt,                         { where are handles and environment inherited from }
  2582.                                         { 0 = inherit from shell , 1 = inherit from caller }
  2583.     SessionType: USHORT;                { session type }
  2584.     IconFile: PSZ;                      { address of icon definition }
  2585.     PgmHandle: ULONG;                   { program handle }
  2586.     PgmControl,                         { initial state of windowed application }
  2587.     InitXPos,                           { x coordinate of initial session window }
  2588.     InitYPos,                           { y coordinate of initial session window }
  2589.     InitXSize,                          { initial size of x }
  2590.     InitYSize: USHORT                   { initial size of y }
  2591.   End;
  2592.   pSTARTDATA = ^STARTDATA;
  2593.  
  2594.  
  2595. { DOSSETSESSION data structure definition }
  2596.  
  2597.   STATUSDATA = Record
  2598.     Length,                             { length of this data structure }
  2599.     SelectInd,                          { 0=leave setting unchanged, 1=selectable }{ 2=non-selectable }
  2600.     BondInd: USHORT                     { which session to bring to foreground }
  2601.   End;
  2602.   pSTATUSDATA = ^STATUSDATA;
  2603.  
  2604.  
  2605. { DOSSMREGISTERDD data structure definition }
  2606.  
  2607.   REGISTERDATA = Record
  2608.     Length,                             { length of this data structure }
  2609.     NotifType: USHORT;                  { type of notification }
  2610.     DDName: PCHAR                       { device driver name }
  2611.   End;
  2612.   pREGISTERDATA =^REGISTERDATA;
  2613.  
  2614.  
  2615. {** DosStartSession - Start session
  2616.  *
  2617.  *   Provides an application program interface to start another session and
  2618.  *   specify the name of the program to start in the session.
  2619.  *
  2620.  }
  2621.  
  2622.   Function DosStartSession (pstdata: PSTARTDATA;            { start session data structure }
  2623.                             pidSession,                     { session ID (returned) }
  2624.                             ppid: PUSHORT): USHORT;                  { process ID (returned)              }
  2625.  
  2626.  
  2627. {**   DosSetSession - Set session status
  2628.  *
  2629.  *     Sets the status of a child session.
  2630.  *
  2631.  }
  2632.  
  2633.   Function DosSetSession (idSession: USHORT;                { session ID }
  2634.                           pstsdata: PSTATUSDATA): USHORT;          { session status data structure      }
  2635.  
  2636.  
  2637. {**   DosSelectSession - Select foreground session
  2638.  *
  2639.  *     Allows a parent session to switch one of its child sessions to the
  2640.  *     foreground
  2641.  *
  2642.  }
  2643.  
  2644.   Function DosSelectSession (idSession: USHORT;             { session ID }
  2645.                              usReserved: ULONG): USHORT;              { reserved (must be 0)               }
  2646.  
  2647.  
  2648. {**   DosStopSession - Stop session
  2649.  *
  2650.  *     Terminates a session previously started with DosStartSession.
  2651.  *
  2652.  }
  2653.  
  2654.   Function DosStopSession (fScope,                          { target option }
  2655.                            isSession: USHORT;               { session ID }
  2656.                            ulReserved: ULONG): USHORT;              { reserved (must be 0)               }
  2657.  
  2658.  
  2659. {**   DosSmRegisterDD - Register device driver
  2660.  *
  2661.  *     Allows a device driver to receive session switch notification.
  2662.  *
  2663.  }
  2664.  
  2665.   Function DosSmRegisterDD (pregdata: PREGISTERDATA): USHORT;        { register data structure            }
  2666.  
  2667.  
  2668. {**   DosQAppType - Return the application type of an executable file }
  2669.  
  2670.   Function DosQAppType (pszPrgName: PSZ;                    { file name of executable file }
  2671.                         pusType: PUSHORT): USHORT;               { application type                   }
  2672.  
  2673. {** Device support }
  2674.  
  2675. {**   DosDevConfig - Get device configuration
  2676.  *
  2677.  *     Gets information about attached devices.
  2678.  *
  2679.  }
  2680.  
  2681.   Function DosDevConfig (pDevInfo: PVOID;                   { returned information }
  2682.                          usItem,                            { what device information is needed }
  2683.                          usReserved: USHORT): USHORT;             { reserved, should be set to 0       }
  2684.  
  2685.  
  2686. {**   DosDevIOCtl - I/O control for devices
  2687.  *
  2688.  *     Performs control functions on a device specified by an opened device
  2689.  *     handle.
  2690.  *
  2691.  }
  2692.  
  2693.   Function DosDevIOCtl (pData,                              { data area }
  2694.                         pParms: PVOID;                      { command specific argument list }
  2695.                         usFun,                              { device specific function code }
  2696.                         usCategory: USHORT;                 { device category }
  2697.                         hDev: HFILE): USHORT;                    { device handle                      }
  2698.  
  2699. {**    DosDevIOCtl2 - Perform Control Functions Directly On Device, with lengths
  2700.  *
  2701.  *      Control functions on the device specified by the opened
  2702.  *      handle
  2703.  }
  2704.  
  2705.   Function DosDevIOCtl2 (pData: PVOID;                      { Data area }
  2706.                          cbData: USHORT;                    { Length of data area }
  2707.                          pParm: PVOID;                      { Command-specific argument list }
  2708.                          cbParm,                            { Length of argument list }
  2709.                          usFun,                             { Device-specific function code }
  2710.                          usCategory: USHORT;                { Device category }
  2711.                          hDev: HFILE): USHORT;                    { Device handle returned by Open }
  2712.  
  2713. {**   DosCLIAccess - Request CLI/STI privilege
  2714.  *
  2715.  *     Requests I/O privilege for disabling and enabling interrupts. Access to
  2716.  *     ports must be granted via DosPortAccess.
  2717.  *
  2718.  }
  2719.  
  2720.   Function DosCLIAccess: USHORT;
  2721.  
  2722.  
  2723.  
  2724. {**   DosPortAccess - Request port access
  2725.  *
  2726.  *     Requests or releases access to ports for I/O privilege.
  2727.  *
  2728.  }
  2729.  
  2730.   Function DosPortAccess (usReserved,                       { reserved (must be set to 0) }
  2731.                           fRelease,                         { 0=request access, 1=release access }
  2732.                           usFirstPort,                      { first port number }
  2733.                           usLastPort: USHORT): USHORT;             { last port number                   }
  2734.  
  2735.  
  2736. {**   DosPhysicalDisk - Partitionable disk support
  2737.  *
  2738.  *     Obtains information on partitionable disks.
  2739.  *
  2740.  }
  2741.  
  2742.   Function DosPhysicalDisk (usFun: USHORT;                  { type of information to obtain }
  2743.                             pOut: PBYTE;                    { pointer to return buffer }
  2744.                             cbOut: USHORT;                  { return buffer length }
  2745.                             pParm: PBYTE;                   { pointer to user-supplied information }
  2746.                             cbParm: USHORT): USHORT;               { length of user-supplied information  }
  2747.  
  2748.  
  2749. {**   DosR2StackRealloc - Reallocate ring 2 stack
  2750.  *
  2751.  *     Changes the size of a thread's ring 2 stack
  2752.  *
  2753.  }
  2754.  
  2755.   Function DosR2StackRealloc (cbStack: USHORT): USHORT;                { ring 2 stack's new size in bytes }
  2756.  
  2757.  
  2758. {**   DosCallback Ring 2 call to ring 3 routine
  2759.  *
  2760.  *     Provided so a Ring 2 IOPL segment can call a Ring 3 allocation segment.
  2761.  *
  2762.  }
  2763.  
  2764.   Procedure DosCallback (pfn: PFN); { Address of the ring 3 routine }
  2765.                                     { to be called                  }
  2766. Type
  2767.   HPIPE = SHANDLE;
  2768.   pHPIPE = ^HPIPE;
  2769.  
  2770.  
  2771. Type
  2772.   AVAILDATA = Record                    { PeekNMPipe Bytes Available record  }
  2773.     cbpipe,                             { bytes left in the pipe }
  2774.     cbmessage: USHORT                   { bytes left in current message }
  2775.   End;
  2776.   pAVAILDATA = ^AVAILDATA;
  2777.  
  2778. {** DosCallNmPipe - Procedure call transaction
  2779.  *
  2780.  *   Performs a procedure call transaction using a message pipe.
  2781.  *
  2782.  }
  2783.  
  2784.   Function DosCallNmPipe (pszName: PSZ;                     { Name of the pipe to be opened }
  2785.                           pInBuf: PBYTE;                    { Address of the buffer to write to the pipe }
  2786.                           cbInBuf: USHORT;                  { Number of bytes to be written }
  2787.                           pbOutBuf: PBYTE;                  { Address of the buffer for returned data }
  2788.                           cbOutBuf: USHORT;                 { Maximum size (in bytes) of returned data }
  2789.                           pcbRead: PUSHORT;                 { Number of bytes actually read (returned) }
  2790.                           ulTimeOut: ULONG): USHORT;       { Maximum wait time                          }
  2791.  
  2792. {** DosConnectNmPipe - Connect named pipe
  2793.  *
  2794.  *   Enables a new client to obtain handle-based access to a named pipe
  2795.  *   through DosOpen.
  2796.  *
  2797.  }
  2798.  
  2799.   Function DosConnectNmPipe (hp: HPIPE): USHORT;                      { Pipe Handle                        }
  2800.  
  2801. {** DosDisConnectNmPipe - Disconnect named pipe
  2802.  *
  2803.  *   Forces a named pipe to close.
  2804.  *
  2805.  }
  2806.  
  2807.   Function DosDisConnectNmPipe (hp: HPIPE): USHORT;                      { Pipe Handle                        }
  2808.  
  2809. {** DosMakeNmPipe - Create a named pipe
  2810.  *
  2811.  *   Creates the specified named pipe and returns its handle.
  2812.  *
  2813.  }
  2814.  
  2815.   Function DosMakeNmPipe (pszName: PSZ;                     { Pipe Name }
  2816.                           php: PHPIPE;                      { Returned pipe handle }
  2817.                           fsOpenMode,                       { DOS open mode of pipe }
  2818.                           fsPipeMode,                       { Pipe open mode }
  2819.                           cbOutBuf,                         { Advisory outgoing buffer size }
  2820.                           cbInBuf: USHORT;                  { Advisory incoming buffer size }
  2821.                           ulTimeOut: ULONG): USHORT;               { Timeout for DosWaitNmPipe          }
  2822.  
  2823. {** DosPeekNmPipe - Peek named pipe
  2824.  *
  2825.  *   Reads pipe without removing the read data from the pipe
  2826.  *
  2827.  }
  2828.  
  2829.   Function DosPeekNmPipe (hp: HPIPE;                        { Pipe handle }
  2830.                           pBuf: PBYTE;                      { Address of user buffer }
  2831.                           cbBuf: USHORT;                    { Buffer length }
  2832.                           pcbRead: PUSHORT;                 { Bytes read }
  2833.                           pAvail: PAVAILDATA;               { Bytes available }
  2834.                           pfsState: PUSHORT): USHORT;              { Pipe state                         }
  2835.  
  2836. {** DosQNmPHandState - Query named pipe state
  2837.  *
  2838.  *   Returns information for a named pipe's specific handle state.
  2839.  *
  2840.  }
  2841.  
  2842.   Function DosQNmPHandState (hp: HPIPE;                     { Pipe handle }
  2843.                              pfsState: PUSHORT): USHORT;              { Pipe handle state                  }
  2844.  
  2845. {** DosQNmPipeInfo - Query named pipe info
  2846.  *
  2847.  *   Returns information for a named pipe
  2848.  *
  2849.  }
  2850.  
  2851.   Function DosQNmPipeInfo (hp: HPIPE;                       { Pipe handle }
  2852.                            usInfoLevel: USHORT;             { Pipe data required }
  2853.                            pBuf: PBYTE;                     { Pipe data buffer }
  2854.                            cb: USHORT): USHORT;                     { Pipe data buffer size              }
  2855.  
  2856. {** DosQNmPipeSemState - Query named pipe operations
  2857.  *
  2858.  *   Returns information about named pipes attached to a specific system
  2859.  *   semaphore
  2860.  *
  2861.  }
  2862.  
  2863.   Function DosQNmPipeSemState (hsem: HSEM;                  { Semaphore handle }
  2864.                                pBuf: PBYTE;                 { Address of returned info }
  2865.                                cb: USHORT): USHORT;                     { Length of InfoBuff                 }
  2866.  
  2867.  
  2868.  
  2869. {** DosSetNmPHandState - Set named pipe handle state
  2870.  *
  2871.  *   Returns information about named pipes specific handle state.
  2872.  *
  2873.  }
  2874.  
  2875.   Function DosSetNmPHandState (hp: HPIPE;                   { Pipe handle }
  2876.                                fsState: USHORT): USHORT;                { Pipe handle state                  }
  2877.  
  2878.   Function DosSetNmPipeSem (hp: HPIPE;                      { File handle }
  2879.                             hsem: HSEM;                     { Semaphore handle }
  2880.                             usKeyVal: USHORT): USHORT;               { Key              }
  2881.  
  2882. {** DosTransactNmPipe - Perform transaction
  2883.  *
  2884.  *   Performs a transaction, write followed by a read, on a message pipe.
  2885.  *
  2886.  }
  2887.  
  2888.   Function DosTransactNmPipe (hp: HPIPE;                    { Pipe handle }
  2889.                               pOutBuf: PBYTE;               { Write buffer address }
  2890.                               cbOut: USHORT;                { Write buffer length }
  2891.                               pInBuf: PBYTE;                { Read buffer address }
  2892.                               cbIn: USHORT;                 { Read buffer length }
  2893.                               pcbRead: PUSHORT): USHORT;               { Bytes read (returned)              }
  2894.  
  2895. {** DosWaitNmPipe - Wait named pipe instance
  2896.  *
  2897.  *   Waits for the availability of a named pipe instance.
  2898.  *
  2899.  }
  2900.  
  2901.   Function DosWaitNmPipe (pszName: PSZ;                     { Pipe name }
  2902.                           ulTimeOut: ULONG): USHORT;               { Maximum wait time                  }
  2903.  
  2904.  
  2905. {** Data structures and equates used with named pipes **}
  2906.  
  2907.  
  2908. Var
  2909.   npi_data1: Record                    { PipeInfo data block (returned, level 1) }
  2910.     npi_obuflen,                        { length of outgoing I/O buffer }
  2911.     npi_ibuflen: USHORT;                { length of incoming I/O buffer }
  2912.     npi_maxicnt,                        { maximum number of instances }
  2913.     npi_curicnt,                        { current number of instances }
  2914.     npi_namlen: UCHAR;                  { length of pipe name }
  2915.     npi_name: Array[0..0] Of Char       { start of name }
  2916.   End;
  2917.  
  2918.   npss: Record                         { QNmPipeSemState information record }
  2919.     npss_status,                        { type of record, 0=EOI, 1=read ok, }{   2 = write ok, 3 = pipe closed }
  2920.     npss_flag: UCHAR;                   { additional info, 01=waiting thread }
  2921.     npss_key,                           { user's key value }
  2922.     npss_avail: USHORT                  { available data/space if status=1/2 }
  2923.   End;
  2924.  
  2925. { values in npss_status }
  2926.  
  2927. Const
  2928.   NPSS_EOI                         = 0;                     { End Of Information    }
  2929.   NPSS_RDATA                       = 1;                     { read data available   }
  2930.   NPSS_WSPACE                      = 2;                     { write space available }
  2931.   NPSS_CLOSE                       = 3;                     { pipe in CLOSING state }
  2932.  
  2933. { values in npss_flag }
  2934.   NPSS_WAIT                        =  $01;                  { waiting thread on other end of pipe }
  2935.  
  2936. { defined bits in pipe mode }
  2937.   NP_NBLK                          =  $8000;                { non-blocking read/write }
  2938.   NP_SERVER                        =  $4000;                { set if server end       }
  2939.   NP_WMESG                         =  $0400;                { write messages          }
  2940.   NP_RMESG                         =  $0100;                { read as messages        }
  2941.   NP_ICOUNT                        =  $00FF;                { instance count field    }
  2942.  
  2943.  
  2944. { Named pipes may be in one of several states depending on the actions
  2945.  * that have been taken on it by the server end and client end.  The
  2946.  * following state/action table summarizes the valid state transitions:
  2947.  *
  2948.  * Current state   Action                 Next state
  2949.  *
  2950.  *  <none>         server DosMakeNmPipe   DISCONNECTED
  2951.  *  DISCONNECTED   server connect         LISTENING
  2952.  *  LISTENING      client open            CONNECTED
  2953.  *  CONNECTED      server disconn         DISCONNECTED
  2954.  *  CONNECTED      client close           CLOSING
  2955.  *  CLOSING        server disconn         DISCONNECTED
  2956.  *  CONNECTED      server close           CLOSING
  2957.  *  <any other>    server close           <pipe deallocated>
  2958.  *
  2959.  * If a server disconnects his end of the pipe, the client end will enter a
  2960.  * special state in which any future operations
  2961.  * descriptor associated with the pipe will return an error.
  2962.  }
  2963.  
  2964. {
  2965.  * Values for named pipe state
  2966.  }
  2967.  
  2968.   NP_DISCONNECTED                  = 1;                     { after pipe creation or Disconnect }
  2969.   NP_LISTENING                     = 2;                     { after DosNmPipeConnect            }
  2970.   NP_CONNECTED                     = 3;                     { after Client open                 }
  2971.   NP_CLOSING                       = 4;                     { after Client or Server close      }
  2972.  
  2973.  
  2974. {** DosPFSActivate - Activate font
  2975.  *
  2976.  *   Specifies the code page and font to make active for the specified printer
  2977.  *   and Process ID
  2978.  *
  2979.  }
  2980.  
  2981.   Function DosPFSActivate (hspl: PVOID;                     { Temporary spool file handle }
  2982.                            pfnAct: PULONG;                  { Number of bytes written (returned) }
  2983.                            pszPName: PSZ;                   { Printer name string }
  2984.                            usCodePage,                      { Code page to make active }
  2985.                            usFontId,                        { Font ID to make active }
  2986.                            usSFN: USHORT;                   { System file number }
  2987.                            ulReserved: ULONG): USHORT;              { Reserved, set to 0                 }
  2988.  
  2989. {** DosPFSCloseUser - Close Font User Interface
  2990.  *
  2991.  *   Indicates to the Font Switcher that the specified process has closed its
  2992.  *   spool file. The font Switcher may then free any resources being used to
  2993.  *   track code page and font switching for a process.
  2994.  *
  2995.  }
  2996.  
  2997.   Function DosPFSCloseUser (pszPName: PSZ;                  { Printer name string }
  2998.                             usSFN: USHORT;                  { System file number }
  2999.                             ulReserved: ULONG): USHORT;              { Reserved, set to 0                 }
  3000.  
  3001. {** DosPFSInit - Initialize code page and fpnt
  3002.  *
  3003.  *   Allows the FontSwitcher ti initialize code page and font switching for a
  3004.  *   specified printer.
  3005.  *
  3006.  }
  3007.  
  3008.   Function DosPFSInit (pusHdw: PUSHORT;                     { Hdw font definition list }
  3009.                        pszFontPath,                         { File pathname of the font }{ file to use }
  3010.                        pszPType,                            { Printer type string }
  3011.                        pszPName: PSZ;                       { Printer name string }
  3012.                        usSpool: USHORT;                     { Number of spool instances }
  3013.                        ulReserved: ULONG): USHORT;              { Reserved                           }
  3014.  
  3015. {** DosPFSQueryAct - Query active font
  3016.  *
  3017.  *   Queries the active code page and font for the specified printer and
  3018.  *   Process ID.
  3019.  *
  3020.  }
  3021.  
  3022.  
  3023.   Function DosPFSQueryAct (pszPname: PSZ;                   { Printer name string }
  3024.                            pusCodePage,                     { Code page return }
  3025.                            pusFontId: PUSHORT;              { Font ID return }
  3026.                            usSFN: USHORT;                   { System file number }
  3027.                            ulReserved: ULONG): USHORT;              { Reserved, set to 0                 }
  3028.  
  3029. {** DosPFSVerifyFont - Verify font
  3030.  *
  3031.  *   Indicates whether the specified code page and font within that code page
  3032.  *   are available in the font file for the specified printer.
  3033.  *
  3034.  }
  3035.  
  3036.   Function DosPFSVerifyFont (pszPName: PSZ;                 { Printer name string }
  3037.                              usCodePage,                    { Code page to validate }
  3038.                              usFontId: USHORT;              { Font ID to validate }
  3039.                              ulReserved: ULONG): USHORT;              { Reserved, set to 0                 }
  3040.  
  3041.  
  3042. {** DosPFS API Support }
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050. {** DosProfile API support }
  3051.  
  3052.  
  3053. { DosProfile ordinal number }
  3054.  
  3055.  
  3056. Const
  3057.   PROF_ORDINAL            = 133;
  3058.  
  3059. { DosProfile usType }
  3060.  
  3061.   PROF_SYSTEM                      = 0;
  3062.   PROF_USER                        = 1;
  3063.   PROF_USEDD                       = 2;
  3064.   PROF_KERNEL                      = 4;
  3065.   PROF_VERBOSE                     = 8;
  3066.   PROF_ENABLE                      = 16;
  3067.  
  3068. { DosProfile usFunc }
  3069.  
  3070.   PROF_ALLOC                       = 0;
  3071.   PROF_CLEAR                       = 1;
  3072.   PROF_ON                          = 2;
  3073.   PROF_OFF                         = 3;
  3074.   PROF_DUMP                        = 4;
  3075.   PROF_FREE                        = 5;
  3076.  
  3077. { DosProfile tic count granularity}
  3078.   PROF_SHIFT                       = 2;
  3079.  
  3080. { DosProfile module name string length }
  3081.   PROF_MOD_NAME_SIZE               = 10;
  3082.  
  3083. { DosProfile error code for end of data }
  3084.   PROF_END_OF_DATA                 = 13;
  3085.  
  3086. Implementation
  3087.   Function DosAllocHuge;                  External 'DOSCALLS' Index   40;
  3088.   Function DosAllocSeg;                   External 'DOSCALLS' Index   34;
  3089.   Function DosAllocShrSeg;                External 'DOSCALLS' Index   35;
  3090.   Function DosBeep;                       External 'DOSCALLS' Index   50;
  3091.   Function DosBufReset;                   External 'DOSCALLS' Index   56;
  3092.   Function DosCLIAccess;                  External 'DOSCALLS' Index   51;
  3093.   Function DosCallNmPipe;                 External 'NAMPIPES' Index   10;
  3094.   Procedure DosCallback;                  External 'DOSCALLS' Index  157;
  3095.   Function DosCaseMap;                    External 'NLS'      Index    1;
  3096.   Function DosChDir;                      External 'DOSCALLS' Index   57;
  3097.   Function DosChgFilePtr;                 External 'DOSCALLS' Index   58;
  3098.   Function DosClose;                      External 'DOSCALLS' Index   59;
  3099.   Function DosCloseQueue;                 External 'QUECALLS' Index    3;
  3100.   Function DosCloseSem;                   External 'DOSCALLS' Index   23;
  3101.   Function DosConnectNmPipe;              External 'NAMPIPES' Index    3;
  3102.   Function DosCopy;                       External 'DOSCALLS' Index  201;
  3103.   Function DosCreateCSAlias;              External 'DOSCALLS' Index   43;
  3104.   Function DosCreateQueue;                External 'QUECALLS' Index    8;
  3105.   Function DosCreateSem;                  External 'DOSCALLS' Index   24;
  3106.   Function DosCreateThread;               External 'DOSCALLS' Index  145;
  3107.   Function DosCwait;                      External 'DOSCALLS' Index    2;
  3108.   Function DosDelete;                     External 'DOSCALLS' Index   60;
  3109.   Function DosDevConfig;                  External 'DOSCALLS' Index   52;
  3110.   Function DosDevIOCtl;                   External 'DOSCALLS' Index   53;
  3111.   Function DosDevIOCtl2;                  External 'DOSCALLS' Index   99;
  3112.   Function DosDisConnectNmPipe;           External 'NAMPIPES' Index    4;
  3113.   Function DosDupHandle;                  External 'DOSCALLS' Index   61;
  3114.   Function DosEditName;                   External 'DOSCALLS' Index  191;
  3115.   Function DosEnterCritSec;               External 'DOSCALLS' Index    3;
  3116.   Function DosEnumAttribute;              External 'DOSCALLS' Index  204;
  3117.   Function DosErrClass;                   External 'DOSCALLS' Index  139;
  3118.   Function DosError;                      External 'DOSCALLS' Index  120;
  3119.   Function DosExecPgm;                    External 'DOSCALLS' Index  144;
  3120.   Procedure DosExit;                      External 'DOSCALLS' Index    5;
  3121.   Function DosExitCritSec;                External 'DOSCALLS' Index    6;
  3122.   Function DosExitList;                   External 'DOSCALLS' Index    7;
  3123.   Function DosFSAttach;                   External 'DOSCALLS' Index  181;
  3124.   Function DosFSCtl;                      External 'DOSCALLS' Index  183;
  3125.   Function DosFSRamSemClear;              External 'DOSCALLS' Index  162;
  3126.   Function DosFSRamSemRequest;            External 'DOSCALLS' Index  161;
  3127.   Function DosFileIO;                     External 'DOSCALLS' Index  186;
  3128.   Function DosFileLocks;                  External 'DOSCALLS' Index   62;
  3129.   Function DosFindClose;                  External 'DOSCALLS' Index   63;
  3130.   Function DosFindFirst;                  External 'DOSCALLS' Index   64;
  3131.   Function DosFindFirst2;                 External 'DOSCALLS' Index  184;
  3132.   Function DosFindNext;                   External 'DOSCALLS' Index   65;
  3133.   Function DosFindNotifyClose;            External 'DOSCALLS' Index  187;
  3134.   Function DosFindNotifyFirst;            External 'DOSCALLS' Index  188;
  3135.   Function DosFindNotifyNext;             External 'DOSCALLS' Index  189;
  3136.   Function DosFlagProcess;                External 'DOSCALLS' Index   15;
  3137.   Function DosFreeModule;                 External 'DOSCALLS' Index   46;
  3138.   Function DosFreeResource;               External 'DOSCALLS' Index  208;
  3139.   Function DosFreeSeg;                    External 'DOSCALLS' Index   39;
  3140.   Function DosGetCollate;                 External 'NLS'      Index    2;
  3141.   Function DosGetCp;                      External 'DOSCALLS' Index  130;
  3142.   Function DosGetCtryInfo;                External 'NLS'      Index    3;
  3143.   Function DosGetDBCSEv;                  External 'NLS'      Index    4;
  3144.   Function DosGetDateTime;                External 'DOSCALLS' Index   33;
  3145.   Function DosGetEnv;                     External 'DOSCALLS' Index   91;
  3146.   Function DosGetHugeShift;               External 'DOSCALLS' Index   41;
  3147.   Function DosGetInfoSeg;                 External 'DOSCALLS' Index    8;
  3148.   Function DosGetMachineMode;             External 'DOSCALLS' Index   49;
  3149.   Function DosGetMessage; Begin {IndexNotFound('DosGetMessage')} End;
  3150.   Function DosGetModHandle;               External 'DOSCALLS' Index   47;
  3151.   Function DosGetModName;                 External 'DOSCALLS' Index   48;
  3152.   Function DosGetPID;                     External 'DOSCALLS' Index   94;
  3153.   Function DosGetPPID;                    External 'DOSCALLS' Index  156;
  3154.   Function DosGetProcAddr;                External 'DOSCALLS' Index   45;
  3155.   Function DosGetPrty;                    External 'DOSCALLS' Index    9;
  3156.   Function DosGetResource;                External 'DOSCALLS' Index  155;
  3157.   Function DosGetResource2;               External 'DOSCALLS' Index  207;
  3158.   Function DosGetSeg;                     External 'DOSCALLS' Index  121;
  3159.   Function DosGetShrSeg;                  External 'DOSCALLS' Index   36;
  3160.   Function DosGetVersion;                 External 'DOSCALLS' Index   92;
  3161.   Function DosGiveSeg;                    External 'DOSCALLS' Index   37;
  3162.   Function DosHoldSignal;                 External 'DOSCALLS' Index   13;
  3163.   Function DosInsMessage;                 External 'MSG'      Index    3;
  3164.   Function DosKillProcess;                External 'DOSCALLS' Index   10;
  3165.   Function DosLoadModule;                 External 'DOSCALLS' Index   44;
  3166.   Function DosLockSeg;                    External 'DOSCALLS' Index  122;
  3167.   Function DosMakeNmPipe;                 External 'NAMPIPES' Index    1;
  3168.   Function DosMakePipe;                   External 'DOSCALLS' Index   16;
  3169.   Function DosMemAvail;                   External 'DOSCALLS' Index  127;
  3170.   Function DosMkDir;                      External 'DOSCALLS' Index   66;
  3171.   Function DosMkDir2;                     External 'DOSCALLS' Index  185;
  3172.   Function DosMonClose;                   External 'MONCALLS' Index    3;
  3173.   Function DosMonOpen;                    External 'MONCALLS' Index    4;
  3174.   Function DosMonRead;                    External 'MONCALLS' Index    2;
  3175.   Function DosMonReg;                     External 'MONCALLS' Index    5;
  3176.   Function DosMonWrite;                   External 'MONCALLS' Index    1;
  3177.   Function DosMove;                       External 'DOSCALLS' Index   67;
  3178.   Function DosMuxSemWait;                 External 'DOSCALLS' Index   22;
  3179.   Function DosNewSize;                    External 'DOSCALLS' Index   68;
  3180.   Function DosOpen;                       External 'DOSCALLS' Index   70;
  3181.   Function DosOpen2;                      External 'DOSCALLS' Index   95;
  3182.   Function DosOpenQueue;                  External 'QUECALLS' Index    7;
  3183.   Function DosOpenSem;                    External 'DOSCALLS' Index   25;
  3184.   Function DosPFSActivate;                External 'SPOOLCP'  Index    4;
  3185.   Function DosPFSCloseUser;               External 'SPOOLCP'  Index    1;
  3186.   Function DosPFSInit;                    External 'SPOOLCP'  Index    3;
  3187.   Function DosPFSQueryAct;                External 'SPOOLCP'  Index    2;
  3188.   Function DosPFSVerifyFont;              External 'SPOOLCP'  Index    5;
  3189.   Function DosPeekNmPipe;                 External 'NAMPIPES' Index    7;
  3190.   Function DosPeekQueue;                  External 'QUECALLS' Index    5;
  3191.   Function DosPhysicalDisk;               External 'DOSCALLS' Index  129;
  3192.   Function DosPortAccess;                 External 'DOSCALLS' Index   69;
  3193.   Function DosPtrace;                     External 'DOSCALLS' Index   12;
  3194.   Function DosPurgeQueue;                 External 'QUECALLS' Index    2;
  3195.   Function DosPutMessage;                 External 'MSG'      Index    1;
  3196.   Function DosQAppType;                   External 'DOSCALLS' Index  163;
  3197.   Function DosQCurDir;                    External 'DOSCALLS' Index   71;
  3198.   Function DosQCurDisk;                   External 'DOSCALLS' Index   72;
  3199.   Function DosQFHandState;                External 'DOSCALLS' Index   73;
  3200.   Function DosQFSAttach;                  External 'DOSCALLS' Index  182;
  3201.   Function DosQFSInfo;                    External 'DOSCALLS' Index   76;
  3202.   Function DosQFileInfo;                  External 'DOSCALLS' Index   74;
  3203.   Function DosQFileMode;                  External 'DOSCALLS' Index   75;
  3204.   Function DosQHandType;                  External 'DOSCALLS' Index   77;
  3205.   Function DosQNmPHandState;              External 'NAMPIPES' Index    5;
  3206.   Function DosQNmPipeInfo;                External 'NAMPIPES' Index    2;
  3207.   Function DosQNmPipeSemState;            External 'NAMPIPES' Index   14;
  3208.   Function DosQPathInfo;                  External 'DOSCALLS' Index   98;
  3209.   Function DosQSysInfo;                   External 'DOSCALLS' Index  166;
  3210.   Function DosQVerify;                    External 'DOSCALLS' Index   78;
  3211.   Function DosQueryQueue;                 External 'QUECALLS' Index    4;
  3212.   Function DosR2StackRealloc;             External 'DOSCALLS' Index  160;
  3213.   Function DosRead;                       External 'DOSCALLS' Index  137;
  3214.   Function DosReadAsync;                  External 'DOSCALLS' Index  149;
  3215.   Function DosReadQueue;                  External 'QUECALLS' Index    1;
  3216.   Function DosReallocHuge;                External 'DOSCALLS' Index   42;
  3217.   Function DosReallocSeg;                 External 'DOSCALLS' Index   38;
  3218.   Function DosResumeThread;               External 'DOSCALLS' Index   26;
  3219.   Function DosRmDir;                      External 'DOSCALLS' Index   80;
  3220.   Function DosScanEnv;                    External 'DOSCALLS' Index  152;
  3221.   Function DosSearchPath;                 External 'DOSCALLS' Index  151;
  3222.   Function DosSelectDisk;                 External 'DOSCALLS' Index   81;
  3223.   Function DosSelectSession;              External 'SESMGR'   Index    9;
  3224.   Function DosSemClear;                   External 'DOSCALLS' Index  141;
  3225.   Function DosSemRequest;                 External 'DOSCALLS' Index  140;
  3226.   Function DosSemSet;                     External 'DOSCALLS' Index  143;
  3227.   Function DosSemSetWait;                 External 'DOSCALLS' Index   20;
  3228.   Function DosSemWait;                    External 'DOSCALLS' Index  142;
  3229.   Function DosSendSignal;                 External 'DOSCALLS' Index  134;
  3230.   Function DosSetCp;                      External 'DOSCALLS' Index  153;
  3231.   Function DosSetDateTime;                External 'DOSCALLS' Index   28;
  3232.   Function DosSetFHandState;              External 'DOSCALLS' Index   82;
  3233.   Function DosSetFSInfo;                  External 'DOSCALLS' Index   97;
  3234.   Function DosSetFileInfo;                External 'DOSCALLS' Index   83;
  3235.   Function DosSetFileMode;                External 'DOSCALLS' Index   84;
  3236.   Function DosSetMaxFH;                   External 'DOSCALLS' Index   85;
  3237.   Function DosSetNmPHandState;            External 'NAMPIPES' Index    6;
  3238.   Function DosSetNmPipeSem;               External 'NAMPIPES' Index   13;
  3239.   Function DosSetPathInfo;                External 'DOSCALLS' Index  104;
  3240.   Function DosSetProcCp;                  External 'DOSCALLS' Index  164;
  3241.   Function DosSetPrty;                    External 'DOSCALLS' Index   11;
  3242.   Function DosSetSession;                 External 'SESMGR'   Index   14;
  3243.   Function DosSetSigHandler;              External 'DOSCALLS' Index   14;
  3244.   Function DosSetVec;                     External 'DOSCALLS' Index   89;
  3245.   Function DosSetVerify;                  External 'DOSCALLS' Index   86;
  3246.   Function DosShutdown;                   External 'DOSCALLS' Index  206;
  3247.   Function DosSizeSeg;                    External 'DOSCALLS' Index  126;
  3248.   Function DosSleep;                      External 'DOSCALLS' Index   32;
  3249.   Function DosSmRegisterDD;               External 'SESMGR'   Index   29;
  3250.   Function DosStartSession;               External 'SESMGR'   Index   17;
  3251.   Function DosStopSession;                External 'SESMGR'   Index    8;
  3252.   Function DosSubAlloc;                   External 'DOSCALLS' Index  147;
  3253.   Function DosSubFree;                    External 'DOSCALLS' Index  148;
  3254.   Function DosSubSet;                     External 'DOSCALLS' Index  146;
  3255.   Function DosSuspendThread;              External 'DOSCALLS' Index   27;
  3256.   Function DosTimerAsync;                 External 'DOSCALLS' Index   29;
  3257.   Function DosTimerStart;                 External 'DOSCALLS' Index   30;
  3258.   Function DosTimerStop;                  External 'DOSCALLS' Index   31;
  3259.   Function DosTransactNmPipe;             External 'NAMPIPES' Index    9;
  3260.   Function DosUnlockSeg;                  External 'DOSCALLS' Index  123;
  3261.   Function DosWaitNmPipe;                 External 'NAMPIPES' Index    8;
  3262.   Function DosWrite;                      External 'DOSCALLS' Index  138;
  3263.   Function DosWriteAsync;                 External 'DOSCALLS' Index  150;
  3264.   Function DosWriteQueue;                 External 'QUECALLS' Index    6;
  3265. End.
  3266.  
  3267. WriteLn('Verify BseDos');
  3268. veri('AVAILDATA                          ',sizeof(AVAILDATA                          ));
  3269. veri('COUNTRYCODE                        ',sizeof(COUNTRYCODE                        ));
  3270. veri('COUNTRYINFO                        ',sizeof(COUNTRYINFO                        ));
  3271. veri('DATETIME                           ',sizeof(DATETIME                           ));
  3272. veri('DENA1                              ',sizeof(DENA1                              ));
  3273. veri('DOSFSRSEM                          ',sizeof(DOSFSRSEM                          ));
  3274. veri('EAOP                               ',sizeof(EAOP                               ));
  3275. veri('FDATE                              ',sizeof(FDATE                              ));
  3276. veri('FEA                                ',sizeof(FEA                                ));
  3277. veri('FEALIST                            ',sizeof(FEALIST                            ));
  3278. veri('FILEFINDBUF                        ',sizeof(FILEFINDBUF                        ));
  3279. veri('FILEFINDBUF2                       ',sizeof(FILEFINDBUF2                       ));
  3280. veri('FILELOCK                           ',sizeof(FILELOCK                           ));
  3281. veri('FILESTATUS                         ',sizeof(FILESTATUS                         ));
  3282. veri('FILESTATUS2                        ',sizeof(FILESTATUS2                        ));
  3283. veri('FIOLOCKCMD                         ',sizeof(FIOLOCKCMD                         ));
  3284. veri('FIOLOCKREC                         ',sizeof(FIOLOCKREC                         ));
  3285. veri('FIOREADWRITE                       ',sizeof(FIOREADWRITE                       ));
  3286. veri('FIOSEEKCMD                         ',sizeof(FIOSEEKCMD                         ));
  3287. veri('FIOUNLOCKCMD                       ',sizeof(FIOUNLOCKCMD                       ));
  3288. veri('FIOUNLOCKREC                       ',sizeof(FIOUNLOCKREC                       ));
  3289. veri('FSALLOCATE                         ',sizeof(FSALLOCATE                         ));
  3290. veri('FSINFO                             ',sizeof(FSINFO                             ));
  3291. veri('FSQBUFFER                          ',sizeof(FSQBUFFER                          ));
  3292. veri('FTIME                              ',sizeof(FTIME                              ));
  3293. veri('GEA                                ',sizeof(GEA                                ));
  3294. veri('GEALIST                            ',sizeof(GEALIST                            ));
  3295. veri('GINFOSEG                           ',sizeof(GINFOSEG                           ));
  3296. veri('LINFOSEG                           ',sizeof(LINFOSEG                           ));
  3297. veri('MUXSEM                             ',sizeof(MUXSEM                             ));
  3298. veri('MUXSEMLIST                         ',sizeof(MUXSEMLIST                         ));
  3299. veri('PIDINFO                            ',sizeof(PIDINFO                            ));
  3300. veri('REGISTERDATA                       ',sizeof(REGISTERDATA                       ));
  3301. veri('RESULTCODES                        ',sizeof(RESULTCODES                        ));
  3302. veri('STARTDATA                          ',sizeof(STARTDATA                          ));
  3303. veri('STATUSDATA                         ',sizeof(STATUSDATA                         ));
  3304. veri('VOLUMELABEL                        ',sizeof(VOLUMELABEL                        ));
  3305.  
  3306. printf("Verify BseDos\n");
  3307. veri("AVAILDATA                          ",sizeof(AVAILDATA                          ));
  3308. veri("COUNTRYCODE                        ",sizeof(COUNTRYCODE                        ));
  3309. veri("COUNTRYINFO                        ",sizeof(COUNTRYINFO                        ));
  3310. veri("DATETIME                           ",sizeof(DATETIME                           ));
  3311. veri("DENA1                              ",sizeof(DENA1                              ));
  3312. veri("DOSFSRSEM                          ",sizeof(DOSFSRSEM                          ));
  3313. veri("EAOP                               ",sizeof(EAOP                               ));
  3314. veri("FDATE                              ",sizeof(FDATE                              ));
  3315. veri("FEA                                ",sizeof(FEA                                ));
  3316. veri("FEALIST                            ",sizeof(FEALIST                            ));
  3317. veri("FILEFINDBUF                        ",sizeof(FILEFINDBUF                        ));
  3318. veri("FILEFINDBUF2                       ",sizeof(FILEFINDBUF2                       ));
  3319. veri("FILELOCK                           ",sizeof(FILELOCK                           ));
  3320. veri("FILESTATUS                         ",sizeof(FILESTATUS                         ));
  3321. veri("FILESTATUS2                        ",sizeof(FILESTATUS2                        ));
  3322. veri("FIOLOCKCMD                         ",sizeof(FIOLOCKCMD                         ));
  3323. veri("FIOLOCKREC                         ",sizeof(FIOLOCKREC                         ));
  3324. veri("FIOREADWRITE                       ",sizeof(FIOREADWRITE                       ));
  3325. veri("FIOSEEKCMD                         ",sizeof(FIOSEEKCMD                         ));
  3326. veri("FIOUNLOCKCMD                       ",sizeof(FIOUNLOCKCMD                       ));
  3327. veri("FIOUNLOCKREC                       ",sizeof(FIOUNLOCKREC                       ));
  3328. veri("FSALLOCATE                         ",sizeof(FSALLOCATE                         ));
  3329. veri("FSINFO                             ",sizeof(FSINFO                             ));
  3330. veri("FSQBUFFER                          ",sizeof(FSQBUFFER                          ));
  3331. veri("FTIME                              ",sizeof(FTIME                              ));
  3332. veri("GEA                                ",sizeof(GEA                                ));
  3333. veri("GEALIST                            ",sizeof(GEALIST                            ));
  3334. veri("GINFOSEG                           ",sizeof(GINFOSEG                           ));
  3335. veri("LINFOSEG                           ",sizeof(LINFOSEG                           ));
  3336. veri("MUXSEM                             ",sizeof(MUXSEM                             ));
  3337. veri("MUXSEMLIST                         ",sizeof(MUXSEMLIST                         ));
  3338. veri("PIDINFO                            ",sizeof(PIDINFO                            ));
  3339. veri("REGISTERDATA                       ",sizeof(REGISTERDATA                       ));
  3340. veri("RESULTCODES                        ",sizeof(RESULTCODES                        ));
  3341. veri("STARTDATA                          ",sizeof(STARTDATA                          ));
  3342. veri("STATUSDATA                         ",sizeof(STATUSDATA                         ));
  3343. veri("VOLUMELABEL                        ",sizeof(VOLUMELABEL                        ));
  3344.