home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / PRCP.ZIP / PRCP.INF (.txt)
OS/2 Help File  |  1990-11-16  |  592KB  |  32,772 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Control Program Function Calls ΓòÉΓòÉΓòÉ
  3.  
  4. This section reflects the Dos API interface of OS/2 only. 
  5.  
  6. The Dos function calls can be used in full-screen and Presentation Manager 
  7. sessions to perform basic operating-system operations, such as file 
  8. input/output, memory allocation, and thread and process 
  9. creation/control/communication. 
  10.  
  11. Notes: 
  12.  
  13.   1. Calls marked xPM are not supported by Presentation Manager, and must not 
  14.      be used by Presentation Manager applications.  An error code is returned 
  15.      if any of these calls are issued. 
  16.  
  17.   2. Calls marked xWPM are not windowable and are not supported by Presentation 
  18.      Manager.  They can be used in OS/2 mode. 
  19.  
  20.   3. Calls marked FAPI are present in the Family API. 
  21.  
  22.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  23.         Γöé   FUNCTION CALL          ICON         Γöé
  24.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  25.         Γöé   DosAllocHuge           FAPI         Γöé
  26.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  27.         Γöé   DosAllocHuge           FAPI         Γöé
  28.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  29.         Γöé   DosAllocSeg            FAPI         Γöé
  30.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  31.         Γöé   DosBeep                FAPI         Γöé
  32.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  33.         Γöé   DosBufReset            FAPI         Γöé
  34.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  35.         Γöé   DosCaseMap             FAPI         Γöé
  36.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  37.         Γöé   DosChDir               FAPI         Γöé
  38.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  39.         Γöé   DosChgFilePtr          FAPI         Γöé
  40.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  41.         Γöé   DosClose               FAPI         Γöé
  42.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  43.         Γöé   DosCreateCSAlias       FAPI         Γöé
  44.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  45.         Γöé   DosDelete              FAPI         Γöé
  46.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  47.         Γöé   DosDevConfig           FAPI         Γöé
  48.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  49.         Γöé   DosDevIOCtl            FAPI         Γöé
  50.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  51.         Γöé   DosDupHandle           FAPI         Γöé
  52.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  53.         Γöé   DosEnumAttribute       FAPI         Γöé
  54.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  55.         Γöé   DosErrClass            FAPI         Γöé
  56.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  57.         Γöé   DosError               FAPI         Γöé
  58.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  59.         Γöé   DosExecPgm             FAPI         Γöé
  60.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  61.         Γöé   DosExit                FAPI         Γöé
  62.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  63.         Γöé   DosFileLocks           FAPI         Γöé
  64.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  65.         Γöé   DosFindClose           FAPI         Γöé
  66.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  67.         Γöé   DosFindFirst           FAPI         Γöé
  68.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  69.         Γöé   DosFindFirst2          FAPI         Γöé
  70.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  71.         Γöé   DosFindNext            FAPI         Γöé
  72.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  73.         Γöé   DosFreeSeg             FAPI         Γöé
  74.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  75.         Γöé   DosGetCollate          FAPI         Γöé
  76.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  77.         Γöé   DosGetCp               FAPI         Γöé
  78.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  79.         Γöé   DosGetCtryInfo         FAPI         Γöé
  80.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  81.         Γöé   DosGetDateTime         FAPI         Γöé
  82.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  83.         Γöé   DosGetDBCSEv           FAPI         Γöé
  84.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  85.         Γöé   DosGetEnv              FAPI         Γöé
  86.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  87.         Γöé   DosGetHugeShift        FAPI         Γöé
  88.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  89.         Γöé   DosGetMachineMode      FAPI         Γöé
  90.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  91.         Γöé   DosGetPID              FAPI         Γöé
  92.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  93.         Γöé   DosGetVersion          FAPI         Γöé
  94.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  95.         Γöé   DosHoldSignal          FAPI         Γöé
  96.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  97.         Γöé   DosInsMessage          FAPI         Γöé
  98.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  99.         Γöé   DosMkDir               FAPI         Γöé
  100.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  101.         Γöé   DosMkDir2              FAPI         Γöé
  102.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  103.         Γöé   DosMonClose            xPM          Γöé
  104.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  105.         Γöé   DosMonOpen             xPM          Γöé
  106.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  107.         Γöé   DosMonRead             xPM          Γöé
  108.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  109.         Γöé   DosMonReg              xPM          Γöé
  110.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  111.         Γöé   DosMonWrite            xPM          Γöé
  112.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  113.         Γöé   DosMove                FAPI         Γöé
  114.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  115.         Γöé   DosNewSize             FAPI         Γöé
  116.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  117.         Γöé   DosOpen                FAPI         Γöé
  118.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  119.         Γöé   DosOpen2               FAPI         Γöé
  120.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  121.         Γöé   DosPortAccess          FAPI         Γöé
  122.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  123.         Γöé   DosPutMessage          FAPI         Γöé
  124.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  125.         Γöé   DosQCurDir             FAPI         Γöé
  126.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  127.         Γöé   DosQCurDisk            FAPI         Γöé
  128.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  129.         Γöé   DosQFHandState         FAPI         Γöé
  130.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  131.         Γöé   DosQFileInfo           FAPI         Γöé
  132.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  133.         Γöé   DosQFileMode           FAPI         Γöé
  134.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  135.         Γöé   DosQFSInfo             FAPI         Γöé
  136.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  137.         Γöé   DosQHandType           FAPI         Γöé
  138.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  139.         Γöé   DosQPathInfo           FAPI         Γöé
  140.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  141.         Γöé   DosQVerify             FAPI         Γöé
  142.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  143.         Γöé   DosRead                FAPI         Γöé
  144.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  145.         Γöé   DosReallocHuge         FAPI         Γöé
  146.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  147.         Γöé   DosReallocSeg          FAPI         Γöé
  148.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  149.         Γöé   DosRmDir               FAPI         Γöé
  150.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  151.         Γöé   DosSelectDisk          FAPI         Γöé
  152.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  153.         Γöé   DosSetCp               FAPI xPM     Γöé
  154.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  155.         Γöé   DosSetDateTime         FAPI         Γöé
  156.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  157.         Γöé   DosSetFHandState       FAPI         Γöé
  158.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  159.         Γöé   DosSetFileInfo         FAPI         Γöé
  160.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  161.         Γöé   DosSetFileMode         FAPI         Γöé
  162.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  163.         Γöé   DosSetFSInfo           FAPI         Γöé
  164.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  165.         Γöé   DosSetPathInfo         FAPI         Γöé
  166.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  167.         Γöé   DosSetSigHandler       FAPI         Γöé
  168.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  169.         Γöé   DosSetVec              FAPI         Γöé
  170.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  171.         Γöé   DosSetVerify           FAPI         Γöé
  172.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  173.         Γöé   DosSizeSeg             FAPI         Γöé
  174.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  175.         Γöé   DosSleep               FAPI         Γöé
  176.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  177.         Γöé   DosSubAlloc            FAPI         Γöé
  178.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  179.         Γöé   DosSubFree             FAPI         Γöé
  180.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  181.         Γöé   DosSubSet              FAPI         Γöé
  182.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  183.         Γöé   DosWrite               FAPI         Γöé
  184.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  185.  
  186.  
  187. ΓòÉΓòÉΓòÉ 1.1. DosAllocHuge ΓòÉΓòÉΓòÉ
  188.  
  189.                                Bindings:  C, MASM
  190.  
  191. This call allocates multiple segments as a huge block of memory. 
  192.  
  193.  DosAllocHuge    (NumSeg, Size, Selector, MaxNumSeg, AllocFlags) 
  194.  
  195.  NumSeg (USHORT) - input 
  196.     Number of 65536-byte segments to be allocated. 
  197.  
  198.  Size (USHORT) - input 
  199.     Number of bytes to be allocated in the last (non-65536-byte) segment. A 
  200.     value of zero indicates none. 
  201.  
  202.  Selector (PSEL) - output 
  203.     Address where the selector of the first segment allocated is returned. 
  204.  
  205.  MaxNumSeg (USHORT) - input 
  206.     Maximum number of 65536-byte segments this object occupies as a result of 
  207.     any subsequent DosReallocHuge (see DosReallocHuge.) If MaxNumSeg is 0, OS/2 
  208.     assumes this segment will never be increased by DosReallocHuge beyond its 
  209.     original size, though it may be decreased. This value is ignored in the DOS 
  210.     mode. 
  211.  
  212.  AllocFlags (USHORT) - input 
  213.     Bit indicators describing the characteristics of the segment allocated. The 
  214.     bits that can be set and their meanings are: 
  215.  
  216.     Bit       Description 
  217.     15-4      Reserved and must be set to zero. 
  218.     3         If segment is shared, it can be decreased in size by 
  219.               DosReallocHuge. 
  220.     2         Segment may be discarded by the system in low memory situations. 
  221.     1         Segment is shareable through DosGetSeg. 
  222.     0         Segment is shareable through DosGiveSeg. 
  223.  
  224.  rc (USHORT) - return 
  225.     Return code descriptions are: 
  226.  
  227.     0         NO_ERROR 
  228.     8         ERROR_NOT_ENOUGH_MEMORY 
  229.     87        ERROR_INVALID_PARAMETER 
  230.     212       ERROR_LOCKED 
  231.  
  232.  Remarks 
  233.  
  234.  DosAllocHuge allows a process to allocate a large amount of memory by telling 
  235.  the system how many 64KB segments it needs and whether it requires an 
  236.  additional partial segment.  The system allocates the memory, which is movable 
  237.  and swappable, and returns a selector to the first segment. When this selector 
  238.  is used with a call, the requested function is performed for the entire block 
  239.  of memory. 
  240.  
  241.  Each segment of a huge memory allocation has a unique selector. To determine 
  242.  the remaining selectors of a huge memory allocation, issue DosGetHugeShift, 
  243.  which returns a shift count. To compute the next sequential selector, take the 
  244.  value 1 and shift it left by the number of bits specified in shift count. Use 
  245.  the resulting value as an increment to add to the previous selector, using the 
  246.  selector returned by DosAllocHuge as the first selector. For example: 
  247.  
  248.  o Assume DosAllocHuge is issued with NumSeg equal to 3, and that the number 63 
  249.    is returned for the selector of the first segment. 
  250.  o If DosGetHugeShift returns a shift count of 4, shifting the value "1" by 
  251.    this amount results in an increment of 16. 
  252.  o Adding this increment to selector number 63 produces 79 for the second 
  253.    selector. Adding the same increment to selector number 79 yields 95 for the 
  254.    third selector. 
  255.  
  256.  Like single segment memory allocated with DosAllocSeg, huge memory can be 
  257.  designated as shareable by other processes and discardable by the system when 
  258.  no longer needed.  Allocating a huge block of memory as discardable 
  259.  automatically locks the memory for use by the caller. When one segment of a 
  260.  huge allocation is discarded by the system, this forces the discard of all the 
  261.  other segments. See DosAllocSeg for more information relating to discardable 
  262.  and shared segments. 
  263.  
  264.  Applications should be discretionary in claiming large memory when doing so 
  265.  can impair system performance.  To test system memory availability, issue 
  266.  DosMemAvail.  This call returns the size of the largest block of unallocated 
  267.  memory. Although this value can change at any time because of system activity 
  268.  , it can provide a good indication of the system memory state. 
  269.  
  270.  Memory allocated by DosAllocHuge is freed by DosFreeSeg.  One call to 
  271.  DosFreeSeg, passing the selector returned from a  DosAllocHuge, frees all of 
  272.  the memory allocated. 
  273.  
  274.  Note:  This request may be issued from privilege level 2.  However, the 
  275.         segment is allocated as a privilege level 3 segment. 
  276.  
  277.  
  278.  Family API Considerations 
  279.  
  280.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  281.  Therefore, the following considerations apply to DosAllocHuge when coding for 
  282.  the DOS mode: 
  283.  
  284.  o Requested size value is rounded up to the next paragraph (16-byte) 
  285.  o Selector is the actual segment address allocated. 
  286.  
  287.  
  288. ΓòÉΓòÉΓòÉ 1.2. DosAllocSeg ΓòÉΓòÉΓòÉ
  289.  
  290.                                Bindings:  C, MASM
  291.  
  292. This call allocates a segment of memory to a requesting process. 
  293.  
  294.  DosAllocSeg     (Size, Selector, AllocFlags) 
  295.  
  296.  Size (USHORT) - input 
  297.     Number of bytes requested.  The value specified must be less than or equal 
  298.     to 65535.  A value of zero indicates 65536 bytes. 
  299.  
  300.  Selector (PSEL) - output 
  301.     Address where the selector of the segment allocated is returned. 
  302.  
  303.  AllocFlags (USHORT) - input 
  304.     Bit indicators describing the characteristics of the segment being 
  305.     allocated.  The bits that can be set and their meanings are: 
  306.  
  307.     Bit       Description 
  308.     15-4      Reserved and must be set to zero. 
  309.     3         If segment is shared, it can be decreased in size by 
  310.               DosReallocSeg. 
  311.     2         Segment may be discarded by the system in low memory situations. 
  312.     1         Segment is shareable through DosGetSeg. 
  313.     0         Segment is shareable through DosGiveSeg. 
  314.  
  315.  rc (USHORT) - return 
  316.     Return code descriptions are: 
  317.  
  318.     0         NO_ERROR 
  319.     8         ERROR_NOT_ENOUGH_MEMORY 
  320.     87        ERROR_INVALID_PARAMETER 
  321.  
  322.  Remarks 
  323.  
  324.  DosAllocSeg allows a process to allocate a data segment up to 64KB in size, 
  325.  which is movable and swappable by the system. If your application needs to 
  326.  accommodate a large data structure that exceeds the 64KB limit, DosAllocHuge 
  327.  may be issued to allocate multiple segments as one huge block of memory. 
  328.  
  329.  A segment allocated by DosAllocSeg with AllocFlags bit 2 set can be discarded 
  330.  by the system to remedy a low memory situation when the segment is not in use. 
  331.  Upon allocation, a discardable segment is locked and ready for access. The 
  332.  caller issues DosUnlockSeg when it is finished using the segment. The next 
  333.  time the caller needs to access the segment, it must issue DosLockSeg. During 
  334.  the time a segment is locked, it cannot be discarded, but it can still be 
  335.  swapped. 
  336.  
  337.  Allocate memory as discardable when it is needed to hold data for only short 
  338.  periods of time; for example, saved bit map images for obscured windows. Once 
  339.  the system discards a segment, the caller must reallocate the segment with 
  340.  DosReallocSeg and regenerate the data. Reallocating the segment automatically 
  341.  locks it for the first access. 
  342.  
  343.  A segment may also be designated as shared with another process. If a process 
  344.  issues DosAllocSeg with AllocFlags bit 0 set, then the segment allocated is 
  345.  shareable through DosGiveSeg. To share the segment in this manner, the owning 
  346.  process can then issue DosGiveSeg to obtain a selector for the sharer to use. 
  347.  The owning process then passes the selector to the sharer using some means of 
  348.  interprocess communication. The sharing process can use the selector to access 
  349.  the shared segment. If the shared segment has been designated discardable 
  350.  (AllocFlags bit 2 is also set), the sharer must issue DosLockSeg to lock the 
  351.  segment. 
  352.  
  353.  Memory allocated with DosAllocSeg is freed by a call to DosFreeSeg. 
  354.  
  355.  Note:  This request may be issued from privilege level 2.  However, the 
  356.         segment is allocated as a privilege level 3 segment. 
  357.  
  358.  
  359.  Family API Considerations 
  360.  
  361.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  362.  Therefore, the following restrictions apply to DosAllocSeg when coding for the 
  363.  DOS mode: 
  364.  
  365.  o Requested Size value is rounded up to the next paragraph (16-byte). 
  366.  o Selector is the actual segment address allocated. 
  367.  o AllocFlags must be set to zero. 
  368.  
  369.  
  370. ΓòÉΓòÉΓòÉ 1.3. DosAllocShrSeg ΓòÉΓòÉΓòÉ
  371.  
  372.                                Bindings:  C, MASM
  373.  
  374. This call allocates a named shared memory segment to a process. 
  375.  
  376.  DosAllocShrSeg     (Size, Name, Selector) 
  377.  
  378.  Size (USHORT) - input 
  379.     Number of bytes requested.  The value specified must be less than or equal 
  380.     to 65535.  A value of 0 indicates 65536 bytes. 
  381.  
  382.  Name (PSZ) - input 
  383.     Address of the name string associated with the shared memory segment to be 
  384.     allocated. Name specifies the symbolic name for the shared memory segment. 
  385.     The name string is an ASCIIZ string in the format of an OS/2 file name in a 
  386.     subdirectory called \SHAREMEM\. The name string must include the prefix 
  387.     \SHAREMEM\. For example \SHAREMEM\name. 
  388.  
  389.  Selector (PSEL) - output 
  390.     Address where the selector of the allocated segment is returned. 
  391.  
  392.  rc (USHORT) - return 
  393.     Return code descriptions are: 
  394.  
  395.     0         NO_ERROR 
  396.     8         ERROR_NOT_ENOUGH_MEMORY 
  397.     123       ERROR_INVALID_NAME 
  398.     183       ERROR_ALREADY_EXISTS 
  399.  
  400.  Remarks 
  401.  
  402.  DosAllocShrSeg allocates a named segment of up to 64KB in size, which is 
  403.  movable and swappable. The segment can be shared by any process that knows the 
  404.  name of the segment. 
  405.  
  406.  To access the shared segment, another process issues DosGetShrSeg, specifying 
  407.  the segment name. The selector returned by DosGetShrSeg is the same as the one 
  408.  returned by DosAllocShrSeg. 
  409.  
  410.  The maximum number of segments a process can define with DosAllocShrSeg or 
  411.  access with DosGetShrSeg is 256. 
  412.  
  413.  Note:  This request may be issued from privilege level 2.  However, the 
  414.         segment is allocated as a privilege level 3 segment. 
  415.  
  416.  
  417. ΓòÉΓòÉΓòÉ 1.4. DosBeep ΓòÉΓòÉΓòÉ
  418.  
  419.                                Bindings:  C, MASM
  420.  
  421. This call generates sound from the speaker. 
  422.  
  423.  DosBeep    (Frequency, Duration) 
  424.  
  425.  Frequency (USHORT) - input 
  426.     Tone in Hertz (cycles per second) in the range 37 through 32767. 
  427.  
  428.  Duration (USHORT) - input 
  429.     Length of the sound in milliseconds. 
  430.  
  431.  rc (USHORT) - return 
  432.     Return code descriptions are: 
  433.  
  434.     0         NO_ERROR 
  435.     395       ERROR_INVALID_FREQUENCY 
  436.  
  437.  Remarks 
  438.  
  439.  DosBeep executes synchronously.  An application program that invokes DosBeep 
  440.  waits until the specified number of milliseconds expire before it resumes 
  441.  execution. 
  442.  
  443.  
  444. ΓòÉΓòÉΓòÉ 1.5. DosBufReset ΓòÉΓòÉΓòÉ
  445.  
  446.                                Bindings:  C, MASM
  447.  
  448. This call flushes a requesting process's cache buffers for a specific file 
  449. handle or for all file handles attached to that process. This call is also used 
  450. with the handle of a named pipe to synchronize a dialog between communicating 
  451. processes. 
  452.  
  453.  DosBufReset    (FileHandle) 
  454.  
  455.  FileHandle (HFILE) - input 
  456.     File handle whose buffers are to be flushed. If FileHandle = 0xFFFFH, all 
  457.     of the process's file handles are flushed. 
  458.  
  459.  rc (USHORT) - return 
  460.     Return code descriptions are: 
  461.  
  462.     0         NO_ERROR 
  463.     2         ERROR_FILE_NOT_FOUND 
  464.     5         ERROR_ACCESS_DENIED 
  465.     6         ERROR_INVALID_HANDLE 
  466.  
  467.  Remarks 
  468.  
  469.  Upon issuing DosBufReset for a file handle, the file's buffers are flushed to 
  470.  disk and its directory entry updated as if the file had been closed; however 
  471.  the file remains in an open state. 
  472.  
  473.  Usage of this call to write out all files belonging to the requesting process 
  474.  should be administered with caution. When the files reside on removable media 
  475.  (diskettes), a call to DosBufReset could have the undesirable effect of 
  476.  requiring the user to insert and remove a large number of diskettes. 
  477.  
  478.  
  479.  Named Pipe Considerations 
  480.  
  481.  Issuing DosBufReset for a named pipe performs an operation that is analogous 
  482.  to forcing the buffer cache to disk.  The request blocks the calling process 
  483.  at one end of the pipe until all data it has written has been read at the 
  484.  other end of the pipe. 
  485.  
  486.  
  487. ΓòÉΓòÉΓòÉ 1.6. DosCallback ΓòÉΓòÉΓòÉ
  488.  
  489.                                Bindings:  C, MASM
  490.  
  491. This call provides a privilege level 2 IOPL segment to call a privilege level 3 
  492. application segment. 
  493.  
  494.  DosCallback    (Ring3Routine) 
  495.  
  496.  Ring3Routine (PFN) - input 
  497.     Address of the privilege level 3 application routine to be called. 
  498.  
  499.  Remarks 
  500.  
  501.  This function allows a routine executing with I/O privilege (at privilege 
  502.  level 2) to call a segment that is executing at privilege level 3 and also to 
  503.  have the target routine execute at privilege level 3; for example, not to 
  504.  allow/require the target routine to be privilege level 2 conforming. 
  505.  
  506.  The requested routine is given control at privilege level 3 and when it 
  507.  completes execution and returns, return is made to the privilege level 2 
  508.  calling routine. 
  509.  
  510.  All registers except FLAGs are passed intact across this call return sequence 
  511.  and may be used to pass parameters or data. Any addresses passed from 
  512.  privilege level 2 to privilege level 3 must be based on privilege level 3 
  513.  selectors only as the privilege level 3 code does not have proper 
  514.  addressability to any privilege level 2 data selectors. 
  515.  
  516.  The privilege level 2 stack can not be used to pass data to the privilege 
  517.  level 3 routine. 
  518.  
  519.  If DosCallback is used in a nested fashion such that a privilege level 3 
  520.  routine issues a call to a privilege level 2 routine while performing a 
  521.  "Callback" operation (after being invoked by "Callback" but before having 
  522.  issued a Far RET back to the privilege level 2 code), any subsequent 
  523.  DosCallback requests must complete execution and issue their corresponding Far 
  524.  RETs in last-in-first-out (LIFO) order. 
  525.  
  526.  
  527. ΓòÉΓòÉΓòÉ 1.7. DosCallNmPipe ΓòÉΓòÉΓòÉ
  528.  
  529.                                Bindings:  C, MASM
  530.  
  531. This call performs a "procedure call" transaction using a message pipe. 
  532.  
  533.  DosCallNmPipe     (FileName, InBuffer, InBufferLen, OutBuffer, OutBufferLen, 
  534.                    BytesOut, TimeOut) 
  535.  
  536.  FileName (PSZ) - input 
  537.     Address of the ASCIIZ name of the pipe to be opened. Pipes are named 
  538.     \PIPE\FileName. 
  539.  
  540.  InBuffer (PBYTE) - input 
  541.     Address of the buffer to write to the pipe. 
  542.  
  543.  InBufferLen (USHORT) - input 
  544.     Number of bytes to be written. 
  545.  
  546.  OutBuffer (PBYTE) - input/output 
  547.     Address of the buffer for returned data. 
  548.  
  549.  OutBufferLen (USHORT) - input 
  550.     Maximum size (number of bytes) of returned data. 
  551.  
  552.  BytesOut (PUSHORT) - output 
  553.     Address of the variable where the system returns the number of bytes 
  554.     actually read (returned). 
  555.  
  556.  TimeOut (ULONG) - input 
  557.     Maximum time to wait for pipe availability. 
  558.  
  559.  rc (USHORT) - return 
  560.     Return code descriptions are: 
  561.  
  562.     0         NO_ERROR 
  563.     2         ERROR_FILE_NOT_FOUND 
  564.     11        ERROR_BAD_FORMAT 
  565.     230       ERROR_BAD_PIPE 
  566.     231       ERROR_PIPE_BUSY 
  567.     233       ERROR_PIPE_NOT_CONNECTED 
  568.     234       ERROR_MORE_DATA 
  569.  
  570.  Remarks 
  571.  
  572.  This call is intended for use only on duplex message pipes. If this call is 
  573.  issued for a pipe that is not a duplex message pipe, ERROR_BAD_FORMAT is 
  574.  returned. 
  575.  
  576.  This call has the combined effect on a named pipe of DosOpen, 
  577.  DosTransactNmPipe, and DosClose.  It provides an efficient means of 
  578.  implementing local and remote procedure-call (RPC) interfaces between 
  579.  processes. 
  580.  
  581.  
  582. ΓòÉΓòÉΓòÉ 1.8. DosCaseMap ΓòÉΓòÉΓòÉ
  583.  
  584.                                Bindings:  C, MASM
  585.  
  586. This call performs case mapping on a string of binary values that represent 
  587. ASCII characters. 
  588.  
  589.  DosCaseMap    (Length, Country, BinaryString) 
  590.  
  591.  Length (USHORT) - input 
  592.     Length of the string of binary values to be case mapped. 
  593.  
  594.  Country (PCOUNTRYCODE) - input/output 
  595.     Address of the country information structure: 
  596.  
  597.     country (USHORT) 
  598.        Country code identifier is a binary value of the selected country code. 
  599.        0 is the default country code. 
  600.  
  601.     codepage (USHORT) 
  602.        Code page identifier is a binary value of the selected code page. 0 is 
  603.        the code page of the current process. 
  604.  
  605.  BinaryString (PCHAR) - input/output 
  606.     Address of a string of binary characters to be case mapped.  They are case 
  607.     mapped in place so the results appear in BinaryString and the input is 
  608.     destroyed. 
  609.  
  610.  rc (USHORT) - return 
  611.     Return code descriptions are: 
  612.  
  613.     0         NO_ERROR 
  614.     396       ERROR_NLS_NO_COUNTRY_FILE 
  615.     397       ERROR_NLS_OPEN_FAILED 
  616.     398       ERROR_NO_COUNTRY_OR_CODEPAGE 
  617.     399       ERROR_NLS_TABLE_TRUNCATED 
  618.  
  619.  Remarks 
  620.  
  621.  DosCaseMap is mainly used to map a lower case character string to an upper 
  622.  case character string.  Unless the user replaces the country information file, 
  623.  DosCaseMap only does the conversion from lower case to upper case. 
  624.  
  625.  The case map information is taken from the country information file. See the 
  626.  COUNTRY statement in the IBM Operating System/2 Version 1.2 Command Reference 
  627.  for information on how to specify the country information file. 
  628.  
  629.  If countrycode is 0, the case mapping is performed using the information for 
  630.  the country specified in the COUNTRY statement in CONFIG.SYS. 
  631.  
  632.  If countrycode is not 0, the case mapping is performed using the information 
  633.  for that country. 
  634.  
  635.  If the code page identifier is 0, the case mapping is performed using the 
  636.  information for the current process code page. Refer to DosSetCp and the CHCP 
  637.  command in the IBM Operating System/2 Version 1.2 Command Reference for 
  638.  information on setting the process code page.  If codepage is not 0, the case 
  639.  mapping is performed using the information for that code page. 
  640.  
  641.  The returned country dependent information may be for the default country and 
  642.  current process code page or for a specific country and code page. 
  643.  
  644.  
  645. ΓòÉΓòÉΓòÉ 1.9. DosChDir ΓòÉΓòÉΓòÉ
  646.  
  647.                                Bindings:  C, MASM
  648.  
  649. This call defines the current directory for the requesting process. 
  650.  
  651.  DosChDir    (DirName, Reserved) 
  652.  
  653.  DirName (PSZ) - input 
  654.     Address of the ASCIIZ directory path name. 
  655.  
  656.  Reserved (ULONG) - input 
  657.     Reserved and must be set to zero. 
  658.  
  659.  rc (USHORT) - return 
  660.     Return code descriptions are: 
  661.  
  662.     0         NO_ERROR 
  663.     2         ERROR_FILE_NOT_FOUND 
  664.     3         ERROR_PATH_NOT_FOUND 
  665.     5         ERROR_ACCESS_DENIED 
  666.     8         ERROR_NOT_ENOUGH_MEMORY 
  667.     26        ERROR_NOT_DOS_DISK 
  668.     87        ERROR_INVALID_PARAMETER 
  669.     108       ERROR_DRIVE_LOCKED 
  670.     206       ERROR_FILENAME_EXCED_RANGE 
  671.  
  672.  Remarks 
  673.  
  674.  The directory path is not changed if any member of the path does not exist. 
  675.  The current directory changes only for the requesting process. 
  676.  
  677.  For FSDs, the case of the current directory is set according to the DirName 
  678.  passed in, not according to the case of the directories on disk. For example, 
  679.  if the directory "c:\bin" is created and DosChDir is called with DirName 
  680.  "c:\bin", the current directory returned by DosQCurDir will be "c:\bin". 
  681.  
  682.  Programs running without the NEWFILES bit set are allowed to DosChDir to a 
  683.  non-8.3 filename format directory. 
  684.  
  685.  DosQSysInfo must be used by an application to determine the maximum path 
  686.  length supported by OS/2.  The returned value should be used to dynamically 
  687.  allocate buffers that are to be used to store paths. 
  688.  
  689.  
  690. ΓòÉΓòÉΓòÉ 1.10. DosChgFilePtr ΓòÉΓòÉΓòÉ
  691.  
  692.                                Bindings:  C, MASM
  693.  
  694. This call moves the read/write pointer in accordance with the type of move 
  695. specified. 
  696.  
  697.  DosChgFilePtr     (FileHandle, Distance, MoveType, NewPointer) 
  698.  
  699.  FileHandle (HFILE) - input 
  700.     Handle returned by a previous DosOpen call. 
  701.  
  702.  Distance (LONG) - input 
  703.     The offset to move, in bytes. 
  704.  
  705.  MoveType (USHORT) - input 
  706.     Method of moving.  Specifies a location in the file from where Distance to 
  707.     move the read/write pointer starts. Values and their meanings are: 
  708.  
  709.     Value     Definition 
  710.     0         Beginning of the file. 
  711.     1         Current location of the read/write pointer. 
  712.     2         End of the file. Use this method to determine a file's size. 
  713.  
  714.  NewPointer (PULONG) - output 
  715.     Address of the new pointer location. 
  716.  
  717.  rc (USHORT) - return 
  718.     Return code descriptions are: 
  719.  
  720.     0         NO_ERROR 
  721.     1         ERROR_INVALID_FUNCTION 
  722.     6         ERROR_INVALID_HANDLE 
  723.  
  724.  Remarks 
  725.  
  726.  The read/write pointer in a file is a signed 32-bit number. A negative value 
  727.  moves the pointer backward in the file.  A positive value moves the pointer 
  728.  forward. DosChgFilePtr cannot be used to seek to a negative position in the 
  729.  file. 
  730.  
  731.  This call may not be used for a character device or pipe. 
  732.  
  733.  
  734. ΓòÉΓòÉΓòÉ 1.11. DosCLIAccess ΓòÉΓòÉΓòÉ
  735.  
  736.                                Bindings:  C, MASM
  737.  
  738. This call requests I/O privilege for disabling and enabling interrupts.  Access 
  739. to ports must be granted with DosPortAccess. 
  740.  
  741.  DosCLIAccess     ( ) 
  742.  
  743.  rc (USHORT) - return 
  744.     Return code descriptions are: 
  745.  
  746.     0         NO_ERROR 
  747.  
  748.  Remarks 
  749.  
  750.  Applications that only use CLI/STI in IOPL segments must request CLI/STI 
  751.  privilege from the operating system. 
  752.  
  753.  Applications that use IN/OUT instructions to I/O ports must request I/O 
  754.  privilege with DosPortAccess. (See DosPortAccess for more detail.) Request for 
  755.  port access also grants CLI/STI privilege from the operating system. 
  756.  
  757.  
  758. ΓòÉΓòÉΓòÉ 1.12. DosClose ΓòÉΓòÉΓòÉ
  759.  
  760.                                Bindings:  C, MASM
  761.  
  762. This call closes a handle to a file, pipe, or device. 
  763.  
  764.  DosClose    (FileHandle) 
  765.  
  766.  FileHandle (HFILE) - input 
  767.     Handle returned by a previous DosOpen, DosMakeNmPipe, or DosMakePipe call. 
  768.  
  769.  rc (USHORT) - return 
  770.     Return code descriptions are: 
  771.  
  772.     0         NO_ERROR 
  773.     2         ERROR_FILE_NOT_FOUND 
  774.     5         ERROR_ACCESS_DENIED 
  775.     6         ERROR_INVALID_HANDLE 
  776.  
  777.  Remarks 
  778.  
  779.  Issuing DosClose with the handle to a file closes a handle to a file, pipe, or 
  780.  device. 
  781.  
  782.  If one or more additional handles to a file have been created with 
  783.  DosDupHandle, the directory is not updated and all internal buffers are not 
  784.  written to the medium until DosClose has been issued for the duplicated 
  785.  handles. 
  786.  
  787.  Closing a handle to a device causes the device to be notified of the close, if 
  788.  appropriate. 
  789.  
  790.  
  791.  Named Pipe Considerations 
  792.  
  793.  DosClose closes a named pipe by handle.  When all handles referencing one end 
  794.  of a pipe are closed, the pipe is considered broken. 
  795.  
  796.  If the client end closes, no other process can re-open the pipe until the 
  797.  serving end issues a DosDisConnectNmPipe followed by a DosConnectNmPipe. 
  798.  
  799.  If the server end closes when the pipe is already broken, it is deallocated 
  800.  immediately; otherwise, the pipe is not deallocated until the last client 
  801.  handle is closed. 
  802.  
  803.  
  804. ΓòÉΓòÉΓòÉ 1.13. DosCloseQueue ΓòÉΓòÉΓòÉ
  805.  
  806.                                Bindings:  C, MASM
  807.  
  808. This call closes the queue in use by the requesting process. 
  809.  
  810.  DosCloseQueue (QueueHandle) 
  811.  
  812.  QueueHandle (HQUEUE) - input 
  813.     Handle returned from a previous DosCreateQueue or DosOpenQueue call. 
  814.  
  815.  rc (USHORT) - return 
  816.     Return code descriptions are: 
  817.  
  818.     0         NO_ERROR 
  819.     337       ERROR_QUE_INVALID_HANDLE 
  820.  
  821.  Remarks 
  822.  
  823.  DosCloseQueue is used to terminate further processing of a queue by the 
  824.  requesting process. The actions taken depend on whether the requestor is the 
  825.  owner or a writer of the queue. For all processes, an access count 
  826.  representing all DosOpenQueue calls performed is decremented. For non-owning 
  827.  processes, access is terminated when this count goes to zero. For owning 
  828.  processes, the queue (and its elements) are purged if the access count 
  829.  previously equaled zero. Other processes that have the queue open receive the 
  830.  ERROR_QUE_INVALID_HANDLE return code on their next request. 
  831.  
  832.  
  833. ΓòÉΓòÉΓòÉ 1.14. DosCloseSem ΓòÉΓòÉΓòÉ
  834.  
  835.                                Bindings:  C, MASM
  836.  
  837. This call closes a handle to a system semaphore, obtained with a DosCreateSem 
  838. or DosOpenSem request. 
  839.  
  840.  DosCloseSem     (SemHandle) 
  841.  
  842.  SemHandle (HSEM) - input 
  843.     Handle returned from a previous DosCreateSem or DosOpenSem call. 
  844.  
  845.  rc (USHORT) - return 
  846.     Return code descriptions are: 
  847.  
  848.     0         NO_ERROR 
  849.     102       ERROR_SEM_IS_SET 
  850.  
  851.  Remarks 
  852.  
  853.  DosCloseSem is issued to close a handle to a system semaphore. When all 
  854.  processes that obtained handles to the semaphore with DosCreateSem or 
  855.  DosOpenSem requests have issued DosCloseSem, the semaphore is deleted and must 
  856.  be redefined by the next user with a call to DosCreateSem. 
  857.  
  858.  If a process has created a nonexclusive system semaphore and terminates while 
  859.  the semaphore is open, the system closes the handle to the semaphore that was 
  860.  returned by DosCreateSem. If the process is currently holding the semaphore 
  861.  when it terminates, OS/2 clears the semaphore and returns ERROR_SEM_OWNER_DIED 
  862.  to the next thread that gets the resource because of a DosSemRequest call. 
  863.  This error message alerts the holder of the semaphore that the semaphore owner 
  864.  may have ended abnormally; consequently, the resource is in an indeterminate 
  865.  state.  The thread should take appropriates steps to protect the integrity of 
  866.  the resource.  Upon completion of cleanup activity, the thread can release the 
  867.  semaphore by calling DosSemClear. This call resets the error condition flagged 
  868.  in the semaphore data structure and makes the semaphore available to the next 
  869.  user of the resource. The semaphore remains available to all processes that 
  870.  obtained handles to it with DosOpenSem requests until they call DosCloseSem to 
  871.  release the semaphore handles. 
  872.  
  873.  If a process has created an exclusive system semaphore and terminates while 
  874.  the semaphore is open, ownership of the semaphore is transferred to the thread 
  875.  executing any exit list routines. If no exit list routines have been 
  876.  identified to the system with DosExitList, the system closes the handle to the 
  877.  semaphore. 
  878.  
  879.  
  880. ΓòÉΓòÉΓòÉ 1.15. DosConnectNmPipe ΓòÉΓòÉΓòÉ
  881.  
  882.                                Bindings:  C, MASM
  883.  
  884. This call is issued by the server process and enables the named pipe to be 
  885. opened 
  886. by a client. 
  887.  
  888.  DosConnectNmPipe      (Handle) 
  889.  
  890.  Handle (HPIPE) - input 
  891.     Handle of the named pipe that is returned by DosMakeNmPipe. 
  892.  
  893.  rc (USHORT) - return 
  894.     Return code descriptions are: 
  895.  
  896.     0         NO_ERROR 
  897.     95        ERROR_INTERRUPT 
  898.     109       ERROR_BROKEN_PIPE 
  899.     230       ERROR_BAD_PIPE 
  900.     233       ERROR_PIPE_NOT_CONNECTED 
  901.  
  902.  Remarks 
  903.  
  904.  The server process, which creates the named pipe with DosMakeNmPipe, prepares 
  905.  the pipe so that it can accept a DosOpen from a client.  To prepare the pipe 
  906.  for its first client, the server issues DosConnectNmPipe.  To prepare the pipe 
  907.  for the next client, the server issues DosDisConnectNmPipe followed by 
  908.  DosConnectNmPipe. 
  909.  
  910.  When DosConnectNmPipe returns, the pipe is in a listening state. A DosOpen to 
  911.  a pipe that is not in a listening state fails.  A client can determine the 
  912.  pipe's state by issuing DosPeekNmPipe. 
  913.  
  914.  If the client end of the pipe is currently open, DosConnectNmPipe returns 
  915.  immediately and has no effect. If the client end is not open, DosConnectNmPipe 
  916.  either waits until it is open (if blocking mode is set) or else returns 
  917.  immediately with ERROR_PIPE_NOT_CONNECTED (if non-blocking mode is set). In 
  918.  the case where ERROR_PIPE_NOT_CONNECTED is returned, the pipe enters a 
  919.  listening state, permitting a client to issue a successful DosOpen. 
  920.  
  921.  If the pipe has been closed by a previous client but is not disconnected by 
  922.  the server, DosConnectNmPipe always returns ERROR_BROKEN_PIPE.  Multiple 
  923.  DosConnectNmPipe calls can be issued in non-blocking mode; the first one puts 
  924.  the pipe into a listening state (if it is not already open or closing), and 
  925.  subsequent ones simply test the pipe state. 
  926.  
  927.  If DosConnectNmPipe is called by the client end of the pipe, ERROR_BAD_PIPE is 
  928.  returned.  If the wait (in blocking mode only) for the client open is 
  929.  interrupted, the ERROR_INTERRUPT is returned. 
  930.  
  931.  
  932. ΓòÉΓòÉΓòÉ 1.16. DosCopy ΓòÉΓòÉΓòÉ
  933.  
  934.                                Bindings:  C, MASM
  935.  
  936. This call copies the specified file or subdirectory to the target file or 
  937. subdirectory. 
  938.  
  939.  DosCopy    (SourceName, TargetName, OpMode, Reserved) 
  940.  
  941.  SourceName (PSZ) - input 
  942.     Address of the ASCIIZ path name of the source file, subdirectory, or 
  943.     character device. Global file name characters are not allowed. 
  944.  
  945.  TargetName (PSZ) - input 
  946.     Address of the ASCIIZ path name of the target file, subdirectory, or 
  947.     character device. Global file name characters are not allowed. 
  948.  
  949.  OpMode (USHORT) - input 
  950.     Word-length bit map that defines how the DosCopy function is done. 
  951.  
  952.     Bit       Description 
  953.  
  954.     15-2      Reserved and must be set to zero. 
  955.  
  956.     1         0 = Replace the target file with the source file. 
  957.  
  958.               1 = Append the source file to the target file's end of data. This 
  959.               is ignored when copying a directory or if the target file doesn't 
  960.               exist. 
  961.  
  962.     0         0 = Do not copy the source file to the target if the file name 
  963.               already exists within the target directory.  If a single file is 
  964.               being copied and the target already exists, an error is returned. 
  965.  
  966.               1 = Copy the source file to the target even if the file name 
  967.               already exists within the target directory. 
  968.  
  969.  Reserved (ULONG) - input 
  970.     Reserved, must be set to zero. 
  971.  
  972.  rc (USHORT) - return 
  973.     Return code descriptions are: 
  974.  
  975.     0         NO_ERROR 
  976.     2         ERROR_FILE_NOT_FOUND 
  977.     3         ERROR_PATH_NOT_FOUND 
  978.     5         ERROR_ACCESS_DENIED 
  979.     26        ERROR_NOT_DOS_DISK 
  980.     32        ERROR_SHARING_VIOLATION 
  981.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  982.     87        ERROR_INVALID_PARAMETER 
  983.     108       ERROR_DRIVE_LOCKED 
  984.     206       ERROR_FILENAME_EXCED_RANGE 
  985.     267       ERROR_DIRECTORY 
  986.  
  987.  Remarks 
  988.  
  989.  DosCopy copies all files and subdirectories in the source path to the target 
  990.  path. Global file name characters are not allowed in source or target names. 
  991.  The source and the target may be on different drives. 
  992.  
  993.  In the event of an I/O error, DosCopy takes the following actions before it 
  994.  terminates: 
  995.  
  996.  o If the source name is that of a subdirectory, the file being copied at the 
  997.    time of the error is deleted from the target path. 
  998.  
  999.  o If the source name is that of a file to be replaced, the file is deleted 
  1000.    from the target path. 
  1001.  
  1002.  o If the source name is that of a file to be appended, the target file is 
  1003.    resized to its original size. 
  1004.  
  1005.  Read-only files cannot be replaced by a DosCopy request. If OpMode bit flag0 
  1006.  is set to 1 and read-only files exist in the target, an attempt to replace 
  1007.  them with files from the source returns an error. 
  1008.  
  1009.  File attributes are always copied from the source to the target; however 
  1010.  extended attributes (EAs) are not copied in every case. DosCopy copies EAs 
  1011.  from the source to the target when creating a file or directory or when 
  1012.  replacing an existing file on the target. However, it does not copy them when 
  1013.  appending an existing file or when copying files to an existing directory on 
  1014.  the target. 
  1015.  
  1016.  If a device name is specified as the target, the source name must be a file, 
  1017.  not a directory.  When the request is issued, OpMode bit flags 0 and 1 are 
  1018.  ignored. 
  1019.  
  1020.  DosQSysInfo is called by an application during initialization to determine the 
  1021.  maximum path length allowed by OS/2. 
  1022.  
  1023.  
  1024. ΓòÉΓòÉΓòÉ 1.17. DosCreateCSAlias ΓòÉΓòÉΓòÉ
  1025.  
  1026.                                Bindings:  C, MASM
  1027.  
  1028. This call creates a code segment alias descriptor for a data segment passed as 
  1029. input. 
  1030.  
  1031.  DosCreateCSAlias     (DataSelector, CodeSelector) 
  1032.  
  1033.  DataSelector (SEL) - input 
  1034.     Data segment selector. 
  1035.  
  1036.  CodeSelector (PSEL) - output 
  1037.     Address where the selector of the code segment alias descriptor is 
  1038.     returned. 
  1039.  
  1040.  rc (USHORT) - return 
  1041.     Return code descriptions are: 
  1042.  
  1043.     0         NO_ERROR 
  1044.     5         ERROR_ACCESS_DENIED 
  1045.  
  1046.  Remarks 
  1047.  
  1048.  A selector returned by a call to DosAllocSeg with no sharing options specified 
  1049.  can be used as the data segment specified with DosCreateCSAlias.  However, to 
  1050.  be CS alias, the segment must be a privilege level 2 or privilege level 3 
  1051.  non-shared segment. 
  1052.  
  1053.  A CS alias segment must be exclusively accessible by the process and cannot be 
  1054.  a huge segment.  Selectors of shared memory segments and dynamically linked 
  1055.  global data segments cannot be used as input for DosCreateCSAlias. 
  1056.  
  1057.  The code segment selector returned by DosCreateCSAlias is valid for CS. If a 
  1058.  procedure is stored in the data segment, it can be called using the CS alias. 
  1059.  The procedure may be called from privilege level 3 or I/O privilege level. 
  1060.  
  1061.  Use DosFreeSeg to free a CS alias selector created with DosCreateCSAlias. 
  1062.  Procedures in the segment can continue to be referenced if the data selector 
  1063.  for the aliased segment is passed to DosFreeSeg, because the CS alias selector 
  1064.  is not affected. Once both selectors have been passed to DosFreeSeg, the 
  1065.  segment is deallocated. 
  1066.  
  1067.  
  1068.  Family API Considerations 
  1069.  
  1070.  The returned selector is the segment address of the allocated memory. When the 
  1071.  returned selector or the original selector is freed, OS/2 immediately 
  1072.  deallocates the block of memory. 
  1073.  
  1074.  
  1075. ΓòÉΓòÉΓòÉ 1.18. DosCreateQueue ΓòÉΓòÉΓòÉ
  1076.  
  1077.                                Bindings:  C, MASM
  1078.  
  1079. This call creates a queue owned by a creating process. 
  1080.  
  1081.  DosCreateQueue     (RWHandle, QueuePrty, QueueName) 
  1082.  
  1083.  RWHandle (PHQUEUE) - output 
  1084.     Address of read/write handle of the queue. The handle is used by the 
  1085.     requestor on return. 
  1086.  
  1087.  QueuePrty (USHORT) - input 
  1088.     Values that indicate the priority ordering algorithm to use for elements 
  1089.     placed in the queue. 
  1090.  
  1091.     Value     Definition 
  1092.     0         FIFO queue 
  1093.     1         LIFO queue 
  1094.     2         Priority queue (sender specifies priority zero to 15). 
  1095.  
  1096.  QueueName (PSZ) - input 
  1097.     Address of the name of the queue. The name string that specifies the name 
  1098.     for the queue must include \QUEUES\ as the first element of the path. For 
  1099.     example, \QUEUES\RETRIEVE\CONTROL.QUE is a valid queue name.  The same name 
  1100.     must be specified when calling DosOpenQueue for the process that adds 
  1101.     elements to the queue. 
  1102.  
  1103.  rc (USHORT) - return 
  1104.     Return code descriptions are: 
  1105.  
  1106.     0         NO_ERROR 
  1107.     332       ERROR_QUE_DUPLICATE 
  1108.     334       ERROR_QUE_NO_MEMORY 
  1109.     335       ERROR_QUE_INVALID_NAME 
  1110.     336       ERROR_QUE_INVALID_PRIORITY 
  1111.     337       ERROR_QUE_INVALID_HANDLE 
  1112.  
  1113.  Remarks 
  1114.  
  1115.  When specifying the name for a queue, the ASCIIZ name string must include the 
  1116.  prefix \QUEUES\. Issuing DosCreateQueue creates a queue that can then be 
  1117.  accessed by the creating process. When another process needs to access the 
  1118.  queue, it issues DosOpenQueue with the queue's name. 
  1119.  
  1120.  The process that creates the queue owns it and has queue management 
  1121.  privileges.  Only the owner can peek at the elements in the queue with 
  1122.  DosPeekQueue, remove them with DosReadQueue, or purge the queue of all its 
  1123.  elements with DosPurgeQueue. 
  1124.  
  1125.  Any process that knows the queue name can open the queue after its creation 
  1126.  with DosOpenQueue and place data in it with DosWriteQueue. It can also query 
  1127.  the number of elements in the queue with DosQueryQueue and terminate its 
  1128.  access to the queue with DosCloseQueue. 
  1129.  
  1130.  Whether a process gains access to the queue by creating or opening it, any 
  1131.  thread in that process has access to the queue with equal authority. This 
  1132.  provides the capability for multi-server queues. 
  1133.  
  1134.  A queue ceases to exist when its owner issues DosCloseQueue. If other 
  1135.  processes use the queue handle for subsequent requests after the owner has 
  1136.  closed the queue, ERROR_QUE_INVALID_HANDLE is returned. 
  1137.  
  1138.  
  1139. ΓòÉΓòÉΓòÉ 1.19. DosCreateSem ΓòÉΓòÉΓòÉ
  1140.  
  1141.                                Bindings:  C, MASM
  1142.  
  1143. This call creates a system semaphore used by multiple asynchronous threads to 
  1144. serialize their access to resources. 
  1145.  
  1146.  DosCreateSem     (NoExclusive, SemHandle, SemName) 
  1147.  
  1148.  NoExclusive (USHORT) - input 
  1149.     Indicates whether or not the process creating the semaphore wants exclusive 
  1150.     use of the semaphore. The meanings for the settings of this flag are: 
  1151.  
  1152.     Value     Definition 
  1153.     0         The creating process has exclusive use of the semaphore. Only 
  1154.               threads of the creating process may alter the state of the 
  1155.               semaphore with semaphore function calls. 
  1156.     1         The creating process has nonexclusive use of the semaphore. 
  1157.               Threads of other processes, as well as those of the creating 
  1158.               process, may alter the state of the semaphore with semaphore 
  1159.               function calls. 
  1160.  
  1161.  SemHandle (PHSYSSEM) - output 
  1162.     Address of handle of the new system semaphore. 
  1163.  
  1164.  SemName (PSZ) - input 
  1165.     Address of the name of the system semaphore. A system semaphore is defined 
  1166.     within the file system name space as a pseudo file; thus, a semaphore has a 
  1167.     full path name. The ASCIIZ string specifying the name must include \SEM\ as 
  1168.     the first element of the path. For example, \SEM\RETRIEVE\SIGNAL.SEM is a 
  1169.     valid semaphore name. 
  1170.  
  1171.     Although a system semaphore name takes the form of a file in a subdirectory 
  1172.     called \SEM, this subdirectory does not exist. System semaphores and their 
  1173.     names are kept in memory. 
  1174.  
  1175.     If your application provides long name support for an installable file 
  1176.     system, a semaphore name is not restricted to the DOS 8.3 filename format. 
  1177.  
  1178.  rc (USHORT) - return 
  1179.     Return code descriptions are: 
  1180.  
  1181.     0         NO_ERROR 
  1182.     87        ERROR_INVALID_PARAMETER 
  1183.     100       ERROR_TOO_MANY_SEMAPHORES 
  1184.     123       ERROR_INVALID_NAME 
  1185.     183       ERROR_ALREADY_EXISTS 
  1186.  
  1187.  Remarks 
  1188.  
  1189.  A call to DosCreateSem creates a system semaphore, which can be manipulated by 
  1190.  threads issuing semaphore function calls. Manipulation of a system semaphore 
  1191.  is most often used to control access to a serially reusable resource. 
  1192.  Manipulation of the semaphore is also used to signal the occurrence of an 
  1193.  event to waiting threads. 
  1194.  
  1195.  To control access to a serially reusable resource, a process creates the 
  1196.  system semaphore with a call to DosCreateSem. If the users of the resource are 
  1197.  asynchronous threads of the creating process, NoExclusive=0 is specified to 
  1198.  create an exclusive system semaphore. If the users of the resource include 
  1199.  threads of other processes, NoExclusive=1 is specified to create a 
  1200.  nonexclusive system semaphore. 
  1201.  
  1202.  DosCreateSem returns a semaphore handle used by the creating process and any 
  1203.  of its threads to access the semaphore. If the semaphore is nonexclusive, a 
  1204.  process other than the semaphore creator calls DosOpenSem for a handle to 
  1205.  access the semaphore. 
  1206.  
  1207.  Ownership of the system semaphore is established by a successful DosSemRequest 
  1208.  call. If another thread issues DosSemRequest while the semaphore is owned, the 
  1209.  thread can block and wait for the semaphore to become available, or it can 
  1210.  return immediately. 
  1211.  
  1212.  After accessing the resource, the owning thread can clear the semaphore by a 
  1213.  call to DosSemClear. If the semaphore is an exclusive system semaphore, it has 
  1214.  a use count associated with it, which is incremented by DosSemRequest calls 
  1215.  and decremented by DosSemClear calls. The semaphore is not actually cleared 
  1216.  and made available to the next thread waiting to use the resource until the 
  1217.  semaphore has been cleared the same number of times it has been requested. 
  1218.  This means that exclusive system semaphores can be used in recursive routines. 
  1219.  
  1220.  If a process has created a nonexclusive system semaphore and terminates while 
  1221.  the semaphore is open, the system closes the handle to the semaphore that was 
  1222.  returned by DosCreateSem. If the process is currently holding the semaphore 
  1223.  when it terminates, OS/2 clears the semaphore and returns ERROR_SEM_OWNER_DIED 
  1224.  to the next thread that gets the resource because of a DosSemRequest call. 
  1225.  This error message alerts the holder of the semaphore that the semaphore owner 
  1226.  may have ended abnormally; consequently, the resource is in an indeterminate 
  1227.  state.  The thread should take appropriates  steps to protect the integrity of 
  1228.  the resource.  Upon completion of cleanup activity, the thread can release the 
  1229.  semaphore by calling DosSemClear. This call resets the error condition flagged 
  1230.  in the semaphore data structure and makes the semaphore available to the next 
  1231.  user of the resource. The semaphore remains available to all processes that 
  1232.  obtained handles to it with DosOpenSem requests until they call DosCloseSem to 
  1233.  release the semaphore handles. 
  1234.  
  1235.  If a process has created an exclusive system semaphore and terminates while 
  1236.  the semaphore is open, ownership of the semaphore is transferred to the thread 
  1237.  executing any exit list routines. If no exit list routines have been 
  1238.  identified to the system with DosExitList, the system closes the handle to the 
  1239.  semaphore. 
  1240.  
  1241.  In addition to controlling access to serially reusable resources, a 
  1242.  nonexclusive system semaphore is also used to signal an event, such as the 
  1243.  removal of an element from a queue, to other processes. A process that sets 
  1244.  the semaphore waits for another process to clear the semaphore, signaling the 
  1245.  event. When the signaling process issues a DosSemClear, any waiting threads 
  1246.  resume execution. Calls that support setting and waiting upon a nonexclusive 
  1247.  semaphore by one or more threads are DosSemSet, DosSemWait,  DosSemSetWait, 
  1248.  and DosMuxSemWait. 
  1249.  
  1250.  Note:  If a thread needs to signal another thread of the same process, a RAM 
  1251.         semaphore is used. 
  1252.  
  1253.  
  1254. ΓòÉΓòÉΓòÉ 1.20. DosCreateThread ΓòÉΓòÉΓòÉ
  1255.  
  1256.                                Bindings:  C, MASM
  1257.  
  1258. This call creates an asynchronous thread of execution under the current 
  1259. process. 
  1260.  
  1261.  DosCreateThread     (PgmAddress, ThreadIDWord, NewThreadStack) 
  1262.  
  1263.  PgmAddress (PFNTHREAD) - input 
  1264.     Address within program module where new thread begins execution. This 
  1265.     address must not be in an IOPL segment. 
  1266.  
  1267.  ThreadIDWord (PTID) - output 
  1268.     Address of thread ID of the new thread. 
  1269.  
  1270.  NewThreadStack (PBYTE) - input 
  1271.     Address of the new thread's stack. 
  1272.  
  1273.  rc (USHORT) - return 
  1274.     Return code descriptions are: 
  1275.  
  1276.     0         NO_ERROR 
  1277.     8         ERROR_NOT_ENOUGH_MEMORY 
  1278.     89        ERROR_NO_PROC_SLOTS 
  1279.     212       ERROR_LOCKED 
  1280.  
  1281.  Remarks 
  1282.  
  1283.  OS/2 creates the first thread of a process when it starts the executable file. 
  1284.  This thread is dispatched with a regular class priority. To start another 
  1285.  thread of execution under the current process, the current thread allocates 
  1286.  stack memory and issues DosCreateThread. Upon generation of the far call, the 
  1287.  thread's initial dispatch point is the address specified for PgmAddress. The 
  1288.  started thread has a unique stack and register context and the same priority 
  1289.  as the requesting thread. 
  1290.  
  1291.  Note:  The minimum available space on the stack for a thread calling an 
  1292.         operating system function must be 4K bytes. 
  1293.  
  1294.  A thread's stack, register context, and priority is the only information 
  1295.  maintained by OS/2 that is specific to the thread. The thread shares resources 
  1296.  with other threads of the process. Any thread in the process can open a file 
  1297.  or device, and any other thread can issue a read or write to that handle. This 
  1298.  is also true for pipes, queues, and system semaphores. 
  1299.  
  1300.  The address passed as the NewThreadStack value must be the address of the 
  1301.  highest byte in the stack. This value is loaded into the SS:PP registers 
  1302.  before starting the new thread. 
  1303.  
  1304.  A thread started with DosCreateThread terminates upon return of this call or 
  1305.  when a DosExit is issued. Any thread can temporarily stop the execution of 
  1306.  other threads in its process with DosSuspendThread, DosResumeThread, 
  1307.  DosEnterCritSec, and DosExitCritSec calls.  Any thread can also examine and 
  1308.  change the priority at which it and other threads execute with DosGetPrty and 
  1309.  DosSetPrty. 
  1310.  
  1311.  Note:  DosCreateThread cannot be issued from within a segment that has I/O 
  1312.         privilege (IOPL).  If the new thread entry point is in an IOPL code 
  1313.         segment, a general protection fault is generated, and the process is 
  1314.         terminated. 
  1315.  
  1316.  All code segments execute at a privilege level. Segments for OS/2 applications 
  1317.  usually execute at privilege level 3. However, if an application has an IOPL 
  1318.  code segment that is executing at privilege level 2 and has to start another 
  1319.  thread of execution, DosCallback can be issued from the IOPL segment to invoke 
  1320.  a privilege level 3 segment.  But before the DosCreateThread request is made, 
  1321.  the IOPL segment's stack must be resized in the privilege level 3 segment by a 
  1322.  call to DosR2StackRealloc. For more information on IOPL code segments, see IBM 
  1323.  Operating System/2 Version 1.2 I/O Subsystems And Device Support Volume 1. 
  1324.  
  1325.  
  1326. ΓòÉΓòÉΓòÉ 1.21. DosCwait ΓòÉΓòÉΓòÉ
  1327.  
  1328.                                Bindings:  C, MASM
  1329.  
  1330. This call places the current thread in a wait state until an asynchronous child 
  1331. process ends.  When the process ends, its process ID and termination code are 
  1332. returned to the caller. 
  1333.  
  1334.  DosCwait    (ActionCode, WaitOption, ReturnCodes, ProcessIDWord, ProcessID) 
  1335.  
  1336.  ActionCode (USHORT) - input 
  1337.     The process whose termination is being waited for. 
  1338.  
  1339.     Value     Definition 
  1340.     0         The child process indicated by ProcessID. 
  1341.     1         The last descendant of the child process indicated by ProcessID. 
  1342.  
  1343.  WaitOption (USHORT) - input 
  1344.     Return if no child process ends. 
  1345.  
  1346.     Value     Definition 
  1347.     0         Wait if no child process ends or until no child processes are 
  1348.               outstanding. 
  1349.     1         Do not wait for child processes to end. 
  1350.  
  1351.  ReturnCodes (PRESULTCODES) - output 
  1352.     Address of the structure containing the termination code and the result 
  1353.     code indicating the reason for the child's termination. 
  1354.  
  1355.     codeTerminate (USHORT) 
  1356.        The termination code furnished by the system describing why the child 
  1357.        terminated. 
  1358.  
  1359.        Value     Definition 
  1360.        0         EXIT (normal) 
  1361.        1         Hard error abort 
  1362.        2         Trap operation 
  1363.        3         Unintercepted DosKillProcess 
  1364.  
  1365.     codeResult (USHORT) 
  1366.        Result code specified by the terminating process on its last DosExit 
  1367.        call. 
  1368.  
  1369.  ProcessIDWord (PPID) - output 
  1370.     Address of the process ID of the ending process. 
  1371.  
  1372.  ProcessID (PID) - input 
  1373.     ID of the process whose termination is being waited for: 
  1374.  
  1375.     Value     Definition 
  1376.       0       Any child process. 
  1377.     <> 0      The indicated child process and all its descendants. 
  1378.  
  1379.  rc (USHORT) - return 
  1380.     Return code descriptions are: 
  1381.  
  1382.     0         NO_ERROR 
  1383.     13        ERROR_INVALID_DATA 
  1384.     128       ERROR_WAIT_NO_CHILDREN 
  1385.     129       ERROR_CHILD_NOT_COMPLETE 
  1386.     184       ERROR_NO_CHILD_PROCESS 
  1387.     303       ERROR_INVALID_PROCID 
  1388.  
  1389.  Remarks 
  1390.  
  1391.  DosCwait waits for completion of a child process, whose execution is 
  1392.  asynchronous to that of its parent process. The child process is created by a 
  1393.  DosExecPgm request with ExecFlags=2 specified. If the child process has 
  1394.  multiple threads, the result code returned by DosCwait is the one passed to it 
  1395.  by the DosExit request that terminates the process. 
  1396.  
  1397.  DosCwait can also wait for the descendant processes of a child process to 
  1398.  complete before it returns. However, it does not report status for descendant 
  1399.  processes. 
  1400.  
  1401.  To wait for all child processes and descendant processes to end, issue 
  1402.  DosCwait repeatedly, with ActionCode=1 andProcessID=0 specified, until 
  1403.  ERROR_NO_CHILD_PROCESS is returned. The contents of ProcessIDWord can be 
  1404.  examined to determine which child the termination codes are from. 
  1405.  
  1406.  If no child processes were started, DosCwait returns with an error. If no 
  1407.  child processes terminate, DosCwait can wait until one terminates before 
  1408.  returning to the parent, or it can return immediately if it specifies 
  1409.  WaitOption=1. This parameter is used to return the result code of a child 
  1410.  process that has already ended. 
  1411.  
  1412.  
  1413. ΓòÉΓòÉΓòÉ 1.22. DosDelete ΓòÉΓòÉΓòÉ
  1414.  
  1415.                                Bindings:  C, MASM
  1416.  
  1417. This call removes a directory entry associated with a file name. 
  1418.  
  1419.  DosDelete    (FileName, Reserved) 
  1420.  
  1421.  FileName (PSZ) - input 
  1422.     Address of the name of the file to be deleted. 
  1423.  
  1424.     DosQSysInfo is called by an application during initialization to determine 
  1425.     the maximum path length allowed by OS/2. 
  1426.  
  1427.  Reserved (ULONG) - input 
  1428.     Reserved and must be set to zero. 
  1429.  
  1430.  rc (USHORT) - return 
  1431.     Return code descriptions are: 
  1432.  
  1433.     0         NO_ERROR 
  1434.     2         ERROR_FILE_NOT_FOUND 
  1435.     3         ERROR_PATH_NOT_FOUND 
  1436.     5         ERROR_ACCESS_DENIED 
  1437.     26        ERROR_NOT_DOS_DISK 
  1438.     32        ERROR_SHARING_VIOLATION 
  1439.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  1440.     87        ERROR_INVALID_PARAMETER 
  1441.     206       ERROR_FILENAME_EXCED_RANGE 
  1442.  
  1443.  Remarks 
  1444.  
  1445.  Global file name characters are not permitted. 
  1446.  
  1447.  A file whose read-only attribute is set cannot be deleted. To change the 
  1448.  setting of the read-only bit, call DosSetFileMode. 
  1449.  
  1450.  
  1451. ΓòÉΓòÉΓòÉ 1.23. DosDevConfig ΓòÉΓòÉΓòÉ
  1452.  
  1453.                                Bindings:  C, MASM
  1454.  
  1455. This call gets information about attached devices. 
  1456.  
  1457.  DosDevConfig     (DeviceInfo, Item, Parm) 
  1458.  
  1459.  DeviceInfo (PVOID) - output 
  1460.     Address of the byte-wide field containing the requested information. 
  1461.  
  1462.  Item (USHORT) - input 
  1463.     Device information requested. 
  1464.  
  1465.     Value     Definition 
  1466.      0        Number of printers attached 
  1467.      1        Number of RS232 ports 
  1468.      2        Number of diskette drives 
  1469.      3        Presence of math coprocessor (where 0 = not present, 1 = present) 
  1470.      4        PC Submodel Type ( where the return is the system submodel byte) 
  1471.      5        PC Model Type ( where the return is the system model byte) 
  1472.      6        Display adapter type (where 0 = monochrome mode compatible, 1 = 
  1473.               other). 
  1474.  
  1475.  Parm (USHORT) - input 
  1476.     Reserved for future use and should be set to zero. 
  1477.  
  1478.  rc (USHORT) - return 
  1479.     Return code descriptions are: 
  1480.  
  1481.     0         NO_ERROR 
  1482.     87        ERROR_INVALID_PARAMETER 
  1483.  
  1484.  Remarks 
  1485.  
  1486.  The system model (function 5) and submodel (function 4) information is 
  1487.  obtained from BIOS. 
  1488.  
  1489.  In addition, the number of devices attached in a PS/2 environment reflect only 
  1490.  devices that are "awake".  Devices that are "asleep" are not counted. 
  1491.  
  1492.  
  1493. ΓòÉΓòÉΓòÉ 1.24. DosDevIOCtl ΓòÉΓòÉΓòÉ
  1494.  
  1495.                                Bindings:  C, MASM
  1496.  
  1497. This call performs control functions on a device specified by an opened device 
  1498. handle. 
  1499.  
  1500.  DosDevIOCtl     (Data, ParmList, Function, Category, DevHandle) 
  1501.  
  1502.  Data (PVOID) - input 
  1503.     Address of the data area. 
  1504.  
  1505.  ParmList (PVOID) - input 
  1506.     Address of the command-specific argument list. 
  1507.  
  1508.  Function (USHORT) - input 
  1509.     Device-specific function code. 
  1510.  
  1511.  Category (USHORT) - input 
  1512.     Device category. 
  1513.  
  1514.  DevHandle (HFILE) - input 
  1515.     Device handle returned by DosOpen or a standard (open) device handle. 
  1516.  
  1517.  rc (USHORT) - return 
  1518.     Return code descriptions are: 
  1519.  
  1520.     0         NO_ERROR 
  1521.     1         ERROR_INVALID_FUNCTION 
  1522.     6         ERROR_INVALID_HANDLE 
  1523.     15        ERROR_INVALID_DRIVE 
  1524.     31        ERROR_GEN_FAILURE 
  1525.     87        ERROR_INVALID_PARAMETER 
  1526.     115       ERROR_PROTECTION_VIOLATION 
  1527.     117       ERROR_INVALID_CATEGORY 
  1528.     119       ERROR_BAD_DRIVER_LEVEL 
  1529.     163       ERROR_UNCERTAIN_MEDIA 
  1530.     165       ERROR_MONITORS_NOT_SUPPORTED 
  1531.  
  1532.  Remarks 
  1533.  
  1534.  Values returned in the range hex FF00 through FFFF are user dependent error 
  1535.  codes.  Values returned in the range hex FE00 through FEFF are device driver 
  1536.  dependent error codes. 
  1537.  
  1538.  Refer to the IBM Operating System/2 Version 1.2 I/O Subsystems And Device 
  1539.  Support Volume 1 for a complete listing of control functions (DevHlp calls). 
  1540.  
  1541.  
  1542.  Family API Considerations 
  1543.  
  1544.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  1545.  Therefore, the following considerations apply to DosDevIOCtl when coding for 
  1546.  the DOS mode. 
  1547.  
  1548.  The level of support for DosDevIOCtl is identified by category and function 
  1549.  code with a noted restriction if it is not supported by DOS 2.X or DOS 3.X 
  1550.  Functions tend to be more restrictive in lower version numbers of DOS. 
  1551.  
  1552.  o Category 1 supported as follows: 
  1553.  
  1554.     - 41H Set Baud Rate 
  1555.     - 42H Set Line Control 
  1556.     - All other category 1 functions are not supported for DOS 2.X and DOS 3.X. 
  1557.  
  1558.  o Category 2 not supported in FAPI 
  1559.  
  1560.  o Category 3 not supported in FAPI 
  1561.  
  1562.  o Category 4 not supported in FAPI 
  1563.  
  1564.  o Category 5 supported in FAPI as follows: 
  1565.  
  1566.     - 42H Set Frame control - supports IBM Graphics Printers only 
  1567.     - 44H Set Infinite Retry - for DOS 2.X and DOS 3.X, the function is in 
  1568.       effect only for the duration of the calling program 
  1569.     - 46H Initialize printer 
  1570.     - 62H Get Frame Control - not supported for DOS 2.X and DOS 3.X 
  1571.     - 64H Get Infinite Retry 
  1572.     - 66H Get Printer Status. 
  1573.  
  1574.  o Category 6 not supported in FAPI 
  1575.  
  1576.  o Category 7 not supported in FAPI 
  1577.  
  1578.  o Category 8 supported in FAPI as follows: 
  1579.  
  1580.     - 00H Lock Drive - not supported for versions below DOS 3.2 
  1581.     - 01H Unlock Drive - not supported for versions below DOS 3.2 
  1582.     - 02H Redetermine Media - not supported for versions below DOS 3.2 
  1583.     - 03H Set Logical Map - not supported for versions below DOS 3.2 
  1584.     - 20H Block Removable - not supported for versions below DOS 3.2 
  1585.     - 21H Get Logical Map - not supported for versions below DOS 3.2 
  1586.     - 43H Set Device Parameters - not supported for DOS 2.X and DOS 3.X 
  1587.     - 44H Write Track - not supported for DOS 2.X and DOS 3.X 
  1588.     - 45H Format Track - not supported for DOS 2.X and DOS 3.X 
  1589.     - 63H Get Device Parameters - not supported for DOS 2.X and DOS 3.X 
  1590.     - 64H Read Track - not supported for DOS 2.X and DOS 3.X 
  1591.     - 65H Verify Track - not supported for DOS 2.X and DOS 3.X. 
  1592.  
  1593.  o Category 9 is reserved 
  1594.  
  1595.  o Category 10 (0AH) not supported in FAPI 
  1596.  
  1597.  o Category 11 (0BH) not supported in FAPI. 
  1598.  
  1599.  
  1600. ΓòÉΓòÉΓòÉ 1.25. DosDevIOCtl2 ΓòÉΓòÉΓòÉ
  1601.  
  1602.                                Bindings:  C, MASM
  1603.  
  1604. This call performs control functions on a device specified by an opened device 
  1605. handle. 
  1606.  
  1607.  DosDevIOCtl2     (Data, DataLength, ParmList, ParmListLength, Function, 
  1608.                   Category, DevHandle) 
  1609.  
  1610.  Data (PVOID) - input 
  1611.     Address of the data area. 
  1612.  
  1613.  DataLength (USHORT) - input 
  1614.     Length of the data buffer. 
  1615.  
  1616.  ParmList (PVOID) - input 
  1617.     Address of the command-specific argument list. 
  1618.  
  1619.  ParmListLength (USHORT) - input 
  1620.     Length of the command-specific argument list. 
  1621.  
  1622.  Function (USHORT) - input 
  1623.     Device-specific function code. 
  1624.  
  1625.  Category (USHORT) - input 
  1626.     Device category. 
  1627.  
  1628.  DevHandle (HFILE) - input 
  1629.     Device handle returned by DosOpen or a standard (open) device handle. 
  1630.  
  1631.  rc (USHORT) - return 
  1632.     Return code descriptions are: 
  1633.  
  1634.     0         NO_ERROR 
  1635.     1         ERROR_INVALID_FUNCTION 
  1636.     6         ERROR_INVALID_HANDLE 
  1637.     15        ERROR_INVALID_DRIVE 
  1638.     31        ERROR_GEN_FAILURE 
  1639.     87        ERROR_INVALID_PARAMETER 
  1640.     115       ERROR_PROTECTION_VIOLATION 
  1641.     117       ERROR_INVALID_CATEGORY 
  1642.     119       ERROR_BAD_DRIVER_LEVEL 
  1643.     163       ERROR_UNCERTAIN_MEDIA 
  1644.     165       ERROR_MONITORS_NOT_SUPPORTED 
  1645.  
  1646.  Remarks 
  1647.  
  1648.  Values returned in the range hex FF00 through FFFF are user dependent error 
  1649.  codes.  Values returned in the range hex FE00 through FEFF are device driver 
  1650.  dependent error codes. 
  1651.  
  1652.  Refer to the IBM Operating System/2 Version 1.2 I/O Subsystems And Device 
  1653.  Support Volume 1 for a complete listing of control functions (DevHlp calls). 
  1654.  
  1655.  This function provides a generic, expandable IOCTL facility. 
  1656.  
  1657.  A null (zero) value for Data specifies that this parameter is not defined for 
  1658.  the generic IOCTL function being specified.  A null value for Data causes the 
  1659.  value passed in DataLength to be ignored. 
  1660.  
  1661.  A null (zero) value for ParmList specifies that this parameter is not defined 
  1662.  for the generic IOCTL function being specified.  A null value for ParmList 
  1663.  causes the value passed in ParmListLength to be ignored. 
  1664.  
  1665.  The kernel formats a generic IOCTL packet and call the device driver.  Since 
  1666.  V1.0 and V1.1 device drivers do not understand generic IOCTL packets with 
  1667.  DataLength and ParmListLength, the kernel does not pass these fields to the 
  1668.  device driver.  Device drivers that are marked as being level 2 or higher must 
  1669.  support receipt of the generic IOCTL packets with associated length fields. 
  1670.  
  1671.  Do not pass a non-null pointer with a zero length. 
  1672.  
  1673.  
  1674. ΓòÉΓòÉΓòÉ 1.26. DosDisConnectNmPipe ΓòÉΓòÉΓòÉ
  1675.  
  1676.                                Bindings:  C, MASM
  1677.  
  1678. This call forces a named pipe to close. 
  1679.  
  1680.  DosDisConnectNmPipe      (Handle) 
  1681.  
  1682.  Handle (HPIPE) - input 
  1683.     Handle of the named pipe that is returned by DosMakeNmPipe. 
  1684.  
  1685.  rc (USHORT) - return 
  1686.     Return code descriptions are: 
  1687.  
  1688.     0         NO_ERROR 
  1689.     109       ERROR_BROKEN_PIPE 
  1690.     230       ERROR_BAD_PIPE 
  1691.  
  1692.  Remarks 
  1693.  
  1694.  The server process of a named pipe issues DosDisConnectNmPipe followed by 
  1695.  DosConnectNmPipe to prepare the pipe for the next client. 
  1696.  
  1697.  If the client end of the pipe is open when DosDisConnectNmPipe is issued, it 
  1698.  is forced to close, and the client gets an error code on its next operation. 
  1699.  Forcing the client end to close may cause data to be discarded that has not 
  1700.  yet been read by the client.  If the client end is currently closing (DosClose 
  1701.  has been issued), DosDisConnectNmPipe acknowledges the close and makes the 
  1702.  pipe available to be opened by the next client after a DosConnectNmPipe is 
  1703.  issued. 
  1704.  
  1705.  A client that gets forced off a pipe by a DosDisConnectNmPipe must issue 
  1706.  DosClose to free the handle resource. Although DosDisConnectNmPipe makes the 
  1707.  client's handle invalid, it does not free the client's handle. 
  1708.  
  1709.  Any threads that are blocked on the pipe are awakened by DosDisConnectNmPipe. 
  1710.  A thread blocked on the pipe by a DosWrite returns ERROR_BROKEN_PIPE.  A 
  1711.  thread blocked on the pipe by a DosRead returns BytesRead = 0, indicating EOF. 
  1712.  
  1713.  
  1714. ΓòÉΓòÉΓòÉ 1.27. DosDupHandle ΓòÉΓòÉΓòÉ
  1715.  
  1716.                                Bindings:  C, MASM
  1717.  
  1718. This call returns a new file handle for an open file, which refers to the same 
  1719. position in the file as the old file handle. 
  1720.  
  1721.  DosDupHandle     (OldFileHandle, NewFileHandle) 
  1722.  
  1723.  OldFileHandle (HFILE) - input 
  1724.     Current file handle. 
  1725.  
  1726.  NewFileHandle (PHFILE) - input/output 
  1727.     Address of a Word.  On input, values and their meanings are: 
  1728.  
  1729.     Value     Definition 
  1730.      FFFFH    Allocate a new file handle and return it here. 
  1731.     <>FFFFH   Assign this value as the new file handle. A valid value is any of 
  1732.               the handles assigned to standard I/O, or the handle of a file 
  1733.               currently opened by the process. 
  1734.  
  1735.               On output, a value of FFFFH returns a value for NewFileHandle, 
  1736.               allocated by OS/2. 
  1737.  
  1738.  rc (USHORT) - return 
  1739.     Return code descriptions are: 
  1740.  
  1741.     0         NO_ERROR 
  1742.     4         ERROR_TOO_MANY_OPEN_FILES 
  1743.     6         ERROR_INVALID_HANDLE 
  1744.     114       ERROR_INVALID_TARGET_HANDLE 
  1745.  
  1746.  Remarks 
  1747.  
  1748.  Duplicating the handle duplicates and ties all handle-specific information 
  1749.  between OldFileHandle and NewFileHandle. For example, if you move the 
  1750.  read/write pointer of either handle by a DosRead, DosWrite, or DosChgFilePtr 
  1751.  function call, the pointer for the other handle is also changed. 
  1752.  
  1753.  The valid values for NewFileHandle include the following handles for standard 
  1754.  I/O, which are always available to the process: 
  1755.  
  1756.  0000H     Standard input 
  1757.  0001H     Standard output 
  1758.  0002H     Standard error. 
  1759.  
  1760.  If a file handle value of a currently open file is specified in NewFileHandle, 
  1761.  the file handle is closed before it is redefined as the duplicate of 
  1762.  OldFileHandle. Avoid using arbitrary values for NewFileHandle. 
  1763.  
  1764.  Issuing a DosClose against a file handle does not affect the duplicate handle. 
  1765.  
  1766.  
  1767. ΓòÉΓòÉΓòÉ 1.28. DosEditName ΓòÉΓòÉΓòÉ
  1768.  
  1769.                                Bindings:  C, MASM
  1770.  
  1771. This call edits file and subdirectory names indirectly by transforming one 
  1772. ASCII string into another, using global file name characters for editing or 
  1773. search operations on the string. 
  1774.  
  1775.  DosEditName     (EditLevel, SourceString, EditString, TargetBuf, TargetBufLen) 
  1776.  
  1777.  EditLevel (USHORT) - input 
  1778.     The level of editing semantics to use in transforming the source string. 
  1779.     The value of EditLevel must be 0001H for OS/2 Version 1.2. 
  1780.  
  1781.  SourceString (PSZ) - input 
  1782.     Address of the ASCIIZ string to transform. Global file name characters are 
  1783.     specified only in the subdirectory or file name component of the path name 
  1784.     and are interpreted as search characters. 
  1785.  
  1786.  EditString (PSZ) - input 
  1787.     Address of the ASCIIZ string to use for editing. Global file name 
  1788.     characters specified in the edit string are interpreted as editing 
  1789.     characters. Because only the name component of a path name is transformed, 
  1790.     this string does not include the path component. 
  1791.  
  1792.  TargetBuf (PBYTE) - output 
  1793.     Address of the buffer to store the resulting ASCIIZ string in. 
  1794.  
  1795.  TargetBufLen (USHORT) - input 
  1796.     The length of the buffer to store the resulting string in. 
  1797.  
  1798.  rc (USHORT) - return 
  1799.     Return code descriptions are: 
  1800.  
  1801.     0         NO_ERROR 
  1802.     87        ERROR_INVALID_PARAMETER 
  1803.     123       ERROR_INVALID_NAME 
  1804.  
  1805.  Remarks 
  1806.  
  1807.  DosEditName is used to search for and edit names of files and subdirectories. 
  1808.  This call is typically used in conjunction with calls like DosMove and 
  1809.  DosCopy, which do not permit the use of global file name characters, to 
  1810.  perform repetitive operations on files. 
  1811.  
  1812.  As an example of an editing operation, a SourceString of "foo.bar" specified 
  1813.  with an EditString of "*.baz" results in "FOO.BAZ" being returned. In the 
  1814.  editing process, the string is changed to uppercase. 
  1815.  
  1816.  Global file name characters have two sets of semantics; one for searching and 
  1817.  one for editing. If they are specified in SourceString, they are interpreted 
  1818.  as search characters.  If they are specified in EditString, they are 
  1819.  interpreted as editing characters. 
  1820.  
  1821.  Use of the OS/2 COPY utility illustrates this difference in semantics. For 
  1822.  example, if a user enters: 
  1823.  
  1824.   copy *.old *.new
  1825.  In the source, the "*" acts as a search character and determines which files 
  1826.  to return to the user.  In the target, the "*" functions as an editing 
  1827.  character by constructing new names for the matched files. 
  1828.  
  1829.  When used as search characters in SourceString, global file name characters 
  1830.  simply match files and behave like any other search characters. They have the 
  1831.  following meanings: 
  1832.  
  1833.  .  The "." has no special meaning itself but "?" gives it one. 
  1834.  
  1835.  *  The "*" matches 0 or more characters, any character, including a blank. The 
  1836.     matching operation does not cross the null character or the backslash (\), 
  1837.     which means only the file name is matched, not an entire path. 
  1838.  
  1839.  ?  The "?" matches 1 character, unless what it would match is a "." or the 
  1840.     terminating null characters, in which case it matches 0 characters.  It 
  1841.     also doesn't cross "\". 
  1842.  Any character other than * and ? matches itself, including ".". 
  1843.  
  1844.  Searching is case-insensitive. 
  1845.  
  1846.  Any file name that does not have a period (.) in it gets an implicit one 
  1847.  automatically appended to the end during searching operations.  For example, 
  1848.  searching for "foo." would return "foo". 
  1849.  
  1850.  When used as editing characters in EditString, global file name characters 
  1851.  have the following meanings: 
  1852.  
  1853.  .  The "." has a special meaning for editing.  The "." in the target 
  1854.     synchronizes pointers.  It causes the source pointer to match a 
  1855.     corresponding pointer to the "." in the target.  Counting starts from the 
  1856.     left of the pointers. 
  1857.  
  1858.  ?  The "?" copies one character, unless what it would copy is a ".", in which 
  1859.     case it copies 0.  It also copies 0 characters when the end of the source 
  1860.     string is reached. 
  1861.  
  1862.  *  The "*" copies characters from the source to the target until it finds a 
  1863.     source character that matches the character following it in the target. 
  1864.  Editing is case-insensitive and case-preserving.  If conflicts arise between 
  1865.  the case of the source and editing string, the case of the editing string is 
  1866.  used. For example: 
  1867.  
  1868.   source string:      "file.txt"
  1869.   editing string:     "*E.TMP"
  1870.   destination string: "filE.TMP"
  1871.  
  1872.   copy file.txt  *E.tmp  ->  filE.tmp
  1873.  
  1874.  
  1875. ΓòÉΓòÉΓòÉ 1.29. DosEnterCritSec ΓòÉΓòÉΓòÉ
  1876.  
  1877.                                Bindings:  C, MASM
  1878.  
  1879. This call disables thread switching for the current process. 
  1880.  
  1881.  DosEnterCritSec    ( ) 
  1882.  
  1883.  rc (USHORT) - return 
  1884.     Return code descriptions are: 
  1885.  
  1886.     0         NO_ERROR 
  1887.     484       ERROR_CRITSEC_OVERFLOW 
  1888.  
  1889.  Remarks 
  1890.  
  1891.  DosEnterCritSec causes other threads in the process to block themselves and 
  1892.  give up their time slice. After a DosEnterCritSec request is made, no dynamic 
  1893.  link calls should be made until the corresponding DosExitCritSec call is 
  1894.  completed. 
  1895.  
  1896.  If a signal occurs, thread 1 begins execution to process the signal even 
  1897.  though another thread in the process has a DosEnterCritSec active.  (Thread 1 
  1898.  of a process is its initial thread of execution, not a thread created with the 
  1899.  DosCreateThread call.) Any processing done by thread 1 to satisfy the signal 
  1900.  must not include accessing the critical resource intended to be protected by 
  1901.  the DosEnterCritSec request. 
  1902.  
  1903.  A count is maintained of the number of times a DosEnterCritSec request is made 
  1904.  without a corresponding DosExitCritSec. The count is incremented by 
  1905.  DosEnterCritSec and decremented by  DosExitCritSec. Normal thread dispatching 
  1906.  is not restored until the count is 0. The outstanding DosEnterCritSec count is 
  1907.  maintained in a word. If overflow occurs, the count is set to the maximum 
  1908.  value, no operation is performed, and the request returns with an error. 
  1909.  
  1910.  A thread can also execute code without having to give up time slices to other 
  1911.  threads in its process if it requests a priority class that is higher than 
  1912.  those of the other threads. A thread's priority is examined and changed with 
  1913.  DosGetPrty and DosSetPrty. 
  1914.  
  1915.  
  1916. ΓòÉΓòÉΓòÉ 1.30. DosEnumAttribute ΓòÉΓòÉΓòÉ
  1917.  
  1918.                                Bindings:  C, MASM
  1919.  
  1920. This call identifies extended attributes for a specific file or subdirectory. 
  1921.  
  1922.  DosEnumAttribute     (RefType, FileRef, EntryNum, EnumBuf, EnumBufSize, 
  1923.                       EnumCnt, InfoLevel, Reserved) 
  1924.  
  1925.  RefType (USHORT) - input 
  1926.     A value that indicates the contents of FileRef. 
  1927.  
  1928.     Value     Definition 
  1929.     0         Handle of a file. 
  1930.     1         ASCIIZ name of a file or subdirectory. 
  1931.  
  1932.  FileRef (PVOID) - input 
  1933.     Address of the handle of a file returned by a DosOpen or  DosOpen2 request; 
  1934.     or the ASCIIZ name of a file or subdirectory. 
  1935.  
  1936.  EntryNum (ULONG) - input 
  1937.     Ordinal of an entry in the file object's EA list, which indicates where in 
  1938.     the list to begin the return of EA information. The value 0 is reserved.  A 
  1939.     value of 1 indicates the file object's first EA; a value of 2, the second; 
  1940.     and so on. 
  1941.  
  1942.  EnumBuf (PVOID) - output 
  1943.     Address of the buffer where EA information is returned. Level 1 information 
  1944.     is returned in the following format: 
  1945.  
  1946.     Reserved (UCHAR) 
  1947.        Zero. 
  1948.  
  1949.     cbName (UCHAR) 
  1950.        Length of name excluding NULL. 
  1951.  
  1952.     cbValue (USHORT) 
  1953.        Length of value. 
  1954.  
  1955.     szName (UCHAR) 
  1956.        Variable length asciiz name. 
  1957.  
  1958.  EnumBufSize (ULONG) - output 
  1959.     Size of EnumBuf. 
  1960.  
  1961.  EnumCnt (PULONG) - input/output 
  1962.     Address of, on input, the number of EAs for which information is requested. 
  1963.     A value of -1 requests information be returned for as many EAs whose 
  1964.     information fits in EnumBuf. 
  1965.  
  1966.     On output, the actual number of EAs for which information is returned. When 
  1967.     this value is greater than 1, enumerated information is returned in a 
  1968.     packed list.  That is, information for the next EA will be stored adjacent 
  1969.     to the previous one. 
  1970.  
  1971.  InfoLevel (ULONG) - input 
  1972.     Level of information required. Only the value 1 can be specified, 
  1973.     indicating return of level 1 information. 
  1974.  
  1975.  Reserved (ULONG) - input 
  1976.     Reserved and must be set to zero. 
  1977.  
  1978.  rc (USHORT) - return 
  1979.     Return code descriptions are: 
  1980.  
  1981.     0         NO_ERROR 
  1982.     3         ERROR_PATH_NOT_FOUND 
  1983.     5         ERROR_ACCESS_DENIED 
  1984.     6         ERROR_INVALID_HANDLE 
  1985.     8         ERROR_NOT_ENOUGH_MEMORY 
  1986.     87        ERROR_INVALID_PARAMETER 
  1987.     111       ERROR_BUFFER_OVERFLOW 
  1988.     124       ERROR_INVALID_LEVEL 
  1989.     206       ERROR_FILENAME_EXCED_RANGE 
  1990.  
  1991.  Remarks 
  1992.  
  1993.  The structure returned by DosEnumAttribute is used to calculate the size of 
  1994.  the buffer required to hold the full extended attribute (FEA) information for 
  1995.  a DosQPathInfo or DosQFileInfo call that actually gets the FEA. The size of 
  1996.  buffer required to hold the FEA information is calculated as follows: 
  1997.  
  1998.  One byte (for fea_Reserved) +
  1999.  One byte (for fea_cbName) +
  2000.  Two bytes (for fea_cbValue) +
  2001.  Value of cbName (for the name of the EA) +
  2002.  One byte (for terminating NULL in fea_cbName) +
  2003.  Value of cbValue (for the value of the EA) 
  2004.  
  2005.  A process can continue through a file's EA list by reissuing DosEnumAttribute 
  2006.  with EntryNum set to the value specified in the previous call plus the value 
  2007.  returned in EnumCnt. 
  2008.  
  2009.  DosEnumAttribute does not control the specific ordering of EAs; it merely 
  2010.  identifies them. Like the files they are associated with, extended attributes 
  2011.  can have multiple readers and writers. If a file is open in a sharing mode 
  2012.  that allows other processes to modify the file's EA list, calling 
  2013.  DosEnumAttribute repetitively to back up to an EA's position may return 
  2014.  inconsistent results. For example, it is possible for another process to edit 
  2015.  the EA list with DosSetFileInfo or DosSetPathInfo between calls by your 
  2016.  process to DosEnumAttribute. Thus, the EA returned when EntryNum is 11 for the 
  2017.  first call may not be the same EA returned when EntryNum is 11 for the next 
  2018.  call. 
  2019.  
  2020.  To prevent the modification of EAs between calls to DosEnumAttribute for a 
  2021.  specified file handle or file name, the caller must open the file in 
  2022.  deny-write sharing mode before it calls DosEnumAttribute. If a subdirectory 
  2023.  name is specified, modification by other processes is not a concern , because 
  2024.  no sharing is possible. 
  2025.  
  2026.  For RefType = 1, the EAs returned are current only when the call was made, and 
  2027.  they may have been changed by another thread or process in the meantime. 
  2028.  
  2029.  
  2030. ΓòÉΓòÉΓòÉ 1.31. DosErrClass ΓòÉΓòÉΓòÉ
  2031.  
  2032.                                Bindings:  C, MASM
  2033.  
  2034. This call helps OS/2 applications respond to error codes (return codes) 
  2035. received from OS/2. 
  2036.  
  2037.  DosErrClass     (Code, Class, Action, Locus) 
  2038.  
  2039.  Code (USHORT) - input 
  2040.     Error code returned by an OS/2 function. 
  2041.  
  2042.  Class (PUSHORT) - output 
  2043.     Address of the classification of an error. 
  2044.  
  2045.  Action (PUSHORT) - output 
  2046.     Address of the action for an error. 
  2047.  
  2048.  Locus (PUSHORT) - output 
  2049.     Address of the origin of an error. 
  2050.  
  2051.  rc (USHORT) - return 
  2052.     Return code descriptions are: 
  2053.  
  2054.     0         NO_ERROR 
  2055.  
  2056.  Remarks 
  2057.  
  2058.  The input is a return code returned from another function call, and the output 
  2059.  is a classification of the return and recommended action.  Depending on the 
  2060.  application, the recommended action could be followed, or a more specific 
  2061.  application recovery could be performed. 
  2062.  
  2063.  The following values are returned in Class, Action, and Locus: 
  2064.  
  2065.  Class Definitions 
  2066.  
  2067.      VALUE      MNEMONIC     DESCRIPTION
  2068.      ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2069.      1          OUTRES       Out of resources
  2070.      2          TEMPSIT      Temporary situation
  2071.      3          AUTH         Authorization failed
  2072.      4          INTRN        Internal error
  2073.      5          HRDFAIL      Device hardware failure
  2074.      6          SYSFAIL      System failure
  2075.      7          APPERR       Probable application error
  2076.      8          NOTFND       Item not located
  2077.      9          BADFMT       Bad format for call/data
  2078.      10         LOCKED       Resource/data locked
  2079.      11         MEDIA        Incorrect media, CRC error
  2080.      12         ALREADY      Resource/action already taken/done/exists
  2081.      13         UNK          Unclassified
  2082.      14         CANT         Can't perform requested action
  2083.      15         TIME         Timeout
  2084.  
  2085.  Action Definitions 
  2086.  
  2087.      VALUE      MNEMONIC     DESCRIPTION
  2088.      ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2089.      1          RETRY        Retry immediately
  2090.      2          DLYRET       Delay and retry
  2091.      3          USER         Bad user input - get new values
  2092.      4          ABORT        Terminate in an orderly manner
  2093.      5          PANIC        Terminate immediately
  2094.      6          IGNORE       Ignore error
  2095.      7          INTRET       Retry after user intervention
  2096.  
  2097.  Locus Definitions 
  2098.  
  2099.      VALUE      MNEMONIC     DESCRIPTION
  2100.      ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2101.      1          UNK          Unknown
  2102.      2          DISK         Random access device such as a disk
  2103.      3          NET          Network
  2104.      4          SERDEV       Serial device
  2105.      5          MEM          Memory
  2106.  
  2107.  
  2108.  Family API Considerations 
  2109.  
  2110.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  2111.  Therefore, the following considerations apply to DosErrClass when coding for 
  2112.  the DOS mode: 
  2113.  
  2114.  When DosErrClass is called by a family application, it returns a valid error 
  2115.  classification for returns that have occurred.  The classifications of a given 
  2116.  return code may not be the same for the Family API and the OS/2 mode 
  2117.  applications. 
  2118.  
  2119.  
  2120. ΓòÉΓòÉΓòÉ 1.32. DosError ΓòÉΓòÉΓòÉ
  2121.  
  2122.                                Bindings:  C, MASM
  2123.  
  2124. This call allows an OS/2 process to receive hard error notification without 
  2125. generating a hard error signal. 
  2126.  
  2127.  DosError  (Flag) 
  2128.  
  2129.  Flags (USHORT) - input 
  2130.     Bit field, defined in the following example (the unused high-order bits are 
  2131.     reserved and must be set to zero). 
  2132.  
  2133.     Bit       Description 
  2134.  
  2135.     15-2      Reserved, set to zero. 
  2136.  
  2137.     1         0 = Enable exception popups. 
  2138.  
  2139.               1 = Disable exception popups. 
  2140.  
  2141.     0         0 = Disable hard error popups (fail requests). 
  2142.  
  2143.               1 = Enable hard error popups. 
  2144.  
  2145.  rc (USHORT) - return 
  2146.     Return code descriptions are: 
  2147.  
  2148.     0         NO_ERROR 
  2149.     87        ERROR_INVALID_PARAMETER 
  2150.  
  2151.  Remarks 
  2152.  
  2153.  DosError allows an OS/2 process to disable user notification if a program (or 
  2154.  untrapped numeric processor) exception occurs. If end user notification is 
  2155.  disabled, and if one of these exceptions occurs, the process is terminated. 
  2156.  
  2157.  Hard errors generated under a process that has issued a DosError call are 
  2158.  failed, and the appropriate error code is returned.  The default situation is 
  2159.  both hard error pop-ups and exception pop-ups are enabled, if DosError is not 
  2160.  issued. 
  2161.  
  2162.  
  2163.  Family API Considerations 
  2164.  
  2165.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  2166.  Therefore, the following restriction applies to DosError when coding for the 
  2167.  DOS mode: 
  2168.  
  2169.  For Flag, a value of 0000 causes all subsequent INT 24s to be failed until a 
  2170.  subsequent call with a value of 1 is issued. 
  2171.  
  2172.  Note:  Since INT 24 is not issued in DOS mode, this call has no effect when 
  2173.         running in DOS mode. 
  2174.  
  2175.  
  2176. ΓòÉΓòÉΓòÉ 1.33. DosExecPgm ΓòÉΓòÉΓòÉ
  2177.  
  2178.                                Bindings:  C, MASM
  2179.  
  2180. This call allows a program to request that another program execute as a child 
  2181. process. 
  2182.  
  2183.  DosExecPgm     (ObjNameBuf, ObjNameBufL, ExecFlags, ArgPointer, EnvPointer, 
  2184.                 ReturnCodes, PgmPointer) 
  2185.  
  2186.  ObjNameBuf (PCHAR) - output 
  2187.     Address of the name of the object that contributed to the failure of 
  2188.     DosExecPgm is returned. 
  2189.  
  2190.  ObjNameBufL (SHORT) - input 
  2191.     Length, in bytes, of the buffer described by ObjNameBuf. 
  2192.  
  2193.  ExecFlags (USHORT) - input 
  2194.     Indicates how the program executes in relation to the requestor and whether 
  2195.     execution is under conditions for debugging. 
  2196.  
  2197.     Value     Definition 
  2198.  
  2199.     0         Execution is synchronous to the parent process.  The termination 
  2200.               code and result code are stored in the two-word structure. 
  2201.  
  2202.     1         Execution is asynchronous to the parent process. When the child 
  2203.               process terminates, its result code is discarded. The process ID 
  2204.               is stored in the first word of the two-word structure 
  2205.               ReturnCodes. 
  2206.  
  2207.     2         Execution is asynchronous to the parent process. When the child 
  2208.               process terminates, its result code is saved for examination by a 
  2209.               DosCwait request. The process ID is stored in the first word of 
  2210.               the two-word structure ReturnCodes. 
  2211.  
  2212.     3         Execution is the same as if ExecFlags=2 is specified, plus 
  2213.               debugging conditions are present for the child process. 
  2214.  
  2215.     4         Execution is asynchronous to and detached from the parent process 
  2216.               session.  When the detached process is started, it is not 
  2217.               affected by the ending of the parent process. 
  2218.  
  2219.     5         The program is loaded into storage and made ready to execute, but 
  2220.               is not placed into execution until the session manager dispatches 
  2221.               the threads belonging to the process. 
  2222.  
  2223.     6         Execution is the same as if ExecFlag=2 is specified, with the 
  2224.               addition of debugging conditions being present for the child 
  2225.               process and any of its descendants. 
  2226.  
  2227.               Some memory is consumed for uncollected result codes. Issue 
  2228.               DosCwait to release this memory. If result codes are not 
  2229.               collected, then ExecFlags=0 or 1 should be used. 
  2230.  
  2231.  ArgPointer (PSZ) - input 
  2232.     Address of the ASCIIZ Argument strings passed to the program. These strings 
  2233.     represent command parameters, which are copied to the environment segment 
  2234.     of the new process. The convention used by CMD.EXE is that the first of 
  2235.     these strings is the program name (as entered from the command prompt or 
  2236.     found in a batch file), and the second string consists of parameters to the 
  2237.     program name. The second ASCIIZ string is followed by an additional byte of 
  2238.     zeros. A value of 0 for the address of ArgPointer means that no arguments 
  2239.     are to be passed. 
  2240.  
  2241.  EnvPointer(PSZ) - input 
  2242.     Address of the ASCIIZ environment strings passed to the program. These 
  2243.     strings represent environment variables and their current values. An 
  2244.     environment string has the following form: 
  2245.  
  2246.         variable=value
  2247.  
  2248.     The last ASCIIZ environment string must be followed by an additional byte 
  2249.     of zeros. 
  2250.  
  2251.     A value of 0 for the address of EnvPointer results in the new process 
  2252.     inheriting the environment of its parent process. 
  2253.  
  2254.     When the new process is given control, it receives: 
  2255.  
  2256.     o A pointer to its environment segment 
  2257.     o The fully qualified path name of the executable file 
  2258.     o A copy of the argument strings. 
  2259.  
  2260.       A coded example of this follows: 
  2261.  
  2262.             eo:   ASCIIZ string 1  ; environment string 1
  2263.                   ASCIIZ string 2  ; environment string 2
  2264.             .
  2265.             .
  2266.             .
  2267.                   ASCIIZ string n  ; environment string n
  2268.                   Byte of 0
  2269.             .
  2270.             .
  2271.             .
  2272.             po:   ASCIIZ           ; string of filename
  2273.                                    ; of program to run.
  2274.             .
  2275.             .
  2276.             .
  2277.             ao:   ASCIIZ           ; argument string 1
  2278.                   ASCIIZ           ; argument string 2
  2279.                   Byte of 0
  2280.  
  2281.       The beginning of the environment segment is "eo" and "ao" is the offset 
  2282.       of the first argument string in that segment. Register BX contains "ao" 
  2283.       on entry to the target program. The address to the environment segment 
  2284.       can also be obtained by issuing DosGetInfoSeg. 
  2285.  
  2286.  ReturnCodes (PRESULTCODES) - output 
  2287.     Address of the structure containing the process ID or termination code and 
  2288.     the result code indicating the reason for the child's termination. This 
  2289.     structure is also used by a DosCwait request, which waits for an 
  2290.     asynchronous child process to end. 
  2291.  
  2292.     termcodepid (USHORT) 
  2293.        For an asynchronous request, the process identifier of the child 
  2294.        process. For a synchronous request, the termination code furnished by 
  2295.        the system describes  why the child terminated. 
  2296.  
  2297.        Value     Definition 
  2298.        0         EXIT (normal) 
  2299.        1         Hard error abort 
  2300.        2         Trap operation 
  2301.        3         Unintercepted DosKillProcess 
  2302.  
  2303.     resultcode (USHORT) 
  2304.        Result code specified by the terminating synchronous process on its last 
  2305.        DosExit call. 
  2306.  
  2307.  PgmPointer (PSZ) - input 
  2308.     Address of the name of the file that contains the program to be executed. 
  2309.     When the environment is passed to the target program, this name is copied 
  2310.     into "po" in the environment description shown above. 
  2311.  
  2312.     If the string appears to be a fully qualified path (it contains a ":" in 
  2313.     the second position - or it contains a "\" - or both), then the file name 
  2314.     must include the extension .COM or .EXE, and the program is loaded from the 
  2315.     indicated drive:directory. If the string is not a fully qualified path, the 
  2316.     current directory is searched.  If the file name is not found in the 
  2317.     current directory, each drive:directory specification in the PATH defined 
  2318.     in the current process' environment is searched for this file. 
  2319.  
  2320.  rc (USHORT) - return 
  2321.     Return code descriptions are: 
  2322.  
  2323.     0         NO_ERROR 
  2324.     1         ERROR_INVALID_FUNCTION 
  2325.     2         ERROR_FILE_NOT_FOUND 
  2326.     3         ERROR_PATH_NOT_FOUND 
  2327.     4         ERROR_TOO_MANY_OPEN_FILES 
  2328.     5         ERROR_ACCESS_DENIED 
  2329.     8         ERROR_NOT_ENOUGH_MEMORY 
  2330.     10        ERROR_BAD_ENVIRONMENT 
  2331.     11        ERROR_BAD_FORMAT 
  2332.     13        ERROR_INVALID_DATA 
  2333.     26        ERROR_NOT_DOS_DISK 
  2334.     32        ERROR_SHARING_VIOLATION 
  2335.     33        ERROR_LOCK_VIOLATION 
  2336.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  2337.     89        ERROR_NO_PROC_SLOTS 
  2338.     95        ERROR_INTERRUPT 
  2339.     108       ERROR_DRIVE_LOCKED 
  2340.     127       ERROR_PROC_NOT_FOUND 
  2341.     180       ERROR_INVALID_SEGMENT_NUMBER 
  2342.     182       ERROR_INVALID_ORDINAL 
  2343.     188       ERROR_INVALID_STARTING_CODESEG 
  2344.     189       ERROR_INVALID_STACKSEG 
  2345.     190       ERROR_INVALID_MODULETYPE 
  2346.     191       ERROR_INVALID_EXE_SIGNATURE 
  2347.     192       ERROR_EXE_MARKED_INVALID 
  2348.     194       ERROR_ITERATED_DATA_EXCEEDS_64k 
  2349.     195       ERROR_INVALID_MINALLOCSIZE 
  2350.     196       ERROR_DYNLINK_FROM_INVALID_RING 
  2351.     198       ERROR_INVALID_SEGDPL 
  2352.     199       ERROR_AUTODATASEG_EXCEEDS_64k 
  2353.     201       ERROR_RELOC_CHAIN_XEEDS_SEGLIM 
  2354.  
  2355.  Remarks 
  2356.  
  2357.  The target program is located and loaded into storage if necessary.  A process 
  2358.  is created and executed for the target program.  The new process is created 
  2359.  with an address space separate from its parent; that is, a new Local 
  2360.  Descriptor Table (LDT) is built for the process. 
  2361.  
  2362.  The execution of a child process can be synchronous or asynchronous to the 
  2363.  execution of its parent process. If synchronous execution is indicated, the 
  2364.  requesting thread waits pending completion of the child process.  Other 
  2365.  threads in the requesting process may continue to run. 
  2366.  
  2367.  If asynchronous execution is indicated, DosExecPgm returns with the process ID 
  2368.  of the started child process. Specifying ExecFlags=2 allows the parent process 
  2369.  to issue a DosCwait request after the DosExecPgm request, so it can examine 
  2370.  the result code returned when the child process terminates. If ExecFlags=1 is 
  2371.  specified, the result code of the asynchronous child process is not returned 
  2372.  to the parent process. 
  2373.  
  2374.  A child process inherits file handles obtained by its parent with DosOpen 
  2375.  calls that indicated inheritance .  The child process also inherits handles to 
  2376.  pipes created by the parent process with DosMakePipe. 
  2377.  
  2378.  Because a child process has the ability to inherit handles and a parent 
  2379.  process controls the meanings of handles for standard I/O, the parent can 
  2380.  duplicate inherited handles as handles for standard I/O. This permits the 
  2381.  parent process and the child process to coordinate I/O to a pipe or a file. 
  2382.  
  2383.  For example, a parent process can create two pipes with DosMakePipe requests. 
  2384.  It can issue DosDupHandle to redefine the read handle of one pipe as standard 
  2385.  input (0000H), and the write handle of the other pipe as standard output 
  2386.  (0001H).  The child process uses the standard I/O handles, and the parent 
  2387.  process uses the remaining read and write pipe handles.  Thus, the child 
  2388.  process reads what the parent writes to one pipe, and the parent process reads 
  2389.  what the child writes to the other pipe. 
  2390.  
  2391.  When an inherited file handle is duplicated, the position of the file pointer 
  2392.  is always the same for both handles, regardless of which handle repositions 
  2393.  the file pointer. 
  2394.  
  2395.  An asynchronous process started with ExecFlags=3 or ExecFlags=6 is provided a 
  2396.  trace flag facility.  This facility and the Ptrace buffer provided by 
  2397.  DosPtrace enable a debugger to perform breakpoint debugging.  DosStartSession 
  2398.  provides additional debugging capabilities that allow a debugger to trace all 
  2399.  processes associated with an application running in a child session, 
  2400.  regardless of whether the process is started with a DosExecPgm or a 
  2401.  DosStartSession request. 
  2402.  
  2403.  A detached process is treated as an orphan of the parent process and executes 
  2404.  in the background.  Thus, it cannot make any VIO, KBD, or MOU calls, except 
  2405.  within a video pop-up requested by VioPopUp. To test whether a program is 
  2406.  running detached, use the following method.  Issue a video call, (for example, 
  2407.  VioGetAnsi).  If the call is not issued within a video pop-up and the process 
  2408.  is detached, the video call returns error code ERROR_VIO_DETACHED. 
  2409.  
  2410.  Note:  If the target program's entry point is in a segment that has IOPL 
  2411.         indicated, this causes a general protection fault and the process is 
  2412.         terminated. If any dynamic link module being used by the new process 
  2413.         has an initialization routine specified in a segment that has IOPL 
  2414.         indicated, general protection fault occurs and the process is 
  2415.         terminated. 
  2416.  
  2417.  
  2418.  Family API Considerations 
  2419.  
  2420.  Some options operate differently in DOS mode than in OS/2 mode.  Therefore, 
  2421.  the following restrictions apply to DosExecPgm when coding in DOS mode: 
  2422.  
  2423.  o ExecFlags must be set to zero.  This value is not related to the PID of the 
  2424.    program being executed. If ExecFlags <> 0, DosExecPgm returns the error code 
  2425.    ERROR_INVALID_DATA. 
  2426.  
  2427.  o The ObjNameBuf field is used to provide additional information in the OS/2 
  2428.    mode environment as to why the DosExecPgm failed.  The information is not 
  2429.    relevant or available in DOS 2.X or DOS 3.X. Therefore, the buffer is filled 
  2430.    in with blanks. 
  2431.  
  2432.  o The ReturnCodes two-word structure is very similar to the OS/2 mode 
  2433.    environment. The first word is a termination code with the following 
  2434.    meanings: 
  2435.  
  2436.     Value     Definition 
  2437.     0         Exit (normal exit and termination by call INT 21H AH=31H) 
  2438.     1         Hard error abort 
  2439.     2         Not returned 
  2440.     3         Termination by Ctrl -Break. 
  2441.  
  2442.               The second word contains the ResultCode specified by the 
  2443.               terminating process on its DosExit call (or INT 21H AH=4CH call). 
  2444.  
  2445.  Application Type Considerations 
  2446.  
  2447.  You may use DosExecPgm to start a process that is of the same type as the 
  2448.  starting process. Process types include Presentation Manager, text-windowed, 
  2449.  and full-screen. You may not use DosExecPgm to start a process that is of a 
  2450.  different type than the starting process. 
  2451.  
  2452.  You must use DosStartSession to start a new process from a process that is of 
  2453.  a different type. For example, use DosStartSession to start a Presentation 
  2454.  Manager process from a non-Presentation Manager process. 
  2455.  
  2456.  
  2457. ΓòÉΓòÉΓòÉ 1.34. DosExit ΓòÉΓòÉΓòÉ
  2458.  
  2459.                                Bindings:  C, MASM
  2460.  
  2461. This call is issued when a thread completes executing. The current thread or 
  2462. process ends. 
  2463.  
  2464.  DosExit    (ActionCode, ResultCode) 
  2465.  
  2466.  ActionCode (USHORT) - input 
  2467.     Terminates the process and all its threads. 
  2468.  
  2469.     Value     Definition 
  2470.     0         The current thread ends. 
  2471.     1         All threads in the process end. 
  2472.  
  2473.  ResultCode (USHORT) - input 
  2474.     Program's completion code.  It is passed to any thread that issues DosCwait 
  2475.     for this process. 
  2476.  
  2477.  Remarks 
  2478.  
  2479.  DosExit allows a thread to terminate itself or be terminated by another thread 
  2480.  in its process. If ActionCode=0 and the specified thread is the last thread 
  2481.  executing in the process, or if ActionCode=1, the process terminates. 
  2482.  
  2483.  The system can start threads on behalf of an application. Thus, if the intent 
  2484.  of a DosExit call is to terminate the process, ActionCode=1 should be 
  2485.  specified to terminate all the threads belonging to the process. 
  2486.  
  2487.  Do not terminate thread 1 without terminating the process. Thread 1 is the 
  2488.  initial thread of execution, not a thread started by a DosCreateThread 
  2489.  request.  When thread 1 ends, any monitors or signal processing routines set 
  2490.  for this process also end. To avoid unpredictable results, DosExit should be 
  2491.  specified with ActionCode=1 to ensure the process ends. 
  2492.  
  2493.  When a process is terminating, all but one thread is terminated and that 
  2494.  thread executes routines whose addresses have been specified with DosExitList. 
  2495.  After resources have been cleaned up by the exit list routines, this thread 
  2496.  and all other resources owned by the process are released. 
  2497.  
  2498.  
  2499.  Family API Considerations 
  2500.  
  2501.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  2502.  Therefore, the following restrictions apply to DosExit when coding for the DOS 
  2503.  mode: 
  2504.  
  2505.  There is no thread support in DOS 3.3; therefore DosExit exits the currently 
  2506.  executing program. 
  2507.  
  2508.  If ActionCode = 0 this option is ignored.  It is equivalent to an ActionCode = 
  2509.  1. 
  2510.  
  2511.  
  2512. ΓòÉΓòÉΓòÉ 1.35. DosExitCritSec ΓòÉΓòÉΓòÉ
  2513.  
  2514.                                Bindings:  C, MASM
  2515.  
  2516. This call restores normal thread dispatching for the current process. 
  2517.  
  2518.  DosExitCritSec   ( ) 
  2519.  
  2520.  rc (USHORT) - return 
  2521.     Return code descriptions are: 
  2522.  
  2523.     0         NO_ERROR 
  2524.     485       ERROR_CRITSEC_UNDERFLOW 
  2525.  
  2526.  Remarks 
  2527.  
  2528.  A count is maintained of the number of times a DosEnterCritSec request is made 
  2529.  without a corresponding DosExitCritSec. The count is incremented by 
  2530.  DosEnterCritSec and decremented by  DosExitCritSec. Normal thread dispatching 
  2531.  is not restored until the count is 0. 
  2532.  
  2533.  The outstanding DosEnterCritSec count is maintained in a word. If overflow 
  2534.  occurs, the count is set to the maximum value, no operation is performed, and 
  2535.  the request returns with an error. 
  2536.  
  2537.  
  2538. ΓòÉΓòÉΓòÉ 1.36. DosExitList ΓòÉΓòÉΓòÉ
  2539.  
  2540.                                Bindings:  C, MASM
  2541.  
  2542. This call maintains a list of routines that execute when the current process 
  2543. ends. 
  2544.  
  2545.  DosExitList   (FcnCode_Order, RtnAddress) 
  2546.  
  2547.  FcnCode_Order (USHORT) - input 
  2548.     Two-byte fields. The low-order byte indicates the operation being performed 
  2549.     by DosExitList, which can be used to update the list of routines, or to 
  2550.     transfer to the next address on the termination list at the completion of a 
  2551.     routine. The values of the byte and their meanings are: 
  2552.  
  2553.     Value     Definition 
  2554.     1         Add address to termination list. 
  2555.     2         Remove address from termination list. 
  2556.     3         Transfer to next address on termination list. 
  2557.  
  2558.     The high-order byte indicates the invocation order. This value is valid 
  2559.     only when the low-order byte is 1 (add an address).  For the other 
  2560.     low-order byte values, the high-order byte must be set to zero. 
  2561.  
  2562.     The invocation order determines the order in which routines are invoked. 
  2563.     Routines given a value of 0 are invoked first and routines with a value of 
  2564.     255 are invoked last. If more than one routine is added with the same 
  2565.     invocation order value, the last routine to be added is invoked first. The 
  2566.     following values are used by OS/2 components: 
  2567.  
  2568.     Value       Definition 
  2569.     80H-88H     OS/2 Extended Edition Database Manager 
  2570.     90H-98H     OS/2 Extended Edition Communications Manager 
  2571.     A0H-A8H     OS/2 Presentation Manager 
  2572.     B0H         OS/2 KBD component 
  2573.     C0H         OS/2 VIO component 
  2574.     D0H         OS/2 IPC Queues component 
  2575.  
  2576.  RtnAddress (PFNEXITLIST) - input 
  2577.     The address of a routine to be executed. This address cannot be in an IOPL 
  2578.     segment. 
  2579.  
  2580.  rc (USHORT) - return 
  2581.     Return code descriptions are: 
  2582.  
  2583.     0         NO_ERROR 
  2584.     8         ERROR_NOT_ENOUGH_MEMORY 
  2585.     13        ERROR_INVALID_DATA 
  2586.  
  2587.  Remarks 
  2588.  
  2589.  DosExitList maintains a list of addresses to routines that receive control 
  2590.  when a process is terminated.  These addresses must be in the address space of 
  2591.  the terminating process. DosExitList routines perform clean-up operations on 
  2592.  resources. For example, DosExitList can be used in a dynamic link library 
  2593.  module to free resources and semaphores after a client program has ended. 
  2594.  
  2595.  During DosExitList processing, the process is in a state of partial 
  2596.  termination.  All threads of the process are terminated, except for the one 
  2597.  executing the routines.  Ownership of any exclusive semaphores created by the 
  2598.  process with DosCreateSem was transferred to the DosExitList thread, so the 
  2599.  thread can access protected resources. Termination routines should be short 
  2600.  and fail-safe, so there is minimum delay in completing process termination. 
  2601.  
  2602.  Before transferring control to the termination routines, OS/2 resets the stack 
  2603.  to its initial value. Transfer is by way of a JMP instruction. The first 
  2604.  parameter on the stack (located at SS:SP+4) contains an indicator of why the 
  2605.  process ended. The meanings of values returned are the same as those for 
  2606.  termination codes returned by DosCwait or  DosExecPgm requests. These values 
  2607.  are: 
  2608.  
  2609.  0         EXIT (normal exit) 
  2610.  1         Hard error abort 
  2611.  2         Trap operation 
  2612.  3         Unintercepted DosKillProcess. 
  2613.  
  2614.  Each routine on the list receives control in numeric order by function 
  2615.  high-order byte. For example, low (0) is first with high (0FFH) being last. 
  2616.  In case of duplicate entries for the same value, the routines are executed in 
  2617.  LIFO order. 
  2618.  
  2619.  When a routine has completed its processing, it issues  DosExitList with 
  2620.  function = 3. Control is then transferred to the next address in the 
  2621.  invocation order. If a routine on the list does not issue DosExitList at the 
  2622.  completion of its processing, the process hangs, and OS/2 prevents 
  2623.  termination. When all addresses are serviced, the process completes exiting. 
  2624.  
  2625.  Most OS/2 system calls are valid in a DosExitList routine; however, certain 
  2626.  functions such as DosCreateThread and DosExecPgm are not. Functions requested 
  2627.  in a routine must not be higher in the function code order hierarchy than the 
  2628.  invocation order specified for the routine. 
  2629.  
  2630.  
  2631. ΓòÉΓòÉΓòÉ 1.37. DosFileIO ΓòÉΓòÉΓòÉ
  2632.  
  2633.                                Bindings:  C, MASM
  2634.  
  2635. This call performs multiple locking, unlocking, seeking, and I/O operations on 
  2636. an 
  2637. opened file. 
  2638.  
  2639.  DosFileIO     (FileHandle, CommandList, CommandListLen, ErrorOffset) 
  2640.  
  2641.  FileHandle (HFILE) - input 
  2642.     The handle of the file. 
  2643.  
  2644.  CommandList (PBYTE) - input 
  2645.     Address of the list of entries, indicating the operations to be performed. 
  2646.     CmdLock, CmdUnlock, CmdSeek, and CmdIO operations are atomic. Thus, the 
  2647.     completion of one operation is not dependent upon the completion of another 
  2648.     operation following it in the list. Operations are performed until all are 
  2649.     complete or until one fails. 
  2650.  
  2651.     CmdLock 
  2652.        Lock command structure. To perform lock operations on one or more 
  2653.        regions in a file, a structure is created that has the following format: 
  2654.  
  2655.        Cmd (USHORT) - input 
  2656.           A value of 0 is required for a lock operation. 
  2657.  
  2658.        LockCnt (USHORT) - input 
  2659.           Number of regions in the file that are to be locked. 
  2660.  
  2661.        TimeOut (LONG) - input 
  2662.           The count in milliseconds until the requesting process is to resume 
  2663.           execution if the requested locks are not available. In addition to 
  2664.           specifying a milliseconds value, the following values and their 
  2665.           meanings may also be specified: 
  2666.  
  2667.           Value       Definition 
  2668.           FFFFFFFFH   Wait indefinitely until the requested locks become 
  2669.                       available. 
  2670.           00000000H   Return immediately to the requesting process. 
  2671.  
  2672.                       Because the lock operation is atomic, if a lock within a 
  2673.                       CmdLock causes a time out, none of the other locks within 
  2674.                       the scope of CmdLock are in force. 
  2675.  
  2676.     Lock 
  2677.        Lock record structure. The CmdLock structure is followed by a series of 
  2678.        records in the following format: 
  2679.  
  2680.        Share (USHORT) - input 
  2681.           Defines the type of access other processes may have to the file range 
  2682.           being locked. Values and their meanings are: 
  2683.  
  2684.           Value     Definition 
  2685.  
  2686.           0         Other processes have "No-Access" to the locked range.  The 
  2687.                     current process has both read and write access to the 
  2688.                     locked range.  A region with Share = 0 must not overlap any 
  2689.                     other locked region. 
  2690.  
  2691.           1         Other processes and the current process have "Read-Only" 
  2692.                     access to the locked range. A range locked with Share = 1 
  2693.                     may overlap other ranges locked with Share = 1, but must 
  2694.                     not overlap other ranges locked with Share = 0. 
  2695.  
  2696.        Start (ULONG) - input 
  2697.           Offset into file where region to be locked starts. 
  2698.  
  2699.        Length (ULONG) - input 
  2700.           Length of region to be locked. 
  2701.  
  2702.     CmdUnlock 
  2703.        Unlock command structure. To perform unlock operations on one or more 
  2704.        regions in a file, a structure is created that has the following format: 
  2705.  
  2706.        Cmd (USHORT) - input 
  2707.           A value of 1 is required for an unlock operation. 
  2708.  
  2709.        UnlockCnt (USHORT) - input 
  2710.           Number of regions in the file that are to be unlocked. 
  2711.  
  2712.     UnLock 
  2713.        Unlock record structure. The CmdUnlock structure is followed by a series 
  2714.        of records in the following format: 
  2715.  
  2716.        Start (ULONG) - input 
  2717.           Offset into file where region to be unlocked starts. 
  2718.  
  2719.        Length (ULONG) - input 
  2720.           Length of region to be unlocked. 
  2721.  
  2722.     CmdSeek 
  2723.        Seek command structure. To perform seek operations on one or more locked 
  2724.        regions in a file, a structure is created that has the following format: 
  2725.  
  2726.        Cmd (USHORT) - input 
  2727.           A value of 2 is required for a seek operation. 
  2728.  
  2729.        Method (USHORT) - input 
  2730.           Location in file whose offset is used to calculate the new position 
  2731.           of the file pointer by adding to it the offset specified by Position. 
  2732.  
  2733.           Value     Definition 
  2734.           0         Beginning of the file 
  2735.           1         Current location of the file pointer 
  2736.           2         End of the file. 
  2737.  
  2738.        Position (LONG) - input 
  2739.           The distance to move, in bytes. 
  2740.  
  2741.        Actual ULONG - output 
  2742.           New position of the file pointer. 
  2743.  
  2744.     CmdIO 
  2745.        I/O command structure. To perform I/O operations on one or more locked 
  2746.        regions in a file, a structure is created that has the following format: 
  2747.  
  2748.        Cmd (USHORT) - input 
  2749.           Either of the following values are specified: 
  2750.  
  2751.           Value     Definition 
  2752.           3         Read operation 
  2753.           4         Write operation. 
  2754.  
  2755.        Buffer (PBYTE) - input/output 
  2756.           Address of the input or output buffer. 
  2757.  
  2758.        BufferLen (USHORT) - input 
  2759.           Number of bytes requested to be read or written. 
  2760.  
  2761.        Actual (USHORT) - output 
  2762.           Number of bytes actually transferred. 
  2763.  
  2764.  CommandListLen (USHORT) - input 
  2765.     The length in bytes of CommandList. 
  2766.  
  2767.  ErrorOffset (PLONG) - output 
  2768.     Address of the byte offset of the record in which the error occurred. 
  2769.  
  2770.  rc (USHORT) - return 
  2771.     Return code descriptions are: 
  2772.  
  2773.     0         NO_ERROR 
  2774.     5         ERROR_ACCESS_DENIED 
  2775.     6         ERROR_INVALID_HANDLE 
  2776.     33        ERROR_LOCK_VIOLATION 
  2777.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  2778.     87        ERROR_INVALID_PARAMETER 
  2779.     95        ERROR_INTERRUPT 
  2780.     130       ERROR_DIRECT_ACCESS_HANDLE 
  2781.     131       ERROR_NEGATIVE_SEEK 
  2782.     132       ERROR_SEEK_ON_DEVICE 
  2783.  
  2784.  Remarks 
  2785.  
  2786.  DosFileIO combines the following operations into a single request: 
  2787.  
  2788.  o Unlocking and locking multiple file ranges 
  2789.  o Changing the file position pointer 
  2790.  o Performing file I/O. 
  2791.  
  2792.  The ability to combine operations on files provides improved performance and 
  2793.  makes DosFileIO particularly suited to a networking environment. 
  2794.  
  2795.  Unlike DosFileLocks, which unconditionally prevents access to only one range 
  2796.  in a file at a time, DosFileIO permits multiple regions to be locked. 
  2797.  DosFileIO also offers the option of read-only access to locked regions by the 
  2798.  current process and any sharing processes. 
  2799.  
  2800.  If another process attempts to read or write in a "No-access" region, or if 
  2801.  any process attempts to write in a "Read-only" region, ERROR_ACCESS_DENIED is 
  2802.  returned. 
  2803.  
  2804.  A range to be locked must first be cleared of any locked subranges or 
  2805.  overlapping ranges. If a time out occurs before locking can be completed, 
  2806.  DosFileIO returns with an unsuccessful return code. The caller may return 
  2807.  after the time-out period has expired without receiving an ERROR_SEM_TIMEOUT. 
  2808.  Therefore, semaphore time-out values should not be used for exact timing and 
  2809.  sequencing. 
  2810.  
  2811.  
  2812. ΓòÉΓòÉΓòÉ 1.38. DosFileLocks ΓòÉΓòÉΓòÉ
  2813.  
  2814.                                Bindings:  C, MASM
  2815.  
  2816. This call locks and unlocks a range in an opened file. 
  2817.  
  2818.  DosFileLocks    (FileHandle, UnLockRange, LockRange) 
  2819.  
  2820.  FileHandle (HFILE) - input 
  2821.     File handle. 
  2822.  
  2823.  UnLockRange (PLONG) - input 
  2824.     Address of the structure containing the offset and length of a range to be 
  2825.     unlocked. A doubleword of zero indicates that unlocking is not required. 
  2826.  
  2827.     FileOffset (ULONG) 
  2828.        The offset to the beginning of the range to be unlocked. 
  2829.  
  2830.     RangeLength (ULONG) 
  2831.        The length of the range to be unlocked. 
  2832.  
  2833.  LockRange (PLONG) - input 
  2834.     Address of the structure containing the offset and length of a range to be 
  2835.     locked. A doubleword of zero indicates that locking is not required. 
  2836.  
  2837.     FileOffset (ULONG) 
  2838.        The offset to the beginning of the range to be locked. 
  2839.  
  2840.     RangeLength (ULONG) 
  2841.        The length of the range to be locked. 
  2842.  
  2843.  rc (USHORT) - return 
  2844.     Return code descriptions are: 
  2845.  
  2846.     0         NO_ERROR 
  2847.     6         ERROR_INVALID_HANDLE 
  2848.     33        ERROR_LOCK_VIOLATION 
  2849.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  2850.  
  2851.  Remarks 
  2852.  
  2853.  DosFileLocks provides a mechanism that allows a process to lock a region in a 
  2854.  file for read/write access. The time a region is locked should be short. 
  2855.  
  2856.  Instead of denying another process read/write access to the entire file by 
  2857.  means of access and sharing modes specified with DosOpen or DosOpen2 requests, 
  2858.  a process attempts to lock only the the range needed for read/write access and 
  2859.  examines the error code returned. 
  2860.  
  2861.  A range to be locked must first be cleared of any locked subranges or 
  2862.  overlapping ranges. The locked region can be located anywhere in the file, and 
  2863.  locking beyond end-of-file is not considered an error. 
  2864.  
  2865.  Once a lock is successful, read/write access by another process to the 
  2866.  specified range is denied until the range is unlocked. If both unlocking and 
  2867.  locking are specified by a DosFileLocks request, the unlocking operation is 
  2868.  performed first. After unlocking is completed, locking is done. 
  2869.  
  2870.  Duplicating the handle duplicates access to any locked regions; however, 
  2871.  access to locked regions is not duplicated across the DosExecPgm call. 
  2872.  
  2873.  If a file is closed (either by a DosClose request or by a process terminating) 
  2874.  and locks are still in effect, the locks are released in no defined order. 
  2875.  
  2876.  
  2877.  Family API Considerations 
  2878.  
  2879.  Some options operate differently in the DOS mode than in OS/2 mode. 
  2880.  Therefore, the following restrictions apply to DosFileLocks when coding for 
  2881.  the DOS mode: 
  2882.  
  2883.  o If Block = 1 is specified, an "invalid range lock list" or "invalid unlock 
  2884.    list" error is returned. 
  2885.  o NewLockIDList is not supported. 
  2886.  
  2887.  
  2888. ΓòÉΓòÉΓòÉ 1.39. DosFindClose ΓòÉΓòÉΓòÉ
  2889.  
  2890.                                Bindings:  C, MASM
  2891.  
  2892. This call closes the association between a directory handle and a DosFindFirst 
  2893. or DosFindNext directory search function. 
  2894.  
  2895.  DosFindClose     (DirHandle) 
  2896.  
  2897.  DirHandle (HDIR) - input 
  2898.     Handle previously associated with a DosFindFirst by the system, or used 
  2899.     with a DosFindNext directory search function. 
  2900.  
  2901.  rc (USHORT) - return 
  2902.     Return code descriptions are: 
  2903.  
  2904.     0         NO_ERROR 
  2905.     6         ERROR_INVALID_HANDLE 
  2906.  
  2907.  Remarks 
  2908.  
  2909.  When DosFindClose is issued, a subsequent DosFindNext for the closed DirHandle 
  2910.  fails unless an intervening DosFindFirst has been issued specifying DirHandle. 
  2911.  
  2912.  
  2913. ΓòÉΓòÉΓòÉ 1.40. DosFindFirst ΓòÉΓòÉΓòÉ
  2914.  
  2915.                                Bindings:  C, MASM
  2916.  
  2917. This call finds the first file object or group of file objects whose name(s) 
  2918. match the specification. 
  2919.  
  2920.  DosFindFirst     (FileName, DirHandle, Attribute, ResultBuf, ResultBufLen, 
  2921.                   SearchCount, Reserved) 
  2922.  
  2923.  FileName (PSZ) - input 
  2924.     Address of the ASCIIZ path name of the file or subdirectory to be found. 
  2925.     The name component may contain global file name characters. 
  2926.  
  2927.  DirHandle (PHDIR) - input/output 
  2928.     Address of the handle associated with a specific DosFindFirst request. The 
  2929.     values that can be specified are: 
  2930.  
  2931.     Value     Definition 
  2932.     0001H     Assign handle 1, which is always available to a process. 
  2933.     FFFFH     The system allocates and returns a handle. If on input FFFFH is 
  2934.               specified, on output DirHandle contains the handle allocated by 
  2935.               the system. 
  2936.  
  2937.               The DosFindFirst handle is used with subsequent DosFindNext 
  2938.               requests. Reuse of this handle in another DosFindFirst closes the 
  2939.               association with the previous DosFindFirst and opens a new 
  2940.               association. 
  2941.  
  2942.  Attribute (USHORT) - input 
  2943.     Attribute value that determines the file objects to be searched for. 
  2944.  
  2945.     Bit       Description 
  2946.     15-6      Reserved and must be zero. 
  2947.     5         File archive 
  2948.     4         Subdirectory 
  2949.     3         Reserved and must be zero. 
  2950.     2         System file 
  2951.     1         Hidden file 
  2952.     0         Read only file 
  2953.  
  2954.     These bits may be set individually or in combination.  For example, an 
  2955.     attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file 
  2956.     that should be archived. 
  2957.  
  2958.     If Attribute is 0, normal file entries are found.  Entries for 
  2959.     subdirectories, hidden, and system files, are not returned.  If Attribute 
  2960.     is set for hidden or system files, or directory entries, it is considered 
  2961.     an inclusive search.  All normal file entries plus all entries matching the 
  2962.     specific attributes are returned.  Set Attribute to hidden+system+directory 
  2963.     (all three bits on) to look at all directory entries except the volume 
  2964.     label. 
  2965.  
  2966.     Attribute cannot specify the volume label.  Volume labels are queried using 
  2967.     DosQFSInfo. Attributes of a file are queried and set with DosQFileMode and 
  2968.     DosSetFileMode. 
  2969.  
  2970.  ResultBuf (PFILEFINDBUF) - output 
  2971.     Address of the structure that contains the returned directory information. 
  2972.     The information reflects the last DosClose, DosBufReset, DosSetFileMode, 
  2973.     DosSetFileInfo, and DosSetPathInfo calls. 
  2974.  
  2975.     filedate (FDATE) 
  2976.        Structure containing the date of file creation. 
  2977.  
  2978.        Bit       Description 
  2979.        15-9      Year, in binary, of file creation 
  2980.        8-5       Month, in binary, of file creation 
  2981.        4-0       Day, in binary, of file creation. 
  2982.  
  2983.     filetime (FTIME) 
  2984.        Structure containing the time of file creation. 
  2985.  
  2986.        Bit       Description 
  2987.        15-11     Hours, in binary, of file creation 
  2988.        10-5      Minutes, in binary, of file creation 
  2989.        4-0       Seconds, in binary number of two-second increments, of file 
  2990.                  creation. 
  2991.  
  2992.     fileaccessdate (FDATE) 
  2993.        Structure containing the date of last access. See FDATE in filedate. 
  2994.  
  2995.     fileaccesstime (FTIME) 
  2996.        Structure containing the time of last access. See FTIME in filetime. 
  2997.  
  2998.     writeaccessdate (FDATE) 
  2999.        Structure containing the date of last write. See FDATE in filedate. 
  3000.  
  3001.     writeaccesstime (FTIME) 
  3002.        Structure containing the time of last write. See FTIME in filetime. 
  3003.  
  3004.     filesize (ULONG) 
  3005.        File size. 
  3006.  
  3007.     filealloc (ULONG) 
  3008.        Allocated file size. 
  3009.  
  3010.     fileattrib (USHORT) 
  3011.        Attributes of the file, defined in DosSetFileMode. 
  3012.  
  3013.     length (UCHAR) 
  3014.        Length of the ASCIIZ name string. 
  3015.  
  3016.     matchfilename (CHAR) 
  3017.        ASCIIZ name string for the first occurrence of FileName. 
  3018.  
  3019.  ResultBufLen (USHORT) - input 
  3020.     Length of ResultBuf 
  3021.  
  3022.  SearchCount (PUSHORT) - input/output 
  3023.     Address of the number of matching entries requested in ResultBuf. On 
  3024.     return, this field contains the number of entries placed into ResultBuf. 
  3025.  
  3026.  Reserved (ULONG) - input 
  3027.     Reserved, must be set to zero. 
  3028.  
  3029.  rc (USHORT) - return 
  3030.     Return code descriptions are: 
  3031.  
  3032.     0         NO_ERROR 
  3033.     2         ERROR_FILE_NOT_FOUND 
  3034.     3         ERROR_PATH_NOT_FOUND 
  3035.     6         ERROR_INVALID_HANDLE 
  3036.     18        ERROR_NO_MORE_FILES 
  3037.     26        ERROR_NOT_DOS_DISK 
  3038.     87        ERROR_INVALID_PARAMETER 
  3039.     108       ERROR_DRIVE_LOCKED 
  3040.     111       ERROR_BUFFER_OVERFLOW 
  3041.     113       ERROR_NO_MORE_SEARCH_HANDLES 
  3042.     206       ERROR_FILENAME_EXCED_RANGE 
  3043.  
  3044.  Remarks 
  3045.  
  3046.  DosFindFirst returns directory entries (up to the number requested in 
  3047.  SearchCount) for as many files or subdirectories whose names and attributes 
  3048.  match the specification and whose information fits in ResultBuf. On output, 
  3049.  SearchCount contains the actual number of directory entries returned. 
  3050.  
  3051.  DosFindNext uses the directory handle associated with DosFindFirst to continue 
  3052.  the search started by the DosFindFirst request. 
  3053.  
  3054.  Any non-zero return code indicates no handle has been allocated, including 
  3055.  such non-error indicators as ERROR_NO_MORE_FILES. 
  3056.  
  3057.  DosQSysInfo is called by an application to determine the maximum path length 
  3058.  allowed by OS/2. 
  3059.  
  3060.  For programs running without the NEWFILES bit set, only 8.3 filename format 
  3061.  names are returned.  These names are changed to uppercase. 
  3062.  
  3063.  
  3064.  Family API Considerations 
  3065.  
  3066.  Some options operate differently in the DOS mode than in OS/2 mode. 
  3067.  Therefore, the following restrictions apply to DosFindFirst when coding for 
  3068.  the DOS mode: 
  3069.  
  3070.  DirHandle must always equal hex 0001H or FFFFH on the initial call to 
  3071.  DosFindFirst. Subsequent calls to DosFindFirst must have a DirHandle of hex 
  3072.  0001H unless a DosFindClose had been issued.  In this case, 0001H or FFFFH is 
  3073.  allowed. 
  3074.  
  3075.  
  3076. ΓòÉΓòÉΓòÉ 1.41. DosFindFirst2 ΓòÉΓòÉΓòÉ
  3077.  
  3078.                                Bindings:  C, MASM
  3079.  
  3080. This call finds the first file object or group of file objects whose name(s) 
  3081. match the specification. The specification can include extended attribute 
  3082. information associated with a file or subdirectory. 
  3083.  
  3084.  DosFindFirst2     (FileName, DirHandle, Attribute, ResultBuf, ResultBufLen, 
  3085.                    SearchCount, FileInfoLevel, Reserved) 
  3086.  
  3087.  FileName (PSZ) - input 
  3088.     Address of the ASCIIZ path name of the file or subdirectory to be found. 
  3089.     The name component may contain global file name characters. 
  3090.  
  3091.  DirHandle (PHDIR) - input/output 
  3092.     Address of the handle associated with a specific DosFindFirst2 request. The 
  3093.     values that can be specified are: 
  3094.  
  3095.     0001H     The system assigns the handle for standard output, which is 
  3096.               always available to a process. 
  3097.     FFFFH     The system allocates and returns a handle. If on input FFFFH is 
  3098.               specified, on output DirHandle contains the handle allocated by 
  3099.               the system. 
  3100.  
  3101.               The DosFindFirst2 handle is used with subsequent  DosFindNext 
  3102.               requests. Reuse of this handle in another DosFindFirst2 closes 
  3103.               the association with the previous DosFindFirst2 and opens a new 
  3104.               association. 
  3105.  
  3106.  Attribute (USHORT) - input 
  3107.     Attribute value that determines the file objects to be searched for. 
  3108.  
  3109.     Bit       Description 
  3110.     15-6      Reserved and must be zero. 
  3111.     5         File archive 
  3112.     4         Subdirectory 
  3113.     3         Reserved and must be zero. 
  3114.     2         System file 
  3115.     1         Hidden file 
  3116.     0         Read only file 
  3117.  
  3118.     These bits may be set individually or in combination.  For example, an 
  3119.     attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file 
  3120.     that should be archived. 
  3121.  
  3122.     To look at all directory entries except the volume label, set Attribute to 
  3123.     hidden+system+directory (all three bits on). Attribute cannot specify the 
  3124.     volume label.  Volume labels are queried using DosQFSInfo. 
  3125.  
  3126.     If Attribute is 0, only normal file entries are found.  Entries for 
  3127.     subdirectories, hidden, and system files, are not returned. 
  3128.  
  3129.  ResultBuf (PVOID) - input/output 
  3130.     Address of the directory search structures for file object information 
  3131.     levels 1 through 3. The structure required for ResultBuf is dependent on 
  3132.     the value specified for FileInfoLevel.  The information returned reflects 
  3133.     the last DosSetFileInfo, DosSetPathInfo, DosClose, and DosBufReset calls. 
  3134.  
  3135.     Level 1 Information 
  3136.        ResultBuf contains the following structure, to which directory entry 
  3137.        information is returned: 
  3138.  
  3139.        filedate (FDATE) 
  3140.           Structure containing the date of file creation. 
  3141.  
  3142.           Bit       Description 
  3143.           15-9      Year, in binary, of file creation 
  3144.           8-5       Month, in binary, of file creation 
  3145.           4-0       Day, in binary, of file creation. 
  3146.  
  3147.        filetime (FTIME) 
  3148.           Structure containing the time of file creation. 
  3149.  
  3150.           Bit       Description 
  3151.           15-11     Hours, in binary, of file creation 
  3152.           10-5      Minutes, in binary, of file creation 
  3153.           4-0       Seconds, in binary number of two-second increments, of file 
  3154.                     creation. 
  3155.  
  3156.        fileaccessdate (FDATE) 
  3157.           Structure containing the date of last access. See FDATE in filedate. 
  3158.  
  3159.        fileaccesstime (FTIME) 
  3160.           Structure containing the time of last access. See FTIME in filetime. 
  3161.  
  3162.        writeaccessdate (FDATE) 
  3163.           Structure containing the date of last write. See FDATE in filedate. 
  3164.  
  3165.        writeaccesstime (FTIME) 
  3166.           Structure containing the time of last write. See FTIME in filetime. 
  3167.  
  3168.        filesize (ULONG) 
  3169.           File size. 
  3170.  
  3171.        filealloc (ULONG) 
  3172.           Allocated file size. 
  3173.  
  3174.        fileattrib (USHORT) 
  3175.           Attributes of the file, defined in DosSetFileMode. 
  3176.  
  3177.        length (UCHAR) 
  3178.           Length of the ASCIIZ name string. 
  3179.  
  3180.        matchfilename (CHAR) 
  3181.           ASCIIZ name string for the first occurrence of FileName. 
  3182.  
  3183.     Level 2 Information 
  3184.        ResultBuf contains a structure similar to the Level 1 structure, with 
  3185.        the addition of the cbList field inserted before the name length field 
  3186.        of the matched file object. 
  3187.  
  3188.        cbList (ULONG) 
  3189.           On output, this field contains the length of the entire EA set for 
  3190.           the file object.  This value can be used to calculate the size of the 
  3191.           buffer required to hold EA information returned when FileInfoLevel = 
  3192.           3 is specified. 
  3193.  
  3194.     Level 3 Information 
  3195.        ResultBuf contains an EAOP structure, which has the following format : 
  3196.  
  3197.        fpGEAList (PGEALIST) 
  3198.           Address of GEAList. GEAList is a packed array of variable length "get 
  3199.           EA" structures, each containing an EA name and the length of the 
  3200.           name. 
  3201.  
  3202.        fpFEAList (PFEALIST) 
  3203.           Address of FEAList. FEAList is a packed array of variable length 
  3204.           "full EA" structures, each containing an EA name and its 
  3205.           corresponding value, as well as the lengths of the name and the 
  3206.           value. 
  3207.  
  3208.        oError (ULONG) 
  3209.           Offset into structure where error has occurred. 
  3210.  
  3211.           On input, fpGEAList contains the address of a GEA list, which defines 
  3212.           the attribute names whose values are to be returned. fpGEAList is 
  3213.           ignored.  In case of error, oError contains the offset of the 
  3214.           offending GEA entry. Following is the format of the GEAList 
  3215.           structure: 
  3216.  
  3217.        cbList (ULONG) 
  3218.           Length of the GEA list, including the length itself. 
  3219.  
  3220.        list (GEA) 
  3221.           List of GEA structures.  A GEA structure has the following format: 
  3222.  
  3223.           cbName (BYTE) 
  3224.              Length of EA ASCIIZ name, which does not include the null 
  3225.              character. 
  3226.  
  3227.           szName (CHAR) 
  3228.              ASCIIZ name of EA. 
  3229.  
  3230.              Following the EAOP structure is a structure similar to the Level 1 
  3231.              structure, with the addition of an FEAList structure inserted 
  3232.              before the name length field for the matched file object. 
  3233.  
  3234.              On output, this structure contains a packed set of records 
  3235.              representing the directory entry and associated EAs for the 
  3236.              matched file object. Following is the format of the FEAList 
  3237.              structure: 
  3238.  
  3239.        cbList (ULONG) 
  3240.           Length of the FEA list, including the length itself. 
  3241.  
  3242.        list (FEA) 
  3243.           List of FEA structures.  An FEA structure has the following format: 
  3244.  
  3245.           Flags (BYTE) 
  3246.              Bit indicator describing the characteristics of the EA being 
  3247.              defined. 
  3248.  
  3249.              Bit       Description 
  3250.              7         Critical EA. 
  3251.              6-0       Reserved and must be set to zero. 
  3252.  
  3253.              If bit 7 is set to 1, this indicates a critical EA.  If bit 7 is 
  3254.              0, this means the EA is noncritical; that is, the EA is not 
  3255.              essential to the intended use by an application of the file with 
  3256.              which it is associated. 
  3257.  
  3258.           cbName (BYTE) 
  3259.              Length of EA ASCIIZ name, which does not include the null 
  3260.              character. 
  3261.  
  3262.           cbValue (USHORT) 
  3263.              Length of EA value, which cannot exceed 64KB. 
  3264.  
  3265.           szName (PSZ) 
  3266.              ASCIIZ name of EA. 
  3267.  
  3268.           aValue (PSZ) 
  3269.              Free-format value of EA. 
  3270.  
  3271.           Note: 
  3272.              The szName and aValue fields are not included as part of header or 
  3273.              include files.  Because of their variable lengths, these entries 
  3274.              must be built manually. 
  3275.  
  3276.  ResultBufLen (USHORT) - input 
  3277.     Length of ResultBuf. 
  3278.  
  3279.  SearchCount (PUSHORT) - input/output 
  3280.     Address of the number of matching entries requested in ResultBuf. On 
  3281.     return, this field contains the number of entries placed into ResultBuf. 
  3282.  
  3283.  FileInfoLevel (USHORT) 
  3284.     The level of file information required. A value of 1, 2, or 3 can be 
  3285.     specified. The structures described in ResultBuf indicate the information 
  3286.     returned for each of these levels. 
  3287.  
  3288.     Regardless of the level specified, a DosFindFirst2 request (and an 
  3289.     associated DosFindNext request) always includes the information returned by 
  3290.     level 1 as part of the information that is returned. However, when level 1 
  3291.     information is specifically requested, an inclusive search is made. That 
  3292.     is, all normal file entries plus all entries matching any specified 
  3293.     attributes are returned. 
  3294.  
  3295.  Reserved (ULONG) - input 
  3296.     Reserved, must be set to zero. 
  3297.  
  3298.  rc (USHORT) - return 
  3299.     Return code descriptions are: 
  3300.  
  3301.     0         NO_ERROR 
  3302.     2         ERROR_FILE_NOT_FOUND 
  3303.     3         ERROR_PATH_NOT_FOUND 
  3304.     6         ERROR_INVALID_HANDLE 
  3305.     18        ERROR_NO_MORE_FILES 
  3306.     26        ERROR_NOT_DOS_DISK 
  3307.     87        ERROR_INVALID_PARAMETER 
  3308.     108       ERROR_DRIVE_LOCKED 
  3309.     111       ERROR_BUFFER_OVERFLOW 
  3310.     113       ERROR_NO_MORE_SEARCH_HANDLES 
  3311.     206       ERROR_FILENAME_EXCED_RANGE 
  3312.     208       ERROR_META_EXPANSION_TOO_LONG 
  3313.     254       ERROR_INVALID_EA_NAME 
  3314.     255       ERROR_EA_LIST_INCONSISTENT 
  3315.     275       ERROR_EAS_DIDNT_FIT 
  3316.  
  3317.  Remarks 
  3318.  
  3319.  DosFindFirst2 returns directory entries (up to the number requested in 
  3320.  SearchCount) and extended attribute information for as many files or 
  3321.  subdirectories whose names, attributes, and extended attributes match the 
  3322.  specification, and whose information fits in ResultBuf.  On output, 
  3323.  SearchCount contains the actual number of directory entries returned. 
  3324.  
  3325.  DosFindNext uses the directory handle associated with DosFindFirst2 to 
  3326.  continue the search started by the DosFindFirst2 request. 
  3327.  
  3328.  Any non-zero return code except ERROR_EAS_DIDNT_FIT indicates no handle has 
  3329.  been allocated. This includes such non-error indicators as 
  3330.  ERROR_NO_MORE_FILES. 
  3331.  
  3332.  For programs running without the NEWFILES bit set, only 8.3 filename format 
  3333.  names are returned.  These names are changed to uppercase. 
  3334.  
  3335.  In the case of ERROR_EAS_DIDNT_FIT, a search handle is returned, and a 
  3336.  subsequent call to DosFindNext will get the next matching entry in the 
  3337.  directory. You may use DosQPathInfo to retrieve the EAs for the matching entry 
  3338.  by using the EA arguments that were used for the DosFindFirst2 call and the 
  3339.  name that was returned by DosFindFirst2. 
  3340.  
  3341.  In the case of ERROR_EAS_DIDNT_FIT, only information for the first matching 
  3342.  entry is returned. This entry is the one whose EAs did not fit in the buffer. 
  3343.  The information returned is in the format of that returned for InfoLevel 2. No 
  3344.  further entries are returned in the buffer even if they could fit in the 
  3345.  remaining space. 
  3346.  
  3347.  
  3348.  Family API Considerations 
  3349.  
  3350.  Some options operate differently in the DOS mode than in OS/2 mode. 
  3351.  Therefore, the following restrictions apply to DosFindFirst when coding for 
  3352.  the DOS mode: 
  3353.  
  3354.  DirHandle must always equal hex 0001H or FFFFH on the initial call to 
  3355.  DosFindFirst. Subsequent calls to DosFindFirst must have a DirHandle of hex 
  3356.  0001H unless a DosFindClose had been issued.  In this case, 0001H or FFFFH is 
  3357.  allowed. 
  3358.  
  3359.  
  3360. ΓòÉΓòÉΓòÉ 1.42. DosFindNext ΓòÉΓòÉΓòÉ
  3361.  
  3362.                                Bindings:  C, MASM
  3363.  
  3364. This call locates the next set of directory entries that match the name 
  3365. specified in the previous DosFindFirst, DosFindFirst2, or DosFindNext call. 
  3366.  
  3367.  DosFindNext    (DirHandle, ResultBuf, ResultBufLen, SearchCount) 
  3368.  
  3369.  DirHandle (HDIR) - input 
  3370.     Handle associated with a previous DosFindFirst or DosFindNext function 
  3371.     call. 
  3372.  
  3373.  ResultBuf (PFILEFINDBUF) - output 
  3374.     Address of the directory search information structure.  The information 
  3375.     reflects the last DosClose or DosBufReset call. 
  3376.  
  3377.     It is possible, if the EA information for a file is 64K, that the system 
  3378.     can never be able to return the full EA information for a file. 
  3379.  
  3380.     For the continuation of an FileInfoLevel 3 search, this buffer should 
  3381.     contain input in the same format as a DosFindFirst2 FileInfoLevel 3 search. 
  3382.  
  3383.     filedate (FDATE) 
  3384.        Structure containing the date of file creation. 
  3385.  
  3386.        Bit       Description 
  3387.        15-9      Year, in binary, of file creation 
  3388.        8-5       Month, in binary, of file creation 
  3389.        4-0       Day, in binary, of file creation. 
  3390.  
  3391.     filetime (FTIME) 
  3392.        Structure containing the time of file creation. 
  3393.  
  3394.        Bit       Description 
  3395.        15-11     Hours, in binary, of file creation 
  3396.        10-5      Minutes, in binary, of file creation 
  3397.        4-0       Seconds, in binary number of two-second increments, of file 
  3398.                  creation. 
  3399.  
  3400.     fileaccessdate (FDATE) 
  3401.        Structure containing the date of last access. See FDATE in filedate. 
  3402.  
  3403.     fileaccesstime (FTIME) 
  3404.        Structure containing the time of last access. See FTIME in filetime. 
  3405.  
  3406.     writeaccessdate (FDATE) 
  3407.        Structure containing the date of last write. See FDATE in filedate. 
  3408.  
  3409.     writeaccesstime (FTIME) 
  3410.        Structure containing the time of last write. See FTIME in filetime. 
  3411.  
  3412.     filesize (ULONG) 
  3413.        File size. 
  3414.  
  3415.     filealloc (ULONG) 
  3416.        Allocated file size. 
  3417.  
  3418.     fileattrib (USHORT) 
  3419.        Attributes of the file, defined in DosSetFileMode. 
  3420.  
  3421.     length (UCHAR) 
  3422.        Length of the ASCIIZ name string. 
  3423.  
  3424.     matchfilename (CHAR) 
  3425.        ASCIIZ name string for the first occurrence of FileName. 
  3426.  
  3427.  ResultBufLen (USHORT) - input 
  3428.     Length of ResultBuf 
  3429.  
  3430.  SearchCount (PUSHORT) - input/output 
  3431.     Address of the number of matching entries requested in ResultBuf. On 
  3432.     return, this field contains the number of entries placed into ResultBuf. 
  3433.  
  3434.  rc (USHORT) - return 
  3435.     Return code descriptions are: 
  3436.  
  3437.     0         NO_ERROR 
  3438.     6         ERROR_INVALID_HANDLE 
  3439.     18        ERROR_NO_MORE_FILES 
  3440.     26        ERROR_NOT_DOS_DISK 
  3441.     87        ERROR_INVALID_PARAMETER 
  3442.     111       ERROR_BUFFER_OVERFLOW 
  3443.     275       ERROR_EAS_DIDNT_FIT 
  3444.  
  3445.  Remarks 
  3446.  
  3447.  The file name in FileName can contain global file name characters. If no more 
  3448.  matching files are found, an error code is returned. 
  3449.  
  3450.  If an ERROR_BUFFER_OVERFLOW error is returned, further calls to DosFindNext 
  3451.  will start the search from the same entry. 
  3452.  
  3453.  If an ERROR_EAS_DIDNT_FIT error is returned, then the buffer was too small to 
  3454.  hold the EAs for the first matching entry being returned. A subsequent call to 
  3455.  DosFindNext will get the next matching entry. This enables the search to 
  3456.  continue if the EAs being returned are too big to fit in the buffer. You may 
  3457.  use DosQPathInfo to retrieve the EAs for the matching entry by using the EA 
  3458.  arguments that were used for the DosFindFirst2 call and the name that was 
  3459.  returned by DosFindFirst2. 
  3460.  
  3461.  In the case of ERROR_EAS_DIDNT_FIT, only information for the first matching 
  3462.  entry is returned. This entry is the one whose EAs did not fit in the buffer. 
  3463.  The information returned is in the format of that returned for InfoLevel 2. No 
  3464.  further entries are returned in the buffer even if they could fit in the 
  3465.  remaining space. 
  3466.  
  3467.  
  3468.  Family API Considerations 
  3469.  
  3470.  Some options operate differently in the DOS mode than in OS/2 mode. 
  3471.  Therefore, the following restriction applies to DosFindNext when coding for 
  3472.  the DOS mode: 
  3473.  
  3474.  o DirHandle must always equal 1. 
  3475.  
  3476.  
  3477. ΓòÉΓòÉΓòÉ 1.43. DosFlagProcess ΓòÉΓòÉΓòÉ
  3478.  
  3479.                                Bindings:  C, MASM
  3480.  
  3481. This call allows one process to set an external event flag for another. 
  3482.  
  3483.  DosFlagProcess     (ProcessID, ActionCode, Flagnum, Flagarg) 
  3484.  
  3485.  ProcessID (PID) - input 
  3486.     ID of the process or root process of the process tree, who is to receive 
  3487.     notification that the flag event has occurred. 
  3488.  
  3489.  ActionCode (USHORT) - input 
  3490.     Indicates who is to receive notification that the flag event has occurred. 
  3491.  
  3492.     Value     Definition 
  3493.     0         The indicated process and all its descendant processes are 
  3494.               flagged.  (Detached processes cannot be flagged.) The indicated 
  3495.               process must be the current process or one it has created as a 
  3496.               non-detached process.  If the indicated process terminates, its 
  3497.               descendants are still flagged. 
  3498.     1         Only the indicated process is flagged.  Any process can be 
  3499.               specified. 
  3500.  
  3501.  Flagnum (USHORT) - input 
  3502.     Number of the flag event whose occurrence is to be signalled as shown 
  3503.     below: 
  3504.  
  3505.     Value     Definition 
  3506.     0         Flag A 
  3507.     1         Flag B 
  3508.     2         Flag C. 
  3509.  
  3510.  Flagarg (USHORT) - input 
  3511.     An argument passed to indicated processes. 
  3512.  
  3513.  rc (USHORT) - return 
  3514.     Return code descriptions are: 
  3515.  
  3516.     0         NO_ERROR 
  3517.     1         ERROR_INVALID_FUNCTION 
  3518.     156       ERROR_SIGNAL_REFUSED 
  3519.     186       ERROR_INVALID_FLAG_NUMBER 
  3520.     303       ERROR_INVALID_PROCID 
  3521.  
  3522.  Remarks 
  3523.  
  3524.  A process issues DosFlagProcess to set one of three user-defined flags 
  3525.  available to the process. The meaning of the flag is defined by the flag user 
  3526.  - the process that receives the signal generated by the OS/2 signal mechanism 
  3527.  upon the setting of the flag. 
  3528.  
  3529.  When the flag user is signaled, its reaction to the signal depends on values 
  3530.  it has specified with DosSetSigHandler. For example, it can respond by giving 
  3531.  control to a signal handler it has registered with DosSetSigHandler for the 
  3532.  signal that corresponds to the user flag (SIGPFA corresponds to Flag A, and so 
  3533.  on). Or, the flag user can ignore the signal and return an error code to the 
  3534.  flagger. 
  3535.  
  3536.  If no action is specified with DosSetSigHandler by a process for a user flag, 
  3537.  the default is to ignore the signal. 
  3538.  
  3539.  
  3540. ΓòÉΓòÉΓòÉ 1.44. DosFreeModule ΓòÉΓòÉΓòÉ
  3541.  
  3542.                                Bindings:  C, MASM
  3543.  
  3544. This call frees the reference to a dynamic link module for a process.  When the 
  3545. dynamic link module is no longer needed by any process, the module is freed 
  3546. from system memory. 
  3547.  
  3548.  DosFreeModule     (ModuleHandle) 
  3549.  
  3550.  ModuleHandle (HMODULE) - input 
  3551.     Handle returned by DosLoadModule. 
  3552.  
  3553.  rc (USHORT) - return 
  3554.     Return code descriptions are: 
  3555.  
  3556.     0         NO_ERROR 
  3557.     6         ERROR_INVALID_HANDLE 
  3558.     12        ERROR_INVALID_ACCESS 
  3559.     95        ERROR_INTERRUPT 
  3560.  
  3561.  Remarks 
  3562.  
  3563.  The module identified by the handle must be loaded through DosLoadModule.  An 
  3564.  error is returned if the handle is invalid. 
  3565.  
  3566.  If any exit list routines were registered as a result of this module being 
  3567.  loaded, the module may not be freed and ERROR_INVALID_ACCESS may be returned. 
  3568.  
  3569.  When DosFreeModule returns to the caller, the module handle is no longer valid 
  3570.  and is not used to reference the dynamic link module.  Procedure entry 
  3571.  addresses returned for this module are no longer valid and cause a protection 
  3572.  fault if they are invoked. 
  3573.  
  3574.  
  3575. ΓòÉΓòÉΓòÉ 1.45. DosFreeResource ΓòÉΓòÉΓòÉ
  3576.  
  3577.                                Bindings:  C, MASM
  3578.  
  3579. This call frees a resource loaded by DosGetResource2. 
  3580.  
  3581.  DosFreeResource      (ResAddr) 
  3582.  
  3583.  ResAddr (PBYTE) - input 
  3584.     The address of the resource to free. 
  3585.  
  3586.  rc (USHORT) - return 
  3587.     Return code descriptions are: 
  3588.  
  3589.     0         NO_ERROR 
  3590.     6         ERROR_ACCESS_DENIED 
  3591.  
  3592.  Remarks 
  3593.  
  3594.  DosFreeResource is used to free resources obtained with DosGetResource2. 
  3595.  
  3596.  After the last reference to a resource is freed, the memory becomes available 
  3597.  for reuse by the system. However, the memory is not reused until the system 
  3598.  determines it cannot satisfy a memory allocation request. This allows the 
  3599.  resource to remain in memory in case the process issues another 
  3600.  DosGetResource2 call. The system thus avoids having to reread the contents of 
  3601.  the resource from disk. 
  3602.  
  3603.  
  3604. ΓòÉΓòÉΓòÉ 1.46. DosFreeSeg ΓòÉΓòÉΓòÉ
  3605.  
  3606.                                Bindings:  C, MASM
  3607.  
  3608. This call deallocates a memory segment. 
  3609.  
  3610.  DosFreeSeg    (Selector) 
  3611.  
  3612.  Selector (SEL) - input 
  3613.     Selector of the segment to be freed. 
  3614.  
  3615.  rc (USHORT) - return 
  3616.     Return code descriptions are: 
  3617.  
  3618.     0         NO_ERROR 
  3619.     5         ERROR_ACCESS_DENIED 
  3620.     212       ERROR_LOCKED 
  3621.  
  3622.  Remarks 
  3623.  
  3624.  DosFreeSeg frees selectors to segments returned by allocation calls to 
  3625.  DosAllocSeg, DosAllocShrSeg, and DosAllocHuge.  In addition, DosFreeSeg frees 
  3626.  a selector returned by a call to DosCreateCSAlias. If a CS alias selector has 
  3627.  been created for a data segment by a call to DosCreateCSAlias, the CS alias 
  3628.  selector is still valid after the segment's data selector has been freed. 
  3629.  
  3630.  When allocated memory is shared, all selectors to the shared memory must be 
  3631.  freed before the memory is deallocated. For example, if memory allocated by 
  3632.  DosAllocSeg or  DosAllocHuge has been given to another process with 
  3633.  DosGiveSeg, the giver usually frees its selector by a call to DosFreeSeg.  The 
  3634.  recipient, in turn, frees the selector passed to it, after it has accessed the 
  3635.  shared memory with DosGetSeg. 
  3636.  
  3637.  DosFreeSeg decrements the reference count for named shared segments allocated 
  3638.  by DosAllocShrSeg.  Access to the segment with  DosGetShrSeg increments this 
  3639.  count.  When the count is 0, the memory is deallocated. 
  3640.  
  3641.  
  3642.  Family API Considerations 
  3643.  
  3644.  Some options operate differently in the DOS mode than in OS/2 mode. 
  3645.  Therefore, the following restriction applies to DosFreeSeg when coding for the 
  3646.  DOS mode: 
  3647.  
  3648.  If DosFreeSeg is issued on a CSAliased segment it deallocates the associated 
  3649.  memory.  This is inconsistent with the OS/2 mode, because DosFreeSeg must be 
  3650.  performed on both the original and CSAliased selectors. 
  3651.  
  3652.  
  3653. ΓòÉΓòÉΓòÉ 1.47. DosFSAttach ΓòÉΓòÉΓòÉ
  3654.  
  3655.                                Bindings:  C, MASM
  3656.  
  3657. DosFSAttach attaches or detaches drive to/from a remote FSD, or a 
  3658. pseudo-character device name to/from a local or remote FSD. 
  3659.  
  3660.  DosFSAttach     (DeviceName, FSDName, DataBuffer, DataBufferLen, OpFlag, 
  3661.                  Reserved) 
  3662.  
  3663.  DeviceName (PSZ) - input 
  3664.     Points to either the drive letter followed by a colon, or points to a 
  3665.     pseudo-character device name.  If DeviceName is a drive, it is an ASCIIZ 
  3666.     string having the form of drive letter followed by a colon.  If an attach 
  3667.     is successful, all requests to that drive are routed to the specified FSD. 
  3668.     If a detach is successful, the drive disappears from the system's name 
  3669.     space. 
  3670.  
  3671.     If DeviceName is a pseudo-character device name (single file device), its 
  3672.     format is that of an ASCIIZ string in the format of an OS/2 filename in a 
  3673.     subdirectory called \DEV\.  All requests to that name are routed to the 
  3674.     specified FSD after a successful attach.  A successful detach removes the 
  3675.     name from the system's name space. 
  3676.  
  3677.  FSDName (PSZ) - input 
  3678.     Address of the ASCIIZ name of the remote FSD to attach to or detach from 
  3679.     DeviceName. 
  3680.  
  3681.  DataBuffer (PBYTE) - input 
  3682.     Points to the user-supplied FSD argument data area.  The meaning of the 
  3683.     data is specific to the FSD. The DataBuffer contains contiguous ASCIIZ 
  3684.     strings, with the first word of the buffer containing the number of ASCIIZ 
  3685.     strings. 
  3686.  
  3687.  DataBufferLen (USHORT) - input 
  3688.     The byte length of the data buffer. 
  3689.  
  3690.  OpFlag (USHORT) - input 
  3691.     Defines the type of operation to be performed. Attach = 0 and Detach = 1. 
  3692.  
  3693.  Reserved (ULONG) - input 
  3694.     Reserved, must be set to zero. 
  3695.  
  3696.  rc (USHORT) - return 
  3697.     Return code descriptions are: 
  3698.  
  3699.     0         NO_ERROR 
  3700.     8         ERROR_NOT_ENOUGH_MEMORY 
  3701.     15        ERROR_INVALID_DRIVE 
  3702.     124       ERROR_INVALID_LEVEL 
  3703.     252       ERROR_INVALID_FSD_NAME 
  3704.     253       ERROR_INVALID_PATH 
  3705.  
  3706.  Remarks 
  3707.  
  3708.  The redirection of drive letters representing local drives is not supported. 
  3709.  
  3710.  FSDs that wish to establish open connections that are not attached to a name 
  3711.  in the system's name space, for such purposes as optimizing UNC connections or 
  3712.  establishing access rights, must use an DosFSCtl function to do so. 
  3713.  DosFSAttach only creates attachments to drives or devices in the system's name 
  3714.  space. 
  3715.  
  3716.  See description of pseudo-character devices. 
  3717.  
  3718.  
  3719. ΓòÉΓòÉΓòÉ 1.48. DosFSCtl ΓòÉΓòÉΓòÉ
  3720.  
  3721.                                Bindings:  C, MASM
  3722.  
  3723. DosFSCtl provides an extended standard interface between an application and an 
  3724. FSD. 
  3725.  
  3726.  DosFSCtl    (DataArea, DataLengthMax, DataLength, ParmList, ParmLengthMax, 
  3727.              ParmLength, FunctionCode, RouteName, FileHandle, RouteMethod, 
  3728.              Reserved) 
  3729.  
  3730.  DataArea (PBYTE) - input 
  3731.     Address of the data area. 
  3732.  
  3733.  DataLengthMax (USHORT) - input 
  3734.     The maximum length in bytes to be returned by the FSD in DataArea. 
  3735.     DataLength may be longer than this on input, but not on output. 
  3736.  
  3737.  DataLength (PUSHORT) - input/output 
  3738.     Address of the length in bytes of data in DataArea. On input, it is the 
  3739.     length of data being sent, and on output is the length of the data that was 
  3740.     returned by the FSD.  If ERROR_BUFFER_OVERFLOW is returned from the call, 
  3741.     then it is the size of the buffer required to hold the data returned by the 
  3742.     FSD. 
  3743.  
  3744.  ParmList (PBYTE) - input 
  3745.     Address of the command specific parameter list. 
  3746.  
  3747.  ParmLengthMax (USHORT) - input 
  3748.     The maximum length in bytes of the data to be returned by the FSD in 
  3749.     ParmList.  ParmLength may be longer than this on input, but not on output. 
  3750.  
  3751.  ParmLength (PUSHORT) - input/output 
  3752.     Address of, on input, the length in bytes of parameters passed in by the 
  3753.     application, and on return it is the length of parameters returned by the 
  3754.     FSD.  If ERROR_BUFFER_OVERFLOW is returned from the call, then it is the 
  3755.     size of the buffer required to hold the parameters returned by the FSD.  No 
  3756.     other data is returned in this case. 
  3757.  
  3758.  FunctionCode (USHORT) - input 
  3759.     The file system-specific function code. For remote FSDs, there are two 
  3760.     kinds of possible FsCtl calls: FsCtl calls that are handled locally, and 
  3761.     FsCtl calls that are exported across the network.  If bit 0x4000 is set in 
  3762.     the function code, then this indicates to the remote FSD that the function 
  3763.     should be exported. The range of function codes are split up as follows: 
  3764.     Function codes between 0x0000 and 0x7FFF are reserved for use by OS/2. 
  3765.     Function codes between 0x8000 and 0xBFFF are FSD defined FsCtl functions 
  3766.     handled by the local FSD. Function codes between 0xC000 and 0xFFFF are FSD 
  3767.     defined FsCtl functions exported to the server. 
  3768.  
  3769.     FunctionCode = 1: returns FSD error code information. Error code is passed 
  3770.     to the FSD in the first word of ParmList. On return, the first word of the 
  3771.     Data area contains the length of the following ASCIIZ string. The ASCIIZ 
  3772.     string begins at the second word and is an explanation of the error code. 
  3773.  
  3774.  RouteName (PSZ) - input 
  3775.     Address of the ASCIIZ name of the FSD, or the pathname of a file or 
  3776.     directory the operation should apply to. 
  3777.  
  3778.  FileHandle (HFILE) - input 
  3779.     The file or device specific handle. 
  3780.  
  3781.  RouteMethod (USHORT) - input 
  3782.     Selects how the request is routed. 
  3783.  
  3784.     Value     Definition 
  3785.  
  3786.     1         FileHandle directs routing. RouteName must be a NUL pointer (0L). 
  3787.               The FSD associated with the handle receives the request. 
  3788.  
  3789.     2         RouteMethod refers to a pathname, that directs routing. 
  3790.               FileHandle must 
  3791.               be -1. The FSD associated with the drive that the pathname refers 
  3792.               to at the time of the request receives the request. The pathname 
  3793.               need not refer to a file or directory that actually exists, only 
  3794.               to a drive. A relative pathname may be used, it is processed like 
  3795.               any other pathname. 
  3796.  
  3797.     3         RouteMethod refers to an FSD name, that directs routing. 
  3798.               FileHandle must 
  3799.               be -1. The named FSD receives the request. 
  3800.  
  3801.  Reserved (ULONG) - input 
  3802.     Reserved, must be set to zero. 
  3803.  
  3804.  rc (USHORT) - return 
  3805.     Return code descriptions are: 
  3806.  
  3807.     0         NO_ERROR 
  3808.     1         ERROR_INVALID_FUNCTION 
  3809.     6         ERROR_INVALID_HANDLE 
  3810.     87        ERROR_INVALID_PARAMETER 
  3811.     95        ERROR_INTERRUPT 
  3812.     111       ERROR_BUFFER_OVERFLOW 
  3813.     117       ERROR_INVALID_CATEGORY 
  3814.     124       ERROR_INVALID_LEVEL 
  3815.     252       ERROR_INVALID_FSD_NAME 
  3816.  
  3817.  
  3818. ΓòÉΓòÉΓòÉ 1.49. DosFSRamSemClear ΓòÉΓòÉΓòÉ
  3819.  
  3820.                                Bindings:  C, MASM
  3821.  
  3822. This call releases ownership of a Fast-Safe (FS) RAM semaphore. 
  3823.  
  3824.  DosFSRamSemClear     (FSRamSemStructure) 
  3825.  
  3826.  FSRamSemStructure (PDOSFSRSEM) - input 
  3827.     Address of the FS RAM Semaphore data structure. The content/format of this 
  3828.     structure is shown in DosFSRamSemRequest. 
  3829.  
  3830.  rc (USHORT) - return 
  3831.     Return code description is: 
  3832.  
  3833.     0         NO_ERROR 
  3834.  
  3835.  Remarks 
  3836.  
  3837.  DosFSRamSemClear decrements fs_UseCount, which is incremented by 
  3838.  DosFSRamSemRequest. Recursive requests for FS RAM semaphores are supported by 
  3839.  this use count, which keeps track of the number of times the owner has issued 
  3840.  a DosFSRamSemRequest without a corresponding DosFSRamSemClear. If the call to 
  3841.  DosFSRamSemClear decrements the use count to zero, the semaphore is set 
  3842.  unowned, and any threads that were blocked waiting for the semaphore resume 
  3843.  execution. 
  3844.  
  3845.  DosFSRamSemClear cannot be issued against a FS RAM semaphore that is owned by 
  3846.  another thread. 
  3847.  
  3848.  
  3849. ΓòÉΓòÉΓòÉ 1.50. DosFSRamSemRequest ΓòÉΓòÉΓòÉ
  3850.  
  3851.                                Bindings:  C, MASM
  3852.  
  3853. This call obtains a Fast-Safe (FS) RAM semaphore and records the current owner 
  3854. for potential cleanup by a DosExitList routine. 
  3855.  
  3856.  DosFSRamSemRequest     (FSRamSemStructure, Timeout) 
  3857.  
  3858.  FSRamSemStructure (PDOSFSRSEM) - input 
  3859.     Address of the FS RAM Semaphore data structure. The content of this 
  3860.     structure is: 
  3861.  
  3862.     fs_Length (USHORT) 
  3863.        Length in bytes of the FSRamSemStructure; 14 is the only valid value. 
  3864.  
  3865.     fs_ProcID (PID) 
  3866.        Owning process ID; 0 means the semaphore is not owned. 
  3867.  
  3868.     fs_ThrdID (TID) 
  3869.        Owning thread ID; 0 means the semaphore is not owned. 
  3870.  
  3871.     fs_UseCount (USHORT) 
  3872.        Use count.  The number of times the owning thread has issued 
  3873.        DosFSRamSemRequest without issuing a corresponding DosFSRamSemClear. 
  3874.  
  3875.     fs_Client (USHORT) 
  3876.        Is a 16-bit pattern used by the owner of a semaphore to record 
  3877.        maintenance information about the resource managed by the semaphore. 
  3878.  
  3879.     fs_RAMSem (ULONG) 
  3880.        The RAM semaphore data structure used in this request. 
  3881.  
  3882.        Before the initial call to DosFSRamSemRequest, this entire structure 
  3883.        must be initialized to zero and its length set to 14. Other than 
  3884.        fs_Client, the caller should not modify any fields in this structure. 
  3885.  
  3886.  Timeout (LONG) - input 
  3887.     The number of milliseconds to wait for the semaphore to be cleared before 
  3888.     resuming execution. The meaning of the specified values are: 
  3889.  
  3890.     Value     Definition 
  3891.      -1       The requestor waits indefinitely when the semaphore is owned. 
  3892.               There is no time out. 
  3893.       0       There is an immediate return if the semaphore is owned. 
  3894.     >0        The value is the number of milliseconds to wait, if the semaphore 
  3895.               is owned. 
  3896.  
  3897.  rc (USHORT) - return 
  3898.     Return code descriptions are: 
  3899.  
  3900.     0         NO_ERROR 
  3901.     121       ERROR_SEM_TIMEOUT 
  3902.  
  3903.  Remarks 
  3904.  
  3905.  When DosFSRamSemRequest is called, it checks the status of the semaphore.  If 
  3906.  it is unowned, then DosFSRamSemRequest sets it owned, increments fs_UseCount, 
  3907.  and returns immediately to the caller. 
  3908.  
  3909.  If the semaphore is owned, the caller has the option to block until the 
  3910.  semaphore is no longer owned. The unblocking of a DosFSRamSemRequest is "level 
  3911.  triggered" because it does not actually return unless the semaphore remains 
  3912.  clear until the affected thread can be redispatched to claim it successfully. 
  3913.  The Timeout parameter can be used to place an upper bound on the amount of 
  3914.  time to block before returning, even though the semaphore remains owned. 
  3915.  
  3916.  When the thread is done with the protected resource, it calls 
  3917.  DosFSRamSemClear.  DosFSRamSemClear decrements fs_UseCount. Recursive requests 
  3918.  for FS RAM semaphores are supported by the use count, which keeps track of the 
  3919.  number of times the owner has issued a DosFSRamSemRequest without a 
  3920.  corresponding DosFSRamSemClear. If the call to DosFSRamSemClear decrements the 
  3921.  use count to zero, the semaphore is set unowned, and any threads that were 
  3922.  blocked waiting for the semaphore resume execution. 
  3923.  
  3924.  The 16-bit field fs_Client is not interpreted by the FS RAM semaphore calls. 
  3925.  Instead, it provides the caller with a means of identifying the resource being 
  3926.  accessed by the owner of the semaphore.  This field is initialized to zero 
  3927.  when a FS RAM semaphore is first acquired.  The owner may place values into 
  3928.  this field that describe the resource. These values can be used by an exit 
  3929.  list handler to determine the appropriate cleanup action. 
  3930.  
  3931.  When a process terminates while owning a FS RAM semaphore, any routines in the 
  3932.  exit list maintained by DosExitList are given control. These routines take 
  3933.  appropriate steps to guarantee the integrity of resources owned by the 
  3934.  process. To clean up a resource protected by a FS RAM semaphore, 
  3935.  DosFSRamSemRequest is called to gain ownership of the semaphore.  When issued 
  3936.  during exit list processing , DosFSRamSemRequest examines the semaphore to 
  3937.  determine if the semaphore is owned by the active process. It then forces the 
  3938.  owning thread ID to be equal to the current thread ID and sets 
  3939.  fs_Count = 1.  This allows the exit list routine to be programmed without any 
  3940.  FS RAM semaphore handling instructions.  When the exit list routine has 
  3941.  completed its operations, it restores the resource for use by others by 
  3942.  issuing DosFSRamSemClear. 
  3943.  
  3944.  
  3945. ΓòÉΓòÉΓòÉ 1.51. DosGetCollate ΓòÉΓòÉΓòÉ
  3946.  
  3947.                                Bindings:  C, MASM
  3948.  
  3949. This call obtains a collating sequence table (for characters hex 00H through 
  3950. FFH) that resides in the country information file.  It is used by the SORT 
  3951. utility to sort text according to the collating sequence. 
  3952.  
  3953.  DosGetCollate    (Length, Country, MemoryBuffer, DataLength) 
  3954.  
  3955.  Length (USHORT) - input 
  3956.     Length, in bytes, of the data area (MemoryBuffer). A length value of 256 is 
  3957.     sufficient. 
  3958.  
  3959.  Country (PCOUNTRYCODE) - input 
  3960.     Address of the country information structure: 
  3961.  
  3962.     country (USHORT) 
  3963.        Country code identifier. 0 is the default country code. 
  3964.  
  3965.     codepage (USHORT) 
  3966.        Code page identifier. 0 is the code page of the current process. 
  3967.  
  3968.  MemoryBuffer (PCHAR) - output 
  3969.     Address of the collating table. This memory area is provided by the caller. 
  3970.     The size of the area is provided by the input parameter Length.  If it is 
  3971.     too small to hold all the available information then as much information as 
  3972.     possible is provided in the available space (in the order that the data 
  3973.     would appear).  If the amount of returned data does not fill the memory 
  3974.     area provided by the caller, the unaltered memory is set at 0. The buffer 
  3975.     format for the returned information is: 
  3976.  
  3977.     Byte      Description 
  3978.     0         Sort weight of ASCII (0) 
  3979.     1         Sort weight of ASCII (1) 
  3980.     . 
  3981.     . 
  3982.     . 
  3983.     255       Sort weight of ASCII (255) 
  3984.  
  3985.  DataLength (PUSHORT) - output 
  3986.     Address of the length, in bytes, of the collate table. 
  3987.  
  3988.  rc (USHORT) - return 
  3989.     Return code descriptions are: 
  3990.  
  3991.     0         NO_ERROR 
  3992.     396       ERROR_NLS_NO_COUNTRY_FILE 
  3993.     397       ERROR_NLS_OPEN_FAILED 
  3994.     398       ERROR_NO_COUNTRY_OR_CODEPAGE 
  3995.     399       ERROR_NLS_TABLE_TRUNCATED 
  3996.  
  3997.  Remarks 
  3998.  
  3999.  The returned country-dependent information can be for the default country and 
  4000.  current process code page or for a specific country and code page. For more 
  4001.  information see DosSetCp. 
  4002.  
  4003.  
  4004. ΓòÉΓòÉΓòÉ 1.52. DosGetCp ΓòÉΓòÉΓòÉ
  4005.  
  4006.                                Bindings:  C, MASM
  4007.  
  4008. This call allows a process to query the current process code page and the 
  4009. prepared system code pages. 
  4010.  
  4011.  DosGetCp    (Length, CodePageList, DataLength) 
  4012.  
  4013.  Length (USHORT) - input 
  4014.     Length, in bytes, of CodePageList.  This length should be at least 2 bytes. 
  4015.     If the length is less than the bytes needed to return all the prepared 
  4016.     system code pages than the returned CodePageList is truncated. 
  4017.  
  4018.  CodePageList (PUSHORT) - output 
  4019.     Address of the list of available system code pages. The format of the 
  4020.     information returned in this list is: 
  4021.  
  4022.     Word      Description 
  4023.     1         Current code page identifier 
  4024.     2         The first prepared code page 
  4025.     3         The second prepared code page 
  4026.     N         Other prepared system code pages. 
  4027.  
  4028.  DataLength (PUSHORT) - output 
  4029.     Address of the length, in bytes, of the returned data. 
  4030.  
  4031.  rc (USHORT) - return 
  4032.     Return code descriptions are: 
  4033.  
  4034.     0         NO_ERROR 
  4035.     473       ERROR_CPLIST_TOO_SMALL 
  4036.  
  4037.  Remarks 
  4038.  
  4039.  If the process code page identifier was previously set by DosSetCp or 
  4040.  inherited by a process, it is returned to the caller. 
  4041.  
  4042.  An input list size (length) of two bytes returns only the current process code 
  4043.  page identifier.  If CodePageList length is too small to hold all the 
  4044.  available information, then as much information as possible is provided in the 
  4045.  available space and ERROR_CPLIST_TOO_SMALL is returned. 
  4046.  
  4047.  If no codepages were prepared with the CODEPAGE command, a length of two and 
  4048.  current codepage identifier value of zero is returned. 
  4049.  
  4050.  
  4051.  Family API Considerations 
  4052.  
  4053.  Some options operate differently in the DOS mode than in OS/2 mode. 
  4054.  Therefore, the following restriction applies to DosGetCp when coding for the 
  4055.  DOS mode: 
  4056.  
  4057.  The current process code page, and no more than one prepared system code page, 
  4058.  is returned. 
  4059.  
  4060.  
  4061. ΓòÉΓòÉΓòÉ 1.53. DosGetCtryInfo ΓòÉΓòÉΓòÉ
  4062.  
  4063.                                Bindings:  C, MASM
  4064.  
  4065. This call obtains country-dependent formatting information that resides in the 
  4066. country information file. 
  4067.  
  4068.  DosGetCtryInfo     (Length, Country, MemoryBuffer, DataLength) 
  4069.  
  4070.  Length (USHORT) - input 
  4071.     Length, in bytes, of the data area (MemoryBuffer). This length should be at 
  4072.     least 38 bytes. 
  4073.  
  4074.  Country (PCOUNTRYCODE) - input 
  4075.     Address of the country information structure: 
  4076.  
  4077.     country (USHORT) 
  4078.        Country code identifier; 0 is the default country code. 
  4079.  
  4080.     codepage (USHORT) 
  4081.        Code page identifier; 0 is the code page of the current process. 
  4082.  
  4083.  MemoryBuffer (PCOUNTRYINFO) - output 
  4084.     Address of the buffer where the country-dependent data is returned. The 
  4085.     application must request enough space in memory, a minimum of 38 bytes, to 
  4086.     hold the returned data. If the requested space is not large enough, the 
  4087.     system fills the allocated space with as much data as it can hold. If the 
  4088.     requested space is too large, the extra memory requested is set to 0. The 
  4089.     data is returned in the buffer in the following format: 
  4090.  
  4091.     country (USHORT) 
  4092.        Country code identifier. 
  4093.  
  4094.     codepage (USHORT) 
  4095.        Code page identifier. 
  4096.  
  4097.     dateformat (USHORT) 
  4098.        Date format. 
  4099.  
  4100.        Value     Definition 
  4101.        0         mm/dd/yy 
  4102.        1         dd/mm/yy 
  4103.        2         yy/mm/dd 
  4104.  
  4105.     currency (CHAR) 
  4106.        Currency identifier, terminated with a null. 
  4107.  
  4108.     thousandsep (CHAR) 
  4109.        Thousands separator, terminated with a null. 
  4110.  
  4111.     decimalsep (CHAR) 
  4112.        Decimal separator, terminated with a null. 
  4113.  
  4114.     datesep (CHAR) 
  4115.        Date separator, terminated with a null. 
  4116.  
  4117.     timesep (CHAR) 
  4118.        Time separator, terminated with a null. 
  4119.  
  4120.     currencyformat (UCHAR) 
  4121.        The currency bit fields in the following format: 
  4122.  
  4123.        Bit       Description 
  4124.  
  4125.        7-3       Reserved 
  4126.  
  4127.        2         0 = Bits 0 and 1 are used. 
  4128.  
  4129.                  1 = Bits 0 and 1 are ignored; the currency indicator replaces 
  4130.                  the decimal indicator. 
  4131.  
  4132.        1         0 = No space between the currency indicator and money value. 
  4133.  
  4134.                  1 = One space between the currency indicator and money value. 
  4135.  
  4136.        0         0 = Currency indicator precedes the money value. 
  4137.  
  4138.                  1 = Currency indicator follows the money value. 
  4139.  
  4140.     decimalspace (UCHAR) 
  4141.        Number (in binary) of decimal spaces used to indicate currency value. 
  4142.  
  4143.     timeformat (UCHAR) 
  4144.        Time format for presentation in file directory: 
  4145.  
  4146.        Bit       Description 
  4147.  
  4148.        7-1       Reserved 
  4149.  
  4150.        0         0 = 12-hour format 
  4151.  
  4152.                  1 = 24-hour format. 
  4153.  
  4154.     reserved (USHORT) 
  4155.        Reserved, set to zero. 
  4156.  
  4157.     datalistsep (CHAR) 
  4158.        Data list separator, terminated with a null. 
  4159.  
  4160.     reserved (USHORT) 
  4161.        Reserved, set to zero. 
  4162.  
  4163.  DataLength (PUSHORT) - output 
  4164.     Address of the length, in bytes, of the country dependent information. 
  4165.  
  4166.  rc (USHORT) - return 
  4167.     Return code descriptions are: 
  4168.  
  4169.     0         NO_ERROR 
  4170.     396       ERROR_NLS_NO_COUNTRY_FILE 
  4171.     397       ERROR_NLS_OPEN_FAILED 
  4172.     398       ERROR_NO_COUNTRY_OR_CODEPAGE 
  4173.     399       ERROR_NLS_TABLE_TRUNCATED 
  4174.  
  4175.  Remarks 
  4176.  
  4177.  The returned country dependent information may be for the default country and 
  4178.  current process code page, or for a specific country and code page. For more 
  4179.  information on code page, see DosSetCp. 
  4180.  
  4181.  
  4182.  Family API Considerations 
  4183.  
  4184.  Some options operate differently in DOS mode than in OS/2 mode. Note that not 
  4185.  all country information is available in DOS 3.3. 
  4186.  
  4187.  
  4188. ΓòÉΓòÉΓòÉ 1.54. DosGetDateTime ΓòÉΓòÉΓòÉ
  4189.  
  4190.                                Bindings:  C, MASM
  4191.  
  4192. This call gets the current date and time maintained by the operating system. 
  4193.  
  4194.  DosGetDateTime     (DateTime) 
  4195.  
  4196.  DateTime (PDATETIME) - output 
  4197.     Address of the date and time structure: 
  4198.  
  4199.     hours (UCHAR) 
  4200.        Current hour. 
  4201.  
  4202.     minutes (UCHAR) 
  4203.        Current minute. 
  4204.  
  4205.     seconds (UCHAR) 
  4206.        Current second. 
  4207.  
  4208.     hundredths (UCHAR) 
  4209.        Current hundredth of a second. 
  4210.  
  4211.     day (UCHAR) 
  4212.        Current day. 
  4213.  
  4214.     month (UCHAR) 
  4215.        Current month. 
  4216.  
  4217.     year (USHORT) 
  4218.        Current year. 
  4219.  
  4220.     timezone (SHORT) 
  4221.        Minutes west of UTC (Universal Time Coordinate). 
  4222.  
  4223.     weekday (UCHAR) 
  4224.        Current day of the week. Sunday is 0. 
  4225.  
  4226.  rc (USHORT) - return 
  4227.     Return code description is: 
  4228.  
  4229.     0         NO_ERROR 
  4230.  
  4231.  Remarks 
  4232.  
  4233.  The dayofweek value is based on Sunday equal to zero.  The value of timezone 
  4234.  is the difference in minutes between the current time zone and UTC.  This 
  4235.  number is positive if it is earlier than UTC and negative if it is later than 
  4236.  UTC.  For Eastern Standard Time, this value is 300 (5 hours earlier than UTC). 
  4237.  
  4238.  If the application is executing in the OS/2 environment, it is more efficient 
  4239.  to obtain these variables by calling DosGetInfoSeg instead of this function. 
  4240.  However, applications written to the family API cannot depend on the 
  4241.  availability of DosGetInfoSeg. 
  4242.  
  4243.  
  4244. ΓòÉΓòÉΓòÉ 1.55. DosGetDBCSEv ΓòÉΓòÉΓòÉ
  4245.  
  4246.                                Bindings:  C, MASM
  4247.  
  4248. This call obtains a DBCS (double byte character set) environmental vector that 
  4249. resides in the country information file. 
  4250.  
  4251.  DosGetDBCSEv      (Length, Country, MemoryBuffer) 
  4252.  
  4253.  Length (USHORT) - input 
  4254.     Length, in bytes, of the data area (MemoryBuffer). This value should be at 
  4255.     least 10. 
  4256.  
  4257.  Country (PCOUNTRYCODE) - input 
  4258.     Address of the country information structure: 
  4259.  
  4260.     countrycode (USHORT) 
  4261.        Country code identifier. 0 is the default country code. 
  4262.  
  4263.     codepage (USHORT) 
  4264.        Code page identifier. 0 is the code page of the current process. 
  4265.  
  4266.  MemoryBuffer (PCHAR) - output 
  4267.     Address of the country dependent information for the DBCS environmental 
  4268.     vector.  This memory area is provided by the caller. The size of the area 
  4269.     is provided by the input parameter Length. If it is too small to hold all 
  4270.     the available information, then as much information as possible is provided 
  4271.     in the available space. The format of the information returned in this 
  4272.     buffer is: 
  4273.  
  4274.     Word      Description 
  4275.  
  4276.     1         First range definition for DBCS lead byte values 
  4277.  
  4278.               High byte   Binary start value (inclusive) for range one 
  4279.  
  4280.               Low byte    Binary stop value (inclusive) for range one. 
  4281.  
  4282.     2         Second range definition 
  4283.  
  4284.               High byte   Binary start value for range two 
  4285.  
  4286.               Low byte    Binary stop value for range two. 
  4287.  
  4288.     N         Nth range definition 
  4289.  
  4290.               High byte   Binary start value for Nth range 
  4291.  
  4292.               Low byte    Binary stop value for Nth range. 
  4293.  
  4294.     N + 1     Two bytes of binary 0 terminate list. 
  4295.  
  4296.     For example: 
  4297.  
  4298.           DB  81H,9FH
  4299.           DB  E0H,FCH
  4300.           DB  00H,00H
  4301.  
  4302.  rc (USHORT) - return 
  4303.     Return code descriptions are: 
  4304.  
  4305.     0         NO_ERROR 
  4306.     396       ERROR_NLS_NO_COUNTRY_FILE 
  4307.     397       ERROR_NLS_OPEN_FAILED 
  4308.     398       ERROR_NO_COUNTRY_OR_CODEPAGE 
  4309.     399       ERROR_NLS_TABLE_TRUNCATED 
  4310.  
  4311.  Remarks 
  4312.  
  4313.  The returned DBCS environmental vector may be for the default country and 
  4314.  current process code page or for a specific country and code page.  For more 
  4315.  information on code page see DosSetCp. 
  4316.  
  4317.  
  4318. ΓòÉΓòÉΓòÉ 1.56. DosGetEnv ΓòÉΓòÉΓòÉ
  4319.  
  4320.                                Bindings:  C, MASM
  4321.  
  4322. This call returns the address of the process environment string for the current 
  4323. process. 
  4324.  
  4325.  DosGetEnv    (EnvSegment, CmdOffset) 
  4326.  
  4327.  EnvSegment (PSEL) - output 
  4328.     Address of the selector for the environment segment. 
  4329.  
  4330.  CmdOffset (PUSHORT) - output 
  4331.     Address of the offset to the command line within the environment segment. 
  4332.  
  4333.  rc (USHORT) - return 
  4334.     Return code descriptions are: 
  4335.  
  4336.     0         NO_ERROR 
  4337.     12        ERROR_INVALID_ACCESS 
  4338.  
  4339.  Remarks 
  4340.  
  4341.  DosGetEnv can be used by dynamic link library routines that need to determine 
  4342.  the environment for the current process. 
  4343.  
  4344.  When a process issues DosExecPgm to start another process, the program that 
  4345.  receives control is returned a pointer to the environment segment. 
  4346.  
  4347.  
  4348. ΓòÉΓòÉΓòÉ 1.57. DosGetHugeShift ΓòÉΓòÉΓòÉ
  4349.  
  4350.                                Bindings:  C, MASM
  4351.  
  4352. This call returns a shift count used to derive the selectors that address 
  4353. memory allocated with DosAllocHuge. 
  4354.  
  4355.  DosGetHugeShift     (ShiftCount) 
  4356.  
  4357.  ShiftCount (PUSHORT) - output 
  4358.     Address of the shift count. 
  4359.  
  4360.  rc (USHORT) - return 
  4361.     Return code description is: 
  4362.  
  4363.     0         NO_ERROR 
  4364.  
  4365.  Remarks 
  4366.  
  4367.  Each segment of a huge memory allocation has a unique selector. To compute the 
  4368.  next sequential selector in a huge memory area, take the value 1, shift it 
  4369.  left by the number of bits specified in shift count. Use the resulting value 
  4370.  as an increment to add to the previous selector (using the selector returned 
  4371.  by DosAllocHuge as the first selector). For example: 
  4372.  
  4373.  o Assume DosAllocHuge is issued with NumSeg equal to 3, and that the number 63 
  4374.    is returned for the selector of the first segment. 
  4375.  o If DosGetHugeShift returns a shift count of 4, shifting the value "1" by 
  4376.    this amount results in an increment of 16. 
  4377.  o Adding this increment to selector number 63 produces 79 for the second 
  4378.    selector. Adding the same increment to selector number 79 yields 95 for the 
  4379.    third selector. 
  4380.  
  4381.  
  4382. ΓòÉΓòÉΓòÉ 1.58. DosGetInfoSeg ΓòÉΓòÉΓòÉ
  4383.  
  4384.                                Bindings:  C, MASM
  4385.  
  4386. This call returns the address of a global and local information segment, 
  4387. specific to a process. 
  4388.  
  4389.  DosGetInfoSeg     (GlobalSeg, LocalSeg) 
  4390.  
  4391.  GlobalSeg (PSEL) - output 
  4392.     Address of the global information segment structure, as defined below: 
  4393.  
  4394.     time (ULONG) 
  4395.        Time in seconds since 1/1/1970. 
  4396.  
  4397.     millisecs (ULONG) 
  4398.        Time in milliseconds. 
  4399.  
  4400.     hours (UCHAR) 
  4401.        Current hour. 
  4402.  
  4403.     minute (UCHAR) 
  4404.        Current minute. 
  4405.  
  4406.     seconds (UCHAR) 
  4407.        Current second. 
  4408.  
  4409.     hundredsec (UCHAR) 
  4410.        Current hundredth of a second. 
  4411.  
  4412.     timezone (USHORT) 
  4413.        Minutes from UTC; if hex FFFFH, timezone is undefined. 
  4414.  
  4415.     interval (USHORT) 
  4416.        Timer interval in tenths of milliseconds. 
  4417.  
  4418.     day (UCHAR) 
  4419.        Day. 
  4420.  
  4421.     month (UCHAR) 
  4422.        Month. 
  4423.  
  4424.     year (USHORT) 
  4425.        Year. 
  4426.  
  4427.     weekday (UCHAR) 
  4428.        Day-of-week: 
  4429.  
  4430.        Value     Definition 
  4431.        0         Sunday 
  4432.        1         Monday 
  4433.        2         Tuesday 
  4434.        3         Wednesday 
  4435.        4         Thursday 
  4436.        5         Friday 
  4437.        6         Saturday 
  4438.  
  4439.     majorversion (UCHAR) 
  4440.        Major version number. 
  4441.  
  4442.     minorversion (UCHAR) 
  4443.        Minor version number. 
  4444.  
  4445.     revision (UCHAR) 
  4446.        Revision letter. 
  4447.  
  4448.     currentsession (UCHAR) 
  4449.        Current foreground full-screen session. 
  4450.  
  4451.     maxnumsessions (UCHAR) 
  4452.        Maximum number of full-screen sessions. 
  4453.  
  4454.     hugeshift (UCHAR) 
  4455.        Shift count for huge segments. 
  4456.  
  4457.     protmodeind (UCHAR) 
  4458.        Protect-mode-only indicator: 
  4459.  
  4460.        Value     Definition 
  4461.        0         DOS mode and OS/2 mode. 
  4462.        1         OS/2 mode only. 
  4463.  
  4464.     lastprocess (USHORT) 
  4465.        Process ID of the current foreground process. 
  4466.  
  4467.     dynvarflag (UCHAR) 
  4468.        Dynamic variation flag: 
  4469.  
  4470.        Value     Definition 
  4471.        0         Absolute 
  4472.        1         Enabled. 
  4473.  
  4474.     maxwait (UCHAR) 
  4475.        Maximum wait in seconds. 
  4476.  
  4477.     mintimeslice (USHORT) 
  4478.        Minimum timeslice in milliseconds. 
  4479.  
  4480.     maxtimeslice (USHORT) 
  4481.        Maximum timeslice in milliseconds. 
  4482.  
  4483.     bootdrive (USHORT) 
  4484.        Drive from which the system was booted: 
  4485.  
  4486.        Value     Definition 
  4487.        1         Drive A. 
  4488.        2         Drive B. 
  4489.        . 
  4490.        . 
  4491.        . 
  4492.        n         Drive n. 
  4493.  
  4494.     traceflags (UCHAR) 
  4495.        32 system trace major code flags. Each bit corresponds to a trace major 
  4496.        code, hex 00-FFH. The most significant bit (left-most) of the first byte 
  4497.        corresponds to major code hex 00H. 
  4498.  
  4499.        Value     Definition 
  4500.        0         Trace disabled. 
  4501.        1         Trace enabled. 
  4502.  
  4503.     maxtextsessions (UCHAR) 
  4504.        Maximum number of VIO windowable sessions. 
  4505.  
  4506.     maxpmsessions (UCHAR) 
  4507.        Maximum number of Presentation Manager sessions. 
  4508.  
  4509.  LocalSeg (PSEL) - output 
  4510.     Address of the selector for the local information segment structure, as 
  4511.     defined below: 
  4512.  
  4513.     processid (PID) 
  4514.        Current process ID. 
  4515.  
  4516.     parentprocessid (PID) 
  4517.        Parent process ID. 
  4518.  
  4519.     threadprty (USHORT) 
  4520.        Priority of current thread. 
  4521.  
  4522.     threadid (TID) 
  4523.        Current thread ID. 
  4524.  
  4525.     sessionid (USHORT) 
  4526.        Current session ID. 
  4527.  
  4528.     procstatus (UCHAR) 
  4529.        Process status. 
  4530.  
  4531.     unused (UCHAR) 
  4532.        Unused. 
  4533.  
  4534.     foregroundprocess (BOOL) 
  4535.        Current process is in foreground (has keyboard focus). Value -1 implies 
  4536.        yes, 
  4537.        0 implies no. 
  4538.  
  4539.     typeProcess (UCHAR) 
  4540.        Type of process: 
  4541.  
  4542.        Value     Definition 
  4543.        0         Full screen protect mode session. 
  4544.        1         Requires real mode. 
  4545.        2         VIO windowable protect mode session. 
  4546.        3         Presentation Manager protect mode session. 
  4547.        4         Detached protect mode process. 
  4548.  
  4549.     unused (UCHAR) 
  4550.        Unused. 
  4551.  
  4552.     environmentsel (SEL) 
  4553.        Environment selector. 
  4554.  
  4555.     cmdlineoff (USHORT) 
  4556.        Command line offset in the segment addressed by environmentsel. 
  4557.  
  4558.     dataseglen (USHORT) 
  4559.        Length of data segment in bytes. 
  4560.  
  4561.     stacksize (USHORT) 
  4562.        Stack size in bytes. 
  4563.  
  4564.     heapsize (USHORT) 
  4565.        Heap size in bytes. 
  4566.  
  4567.     hmodule (HMODULE) 
  4568.        Module handle. 
  4569.  
  4570.     dssel (SEL) 
  4571.        Data segment selector. 
  4572.  
  4573.  rc (USHORT) - return 
  4574.     Return code description is: 
  4575.  
  4576.     0         NO_ERROR 
  4577.  
  4578.  Remarks 
  4579.  
  4580.  Items of general interest are kept in the global information segment. Items of 
  4581.  information specific to a particular process are kept in the local information 
  4582.  segment.  This information can be directly read  by the application program. 
  4583.  Both of these segments are defined as read-only segments.  The application 
  4584.  program cannot modify this data. 
  4585.  
  4586.  Assuming n1, n2, and n3 are the maximum number of full-screen sessions, 
  4587.  VIO-windowable sessions, and Presentation Manager sessions, the first 0 
  4588.  through (n1-1) session numbers are assigned to full-screen sessions.  The next 
  4589.  n2 session numbers are assigned to VIO-windowable sessions, and the next n3 
  4590.  session numbers are assigned to Presentation Manager sessions. Session numbers 
  4591.  in the range (n1+n2+n3) through 255 are reserved.  Applications should use 
  4592.  (n1+n2+n3-1) as an upper boundary. Applications should not assume that all 
  4593.  session numbers starting with (n1+n2) and higher are Presentation Manager 
  4594.  sessions. 
  4595.  
  4596.  The application program must be careful when referencing the date or time 
  4597.  fields in the global information segment.  A timer interrupt can be received 
  4598.  by the system in between the instructions that read the individual fields, 
  4599.  changing the data in these fields. For example, if the time is currently 
  4600.  23:59:59 on Tuesday, 6/2/87, the program can read the hours field (23). A 
  4601.  timer interrupt can now be received, changing the time to 00:00:00 on 
  4602.  Wednesday, 6/3/87.  The program reads the rest of the time field (0 minutes) 
  4603.  and the date field.  The program would then think the current time and date is 
  4604.  23:00:00 on Wednesday, 6/3/87, which is incorrect. 
  4605.  
  4606.  The application program should read all time and date fields it uses as 
  4607.  quickly as possible.  It can then compare the least significant time field it 
  4608.  uses (milliseconds, hundredths, seconds, or minutes) against the current value 
  4609.  in the global information segment.  If the value has not changed, the rest of 
  4610.  the information is valid.  If the value has changed, the program time or date 
  4611.  information should be read again, as the information is updated while the 
  4612.  program reads it. 
  4613.  
  4614.  
  4615. ΓòÉΓòÉΓòÉ 1.59. DosGetMachineMode ΓòÉΓòÉΓòÉ
  4616.  
  4617.                                Bindings:  C, MASM
  4618.  
  4619. This call returns the current mode of the processor, whether the processor is 
  4620. running in the DOS mode or the OS/2 mode. This allows an application to 
  4621. determine whether a dynamic link call is valid or not. 
  4622.  
  4623.  DosGetMachineMode      (MachineMode) 
  4624.  
  4625.  MachineMode (PBYTE) - output 
  4626.     Address of the value to indicate the current processor mode. This value may 
  4627.     be: 
  4628.  
  4629.     Value     Definition 
  4630.     0         DOS mode 
  4631.     1         OS/2 mode. 
  4632.  
  4633.  rc (USHORT) - return 
  4634.     Return code description is: 
  4635.  
  4636.     0         NO_ERROR 
  4637.  
  4638.  Remarks 
  4639.  
  4640.  All dynamic link calls are available to an application if the MachineMode 
  4641.  value indicates the program is in OS/2 mode. This method provides a 
  4642.  self-tailoring application that allows the application to adapt to the 
  4643.  execution environment by limiting or enhancing the functions it provides. 
  4644.  
  4645.  If the MachineMode value indicates the program is in DOS mode, the application 
  4646.  is limited to a subset of dynamic link calls listed in the Family API. 
  4647.  
  4648.  
  4649. ΓòÉΓòÉΓòÉ 1.60. DosGetMessage ΓòÉΓòÉΓòÉ
  4650.  
  4651.                                Bindings:  C, MASM
  4652.  
  4653. This call retrieves a message from a message file and inserts variable 
  4654. information into the body of the message. 
  4655.  
  4656.  DosGetMessage     (IvTable, IvCount, DataArea, DataLength, MsgNumber, 
  4657.                    FileName, MsgLength) 
  4658.  
  4659.  IvTable (PCHAR FAR *) - input 
  4660.     Address of a list of double-word pointers.  Each pointer points to an 
  4661.     ASCIIZ or null-terminated DBCS string (variable insertion text).  0 to 9 
  4662.     strings can be present. 
  4663.  
  4664.  IvCount (USHORT) - input 
  4665.     Count of variable insertion text strings is 0-9. If IvCount is 0, IvTable 
  4666.     is ignored. 
  4667.  
  4668.  DataArea (PCHAR) - output 
  4669.     Address of the requested message. If the message is too long to fit in the 
  4670.     caller's buffer, as much of the message text is returned as possible, with 
  4671.     the appropriate error return code. 
  4672.  
  4673.  DataLength (USHORT) - input 
  4674.     Length, in bytes, of the user's storage area. 
  4675.  
  4676.  MsgNumber (USHORT) - input 
  4677.     Requested message number. 
  4678.  
  4679.  FileName (PSZ) - input 
  4680.     Address of the optional drive, path, and filename of the file where the 
  4681.     message can be found.  If messages are bound to the .EXE file using MSGBIND 
  4682.     utility, then filename is the name of the message file from which the 
  4683.     messages are extracted. 
  4684.  
  4685.  MsgLength (PUSHORT) - output 
  4686.     Address of the length, in bytes, of the message. 
  4687.  
  4688.  rc (USHORT) - return 
  4689.     Return code descriptions are: 
  4690.  
  4691.     0         NO_ERROR 
  4692.     2         ERROR_FILE_NOT_FOUND 
  4693.     206       ERROR_FILENAME_EXCED_RANGE 
  4694.     316       ERROR_MR_MSG_TOO_LONG 
  4695.     317       ERROR_MR_MID_NOT_FOUND 
  4696.     318       ERROR_MR_UN_ACC_MSGF 
  4697.     319       ERROR_MR_INV_MSFG_FORMAT 
  4698.     320       ERROR_MR_INV_IVCOUNT 
  4699.     321       ERROR_MR_UN_PERFORM 
  4700.  
  4701.  Remarks 
  4702.  
  4703.  If IvCount is greater than 9, DosGetMessage returns an error that indicates 
  4704.  IvCount is out of range.  If the numeric value of x in the %x sequence for 
  4705.  %1through%9 is less than or equal to IvCount, text insertion by substitution 
  4706.  for %x, is performed for all occurrences of %x in the message.  Otherwise text 
  4707.  insertion is ignored and the %x sequence is returned in the message unchanged. 
  4708.  Text insertion is performed for all text strings defined by IvCount and 
  4709.  IvTable. 
  4710.  
  4711.  Variable data insertion is not dependent on blank character delimiters nor are 
  4712.  blanks automatically inserted. 
  4713.  
  4714.  For warning and error messages, the message ID (seven alphanumeric characters 
  4715.  consisting of three upper case characters as the component ID, concatenated 
  4716.  with a four-digit message number) followed by a colon and a blank character 
  4717.  are returned to the caller as part of the message text. (DosGetMessage 
  4718.  determines the type of message based on the message classification generated 
  4719.  in the output file of the MKMSGF utility.) 
  4720.  
  4721.  The following is an example of a sample error message returned with the 
  4722.  message ID: 
  4723.  
  4724.      SYS0100: File not found
  4725.  
  4726.  DosGetMessage retrieves messages previously prepared by the utility MKMSGF to 
  4727.  create a message file, or MSGBIND to bind a message segment to an .EXE file. 
  4728.  DosGetMessage tries to retrieve the message from RAM in the message segment 
  4729.  bound to the .EXE program.  If the message cannot be found, DosGetMessage 
  4730.  retrieves the message from the message file on DASD (direct access storage 
  4731.  device, such as a diskette or fixed-disk). 
  4732.  
  4733.  If the file name is not a fully-qualified name, DosGetMessage searches the 
  4734.  following directories for default drive and path: 
  4735.  
  4736.  o The system root directory 
  4737.  o The current working directory 
  4738.  o Directories listed in the DPATH  statement (OS/2 mode only) 
  4739.  o Directories listed in the APPEND statement (DOS mode only). 
  4740.  
  4741.  If a message cannot be retrieved because of a DASD error or file not found 
  4742.  condition, a default message is placed in the user's buffer area. A message is 
  4743.  placed in the buffer area based on the following error conditions: 
  4744.  
  4745.  o The message number cannot be found in the message file. 
  4746.  o The message file cannot be found. 
  4747.  o The system detected a disk error trying to access the message file, or the 
  4748.    message file format is incorrect. 
  4749.  o IvCount is out of range. 
  4750.  o A system error occurred trying to allocate storage. 
  4751.  
  4752.  When these conditions occur, the default message allows the application 
  4753.  program to issue a message and prompt that enables recovery opportunity. 
  4754.  
  4755.  The residency of the message in RAM (EXE bound) or on DASD is transparent to 
  4756.  the caller and handled by DosGetMessage.  In either case the message is 
  4757.  referenced by message number and file name. 
  4758.  
  4759.  In order for DosGetMessage to be properly resolved, an application must be 
  4760.  linked with DOSCALLS.LIB. 
  4761.  
  4762.  
  4763.  Family API Considerations 
  4764.  
  4765.  Some options operate differently in the DOS mode than in OS/2 mode. 
  4766.  Therefore, the following restriction applies to DosGetMessage when coding for 
  4767.  the DOS mode: 
  4768.  
  4769.  If the message file name is not a fully qualified name, DosGetMessage searches 
  4770.  the root directory of the default drive for the message file, instead of the 
  4771.  root directory of the startup drive. 
  4772.  
  4773.  
  4774. ΓòÉΓòÉΓòÉ 1.61. DosGetModHandle ΓòÉΓòÉΓòÉ
  4775.  
  4776.                                Bindings:  C, MASM
  4777.  
  4778. This call returns a handle to a previously loaded dynamic link module. 
  4779.  
  4780.  DosGetModHandle     (ModuleName, ModuleHandle) 
  4781.  
  4782.  ModuleName (PSZ) - input 
  4783.     Address of the ASCIIZ name string containing the dynamic link module name 
  4784.     or the pathname string.  The filename extension used for dynamic link 
  4785.     libraries when a module name is provided is .DLL.  When a pathname is 
  4786.     provided, the module name may have any extension. 
  4787.  
  4788.  ModuleHandle (PHMODULE) - output 
  4789.     Address of the handle for the dynamic link module. 
  4790.  
  4791.  rc (USHORT) - return 
  4792.     Return code descriptions are: 
  4793.  
  4794.     0         NO_ERROR 
  4795.     95        ERROR_INTERRUPT 
  4796.     123       ERROR_INVALID_NAME 
  4797.     126       ERROR_MOD_NOT_FOUND 
  4798.  
  4799.  Remarks 
  4800.  
  4801.  If a module name is provided, it must match the name of a module residing in 
  4802.  the LIBPATH that is currently loaded.  Otherwise an error code is returned. 
  4803.  If a pathname is provided, the expanded pathname must match the full pathname 
  4804.  of a module that is currently loaded. 
  4805.  
  4806.  The handle returned by this call can be used with DosGetModName.  It should 
  4807.  not be used with DosGetProcAddr for access to the already loaded dynamic link 
  4808.  module.  Instead, DosLoadModule should be issued to ensure that the calling 
  4809.  process is attached to the module. 
  4810.  
  4811.  
  4812. ΓòÉΓòÉΓòÉ 1.62. DosGetModName ΓòÉΓòÉΓòÉ
  4813.  
  4814.                                Bindings:  C, MASM
  4815.  
  4816. This call returns the fully qualified drive, path, file name, and extension 
  4817. associated with a referenced module handle. 
  4818.  
  4819.  DosGetModName     (ModuleHandle, BufferLength, Buffer) 
  4820.  
  4821.  ModuleHandle (HMODULE) - input 
  4822.     Handle of the dynamic link module being referenced. 
  4823.  
  4824.  BufferLength (USHORT) - input 
  4825.     Maximum length of the buffer, in bytes, where the name is stored. 
  4826.  
  4827.  Buffer (PCHAR) - output 
  4828.     Address of the buffer where the fully qualified drive, path, filename, and 
  4829.     extension of the dynamic link module are stored. 
  4830.  
  4831.  rc (USHORT) - return 
  4832.     Return code descriptions are: 
  4833.  
  4834.     0         NO_ERROR 
  4835.     6         ERROR_INVALID_HANDLE 
  4836.     24        ERROR_BAD_LENGTH 
  4837.     95        ERROR_INTERRUPT 
  4838.  
  4839.  Remarks 
  4840.  
  4841.  The handle returned by either a DosGetModHandle or a  DosLoadModule request 
  4842.  can be used with this call. An error is returned if the buffer is not large 
  4843.  enough for the module name. 
  4844.  
  4845.  
  4846. ΓòÉΓòÉΓòÉ 1.63. DosGetPID ΓòÉΓòÉΓòÉ
  4847.  
  4848.                                Bindings:  C, MASM
  4849.  
  4850. This call returns the current process ID, thread ID, and the process ID of the 
  4851. parent process. 
  4852.  
  4853.  DosGetPID     (ProcessIDs) 
  4854.  
  4855.  ProcessIDs (PPIDINFO) - output 
  4856.     Address of the structure where the ID information is returned. 
  4857.  
  4858.     pid (PID) 
  4859.        Current process identifier. 
  4860.  
  4861.     tid (TID) 
  4862.        Thread (of the current process) identifier. 
  4863.  
  4864.     pidParent (PID) 
  4865.        Parent process (of the current process) identifier. 
  4866.  
  4867.  rc (USHORT) - return 
  4868.     Return code description is: 
  4869.  
  4870.     0         NO_ERROR 
  4871.  
  4872.  Remarks 
  4873.  
  4874.  The process ID may be used to generate uniquely named temporary files, or for 
  4875.  communication with signals. For more information on signals, see 
  4876.  DosFlagProcess and  DosSendSignal. 
  4877.  
  4878.  In the OS/2 environment, thread IDs are used with calls that manipulate 
  4879.  threads in the current process.  For more information, see DosSuspendThread, 
  4880.  DosResumeThread, DosGetPrty, and DosSetPrty. 
  4881.  
  4882.  If the application is executing in the OS/2 environment, it is more efficient 
  4883.  to obtain these variables by calling DosGetInfoSeg instead of DosGetPID. 
  4884.  However, applications written to the family API cannot depend on the 
  4885.  availability of DosGetInfoSeg. 
  4886.  
  4887.  To get an ID for a process other than the current process or its parent 
  4888.  process, issue DosGetPPID. 
  4889.  
  4890.  
  4891. ΓòÉΓòÉΓòÉ 1.64. DosGetPPID ΓòÉΓòÉΓòÉ
  4892.  
  4893.                                Bindings:  C, MASM
  4894.  
  4895. This call allows the caller to obtain the parent process ID for any process. 
  4896.  
  4897.  DosGetPPID     (PID, PPID) 
  4898.  
  4899.  PID (USHORT) - input 
  4900.     The process ID of the process to find the parent PID. 
  4901.  
  4902.  PPID (PUSHORT) - output 
  4903.     Address of a word where the process ID of the parent of the indicated 
  4904.     process is placed. 
  4905.  
  4906.  rc (USHORT) - return 
  4907.     Return code descriptions are: 
  4908.  
  4909.     0         NO_ERROR 
  4910.     303       ERROR_INVALID_PROCID 
  4911.  
  4912.  
  4913. ΓòÉΓòÉΓòÉ 1.65. DosGetProcAddr ΓòÉΓòÉΓòÉ
  4914.  
  4915.                                Bindings:  C, MASM
  4916.  
  4917. This call returns a far address to a desired procedure within a dynamic link 
  4918. module. 
  4919.  
  4920.  DosGetProcAddr     (ModuleHandle, ProcName, ProcAddress) 
  4921.  
  4922.  ModuleHandle (HMODULE) - input 
  4923.     Handle of the dynamic link module. 
  4924.  
  4925.  ProcName (PSZ) - input 
  4926.     Address of a name string that contains the referenced procedure name. 
  4927.  
  4928.     Alternatively, if the selector portion of the pointer is null, the offset 
  4929.     portion of the pointer is an explicit entry number (ordinal) within the 
  4930.     dynamic link module. 
  4931.  
  4932.     DosGetProcAddr for entries within the DOSCALLS module are only supported 
  4933.     for ordinal references.  References to the DOSCALLS module by name strings 
  4934.     are not supported and return an error.  Dynamic link ordinal numbers for 
  4935.     DOSCALLS routines are resolved by linking with DOSCALLS.LIB. 
  4936.  
  4937.  ProcAddress (PFN FAR *) - output 
  4938.     Procedure address. 
  4939.  
  4940.  rc (USHORT) - return 
  4941.     Return code descriptions are: 
  4942.  
  4943.     0         NO_ERROR 
  4944.     6         ERROR_INVALID_HANDLE 
  4945.     95        ERROR_INTERRUPT 
  4946.     127       ERROR_PROC_NOT_FOUND 
  4947.  
  4948.  Remarks 
  4949.  
  4950.  A 32-bit address, consisting of a selector and offset, is returned for a 
  4951.  specified procedure. 
  4952.  
  4953.  To free the dynamic link module, issue DosFreeModule. After DosFreeModule is 
  4954.  issued, procedure entry addresses returned for this handle or no longer valid. 
  4955.  
  4956.  Other run-time dynamic link calls are DosLoadModule, DosGetModName, and 
  4957.  DosGetModHandle. 
  4958.  
  4959.  
  4960. ΓòÉΓòÉΓòÉ 1.66. DosGetPrty ΓòÉΓòÉΓòÉ
  4961.  
  4962.                                Bindings:  C, MASM
  4963.  
  4964. This call gets the priority of the initial thread of execution for any process, 
  4965. or any thread in the current process. 
  4966.  
  4967.  DosGetPrty    (Scope, Priority, ID) 
  4968.  
  4969.  Scope (USHORT) - input 
  4970.     Scope of priority request. Used to define the scope of the request. 
  4971.  
  4972.     Value     Definition 
  4973.     0         Thread 1 (the initial thread of execution) of the indicated 
  4974.               process. 
  4975.     2         Any thread of the current process. 
  4976.  
  4977.  Priority (PUSHORT) - output 
  4978.     Address of the base priority of the thread identified by ID. The high-order 
  4979.     byte of this word is set equal to the priority class.  The low-order byte 
  4980.     is set equal to the priority level. 
  4981.  
  4982.  ID (USHORT) - input 
  4983.     A process ID (scope = 0) or a thread ID (scope = 2).  If this operand is 
  4984.     equal to 0, the current process or thread is assumed. 
  4985.  
  4986.  rc (USHORT) - return 
  4987.     Return code descriptions are: 
  4988.  
  4989.     0         NO_ERROR 
  4990.     303       ERROR_INVALID_PROCID 
  4991.     308       ERROR_INVALID_SCOPE 
  4992.     309       ERROR_INVALID_THREADID 
  4993.  
  4994.  Remarks 
  4995.  
  4996.  If scope = 0 (process) the priority of the first thread of a process is 
  4997.  returned.  If that thread has terminated, the ERROR_INVALID_THREAD_ID error 
  4998.  code is returned. 
  4999.  
  5000.  A thread's priority is changed by issuing DosSetPrty.  A process can change 
  5001.  the priority of all the threads of any process whose process ID is known to 
  5002.  the thread. It can also change the priority of another thread in its process, 
  5003.  or all the threads of the current or a child process, as well as all its 
  5004.  descendants. 
  5005.  
  5006.  DosGetPID and DosGetPPID are useful for obtaining process and thread IDs. 
  5007.  DosGetPID gets the ID of the current thread, the process ID of its current 
  5008.  process, or the process ID of the parent process of the current process. 
  5009.  DosGetPPID gets the parent process ID of any specified process. 
  5010.  
  5011.  
  5012. ΓòÉΓòÉΓòÉ 1.67. DosGetResource ΓòÉΓòÉΓòÉ
  5013.  
  5014.                                Bindings:  C, MASM
  5015.  
  5016. This call returns the segment selector of the specified resource segment. 
  5017.  
  5018.  DosGetResource    (ModHandle, TypeID, NameID, Selector) 
  5019.  
  5020.  ModHandle (HMODULE) - input 
  5021.     The location of the resource segment. 
  5022.  
  5023.     Value     Definition 
  5024.        0      The executable file of the current process. 
  5025.     <> 0      A handle to a dynamic link module returned by DosLoadModule. 
  5026.  
  5027.  TypeID (USHORT) - input 
  5028.     A 16 bit resource type ID (see Remarks). 
  5029.  
  5030.  NameID (USHORT) - input 
  5031.     A 16 bit resource name ID (see Remarks). 
  5032.  
  5033.  Selector (PSEL) - output 
  5034.     The address of a word where the resource segment selector is returned. 
  5035.  
  5036.  rc (USHORT) - return 
  5037.     Return code descriptions are: 
  5038.  
  5039.     0         NO_ERROR 
  5040.     6         ERROR_INVALID_HANDLE 
  5041.  
  5042.  Remarks 
  5043.  
  5044.  Resource segments are read-only data segments that can be accessed dynamically 
  5045.  at run time.  The access key consists of two 16-bit numbers, the first of 
  5046.  which is a type ID and the second, a name ID. These numbers are similar in 
  5047.  concept to the file extension and file name portions of a file name. 
  5048.  
  5049.  The advantage of resource segments is that they can be bundled into an 
  5050.  application's executable file, so a single file contains all of the code and 
  5051.  data for an application. 
  5052.  
  5053.  It is recommended that resource segments obtained through DosGetResource only 
  5054.  be freed using DosFreeSeg. 
  5055.  
  5056.  OS/2 Version 1.2 added two new functions, DosGetResource2 and 
  5057.  DosFreeResource, to load and free an application specific resource. 
  5058.  DosGetResource2 returns a far pointer to a resource rather than the selector 
  5059.  returned via DosGetResource. It is recommended that applications targeted for 
  5060.  OS/2 1.2 use DosGetResource2 and DosFreeResource.  Applications that wish to 
  5061.  execute on OS/2 1.1 and 1.2 should use the OS/2 run-time dynamic link 
  5062.  capabilities, DosLoadModule and DosGetProcAddr, to get the address of 
  5063.  DosGetResource2 and DosFreeResource when executing on OS/2 1.2. If the 
  5064.  DosGetProcAddr call to obtain the address of DosGetResource2 and 
  5065.  DosFreeResource fails, the application can call DosGetResource and DosFreeSeg. 
  5066.  Applications that use DosGetResource2 and DosFreeResource allow OS/2 to 
  5067.  optimize memory allocation associated with the applications resource. 
  5068.  
  5069.  
  5070. ΓòÉΓòÉΓòÉ 1.68. DosGetResource2 ΓòÉΓòÉΓòÉ
  5071.  
  5072.                                Bindings:  C, MASM
  5073.  
  5074. This call returns the far address of the specified resource. 
  5075.  
  5076.  DosGetResource2     (ModHandle, TypeID, NameID, ResAddr) 
  5077.  
  5078.  ModHandle (HMODULE) - input 
  5079.     The location of the resource. 
  5080.  
  5081.     Value     Definition 
  5082.        0      The executable file of the current process. 
  5083.     <> 0      A handle to a dynamic link module returned by DosLoadModule. 
  5084.  
  5085.  TypeID (USHORT) - input 
  5086.     A 16 bit resource type ID (see Remarks). 
  5087.  
  5088.  NameID (USHORT) - input 
  5089.     A 16 bit resource name ID (see Remarks). 
  5090.  
  5091.  ResAddr (PULONG) - output 
  5092.     Address of the resource address. 
  5093.  
  5094.  rc (USHORT) - return 
  5095.     Return code descriptions are: 
  5096.  
  5097.     0         NO_ERROR 
  5098.     6         ERROR_INVALID_HANDLE 
  5099.  
  5100.  Remarks 
  5101.  
  5102.  A resource is read-only data generated by the Resource Compiler that can be 
  5103.  accessed dynamically at run time.  The access key consists of two 16-bit 
  5104.  numbers, the first of which is a type ID and the second, a name ID. These 
  5105.  numbers are similar in concept to the file extension and file name portions of 
  5106.  a file name. 
  5107.  
  5108.  The advantage of a resource is that it can be bundled into an application's 
  5109.  executable file, so a single file contains all of the code and data for an 
  5110.  application. 
  5111.  
  5112.  Resource segments obtained through DosGetResource2 should only be freed using 
  5113.  DosFreeResource. 
  5114.  
  5115.  
  5116. ΓòÉΓòÉΓòÉ 1.69. DosGetSeg ΓòÉΓòÉΓòÉ
  5117.  
  5118.                                Bindings:  C, MASM
  5119.  
  5120. This call accesses shared memory allocated by a DosAllocSeg or DosAllocHuge 
  5121. call. 
  5122.  
  5123.  DosGetSeg    (Selector) 
  5124.  
  5125.  Selector (SEL) - input 
  5126.     Parameter used to get access to a segment. 
  5127.  
  5128.  rc (USHORT) - return 
  5129.     Return code descriptions are: 
  5130.  
  5131.     0         NO_ERROR 
  5132.     5         ERROR_ACCESS_DENIED 
  5133.  
  5134.  Remarks 
  5135.  
  5136.  A process may issue DosAllocSeg or DosAllocHuge to allocate shareable segments 
  5137.  of memory. The segment may be shareable through DosGiveSeg or DosGetSeg. If 
  5138.  the segment is shareable through DosGetSeg, then the process that allocated 
  5139.  the memory must pass the selector of the segment to the recipient process 
  5140.  using some means of interprocess communication. 
  5141.  
  5142.  If at the time the shared segment is allocated, it is also specified as 
  5143.  discardable, it is automatically locked for access by the caller. The caller 
  5144.  may free the segment for discard by a DosUnlockSeg call. A process that gains 
  5145.  access to the discardable shared segment by calling DosGetSeg has to lock the 
  5146.  segment with a DosLockSeg request.  However, DosLockSeg may return an error, 
  5147.  indicating the segment is already locked. In this case, the process calls 
  5148.  DosUnlockSeg repetitively, until the segment is fully unlocked.  The process 
  5149.  then locks the segment for its own use. Locking is an attribute of the 
  5150.  segment, not the processes using the segment. 
  5151.  
  5152.  To access named shared memory allocated with a DosAllocShrSeg request, a 
  5153.  process issues DosGetShrSeg. 
  5154.  
  5155.  
  5156. ΓòÉΓòÉΓòÉ 1.70. DosGetShrSeg ΓòÉΓòÉΓòÉ
  5157.  
  5158.                                Bindings:  C, MASM
  5159.  
  5160. This call accesses a shared memory segment previously allocated by another 
  5161. process. 
  5162.  
  5163.  DosGetShrSeg     (Name, Selector) 
  5164.  
  5165.  Name (PSZ) - input 
  5166.     Address of the name string associated with the shared memory segment to be 
  5167.     accessed.  The name is an ASCIIZ string in the format of an OS/2 filename 
  5168.     in a subdirectory called \SHAREMEM\, for example, \SHAREMEM\PUBLIC.DAT. 
  5169.  
  5170.  Selector (PSEL) - output 
  5171.     Address of the selector for the shared memory segment. 
  5172.  
  5173.  rc (USHORT) - return 
  5174.     Return code descriptions are: 
  5175.  
  5176.     0         NO_ERROR 
  5177.     2         ERROR_FILE_NOT_FOUND 
  5178.     4         ERROR_TOO_MANY_OPEN_FILES 
  5179.     123       ERROR_INVALID_NAME 
  5180.  
  5181.  Remarks 
  5182.  
  5183.  DosGetShrSeg provides access to a named shared segment allocated by another 
  5184.  process with DosAllocShrSeg. The selector returned by DosGetShrSeg is the same 
  5185.  as the one returned by the DosAllocShrSeg call. 
  5186.  
  5187.  A usage count is maintained for a named shared segment. Issuing DosGetShrSeg 
  5188.  increments the count, and issuing  DosFreeSeg decrements the count. When the 
  5189.  usage count equals zero, the named shared segment is deallocated.  Once the 
  5190.  segment has been deallocated, it must be reinitialized by a call to 
  5191.  DosAllocShrSeg. 
  5192.  
  5193.  To access shared memory that is allocated by another process with DosAllocSeg 
  5194.  and DosAllocHuge requests, a process issues  DosGetSeg. 
  5195.  
  5196.  
  5197. ΓòÉΓòÉΓòÉ 1.71. DosGetVersion ΓòÉΓòÉΓòÉ
  5198.  
  5199.                                Bindings:  C, MASM
  5200.  
  5201. This call returns the OS/2 version number. 
  5202.  
  5203.  DosGetVersion     (VersionWord) 
  5204.  
  5205.  VersionWord (PUSHORT) - output 
  5206.     Address of the OS/2 version number.  The version is stored as two bytes, 
  5207.     with the minor version in the first byte and major version in the second 
  5208.     byte. 
  5209.  
  5210.  rc (USHORT) - return 
  5211.     Return code description is: 
  5212.  
  5213.     0         NO_ERROR 
  5214.  
  5215.  
  5216. ΓòÉΓòÉΓòÉ 1.72. DosGiveSeg ΓòÉΓòÉΓòÉ
  5217.  
  5218.                                Bindings:  C, MASM
  5219.  
  5220. This call allows another process to access shared memory allocated by a 
  5221. DosAllocSeg or DosAllocHuge call. 
  5222.  
  5223.  DosGiveSeg    (CallerSegSelector, ProcessID, RecipientSegSelector) 
  5224.  
  5225.  CallerSegSelector (SEL) - input 
  5226.     Segment selector of the shared memory segment. 
  5227.  
  5228.  ProcessID (PID) - input 
  5229.     Process ID of the process to receive access to the shared memory segment. 
  5230.  
  5231.  RecipientSegSelector (PSEL) - output 
  5232.     Address of the recipient's segment selector. 
  5233.  
  5234.  rc (USHORT) - return 
  5235.     Return code descriptions are: 
  5236.  
  5237.     0         NO_ERROR 
  5238.     5         ERROR_ACCESS_DENIED 
  5239.     8         ERROR_NOT_ENOUGH_MEMORY 
  5240.  
  5241.  Remarks 
  5242.  
  5243.  DosGiveSeg returns a selector that can be given to another process to access 
  5244.  shared memory the giver has allocated by a DosAllocSeg or DosAllocHuge call. 
  5245.  The giving process passes the recipient's selector to the intended sharer by 
  5246.  some means of interprocess communication. If the recipient has created a queue 
  5247.  with DosCreateQueue, the giver can issue DosWriteQueue, specifying the queue 
  5248.  name, and pass the selector in this manner. 
  5249.  
  5250.  If the memory being given was allocated by a DosAllocHuge request, the 
  5251.  CallerSegSelector must be the base selector returned by DosAllocHuge. When the 
  5252.  caller passes the selector returned in RecipientSegSelector to the intended 
  5253.  sharer, this selector has addressability only to the first segment in the 
  5254.  sharer's address space of the huge allocation.  However, the recipient can 
  5255.  call DosGetHugeShift and use the shift count returned to calculate the 
  5256.  selectors for the remaining segments. 
  5257.  
  5258.  
  5259. ΓòÉΓòÉΓòÉ 1.73. DosHoldSignal ΓòÉΓòÉΓòÉ
  5260.  
  5261.                                Bindings:  C, MASM
  5262.  
  5263. This call temporarily disables or enables signal processing for the current 
  5264. process. 
  5265.  
  5266.  DosHoldSignal     (ActionCode) 
  5267.  
  5268.  ActionCode (USHORT) - input 
  5269.     Disables or enables signals intended for the current process. 
  5270.  
  5271.     Value     Definition 
  5272.     0         Signals are enabled 
  5273.     1         Signals are disabled. 
  5274.  
  5275.  rc (USHORT) - return 
  5276.     Return code descriptions are: 
  5277.  
  5278.     0         NO_ERROR 
  5279.     1         ERROR_INVALID_FUNCTION 
  5280.  
  5281.  Remarks 
  5282.  
  5283.  DosHoldSignal with ActionCode = 1 causes signal processing (except central 
  5284.  processing errors and numeric processor errors) to be postponed until a 
  5285.  DosHoldSignal with ActionCode = 0 is issued.  Any signals that occur while 
  5286.  processing is disabled are recognized, but not accepted until signal 
  5287.  recognition is enabled. 
  5288.  
  5289.  To allow for nesting of requests, a count of the number of outstanding 
  5290.  DosHoldSignal requests with ActionCode = 1 are maintained. 
  5291.  
  5292.  DosHoldSignal is used by library routines, subsystems, and similar code that 
  5293.  lock critical sections or temporarily reserve resources needed to prevent a 
  5294.  signal from terminating a task. A process can have only one signal handling 
  5295.  address for each signal. Dynalink routines should not have a signal handler 
  5296.  (which might override a handler established by a calling process). 
  5297.  
  5298.  Signals can be held for a short period and should be released and re-held, if 
  5299.  necessary.  Their guidelines for proper use are similar to hardware interrupt 
  5300.  counterparts such as the CLI/STI instructions. 
  5301.  
  5302.  
  5303.  Family API Considerations 
  5304.  
  5305.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  5306.  Therefore, the following restriction applies to DosHoldSignal when coding for 
  5307.  the DOS mode: 
  5308.  
  5309.  The only signal recognized in the DOS mode is SIGINTR (Ctrl-C) and SIGBREAK. 
  5310.  Only SIGINTR and SIGBREAK are turned off by this call. 
  5311.  
  5312.  
  5313. ΓòÉΓòÉΓòÉ 1.74. DosInsMessage ΓòÉΓòÉΓòÉ
  5314.  
  5315.                                Bindings:  C, MASM
  5316.  
  5317. This call inserts variable text string information into the body of a message. 
  5318. This is useful when messages are loaded before insertion text strings are 
  5319. known. 
  5320.  
  5321.  DosInsMessage      (IvTable, IvCount, MsgInput, MsgInLength, DataArea, 
  5322.                     DataLength,MsgLength) 
  5323.  
  5324.  IvTable (PCHAR FAR *) - input 
  5325.     List of double-word pointers.  Each pointer points to an ASCIIZ or null 
  5326.     terminated DBCS string (variable insertion text).  0 to 9 strings can be 
  5327.     present. 
  5328.  
  5329.  IvCount (USHORT) - input 
  5330.     0-9 is the count of variable insertion text strings. If IvCount is 0, 
  5331.     IvTable is ignored. 
  5332.  
  5333.  MsgInput (PSZ) - input 
  5334.     Address of the input message. 
  5335.  
  5336.  MsgInLength (USHORT) - input 
  5337.     Length, in bytes, of the input message. 
  5338.  
  5339.  DataArea (PCHAR) - output 
  5340.     Address of the user storage that returns the updated message. If the 
  5341.     message is too long to fit in the caller's buffer, as much of the message 
  5342.     text as possible is returned with the appropriate return code. 
  5343.  
  5344.  DataLength (USHORT) - input 
  5345.     Length, in bytes, of the user's storage area. 
  5346.  
  5347.  MsgLength (PUSHORT) - output 
  5348.     Address of the length, in bytes, of the updated message. 
  5349.  
  5350.  rc (USHORT) - return 
  5351.     Return code descriptions are: 
  5352.  
  5353.     0         NO_ERROR 
  5354.     316       ERROR_MR_MSG_TOO_LONG 
  5355.     320       ERROR_MR_INV_IVCOUNT 
  5356.  
  5357.  Remarks 
  5358.  
  5359.  DosInsMessage returns an error indicating that IvCount is out of range when 
  5360.  IvCount is greater than 9.  A default message is also placed in the caller's 
  5361.  buffer.  Refer to DosGetMessage for details on the default messages.  If the 
  5362.  numeric value of x in the 
  5363.  %x sequence for %1through%9 is less than or equal to IvCount, then text 
  5364.  insertion, by substitution for %x, is performed for all occurrences of %x in 
  5365.  the body of the message.  Otherwise text insertion is ignored and the %x 
  5366.  sequence is returned unchanged in the message. Text insertion is performed for 
  5367.  all text strings defined by IvCount and IvTable. 
  5368.  
  5369.  Variable data insertion does not depend on a blank character delimiter nor are 
  5370.  blanks automatically inserted. 
  5371.  
  5372.  
  5373. ΓòÉΓòÉΓòÉ 1.75. DosKillProcess ΓòÉΓòÉΓòÉ
  5374.  
  5375.                                Bindings:  C, MASM
  5376.  
  5377. This call flags a process to terminate and returns the termination code to its 
  5378. parent. 
  5379.  
  5380.  DosKillProcess    (ActionCode, ProcessID) 
  5381.  
  5382.  ActionCode (USHORT) - input 
  5383.     The processes to be flagged for termination. 
  5384.  
  5385.     Value     Definition 
  5386.  
  5387.     0         A process and all its descendant processes. The process must be 
  5388.               either the current process or a child process created by the 
  5389.               current process. (Detached processes cannot be flagged for 
  5390.               termination.) After the indicated process terminates, its 
  5391.               descendants are flagged for termination. 
  5392.  
  5393.     1         Any process.  Only the indicated process is flagged for 
  5394.               termination. 
  5395.  
  5396.  ProcessID (PID) - input 
  5397.     Process ID of the process, or root process of the process tree to be 
  5398.     flagged for termination. 
  5399.  
  5400.  rc (USHORT) - return 
  5401.     Return code descriptions are: 
  5402.  
  5403.     0         NO_ERROR 
  5404.     13        ERROR_INVALID_DATA 
  5405.     303       ERROR_INVALID_PROCID 
  5406.     305       ERROR_NOT_DESCENDANT 
  5407.  
  5408.  Remarks 
  5409.  
  5410.  DosKillProcess allows a process to send the termination signal SIGTERM to 
  5411.  another process or group of processes.  The default action of the system is to 
  5412.  terminate each of the processes.  A process can intercept this action by 
  5413.  installing a signal handler for SIGTERM with DosSetSigHandler.  This gives the 
  5414.  process the opportunity to clean up its files before it terminates with 
  5415.  DosExit. 
  5416.  
  5417.  If there is no signal handler, the effect on the process is the same as if one 
  5418.  of its threads had issued DosExit for the entire process. All file buffers are 
  5419.  flushed and the handles opened by the process are closed. However, any 
  5420.  internal buffers managed by programs external to OS/2 are not flushed.  An 
  5421.  example of such a buffer could be a C language library's internal character 
  5422.  buffer. 
  5423.  
  5424.  If a parent process is waiting for a child process to end because of a 
  5425.  DosCwait request, and the child is sent the SIGTERM signal but does not have a 
  5426.  SIGTERM signal handler installed, the DosCwait request returns the 
  5427.  "unintercepted DosKillProcess" termination code. 
  5428.  
  5429.  
  5430. ΓòÉΓòÉΓòÉ 1.76. DosLoadModule ΓòÉΓòÉΓòÉ
  5431.  
  5432.                                Bindings:  C, MASM
  5433.  
  5434. This call loads a dynamic link module and returns a handle for the module. 
  5435.  
  5436.  DosLoadModule     (ObjNameBuf, ObjNameBufL, ModuleName, ModuleHandle) 
  5437.  
  5438.  ObjNameBuf (PSZ) - output 
  5439.     Address of the name of an object that contributed to the failure of 
  5440.     DosLoadModule. 
  5441.  
  5442.  ObjNameBufL (USHORT) - input 
  5443.     Length, in bytes, of the buffer described by ObjNameBuf. 
  5444.  
  5445.  ModuleName (PSZ) - input 
  5446.     Address of the ASCIIZ name string containing the dynamic link module name 
  5447.     or the pathname string.  The filename extension used for dynamic link 
  5448.     libraries is .DLL.  When a pathname is provided, the module name may have 
  5449.     any extension.  The internal module name (the name given in the LIBRARY 
  5450.     statement in the .DEF file) must be the same as the filename without the 
  5451.     extension. 
  5452.  
  5453.  ModuleHandle (PHMODULE) - output 
  5454.     Address of the handle for the dynamic link module. 
  5455.  
  5456.  rc (USHORT) - return 
  5457.     Return code descriptions are: 
  5458.  
  5459.     0         NO_ERROR 
  5460.     2         ERROR_FILE_NOT_FOUND 
  5461.     3         ERROR_PATH_NOT_FOUND 
  5462.     4         ERROR_TOO_MANY_OPEN_FILES 
  5463.     5         ERROR_ACCESS_DENIED 
  5464.     8         ERROR_NOT_ENOUGH_MEMORY 
  5465.     11        ERROR_BAD_FORMAT 
  5466.     26        ERROR_NOT_DOS_DISK 
  5467.     32        ERROR_SHARING_VIOLATION 
  5468.     33        ERROR_LOCK_VIOLATION 
  5469.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  5470.     95        ERROR_INTERRUPT 
  5471.     108       ERROR_DRIVE_LOCKED 
  5472.     123       ERROR_INVALID_NAME 
  5473.     127       ERROR_PROC_NOT_FOUND 
  5474.     180       ERROR_INVALID_SEGMENT_NUMBER 
  5475.     182       ERROR_INVALID_ORDINAL 
  5476.     190       ERROR_INVALID_MODULETYPE 
  5477.     191       ERROR_INVALID_EXE_SIGNATURE 
  5478.     192       ERROR_EXE_MARKED_INVALID 
  5479.     194       ERROR_ITERATED_DATA_EXCEEDS_64k 
  5480.     195       ERROR_INVALID_MINALLOCSIZE 
  5481.     196       ERROR_DYNLINK_FROM_INVALID_RING 
  5482.     198       ERROR_INVALID_SEGDPL 
  5483.     199       ERROR_AUTODATASEG_EXCEEDS_64k 
  5484.     201       ERROR_RELOC_CHAIN_XEEDS_SEGLIM 
  5485.     206       ERROR_FILENAME_EXCED_RANGE 
  5486.  
  5487.  Remarks 
  5488.  
  5489.  If the file is an OS/2 dynamic link module, it is loaded, and a handle is 
  5490.  returned.  This handle is used for freeing the dynamic link module with a 
  5491.  DosFreeModule request, getting procedure addresses with DosGetProcAddr 
  5492.  requests, and getting the fully qualified file name with a DosGetModName 
  5493.  request. 
  5494.  
  5495.  DosLoadModule may not be called from a dynamic library initialization routine 
  5496.  if the module to be loaded or any module referenced by it contains a dynamic 
  5497.  link library initialization routing. 
  5498.  
  5499.  
  5500. ΓòÉΓòÉΓòÉ 1.77. DosLockSeg ΓòÉΓòÉΓòÉ
  5501.  
  5502.                                Bindings:  C, MASM
  5503.  
  5504. This call locks a discardable segment in memory. 
  5505.  
  5506.  DosLockSeg    (Selector) 
  5507.  
  5508.  Selector (SEL) - input 
  5509.     Selector of the segment to be locked. 
  5510.  
  5511.  rc (USHORT) - return 
  5512.     Return code descriptions are: 
  5513.  
  5514.     0         NO_ERROR 
  5515.     5         ERROR_ACCESS_DENIED 
  5516.     157       ERROR_DISCARDED 
  5517.  
  5518.  Remarks 
  5519.  
  5520.  Discardable segments are useful for holding objects that are accessed for 
  5521.  short periods of time and that can be regenerated quickly if discarded. 
  5522.  Examples are cache buffers for a data base package, saved bitmap images for 
  5523.  obscured windows or precomputed display images for a word processing 
  5524.  application. 
  5525.  
  5526.  Discardable memory is allocated by a call to DosAllocSeg or  DosAllocHuge with 
  5527.  AllocFlags bit 2 set.  Upon allocation, the memory is automatically locked for 
  5528.  access by the allocating process and cannot be discarded. After the segment is 
  5529.  unlocked by a DosUnlockSeg request, the memory can be discarded by the memory 
  5530.  manager to remedy a low memory situation.  Once memory is discarded, a 
  5531.  DosLockSeg call returns ERROR_DISCARDED.  The memory is reallocated by a call 
  5532.  to DosReallocSeg or DosReallocHuge.  The reallocation request automatically 
  5533.  locks the memory. 
  5534.  
  5535.  Memory allocated as discardable by a DosAllocSeg or  DosAllocHuge request may 
  5536.  also have been designated as shareable. Sharing processes that access the 
  5537.  discardable shared memory with DosGetSeg have to lock the memory by calling 
  5538.  DosLockSeg. See DosGetSeg for more information. 
  5539.  
  5540.  DosLockSeg and DosUnlockSeg calls may be nested.  If  DosLockSeg is called 
  5541.  multiple times to lock a segment, the same number of calls must be made to 
  5542.  DosUnlockSeg before the segment is unlocked.  However, if a segment is locked 
  5543.  255 times, it becomes permanently locked. Additional calls to DosLockSeg and 
  5544.  DosUnlockSeg have no effect on the segment's locked state. 
  5545.  
  5546.  This function is used on segments that have been allocated through DosAllocSeg 
  5547.  with AllocFlags bit 2 (0100B) set. It may be also used on segments that are 
  5548.  non-discardable, in which case it has no effect. 
  5549.  
  5550.  
  5551. ΓòÉΓòÉΓòÉ 1.78. DosMakeNmPipe ΓòÉΓòÉΓòÉ
  5552.  
  5553.                                Bindings:  C, MASM
  5554.  
  5555. This call creates the specified named pipe and returns its handle. 
  5556.  
  5557.  DosMakeNmPipe       (PipeName, PipeHandle, OpenMode, PipeMode, OutBufSize, 
  5558.                      InBufSize, TimeOut) 
  5559.  
  5560.  PipeName (PSZ) - input 
  5561.     Address of the ASCIIZ name of the pipe to be opened.  Pipes are named 
  5562.     \PIPE\PipeName. 
  5563.  
  5564.  PipeHandle (PHPIPE) - output 
  5565.     Address of the handle of the named pipe that is created. 
  5566.  
  5567.  OpenMode (USHORT) - input 
  5568.     The OpenMode parameter contains the following bit fields: 
  5569.  
  5570.     Bit       Description 
  5571.  
  5572.     15        Reserved and must be zero. 
  5573.  
  5574.     14        Write-Through flag:  The file is opened as follows: 
  5575.  
  5576.               0 = Write-behind to remote pipes is allowed. 
  5577.  
  5578.               1 = Write-behind to remote pipes is not allowed. 
  5579.  
  5580.               Setting the Write-Through flag is meaningful only for a remote 
  5581.               pipe. Occasionally, data written to a remote pipe is buffered 
  5582.               locally and then sent across the network to the pipe at a later 
  5583.               time. Setting the Write-Through bit ensures that data is sent to 
  5584.               the remote pipe as soon as it is written. 
  5585.  
  5586.     13-8      Reserved and must be zero. 
  5587.  
  5588.     7         Inheritance flag:  The file handle is as follows: 
  5589.  
  5590.               0 = Pipe handle is inherited by a spawned process resulting from 
  5591.               a DosExecPgm call. 
  5592.  
  5593.               1 = Pipe handle is private to the current process and cannot be 
  5594.               inherited. 
  5595.  
  5596.     6-2       Reserved and must be zero. 
  5597.  
  5598.     1-0       Access field:  The pipe access is assigned as follows: 
  5599.  
  5600.               00 = In-bound pipe (client to server) 
  5601.  
  5602.               01 = Out-bound pipe (server to client) 
  5603.  
  5604.               10 = Duplex pipe (server to/from client) 
  5605.  
  5606.               Any other value is invalid. 
  5607.  
  5608.  PipeMode (USHORT) - input 
  5609.     The PipeMode parameter contains the following bit fields: 
  5610.  
  5611.     Bit       Description 
  5612.  
  5613.     15        Blocking flag:  The pipe is defined as follows: 
  5614.  
  5615.               0 = Reads/Writes block if no data available. 
  5616.  
  5617.               1 = Reads/Writes return immediately if no data available. 
  5618.  
  5619.               Reads normally block until at least partial data can be returned. 
  5620.               Writes by default block until all bytes requested have been 
  5621.               written.  Non-blocking mode (1) changes this behavior as follows: 
  5622.  
  5623.               DosRead returns immediately with error NO_DATA if no data is 
  5624.               available. 
  5625.  
  5626.               DosWrite returns immediately with BytesWritten = 0 if 
  5627.               insufficient buffer space is available in the pipe or the entire 
  5628.               data area is transferred. 
  5629.  
  5630.     14-11     Reserved and must be zero. 
  5631.  
  5632.     10        Type of named pipe:  The pipe is defined as follows: 
  5633.  
  5634.               0 = Pipe is a byte stream pipe. 
  5635.  
  5636.               1 = Pipe is a message stream pipe. 
  5637.  
  5638.               All writes to message stream pipes record the length of the write 
  5639.               along with the written data (see DosWrite).  The first two bytes 
  5640.               of each message represents the length of that message and is 
  5641.               called the message header.  A header of all zeros is reserved. 
  5642.               Zero length messages are not allowed (OS/2 no-ops zero-length 
  5643.               I/Os). 
  5644.  
  5645.     9         Reserved and must be zero. 
  5646.  
  5647.     8         Read mode:  The pipe is defined as follows: 
  5648.  
  5649.               0 = Read pipe as a byte stream. 
  5650.  
  5651.               1 = Read pipe as a message stream. 
  5652.  
  5653.               Message pipes can be read as byte or message streams, depending 
  5654.               on this bit.  Byte pipes can only be read as byte streams (see 
  5655.               DosRead) 
  5656.  
  5657.     7-0       ICount field (Instance count):  Byte wide (8-bit) count to 
  5658.               control pipe instances.  When making the first instance of a 
  5659.               named pipe, ICount specifies how many instances can be created. 
  5660.               Instances are as follows: 
  5661.  
  5662.        Value               Definition 
  5663.         1                  This can be the only instance (pipe is unique). 
  5664.         1 < value < 255    The number of instances is limited to the value 
  5665.                            specified. 
  5666.        -1                  The number of instances is unlimited. 
  5667.         0                  Reserved value. 
  5668.  
  5669.               Subsequent attempts to make a pipe fails if the maximum number of 
  5670.               allowed instances already exists.  The ICount parameter is 
  5671.               ignored when making any other than the first instance of a pipe. 
  5672.               When multiple instances are allowed, multiple clients can 
  5673.               simultaneously issue  DosOpen to the same pipe name and get 
  5674.               handles to distinct pipe instances. 
  5675.  
  5676.  OutBufSize (USHORT) - input 
  5677.     An advisory to the system of the number of bytes to allocate for the 
  5678.     outgoing buffer. 
  5679.  
  5680.  InBufSize (USHORT) - input 
  5681.     An advisory to the system of the number of bytes to allocate for the 
  5682.     incoming buffer. 
  5683.  
  5684.  TimeOut (ULONG) - input 
  5685.     Default value for the TimeOut parameter to DosWaitNmPipe.  This value may 
  5686.     be set only at the creation of the first instance of the pipe name.  If the 
  5687.     value is zero, a system wide default value (50 ms) is chosen. 
  5688.  
  5689.  rc (USHORT) - return 
  5690.     Return code descriptions are: 
  5691.  
  5692.     0         NO_ERROR 
  5693.     3         ERROR_PATH_NOT_FOUND 
  5694.     8         ERROR_NOT_ENOUGH_MEMORY 
  5695.     84        ERROR_OUT_OF_STRUCTURES 
  5696.     87        ERROR_INVALID_PARAMETER 
  5697.     231       ERROR_PIPE_BUSY 
  5698.  
  5699.  Remarks 
  5700.  
  5701.  A named pipe provides two-way communication between a server process and a 
  5702.  number of client processes. In addition, the named pipe can have multiple 
  5703.  instances created by multiple server processes. 
  5704.  
  5705.  The server creates the pipe with DosMakeNmPipe.  The ICount parameter is 
  5706.  significant only for the first instance created of the named pipe. The ASCIIZ 
  5707.  name string specified for the named pipe must include the prefix \PIPE\. 
  5708.  
  5709.  After creating the named pipe, the server issues DosConnectNmPipe to wait for 
  5710.  a client to open the pipe with DosOpen. If all instances of a named pipe are 
  5711.  busy, a client process can issue DosWaitNmPipe and wait for an instance to 
  5712.  become available before it reissues DosOpen. A client can determine whether 
  5713.  the pipe is ready to accept a DosOpen by issuing DosPeekNmPipe to return the 
  5714.  pipe's state. 
  5715.  
  5716.  Server and client processes communicate by issuing DosRead,  DosReadAsync, 
  5717.  DosWrite, and DosWriteAsync calls.  DosBufReset can be used to to synchronize 
  5718.  read and write dialogs. A server process that need to support a large number 
  5719.  of clients for a local named pipe can coordinate access to the pipe with 
  5720.  DosSetNmPipeSem and DosQNmPipeSemState calls. 
  5721.  
  5722.  Server and client processes can also communicate by means of transaction and 
  5723.  procedure calls.  DosTransactNmPipe and DosCallNmPipe are supported only for 
  5724.  duplex message pipes. 
  5725.  
  5726.  Issuing DosClose ends the client's access to the named pipe. To prepare the 
  5727.  pipe for its next client, the server process issues DosDisConnectNmPipe 
  5728.  followed by DosConnectNmPipe. 
  5729.  
  5730.  When all handles to one end of the pipe are closed, the pipe is considered 
  5731.  broken.  If the pipe is broken and the server issues DosClose, the pipe is 
  5732.  immediately deallocated. 
  5733.  
  5734.  
  5735. ΓòÉΓòÉΓòÉ 1.79. DosMakePipe ΓòÉΓòÉΓòÉ
  5736.  
  5737.                                Bindings:  C, MASM
  5738.  
  5739. This call creates a pipe. 
  5740.  
  5741.  DosMakePipe    (ReadHandle, WriteHandle, PipeSize) 
  5742.  
  5743.  ReadHandle (PHFILE) - output 
  5744.     Address of the read handle of the pipe. 
  5745.  
  5746.  WriteHandle (PHFILE) - output 
  5747.     Address of the write handle of the pipe. 
  5748.  
  5749.  PipeSize (USHORT) - input 
  5750.     Storage size, in bytes, to reserve for the pipe. 
  5751.  
  5752.  rc (USHORT) - return 
  5753.     Return code descriptions are: 
  5754.  
  5755.     0         NO_ERROR 
  5756.     4         ERROR_TOO_MANY_OPEN_FILES 
  5757.     8         ERROR_NOT_ENOUGH_MEMORY 
  5758.     109       ERROR_BROKEN_PIPE 
  5759.  
  5760.  Remarks 
  5761.  
  5762.  Pipes are mechanisms used within a closely related group of processes. There 
  5763.  are no control, permission mechanisms, or checks performed on operations to 
  5764.  pipes. 
  5765.  
  5766.  When there is insufficient space in a pipe for the data being written, a 
  5767.  requesting thread blocks until enough data is removed to allow the write 
  5768.  request to be satisfied. If the PipeSize parameter is 0, then the pipe is 
  5769.  created with a default size of 512 bytes. 
  5770.  
  5771.  When all users close the handles, a pipe is deleted. If two processes are 
  5772.  communicating by a pipe and the process reading the pipe ends, the next write 
  5773.  gets the "ERROR_BROKEN_PIPE" error code. 
  5774.  
  5775.  
  5776. ΓòÉΓòÉΓòÉ 1.80. DosMemAvail ΓòÉΓòÉΓòÉ
  5777.  
  5778.                                Bindings:  C, MASM
  5779.  
  5780. This call returns the size of the largest block of free memory. 
  5781.  
  5782.  DosMemAvail     (MemAvailSize) 
  5783.  
  5784.  MemAvailSize (PULONG) - output 
  5785.     Address of the size of the largest free block of memory. 
  5786.  
  5787.  rc (USHORT) - return 
  5788.     Return code description is: 
  5789.  
  5790.     0         NO_ERROR 
  5791.  
  5792.  Remarks 
  5793.  
  5794.  DosMemAvail allows an application to determine how heavily used system memory 
  5795.  is at a particular time. The returned value is a "snapshot" that may be valid 
  5796.  only at the moment this function is issued and can be expected to change at 
  5797.  any time due to system activity. 
  5798.  
  5799.  This call can be used as an indicator for memory availability before a call to 
  5800.  DosAllocHuge is made. 
  5801.  
  5802.  
  5803. ΓòÉΓòÉΓòÉ 1.81. DosMkDir ΓòÉΓòÉΓòÉ
  5804.  
  5805.                                Bindings:  C, MASM
  5806.  
  5807. This call creates a subdirectory. 
  5808.  
  5809.  DosMkDir    (DirName, Reserved) 
  5810.  
  5811.  DirName (PSZ) - input 
  5812.     Address of the ASCIIZ directory path name, which may or may not include a 
  5813.     drive specification. If no drive is specified, the current drive is 
  5814.     assumed. 
  5815.  
  5816.     DosQSysInfo is called by an application during initialization to determine 
  5817.     the maximum path length allowed by OS/2. 
  5818.  
  5819.  Reserved (ULONG) - input 
  5820.     Reserved and must be set to zero. 
  5821.  
  5822.  rc (USHORT) - return 
  5823.     Return code descriptions are: 
  5824.  
  5825.     0         NO_ERROR 
  5826.     3         ERROR_PATH_NOT_FOUND 
  5827.     5         ERROR_ACCESS_DENIED 
  5828.     26        ERROR_NOT_DOS_DISK 
  5829.     87        ERROR_INVALID_PARAMETER 
  5830.     108       ERROR_DRIVE_LOCKED 
  5831.     206       ERROR_FILENAME_EXCED_RANGE 
  5832.  
  5833.  Remarks 
  5834.  
  5835.  If any subdirectory names in the path do not exist, the subdirectory is not 
  5836.  created. Upon return, a subdirectory is created at the end of the specified 
  5837.  path. 
  5838.  
  5839.  DosQSysInfo must be used by an application to determine the maximum path 
  5840.  length supported by OS/2.  The returned value should be used to dynamically 
  5841.  allocate buffers that are to be used to store paths. 
  5842.  
  5843.  If a program running with the NEWFILES bit set tries to create a directory 
  5844.  with blanks immediately preceding the dot on a FAT drive, the system rejects 
  5845.  the name.  For example, if c: is a FAT drive, the name "file .txt" is rejected 
  5846.  and the name "file.txt" is accepted. 
  5847.  
  5848.  
  5849. ΓòÉΓòÉΓòÉ 1.82. DosMkDir2 ΓòÉΓòÉΓòÉ
  5850.  
  5851.                                Bindings:  C, MASM
  5852.  
  5853. This call creates a subdirectory that has extended attributes associated with 
  5854. it. 
  5855.  
  5856.  DosMkDir2    (DirName, EABuf, Reserved) 
  5857.  
  5858.  DirName (PSZ) - input 
  5859.     Address of the ASCIIZ directory path name, which may or may not contain a 
  5860.     drive specification. If no drive is specified, the current drive is 
  5861.     assumed. 
  5862.  
  5863.     DosQSysInfo is called by an application during initialization to determine 
  5864.     the maximum path length allowed by OS/2. 
  5865.  
  5866.  EABuf (PEAOP) - input/output 
  5867.     Address of the extended attribute buffer, which contains an EAOP structure. 
  5868.     An EAOP structure has the following format: 
  5869.  
  5870.     fpGEAList (PGEALIST) 
  5871.        Address of GEAList. GEAList is a packed array of variable length "get 
  5872.        EA" structures, each containing an EA name and the length of the name. 
  5873.  
  5874.     fpFEAList (PFEALIST) 
  5875.        Address of FEAList. FEAList is a packed array of variable length "full 
  5876.        EA" structures, each containing an EA name and its corresponding value, 
  5877.        as well as the lengths of the name and the value. 
  5878.  
  5879.     oError (ULONG) 
  5880.        Offset into structure where error has occurred. 
  5881.  
  5882.        On input, the fpGEAList field and oError fields are ignored.  The EA 
  5883.        setting operation is performed on the information contained in FEAList. 
  5884.        If extended attributes are not to be defined or modified, then EABuf 
  5885.        must be set to null.  Following is the FEAList format: 
  5886.  
  5887.     cbList (ULONG) 
  5888.        Length of the FEA list, including the length itself. 
  5889.  
  5890.     list (FEA) 
  5891.        List of FEA structures.  An FEA structure has the following format: 
  5892.  
  5893.        Flags (BYTE) 
  5894.           Bit indicator describing the characteristics of the EA being defined. 
  5895.  
  5896.           Bit       Description 
  5897.           7         Critical EA. 
  5898.           6-0       Reserved and must be set to zero. 
  5899.  
  5900.           If bit 7 is set to 1, this indicates a critical EA.  If bit 7 is 0, 
  5901.           this means the EA is noncritical; that is, the EA is not essential to 
  5902.           the intended use by an application of the file with which it is 
  5903.           associated. 
  5904.  
  5905.        cbName (BYTE) 
  5906.           Length of EA ASCIIZ name, which does not include the null character. 
  5907.  
  5908.        cbValue (USHORT) 
  5909.           Length of EA value, which cannot exceed 64KB. 
  5910.  
  5911.        szName (PSZ) 
  5912.           Address of the ASCIIZ name of EA. 
  5913.  
  5914.        aValue (PSZ) 
  5915.           Address of the free-format value of EA. 
  5916.  
  5917.        Note: 
  5918.           The szName and aValue fields are not included as part of header or 
  5919.           include files.  Because of their variable lengths, these entries must 
  5920.           be built manually. 
  5921.  
  5922.           On output, fpGEAList is unchanged.  fpFEAList is unchanged as is the 
  5923.           area pointed to by fpFEAList.  If an error occurred during the set, 
  5924.           oError is the offset of the FEA where the error occurred.  The API 
  5925.           return code is the error code corresponding to the condition 
  5926.           generating the error.  If no error occurred, oError is undefined. 
  5927.  
  5928.           If EABuf is 0x00000000, then no extended attributes are defined for 
  5929.           the directory. 
  5930.  
  5931.  Reserved (ULONG) - input 
  5932.     Reserved and must be set to zero. 
  5933.  
  5934.  rc (USHORT) - return 
  5935.     Return code descriptions are: 
  5936.  
  5937.     0         NO_ERROR 
  5938.     3         ERROR_PATH_NOT_FOUND 
  5939.     5         ERROR_ACCESS_DENIED 
  5940.     26        ERROR_NOT_DOS_DISK 
  5941.     87        ERROR_INVALID_PARAMETER 
  5942.     108       ERROR_DRIVE_LOCKED 
  5943.     206       ERROR_FILENAME_EXCED_RANGE 
  5944.     254       ERROR_INVALID_EA_NAME 
  5945.     255       ERROR_EA_LIST_INCONSISTENT 
  5946.  
  5947.  Remarks 
  5948.  
  5949.  DosMkDir2 allows an application to define extended attributes for a 
  5950.  subdirectory at the time of its creation. 
  5951.  
  5952.  If any subdirectory names in the path do not exist, the subdirectory is not 
  5953.  created. Upon return, a subdirectory is created at the end of the specified 
  5954.  path. 
  5955.  
  5956.  DosQSysInfo must be used by an application to determine the maximum path 
  5957.  length supported by OS/2.  The returned value should be used to dynamically 
  5958.  allocate buffers that are to be used to store paths. 
  5959.  
  5960.  If a program  running with the NEWFILES bit set tries to create a directory 
  5961.  with blanks immediately preceding the dot on a FAT drive, the system rejects 
  5962.  the name.  For example, if c: is a FAT drive, the name "file .txt" is rejected 
  5963.  and the name "file.txt" is accepted. 
  5964.  
  5965.  
  5966. ΓòÉΓòÉΓòÉ 1.83. DosMonClose ΓòÉΓòÉΓòÉ
  5967.  
  5968.                                Bindings:  C, MASM
  5969.  
  5970. This call terminates character device monitoring.  All monitor buffers 
  5971. associated with this process are flushed and closed. 
  5972.  
  5973.  DosMonClose     (Handle) 
  5974.  
  5975.  Handle (HMONITOR) - input 
  5976.     Device handle returned from a previous DosMonOpen call. 
  5977.  
  5978.  rc (USHORT) - return 
  5979.     Return code descriptions are: 
  5980.  
  5981.     0         NO_ERROR 
  5982.     381       ERROR_MON_INVALID_HANDLE 
  5983.  
  5984.  Remarks 
  5985.  
  5986.  A single process may register one or more monitors with a character device 
  5987.  using the same device handle returned from a previous DosMonOpen call.  When 
  5988.  DosMonClose is issued for a specific, opened device handle, all monitors for 
  5989.  the current process registered with this handle terminate. 
  5990.  
  5991.  When DosMonClose is issued, the monitor loses access to the device data 
  5992.  stream. Before issuing DosMonClose, monitor threads calling  DosMonRead and 
  5993.  DosMonWrite should be terminated.  After DosMonClose has been called: 
  5994.  
  5995.  o DosMonRead calls return an ERROR_MON_BUFFER_EMPTY return code. 
  5996.  o DosMonWrite calls return an ERROR_NOT_ENOUGH_MEMORY return code. 
  5997.  
  5998.  Data segments containing monitor buffers should not be freed until after 
  5999.  DosMonClose is called.  If data segments containing monitor buffers are freed 
  6000.  before DosMonClose is called, a GP fault occurs when  DosMonClose is called 
  6001.  and the process is terminated. 
  6002.  
  6003.  For a detailed description of this call see the chapter "Character Device 
  6004.  Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And Device 
  6005.  Support Volume 1. 
  6006.  
  6007.  
  6008. ΓòÉΓòÉΓòÉ 1.84. DosMonOpen ΓòÉΓòÉΓòÉ
  6009.  
  6010.                                Bindings:  C, MASM
  6011.  
  6012. This call gains access to a character device data stream. 
  6013.  
  6014.  DosMonOpen     (Devname, Handle) 
  6015.  
  6016.  Devname (PSZ) - input 
  6017.     Address of the device name string. 
  6018.  
  6019.  Handle (PHMONITOR) - output 
  6020.     Address of the handle for the monitor. This value must be passed to 
  6021.     DosMonReg to communicate with the device, and is passed to DosMonClose to 
  6022.     close the connection to the monitor. 
  6023.  
  6024.  rc (USHORT) - return 
  6025.     Return code descriptions are: 
  6026.  
  6027.     0         NO_ERROR 
  6028.     110       ERROR_OPEN_FAILED 
  6029.     379       ERROR_MON_INVALID_PARMS 
  6030.     380       ERROR_MON_INVALID_DEVNAME 
  6031.  
  6032.  Remarks 
  6033.  
  6034.  For a detailed description of this call see the chapter "Character Device 
  6035.  Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And Device 
  6036.  Support Volume 1. 
  6037.  
  6038.  Only one DosMonOpen call is necessary per device per process. That is, several 
  6039.  DosMonReg calls can be made using the same monitor handle to the same device. 
  6040.  This allows monitors to be registered using different values for Index from 
  6041.  the same process and going to the same device.  When the DosMonClose is 
  6042.  issued, all of the monitors registered on the handle is closed. 
  6043.  
  6044.  
  6045. ΓòÉΓòÉΓòÉ 1.85. DosMonRead ΓòÉΓòÉΓòÉ
  6046.  
  6047.                                Bindings:  C, MASM
  6048.  
  6049. This call waits for and moves a data record from the input buffer of a 
  6050. registered character device monitor and places it in a private data area where 
  6051. the monitor can freely access it. 
  6052.  
  6053.  DosMonRead     (BufferI, WaitFlag, DataBuffer, Bytecnt) 
  6054.  
  6055.  BufferI (PBYTE) - input 
  6056.     Address of the monitor input buffer. 
  6057.  
  6058.  WaitFlag (UCHAR) - input 
  6059.     Valid values are: 
  6060.  
  6061.     Value     Definition 
  6062.  
  6063.     0         The monitor thread that issues DosMonRead wishes to block until a 
  6064.               data record is available in its input buffer. 
  6065.  
  6066.     1         The monitor thread that issues DosMonRead does not wish to block 
  6067.               when its input buffer is empty. 
  6068.  
  6069.  DataBuffer (PBYTE) - input 
  6070.     Address of the buffer in the calling process address space that the data 
  6071.     from the monitor's input buffer is read into. The length of DataBuffer must 
  6072.     be the entry value of Bytecnt. 
  6073.  
  6074.  Bytecnt (PUSHORT) - input/output 
  6075.     Address of the length of DataBuffer, on entry to DosMonRead. On the return 
  6076.     from DosMonRead, Bytecnt specifies the number of bytes of data moved. 
  6077.  
  6078.  rc (USHORT) - return 
  6079.     Return code descriptions are: 
  6080.  
  6081.     0         NO_ERROR 
  6082.     379       ERROR_MON_INVALID_PARMS 
  6083.     382       ERROR_MON_BUFFER_TOO_SMALL 
  6084.     383       ERROR_MON_BUFFER_EMPTY 
  6085.  
  6086.  Remarks 
  6087.  
  6088.  For a detailed description of this call see the chapter "Character Device 
  6089.  Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And Device 
  6090.  Support Volume 1. 
  6091.  
  6092.  
  6093. ΓòÉΓòÉΓòÉ 1.86. DosMonReg ΓòÉΓòÉΓòÉ
  6094.  
  6095.                                Bindings:  C, MASM
  6096.  
  6097. This call establishes an input and output buffer structure to monitor an I/O 
  6098. stream for a character device. 
  6099.  
  6100.  DosMonReg     (Handle, BufferI, BufferO, Posflag, Index) 
  6101.  
  6102.  Handle (HMONITOR) - input 
  6103.     Device handle returned from a previous DosMonOpen call. 
  6104.  
  6105.  BufferI (PBYTE) - input 
  6106.     Address of the monitor's input buffer.  The monitor dispatcher moves data 
  6107.     records into this buffer from the device driver (if the monitor is the 
  6108.     first monitor in the monitor chain) or from the previous monitor, if any, 
  6109.     in the monitor chain.  The monitor takes data from this buffer for 
  6110.     filtering by calling DosMonRead. 
  6111.  
  6112.  BufferO (PBYTE) - input 
  6113.     Address of the monitor's output buffer.  The monitor places filtered data 
  6114.     into this buffer by calling DosMonWrite.  The monitor dispatcher moves data 
  6115.     records from this buffer to the device driver (if the monitor is the last 
  6116.     monitor in the monitor chain) or to the next monitor, if any, in the 
  6117.     monitor chain. 
  6118.  
  6119.  Posflag (USHORT) - input 
  6120.     Used to specify the placement of a monitor's buffers with the monitor chain 
  6121.     (FIRST, LAST or DEFAULT) and whether one or two threads are created by the 
  6122.     monitor dispatcher to handle data movement. 
  6123.  
  6124.     Value     Definition 
  6125.     0         DEFAULT (no position preference) and one thread for data 
  6126.               movement. 
  6127.     1         FIRST (monitor placed at beginning of monitor chain) and one 
  6128.               thread for data movement. 
  6129.     2         LAST (monitor placed at end of monitor chain) and one thread for 
  6130.               data movement. 
  6131.     3         DEFAULT with two threads for data movement. 
  6132.     4         FIRST with two threads for data movement. 
  6133.     5         LAST with two threads for data movement. 
  6134.  
  6135.     The first monitor in a monitor chain that registers as FIRST is placed at 
  6136.     the head of the monitor chain.  The next monitor that registers as FIRST 
  6137.     follows the last monitor registered as FIRST, and so on.  Similarly, the 
  6138.     first monitor that registers as LAST is placed at the end of the monitor 
  6139.     chain. The next monitor that registers as LAST is placed before the last 
  6140.     monitor that registered as LAST, and so on.  The first monitor that 
  6141.     registers as DEFAULT is placed before the last monitor, if any, that 
  6142.     registered as LAST.  The next monitor that registers as DEFAULT is placed 
  6143.     before the last monitor that registered as DEFAULT, and so on. 
  6144.  
  6145.  Index (USHORT) - input 
  6146.     Device specific value. For the keyboard it pertains to the session you wish 
  6147.     to register a monitor on.  For the printer it pertains to the data or code 
  6148.     page monitor chain. 
  6149.  
  6150.  rc (USHORT) - return 
  6151.     Return code descriptions are: 
  6152.  
  6153.     0         NO_ERROR 
  6154.     8         ERROR_NOT_ENOUGH_MEMORY 
  6155.     165       ERROR_MONITORS_NOT_SUPPORTED 
  6156.     379       ERROR_MON_INVALID_PARMS 
  6157.     381       ERROR_MON_INVALID_HANDLE 
  6158.     382       ERROR_MON_BUFFER_TOO_SMALL 
  6159.  
  6160.  Remarks 
  6161.  
  6162.  For a detailed description of this call see the chapter "Character Device 
  6163.  Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And Device 
  6164.  Support Volume 1. 
  6165.  
  6166.  
  6167. ΓòÉΓòÉΓòÉ 1.87. DosMonWrite ΓòÉΓòÉΓòÉ
  6168.  
  6169.                                Bindings:  C, MASM
  6170.  
  6171. This call moves a filtered data record from the monitor's private data area 
  6172. into the monitor's output buffer. 
  6173.  
  6174.  DosMonWrite     (BufferO, DataBuffer, Bytecnt) 
  6175.  
  6176.  BufferO (PBYTE) - input 
  6177.     Address of the monitor output buffer. 
  6178.  
  6179.  DataBuffer (PBYTE) - input 
  6180.     Address of the monitor's private data area that contains a filtered data 
  6181.     record of length Bytecnt. DosMonWrite moves this filtered data record into 
  6182.     the monitor's output buffer. 
  6183.  
  6184.  Bytecnt (USHORT) - input 
  6185.     Number of bytes in the data record. 
  6186.  
  6187.  rc (USHORT) - return 
  6188.     Return code descriptions are: 
  6189.  
  6190.     0         NO_ERROR 
  6191.     8         ERROR_NOT_ENOUGH_MEMORY 
  6192.     379       ERROR_MON_INVALID_PARMS 
  6193.     384       ERROR_MON_DATA_TOO_LARGE 
  6194.  
  6195.  Remarks 
  6196.  
  6197.  For a detailed description of the use of this call see the chapter "Character 
  6198.  Device Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And 
  6199.  Device Support Volume 1. 
  6200.  
  6201.  
  6202. ΓòÉΓòÉΓòÉ 1.88. DosMove ΓòÉΓòÉΓòÉ
  6203.  
  6204.                                Bindings:  C, MASM
  6205.  
  6206. This call moves a file object to another location and changes its name. 
  6207.  
  6208.  DosMove    (OldPathName, NewPathName, Reserved) 
  6209.  
  6210.  OldPathName (PSZ) - input 
  6211.     Address of the old path name of the file to be moved. 
  6212.  
  6213.  NewPathName (PSZ) - input 
  6214.     Address of the new path name of the file. 
  6215.  
  6216.  Reserved (ULONG) - input 
  6217.     Reserved and must be set to zero. 
  6218.  
  6219.  rc (USHORT) - return 
  6220.     Return code descriptions are: 
  6221.  
  6222.     0         NO_ERROR 
  6223.     2         ERROR_FILE_NOT_FOUND 
  6224.     3         ERROR_PATH_NOT_FOUND 
  6225.     5         ERROR_ACCESS_DENIED 
  6226.     17        ERROR_NOT_SAME_DEVICE 
  6227.     26        ERROR_NOT_DOS_DISK 
  6228.     32        ERROR_SHARING_VIOLATION 
  6229.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  6230.     87        ERROR_INVALID_PARAMETER 
  6231.     108       ERROR_DRIVE_LOCKED 
  6232.     206       ERROR_FILENAME_EXCED_RANGE 
  6233.     250       ERROR_CIRCULARITY_REQUESTED 
  6234.     251       ERROR_DIRECTORY_IN_CDS 
  6235.  
  6236.  Remarks 
  6237.  
  6238.  This call is often used to change only the name of a file or subdirectory, 
  6239.  allowing the file object to remain in the same subdirectory. Global file name 
  6240.  characters are not allowed in the source or target name. 
  6241.  
  6242.  If the paths specified are different, this allows the subdirectory location of 
  6243.  the file object to be changed as well. If a drive is specified for the target, 
  6244.  it must be the same as the one specified or implied by the source. 
  6245.  
  6246.  Any attempts to move a parent subdirectory to one of its descendant 
  6247.  subdirectories are rejected, because a subdirectory cannot be both an ancestor 
  6248.  and a descendant of the the same subdirectory. Any attempts by a process to 
  6249.  move the current subdirectory or any of its ancestors are also rejected. 
  6250.  
  6251.  Attributes (times and dates) of the source file object are moved to the 
  6252.  target. If read-only files exist in the target path, they are not replaced. 
  6253.  
  6254.  DosQSysInfo is called during initialization by an application to determine the 
  6255.  maximum path length allowed by OS/2. 
  6256.  
  6257.  DosMove can be used to change the case of a file on an FSD drive. The 
  6258.  following example  would change the name of the file to "File.Txt". 
  6259.  
  6260.   DosMove("file.txt","File.Txt")
  6261.  
  6262.  
  6263.  Family API Considerations 
  6264.  
  6265.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  6266.  Therefore, the following restriction applies to DosMove when coding for the 
  6267.  DOS mode: 
  6268.  
  6269.  File names passed to OldPathName and NewPathName are truncated by the system 
  6270.  in the DOS mode only.  The application must truncate all files passed to 
  6271.  OldPathName and NewPathName in the OS/2 mode or an error code is returned. 
  6272.  
  6273.  
  6274. ΓòÉΓòÉΓòÉ 1.89. DosMuxSemWait ΓòÉΓòÉΓòÉ
  6275.  
  6276.                                Bindings:  C, MASM
  6277.  
  6278. This call blocks a current thread until one of the specified semaphores is 
  6279. cleared. 
  6280.  
  6281.  DosMuxSemWait     (IndexNbr, ListAddr, Timeout) 
  6282.  
  6283.  IndexNbr (PUSHORT) - output 
  6284.     Address of the index number of the semaphore in the list of semaphores that 
  6285.     satisfies the wait request. 
  6286.  
  6287.  ListAddr (PVOID) - input 
  6288.     Address of the structure for list of descriptors that define the semaphores 
  6289.     to be waited on. 
  6290.  
  6291.     semcount (USHORT) 
  6292.        Number of semaphores. 
  6293.  
  6294.     sementry (MUXSEM) 
  6295.        Array of MUXSEM structures: 
  6296.  
  6297.        reserved (USHORT) 
  6298.           Reserved; must be zero. 
  6299.  
  6300.        hsem (HSEM) 
  6301.           Reference to the semaphore. 
  6302.  
  6303.           For a system semaphore, this reference is the handle returned by a 
  6304.           DosCreateSem or DosOpenSem request that granted the requesting thread 
  6305.           access to the semaphore. 
  6306.  
  6307.           For a RAM semaphore, this reference is the address of a doubleword of 
  6308.           storage, allocated and initialized to zero by the application. This 
  6309.           sets the semaphore as unowned. Other than initializing the doubleword 
  6310.           to zero, an application must not modify a RAM semaphore directly; 
  6311.           instead it manipulates the semaphore with semaphore function calls. 
  6312.  
  6313.  Timeout (LONG) - input 
  6314.     Action taken by the requesting thread when none of the semaphores in the 
  6315.     list is available.  The values that can be specified are: 
  6316.  
  6317.     Value     Definition 
  6318.       -1      The requesting thread waits indefinitely for a semaphore to be 
  6319.               cleared. 
  6320.       0       The requesting thread returns immediately. 
  6321.     > 0       The requesting thread waits the indicated number of milliseconds 
  6322.               for a semaphore to be cleared before resuming execution. 
  6323.  
  6324.  rc (USHORT) - return 
  6325.     Return code descriptions are: 
  6326.  
  6327.     0         NO_ERROR 
  6328.     95        ERROR_INTERRUPT 
  6329.     101       ERROR_EXCL_SEM_ALREADY_OWNED 
  6330.     121       ERROR_SEM_TIMEOUT 
  6331.     151       ERROR_INVALID_EVENT_COUNT 
  6332.     152       ERROR_TOO_MANY_MUXWAITERS 
  6333.     153       ERROR_INVALID_LIST_FORMAT 
  6334.  
  6335.  Remarks 
  6336.  
  6337.  DosMuxSemWait checks a semaphore list.  If any of the semaphores are clear, 
  6338.  DosMuxSemWait returns.  If all are set, DosMuxSemWait blocks until one of the 
  6339.  semaphores is cleared or until the time out occurs. 
  6340.  
  6341.  Unlike other semaphore calls that block (DosSemRequest, DosSemWait, and 
  6342.  DosSemSetWait), DosMuxSemWait is an edge-triggered, rather than a 
  6343.  level-triggered, procedure.  This means it returns whenever one of the 
  6344.  semaphores on the list is cleared, regardless of how long that semaphore may 
  6345.  remain clear.  It is possible the semaphore may be reset before DosMuxSemWait 
  6346.  returns. If a semaphore is cleared and then set prior to the thread's 
  6347.  executing the DosMuxSemWait call, the event is lost.  Events are only 
  6348.  effective while a thread is in a DosMuxSemWait call. 
  6349.  
  6350.  This implementation allows DosMuxSemWait to be used in conjunction with one or 
  6351.  more semaphores as a triggering or synchronizing device.  One or more threads 
  6352.  can call DosMuxSemWait for a particular semaphore. When an event occurs, 
  6353.  another thread can clear the semaphore and then immediately set it again, 
  6354.  arming it for the next event.  Threads that were waiting on that semaphore 
  6355.  return from DosMuxSemWait and resume execution. 
  6356.  
  6357.  
  6358. ΓòÉΓòÉΓòÉ 1.90. DosNewSize ΓòÉΓòÉΓòÉ
  6359.  
  6360.                                Bindings:  C, MASM
  6361.  
  6362. This call changes the size of a file. 
  6363.  
  6364.  DosNewSize     (FileHandle, FileSize) 
  6365.  
  6366.  FileHandle (HFILE) - input 
  6367.     Handle of the file whose size is being changed. 
  6368.  
  6369.  FileSize (ULONG) - input 
  6370.     File's new size in bytes. 
  6371.  
  6372.  rc (USHORT) - return 
  6373.     Return code descriptions are: 
  6374.  
  6375.     0         NO_ERROR 
  6376.     5         ERROR_ACCESS_DENIED 
  6377.     6         ERROR_INVALID_HANDLE 
  6378.     26        ERROR_NOT_DOS_DISK 
  6379.     33        ERROR_LOCK_VIOLATION 
  6380.     87        ERROR_INVALID_PARAMETER 
  6381.     112       ERROR_DISK_FULL 
  6382.  
  6383.  Remarks 
  6384.  
  6385.  When DosNewSize is called, the file must be open in a mode that allows write 
  6386.  access. If the file is a read-only file, its read-only status must be changed 
  6387.  with DosSetFileMode before you can open the file for write access. 
  6388.  
  6389.  The open file can be truncated or extended in size. If the file is being 
  6390.  extended, the file system makes a reasonable attempt to allocate the 
  6391.  additional bytes for the file in a contiguous (or nearly contiguous) space on 
  6392.  the medium.  The value of the new bytes is undefined. 
  6393.  
  6394.  
  6395. ΓòÉΓòÉΓòÉ 1.91. DosOpen ΓòÉΓòÉΓòÉ
  6396.  
  6397.                                Bindings:  C, MASM
  6398.  
  6399. This call opens a new file, an existing file, a replacement for an existing 
  6400. file, a named pipe, or a device. 
  6401.  
  6402.  DosOpen    (FileName, FileHandle, ActionTaken, FileSize, FileAttribute, 
  6403.             OpenFlag, OpenMode, Reserved) 
  6404.  
  6405.  FileName (PSZ) - input 
  6406.     Address of the ASCIIZ path name of the file, named pipe, or device to be 
  6407.     opened. 
  6408.  
  6409.  FileHandle (PHFILE) - output 
  6410.     Address of the handle for the file, named pipe, or device. 
  6411.  
  6412.  ActionTaken (PUSHORT) - output 
  6413.     Address of the action taken as a result of DosOpen. 
  6414.  
  6415.     Value     Definition 
  6416.     0001H     File exists 
  6417.     0002H     File created 
  6418.     0003H     File replaced. 
  6419.  
  6420.  FileSize (ULONG) - input 
  6421.     File's new logical size (EOD), in bytes. This parameter is significant only 
  6422.     when creating a new file or replacing an existing file.  Otherwise, it is 
  6423.     ignored. 
  6424.  
  6425.  FileAttribute (USHORT) - input 
  6426.     File attribute bits.  Defined below: 
  6427.  
  6428.     Bit       Description 
  6429.     15-6      Reserved and must be zero. 
  6430.     5         File archive 
  6431.     4         Subdirectory 
  6432.     3         Reserved and must be zero. 
  6433.     2         System file 
  6434.     1         Hidden file 
  6435.     0         Read only file 
  6436.  
  6437.     These bits may be set individually or in combination.  For example, an 
  6438.     attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file 
  6439.     that should be archived. 
  6440.  
  6441.  OpenFlag (USHORT) - input 
  6442.     One-word field indicates the action to be taken if the file exists or does 
  6443.     not exist. 
  6444.  
  6445.     Bit       Description 
  6446.  
  6447.     15-8      Reserved and must be zero. 
  6448.  
  6449.     7-4       0000 = Fail if file does not exist. 
  6450.  
  6451.               0001 = Create file if file does not exist. 
  6452.  
  6453.     3-0       0000 = Fail if the file already exists. 
  6454.  
  6455.               0001 = Open the file if it already exists. 
  6456.  
  6457.               0010 = Replace the file if it already exists. 
  6458.  
  6459.  OpenMode (USHORT) - input 
  6460.     The OpenMode parameter contains the following bit flags: 
  6461.  
  6462.     Bit       Description 
  6463.  
  6464.     15        DASD Open flag: 
  6465.  
  6466.               0 = FileName represents a file to be opened in the normal way. 
  6467.  
  6468.               1 = FileName is "Drive:" and represents a mounted disk or 
  6469.               diskette volume to be opened for direct access. 
  6470.  
  6471.     14        Write-Through flag: 
  6472.  
  6473.               0 = Writes to the file may be run through the file system buffer 
  6474.               cache. 
  6475.  
  6476.               1 = Writes to the file may go through the file system buffer 
  6477.               cache but the sectors are written (actual file I/O completed) 
  6478.               before a synchronous write call returns. This state of the file 
  6479.               defines it as a synchronous file. For synchronous files, this is 
  6480.               a mandatory bit in that the data must be written out to the 
  6481.               medium for synchronous write operations. 
  6482.  
  6483.               This bit is not inherited by child processes. 
  6484.  
  6485.     13        Fail-Errors flag. Media I/O errors are handled as follows: 
  6486.  
  6487.               0 = Reported through the system critical error handler. 
  6488.  
  6489.               1 = Reported directly to the caller by way of return code. 
  6490.  
  6491.               Media I/O errors generated through an IOCTL Category 8 function 
  6492.               always get reported directly to the caller by way of return code. 
  6493.               The Fail-Errors function applies only to non-IOCTL handle-based 
  6494.               file I/O calls. 
  6495.  
  6496.               This bit is not inherited by child processes. 
  6497.  
  6498.     12        No-Cache/Cache flag: 
  6499.  
  6500.               0 = It is advisable for the disk driver to cache the data in I/O 
  6501.               operations on this file. 
  6502.  
  6503.               1 = I/O to the file need not be done through the disk driver 
  6504.               cache. 
  6505.  
  6506.               This bit advises FSDs and device drivers whether it is worth 
  6507.               caching the data. Like the write-through bit, this is a 
  6508.               per-handle bit and is not inherited by child processes. 
  6509.  
  6510.     11        Reserved and must be zero. 
  6511.  
  6512.     10-8      The locality of reference flags contain information about how the 
  6513.               application is to access the file. 
  6514.  
  6515.        Value     Definition 
  6516.        000       No locality known. 
  6517.        001       Mainly sequential access. 
  6518.        010       Mainly random access. 
  6519.        011       Random with some locality. 
  6520.  
  6521.     7         Inheritance flag: 
  6522.  
  6523.               0 = File handle is inherited by a spawned process resulting from 
  6524.               a DosExecPgm call. 
  6525.  
  6526.               1 = File handle is private to the current process. 
  6527.  
  6528.               This bit is not inherited by child processes. 
  6529.  
  6530.     6-4       Sharing Mode flags. This field defines any restrictions to file 
  6531.               access placed by the caller on other processes: 
  6532.  
  6533.        Value     Definition 
  6534.        001       Deny Read/Write access 
  6535.        010       Deny Write access 
  6536.        011       Deny Read access 
  6537.        100       Deny neither Read or Write access (Deny None). Any other value 
  6538.                  is invalid. 
  6539.  
  6540.     3         Reserved and must be zero. 
  6541.  
  6542.     2-0       Access Mode flags.  This field defines file access required by 
  6543.               the caller: 
  6544.  
  6545.        Value     Definition 
  6546.        000       Read-Only access 
  6547.        001       Write-Only access 
  6548.        010       Read/Write access. Any other value is invalid. 
  6549.  
  6550.     Any other combinations are invalid. 
  6551.  
  6552.     File sharing requires the cooperation of sharing processes. This 
  6553.     cooperation is communicated through sharing and access modes. Any sharing 
  6554.     restrictions placed on a file opened by a process are removed when the 
  6555.     process closes the file with a DosClose request. 
  6556.  
  6557.     Sharing Mode 
  6558.        Specify the type of access other processes may have to the file (sharing 
  6559.        mode). 
  6560.        For example, if it is permissible for other processes to continue 
  6561.        reading the file while your process is operating on it, specify Deny 
  6562.        Write.  This sharing mode prevents other processes from writing to the 
  6563.        file but still allows them to read it. 
  6564.  
  6565.     Access Mode 
  6566.        Specify the type of access to the file needed by your process (access 
  6567.        mode). 
  6568.        For example, if your process requires Read/Write access, and another 
  6569.        process has already opened the file with a sharing mode of Deny None, 
  6570.        your DosOpen request succeeds. However, if the file is open with a 
  6571.        sharing mode of Deny Write, your process is denied access. 
  6572.  
  6573.     If the file is inherited by a child process, all sharing and access 
  6574.     restrictions are also inherited. 
  6575.  
  6576.     If an open file handle is duplicated by a call to DosDupHandle, all sharing 
  6577.     and access restrictions are also duplicated. 
  6578.  
  6579.  Reserved (ULONG) - input 
  6580.     Reserved and must be set to zero. 
  6581.  
  6582.  rc (USHORT) - return 
  6583.     Return code descriptions are: 
  6584.  
  6585.     0         NO_ERROR 
  6586.     2         ERROR_FILE_NOT_FOUND 
  6587.     3         ERROR_PATH_NOT_FOUND 
  6588.     4         ERROR_TOO_MANY_OPEN_FILES 
  6589.     5         ERROR_ACCESS_DENIED 
  6590.     12        ERROR_INVALID_ACCESS 
  6591.     26        ERROR_NOT_DOS_DISK 
  6592.     32        ERROR_SHARING_VIOLATION 
  6593.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  6594.     82        ERROR_CANNOT_MAKE 
  6595.     87        ERROR_INVALID_PARAMETER 
  6596.     108       ERROR_DRIVE_LOCKED 
  6597.     110       ERROR_OPEN_FAILED 
  6598.     112       ERROR_DISK_FULL 
  6599.     206       ERROR_FILENAME_EXCED_RANGE 
  6600.     231       ERROR_PIPE_BUSY 
  6601.     99        ERROR_DEVICE_IN_USE 
  6602.  
  6603.  Remarks 
  6604.  
  6605.  A successful DosOpen request for a file returns a handle to access the file. 
  6606.  The read/write pointer is set at the first byte of the file. The pointer's 
  6607.  position may be changed by a DosChgFilePtr request or by read and write 
  6608.  operations on the file. 
  6609.  
  6610.  The file's date and time can be queried by calling DosQFileInfo, and set by 
  6611.  calling DosSetFileInfo. 
  6612.  
  6613.  FileAttribute sets attribute bits for the file object. Attributes of an 
  6614.  existing file can be queried and set by DosQFileMode and DosSetFileMode. A 
  6615.  file's read-only attribute may also be set with the OS/2 ATTRIB command. 
  6616.  
  6617.  FileAttribute cannot be set to Volume Label.  Volume labels cannot be opened. 
  6618.  DosSetFSInfo may be issued with a logical drive number to set volume label 
  6619.  information. 
  6620.  
  6621.  The FileSize parameter affects the size  of the file only when the file is a 
  6622.  new file or a replacement for an existing one. If an existing file is simply 
  6623.  opened, FileSize is ignored. DosNewSize may be called to change the existing 
  6624.  file's size. 
  6625.  
  6626.  The value in FileSize is a recommended size for the file. If allocation of the 
  6627.  full size fails, the open may still succeed. The file system makes a 
  6628.  reasonable attempt to allocate the new size in as nearly contiguous an area as 
  6629.  possible on the medium. When the file size is extended, the value of the new 
  6630.  bytes is undefined. 
  6631.  
  6632.  The DASD Open bit provides direct access to an entire disk or diskette volume, 
  6633.  independent of the file system.  This mode of opening the volume currently 
  6634.  mounted on the drive returns a handle to the caller, which represents the 
  6635.  logical volume as a single file. The caller specifies this handle with a 
  6636.  DosDevIOCtl Category 8 Function 0 request to block other processes from 
  6637.  accessing the logical volume. 
  6638.  
  6639.  The file handle state bits can be set by the DosOpen and DosSetFHandState 
  6640.  requests.  An application can query the file handle state bits as well as the 
  6641.  rest of the Open Mode field, by calling DosQFHandState. If a program running 
  6642.  with the NEWFILES bit set tries to create or replace a file with blanks 
  6643.  immediately preceding the dot on a FAT drive, the system rejects the name. 
  6644.  For example, if c: is a FAT drive, the name "file .txt" is rejected and the 
  6645.  name "file.txt" is accepted. 
  6646.  
  6647.  
  6648.  Family API Considerations 
  6649.  
  6650.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  6651.  Therefore, the following restrictions apply to DosOpen when coding for the DOS 
  6652.  mode: 
  6653.  
  6654.  o OpenMode restrictions: 
  6655.  
  6656.     - Handles returned in response to DASD open are valid only for DosDevIOCtl. 
  6657.     - Inheritance flag is not supported in DOS 2.X. 
  6658.     - Write-Through flag must be set to zero. 
  6659.     - Fail-errors flag must be set to zero. 
  6660.     - Sharing mode field has meaning only if Sharing is loaded in DOS 3.X, 
  6661.       ignored if Sharing is not loaded. Sharing mode is not supported in DOS 
  6662.       2.X. 
  6663.     - Access mode field has meaning only if Sharing is loaded in DOS 3.X, 
  6664.       ignored if Sharing is not loaded. Access mode field is not supported in 
  6665.       DOS 2.X. 
  6666.  
  6667.  o Access mode is valid only if Sharing is loaded. 
  6668.  
  6669.  
  6670.  Named Pipe Considerations 
  6671.  
  6672.  DosOpen opens the client end of a pipe by name and returns a handle.  The open 
  6673.  succeeds only if the pipe is in a listening state; otherwise, the open returns 
  6674.  with ERROR_PIPE_BUSY. The pipe can be busy because of the following reasons: 
  6675.  
  6676.  o All instances of the pipe are already open. 
  6677.  o The pipe is closed but is not yet disconnected by the serving end. 
  6678.  o No DosConnectNmPipe is issued against the pipe after it is disconnected. 
  6679.  
  6680.  Once a given instance has been opened by a client, that same instance cannot 
  6681.  be opened by another client at the same time.  Pipes can only be two-ended; 
  6682.  however, the opening process can duplicate the open handle as many times as 
  6683.  desired. 
  6684.  
  6685.  Pipes are always opened with the pipe-specific states set to B = 0 (to block 
  6686.  reads/writes) and RR = 00 (read the pipe as a byte stream).  The client can 
  6687.  change these modes by calling DosSetNmPHandState if desired. 
  6688.  
  6689.  The access and sharing  modes specified on the open must be consistent with 
  6690.  those specified on the DosMakeNmPipe request. 
  6691.  
  6692.  
  6693. ΓòÉΓòÉΓòÉ 1.92. DosOpen2 ΓòÉΓòÉΓòÉ
  6694.  
  6695.                                Bindings:  C, MASM
  6696.  
  6697. This call opens a new file, an existing file, or a replacement for an existing 
  6698. file.  The opened file can have extended attributes. 
  6699.  
  6700.  DosOpen2    (FileName, FileHandle, ActionTaken, FileSize, FileAttribute, 
  6701.              OpenFlag, OpenMode, EABuf, Reserved) 
  6702.  
  6703.  FileName (PSZ) - input 
  6704.     Address of the ASCIIZ path name of the file to be opened. 
  6705.  
  6706.  FileHandle (PHFILE) - output 
  6707.     Address of the handle for the file. 
  6708.  
  6709.  ActionTaken (PUSHORT) - output 
  6710.     Address of the action taken as a result of DosOpen2. 
  6711.  
  6712.     Value     Definition 
  6713.     0001H     File exists 
  6714.     0002H     File created 
  6715.     0003H     File replaced. 
  6716.  
  6717.  FileSize (ULONG) - input 
  6718.     File's new logical size (EOD), in bytes. This parameter is significant only 
  6719.     when creating a new file or replacing an existing file.  Otherwise, it is 
  6720.     ignored. 
  6721.  
  6722.  FileAttribute (USHORT) - input 
  6723.     File attribute bits.  Defined below: 
  6724.  
  6725.     Bit       Description 
  6726.     15-6      Reserved and must be zero. 
  6727.     5         File archive 
  6728.     4         Subdirectory 
  6729.     3         Reserved and must be zero. 
  6730.     2         System file 
  6731.     1         Hidden file 
  6732.     0         Read only file 
  6733.  
  6734.     These bits may be set individually or in combination.  For example, an 
  6735.     attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file 
  6736.     that should be archived. 
  6737.  
  6738.  OpenFlag (USHORT) - input 
  6739.     One-word field indicates the action to be taken if the file exists or does 
  6740.     not exist. 
  6741.  
  6742.     Bit       Description 
  6743.  
  6744.     15-8      Reserved and must be zero. 
  6745.  
  6746.     7-4       0000 = Fail if file does not exist. 
  6747.  
  6748.               0001 = Create file if file does not exist. 
  6749.  
  6750.     3-0       0000 = Fail if the file already exists. 
  6751.  
  6752.               0001 = Open the file if it already exists. 
  6753.  
  6754.               0010 = Replace the file if it already exists. 
  6755.  
  6756.  OpenMode (ULONG) - input 
  6757.     The OpenMode parameter contains the following bit flags: 
  6758.  
  6759.     Bit       Description 
  6760.  
  6761.     15        DASD Open flag: 
  6762.  
  6763.               0 = FileName represents a file to be opened in the normal way. 
  6764.  
  6765.               1 = FileName is "Drive:" and represents a mounted disk or 
  6766.               diskette volume to be opened for direct access. 
  6767.  
  6768.     14        Write-Through flag: 
  6769.  
  6770.               0 = Writes to the file may be run through the file system buffer 
  6771.               cache. 
  6772.  
  6773.               1 = Writes to the file may go through the file system buffer 
  6774.               cache but the sectors are written (actual file I/O completed) 
  6775.               before a synchronous write call returns. This state of the file 
  6776.               defines it as a synchronous file. For synchronous files, this is 
  6777.               a mandatory bit in that the data must be written out to the 
  6778.               medium for synchronous write operations. 
  6779.  
  6780.               This bit is not inherited by child processes. 
  6781.  
  6782.     13        Fail-Errors flag. Media I/O errors are handled as follows: 
  6783.  
  6784.               0 = Reported through the system critical error handler. 
  6785.  
  6786.               1 = Reported directly to the caller by way of return code. 
  6787.  
  6788.               Media I/O errors generated through an IOCTL Category 8 function 
  6789.               always get reported directly to the caller by way of return code. 
  6790.               The Fail-Errors function applies only to non-IOCTL handle-based 
  6791.               file I/O calls. 
  6792.  
  6793.               This bit is not inherited by child processes. 
  6794.  
  6795.     12        No-Cache/Cache flag: 
  6796.  
  6797.               0 = It is advisable for the disk driver to cache the data in I/O 
  6798.               operations on this file. 
  6799.  
  6800.               1 = I/O to the file need not be done through the disk driver 
  6801.               cache. 
  6802.  
  6803.               This bit advises FSDs and device drivers whether it is worth 
  6804.               caching the data. Like the write-through bit, this is a 
  6805.               per-handle bit and is not inherited by child processes. 
  6806.  
  6807.     11        Reserved and must be zero. 
  6808.  
  6809.     10-8      The locality of reference flags contain information about how the 
  6810.               application is to access the file. 
  6811.  
  6812.        Value     Definition 
  6813.        000       No locality known. 
  6814.        001       Mainly sequential access. 
  6815.        010       Mainly random access. 
  6816.        011       Random with some locality. 
  6817.  
  6818.     7         Inheritance flag: 
  6819.  
  6820.               0 = File handle is inherited by a spawned process resulting from 
  6821.               a DosExecPgm call. 
  6822.  
  6823.               1 = File handle is private to the current process. 
  6824.  
  6825.               This bit is not inherited by child processes. 
  6826.  
  6827.     6-4       Sharing Mode flags. This field defines any restrictions to file 
  6828.               access placed by the caller on other processes: 
  6829.  
  6830.        Value     Definition 
  6831.        001       Deny Read/Write access 
  6832.        010       Deny Write access 
  6833.        011       Deny Read access 
  6834.        100       Deny neither Read or Write access (Deny None). Any other value 
  6835.                  is invalid. 
  6836.  
  6837.     3         Reserved and must be zero. 
  6838.  
  6839.     2-0       Access Mode flags.  This field defines file access required by 
  6840.               the caller: 
  6841.  
  6842.        Value     Definition 
  6843.        000       Read-Only access 
  6844.        001       Write-Only access 
  6845.        010       Read/Write access. Any other value is invalid. 
  6846.  
  6847.     Any other combinations are invalid. 
  6848.  
  6849.     File sharing requires the cooperation of sharing processes. This 
  6850.     cooperation is communicated through sharing and access modes. Any sharing 
  6851.     restrictions placed on a file opened by a process are removed when the 
  6852.     process closes the file with a DosClose request. 
  6853.  
  6854.     Sharing Mode 
  6855.        Specify the type of access other processes may have to the file (sharing 
  6856.        mode). 
  6857.        For example, if it is permissible for other processes to continue 
  6858.        reading the file while your process is operating on it, specify Deny 
  6859.        Write.  This sharing mode prevents other processes from writing to the 
  6860.        file but still allows them to read it. 
  6861.  
  6862.     Access Mode 
  6863.        Specify the type of access to the file needed by your process (access 
  6864.        mode). 
  6865.        For example, if your process requires Read/Write access, and another 
  6866.        process has already opened the file with a sharing mode of Deny None, 
  6867.        your DosOpen2 request succeeds. However, if the file is open with a 
  6868.        sharing mode of Deny Write, your process is denied access. 
  6869.  
  6870.     If the file is inherited by a child process, all sharing and access 
  6871.     restrictions are also inherited. 
  6872.  
  6873.     If an open file handle is duplicated by a call to DosDupHandle, all sharing 
  6874.     and access restrictions are also duplicated. 
  6875.  
  6876.  EABuf (PEAOP) - input/output 
  6877.     Address of the extended attribute buffer, which contains an EAOP structure. 
  6878.     An EAOP structure has the following format: 
  6879.  
  6880.     fpGEAList (PGEALIST) 
  6881.        Address of GEAList. GEAList is a packed array of variable length "get 
  6882.        EA" structures, each containing an EA name and the length of the name. 
  6883.  
  6884.     fpFEAList (PFEALIST) 
  6885.        Address of FEAList. FEAList is a packed array of variable length "full 
  6886.        EA" structures, each containing an EA name and its corresponding value, 
  6887.        as well as the lengths of the name and the value. 
  6888.  
  6889.     oError (ULONG) 
  6890.        Offset into structure where error has occurred. 
  6891.  
  6892.     On input, the fpGEAList field and oError fields are ignored.  The EA 
  6893.     setting operation is performed on the information contained in FEAList. If 
  6894.     extended attributes are not to be defined or modified, then EABuf must be 
  6895.     set to null.  Following is the FEAList format: 
  6896.  
  6897.     cbList (ULONG) 
  6898.        Length of the FEA list, including the length itself. 
  6899.  
  6900.     list (FEA) 
  6901.        List of FEA structures.  An FEA structure has the following format: 
  6902.  
  6903.        Flags (BYTE) 
  6904.           Bit indicator describing the characteristics of the EA being defined. 
  6905.  
  6906.           Bit       Description 
  6907.           7         Critical EA. 
  6908.           6-0       Reserved and must be set to zero. 
  6909.  
  6910.                     If bit 7 is set to 1, this indicates a critical EA.  If bit 
  6911.                     7 is 0, this means the EA is noncritical; that is, the EA 
  6912.                     is not essential to the intended use by an application of 
  6913.                     the file with which it is associated. 
  6914.  
  6915.        cbName (BYTE) 
  6916.           Length of EA ASCIIZ name, which does not include the null character. 
  6917.  
  6918.        cbValue (USHORT) 
  6919.           Length of EA value, which cannot exceed 64KB. 
  6920.  
  6921.        szName (PSZ) 
  6922.           Address of the ASCIIZ name of EA. 
  6923.  
  6924.        aValue (PSZ) 
  6925.           Address of the free-format value of EA. 
  6926.  
  6927.     Note: 
  6928.        The szName and aValue fields are not included as part of header  or 
  6929.        include files.  Because of their variable lengths, these entries must be 
  6930.        built manually. 
  6931.  
  6932.     On output, fpGEAList is unchanged.  fpFEAList is unchanged as is the area 
  6933.     pointed to by fpFEAList.  If an error occurred during the set, oError is 
  6934.     the offset of the FEA where the error occurred. The API return code is the 
  6935.     error code corresponding to the condition generating the error.  If no 
  6936.     error occurred, oError is undefined. 
  6937.  
  6938.     If EABuf is 0x00000000, then no extended attributes are defined for the 
  6939.     file. 
  6940.  
  6941.  Reserved (ULONG) - input 
  6942.     Reserved and must be set to zero. 
  6943.  
  6944.  rc (USHORT) - return 
  6945.     Return code descriptions are: 
  6946.  
  6947.     0         NO_ERROR 
  6948.     2         ERROR_FILE_NOT_FOUND 
  6949.     3         ERROR_PATH_NOT_FOUND 
  6950.     4         ERROR_TOO_MANY_OPEN_FILES 
  6951.     5         ERROR_ACCESS_DENIED 
  6952.     12        ERROR_INVALID_ACCESS 
  6953.     26        ERROR_NOT_DOS_DISK 
  6954.     32        ERROR_SHARING_VIOLATION 
  6955.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  6956.     82        ERROR_CANNOT_MAKE 
  6957.     87        ERROR_INVALID_PARAMETER 
  6958.     108       ERROR_DRIVE_LOCKED 
  6959.     110       ERROR_OPEN_FAILED 
  6960.     112       ERROR_DISK_FULL 
  6961.     206       ERROR_FILENAME_EXCED_RANGE 
  6962.     231       ERROR_PIPE_BUSY 
  6963.     99        ERROR_DEVICE_IN_USE 
  6964.  
  6965.  Remarks 
  6966.  
  6967.  A successful DosOpen2 request for a file returns a handle to access the file. 
  6968.  The read/write pointer is set at the first byte of the file. The pointer's 
  6969.  position may be changed by a DosChgFilePtr request or by read and write 
  6970.  operations on the file. 
  6971.  
  6972.  The file's date and time can be queried by calling DosQFileInfo, and is set by 
  6973.  calling DosSetFileInfo. 
  6974.  
  6975.  FileAttribute sets attribute bits for the file object. Attributes of an 
  6976.  existing file can be queried and set by DosQFileMode and DosSetFileMode. A 
  6977.  file's read-only attribute may also be set with the OS/2 ATTRIB command. 
  6978.  
  6979.  FileAttribute cannot be set to Volume Label.  Volume labels cannot be opened. 
  6980.  DosSetFSInfo may be issued with a logical drive number to set volume label 
  6981.  information. 
  6982.  
  6983.  The FileSize parameter affects the size of the file only when the file is a 
  6984.  new file or a replacement for an existing one. If an existing file is simply 
  6985.  opened, FileSize is ignored. DosNewSize may be called to change the existing 
  6986.  file's size. 
  6987.  
  6988.  The value in FileSize is a recommended size for the file. If allocation of the 
  6989.  full size fails, the open may still succeed. The file system makes a 
  6990.  reasonable attempt to allocate the new size in as nearly contiguous an area as 
  6991.  possible on the medium. When the file size is extended, the value of the new 
  6992.  bytes is undefined. 
  6993.  
  6994.  The DASD Open bit provides direct access to an entire disk or diskette volume, 
  6995.  independent of the file system.  This mode of opening the volume currently 
  6996.  mounted on the drive returns a handle to the caller, which represents the 
  6997.  logical volume as a single file. The caller specifies this handle with a 
  6998.  DosDevIOCtl Category 8 Function 0 request to block other processes from 
  6999.  accessing the logical volume. 
  7000.  
  7001.  The file handle state bits can be set by the DosOpen2 and DosSetFHandState 
  7002.  requests.  An application can query the file handle state bits as well as the 
  7003.  rest of the Open Mode field, by calling DosQFHandState. 
  7004.  
  7005.  Extended attributes can be set by an EAOP structure in EABuf when creating a 
  7006.  file, replacing an existing file, or truncating an existing file. No extended 
  7007.  attributes are set when simply opening an existing file. 
  7008.  
  7009.  A replace operation is logically equivalent to atomically deleting and 
  7010.  re-creating the file.  This means that any extended attributes associated with 
  7011.  the file are also deleted before the file is re-created. 
  7012.  
  7013.  
  7014.  Family API Considerations 
  7015.  
  7016.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  7017.  Therefore, the following restrictions apply to DosOpen when coding for the DOS 
  7018.  mode: 
  7019.  
  7020.  o OpenMode restrictions: 
  7021.  
  7022.     - The high word of OpenMode is ignored and is not error checked. 
  7023.     - Handles returned in response to DASD open are valid only for DosDevIOCtl. 
  7024.     - Inheritance flag is not supported in DOS 2.X. 
  7025.     - Write-Through flag must be set to zero. 
  7026.     - Fail-errors flag must be set to zero. 
  7027.     - Sharing mode field has meaning only if Sharing is loaded in DOS 3.X, 
  7028.       ignored if Sharing is not loaded. Sharing mode is not supported in DOS 
  7029.       2.X. 
  7030.     - Access mode field has meaning only if Sharing is loaded in DOS 3.X, 
  7031.       ignored if Sharing is not loaded. Access mode field is not supported in 
  7032.       DOS 2.X. 
  7033.  
  7034.  o Access mode is valid only if Sharing is loaded. 
  7035.  
  7036.  
  7037. ΓòÉΓòÉΓòÉ 1.93. DosOpenQueue ΓòÉΓòÉΓòÉ
  7038.  
  7039.                                Bindings:  C, MASM
  7040.  
  7041. This call opens a queue for the current process. 
  7042.  
  7043.  DosOpenQueue      (OwnerPID, QueueHandle, QueueName) 
  7044.  
  7045.  OwnerPID (PUSHORT) - output 
  7046.     Address of the process ID of the queue owner. 
  7047.  
  7048.  QueueHandle (PHQUEUE) - output 
  7049.     Address of the write handle of the queue. 
  7050.  
  7051.  QueueName (PSZ) - input 
  7052.     Address of the name of the queue provided by a previous DosCreateQueue 
  7053.     call. 
  7054.  
  7055.  rc (USHORT) - return 
  7056.     Return code descriptions are: 
  7057.  
  7058.     0         NO_ERROR 
  7059.     334       ERROR_QUE_NO_MEMORY 
  7060.     343       ERROR_QUE_NAME_NOT_EXIST 
  7061.  
  7062.  Remarks 
  7063.  
  7064.  A process that creates a queue has access to it with the handle returned by 
  7065.  DosCreateQueue.  Before another process can place elements in the queue with 
  7066.  DosWriteQueue, the process must first obtain the queue handle by issuing 
  7067.  DosOpenQueue. 
  7068.  
  7069.  When specifying the name for the queue, the ASCIIZ name string provided must 
  7070.  include the prefix \QUEUES\. 
  7071.  
  7072.  
  7073. ΓòÉΓòÉΓòÉ 1.94. DosOpenSem ΓòÉΓòÉΓòÉ
  7074.  
  7075.                                Bindings:  C, MASM
  7076.  
  7077. This call opens an existing system semaphore that has been created by another 
  7078. process. 
  7079.  
  7080.  DosOpenSem     (SemHandle, SemName) 
  7081.  
  7082.  SemHandle (PHSEM) - output 
  7083.     Address of the handle of the system semaphore created by DosCreateSem. This 
  7084.     handle must be supplied by any requests directed to the same semaphore. 
  7085.  
  7086.  SemName (PSZ) - input 
  7087.     Address of the name of the system semaphore created by using DosCreateSem. 
  7088.  
  7089.  rc (USHORT) - return 
  7090.     Return code descriptions are: 
  7091.  
  7092.     0         NO_ERROR 
  7093.     100       ERROR_TOO_MANY_SEMAPHORES 
  7094.     106       ERROR_SEM_USER_LIMIT 
  7095.     123       ERROR_INVALID_NAME 
  7096.     187       ERROR_SEM_NOT_FOUND 
  7097.  
  7098.  Remarks 
  7099.  
  7100.  A system semaphore that is created by a call to DosCreateSem with 
  7101.  NoExclusive=1 specified returns a handle, which the creating process uses to 
  7102.  access the semaphore.  Another process that needs to access the semaphore must 
  7103.  call DosOpenSem after the semaphore's creation. DosOpenSem merely returns the 
  7104.  handle of the semaphore; it does not test or change the value of the 
  7105.  semaphore. 
  7106.  
  7107.  If a process has access to any semaphores at the time it issues DosExecPgm to 
  7108.  start a child process, the new process inherits the handles to these 
  7109.  semaphores. However, the new process initially does not own any inherited 
  7110.  semaphores, even if the parent process owns them at the time the child process 
  7111.  is started. Semaphore ownership is obtained by a successful DosSemRequest 
  7112.  call, and only one process can own the semaphore at a time. 
  7113.  
  7114.  When the last process that opened a particular semaphore with a DosCreateSem 
  7115.  or DosOpenSem request closes its handle with a DosCloseSem request, the 
  7116.  semaphore is deleted from memory and must be be redefined by its next user 
  7117.  with a call to DosCreateSem. 
  7118.  
  7119.  
  7120. ΓòÉΓòÉΓòÉ 1.95. DosPeekNmPipe ΓòÉΓòÉΓòÉ
  7121.  
  7122.                                Bindings:  C, MASM
  7123.  
  7124. This call reads pipe without removing the read data from the pipe. 
  7125.  
  7126.  DosPeekNmPipe     (Handle, Buffer, BufferLen, BytesRead, BytesAvail, 
  7127.                    PipeState) 
  7128.  
  7129.  Handle (HPIPE) - input 
  7130.     Handle of the named pipe, returned by DosMakeNmPipe or  DosOpen. 
  7131.  
  7132.  Buffer (PBYTE) - output 
  7133.     Address of the output buffer. 
  7134.  
  7135.  BufferLen (USHORT) - input 
  7136.     Number of bytes to be read. 
  7137.  
  7138.  BytesRead (PUSHORT) - output 
  7139.     Address of the number of bytes read. 
  7140.  
  7141.  BytesAvail (PUSHORT) - output 
  7142.     Address of the 4-byte buffer where the system returns the number of bytes 
  7143.     that were available. The buffer structure is: 
  7144.  
  7145.     2 Bytes   Bytes buffered in pipe (including message header bytes and bytes 
  7146.               peeked). 
  7147.     2 Bytes   Bytes in current message (zero for a byte stream pipe). 
  7148.  
  7149.  PipeState (PUSHORT) - output 
  7150.     Address of a value representing the state of the named pipe. 
  7151.  
  7152.     Value     Definition 
  7153.     1         Disconnected 
  7154.     2         Listening 
  7155.     3         Connected 
  7156.     4         Closing 
  7157.  
  7158.     The pipe is in a disconnected state immediately after: 
  7159.  
  7160.     o A DosMakeNmPipe but before the first DosConnectNmPipe, or 
  7161.     o A DosDisConnectNmPipe but before the next DosConnectNmPipe. A 
  7162.       disconnected pipe has no client end and cannot accept a DosOpen. The 
  7163.       serving end must issue DosConnectNmPipe, so an open can be accepted. 
  7164.  
  7165.       The pipe is in a listening state after a DosConnectNmPipe. A listening 
  7166.       pipe is ready to accept a DosOpen request. If the pipe is not in a 
  7167.       listening state, DosOpen returns ERROR_PIPE_BUSY. 
  7168.  
  7169.       The pipe is in a connected state after a successful DosOpen to the 
  7170.       listening pipe. The connected pipe allows the serving and client ends to 
  7171.       perform I/O, provided both have valid handles. 
  7172.  
  7173.       The pipe is in a closing state after the last DosClose to the pipe from 
  7174.       either the client or server end. 
  7175.  
  7176.       After DosClose has been issued for the client handle and any duplicates, 
  7177.       and the serving end has read all buffered data, the serving end is 
  7178.       returned ERROR_EOF for reads and ERROR_BROKEN_PIPE for writes. The 
  7179.       serving end must acknowledge the closing of the client end by issuing 
  7180.       either DosDisConnectNmPipe or DosClose. Issuing DosClose deallocates the 
  7181.       pipe. 
  7182.  
  7183.  rc (USHORT) - return 
  7184.     Return code descriptions are: 
  7185.  
  7186.     0         NO_ERROR 
  7187.     230       ERROR_BAD_PIPE 
  7188.     231       ERROR_PIPE_BUSY 
  7189.     233       ERROR_PIPE_NOT_CONNECTED 
  7190.  
  7191.  Remarks 
  7192.  
  7193.  DosPeekNmPipe is similar to a DosRead, except the bytes read from the pipe are 
  7194.  not removed. In addition, a DosPeekNmPipe never blocks, regardless of the 
  7195.  blocking mode set.  If the pipe cannot be accessed immediately, 
  7196.  ERROR_PIPE_BUSY is returned. Because the peek cannot block, it returns only 
  7197.  what is currently in the pipe.  Thus, a portion of a message may be returned, 
  7198.  even though the size of the peek can accommodate the entire message. 
  7199.  
  7200.  The value returned in PipeState can be used by the client or the server end to 
  7201.  determine the current state of the pipe and take appropriate action. 
  7202.  
  7203.  
  7204. ΓòÉΓòÉΓòÉ 1.96. DosPeekQueue ΓòÉΓòÉΓòÉ
  7205.  
  7206.                                Bindings:  C, MASM
  7207.  
  7208. This call retrieves an element from a queue without removing it from the queue. 
  7209.  
  7210.  DosPeekQueue     (QueueHandle, Request, DataLength, DataAddress, ElementCode, 
  7211.                   NoWait, ElemPriority, SemaphoreHandle) 
  7212.  
  7213.  QueueHandle (HQUEUE) - input 
  7214.     Handle of the queue to read. 
  7215.  
  7216.  Request (PULONG) - output 
  7217.     Address of the data to be filled in with the following information. 
  7218.  
  7219.     Word      Description 
  7220.  
  7221.     1         The PID of the process that added the element to the queue. 
  7222.  
  7223.     2         Used for event coding by the application.  The data in this word 
  7224.               is the same as that furnished by the Request parameter on the 
  7225.               DosWriteQueue request for the corresponding queue element.  The 
  7226.               value of this data is understood by the client thread and by the 
  7227.               server thread.  There is no special meaning to this data and the 
  7228.               operating system does not alter the data. 
  7229.  
  7230.  DataLength (PUSHORT) - output 
  7231.     Address of the length of the received data. 
  7232.  
  7233.  DataAddress (PULONG) - output 
  7234.     Address of the element retrieved from the queue. 
  7235.  
  7236.  ElementCode (PUSHORT) - input/output 
  7237.     Address of the code that identifies the element to be read. This field is 
  7238.     set to: 
  7239.  
  7240.     Value     Definition 
  7241.  
  7242.       0       Read the element at the beginning of the queue and return the 
  7243.               identifier of the next element. 
  7244.  
  7245.     <> 0      Read the element whose identifier is specified and return the 
  7246.               identifier of the next element. 
  7247.  
  7248.  NoWait (UCHAR) - input 
  7249.     Action to be performed when there are no entries on the queue, shown below. 
  7250.  
  7251.     Value     Definition 
  7252.     0         Requesting thread waits 
  7253.     1         Requesting thread does not wait. 
  7254.  
  7255.  ElemPriority (PBYTE) - output 
  7256.     Address of the element's priority.  This is the value that was specified 
  7257.     for ElemPriority by the DosWriteQueue call that added the element to the 
  7258.     queue. 
  7259.  
  7260.  SemaphoreHandle (ULONG) - input 
  7261.     Handle of a semaphore to be cleared when the queue has data placed into it 
  7262.     and NoWait=0 is specified. If NoWait=1 is specified, this parameter should 
  7263.     be set to null. 
  7264.  
  7265.     The semaphore may be either a RAM or system semaphore. If this handle is 
  7266.     for a RAM semaphore, that semaphore must be in a segment shared between the 
  7267.     process that owns the queue and any process that issues a DosWriteQueue 
  7268.     request to the queue. 
  7269.  
  7270.     If multiple threads are processing elements from the queue using a 
  7271.     NoWait=0, the same semaphore must be provided on all DosPeekQueue or 
  7272.     DosReadQueue requests. 
  7273.  
  7274.  rc (USHORT) - return 
  7275.     Return code descriptions are: 
  7276.  
  7277.     0         NO_ERROR 
  7278.     330       ERROR_QUE_PROC_NOT_OWNED 
  7279.     333       ERROR_QUE_ELEMENT_NOT_EXIST 
  7280.     337       ERROR_QUE_INVALID_HANDLE 
  7281.     342       ERROR_QUE_EMPTY 
  7282.     433       ERROR_QUE_INVALID_WAIT 
  7283.  
  7284.  Remarks 
  7285.  
  7286.  A process that creates a queue with DosCreateQueue owns it. Only the owning 
  7287.  process and any threads it creates can issue DosPeekQueue to examine a queue 
  7288.  element without removing it from the queue.  If the queue is empty and 
  7289.  NoWait=0 is specified, the thread waits for an element to be added to the 
  7290.  queue. If the queue is empty and NoWait=1 is specified, the thread returns 
  7291.  with ERROR_QUE_EMPTY. 
  7292.  
  7293.  The ElementCode parameter returns an indicator for the element being examined. 
  7294.  To examine the first element in the queue, the queue owner issues DosPeekQueue 
  7295.  with ElementCode set to zero. To examine the next element in the queue, the 
  7296.  queue owner uses the value returned in ElementCode as input for the next 
  7297.  DosPeekQueue request, and so on.  By issuing successive peeks, the queue owner 
  7298.  can select a queue element and then remove it from the queue by specifying an 
  7299.  ElementCode value with a DosReadQueue request. 
  7300.  
  7301.  The semaphore provided by SemaphoreHandle is typically used with a 
  7302.  DosMuxSemWait request to wait for a queue or any of several other events. If 
  7303.  DosReadQueue is issued with NoWait=0, it clears the semaphore indicated by 
  7304.  SemaphoreHandle as soon as the element is peeked. 
  7305.  
  7306.  The Request, DataLength and DataBuffer parameters contain data understood by 
  7307.  the thread adding the element to the queue and by the thread that receives the 
  7308.  queue element. There is no special meaning to this data; applications may use 
  7309.  these parameters for any purpose they wish. OS/2 does not alter this data; it 
  7310.  simply copies this data intact. OS/2 does not validate the address of 
  7311.  DataBuffer or the DataLength. 
  7312.  
  7313.  
  7314. ΓòÉΓòÉΓòÉ 1.97. DosPFSActivate ΓòÉΓòÉΓòÉ
  7315.  
  7316.                                Bindings:  C, MASM
  7317.  
  7318. This call specifies the code page and font to make active for the specified 
  7319. printer and system file number. 
  7320.  
  7321.  DosPFSActivate     (SplHandle, BytesWritten, PrinterName, CodePage, FontID, 
  7322.                     SFN, Reserved) 
  7323.  
  7324.  SplHandle (PVOID) - input 
  7325.     Address of the file handle of the temporary spool file that activates code 
  7326.     page and font switching. 
  7327.  
  7328.  BytesWritten (PULONG) - output 
  7329.     Address of the number of bytes written to the temporary spool file. 
  7330.  
  7331.  PrinterName (PSZ) - input 
  7332.     Address of the name of the printer that activates code page and font 
  7333.     switching. 
  7334.  
  7335.  CodePage (USHORT) - input 
  7336.     Active code page for the specified printer and system file number. 
  7337.  
  7338.  FontID (USHORT) - input 
  7339.     Active font within the specified code page for the specified printer and 
  7340.     system file number. 
  7341.  
  7342.     For download fonts, the FontID is that specified in the printer font file. 
  7343.  
  7344.     For cartridge fonts, the FontID is the number specified on the label of the 
  7345.     cartridge and in the DEVINFO statement for the printer. 
  7346.  
  7347.     A value of 0 (0000H) for both the CodePage and FontID indicates that the 
  7348.     hardware default code page and font should be made active. 
  7349.  
  7350.     A value of 0 for the font ID but not the code page indicates that any font 
  7351.     ID is acceptable for the code pages. 
  7352.  
  7353.  SFN (USHORT) - input 
  7354.     System file number of the requester.  The SFN is passed as a parameter in 
  7355.     the monitor packet. 
  7356.  
  7357.  Reserved (ULONG) - input 
  7358.     Reserved must be set to zero. 
  7359.  
  7360.  rc (USHORT) - return 
  7361.     Return code descriptions are listed in following section. 
  7362.  
  7363.  Remarks 
  7364.  
  7365.  DosPFSActivate is intended for use only by applications that replace the 
  7366.  spooler as a print monitor and that do code page switching. Other applications 
  7367.  should use printer IOCTLs to manipulate printer code page switching. 
  7368.  
  7369.  DosPFSActivate is located in SPOOLCP.DLL (not in DOSCALLS.LIB) and requires an 
  7370.  import statement in the module definition file.  See the IBM Operating 
  7371.  System/2 Version 1.2 Building Programs, Module Definition File Statements 
  7372.  section for information regarding the import statement. 
  7373.  
  7374.  Return values are: 
  7375.  
  7376.  2         Code page not available. 
  7377.  4         Font ID not available. 
  7378.  9         Code page switcher internal error. 
  7379.  10        Invalid printer name as input. 
  7380.  13        Received code page request when code page switcher not initialized. 
  7381.  15        System file number table full. Cannot activate another entry. 
  7382.  19        I/O error reading font file control sequence section. 
  7383.  21        I/O error reading font file font definition block. 
  7384.  23        I/O error while writing to temporary spool file. 
  7385.  24        Disk full error while writing to temporary spool file. 
  7386.  25        Bad spool file handle. 
  7387.  
  7388.  
  7389. ΓòÉΓòÉΓòÉ 1.98. DosPFSCloseUser ΓòÉΓòÉΓòÉ
  7390.  
  7391.                                Bindings:  C, MASM
  7392.  
  7393. This call indicates to the Font Switcher that the specified process has closed 
  7394. its spool file. The Font Switcher may then free any resources being used to 
  7395. track code page and font switching for a process. 
  7396.  
  7397.  DosPFSCloseUser     (PrinterName, SFN, Reserved) 
  7398.  
  7399.  PrinterName (PSZ) - input 
  7400.     Address of the name of the printer that closes code page and font 
  7401.     switching. 
  7402.  
  7403.  SFN (USHORT) - input 
  7404.     System File Number of the requester.  The SFN is passed as a parameter in 
  7405.     the monitor packet. 
  7406.  
  7407.  Reserved (ULONG) - input 
  7408.     Reserved must be set to zero. 
  7409.  
  7410.  rc (USHORT) - return 
  7411.     Return code descriptions are listed in the following section. 
  7412.  
  7413.  Remarks 
  7414.  
  7415.  DosPFSCloseUser is intended for use only by applications that replace the 
  7416.  spooler as a print monitor and that do code page switching. Other applications 
  7417.  should use printer IOCTLs to manipulate printer code page switching. 
  7418.  
  7419.  DosPFSCloseUser is located in SPOOLCP.DLL (not in DOSCALLS.LIB)  and requires 
  7420.  an import statement in the module definition file.  Refer to the IBM Operating 
  7421.  System/2 Version 1.2 Building Programs, Module Definition File Statements 
  7422.  section for information regarding the import statement. 
  7423.  
  7424.  Return values are: 
  7425.  
  7426.  8         Attempted to close system file number not active. 
  7427.  9         Code page switcher internal error. 
  7428.  10        Invalid printer name as input. 
  7429.  13        Received code page request when code page switcher not initialized. 
  7430.  
  7431.  
  7432. ΓòÉΓòÉΓòÉ 1.99. DosPFSInit ΓòÉΓòÉΓòÉ
  7433.  
  7434.                                Bindings:  C, MASM
  7435.  
  7436. This call allows the Font Switcher to initialize code page and font switching 
  7437. for a specified printer. 
  7438.  
  7439.  DosPFSInit   (CPHdw, FontFileName, PrinterType, PrinterName, Instances, 
  7440.               Reserved) 
  7441.  
  7442.  CPHdw (PUSHORT) - input 
  7443.     Address of the pointer list, in the following format, that specifies the 
  7444.     hardware code page and fonts on the printer. 
  7445.  
  7446.     Word        Description 
  7447.  
  7448.     Word 0      Number of definitions that follow. 
  7449.  
  7450.     DWord 1/N   Code page number (1st Word of DWord) and Font ID (2nd Word of 
  7451.                 DWord) for each hardware font in order corresponding to the 
  7452.                 hardware code page and font selection numbers. (For example, 
  7453.                 the first code page and font ID value corresponds to the 
  7454.                 default hardware font 0, the second, to hardware font 1, the 
  7455.                 third, to hardware font 2, and so on.  If the default hardware 
  7456.                 font is not known, 0 should be specified for the default code 
  7457.                 page and font). 
  7458.  
  7459.  FontFileName (PSZ) - input 
  7460.     Address of the pathname of the font file of the specified printer that 
  7461.     initiates the code page and font switching. 
  7462.  
  7463.  PrinterType (PSZ) - input 
  7464.     Address of the printer type ID. 
  7465.  
  7466.  PrinterName (PSZ) - input 
  7467.     Address of the name of the printer that initiates code page and font 
  7468.     switching. 
  7469.  
  7470.  Instances (USHORT) - input 
  7471.     Maximum number of different instances of use tracking code page and font 
  7472.     switching. This value is advisory for the Font Switcher allocating enough 
  7473.     resources for the specified number of instances being tracked. 
  7474.  
  7475.  Reserved (ULONG) - input 
  7476.     Reserved must be set to zero. 
  7477.  
  7478.  rc (USHORT) - return 
  7479.     Return code descriptions are listed in the following section. 
  7480.  
  7481.  Remarks 
  7482.  
  7483.  DosPFSInit is intended for use only by applications that replace the spooler 
  7484.  as a print monitor and that do code page switching. Other applications should 
  7485.  use printer IOCTLs to manipulate printer code page switching. 
  7486.  
  7487.  DosPFSInit is located in SPOOLCP.DLL (not DOSCALLS.LIB) and requires an import 
  7488.  statement in the module definition file.  Refer to the IBM Operating System/2 
  7489.  Version 1.2 Building Programs, Module Definition File Statements section for 
  7490.  information regarding the import statement. 
  7491.  
  7492.  Return values are: 
  7493.  
  7494.  1         Code page switcher already initialized 
  7495.  3         User entered too many ROMs in DEVINFO, initialization continued with 
  7496.            the rest 
  7497.  6         Wrong or missing font file ID 
  7498.  9         Code page switcher internal error 
  7499.  10        Invalid printer name as input 
  7500.  11        Printer type input does not match that in font file 
  7501.  12        Could not get storage for control blocks 
  7502.  14        Could not open font file during initialization 
  7503.  17        Switcher reports too many system file number entries 
  7504.  19        I/O error reading font file control sequence section 
  7505.  20        I/O error reading font file header 
  7506.  21        I/O error reading font file font definition block 
  7507.  22        Some fonts bad due to error in font file, initialization continued. 
  7508.  
  7509.  
  7510. ΓòÉΓòÉΓòÉ 1.100. DosPFSQueryAct ΓòÉΓòÉΓòÉ
  7511.  
  7512.                                Bindings:  C, MASM
  7513.  
  7514. This call queries the active code page and font for the specified printer and 
  7515. system file number. 
  7516.  
  7517.  DosPFSQueryAct     (PrinterName, CodePage, FontID, SFN, Reserved) 
  7518.  
  7519.  PrinterName (PSZ) - input 
  7520.     Address of the name of the printer that queries the active code page and 
  7521.     font. 
  7522.  
  7523.  CodePage (PUSHORT) - output 
  7524.     Address of the active code page that returns the specified printer and 
  7525.     System File Number. 
  7526.  
  7527.  FontID (PUSHORT) - output 
  7528.     Address of the active Font ID number that returns the specified printer and 
  7529.     System File Number. 
  7530.  
  7531.  SFN (USHORT) - input 
  7532.     System File Number of the requester.  The SFN is passed as a parameter in 
  7533.     the monitor packet. 
  7534.  
  7535.  Reserved (ULONG) - input 
  7536.     Reserved must be set to zero. 
  7537.  
  7538.  rc (USHORT) - return 
  7539.     Return code descriptions are listed in the following section. 
  7540.  
  7541.  Remarks 
  7542.  
  7543.  DosPFSQueryAct is intended for use only by applications that replace the 
  7544.  spooler as a print monitor and that do code page switching. Other applications 
  7545.  should use printer IOCTLs to manipulate printer code page switching. 
  7546.  
  7547.  DosPFSQueryAct is located in SPOOLCP.DLL (not in DOSCALLS.LIB)  and requires 
  7548.  an import statement in the module definition file.  Refer to the IBM Operating 
  7549.  System/2 Version 1.2 Building Programs, Module Definition File Statements 
  7550.  section for information regarding the import statement. 
  7551.  
  7552.  Return values are: 
  7553.  
  7554.  9         Code page switcher internal error. 
  7555.  10        Invalid printer name as input. 
  7556.  13        Received code page request when code page switcher not initialized. 
  7557.  16        Received request for system file number not in the system file 
  7558.            number table. 
  7559.  
  7560.  
  7561. ΓòÉΓòÉΓòÉ 1.101. DosPFSVerifyFont ΓòÉΓòÉΓòÉ
  7562.  
  7563.                                Bindings:  C, MASM
  7564.  
  7565. This call indicates whether the specified code page and font within that code 
  7566. page are available in the font file for the specified printer. 
  7567.  
  7568.  DosPFSVerifyFont     (PrinterName, CodePage, FontID, Reserved) 
  7569.  
  7570.  PrinterName (PSZ) - input 
  7571.     Address of the name of the printer that queries the code page and font 
  7572.     switching setup. 
  7573.  
  7574.  CodePage (USHORT) - input 
  7575.     Code page to validate. Values are in the range 0 through 65535. 
  7576.  
  7577.  FontID (USHORT) - input 
  7578.     Font ID to validate.  Values are in the range 0 through 65535. A value of 0 
  7579.     indicates that any font within the specified code page is acceptable. 
  7580.  
  7581.  Reserved (ULONG) - input 
  7582.     Reserved must be set to zero. 
  7583.  
  7584.  rc (USHORT) - return 
  7585.     Return code descriptions are listed in the following section. 
  7586.  
  7587.  Remarks 
  7588.  
  7589.  DosPFSVerifyFont is intended for use only by applications that replace the 
  7590.  spooler as a print monitor and that do code page switching. Other applications 
  7591.  should use printer IOCTLs to manipulate printer code page switching. 
  7592.  
  7593.  DosPFSVerifyFont is located in SPOOLCP.DLL (not in DOSCALLS.LIB)  and requires 
  7594.  an import statement in the module definition file.  Refer to the IBM Operating 
  7595.  System/2 Version 1.2 Building Programs, Module Definition File Statements 
  7596.  section for information about the import statement. 
  7597.  
  7598.  Return values are: 
  7599.  
  7600.  2         Code page not available. 
  7601.  4         Font ID not available. 
  7602.  10        Invalid printer name as input. 
  7603.  13        Received code page request when code page switcher not initialized. 
  7604.  
  7605.  
  7606. ΓòÉΓòÉΓòÉ 1.102. DosPhysicalDisk ΓòÉΓòÉΓòÉ
  7607.  
  7608.                                Bindings:  C, MASM
  7609.  
  7610. This call obtains information about partitionable disks. 
  7611.  
  7612.  DosPhysicalDisk      (Function, DataPtr, DataLen, ParmPtr, ParmLen) 
  7613.  
  7614.  Function (USHORT) - input 
  7615.     The functions supported are: 
  7616.  
  7617.     Value     Definition 
  7618.     1         Obtain total number of partitionable disks 
  7619.     2         Obtain a handle to use with Category 9 IOCTLs 
  7620.     3         Release a handle for a partitionable disk. 
  7621.  
  7622.  DataPtr (PBYTE) - output 
  7623.     Address of the buffer where the returned information is placed. 
  7624.  
  7625.  DataLen (USHORT) - input 
  7626.     Length of the data buffer.  The output data for each function is described 
  7627.     below. 
  7628.  
  7629.           FUNCTION   DATALEN         RETURNED INFORMATION
  7630.  
  7631.            1         2               Total number of partitionable disks in
  7632.                                      the system, 1-based.
  7633.  
  7634.            2         2               Handle for the specified partitionable
  7635.                                      disk for the category 9 IOCTLs.
  7636.  
  7637.            3         0               None.  Pointer must be zero.
  7638.  
  7639.     All lengths are in bytes. 
  7640.  
  7641.  ParmPtr (PBYTE) - input 
  7642.     Address of the buffer used for input parameters. 
  7643.  
  7644.  ParmLen (USHORT) - input 
  7645.     Length of the parameter buffer.  The input parameters required for each 
  7646.     function are: 
  7647.  
  7648.  
  7649.           FUNCTION   PARMLEN         INPUT PARAMETERS
  7650.  
  7651.            1         0               None.  Must be set to zero.
  7652.  
  7653.            2         String length   ASCIIZ string that specifies the
  7654.                                      partitionable disk.
  7655.  
  7656.            3         2               Handle obtained from function 2.
  7657.  
  7658.     Note:  All lengths are in bytes.
  7659.  
  7660.  rc (USHORT) - return 
  7661.     Return code descriptions are: 
  7662.  
  7663.     0         NO_ERROR 
  7664.     1         ERROR_INVALID_FUNCTION 
  7665.     5         ERROR_ACCESS_DENIED 
  7666.     6         ERROR_INVALID_HANDLE 
  7667.     33        ERROR_LOCK_VIOLATION 
  7668.     87        ERROR_INVALID_PARAMETER 
  7669.  
  7670.  Remarks 
  7671.  
  7672.  The ASCIIZ string used to specify the partitionable disk must be of the 
  7673.  following format: 
  7674.  
  7675.   number : <null byte>
  7676.  
  7677.  Where: 
  7678.  
  7679.  number         specifies the partitionable disk (1-based) number in ASCII 
  7680.  
  7681.  :              must be present 
  7682.  
  7683.  <null byte>    the byte of 0 for the ASCIIZ string 
  7684.  
  7685.  The handle returned for the specified partitionable disk can only be used with 
  7686.  the DosDevIOCtl call for the Category 9 Generic IOCTL.  Use of the handle for 
  7687.  a physical partitionable disk is not permitted for handle-based file system 
  7688.  function calls, such as DosRead or DosClose. 
  7689.  
  7690.  
  7691. ΓòÉΓòÉΓòÉ 1.103. DosPortAccess ΓòÉΓòÉΓòÉ
  7692.  
  7693.                                Bindings:  C, MASM
  7694.  
  7695. This call requests or releases access to ports for I/O privilege. 
  7696.  
  7697.  DosPortAccess     (Reserved, TypeOfAccess, FirstPort, LastPort) 
  7698.  
  7699.  Reserved (USHORT) - input 
  7700.     Must be set to zero. 
  7701.  
  7702.  TypeOfAccess (USHORT) - input 
  7703.     A request for or release of access to a port. 
  7704.  
  7705.     Value     Definition 
  7706.     0         Request access 
  7707.     1         Release access. 
  7708.  
  7709.  FirstPort (USHORT) - input 
  7710.     Starting (low) number in a contiguous range or a single port. 
  7711.  
  7712.  LastPort (USHORT) - input 
  7713.     Ending (high) number in a contiguous range or a single port. If only one 
  7714.     port is being used, FirstPort and LastPort should both be set to this port. 
  7715.  
  7716.  rc (USHORT) - return 
  7717.     Return code descriptions are: 
  7718.  
  7719.     0         NO_ERROR 
  7720.     5         ERROR_ACCESS_DENIED 
  7721.  
  7722.  Remarks 
  7723.  
  7724.  Note that CLI/STI privilege is also granted automatically. There is no need to 
  7725.  make an additional call to DosCLIAccess. 
  7726.  
  7727.  Applications that perform I/O to port(s) in IOPL segments must request port 
  7728.  access from the operating system. 
  7729.  
  7730.  An application with no IOPL segments that accesses a device through a device 
  7731.  driver or by an interface package such as VIO, does not need to issue this 
  7732.  call. The device driver or interface package is responsible for obtaining the 
  7733.  necessary I/O access. 
  7734.  
  7735.  
  7736. ΓòÉΓòÉΓòÉ 1.104. DosPtrace ΓòÉΓòÉΓòÉ
  7737.  
  7738.                                Bindings:  C, MASM
  7739.  
  7740. This call provides an interface into the OS/2 kernel to facilitate program 
  7741. debugging. 
  7742.  
  7743.  DosPtrace   (PtraceB) 
  7744.  
  7745.  PtraceB (PBYTE) - output 
  7746.     Address of the Ptrace command/data buffer.  This buffer is used to 
  7747.     communicate between the debug program and the DosPtrace routines. 
  7748.  
  7749.  rc (USHORT) - return 
  7750.     Return code descriptions are: 
  7751.  
  7752.     0         NO_ERROR 
  7753.     1         ERROR_INVALID_FUNCTION 
  7754.     5         ERROR_ACCESS_DENIED 
  7755.     115       ERROR_PROTECTION_VIOLATION 
  7756.     303       ERROR_INVALID_PROCID 
  7757.  
  7758.  Remarks 
  7759.  
  7760.  DosPtrace allows a parent process to control the execution of another process 
  7761.  by implementing breakpoint debugging for a debugger. Both the program under 
  7762.  test and the program being debugged must be executing in OS/2 mode. 
  7763.  
  7764.  DosPtrace supports debugging of a process with multiple threads by allowing 
  7765.  the debugger to read and write registers, freeze and resume thread execution, 
  7766.  and get status on the threads. 
  7767.  
  7768.  The debugger must be able to read and write the instructions, data, and 
  7769.  registers of the program being debugged to insert breakpoint instructions. 
  7770.  When a process runs in OS/2 mode, one process cannot directly manipulate the 
  7771.  address space of another process.  OS/2 controls this address space through 
  7772.  the use of the trace flag facility in DosExecPgm and the Ptrace buffer in 
  7773.  DosPtrace. 
  7774.  
  7775.  The steps to program debugging in OS/2 mode follow: 
  7776.  
  7777.   1. The debug program issues DosExecPgm for the program to be debugged, and 
  7778.      specifies the trace option. 
  7779.   2. The debug program calls DosPtrace with the TRC_C_Stop command to 
  7780.      initialize the Ptrace Buffer. 
  7781.   3. The debug program sets up a Ptrace buffer with commands for inserting the 
  7782.      breakpoints and issues repeated DosPtrace requests as necessary. 
  7783.   4. The debug program sets up a Ptrace buffer with a command to begin 
  7784.      execution and issues DosPtrace.  This may be a TRC_CS_Step, or TRC_C_Go. 
  7785.   5. When the kernel DosPtrace program receives control from the program being 
  7786.      debugged, it returns to the debug program with the Ptrace buffer set to 
  7787.      the current register contents and with indicators of the reason for 
  7788.      return. 
  7789.   6. The kernel DosPtrace program receives control at a breakpoint interrupt, 
  7790.      at processor exceptions, or when the program ends. 
  7791.  
  7792.  To debug a process with multiple threads, set a field in the Ptrace buffer 
  7793.  (Ptrace_B.TID)  to the thread ID of the thread of interest.  This causes the 
  7794.  read/write register commands to receive only the register set of the specified 
  7795.  thread. 
  7796.  
  7797.  Note:  For a process with multiple threads, the address space is the same for 
  7798.         all the threads in the process.  When commands are issued to read/write 
  7799.         memory locations or set breakpoints, they affect all the threads in the 
  7800.         process, even when a command is issued with a specific thread ID. 
  7801.  
  7802.  The debugger may suspend and resume specific threads through use of the 
  7803.  TRC_C_Freeze and TRC_C_Resume commands.  Having only selected threads be 
  7804.  affected by the breakpoints is useful for manipulating them while other 
  7805.  threads are suspended. 
  7806.  
  7807.  When a process debugger terminates, the program being debugged also 
  7808.  terminates.  To accomplish this, an internal link between the debugger and the 
  7809.  program being debugged is maintained.  This link is established as a result of 
  7810.  the first successful DosPtrace command.  Once established, this link can not 
  7811.  be reset. 
  7812.  
  7813.  The process being debugged does not need to be a direct child process. In this 
  7814.  situation, a small window of time exists between the DosExecPgm call and the 
  7815.  first DosPtrace call. If the debugger terminates during this window, the 
  7816.  program being debugged cannot be cleaned up. The system automatically 
  7817.  terminates the program that was to be debugged. 
  7818.  
  7819.  Specifying a trace option of 2 with DosStartSession enables a debugger running 
  7820.  in the parent session to trace all processes associated with an application 
  7821.  running in the child session, regardless of whether the process was started by 
  7822.  DosStartSession request or by  DosExecPgm. See DosStartSession for more 
  7823.  information. 
  7824.  
  7825.  Contents of the Ptrace Buffer: 
  7826.  
  7827.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7828.    Γöé PTRACE_B Γöé    Γöé    Γöé STRUCTURE                                        Γöé
  7829.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7830.    Γöé PID      Γöé DW Γöé 0  Γöé ; Process ID of the process being debugged       Γöé
  7831.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7832.    Γöé TID      Γöé DW Γöé 0  Γöé ; Thread ID of the process being debugged        Γöé
  7833.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7834.    Γöé Cmd      Γöé DW Γöé 0  Γöé ; Request to DosPtrace, or DosPtrace result code Γöé
  7835.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7836.    Γöé Value    Γöé DW Γöé ?  Γöé ; Data to DosPtrace, or DosPtrace error code     Γöé
  7837.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7838.    Γöé OffV     Γöé DW Γöé ?  Γöé ; Offset value                                   Γöé
  7839.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7840.    Γöé SegV     Γöé DW Γöé ?  Γöé ; Segment value                                  Γöé
  7841.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7842.    Γöé MTE      Γöé DW Γöé ?  Γöé ; Library Module handle                          Γöé
  7843.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7844.    Γöé Ptrace B Γöé    Γöé    Γöé                                                  Γöé
  7845.    Γöé ENDS     Γöé    Γöé    Γöé                                                  Γöé
  7846.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7847.  
  7848.  Exceptions: 
  7849.  
  7850.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7851.    Γöé PTRACEREGSΓöé    Γöé    Γöé STRUCTURE                        Γöé
  7852.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7853.    Γöé rAX       Γöé DW Γöé ?  Γöé ; Registers AX through SS        Γöé
  7854.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7855.    Γöé rBX       Γöé DW Γöé ?  Γöé                                  Γöé
  7856.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7857.    Γöé rCX       Γöé DW Γöé ?  Γöé                                  Γöé
  7858.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7859.    Γöé rDX       Γöé DW Γöé ?  Γöé                                  Γöé
  7860.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7861.    Γöé rSI       Γöé DW Γöé ?  Γöé                                  Γöé
  7862.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7863.    Γöé rDI       Γöé DW Γöé ?  Γöé                                  Γöé
  7864.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7865.    Γöé rBP       Γöé DW Γöé ?  Γöé                                  Γöé
  7866.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7867.    Γöé rDS       Γöé DW Γöé ?  Γöé                                  Γöé
  7868.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7869.    Γöé rES       Γöé DW Γöé ?  Γöé                                  Γöé
  7870.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7871.    Γöé rIP       Γöé DW Γöé ?  Γöé                                  Γöé
  7872.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7873.    Γöé rCS       Γöé DW Γöé ?  Γöé                                  Γöé
  7874.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7875.    Γöé rF        Γöé DW Γöé ?  Γöé                                  Γöé
  7876.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7877.    Γöé rSP       Γöé DW Γöé ?  Γöé                                  Γöé
  7878.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7879.    Γöé rSS       Γöé DW Γöé ?  Γöé                                  Γöé
  7880.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7881.    Γöé PtraceregsΓöé    Γöé    Γöé                                  Γöé
  7882.    Γöé ENDS      Γöé    Γöé    Γöé                                  Γöé
  7883.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7884.  
  7885.  For the TRC_C_ReadMemB and TRC_C_WriteMemB commands, the remainder of the 
  7886.  Ptrace buffer contains: 
  7887.  
  7888.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7889.    Γöé PTRACEPTR Γöé    Γöé    Γöé STRUCTURE                        Γöé
  7890.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7891.    Γöé OffB      Γöé DW Γöé ?  Γöé ; Buffer Address                 Γöé
  7892.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7893.    Γöé SegB      Γöé DW Γöé ?  Γöé                                  Γöé
  7894.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7895.    Γöé Ptraceptr Γöé    Γöé    Γöé                                  Γöé
  7896.    Γöé ENDS      Γöé    Γöé    Γöé                                  Γöé
  7897.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7898.  
  7899.  DosPtrace Commands:  PTrace_B.Cmd must contain one of the following commands 
  7900.  upon entrance to DosPtrace: 
  7901.  
  7902.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7903.    Γöé TRC_C_Null        Γöé EQU 0   Γöé                   Γöé ; Invalid        Γöé
  7904.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7905.    Γöé TRC_C_ReadMem_I   Γöé EQU 1   Γöé                   Γöé ; Instruction    Γöé
  7906.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7907.    Γöé TRC_C_ReadMem_D   Γöé EQU 2   Γöé                   Γöé ; Data           Γöé
  7908.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7909.    Γöé TRC_C_ReadMem     Γöé EQU     Γöé TRC_C_ReadMem_I   Γöé                  Γöé
  7910.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7911.    Γöé TRC_C_ReadReg     Γöé EQU 3   Γöé                   Γöé                  Γöé
  7912.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7913.    Γöé TRC_C_WriteMem_I  Γöé EQU 4   Γöé                   Γöé ; Instruction    Γöé
  7914.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7915.    Γöé TRC_C_WriteMem_D  Γöé EQU 5   Γöé                   Γöé ; Data           Γöé
  7916.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7917.    Γöé TRC_C_WriteMem    Γöé EQU     Γöé TRC_C_WriteMem_I  Γöé                  Γöé
  7918.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7919.    Γöé TRC_C_WriteReg    Γöé EQU 6   Γöé                   Γöé                  Γöé
  7920.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7921.    Γöé TRC_C_Go          Γöé EQU 7   Γöé                   Γöé                  Γöé
  7922.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7923.    Γöé TRC_C_Term        Γöé EQU 8   Γöé                   Γöé                  Γöé
  7924.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7925.    Γöé TRC_C_SStep       Γöé EQU 9   Γöé                   Γöé                  Γöé
  7926.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7927.    Γöé TRC_C_Stop        Γöé EQU 10  Γöé                   Γöé ; Initialize     Γöé
  7928.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7929.    Γöé TRC_C_Freeze      Γöé EQU 11  Γöé                   Γöé                  Γöé
  7930.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7931.    Γöé TRC_C_Resume      Γöé EQU 12  Γöé                   Γöé                  Γöé
  7932.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7933.    Γöé TRC_C_NumToSel    Γöé EQU 13  Γöé                   Γöé                  Γöé
  7934.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7935.    Γöé TRC_C_GetFPRegs   Γöé EQU 14  Γöé                   Γöé                  Γöé
  7936.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7937.    Γöé TRC_C_SetFPRegs   Γöé EQU 15  Γöé                   Γöé                  Γöé
  7938.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7939.    Γöé TRC_C_GetLibName  Γöé EQU 16  Γöé                   Γöé                  Γöé
  7940.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7941.    Γöé TRC_C_ThrdStat    Γöé EQU 17  Γöé                   Γöé                  Γöé
  7942.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7943.    Γöé TRC_C_ReadMem_B   Γöé EQU 18  Γöé                   Γöé ; Read Block     Γöé
  7944.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7945.    Γöé TRC_C_WriteMem_B  Γöé EQU 19  Γöé                   Γöé ; Write Block    Γöé
  7946.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7947.  
  7948.  Commands and Required Input:  A command is issued by placing the command 
  7949.  number in Ptrace buffer, and calling DosPtrace with that buffer. 
  7950.  
  7951.  All of the commands require that Ptrace_B.PID be the PID of the process to 
  7952.  debug. 
  7953.  
  7954.  TRC_C_Null               Not a valid command 
  7955.  
  7956.  Memory Operations: 
  7957.     For the following commands, SegV:OffV is the affected location, and 
  7958.     Ptrace_B.Value contains the value to write to or that was read from the 
  7959.     debugger's memory.  GDT segments cannot be written to: all except privilege 
  7960.     level 2 and 3 access is disallowed. A write to a shared code segment makes 
  7961.     that segment a non-shared segment before the write. 
  7962.  
  7963.     TRC_C_ReadMem_I          Read instruction. 
  7964.     TRC_C_ReadMem_D          Read data. 
  7965.     TRC_C_ReadMem            Read any memory. 
  7966.     TRC_C_WriteMem_I         Write instruction. 
  7967.     TRC_C_WriteMem_D         Write data. 
  7968.     TRC_C_WriteMem           Write to any memory. 
  7969.  
  7970.  Block operations: 
  7971.     For the block operations, SegV:OffV must point to the starting address in 
  7972.     the debugger's memory, and Value is the number of bytes to copy.  On 
  7973.     return, Value contains the number of bytes actually copied. 
  7974.  
  7975.     TRC_C_ReadMem_B          Read memory block. 
  7976.     TRC_C_WriteMem_B         Write memory block. 
  7977.  
  7978.  Register / Thread Operations: 
  7979.     For the following commands, Ptrace_B.TID must contain the thread ID of the 
  7980.     thread in question.  If the Ptrace_B.TID field is zero: 
  7981.  
  7982.     o TRC_C_ThrdStat returns the number of threads in the process, 
  7983.       (PTrace_B.Value). 
  7984.  
  7985.     o TRC_C_Freeze and TRC_C_Resume affects all of the debugger's threads. 
  7986.  
  7987.     TRC_C_ReadReg            Examine thread's registers. 
  7988.     TRC_C_WriteReg           Write thread's registers. 
  7989.     TRC_C_Freeze             Suspend a thread. 
  7990.     TRC_C_Resume             Resume a suspended thread. 
  7991.     TRC_C_ThrdStat           Get thread status. 
  7992.  
  7993.  Command Operations: 
  7994.     For the following commands, the Ptrace_B.PID must be valid. The Ptrace_B 
  7995.     registers are ignored for these commands.  For TRC_C_Go and TRC_C_SStep, 
  7996.     any thread may gain  control first.  The TRC_C_Term command terminates the 
  7997.     program being debugged. 
  7998.  
  7999.     TRC_C_Go                 Run the program being debugged. 
  8000.     TRC_C_Term               Terminate the program being debugged. 
  8001.     TRC_C_SStep              Run one instruction. 
  8002.     TRC_C_Stop               Initialize PTrace buffer. 
  8003.  
  8004.  Library Support: 
  8005.     For TRC_C_NumToSel, Ptrace_B.Value should be set to the segment number on 
  8006.     entrance, and a valid selector on exit.  Also, Ptrace_B.MTE should be set 
  8007.     to the module's handle.  The MTE identifies the different library files in 
  8008.     the program being debugged. 
  8009.  
  8010.     For TRC_C_GetLibName, SegV:OffV should point to a buffer where the name of 
  8011.     the library is returned. PTrace_B.Value should hold the library's module 
  8012.     handle (MTE). 
  8013.  
  8014.     TRC_C_NumToSel           Convert Segment number to selector. 
  8015.     TRC_C_GetLibName         Return name of module. 
  8016.  
  8017.  Floating Point Support: 
  8018.     For the following two commands, SegV:OffV must contain a pointer to a 94 
  8019.     byte buffer to be used to read/write the floating point registers from/to. 
  8020.  
  8021.     The layout of this area is described in the NPX287 manual under the heading 
  8022.     FSAVE/FRSTOR memory layout. 
  8023.  
  8024.     TRC_C_GetFPRegs          Read floating point registers. 
  8025.     TRC_C_SetFPRegs          Write floating point registers. 
  8026.  
  8027.  DosPtrace Return Codes: 
  8028.     When DosPtrace returns to the debug program, the result is placed in 
  8029.     Ptrace_B.Cmd, and reflects the reason for the return. 
  8030.  
  8031.     The values returned are: 
  8032.  
  8033.          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8034.          Γöé TRC_C_SUC_ret  Γöé EQU 0    Γöé ; Success      Γöé
  8035.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8036.          Γöé TRC_C_ERR_ret  Γöé EQU -1   Γöé ; Error        Γöé
  8037.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8038.          Γöé TRC_C_SIG_ret  Γöé EQU -2   Γöé ; Signal       Γöé
  8039.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8040.          Γöé TRC_C_TBT_ret  Γöé EQU -3   Γöé ; Single Step  Γöé
  8041.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8042.          Γöé TRC_C_BPT_ret  Γöé EQU -4   Γöé ; Breakpoint   Γöé
  8043.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8044.          Γöé TRC_C_NMI_ret  Γöé EQU -5   Γöé ; Parity Error Γöé
  8045.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8046.          Γöé TRC_C_KIL_ret  Γöé EQU -6   Γöé ; Process      Γöé
  8047.          Γöé                Γöé          Γöé dying          Γöé
  8048.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8049.          Γöé TRC_C_GPF_ret  Γöé EQU -7   Γöé ; GP fault     Γöé
  8050.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8051.          Γöé TRC_C_LIB_ret  Γöé EQU -8   Γöé ; Library load Γöé
  8052.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8053.          Γöé TRC_C_FPE_ret  Γöé EQU -9   Γöé ; FP error     Γöé
  8054.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8055.          Γöé TRC_C_THD_ret  Γöé EQU -10  Γöé ; Thread       Γöé
  8056.          Γöé                Γöé          Γöé ending         Γöé
  8057.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8058.          Γöé TRC_C_STP_ret  Γöé EQU -11  Γöé ; Async. Stop. Γöé
  8059.          ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8060.  
  8061.     If Ptrace_B.Cmd is returned as TRC_C_ERR_ret, Ptrace_B.Value is set to one 
  8062.     of the following: 
  8063.  
  8064.     TRACE_BAD_COMMAND             EQU 1 
  8065.     TRACE_CHILD_NOT_FOUND         EQU 2 
  8066.     TRACE_CHILD_UNTRACEABLE       EQU 5 
  8067.  
  8068.     If Ptrace_B.Cmd is returned as TRC_C_SIG_ret, the process is about to 
  8069.     receive a signal. 
  8070.  
  8071.     If Ptrace_B.Cmd is returned as TRC_C_KIL_ret, the process is about to 
  8072.     terminate. 
  8073.  
  8074.     If Ptrace_B.Cmd returns as TRC_C_GPF_ret, the process creates a General 
  8075.     Protection fault.  The fault type is returned in PTrace_B.Value, and 
  8076.     SegV:OffV contains the reference that generated the fault. 
  8077.  
  8078.     If Ptrace_B.Cmd is returned as TRC_C_LIB_ret, a library module has been 
  8079.     loaded.  The new module table entry (MTE)  is returned in Ptrace_B.Value. 
  8080.     This can be used with the library support commands to identify the library 
  8081.     module.  The program module's MTE is returned in PTrace_B.MTE.  In this 
  8082.     case, the initial TRC_C_Stop command should be re-issued until 
  8083.     TRC_C_SUC_ret is returned. 
  8084.  
  8085.     If Ptrace_B.Cmd is returned as TRC_C_FPE_ret, the process has generated a 
  8086.     floating point error. 
  8087.  
  8088.     If Ptrace_B.Cmd is returned as TRC_C_THD_ret, the Ptrace_b.TID field 
  8089.     contains the thread ID of the terminating thread. 
  8090.  
  8091.     If Ptrace_B.Cmd is returned as TRC_C_STP_ret, then the asynchronous stop 
  8092.     caused the debugger to stop. 
  8093.  
  8094.  
  8095. ΓòÉΓòÉΓòÉ 1.105. DosPurgeQueue ΓòÉΓòÉΓòÉ
  8096.  
  8097.                                Bindings:  C, MASM
  8098.  
  8099. This call purges a queue of all elements. 
  8100.  
  8101.  DosPurgeQueue     (QueueHandle) 
  8102.  
  8103.  QueueHandle (HQUEUE) - input 
  8104.     Handle of the queue to purge. 
  8105.  
  8106.  rc (USHORT) - return 
  8107.     Return code descriptions are: 
  8108.  
  8109.     0         NO_ERROR 
  8110.     330       ERROR_QUE_PROC_NOT_OWNED 
  8111.     337       ERROR_QUE_INVALID_HANDLE 
  8112.  
  8113.  Remarks 
  8114.  
  8115.  A process that creates a queue with DosCreateQueue owns it. Only the owning 
  8116.  process and any threads it creates can issue DosPurgeQueue to remove all the 
  8117.  elements from the queue. 
  8118.  
  8119.  
  8120. ΓòÉΓòÉΓòÉ 1.106. DosPutMessage ΓòÉΓòÉΓòÉ
  8121.  
  8122.                                Bindings:  C, MASM
  8123.  
  8124. This call outputs the message in a buffer passed by a caller to the specified 
  8125. handle.  The function formats the buffer to prevent words from wrapping if 
  8126. displayed to a screen. 
  8127.  
  8128.  DosPutMessage     (FileHandle, MessageLength, MessageBuffer) 
  8129.  
  8130.  FileHandle (USHORT) - input 
  8131.     Handle of the output file or device. 
  8132.  
  8133.  MessageLength (USHORT) - input 
  8134.     Length of the message to be output. 
  8135.  
  8136.  MessageBuffer (PCHAR) - input 
  8137.     Address of the buffer that contains the returned message. 
  8138.  
  8139.  rc (USHORT) - return 
  8140.     Return code descriptions are: 
  8141.  
  8142.     0         NO_ERROR 
  8143.     6         ERROR_INVALID_HANDLE 
  8144.     19        ERROR_WRITE_PROTECT 
  8145.     321       ERROR_MR_UN_PERFORM 
  8146.  
  8147.  Remarks 
  8148.  
  8149.  Screen width is assumed to be 80 characters. The DosPutMessage call counts a 
  8150.  CR/LF in the 80 characters that it tries to write to the screen. If a word 
  8151.  extends past column 78, it is put on the next line. DosPutMessage assumes the 
  8152.  starting cursor position is column one when handling a word wrap. 
  8153.  
  8154.  If the last character to be positioned on a line is a double-byte character 
  8155.  that would be bisected, the rule above ensures that the character is not 
  8156.  bisected. 
  8157.  
  8158.  
  8159. ΓòÉΓòÉΓòÉ 1.107. DosQAppType ΓòÉΓòÉΓòÉ
  8160.  
  8161.                                Bindings:  C, MASM
  8162.  
  8163. This call returns the application type of an executable file. 
  8164.  
  8165.  DosQAppType     (ExecutableFileName, AppType) 
  8166.  
  8167.  ExecutableFileName (PSZ) - input 
  8168.     Address of the ASCIIZ string containing the filename of the executable file 
  8169.     where the flags are returned. 
  8170.  
  8171.     If the string appears to be a fully qualified path (contains a " : " in the 
  8172.     second position and/or contains a " \ "), only the indicated 
  8173.     drive:directory is searched. If the string is not a fully qualified path, 
  8174.     the current directory is searched.  If the filename is not found in the 
  8175.     current directory, each drive:directory specification in the PATH defined 
  8176.     in the current program's environment is searched for this file.  Note that 
  8177.     any extension (.xxx) is acceptable for the executable filename.  If no 
  8178.     extension is specified, a default extension of ".exe" is used. AppType is a 
  8179.     word that contains flags denoting the application type, as determined by 
  8180.     reading the executable file header specified by ExecutableFileName. Note 
  8181.     that the call sequence passes a pointer to a location in application memory 
  8182.     to return the application type flags. 
  8183.  
  8184.  AppType (PUSHORT) - output 
  8185.     Address of the application type defined as follows: 
  8186.  
  8187.     Bit       Description 
  8188.  
  8189.     15-6      Reserved. 
  8190.  
  8191.     5         Set to 1 if executable file is PC DOS format.  Bits 0, 1, 2, 3, 
  8192.               and 4 are set to zero. 
  8193.  
  8194.     4         Set to 1 if executable file is a dynamic link module.  Bits 0, 1, 
  8195.               2, 3, and 5 are set to 0. 
  8196.  
  8197.     3         Set to 1 if executable has been "bound" (BIND command) as a 
  8198.               Family API application.  Bits 0, 1 and 2 still apply. 
  8199.  
  8200.     2-0       Bits 2, 1 and 0 indicate application type, as specified in the 
  8201.               header of the executable file. 
  8202.  
  8203.        Value     Definition 
  8204.        000       Application type is not specified in executable header. 
  8205.        001       Application is NOTWINDOWCOMPAT 
  8206.        010       Application type is WINDOWCOMPAT 
  8207.        011       Application type is WINDOWAPI 
  8208.  
  8209.  rc (USHORT) - return 
  8210.     Return code descriptions are: 
  8211.  
  8212.     0         NO_ERROR 
  8213.     2         ERROR_FILE_NOT_FOUND 
  8214.     3         ERROR_PATH_NOT_FOUND 
  8215.     4         ERROR_TOO_MANY_OPEN_FILES 
  8216.     11        ERROR_BAD_FORMAT 
  8217.     15        ERROR_INVALID_DRIVE 
  8218.     32        ERROR_SHARING_VIOLATION 
  8219.     108       ERROR_DRIVE_LOCKED 
  8220.     110       ERROR_OPEN_FAILED 
  8221.     191       ERROR_INVALID_EXE_SIGNATURE 
  8222.     192       ERROR_EXE_MARKED_INVALID 
  8223.  
  8224.  Remarks 
  8225.  
  8226.  This function is used by the Presentation Manager shell to determine the 
  8227.  application type being executed.  The application type is specified at link 
  8228.  time in the module definition file. 
  8229.  
  8230.  
  8231. ΓòÉΓòÉΓòÉ 1.108. DosQCurDir ΓòÉΓòÉΓòÉ
  8232.  
  8233.                                Bindings:  C, MASM
  8234.  
  8235. This call returns the full path name of the current directory for the 
  8236. requesting process for the specified drive. 
  8237.  
  8238.  DosQCurDir     (DriveNumber, DirPath, DirPathLen) 
  8239.  
  8240.  DriveNumber (USHORT) - input 
  8241.     Drive number, for example: 
  8242.  
  8243.     Value     Definition 
  8244.     0         default 
  8245.     1         A 
  8246.     2         B 
  8247.     . 
  8248.     . 
  8249.     . 
  8250.  
  8251.  DirPath (PBYTE) - output 
  8252.     Address of the fully qualified path name of current directory. 
  8253.  
  8254.  DirPathLen (PUSHORT) - input/output 
  8255.     Address of the length of the DirPath buffer.  On input, this field contains 
  8256.     the length of the directory path buffer in bytes. On output, if an error is 
  8257.     returned because the buffer is too small, this field contains the required 
  8258.     length. 
  8259.  
  8260.  rc (USHORT) - return 
  8261.     Return code descriptions are: 
  8262.  
  8263.     0         NO_ERROR 
  8264.     15        ERROR_INVALID_DRIVE 
  8265.     26        ERROR_NOT_DOS_DISK 
  8266.     108       ERROR_DRIVE_LOCKED 
  8267.     111       ERROR_BUFFER_OVERFLOW 
  8268.  
  8269.  Remarks 
  8270.  
  8271.  The drive letter is not part of the returned string.  The string does not 
  8272.  begin with a backslash and is terminated by a byte containing 00H. 
  8273.  
  8274.  The system returns the length of the returned DirPath string in DirPathLen, 
  8275.  which does not include the terminating null byte. In the case where the 
  8276.  DirPath buffer is of insufficient length to hold the current directory path 
  8277.  string, the system returns the required length (in bytes) for DirPath in 
  8278.  DirPathLen. 
  8279.  
  8280.  For FSDs, the case of the current directory is set according to the DirName 
  8281.  passed in, not according to the case of the directories on disk. For example, 
  8282.  if the directory "c:\bin" is created and DosChDir is called with DirName 
  8283.  "c:\bin", the current directory returned by DosQCurDir will be "c:\bin". 
  8284.  
  8285.  Programs running without the NEWFILES bit set are allowed to DosChDir to a 
  8286.  non-8.3 filename format directory. 
  8287.  
  8288.  DosQSysInfo must be used by an application to determine the maximum path 
  8289.  length supported by OS/2.  The returned value should be used to dynamically 
  8290.  allocate buffers that are to be used to store paths. 
  8291.  
  8292.  
  8293. ΓòÉΓòÉΓòÉ 1.109. DosQCurDisk ΓòÉΓòÉΓòÉ
  8294.  
  8295.                                Bindings:  C, MASM
  8296.  
  8297. This call determines the current default drive for the requesting process. 
  8298.  
  8299.  DosQCurDisk     (DriveNumber, LogicalDriveMap) 
  8300.  
  8301.  DriveNumber (PUSHORT) - output 
  8302.     Address of the number of the default drive, for example: 
  8303.  
  8304.     Value     Definition 
  8305.     1         A 
  8306.     2         B 
  8307.     . 
  8308.     . 
  8309.     . 
  8310.  
  8311.  LogicalDriveMap (PULONG) - output 
  8312.     Address of the bit map (stored in the low-order portion of the 32-bit, 
  8313.     doubleword area) where the system returns the mapping of the logical 
  8314.     drives.  Logical Drives A to Z have a one-to-one mapping with the bit 
  8315.     positions 0 to 25 of the map; for example, bit 0 is drive A, bit 1 is drive 
  8316.     B, and so forth. The settings of these bits indicate which drives exist: 
  8317.  
  8318.     Value     Definition 
  8319.     0         The logical drive does not exist. 
  8320.     1         The logical drive exists. 
  8321.  
  8322.  rc (USHORT) - return 
  8323.     Return code description is: 
  8324.  
  8325.     0         NO_ERROR 
  8326.  
  8327.  
  8328. ΓòÉΓòÉΓòÉ 1.110. DosQFHandState ΓòÉΓòÉΓòÉ
  8329.  
  8330.                                Bindings:  C, MASM
  8331.  
  8332. This call queries the state of the specified file. 
  8333.  
  8334.  DosQFHandState     (FileHandle, FileHandleState) 
  8335.  
  8336.  FileHandle (HFILE) - input 
  8337.     Handle of the file to be queried. 
  8338.  
  8339.  FileHandleState (PUSHORT) - output 
  8340.     Address of the contents of the open mode word defined in a previous DosOpen 
  8341.     or DosOpen2 call. 
  8342.  
  8343.     Bit       Description 
  8344.  
  8345.     15        Direct Open flag: 
  8346.  
  8347.               0 = PathName represents a file to be opened in the normal way. 
  8348.  
  8349.               1 = PathName is "Drive:" and represents a mounted disk or 
  8350.               diskette volume to be opened for direct access. 
  8351.  
  8352.     14        Write-Through flag: 
  8353.  
  8354.               0 = Writes to the file may be run through the file system buffer 
  8355.               cache. 
  8356.  
  8357.               1 = Writes to the file may go through the file system buffer 
  8358.               cache but the sectors are written (actual file I/O completed) 
  8359.               before a synchronous write call returns. This state of the file 
  8360.               defines it as a synchronous file. For synchronous files, this is 
  8361.               a mandatory bit in that the data must be written out to the 
  8362.               medium for synchronous write operations. 
  8363.  
  8364.               This bit is not inherited by child processes. 
  8365.  
  8366.     13        Fail-Errors flag. Media I/O errors are handled as follows: 
  8367.  
  8368.               0 = Reported through the system critical error handler. 
  8369.  
  8370.               1 = Reported directly to the caller by return code. 
  8371.  
  8372.               Media I/O errors generated through an IOCTL Category 8 function 
  8373.               always get reported directly to the caller by return code.  The 
  8374.               Fail-Errors function applies only to non-IOCTL handle-based file 
  8375.               I/O calls. 
  8376.  
  8377.               This bit is not inherited by child processes. 
  8378.  
  8379.     12        No-Cache/Cache: 
  8380.  
  8381.               0 = It is advisable for the disk driver to cache the data in I/O 
  8382.               operations on this file. 
  8383.  
  8384.               1 = I/O to the file need not be done through the disk driver 
  8385.               cache. 
  8386.  
  8387.               This bit is an advisory bit, and is used to advise FSDs and 
  8388.               device drivers on whether it is worth caching the data. This bit, 
  8389.               like the write-through bit, is a per-handle bit. 
  8390.  
  8391.               This bit is not inherited by child processes. 
  8392.  
  8393.     11-8      Reserved Bits. 
  8394.  
  8395.     7         Inheritance flag: 
  8396.  
  8397.               0 = File handle is inherited by a spawned process resulting from 
  8398.               a DosExecPgm call. 
  8399.  
  8400.               1 = File handle is private to the current process. 
  8401.  
  8402.               This bit is not inherited by child processes. 
  8403.  
  8404.     6-4       Sharing Mode flags:  The file sharing mode flags define what 
  8405.               operations other processes may perform on the file shown as 
  8406.               follows: 
  8407.  
  8408.        Value     Definition 
  8409.        001       Deny Read/Write access 
  8410.        010       Deny Write access 
  8411.        011       Deny Read access 
  8412.        100       Deny neither Read or Write access (Deny None). 
  8413.  
  8414.                  Any other value is invalid. 
  8415.  
  8416.     3         Reserved Bit. 
  8417.  
  8418.     2-0       Access Mode flags.  The file access is assigned as follows: 
  8419.  
  8420.        Value     Definition 
  8421.        000       Read-Only access 
  8422.        001       Write-Only access 
  8423.        010       Read/Write access. 
  8424.  
  8425.                  Any other value is invalid. 
  8426.  
  8427.  rc (USHORT) - return 
  8428.     Return code descriptions are: 
  8429.  
  8430.     0         NO_ERROR 
  8431.     6         ERROR_INVALID_HANDLE 
  8432.  
  8433.  Remarks 
  8434.  
  8435.  When a critical error occurs that the application cannot handle, it may reset 
  8436.  critical error handling to be performed by the system. This is done by calling 
  8437.  DosSetFHandState to turn off the fail/errors bit and then reissuing the I/O 
  8438.  call. The expected critical error reoccurs, and control is passed to the 
  8439.  system critical error handler. The precise time that the effect of this 
  8440.  function is visible at the application level is unpredictable when 
  8441.  asynchronous I/O is pending. 
  8442.  
  8443.  The DASD Open bit parameter is the "Direct I/O flag." It provides an access 
  8444.  mechanism to a disk or diskette volume independent  of the file system.  This 
  8445.  mode should only be used by systems programs and not by application programs. 
  8446.  
  8447.  
  8448.  Named Pipe Considerations 
  8449.  
  8450.  As defined by OS/2 D = 0.  Other bits as defined by DosMakeNmPipe (serving 
  8451.  end), DosOpen (client end), or the last DosSetFHandState. 
  8452.  
  8453.  
  8454. ΓòÉΓòÉΓòÉ 1.111. DosQFileInfo ΓòÉΓòÉΓòÉ
  8455.  
  8456.                                Bindings:  C, MASM
  8457.  
  8458. This call returns information for a specific file. 
  8459.  
  8460.  DosQFileInfo     (FileHandle, FileInfoLevel, FileInfoBuf, FileInfoBufSize) 
  8461.  
  8462.  FileHandle (HFILE) - input 
  8463.     File handle. 
  8464.  
  8465.  FileInfoLevel (USHORT) -  input 
  8466.     Level of file information required. A value of 1, 2, or 3 can be specified. 
  8467.     Level 4 is reserved. The structures described in FileInfoBuf indicate the 
  8468.     information returned for each of these levels. 
  8469.  
  8470.  FileInfoBuf (PBYTE) -  output 
  8471.     Address of the storage area where the system returns the requested level of 
  8472.     file information. File information, where applicable, is at least as 
  8473.     accurate as the most recent DosClose, DosBufReset,  DosSetFileInfo, or 
  8474.     DosSetPathInfo. 
  8475.  
  8476.     Level 1 Information 
  8477.        FileInfoBuf contains the following structure, to which file information 
  8478.        is returned: 
  8479.  
  8480.        filedate (FDATE) 
  8481.           Structure containing the date of file creation. 
  8482.  
  8483.           Bit       Description 
  8484.           15-9      Year, in binary, of file creation 
  8485.           8-5       Month, in binary, of file creation 
  8486.           4-0       Day, in binary, of file creation. 
  8487.  
  8488.        filetime (FTIME) 
  8489.           Structure containing the time of file creation. 
  8490.  
  8491.           Bit       Description 
  8492.           15-11     Hours, in binary, of file creation 
  8493.           10-5      Minutes, in binary, of file creation 
  8494.           4-0       Seconds, in binary number of two-second increments, of file 
  8495.                     creation. 
  8496.  
  8497.        fileaccessdate (FDATE) 
  8498.           Structure containing the date of last access. See FDATE in filedate. 
  8499.  
  8500.        fileaccesstime (FTIME) 
  8501.           Structure containing the time of last access. See FTIME in filetime. 
  8502.  
  8503.        writeaccessdate (FDATE) 
  8504.           Structure containing the date of last write. See FDATE in filedate. 
  8505.  
  8506.        writeaccesstime (FTIME) 
  8507.           Structure containing the time of last write. See FTIME in filetime. 
  8508.  
  8509.        filesize (ULONG) 
  8510.           File size. 
  8511.  
  8512.        filealloc (ULONG) 
  8513.           Allocated file size. 
  8514.  
  8515.        fileattrib (USHORT) 
  8516.           Attributes of the file, defined in DosSetFileMode. 
  8517.  
  8518.     Level 2 Information 
  8519.        FileInfoBuf contains a structure similar to the Level 1 structure, with 
  8520.        the addition of the cbList field after the fileattrib field. 
  8521.  
  8522.        cbList (ULONG) 
  8523.           On output, this field contains the length of the entire EA set for 
  8524.           the file object.  This value can be used to calculate the size of the 
  8525.           buffer required to hold EA information returned when FileInfoLevel = 
  8526.           3 is specified. 
  8527.  
  8528.     Level 3 Information 
  8529.        FileInfoBuf contains an EAOP structure, which has the following format: 
  8530.  
  8531.        fpGEAList (PGEALIST) 
  8532.           Address of GEAList. GEAList is a packed array of variable length "get 
  8533.           EA" structures, each containing an EA name and the length of the 
  8534.           name. 
  8535.  
  8536.        fpFEAList (PFEALIST) 
  8537.           Address of FEAList. FEAList is a packed array of variable length 
  8538.           "full EA" structures, each containing an EA name and its 
  8539.           corresponding value, as well as the lengths of the name and the 
  8540.           value. 
  8541.  
  8542.        oError (ULONG) 
  8543.           Offset into structure where error has occurred. 
  8544.  
  8545.           On input, FileInfoBuf is an EAOP structure.  fpGEAList points to a 
  8546.           GEA list defining the attribute names whose values are returned. 
  8547.           fpFEAList points to a data area where the relevant FEA list is 
  8548.           returned.  The length field of this FEA list is valid, giving the 
  8549.           size of the FEA list buffer. oError points to the offending GEA entry 
  8550.           in case of error. Following is the format of the GEAList structure: 
  8551.  
  8552.        cbList (ULONG) 
  8553.           Length of the GEA list, including the length itself. 
  8554.  
  8555.        list (GEA) 
  8556.           List of GEA structures.  A GEA structure has the following format: 
  8557.  
  8558.           cbName (BYTE) 
  8559.              Length of EA ASCIIZ name, which does not include the null 
  8560.              character. 
  8561.  
  8562.           szName (CHAR) 
  8563.              ASCIIZ name of EA. 
  8564.  
  8565.              On output, FileInfoBuf is unchanged.  The buffer pointed to by 
  8566.              fpFEAList is filled in with the returned information.  If the 
  8567.              buffer fpFEAList points to isn't large enough to hold the returned 
  8568.              information (ERROR_BUFFER_OVERFLOW) cbList is still valid, 
  8569.              assuming there's at least enough space for it.  Its value is the 
  8570.              size of the entire EA set for the file, even though only a subset 
  8571.              of attributes was requested. Following is the format of the 
  8572.              FEAList structure: 
  8573.  
  8574.        cbList (ULONG) 
  8575.           Length of the FEA list, including the length itself. 
  8576.  
  8577.        list (FEA) 
  8578.           List of FEA structures.  An FEA structure has the following format: 
  8579.  
  8580.           Flags (BYTE) 
  8581.              Bit indicator describing the characteristics of the EA being 
  8582.              defined. 
  8583.  
  8584.              Bit       Description 
  8585.              7         Critical EA. 
  8586.              6-0       Reserved and must be set to zero. 
  8587.  
  8588.              If bit 7 is set to 1, this indicates a critical  EA.  If bit 7 is 
  8589.              0, this means the EA is noncritical; that is, the EA is not 
  8590.              essential to the intended use by an application of the file with 
  8591.              which it is associated. 
  8592.  
  8593.           cbName (BYTE) 
  8594.              Length of EA ASCIIZ name, which does not include the null 
  8595.              character. 
  8596.  
  8597.           cbValue (USHORT) 
  8598.              Length of EA value, which cannot exceed 64KB. 
  8599.  
  8600.           szName (PSZ) 
  8601.              Address of the ASCIIZ name of EA. 
  8602.  
  8603.           aValue (PSZ) 
  8604.              Address of the free-format value of EA. 
  8605.  
  8606.              Note:  The szName and aValue fields are not included as part of 
  8607.                     header or include files.  Because of their variable 
  8608.                     lengths, these entries must be built manually. 
  8609.  
  8610.  FileInfoBufSize (USHORT) - output 
  8611.     Length of FileInfoBuf. 
  8612.  
  8613.  rc (USHORT) - return 
  8614.     Return code descriptions are: 
  8615.  
  8616.     0         NO_ERROR 
  8617.     5         ERROR_ACCESS_DENIED 
  8618.     6         ERROR_INVALID_HANDLE 
  8619.     111       ERROR_BUFFER_OVERFLOW 
  8620.     124       ERROR_INVALID_LEVEL 
  8621.     130       ERROR_DIRECT_ACCESS_HANDLE 
  8622.     254       ERROR_INVALID_EA_NAME 
  8623.     255       ERROR_EA_LIST_INCONSISTENT 
  8624.  
  8625.  Remarks 
  8626.  
  8627.  The FAT file system supports modification of only date and time information 
  8628.  contained in file information level 1. Zero is returned for the creation and 
  8629.  access dates and times. 
  8630.  
  8631.  To return information contained in any of the file information levels, 
  8632.  DosQFileInfo has to be able to read the open file.  DosQFileInfo works only 
  8633.  when the file is opened for read access, with a deny-write sharing mode 
  8634.  specified for access by other processes. If the file is already opened by 
  8635.  another process that has specified conflicting sharing and access modes, a 
  8636.  call to DosOpen or  DosOpen2 fails. 
  8637.  
  8638.  DosEnumAttribute returns the lengths of EAs.  This information can be used to 
  8639.  calculate the size of FileInfoBuf needed to hold full extended attribute (FEA) 
  8640.  information returned by DosQFileInfo when Level 3 is specified.  The size of 
  8641.  the buffer is calculated as follows: 
  8642.  
  8643.  One byte (for fea_usFlags) +
  8644.  One byte (for fea_cbName) +
  8645.  Two bytes (for fea_cbValue) +
  8646.  Value of cbName (for the name of the EA) +
  8647.  One byte (for terminating NULL in fea_cbName) +
  8648.  Value of cbValue (for the value of the EA) 
  8649.  
  8650.  
  8651. ΓòÉΓòÉΓòÉ 1.112. DosQFileMode ΓòÉΓòÉΓòÉ
  8652.  
  8653.                                Bindings:  C, MASM
  8654.  
  8655. This call queries the mode (attribute) of the specified file. 
  8656.  
  8657.  DosQFileMode     (FilePathName, CurrentAttribute, Reserved) 
  8658.  
  8659.  FilePathName (PSZ) - input 
  8660.     Address of the file path name. 
  8661.  
  8662.     DosQSysInfo is called by an application during initialization to determine 
  8663.     the maximum path length allowed by OS/2. 
  8664.  
  8665.  CurrentAttribute (PUSHORT) - output 
  8666.     Address of the file's current attribute. 
  8667.  
  8668.     Bit       Description 
  8669.     15-6      Reserved. 
  8670.     5         File archive 
  8671.     4         Subdirectory 
  8672.     3         Reserved. 
  8673.     2         System file 
  8674.     1         Hidden file 
  8675.     0         Read only file 
  8676.  
  8677.     These bits can be set individually or in combination.  For example, an 
  8678.     attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file 
  8679.     that is archived. 
  8680.  
  8681.  Reserved (ULONG) - input 
  8682.     Reserved must be set to zero. 
  8683.  
  8684.  rc (USHORT) - return 
  8685.     Return code descriptions are: 
  8686.  
  8687.     0         NO_ERROR 
  8688.     2         ERROR_FILE_NOT_FOUND 
  8689.     3         ERROR_PATH_NOT_FOUND 
  8690.     26        ERROR_NOT_DOS_DISK 
  8691.     87        ERROR_INVALID_PARAMETER 
  8692.     108       ERROR_DRIVE_LOCKED 
  8693.     206       ERROR_FILENAME_EXCED_RANGE 
  8694.  
  8695.  Remarks 
  8696.  
  8697.  The `Volume Label' type attribute is not returned by DosQFileMode. DosQFSInfo 
  8698.  may be used for this purpose. 
  8699.  
  8700.  
  8701. ΓòÉΓòÉΓòÉ 1.113. DosQFSAttach ΓòÉΓòÉΓòÉ
  8702.  
  8703.                                Bindings:  C, MASM
  8704.  
  8705. Query information about an attached file system (local or remote), or about a 
  8706. character device or pseudo-character device attached to the file system. 
  8707.  
  8708.  DosQFSAttach     (DeviceName, Ordinal, FSAInfoLevel, DataBuffer, 
  8709.                   DataBufferLen, Reserved) 
  8710.  
  8711.  DeviceName (PSZ) - input 
  8712.     Address of a drive letter or the name of a character or pseudo-character 
  8713.     device. If DeviceName is a drive, it is an ASCIIZ string having the form of 
  8714.     drive letter followed by a colon. If DeviceName is a character or 
  8715.     pseudo-character device name, its format is that of an ASCIIZ string in the 
  8716.     format of an OS/2 file name in a subdirectory called \DEV\. This parameter 
  8717.     is ignored if level 2 or 3 is specified for FSAInfoLevel. 
  8718.  
  8719.  Ordinal (USHORT) - output 
  8720.     Index into the list of character or pseudo-character devices, or the set of 
  8721.     drives.  Ordinal always starts at 1.  The Ordinal position of an item in a 
  8722.     list has no significance at all.  Ordinal is used strictly to step through 
  8723.     the list.  The mapping from Ordinal to item is volatile and may change from 
  8724.     one call to DosQFSAttach to the next. This parameter is ignored if level 1 
  8725.     is specified for FSAInfoLevel. 
  8726.  
  8727.  FSAInfoLevel (USHORT) - input 
  8728.     Level of information returned in DataBuffer: 
  8729.  
  8730.     o Level 0001H returns data for the specific drive or device name referred 
  8731.       to by DeviceName.  The Ordinal field is ignored. 
  8732.  
  8733.     o Level 0002H returns data for the entry in the list of character or 
  8734.       pseudo-character devices selected by Ordinal. The DeviceName field is 
  8735.       ignored. 
  8736.  
  8737.     o Level 0003H returns data for the entry in the list of drives selected by 
  8738.       Ordinal. The DeviceName field is ignored. 
  8739.  
  8740.  DataBuffer (PBYTE) - output 
  8741.     Address of the return information buffer, has the following format: 
  8742.  
  8743.     iType (USHORT) 
  8744.        Type of item. 
  8745.  
  8746.        Value     Definition 
  8747.        1         Resident character device 
  8748.        2         Pseudo-character device 
  8749.        3         Local drive 
  8750.        4         Remote drive attached to FSD. 
  8751.  
  8752.     cbName (USHORT) 
  8753.        Length of item name, not counting null. 
  8754.  
  8755.     szName (UCHAR) 
  8756.        Item name, ASCIIZ string. 
  8757.  
  8758.     cbFSDName (USHORT) 
  8759.        Length of FSD name, not counting null. 
  8760.  
  8761.     szFSDName (UCHAR) 
  8762.        Name of FSD item is attached to, ASCIIZ string. 
  8763.  
  8764.     cbFSAData (USHORT) 
  8765.        Length of FSD Attach data returned by FSD. 
  8766.  
  8767.     rgFSAData (UCHAR) 
  8768.        FSD Attach data returned by FSD. 
  8769.  
  8770.  Note: 
  8771.     The szFSDName is the FSD name exported by the FSD, which is not necessarily 
  8772.     the same as the FSD name in the boot sector. 
  8773.  
  8774.     For local character devices (iType = 1), cbFSDName = 0 and szFSDName 
  8775.     contains only a terminating NULL byte, and cbFSAData = 0. 
  8776.  
  8777.     For local drives (iType = 3), szFSDName contains the name of the FSD 
  8778.     attached to the drive at the time of the call.  This information changes 
  8779.     dynamically.  If the drive is attached to the kernel's resident file 
  8780.     system, szFSDName contains FAT or unknown. Since the resident file system 
  8781.     gets attached to any disk that other FSDs refuse to mount, it is possible 
  8782.     to have a disk that does not contain a recognizable file system, but yet 
  8783.     gets attached to the resident file system.  In this case, it is possible to 
  8784.     detect the difference, and this information would help programs in not 
  8785.     destroying data on a disk that was not properly recognized. 
  8786.  
  8787.  DataBufferLen (PUSHSHORT) - input/output 
  8788.     Address of the byte length of the return buffer.  Upon return, it is the 
  8789.     length of the data returned in DataBuffer by the FSD.  This field must be 
  8790.     initialized. 
  8791.  
  8792.  Reserved (ULONG) - input 
  8793.     Reserved, must be set to zero. 
  8794.  
  8795.  rc (USHORT) - return 
  8796.     Return code descriptions are: 
  8797.  
  8798.     0         NO_ERROR 
  8799.     15        ERROR_INVALID_DRIVE 
  8800.     111       ERROR_BUFFER_OVERFLOW 
  8801.     124       ERROR_INVALID_LEVEL 
  8802.     259       ERROR_NO_MORE_ITEMS 
  8803.  
  8804.  Remarks 
  8805.  
  8806.  Information about all block devices and all character and pseudo-character 
  8807.  devices is returned by this call. 
  8808.  
  8809.  The information returned by this call is highly volatile.  Calling programs 
  8810.  should be aware that the returned information may have already changed by the 
  8811.  time it's returned to them. 
  8812.  
  8813.  The information returned for disks that are attached to the kernel's resident 
  8814.  file system can be used to determine if the kernel definitely recognized the 
  8815.  disk as one with its file system on it, or if the kernel just attached its 
  8816.  file  system to it because no other FSDs mounted the disk. This can be 
  8817.  important information for a program that needs to know what  file system is 
  8818.  attached to the drive.  It is quite easy to get into a situation where the FSD 
  8819.  that recognizes a certain disk has not been installed into the system.  In 
  8820.  such a case, there is a potential for the data on the disk to be destroyed 
  8821.  since the wrong file system is attached to the disk by default. 
  8822.  
  8823.  
  8824. ΓòÉΓòÉΓòÉ 1.114. DosQFSInfo ΓòÉΓòÉΓòÉ
  8825.  
  8826.                                Bindings:  C, MASM
  8827.  
  8828. This call queries information from a file system device. 
  8829.  
  8830.  DosQFSInfo     (DriveNumber, FSInfoLevel, FSInfoBuf, FSInfoBufSize) 
  8831.  
  8832.  DriveNumber (USHORT) - input 
  8833.     Logical drive number (0 = default, 1 = A, and so on). 
  8834.  
  8835.     When a logical drive is specified, the media in the drive is examined 
  8836.     (local drive only) and the request is passed to the FSD responsible for 
  8837.     managing that media or to the FSD that is attached to the drive. 
  8838.  
  8839.  FSInfoLevel (USHORT) - input 
  8840.     Level of file information required. 
  8841.  
  8842.  FSInfoBuf (PBYTE) - output 
  8843.     Address of the storage area where the system returns the requested level of 
  8844.     file information. 
  8845.  
  8846.     Level 1 Information 
  8847.        For FSInfoLevel = 1, information is returned in the following structure: 
  8848.  
  8849.        filesysid (ULONG) 
  8850.           File system ID. 
  8851.  
  8852.        sectornum (ULONG) 
  8853.           Number of sectors per allocation unit. 
  8854.  
  8855.        unitnum (ULONG) 
  8856.           Number of allocation units. 
  8857.  
  8858.        unitavail (ULONG) 
  8859.           Number of allocation units available. 
  8860.  
  8861.        bytesnum (USHORT) 
  8862.           Number of bytes per sector. 
  8863.  
  8864.     Level 2 Information 
  8865.        For FSInfoLevel = 2, the information is returned in the following 
  8866.        format: 
  8867.  
  8868.        reserved (ULONG) 
  8869.           Reserved 
  8870.  
  8871.        volumelength (BYTE) 
  8872.           Length of the volume label, not including the null. 
  8873.  
  8874.        volumelabel (CHAR) 
  8875.           Volume label ASCIIZ string. 
  8876.  
  8877.  FSInfoBufSize (USHORT) 
  8878.     Length of the buffer. 
  8879.  
  8880.  rc (USHORT) - return 
  8881.     Return code descriptions are: 
  8882.  
  8883.     0         NO_ERROR 
  8884.     15        ERROR_INVALID_DRIVE 
  8885.     111       ERROR_BUFFER_OVERFLOW 
  8886.     124       ERROR_INVALID_LEVEL 
  8887.     125       ERROR_NO_VOLUME_LABEL 
  8888.  
  8889.  Remarks 
  8890.  
  8891.  Trailing blanks supplied at volume label definition time are not considered to 
  8892.  be part of the label and are therefore not returned as valid label data. 
  8893.  Volume label is limited to a length of 11 bytes. 
  8894.  
  8895.  Volume Serial Number is a unique 32-bit number used by OS/2 to positively 
  8896.  identify its disk/diskette volumes.  The hard error prompts the user for an 
  8897.  unmounted removable volume by displaying both the Volume Serial Number (as an 
  8898.  8 digit hexadecimal number) and the Volume Label. 
  8899.  
  8900.  If there is no volume serial number on the disk/diskette, the volume serial 
  8901.  number information is returned as binary zeros.  If there is no volume label 
  8902.  on the disk/diskette, the volume label information is returned as blank 
  8903.  spaces.  If there is no volume serial number and/or volume label for 
  8904.  disk/diskette volumes formatted by DOS 3.X, this information is not displayed 
  8905.  by the Hard Error Handler. 
  8906.  
  8907.  
  8908. ΓòÉΓòÉΓòÉ 1.115. DosQHandType ΓòÉΓòÉΓòÉ
  8909.  
  8910.                                Bindings:  C, MASM
  8911.  
  8912. This call determines whether a handle references a file or a device. 
  8913.  
  8914.  DosQHandType     (FileHandle, HandType, FlagWord) 
  8915.  
  8916.  FileHandle (HFILE) - input 
  8917.     File handle. 
  8918.  
  8919.  HandType (PUSHORT) - output 
  8920.     Address of the value indicating the handle type. HandType is composed of 
  8921.     two bytes: 
  8922.  
  8923.     Bit       Description 
  8924.  
  8925.     15        Network bit: 
  8926.  
  8927.               0 = The handle refers to a local file, device, or pipe. 
  8928.  
  8929.               1 = Means that the handle refers to a remote file, device, or 
  8930.               pipe. 
  8931.  
  8932.     14-8      Reserved. 
  8933.  
  8934.     7-0       HandleClass describes the handle class.  It may take on the 
  8935.               following values in the low byte of HandleType: 
  8936.  
  8937.        Value     Definition 
  8938.        0         Handle is for a disk file 
  8939.        1         Handle is for a character device 
  8940.        2         Handle is for a pipe. 
  8941.  
  8942.                  Values greater than 2 are reserved. 
  8943.  
  8944.  FlagWord (PUSHORT) - output 
  8945.     Address of the device driver's attribute word if HandleType indicates a 
  8946.     local character device. 
  8947.  
  8948.  rc (USHORT) - return 
  8949.     Return code descriptions are: 
  8950.  
  8951.     0         NO_ERROR 
  8952.     6         ERROR_INVALID_HANDLE 
  8953.  
  8954.  Remarks 
  8955.  
  8956.  This function allows programs that are interactive or file-oriented to 
  8957.  determine the source of their input.  For example, CMD.EXE suppresses writing 
  8958.  prompts if the input is from a disk file. 
  8959.  
  8960.  
  8961. ΓòÉΓòÉΓòÉ 1.116. DosQNmPHandState ΓòÉΓòÉΓòÉ
  8962.  
  8963.                                Bindings:  C, MASM
  8964.  
  8965. This call returns information for a named pipe's specific handle state. 
  8966.  
  8967.  DosQNmPHandState      (Handle, PipeHandleState) 
  8968.  
  8969.  Handle (HPIPE) - input 
  8970.     Handle of the named pipe returned by DosMakeNmPipe or  DosOpen. 
  8971.  
  8972.  PipeHandleState (PUSHORT) - output 
  8973.     Address of the named pipe handle state: 
  8974.  
  8975.     Bit       Description 
  8976.  
  8977.     15        Blocking; pipe is defined as follows: 
  8978.  
  8979.               0 = Reads/Writes block if no data available. 
  8980.  
  8981.               1 = Reads/Writes return immediately if no data available. 
  8982.  
  8983.               Reads normally block until at least partial data can be returned. 
  8984.               Writes, by default, block until all bytes requested have been 
  8985.               written.  Non-blocking mode (value is 1) changes this behavior as 
  8986.               follows: 
  8987.  
  8988.                - DosRead returns immediately with BytesRead = 0 (as defined in 
  8989.               DosRead) if no data is available. 
  8990.  
  8991.                - DosWrite returns immediately with BytesWritten = 0 (as defined 
  8992.               in DosWrite) if insufficient buffer space is available in the 
  8993.               pipe, or the entire data area is transferred. 
  8994.  
  8995.     14        Server or requester end; end-point of named pipe shown as 
  8996.               follows: 
  8997.  
  8998.               0 = Handle is the client end of a named pipe. 
  8999.  
  9000.               1 = Handle is the server (requester) end of a named pipe. 
  9001.  
  9002.     13-12     Reserved. 
  9003.  
  9004.     11-10     Type of named pipe: 
  9005.  
  9006.               00 = Pipe is a byte stream pipe. 
  9007.  
  9008.               01 = Pipe is a message stream pipe. 
  9009.  
  9010.     9-8       Read mode: 
  9011.  
  9012.               00 = Read pipe as a byte stream. 
  9013.  
  9014.               01 = Read pipe as a message stream. 
  9015.  
  9016.     7-0       Instance count; 8-bit count to control pipe instances. When 
  9017.               making the first instance of a named pipe, this field specifies 
  9018.               how many instances can be created.  Instances are as follows: 
  9019.  
  9020.        Value     Definition 
  9021.          1       This can be the only instance (pipe is unique). 
  9022.        -1        The number of instances is unlimited. 
  9023.          0       Reserved value. 
  9024.  
  9025.  rc (USHORT) - return 
  9026.     Return code descriptions are: 
  9027.  
  9028.     0         NO_ERROR 
  9029.     230       ERROR_BAD_PIPE 
  9030.     233       ERROR_PIPE_NOT_CONNECTED 
  9031.  
  9032.  Remarks 
  9033.  
  9034.  At the serving end, the values returned by DosQNmPHandState are those 
  9035.  originally established by DosMakeNmPipe or a subsequent DosSetNmPHandState. 
  9036.  The values returned by the client end are those originally established by 
  9037.  DosOpen or a subsequent DosSetNmPHandState. 
  9038.  
  9039.  
  9040. ΓòÉΓòÉΓòÉ 1.117. DosQNmPipeInfo ΓòÉΓòÉΓòÉ
  9041.  
  9042.                                Bindings:  C, MASM
  9043.  
  9044. This call returns information for a named pipe. 
  9045.  
  9046.  DosQNmPipeInfo     (Handle, InfoLevel, InfoBuf, InfoBufSize) 
  9047.  
  9048.  Handle (HPIPE) - input 
  9049.     Handle of the named pipe that is returned by DosMakeNmPipe or DosOpen. 
  9050.  
  9051.  InfoLevel (USHORT) - input 
  9052.     Level of the required pipe information.  Only level 1 file information is 
  9053.     supported. 
  9054.  
  9055.  InfoBuf (PBYTE) - output 
  9056.     Address of the storage area that returns the requested level of named pipe 
  9057.     information. For InfoLevel = 1, file information is returned in the 
  9058.     following format: 
  9059.  
  9060.     outbufsize (USHORT) 
  9061.        Actual size of buffer for outgoing I/O. 
  9062.  
  9063.     inbufsize (USHORT) 
  9064.        Actual size of buffer for ingoing I/O. 
  9065.  
  9066.     maxnuminstances (UCHAR) 
  9067.        Maximum allowed number of pipe instances. 
  9068.  
  9069.     numinstances (UCHAR) 
  9070.        Current number of pipe instances. 
  9071.  
  9072.     namelength (UCHAR) 
  9073.        Length of pipe name. 
  9074.  
  9075.     pipename (CHAR) 
  9076.        Name of pipe (including \\ComputerName, if remote). 
  9077.  
  9078.  InfoBufSize (USHORT) - input 
  9079.     Length of InfoBuf. 
  9080.  
  9081.  rc (USHORT) - return 
  9082.     Return code descriptions are: 
  9083.  
  9084.     0         NO_ERROR 
  9085.     111       ERROR_BUFFER_OVERFLOW 
  9086.     124       ERROR_INVALID_LEVEL 
  9087.     230       ERROR_BAD_PIPE 
  9088.  
  9089.  Remarks 
  9090.  
  9091.  DosQNmPipeInfo returns all the information that fits in InfoBuf. 
  9092.  
  9093.  For level 1 information, if the length of the name of the pipe is greater than 
  9094.  255 bytes, then a length of zero is returned in the length field.  The full 
  9095.  ASCIIZ name will still be returned in this case. 
  9096.  
  9097.  
  9098. ΓòÉΓòÉΓòÉ 1.118. DosQNmPipeSemState ΓòÉΓòÉΓòÉ
  9099.  
  9100.                                Bindings:  C, MASM
  9101.  
  9102. This call returns information about local named pipes attached to a specific 
  9103. system semaphore. 
  9104.  
  9105.  DosQNmPipeSemState      (SemHandle, InfoBuf, InfoBufLen) 
  9106.  
  9107.  SemHandle (HSEM) - input 
  9108.     System semaphore handle that was previously attached to a named pipe by 
  9109.     DosSetNmPipeSem. 
  9110.  
  9111.  InfoBuf (PBYTE) - output 
  9112.     Address of the buffer that contains records, or multiple records, for each 
  9113.     named pipe: 
  9114.  
  9115.     pipestatus (UCHAR) 
  9116.        Coded value indicating the state of the named pipe: 
  9117.  
  9118.        Value     Definition 
  9119.        0         End of information buffer (EOF).  No more information records 
  9120.                  follow and subsequent fields in this information record have 
  9121.                  no defined value. 
  9122.        1         Read data available. 
  9123.        2         Write space available. 
  9124.        3         Pipe is closed. 
  9125.  
  9126.     pipestate (UCHAR) 
  9127.        Bit mask indicating additional information about the state of the named 
  9128.        pipe: 
  9129.  
  9130.        Bit        Description 
  9131.        7-1        Reserved 
  9132.        0          A thread is waiting on the other end of the pipe. 
  9133.  
  9134.     keyhandle (USHORT) 
  9135.        Key value associated with SemHandle at the time of the call to 
  9136.        DosSetNmPipeSem. 
  9137.  
  9138.     pipedata (USHORT) 
  9139.        Pipe "data or space" availability state: 
  9140.  
  9141.        Value     Definition 
  9142.        1         Amount of read space available in the pipe. 
  9143.        2         Amount of write data available in the pipe. 
  9144.  
  9145.  InfoBufLen (USHORT) - input 
  9146.     Size in bytes of InfoBuf. 
  9147.  
  9148.  rc (USHORT) - return 
  9149.     Return code descriptions are: 
  9150.  
  9151.     0         NO_ERROR 
  9152.  
  9153.     87        ERROR_INVALID_PARAMETER 
  9154.  
  9155.     111       ERROR_BUFFER_OVERFLOW 
  9156.  
  9157.  Remarks 
  9158.  
  9159.  A record is placed in InfoBuf for each local named pipe that has a semaphore 
  9160.  attached whose handle matches the handle specified and whose state is closed 
  9161.  or allows blocking mode I/O to be done. 
  9162.  
  9163.  There is no guarantee that records in the buffer refer to named pipes opened 
  9164.  by the process making this call.  If the same system semaphore is attached to 
  9165.  different named pipes by multiple processes, information about named pipes 
  9166.  that are not accessible to the caller can be returned.  Thus, cooperating 
  9167.  processes should agree on a convention for key values to help identify the 
  9168.  named pipes of interest.  A key value is associated with the pipe at the time 
  9169.  the semaphore is set with DosSetNmPipeSem. 
  9170.  
  9171.  If a process wants data in the buffer to refer only to its own named pipes, it 
  9172.  must use an exclusive system semaphore. 
  9173.  
  9174.  A process associates a single semaphore with multiple pipes by way of 
  9175.  DosSetNmPipeSem. After waking up from a wait on the semaphore, a thread issues 
  9176.  DosQNmPipeSemState, which returns the I/O state information for all pipes 
  9177.  associated with the semaphore. The thread can scan this information to 
  9178.  determine which pipes can be read or written.  This is more efficient than 
  9179.  polling the pipes with a non-blocking I/O on each pipe. 
  9180.  
  9181.  
  9182. ΓòÉΓòÉΓòÉ 1.119. DosQPathInfo ΓòÉΓòÉΓòÉ
  9183.  
  9184.                                Bindings:  C, MASM
  9185.  
  9186. DosQPathInfo returns attribute and extended attribute information for a file or 
  9187. subdirectory. 
  9188.  
  9189.  DosQPathInfo     (PathName, PathInfoLevel, PathInfoBuf, PathInfoBufSize, 
  9190.                   Reserved) 
  9191.  
  9192.  PathName (PSZ) - input 
  9193.     Address of the ASCIIZ full path name of the file or subdirectory. Global 
  9194.     file name characters can be used in the name only for PathInfoLevels five 
  9195.     and six. 
  9196.  
  9197.     DosQSysInfo is called by an application during initialization to determine 
  9198.     the maximum path length allowed by OS/2. 
  9199.  
  9200.  PathInfoLevel (USHORT) - input 
  9201.     Level of path information required. A value of 1, 2, 3, 5, or 6 can be 
  9202.     specified. Level 4 is reserved. The structures described in PathInfoBuf 
  9203.     indicate the information returned for each of these levels. 
  9204.  
  9205.  PathInfoBuf (PBYTE) - output 
  9206.     Address of the storage area containing the requested level of path 
  9207.     information. Path information, where applicable, is based on the most 
  9208.     recent DosClose, DosBufReset, DosSetFileInfo, or  DosSetPathInfo. 
  9209.  
  9210.     Level 1 Information 
  9211.        PathInfoBuf contains the following structure, to which path information 
  9212.        is returned: 
  9213.  
  9214.        filedate (FDATE) 
  9215.           Structure containing the date of creation. 
  9216.  
  9217.           Bit       Description 
  9218.           15-9      Year, in binary, of creation 
  9219.           8-5       Month, in binary, of creation 
  9220.           4-0       Day, in binary, of creation. 
  9221.  
  9222.        filetime (FTIME) 
  9223.           Structure containing the time of creation. 
  9224.  
  9225.           Bit       Description 
  9226.           15-11     Hours, in binary, of creation 
  9227.           10-5      Minutes, in binary, of creation 
  9228.           4-0       Seconds, in binary number of two-second increments, of 
  9229.                     creation. 
  9230.  
  9231.        fileaccessdate (FDATE) 
  9232.           Structure containing the date of last access. See FDATE in filedate. 
  9233.  
  9234.        fileaccesstime (FTIME) 
  9235.           Structure containing the time of last access. See FTIME in filetime. 
  9236.  
  9237.        writeaccessdate (FDATE) 
  9238.           Structure containing the date of last write. See FDATE in filedate. 
  9239.  
  9240.        writeaccesstime (FTIME) 
  9241.           Structure containing the time of last write. See FTIME in filetime. 
  9242.  
  9243.        filesize (ULONG) 
  9244.           File size. 
  9245.  
  9246.        filealloc (ULONG) 
  9247.           Allocated file size. 
  9248.  
  9249.        fileattrib (USHORT) 
  9250.           Attributes of the file, defined in DosSetFileMode. 
  9251.  
  9252.     Level 2 Information 
  9253.        PathInfoBuf contains a structure similar to the Level 1 structure, with 
  9254.        the addition of the cbList field after the fileattrib field. 
  9255.  
  9256.        cbList (ULONG) 
  9257.           On output, this field contains the length of the entire EA set for 
  9258.           the file object.  This value can be used to calculate the size of the 
  9259.           buffer required to hold EA information returned when PathInfoLevel = 
  9260.           3 is specified. 
  9261.  
  9262.     Level 3 Information 
  9263.        PathInfoBuf contains an EAOP structure, which has the following format: 
  9264.  
  9265.        fpGEAList (PGEALIST) 
  9266.           Address of GEAList. GEAList is a packed array of variable length "get 
  9267.           EA" structures, each containing an EA name and the length of the 
  9268.           name. 
  9269.  
  9270.        fpFEAList (PFEALIST) 
  9271.           Address of FEAList. FEAList is a packed array of variable length 
  9272.           "full EA" structures, each containing an EA name and its 
  9273.           corresponding value, as well as the lengths of the name and the 
  9274.           value. 
  9275.  
  9276.        oError (ULONG) 
  9277.           Offset into structure where error has occurred. 
  9278.  
  9279.           On input, PathInfoBuf is an EAOP structure.  fpGEAList points to a 
  9280.           GEA list defining the attribute names whose values are returned. 
  9281.           fpFEAList points to a data area where the relevant FEA list is 
  9282.           returned.  The length field of this FEA list is valid, giving the 
  9283.           size of the FEA list buffer. oError points to the offending GEA entry 
  9284.           in case of error. Following is the format of the GEAList structure: 
  9285.  
  9286.        cbList (ULONG) 
  9287.           Length of the GEA list, including the length itself. 
  9288.  
  9289.        list (GEA) 
  9290.           List of GEA structures.  A GEA structure has the following format: 
  9291.  
  9292.           cbName (BYTE) 
  9293.              Length of EA ASCIIZ name, which does not include the null 
  9294.              character. 
  9295.  
  9296.           szName (CHAR) 
  9297.              ASCIIZ name of EA. 
  9298.  
  9299.        On output, PathInfoBuf is unchanged.  The buffer pointed to by fpFEAList 
  9300.        is filled in with the returned information.  If the buffer fpFEAList 
  9301.        points to isn't large enough to hold the returned information 
  9302.        (ERROR_BUFFER_OVERFLOW) cbList is still valid, assuming there's at least 
  9303.        enough space for it.  Its value is the size of the entire EA set for the 
  9304.        file, even though  only a subset of attributes was requested. Following 
  9305.        is the format of the FEAList structure: 
  9306.  
  9307.        cbList (ULONG) 
  9308.           Length of the FEA list, including the length itself. 
  9309.  
  9310.        list (FEA) 
  9311.           List of FEA structures.  An FEA structure has the following format: 
  9312.  
  9313.           Flags (BYTE) 
  9314.              Bit indicator describing the characteristics of the EA being 
  9315.              defined. 
  9316.  
  9317.              Bit       Description 
  9318.              7         Critical EA. 
  9319.              6-0       Reserved and must be set to zero. 
  9320.  
  9321.              If bit 7 is set to 1, this indicates a critical EA.  If bit 7 is 
  9322.              0, this means the EA is noncritical; that is, the EA is not 
  9323.              essential to the intended use by an application of the file with 
  9324.              which it is associated. 
  9325.  
  9326.           cbName (BYTE) 
  9327.              Length of EA ASCIIZ name, which does not include the null 
  9328.              character. 
  9329.  
  9330.           cbValue (USHORT) 
  9331.              Length of EA value, which cannot exceed 64KB. 
  9332.  
  9333.           szName (PSZ) 
  9334.              Address of the ASCIIZ name of EA. 
  9335.  
  9336.           aValue (PSZ) 
  9337.              Address of the free-format value of EA. 
  9338.  
  9339.        Note: 
  9340.           The szName and aValue fields are not included as part of header or 
  9341.           include files.  Because of their variable lengths, these entries must 
  9342.           be built manually. 
  9343.  
  9344.     Level 5 Information 
  9345.        Level 5 returns the fully qualified ASCIIZ name of PathName in 
  9346.        PathInfoBuf. The PathName may contain global file name characters. 
  9347.  
  9348.     Level 6 Information 
  9349.        Level 6 requests a file system to verify the correctness of PathName per 
  9350.        its rules of syntax. An erroneous name is indicated by an error return 
  9351.        code. The PathName may contain global file name characters. 
  9352.  
  9353.  PathInfoBufSize (USHORT) - output 
  9354.     Length of PathInfoBuf. 
  9355.  
  9356.  Reserved (ULONG) - input 
  9357.     Reserved, must be set to zero. 
  9358.  
  9359.  rc (USHORT) - return 
  9360.     Return code descriptions are: 
  9361.  
  9362.     0         NO_ERROR 
  9363.     3         ERROR_PATH_NOT_FOUND 
  9364.     32        ERROR_SHARING_VIOLATION 
  9365.     111       ERROR_BUFFER_OVERFLOW 
  9366.     124       ERROR_INVALID_LEVEL 
  9367.     206       ERROR_FILENAME_EXCED_RANGE 
  9368.     254       ERROR_INVALID_EA_NAME 
  9369.     255       ERROR_EA_LIST_INCONSISTENT 
  9370.  
  9371.  Remarks 
  9372.  
  9373.  For DosQPathInfo to return information contained in any of the file 
  9374.  information levels, the file object must be opened for read access, with a 
  9375.  deny-write sharing mode specified for access by other processes. Thus, if the 
  9376.  file object is already accessed by another process that holds conflicting 
  9377.  sharing and access rights, a call to DosQPathInfo fails. 
  9378.  
  9379.  
  9380. ΓòÉΓòÉΓòÉ 1.120. DosQSysInfo ΓòÉΓòÉΓòÉ
  9381.  
  9382.                                Bindings:  C, MASM
  9383.  
  9384. This call returns values of static system variables. 
  9385.  
  9386.  DosQSysInfo    (Index, DataBuf, DataBufLen) 
  9387.  
  9388.  Index (USHORT) - input 
  9389.     Ordinal of the system variable to return. 
  9390.  
  9391.     Index = 0 indicates maximum path length.  The maximum path length is 
  9392.     returned in the first word of the DataBuf. 
  9393.  
  9394.  DataBuf (PBYTE) - output 
  9395.     Address where the system returns the variable value. 
  9396.  
  9397.  DataBufLen (USHORT) - input 
  9398.     Length of the data buffer. 
  9399.  
  9400.  rc (USHORT) - return 
  9401.     Return code descriptions include: 
  9402.  
  9403.     0         NO_ERROR 
  9404.     87        ERROR_INVALID_PARAMETER 
  9405.     111       ERROR_BUFFER_OVERFLOW 
  9406.  
  9407.  Remarks 
  9408.  
  9409.  An OS/2 application may want to reference file objects managed by an 
  9410.  installable file system that supports long file names. Because some 
  9411.  installable file systems may support longer names than others, an application 
  9412.  should issue DosQSysInfo upon initialization. 
  9413.  
  9414.  DosQSysInfo returns the maximum path length supported by the file system 
  9415.  currently installed. The path length includes the drive specifier (d:), the 
  9416.  leading "\" and the trailing null character. 
  9417.  
  9418.  The value returned by DosQSysInfo can be used to allocate buffers for storing 
  9419.  path names returned by requests, for example, to DosFindFirst and DosFindNext. 
  9420.  
  9421.  
  9422. ΓòÉΓòÉΓòÉ 1.121. DosQueryQueue ΓòÉΓòÉΓòÉ
  9423.  
  9424.                                Bindings:  C, MASM
  9425.  
  9426. This call determines the number of elements in a queue. 
  9427.  
  9428.  DosQueryQueue     (QueueHandle, NumberElements) 
  9429.  
  9430.  QueueHandle (HQUEUE) - input 
  9431.     Handle of the queue to find size. 
  9432.  
  9433.  NumberElements (PUSHORT) - output 
  9434.     Address of the number of entries in the queue waiting to be processed. 
  9435.  
  9436.  rc (USHORT) - return 
  9437.     Return code descriptions are: 
  9438.  
  9439.     0         NO_ERROR 
  9440.     337       ERROR_QUE_INVALID_HANDLE 
  9441.  
  9442.  Remarks 
  9443.  
  9444.  Any thread of a process that has access to the queue (because of a 
  9445.  DosCreateQueue or a DosOpenQueue request) may issue  DosQueryQueue to 
  9446.  determine the number of elements currently in the queue. 
  9447.  
  9448.  If the process that created the queue closes it before this request is issued, 
  9449.  ERROR_QUE_INVALID_HANDLE is returned. 
  9450.  
  9451.  
  9452. ΓòÉΓòÉΓòÉ 1.122. DosQVerify ΓòÉΓòÉΓòÉ
  9453.  
  9454.                                Bindings:  C, MASM
  9455.  
  9456. This call returns the value of the verify flag. 
  9457.  
  9458.  DosQVerify   (VerifySetting) 
  9459.  
  9460.  VerifySetting (PUSHORT) - output 
  9461.     Address of the verify mode for the process. 
  9462.  
  9463.     Value     Definition 
  9464.     00H       Verify mode is not active. 
  9465.     01H       Verify mode is active. 
  9466.  
  9467.  rc (USHORT) - return 
  9468.     Return code description is: 
  9469.  
  9470.     0         NO_ERROR 
  9471.  
  9472.  Remarks 
  9473.  
  9474.  When verify is active, OS/2 performs a verify operation each time it does a 
  9475.  file write to assure proper data recording on the disk. Although disk 
  9476.  recording errors are rare, this function has been provided for applications to 
  9477.  verify the proper recording of critical data. 
  9478.  
  9479.  
  9480. ΓòÉΓòÉΓòÉ 1.123. DosR2StackRealloc ΓòÉΓòÉΓòÉ
  9481.  
  9482.                                Bindings:  C, MASM
  9483.  
  9484. This call changes the size of a thread's privilege level 2 stack. 
  9485.  
  9486.  DosR2StackRealloc     (NewSize) 
  9487.  
  9488.  NewSize (USHORT) - input 
  9489.     New size, in bytes, for the privilege level 2 stack. The stack is 
  9490.     reallocated as required and the TSS SP pointer is adjusted accordingly. The 
  9491.     new stack size can not be less than the current stack size. 
  9492.  
  9493.  rc (USHORT) - return 
  9494.     Return code descriptions are: 
  9495.  
  9496.     0         NO_ERROR 
  9497.     8         ERROR_NOT_ENOUGH_MEMORY 
  9498.     196       ERROR_DYNLINK_FROM_INVALID_RING 
  9499.     197       ERROR_IOPL_NOT_ENABLED 
  9500.     207       ERROR_RING2_STACK_IN_USE 
  9501.     216       ERROR_CANNOT_SHRINK 
  9502.  
  9503.  Remarks 
  9504.  
  9505.  This call is provided to allow the privilege level 2 stack to be resized and 
  9506.  to have the TSS adjusted to reflect the new size. The size can not be less 
  9507.  than the current size. 
  9508.  
  9509.  This call can not be made from privilege level 2. 
  9510.  
  9511.  
  9512. ΓòÉΓòÉΓòÉ 1.124. DosRead ΓòÉΓòÉΓòÉ
  9513.  
  9514.                                Bindings:  C, MASM
  9515.  
  9516. This call reads the specified number of bytes from a file, pipe, or device to a 
  9517. buffer location. 
  9518.  
  9519.  DosRead    (FileHandle, BufferArea, BufferLength, BytesRead) 
  9520.  
  9521.  FileHandle (HFILE) - input 
  9522.     File handle obtained from DosOpen. 
  9523.  
  9524.  BufferArea (PVOID) - output 
  9525.     Address of the input buffer. 
  9526.  
  9527.  BufferLength (USHORT) - input 
  9528.     Length, in bytes, to be read. 
  9529.  
  9530.  BytesRead (PUSHORT) - output 
  9531.     Address of the number of bytes read. 
  9532.  
  9533.  rc (USHORT) - return 
  9534.     Return code descriptions are: 
  9535.  
  9536.     0         NO_ERROR 
  9537.     5         ERROR_ACCESS_DENIED 
  9538.     6         ERROR_INVALID_HANDLE 
  9539.     26        ERROR_NOT_DOS_DISK 
  9540.     33        ERROR_LOCK_VIOLATION 
  9541.     109       ERROR_BROKEN_PIPE 
  9542.     234       ERROR_MORE_DATA 
  9543.  
  9544.  Remarks 
  9545.  
  9546.  The requested number of bytes may not be read.  If the value returned in 
  9547.  BytesRead is zero, the process has tried to read from the end of the file. 
  9548.  
  9549.  A BufferLength value of zero is not considered an error.  In the case where 
  9550.  BufferLength is zero, the system treats the request as a null operation. 
  9551.  
  9552.  The file pointer is moved to the desired position by reading, writing, or 
  9553.  issuing DosChgFilePtr. 
  9554.  
  9555.  
  9556.  Family API Considerations 
  9557.  
  9558.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  9559.  Therefore, the following restrictions apply to DosRead when coding for the DOS 
  9560.  mode: 
  9561.  
  9562.  o Only single-byte DosRead calls may be made to the COM device, because the 
  9563.    COM device driver for the DOS environment does not support multiple-byte 
  9564.    I/O. 
  9565.  
  9566.  o When DosRead is called with a handle that is open to CON, the read goes 
  9567.    directly through KbdStringIn using the buffer and length that are provided 
  9568.    to DosRead.  This causes a DOS mode DosRead to behave differently than an 
  9569.    OS/2 mode DosRead. Because an OS/2 mode DosRead buffers the call to 
  9570.    KbdStringIn, this allows the user to enter many more characters. 
  9571.  
  9572.    For example, suppose DosRead is called with a buffer of length 10 from a 
  9573.    handle opened to CON: 
  9574.  
  9575.     - In OS/2 mode, the user is allowed to enter a large number of characters 
  9576.       before KbdStringIn begins beeping (indicating the buffer is full). After 
  9577.       carriage return is pressed, KbdStringIn returns to DosRead. DosRead 
  9578.       returns the first 10 characters to the caller and the remaining 
  9579.       characters on subsequent calls to DosRead from CON. 
  9580.  
  9581.     - In DOS mode, the user is allowed to enter only eight characters (DOS mode 
  9582.       DosRead reserves two characters for CR and LF) before KbdStringIn begins 
  9583.       beeping. DosRead returns the eight characters entered, followed by CR and 
  9584.       LF to the calling program. 
  9585.  
  9586.  
  9587.  Named Pipe Considerations 
  9588.  
  9589.  A named pipe is read as one of the following: 
  9590.  
  9591.  o A byte pipe in byte read mode 
  9592.  o A message pipe in message read mode 
  9593.  o A message pipe in byte read mode. 
  9594.  
  9595.  A byte pipe must be in byte read mode to be read; an error is returned if it 
  9596.  is in message read mode. All currently available data, up to the size 
  9597.  requested, is returned. 
  9598.  
  9599.  A message pipe can be read in either message read mode or byte read mode. When 
  9600.  the message pipe is in message read mode, a read that is larger than the next 
  9601.  available message returns only that message.  BytesRead is set to indicate the 
  9602.  size of the message returned. 
  9603.  
  9604.  A read that is smaller than the next available message returns with the number 
  9605.  of bytes requested and an ERROR_MORE_DATA return code. When resuming the 
  9606.  reading of a message after ERROR_MORE_DATA is returned, a read always blocks 
  9607.  until the next piece (or the rest) of the message can be transferred. 
  9608.  DosPeekNmPipe may be used to determine how many bytes are left in the message. 
  9609.  
  9610.  A message pipe in byte read mode is read as if it were a byte stream, skipping 
  9611.  over message headers.  This is like reading a byte pipe in byte read mode. 
  9612.  
  9613.  When blocking mode is set for a named pipe, a read blocks until data is 
  9614.  available.  In this case, the read never returns with BytesRead =  0 except at 
  9615.  EOF.  In message read mode, messages are always read in their entirety, except 
  9616.  in the case where the message is bigger than the size of the read. 
  9617.  
  9618.  Non-blocking mode allows a return with BytesRead = 0 only when no data is 
  9619.  available at the time of the read. 
  9620.  
  9621.  
  9622. ΓòÉΓòÉΓòÉ 1.125. DosReadAsync ΓòÉΓòÉΓòÉ
  9623.  
  9624.                                Bindings:  C, MASM
  9625.  
  9626. This call asynchronously transfers the specified number of bytes from a file, 
  9627. pipe, or device to a buffer. 
  9628.  
  9629.  DosReadAsync      (FileHandle, RamSemaphore, ReturnCode, BufferArea, 
  9630.                    BufferLength, BytesRead) 
  9631.  
  9632.  FileHandle (HFILE) - input 
  9633.     File handle obtained from DosOpen. 
  9634.  
  9635.  RamSemaphore (PULONG) - input 
  9636.     Address used by the system to signal the caller that the read operation is 
  9637.     complete. 
  9638.  
  9639.  ReturnCode (PUSHORT) - output 
  9640.     Address of the I/O error return code. 
  9641.  
  9642.  BufferArea (PVOID) - output 
  9643.     Address of the input buffer. 
  9644.  
  9645.  BufferLength (USHORT) - input 
  9646.     Length, in bytes, to be read. 
  9647.  
  9648.  BytesRead (PUSHORT) - output 
  9649.     Address of the number of bytes read. 
  9650.  
  9651.  rc (USHORT) - return 
  9652.     Return code descriptions are: 
  9653.  
  9654.     0         NO_ERROR 
  9655.     5         ERROR_ACCESS_DENIED 
  9656.     6         ERROR_INVALID_HANDLE 
  9657.     26        ERROR_NOT_DOS_DISK 
  9658.     33        ERROR_LOCK_VIOLATION 
  9659.     89        ERROR_NO_PROC_SLOTS 
  9660.     109       ERROR_BROKEN_PIPE 
  9661.  
  9662.  Remarks 
  9663.  
  9664.  The requested number of bytes may not be read. If the value in BytesRead is 
  9665.  zero, the process tried to read from the end of the file. 
  9666.  
  9667.  A BufferLength value of zero is not considered an error.  In the case where 
  9668.  BufferLength is zero, the system treats the request as a null operation. 
  9669.  
  9670.  The file pointer is moved to the desired position by reading, writing, or 
  9671.  issuing DosChgFilePtr. 
  9672.  
  9673.  A call to DosReadAsync may return before the read is complete. To wait for an 
  9674.  asynchronous read to complete, RamSemaphore must be set by the application 
  9675.  before the DosReadAsync call is made. The application issues DosSemSet to set 
  9676.  the semaphore, calls  DosReadAsync, and then issues DosSemWait, to wait to be 
  9677.  signaled by the system that the asynchronous read is complete. When 
  9678.  RamSemaphore is cleared and the read operation is complete, ReturnCode can be 
  9679.  checked. 
  9680.  
  9681.  Note:  If it is necessary to make a DosReadAsync request from within a segment 
  9682.         that has I/O privilege, DosCallback may be used to invoke a privilege 
  9683.         level 3 segment that actually issues the DosReadAsync request. 
  9684.  
  9685.  
  9686.  Named Pipe Considerations 
  9687.  
  9688.  A named pipe is read as one of the following: 
  9689.  
  9690.  o A byte pipe in byte read mode 
  9691.  o A message pipe in message read mode 
  9692.  o A message pipe in byte read mode. 
  9693.  
  9694.  A byte pipe must be in byte read mode to be read; an error is returned if it 
  9695.  is in message read mode. All currently available data, up to the size 
  9696.  requested, is returned. 
  9697.  
  9698.  When a message pipe is read in message read mode, a read that is larger than 
  9699.  the next available message returns only that message and BytesRead is set to 
  9700.  indicate the size of the message returned. 
  9701.  
  9702.  A read that is smaller than the next available message returns with the number 
  9703.  of bytes requested and an ERROR_MORE_DATA return code. When resuming the 
  9704.  reading of a message after ERROR_MORE_DATA is returned, a read always blocks 
  9705.  until the next piece (or rest) of the message can be transferred. 
  9706.  DosPeekNmPipe may be used to determine how many bytes are left in the message. 
  9707.  
  9708.  A message pipe in byte read mode is read as if it were a byte stream, skipping 
  9709.  over message headers.  This is like reading a byte pipe in byte read mode. 
  9710.  
  9711.  When blocking mode is set for a named pipe, a read blocks until data is 
  9712.  available.  In this case, the read never returns with BytesRead = 0 except at 
  9713.  EOF.  In message read mode, messages are always read in their entirety, except 
  9714.  in the case where the message is bigger than the size of the read. 
  9715.  
  9716.  Non-blocking mode allows a return with BytesRead = 0 only when trying to read 
  9717.  at the start of a message and no message is available. 
  9718.  
  9719.  
  9720. ΓòÉΓòÉΓòÉ 1.126. DosReadQueue ΓòÉΓòÉΓòÉ
  9721.  
  9722.                                Bindings:  C, MASM
  9723.  
  9724. This call reads an element from a queue and removes it. 
  9725.  
  9726.  DosReadQueue       (QueueHandle, Request, DataLength, DataAddress, 
  9727.                     ElementCode, NoWait, ElemPriority, SemaphoreHandle) 
  9728.  
  9729.  QueueHandle (HQUEUE) - input 
  9730.     Handle of the queue to read from. 
  9731.  
  9732.  Request (PULONG) - output 
  9733.     Address of a data field that returns the following information. 
  9734.  
  9735.     The first word is the PID of the process that added the element to the 
  9736.     queue. 
  9737.  
  9738.     The second word is used for event encoding by the application. The data in 
  9739.     this word is the same as that furnished by the Request parameter on the 
  9740.     DosWriteQueue request for the corresponding queue element. 
  9741.  
  9742.  DataLength (PUSHORT) - output 
  9743.     Address of the length of the data being received. 
  9744.  
  9745.  DataAddress (PULONG) - output 
  9746.     Address of the element being received from the queue. 
  9747.  
  9748.  ElementCode (USHORT) - input 
  9749.     Overrides the normal priority, FIFO-, or LIFO-read ordering.  This operand 
  9750.     is used to identify a specific element that is to be read. This field can 
  9751.     be set to zero to read the first element in the queue, or it can contain an 
  9752.     identifier for a particular element, which was returned to ElementCode by a 
  9753.     DosPeekQueue request. 
  9754.  
  9755.  NoWait (UCHAR) - input 
  9756.     Action to be performed when no entries are found in the queue. 
  9757.  
  9758.     Value     Definition 
  9759.     0         The requesting thread waits. 
  9760.     1         The requesting thread does not wait. 
  9761.  
  9762.  ElemPriority (PBYTE) - output 
  9763.     Address of the element's priority.  This is the value that was specified 
  9764.     for ElemPriority by the DosWriteQueue call that added the element to the 
  9765.     queue. ElemPriority is a numeric value in the range of 0 to 15, with 15 
  9766.     being the highest priority. 
  9767.  
  9768.  SemaphoreHandle (HSEM) - input 
  9769.     Handle of the semaphore cleared when an element is written to the queue and 
  9770.     NoWait=0 is specified. If NoWait=1 is specified, this parameter should be 
  9771.     set to null. 
  9772.  
  9773.     The semaphore can be either a RAM or system semaphore. If the semaphore is 
  9774.     a RAM semaphore, it must be in a segment that is shared between the process 
  9775.     that owns the queue and any process that issues a DosWriteQueue request to 
  9776.     the queue. 
  9777.  
  9778.     If multiple threads are processing elements from the queue using NoWait=0, 
  9779.     the same semaphore must be provided on all DosPeekQueue or DosReadQueue 
  9780.     requests. 
  9781.  
  9782.  rc (USHORT) - return 
  9783.     Return code descriptions are: 
  9784.  
  9785.     0         NO_ERROR 
  9786.     330       ERROR_QUE_PROC_NOT_OWNED 
  9787.     333       ERROR_QUE_ELEMENT_NOT_EXIST 
  9788.     337       ERROR_QUE_INVALID_HANDLE 
  9789.     342       ERROR_QUE_EMPTY 
  9790.     433       ERROR_QUE_INVALID_WAIT 
  9791.  
  9792.  Remarks 
  9793.  
  9794.  A process that creates a queue with DosCreateQueue owns it. Only the owning 
  9795.  process and any threads it creates can issue DosReadQueue to remove an element 
  9796.  from the queue. If the queue is empty and NoWait = 0 is specified, the thread 
  9797.  waits for an element to be written to the queue. If the queue is empty and 
  9798.  NoWait = 1 is specified, the thread returns with ERROR_QUE_EMPTY. 
  9799.  
  9800.  If ElementCode is set to zero, the elements in the queue are removed in the 
  9801.  order specified at the time of the queue's creation (FIFO, LIFO, or priority). 
  9802.  
  9803.  ElementCode can also be set to a value returned by DosPeekQueue, which uses 
  9804.  ElementCode to return identifiers for successive queue elements.  The 
  9805.  assigning of identifiers by DosPeekQueue to individual queue elements allows 
  9806.  the queue owner to examine a queue element with DosPeekQueue and compare it 
  9807.  with a queue element it has read. 
  9808.  
  9809.  The semaphore provided by SemaphoreHandle is typically used by a DosMuxSemWait 
  9810.  request to wait for an element to be written to a queue or other events. If 
  9811.  DosReadQueue is issued with NoWait=0, it clears the semaphore indicated by 
  9812.  SemaphoreHandle as soon as the element is read. 
  9813.  
  9814.  The Request, DataLength and DataAddress parameters contain data understood by 
  9815.  the thread adding the element to the queue and by the thread that receives the 
  9816.  queue element. There is no special meaning to this data; applications may use 
  9817.  these parameters for any purpose they wish. OS/2 does not alter this data; it 
  9818.  simply copies this data intact. OS/2 does not validate the address of 
  9819.  DataBuffer or the DataLength. 
  9820.  
  9821.  
  9822. ΓòÉΓòÉΓòÉ 1.127. DosReallocHuge ΓòÉΓòÉΓòÉ
  9823.  
  9824.                                Bindings:  C, MASM
  9825.  
  9826. This call changes the size of memory originally allocated by DosAllocHuge. 
  9827.  
  9828.  DosReallocHuge    (NumSeg, Size, Selector) 
  9829.  
  9830.  NumSeg (USHORT) - input 
  9831.     Number of 65536 byte segments requested. 
  9832.  
  9833.  Size (USHORT) - input 
  9834.     Number of bytes requested in the last non-65536 byte segment.  A value of 0 
  9835.     indicates none. 
  9836.  
  9837.  Selector (SEL) - input 
  9838.     Selector returned on a previous DosAllocHuge. 
  9839.  
  9840.  rc (USHORT) - return 
  9841.     Return code descriptions are: 
  9842.  
  9843.     0         NO_ERROR 
  9844.     8         ERROR_NOT_ENOUGH_MEMORY 
  9845.     87        ERROR_INVALID_PARAMETER 
  9846.  
  9847.  Remarks 
  9848.  
  9849.  DosReallocHuge is called to change the size of unshared or shared huge memory 
  9850.  allocated by DosAllocHuge. The selector used for this call must be the one 
  9851.  returned by the DosAllocHuge request. 
  9852.  
  9853.  Normally, segments allocated as shared (AllocFlags bits 0 and 1 were set) 
  9854.  cannot be decreased in size. However, if AllocFlags bit 3 was also set, the 
  9855.  shared segment's size can be decreased. 
  9856.  
  9857.  DosReallocHuge is also called to reallocate a segment allocated as discardable 
  9858.  (AllocFlags bit 2 set) after the segment is discarded by the system. The call 
  9859.  to DosReallocHuge automatically locks the segment for access by the caller, 
  9860.  the same as if a DosLockSeg had been issued. 
  9861.  
  9862.  Note:  This request may be issued from privilege level 2 or 3.  However, only 
  9863.         a privilege level 3 huge segment is valid. 
  9864.  
  9865.  
  9866.  Family API Considerations 
  9867.  
  9868.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  9869.  Therefore, the following restriction applies to DosReallocHuge when coding for 
  9870.  the DOS mode: 
  9871.  
  9872.  The requested Size value is rounded up to the next paragraph (16-byte). 
  9873.  
  9874.  
  9875. ΓòÉΓòÉΓòÉ 1.128. DosReallocSeg ΓòÉΓòÉΓòÉ
  9876.  
  9877.                                Bindings:  C, MASM
  9878.  
  9879. This call reallocates a segment after discard or changes the size of a segment 
  9880. already allocated. 
  9881.  
  9882.  DosReallocSeg     (Size, Selector) 
  9883.  
  9884.  Size (USHORT) - input 
  9885.     New requested segment size (in bytes). A value of 0 indicates 65536 bytes. 
  9886.  
  9887.  Selector (SEL) - input 
  9888.     Segment to be resized. 
  9889.  
  9890.  rc (USHORT) - return 
  9891.     Return code descriptions are: 
  9892.  
  9893.     0         NO_ERROR 
  9894.     5         ERROR_ACCESS_DENIED 
  9895.     8         ERROR_NOT_ENOUGH_MEMORY 
  9896.  
  9897.  Remarks 
  9898.  
  9899.  DosReallocSeg is called to change the size of an unshared or shared segment 
  9900.  allocated with a DosAllocSeg request. 
  9901.  
  9902.  Normally, segments allocated as shared (AllocFlags bits 0 and 1 were set) 
  9903.  cannot be decreased in size. However, if AllocFlags bit 3 was also set, the 
  9904.  shared segment's size can be decreased. 
  9905.  
  9906.  DosReallocSeg is also called to reallocate a segment allocated as discardable 
  9907.  (AllocFlags bit 2 set) after the segment is discarded by the system. The call 
  9908.  to DosReallocSeg automatically locks the segment for access by the caller, the 
  9909.  same as if a DosLockSeg had been issued. 
  9910.  
  9911.  Note:  This request may be issued from privilege level 2 or 3, and the segment 
  9912.         being resized can be either a privilege level 2 or privilege level 3 
  9913.         segment. 
  9914.  
  9915.  To change the size of huge memory allocated by DosAllocHuge, see 
  9916.  DosReallocHuge. 
  9917.  
  9918.  
  9919.  Family API Considerations 
  9920.  
  9921.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  9922.  Therefore, the following restriction applies to DosReallocSeg when coding for 
  9923.  the DOS mode.  The requested Size value is rounded up to the next paragraph 
  9924.  (16-byte). 
  9925.  
  9926.  
  9927. ΓòÉΓòÉΓòÉ 1.129. DosResumeThread ΓòÉΓòÉΓòÉ
  9928.  
  9929.                                Bindings:  C, MASM
  9930.  
  9931. This call restarts a thread previously stopped with a DosSuspendThread call. 
  9932.  
  9933.  DosResumeThread     (ThreadID) 
  9934.  
  9935.  ThreadID (TID) - input 
  9936.     Thread ID of the resumed thread. 
  9937.  
  9938.  rc (USHORT) - return 
  9939.     Return code descriptions are: 
  9940.  
  9941.     0         NO_ERROR 
  9942.     309       ERROR_INVALID_THREADID 
  9943.  
  9944.  
  9945. ΓòÉΓòÉΓòÉ 1.130. DosRmDir ΓòÉΓòÉΓòÉ
  9946.  
  9947.                                Bindings:  C, MASM
  9948.  
  9949. This call removes a subdirectory from the specified disk. 
  9950.  
  9951.  DosRmDir    (DirName, Reserved) 
  9952.  
  9953.  DirName (PSZ) - input 
  9954.     Address of the fully qualified path name of the subdirectory being removed. 
  9955.  
  9956.  Reserved (ULONG) - input 
  9957.     Reserved must be set to zero. 
  9958.  
  9959.  rc (USHORT) - return 
  9960.     Return code descriptions are: 
  9961.  
  9962.     0         NO_ERROR 
  9963.     2         ERROR_FILE_NOT_FOUND 
  9964.     3         ERROR_PATH_NOT_FOUND 
  9965.     5         ERROR_ACCESS_DENIED 
  9966.     16        ERROR_CURRENT_DIRECTORY 
  9967.     26        ERROR_NOT_DOS_DISK 
  9968.     87        ERROR_INVALID_PARAMETER 
  9969.     108       ERROR_DRIVE_LOCKED 
  9970.     206       ERROR_FILENAME_EXCED_RANGE 
  9971.  
  9972.  Remarks 
  9973.  
  9974.  The subdirectory must be empty, which means it cannot contain hidden files or 
  9975.  directory entries other than the "." and ".." entries. Files can be deleted 
  9976.  with DosDelete. 
  9977.  
  9978.  The root directory and current directory cannot be removed. 
  9979.  
  9980.  
  9981. ΓòÉΓòÉΓòÉ 1.131. DosScanEnv ΓòÉΓòÉΓòÉ
  9982.  
  9983.                                Bindings:  C, MASM
  9984.  
  9985. This call scans (searches) an environment segment for an environment variable. 
  9986.  
  9987.  DosScanEnv    (EnvVarName, ResultPointer) 
  9988.  
  9989.  EnvVarName (PSZ) - input 
  9990.     Address of the name of the environment variable.  Do not include a trailing 
  9991.     " = ", since this is not part of the name. 
  9992.  
  9993.  ResultPointer (PSZ FAR *) - output 
  9994.     Address where the system returns the pointer to the environment string. 
  9995.     ResultPointer points to the first character of the string that is the value 
  9996.     of the environment variable and can be passed directly into DosSearchPath. 
  9997.  
  9998.  rc (USHORT) - return 
  9999.     Return code descriptions are: 
  10000.  
  10001.     0         NO_ERROR 
  10002.     203       ERROR_ENVVAR_NOT_FOUND 
  10003.  
  10004.  Remarks 
  10005.  
  10006.  Assume that the process' environment contains: 
  10007.  
  10008.           "DPATH=c:\sysdir;c:\libdir"
  10009.                  |
  10010.                  Γöé
  10011.                  Γöé
  10012.                  Γöö---- ResultPointer points here after the
  10013.                           following call to DosScanEnv:
  10014.  
  10015.           DosScanEnv("DPATH", &ResultPointer);
  10016.  
  10017.  As noted above, ResultPointer points to the first character of the value of 
  10018.  the environment variable. 
  10019.  
  10020.  
  10021. ΓòÉΓòÉΓòÉ 1.132. DosSearchPath ΓòÉΓòÉΓòÉ
  10022.  
  10023.                                Bindings:  C, MASM
  10024.  
  10025. This call provides a general path search mechanism that allows applications to 
  10026. find files residing along paths.  The path string may come from the process 
  10027. environment, or be supplied directly by the caller. 
  10028.  
  10029.  DosSearchPath     (Control, PathRef, FileName, ResultBuffer, ResultBufferLen) 
  10030.  
  10031.  Control (USHORT) - input 
  10032.     A word bit vector that controls the behavior of DosSearchPath. 
  10033.  
  10034.     Bit       Description 
  10035.  
  10036.     15-3      Reserved bits, must be zero. 
  10037.  
  10038.     2         Ignore network errors bit. The Ignore Network Errors Bit controls 
  10039.               whether the search will abort if it encounters a network error or 
  10040.               will continue the search with the next element.  This allows one 
  10041.               to place network paths in the PATH variable and be able to find 
  10042.               executables in components of the PATH variable even if the 
  10043.               network returns an error, for example, if a server is down.  If 
  10044.               the Ignore Network Errors Bit = 0, DosSearchPath will abort the 
  10045.               search if it encounters an error from the network.  If the Ignore 
  10046.               Network Errors Bit = 1, DosSearchPath will continue on the search 
  10047.               if it encounters network errors. 
  10048.  
  10049.     1         Path source bit.  The path source bit determines how 
  10050.               DosSearchPath interprets the PathRef argument. 
  10051.  
  10052.               0 = The PathRef points to the actual search path. The search path 
  10053.               string may be anywhere in the calling process's address space. 
  10054.               Therefore, it may be in the environment, but is not required. 
  10055.  
  10056.               1 = The PathRef points to the name of an environment variable in 
  10057.               the process environment, and that environment variable contains 
  10058.               the search path. 
  10059.  
  10060.     0         Implied current bit. The implied current bit controls whether the 
  10061.               current directory is implicitly on the front of the search path. 
  10062.  
  10063.               0 = DosSearchPath only searches the current directory if it 
  10064.               appears in the search path. 
  10065.  
  10066.               1 = DosSearchPath searches the current working directory before 
  10067.               it searches the directories in the search path. 
  10068.  
  10069.               For example, implied current bit = 0 and path = ".\;a;b" is 
  10070.               equivalent to implied current bit = 1 and path = "a;b". 
  10071.  
  10072.  PathRef (PSZ) - input 
  10073.     Address of the path. If the path source bit of control = 0, PathRef is the 
  10074.     search path that may be anywhere in the caller's address space. 
  10075.  
  10076.     A search path consists of a sequence of paths separated by a semicolon (;). 
  10077.     It is a single ASCIIZ string.  The directories are searched in the order 
  10078.     they appear in the path. 
  10079.  
  10080.     If the path source bit of control = 1, PathRef is the name of an 
  10081.     environment variable, that contains the search path. 
  10082.  
  10083.     A search path consists of a sequence of paths separated by ";". It is a 
  10084.     single ASCIIZ string.  The directories are searched in the order they 
  10085.     appear in the path.  Paths that contain ";"s should be quoted.  For 
  10086.     example: 
  10087.  
  10088.         "c:&this  is  ;  one directory path";thisisanother
  10089.  
  10090.     Environment variable names are simply strings that match name strings in 
  10091.     the environment.  The equal (=) sign is not part of the name. 
  10092.  
  10093.  FileName (PSZ) - input 
  10094.     Address of the ASCIIZ file name. It may contain global file name 
  10095.     characters.  If FileName does contain global file name characters, they 
  10096.     remain in the result path returned in ResultBuffer.  This allows 
  10097.     applications like CMD.EXE to feed the output directly to DosFindFirst.  If 
  10098.     there are no global file name characters in FileName, the resulting path 
  10099.     returned in ResultBuffer is a full qualified name, and may be passed 
  10100.     directly to DosOpen, or any other system call. 
  10101.  
  10102.  ResultBuffer (PBYTE) - output 
  10103.     Address of the pathname of the file, if found. If FileName is found in one 
  10104.     of the directories along the path, its full pathname is returned in 
  10105.     ResultBuffer (with global file name characters from FileName left in 
  10106.     place.) Do not depend on the contents of ResultBuffer being meaningful if 
  10107.     DosSearchPath returns a non-zero return code. 
  10108.  
  10109.  ResultBufferLen (USHORT) - input 
  10110.     Length, in bytes, of the ResultBuffer. 
  10111.  
  10112.  rc (USHORT) - return 
  10113.     Return code descriptions are: 
  10114.  
  10115.     0         NO_ERROR 
  10116.     1         ERROR_INVALID_FUNCTION 
  10117.     2         ERROR_FILE_NOT_FOUND 
  10118.     87        ERROR_INVALID_PARAMETER 
  10119.     111       ERROR_BUFFER_OVERFLOW 
  10120.     203       ERROR_ENVVAR_NOT_FOUND 
  10121.  
  10122.  Remarks 
  10123.  
  10124.  PathRef always points to an ASCIIZ string. Let DPATH be an environment 
  10125.  variable in the environment segment of the process. 
  10126.  
  10127.   "DPATH=c:\sysdir;c:\init"  /* in the environment */
  10128.  
  10129.  The following two code fragments are equivalent: 
  10130.  
  10131.   DosScanEnv("DPATH", &PathRef);
  10132.   DosSearchPath(0, /* Path Source Bit = 0 */
  10133.       PathRef, "myprog.ini", &ResultBuffer, ResultBufLen);
  10134.  
  10135.   DosSearchPath(2, /* Path Source Bit = 1 */
  10136.       "DPATH", "myprog.ini", &ResultBuffer, ResultBufLen);
  10137.  
  10138.  They both use the search path stored as DPATH in the environment segment.  In 
  10139.  the first case, the application uses DosScanEnv to find the variable: in the 
  10140.  second case DosSearchPath calls DosScanEnv for the application. 
  10141.  
  10142.  DosSearchPath does not check for consistency or formatting on the names.  It 
  10143.  does a DosFindFirst on a series of names it constructs from PathRef and 
  10144.  FileName. 
  10145.  
  10146.  To determine the size of the returned path name, the ResultBuffer must be 
  10147.  scanned for the ASCIIZ terminator. 
  10148.  
  10149.  DosQSysInfo must be used by an application to determine the maximum path 
  10150.  length supported by OS/2.  The returned value should be used to dynamically 
  10151.  allocate buffers that are to be used to store paths. 
  10152.  
  10153.  
  10154. ΓòÉΓòÉΓòÉ 1.133. DosSelectDisk ΓòÉΓòÉΓòÉ
  10155.  
  10156.                                Bindings:  C, MASM
  10157.  
  10158. This call selects the drive specified as the default drive for the calling 
  10159. process. 
  10160.  
  10161.  DosSelectDisk     (DriveNumber) 
  10162.  
  10163.  DriveNumber (USHORT) - input 
  10164.     New default drive number, where 1 = A and 2 = B and so on. 
  10165.  
  10166.  rc (USHORT) - return 
  10167.     Return code descriptions are: 
  10168.  
  10169.     0         NO_ERROR 
  10170.     15        ERROR_INVALID_DRIVE 
  10171.  
  10172.  
  10173. ΓòÉΓòÉΓòÉ 1.134. DosSelectSession ΓòÉΓòÉΓòÉ
  10174.  
  10175.                                Bindings:  C, MASM
  10176.  
  10177. This call allows a parent session to switch one of its child sessions to the 
  10178. foreground. 
  10179.  
  10180.  DosSelectSession    (SessID, Reserved) 
  10181.  
  10182.  SessID (USHORT) - input 
  10183.     ID of the session to be switched to the foreground. The values are their 
  10184.     meanings are: 
  10185.  
  10186.     Value     Definition 
  10187.        0      Switch the caller (the parent session) to the foreground. 
  10188.     <> 0      Switch the child session to the foreground. The nonzero value 
  10189.               specified for SessID must have been returned by a previous 
  10190.               DosStartSession request. 
  10191.  
  10192.  Reserved (ULONG) - input 
  10193.     A DWord of 0. 
  10194.  
  10195.  rc (USHORT) - return 
  10196.     Return code descriptions are: 
  10197.  
  10198.     0         NO_ERROR 
  10199.     369       ERROR_SMG_INVALID_SESSION_ID 
  10200.     418       ERROR_SMG_INVALID_CALL 
  10201.     451       ERROR_SMG_SESSION_NOT_FOREGRND 
  10202.     452       ERROR_SMG_SESSION_NOT_PARENT 
  10203.     459       ERROR_SMG_BAD_RESERVE 
  10204.  
  10205.  Remarks 
  10206.  
  10207.  DosSelectSession can be issued by a parent session to select only itself or a 
  10208.  child session.  It cannot be used to select a grandchild session. The child 
  10209.  session must have been started by the caller with a request to 
  10210.  DosStartSession, specifying "Related = 1." Sessions started as independent 
  10211.  sessions cannot be selected with this call. 
  10212.  
  10213.  When DosSelectSession is issued, the session is brought to the foreground only 
  10214.  if the parent session or one of its descendant sessions is executing in the 
  10215.  foreground. Otherwise, ERROR_SMG_SESSION_NOT_FOREGRND is returned. 
  10216.  
  10217.  
  10218. ΓòÉΓòÉΓòÉ 1.135. DosSemClear ΓòÉΓòÉΓòÉ
  10219.  
  10220.                                Bindings:  C, MASM
  10221.  
  10222. This call unconditionally clears a semaphore.  If any threads were blocked on 
  10223. the semaphore, they are restarted. 
  10224.  
  10225.  DosSemClear    (SemHandle) 
  10226.  
  10227.  SemHandle (HSEM) - input 
  10228.     Reference to the semaphore. 
  10229.  
  10230.     For a system semaphore, this reference is the handle returned by a 
  10231.     DosCreateSem or DosOpenSem request that granted the requesting thread 
  10232.     access to the semaphore. 
  10233.  
  10234.     For a RAM semaphore, this reference is the address of a doubleword of 
  10235.     storage, allocated and initialized to zero by the application. This sets 
  10236.     the semaphore as unowned. Other than initializing the doubleword to zero, 
  10237.     an application must not modify a RAM semaphore directly; instead it 
  10238.     manipulates the semaphore with semaphore function calls. 
  10239.  
  10240.  rc (USHORT) - return 
  10241.     Return code descriptions are: 
  10242.  
  10243.     0         NO_ERROR 
  10244.     101       ERROR_EXCL_SEM_ALREADY_OWNED 
  10245.  
  10246.  Remarks 
  10247.  
  10248.  DosSemClear typically is used to release a semaphore obtained through 
  10249.  DosSemRequest. DosSemClear also is used with the semaphore signaling functions 
  10250.  DosSemSetWait, DosSemWait, and  DosMuxSemWait. 
  10251.  
  10252.  If the semaphore is an exclusive system semaphore, it has a use count 
  10253.  associated with it, which is incremented by a DosSemRequest and decremented by 
  10254.  a DosSemClear. The semaphore is not actually cleared and made available to the 
  10255.  next thread that wants to access the resource until the semaphore has been 
  10256.  cleared the same number of times it has been requested. This means that 
  10257.  exclusive system semaphores can be used in recursive routines.  When the use 
  10258.  count is 0, the semaphore is available to be claimed by the next user of the 
  10259.  protected resource. 
  10260.  
  10261.  Normally, DosSemClear cannot be issued against a system semaphore owned by 
  10262.  another process unless the NoExclusive option is set by the DosCreateSem 
  10263.  request that created the semaphore.  However, at interrupt time any thread may 
  10264.  clear an exclusively owned semaphore. 
  10265.  
  10266.  
  10267. ΓòÉΓòÉΓòÉ 1.136. DosSemRequest ΓòÉΓòÉΓòÉ
  10268.  
  10269.                                Bindings:  C, MASM
  10270.  
  10271. This call obtains a semaphore and sets the semaphore as owned by the thread 
  10272. that requested it. 
  10273.  
  10274.  DosSemRequest     (SemHandle, Timeout) 
  10275.  
  10276.  SemHandle (HSEM) - input 
  10277.     Reference to the semaphore. 
  10278.  
  10279.     For a system semaphore, this reference is the handle returned by a 
  10280.     DosCreateSem or DosOpenSem request that granted the requesting thread 
  10281.     access to the semaphore. 
  10282.  
  10283.     For a RAM semaphore, this reference is the address of a doubleword of 
  10284.     storage, allocated and initialized to zero by the application. This sets 
  10285.     the semaphore as unowned. Other than initializing the doubleword to zero, 
  10286.     an application must not modify a RAM semaphore directly; instead it 
  10287.     manipulates the semaphore with semaphore function calls. 
  10288.  
  10289.  Timeout (LONG) - input 
  10290.     Action taken by the requesting thread when the semaphore is owned by 
  10291.     another thread.  The values that can be specified are: 
  10292.  
  10293.     Value     Definition 
  10294.      -1       The requesting thread waits indefinitely for the semaphore to be 
  10295.               cleared. 
  10296.       0       The requesting thread returns immediately. 
  10297.      > 0      The requesting thread waits the indicated number of milliseconds 
  10298.               for the semaphore to be cleared before resuming execution. 
  10299.  
  10300.  rc (USHORT) - return 
  10301.     Return code descriptions are: 
  10302.  
  10303.     0         NO_ERROR 
  10304.     95        ERROR_INTERRUPT 
  10305.     100       ERROR_TOO_MANY_SEMAPHORES 
  10306.     105       ERROR_SEM_OWNER_DIED 
  10307.     121       ERROR_SEM_TIMEOUT 
  10308.  
  10309.  Remarks 
  10310.  
  10311.  Typically, DosSemRequest is called to set a semaphore for the purpose of 
  10312.  accessing a protected resource. DosSemRequest checks the status of the 
  10313.  semaphore.  If the semaphore is not set (that is, not owned) by another 
  10314.  thread, DosSemRequest sets the semaphore as owned by the current thread and 
  10315.  returns immediately to the caller. 
  10316.  
  10317.  If the semaphore is already owned by another thread, DosSemRequest optionally 
  10318.  can block the requesting thread until the semaphore becomes available. The 
  10319.  unblocking of a thread blocked by a DosSemRequest is level-triggered. That is, 
  10320.  DosSemRequest does not return until the semaphore remains clear long enough 
  10321.  for the affected thread to be redispatched and successfully claim the 
  10322.  semaphore. Thus, if a number of threads are blocked indefinitely on 
  10323.  DosSemRequest calls for the semaphore, only the thread that sets the semaphore 
  10324.  is actually unblocked. If a milliseconds value is specified for the Timeout 
  10325.  parameter, this places an upper limit on the amount of time the requesting 
  10326.  thread remains blocked, waiting for the semaphore to become available. 
  10327.  
  10328.  When a thread no longer requires the protected resource, it issues DosSemClear 
  10329.  to clear the semaphore, so another thread may claim it with a successful 
  10330.  DosSemRequest. If the semaphore is an exclusive system semaphore, it has a use 
  10331.  count associated with it, which is incremented by a DosSemRequest and 
  10332.  decremented by a DosSemClear. The semaphore is not actually cleared and made 
  10333.  available to the next thread that wants to access the resource until the 
  10334.  semaphore has been cleared the same number of times it has been requested. 
  10335.  This means that exclusive system semaphores can be used in recursive routines. 
  10336.  When the use count is 0, the semaphore is available to be claimed by the next 
  10337.  user of the protected resource. 
  10338.  
  10339.  If a process terminates while owning a nonexclusive system semaphore, 
  10340.  ERROR_SEM_OWNER_DIED is returned to the thread that next gets the semaphore 
  10341.  through DosSemRequest. That thread takes steps to ensure the integrity of the 
  10342.  resource.  The thread can release the resource by issuing a DosSemClear, or it 
  10343.  can reset the ERROR_SEM_OWNER_DIED return code condition flagged in the 
  10344.  semaphore data structure. 
  10345.  
  10346.  Note:  To request a Fast-Safe RAM semaphore, a thread calls 
  10347.         DosFSRamSemRequest. 
  10348.  
  10349.  
  10350. ΓòÉΓòÉΓòÉ 1.137. DosSemSet ΓòÉΓòÉΓòÉ
  10351.  
  10352.                                Bindings:  C, MASM
  10353.  
  10354. This call unconditionally sets a semaphore; that is, it sets the semaphore 
  10355. whether or not it is already set. 
  10356.  
  10357.  DosSemSet    (SemHandle) 
  10358.  
  10359.  SemHandle (HSEM) - input 
  10360.     Reference to the semaphore. 
  10361.  
  10362.     For a system semaphore, this reference is the handle returned by a 
  10363.     DosCreateSem or DosOpenSem request that granted the requesting thread 
  10364.     access to the semaphore. 
  10365.  
  10366.     For a RAM semaphore, this reference is the address of a doubleword of 
  10367.     storage, allocated and initialized to zero by the application. This sets 
  10368.     the semaphore as unowned. Other than initializing the doubleword to zero, 
  10369.     an application must not modify a RAM semaphore directly; instead it 
  10370.     manipulates the semaphore with semaphore function calls. 
  10371.  
  10372.  rc (USHORT) - return 
  10373.     Return code descriptions are: 
  10374.  
  10375.     0         NO_ERROR 
  10376.     100       ERROR_TOO_MANY_SEMAPHORES 
  10377.     103       ERROR_TOO_MANY_SEM_REQUESTS 
  10378.  
  10379.  Remarks 
  10380.  
  10381.  DosSemSet usually is not required in a resource control environment using 
  10382.  DosSemRequest and DosSemClear.  It typically is used in a signaling 
  10383.  environment implemented with DosSemWait,  DosMuxSemWait, and DosSemClear. 
  10384.  These function calls are used to block one or more threads on a set semaphore 
  10385.  and awaken them when an event occurs. 
  10386.  
  10387.  DosSemSet cannot be issued against a system semaphore that is owned by another 
  10388.  thread, unless the NoExclusive option was set in the original DosCreateSem 
  10389.  request. 
  10390.  
  10391.  
  10392. ΓòÉΓòÉΓòÉ 1.138. DosSemSetWait ΓòÉΓòÉΓòÉ
  10393.  
  10394.                                Bindings:  C, MASM
  10395.  
  10396. This call sets a semaphore if the semaphore is not already set and waits until 
  10397. another thread clears the semaphore with a DosSemClear call. 
  10398.  
  10399.  DosSemSetWait     (SemHandle, Timeout) 
  10400.  
  10401.  SemHandle (HSEM) - input 
  10402.     Reference to the semaphore. 
  10403.  
  10404.     For a system semaphore, this reference is the handle returned by a 
  10405.     DosCreateSem or DosOpenSem request that granted the requesting thread 
  10406.     access to the semaphore. 
  10407.  
  10408.     For a RAM semaphore, this reference is the address of a doubleword of 
  10409.     storage, allocated and initialized to zero by the application. This sets 
  10410.     the semaphore as unowned. Other than initializing the doubleword to zero, 
  10411.     an application must not modify a RAM semaphore directly; instead it 
  10412.     manipulates the semaphore with semaphore function calls. 
  10413.  
  10414.  Timeout (LONG) - input 
  10415.     Action taken by the requesting thread when the semaphore is set. The values 
  10416.     that can be specified are: 
  10417.  
  10418.     Value     Definition 
  10419.      -1       The requesting thread waits indefinitely for the semaphore to be 
  10420.               cleared. 
  10421.       0       The requesting thread returns immediately. 
  10422.      > 0      The requesting thread waits the indicated number of milliseconds 
  10423.               for the semaphore to be cleared before resuming execution. 
  10424.  
  10425.  rc (USHORT) - return 
  10426.     Return code descriptions are: 
  10427.  
  10428.     0         NO_ERROR 
  10429.     95        ERROR_INTERRUPT 
  10430.     101       ERROR_EXCL_SEM_ALREADY_OWNED 
  10431.     103       ERROR_TOO_MANY_SEM_REQUESTS 
  10432.     121       ERROR_SEM_TIMEOUT 
  10433.  
  10434.  Remarks 
  10435.  
  10436.  DosSemSetWait combines the functions of DosSemSet and  DosSemWait and is used 
  10437.  when there is a chance the semaphore may be be cleared by a thread that gets 
  10438.  an intervening time slice between calls by the current thread to set the 
  10439.  semaphore and wait until it is cleared. 
  10440.  
  10441.  A DosSemSetWait request differs from a DosSemWait request in that it ensures 
  10442.  that the semaphore is set so that it can block on it. Issuing DosSemWait on a 
  10443.  semaphore that has been cleared has no effect. Instead of blocking, the caller 
  10444.  continues to execute. 
  10445.  
  10446.  The unblocking of a thread blocked by a DosSemSetWait is level-triggered. That 
  10447.  is, DosSemSetWait does not return until the semaphore remains clear long 
  10448.  enough for the affected thread to be redispatched and determine that the 
  10449.  semaphore is clear. 
  10450.  
  10451.  DosSemSetWait cannot be issued against a system semaphore owned by another 
  10452.  thread unless the NoExclusive option was selected on the DosCreateSem request 
  10453.  that created the semaphore. 
  10454.  
  10455.  
  10456. ΓòÉΓòÉΓòÉ 1.139. DosSemWait ΓòÉΓòÉΓòÉ
  10457.  
  10458.                                Bindings:  C, MASM
  10459.  
  10460. This call blocks the current thread until an indicated semaphore clears, but 
  10461. does not establish ownership of the semaphore. 
  10462.  
  10463.  DosSemWait    (SemHandle, Timeout) 
  10464.  
  10465.  SemHandle (HSEM) - input 
  10466.     Reference to the semaphore. 
  10467.  
  10468.     For a system semaphore, this reference is the handle returned by a 
  10469.     DosCreateSem or DosOpenSem request that granted the requesting thread 
  10470.     access to the semaphore. 
  10471.  
  10472.     For a RAM semaphore, this reference is the address of a doubleword of 
  10473.     storage, allocated and initialized to zero by the application. This sets 
  10474.     the semaphore as unowned. Other than initializing the doubleword to zero, 
  10475.     an application must not modify a RAM semaphore directly; instead it 
  10476.     manipulates the semaphore with semaphore function calls. 
  10477.  
  10478.  Timeout (LONG) - input 
  10479.     Action taken by the requesting thread when the semaphore is set. The values 
  10480.     that can be specified are: 
  10481.  
  10482.     Value     Definition 
  10483.      -1       The requesting thread waits indefinitely for the semaphore to be 
  10484.               cleared. 
  10485.       0       The requesting thread returns immediately. 
  10486.      > 0      The requesting thread waits the indicated number of milliseconds 
  10487.               for the semaphore to be cleared before resuming execution. 
  10488.  
  10489.  rc (USHORT) - return 
  10490.     Return code descriptions are: 
  10491.  
  10492.     0         NO_ERROR 
  10493.     95        ERROR_INTERRUPT 
  10494.     121       ERROR_SEM_TIMEOUT 
  10495.  
  10496.  Remarks 
  10497.  
  10498.  The unblocking of a thread blocked by a DosSemWait is level-triggered. That 
  10499.  is, DosSemWait does not return until the semaphore remains clear long enough 
  10500.  for the affected thread to be redispatched and determine that the semaphore is 
  10501.  clear. 
  10502.  
  10503.  When an application needs to guarantee that another event has occurred before 
  10504.  continuing, it calls DosSemSetWait. DosSemSetWait combines the functions of 
  10505.  DosSemSet and  DosSemWait and is used when there is a chance the semaphore may 
  10506.  be cleared by a thread that gets an intervening time slice between calls by 
  10507.  the current thread to set the semaphore and wait until it is cleared. Issuing 
  10508.  DosSemWait on a semaphore that has been cleared has no effect; the thread 
  10509.  continues to execute. 
  10510.  
  10511.  
  10512. ΓòÉΓòÉΓòÉ 1.140. DosSendSignal ΓòÉΓòÉΓòÉ
  10513.  
  10514.                                Bindings:  C, MASM
  10515.  
  10516. This call sends either a SIGINTR or a SIGBREAK signal to a process within a 
  10517. specified process tree. 
  10518.  
  10519.  DosSendSignal     (PID, SigNumber) 
  10520.  
  10521.  PID (USHORT) - input 
  10522.     Root process ID of the subtree.  It is not necessary that this process be 
  10523.     alive, but it is necessary that this process be a direct child process of 
  10524.     the process that issues this call. 
  10525.  
  10526.  SigNumber (USHORT) - input 
  10527.     Signal to send.  It may be: 
  10528.  
  10529.     Value     Definition 
  10530.     1         (SIGINTR) Ctrl-C 
  10531.     4         (SIGBREAK) Ctrl-Break. 
  10532.  
  10533.  rc (USHORT) - return 
  10534.     Return code descriptions are: 
  10535.  
  10536.     0         NO_ERROR 
  10537.     1         ERROR_INVALID_FUNCTION 
  10538.     156       ERROR_SIGNAL_REFUSED 
  10539.     205       ERROR_NO_SIGNAL_SENT 
  10540.     209       ERROR_INVALID_SIGNAL_NUMBER 
  10541.     303       ERROR_INVALID_PROCID 
  10542.  
  10543.  Remarks 
  10544.  
  10545.  The process that receives the signal is the most distant descendent process 
  10546.  among those processes in the tree that have a handler installed for the 
  10547.  signal. 
  10548.  
  10549.  The process tree is searched in descending order for processes having a 
  10550.  handler installed for the specified signal.  If there is at least one eligible 
  10551.  process in the tree, the signal is sent to the process that is the most 
  10552.  distant descendent process among the eligible processes.  The selected process 
  10553.  may have descendents, but none of them have the handler installed for the 
  10554.  signal.  If there is more than one most distant descendent eligible process, 
  10555.  the signal is sent to one of them; which one is indeterminate. 
  10556.  
  10557.  Presentation Manager applications may not establish signal handlers for Ctrl-C 
  10558.  and Ctrl-Break.  Establishing a signal handler for Ctrl-C and Ctrl-Break is 
  10559.  supported for VIO-Windowable and full-screen applications. 
  10560.  
  10561.  
  10562. ΓòÉΓòÉΓòÉ 1.141. DosSetCp ΓòÉΓòÉΓòÉ
  10563.  
  10564.                                Bindings:  C, MASM
  10565.  
  10566. This call allows a process to set its code page and the session's display code 
  10567. page and keyboard code page. 
  10568.  
  10569.  DosSetCp    (CodePage, Reserved) 
  10570.  
  10571.  CodePage (USHORT) - input 
  10572.     Code page identifier word that has one of the following values: 
  10573.  
  10574.     Value     Definition 
  10575.     437       IBM PC US 437 code page 
  10576.     850       Multilingual code page 
  10577.     860       Portuguese code page 
  10578.     863       Canadian-French code page 
  10579.     865       Nordic code page. 
  10580.  
  10581.  Reserved (USHORT) - input 
  10582.     Reserved must be set to zero. 
  10583.  
  10584.  rc (USHORT) - return 
  10585.     Return code descriptions are: 
  10586.  
  10587.     0         NO_ERROR 
  10588.     5         ERROR_ACCESS_DENIED 
  10589.     13        ERROR_INVALID_DATA 
  10590.     472       ERROR_INVALID_CODE_PAGE 
  10591.     482       ERROR_CP_SWITCH_INCOMPLETE 
  10592.  
  10593.  Remarks 
  10594.  
  10595.  DosSetCp allows a program to set its code page.  See CONFIG.SYS and the 
  10596.  CODEPAGE command for preparing code pages for the system.  The first code page 
  10597.  specified in the CODEPAGE command is the default system code page.  The 
  10598.  session code page of a new session is set to the default system code page.  A 
  10599.  session's code page can be changed by the user with the CHCP command at the 
  10600.  command prompt.  The process code page of a new program started from a session 
  10601.  command prompt is set to that session's code page. 
  10602.  
  10603.  DosSetCp sets the process code page of the calling process.  The code page of 
  10604.  a process is used in a series of ways.  First, the printer code page is set to 
  10605.  the process code page through the file system and printer spooler when the 
  10606.  process makes an open printer request.  Calling DosSetCp does not affect the 
  10607.  code page of a printer opened prior to the call and does not affect the code 
  10608.  page of a printer opened by another process.  Second, country dependent 
  10609.  information, by default, is retrieved encoded in the code page of the calling 
  10610.  process.  And third, a newly created process inherits its process code page 
  10611.  from its parent process. 
  10612.  
  10613.  DosSetCp also sets, in the session to which the calling process belongs, the 
  10614.  code page for the session's default logical keyboard and automatically flushes 
  10615.  the keyboard buffer.  It also sets the display code page for the session's 
  10616.  logical display.  This setting of the code page for the session's default 
  10617.  logical keyboard and display overrides any previous setting by DosSetCp, 
  10618.  DosSetProcCp, KbdSetCp, and VioSetCp by any process in the same session.  Also 
  10619.  see DosSetProcCp. 
  10620.  
  10621.  
  10622. ΓòÉΓòÉΓòÉ 1.142. DosSetDateTime ΓòÉΓòÉΓòÉ
  10623.  
  10624.                                Bindings:  C, MASM
  10625.  
  10626. This call is used to set the date and time that are maintained by the operating 
  10627. system. 
  10628.  
  10629.  DosSetDateTime     (DateTime) 
  10630.  
  10631.  DateTime (PDATETIME) - input 
  10632.     Address of the date and time structure: 
  10633.  
  10634.     hours (UCHAR) 
  10635.        Current hour (0-23). 
  10636.  
  10637.     minutes (UCHAR) 
  10638.        Current minute (0-59). 
  10639.  
  10640.     seconds (UCHAR) 
  10641.        Current second (0-59). 
  10642.  
  10643.     hundredths (UCHAR) 
  10644.        Current hundredth of a second (0-99). 
  10645.  
  10646.     day (UCHAR) 
  10647.        Current day (1-31). 
  10648.  
  10649.     month (UCHAR) 
  10650.        Current month (1-12). 
  10651.  
  10652.     year (USHORT) 
  10653.        Current year (1980-2079). 
  10654.  
  10655.     timezone (SHORT) 
  10656.        Minutes west of UTC (Universal Time Coordinate -720 to 720). 
  10657.  
  10658.     weekday (UCHAR) 
  10659.        Current day of the week. This value is ignored and is calculated from 
  10660.        the other parameter information. 
  10661.  
  10662.  rc (USHORT) - return 
  10663.     Return code descriptions are: 
  10664.  
  10665.     0         NO_ERROR 
  10666.     327       ERROR_TS_DATETIME 
  10667.  
  10668.  Remarks 
  10669.  
  10670.  The value of timezone is the difference in minutes between the current time 
  10671.  zone and UTC. This is a positive number if earlier than UTC, and negative 
  10672.  number if it is later. For Eastern Standard Time this value is 300 (five hours 
  10673.  earlier than UTC). 
  10674.  
  10675.  To get the date and time, issue DosGetDateTime. If the application is 
  10676.  executing in the OS/2 environment, it is more efficient to obtain these 
  10677.  variables by calling DosGetInfoSeg instead of this function. However, 
  10678.  applications written to the family API cannot depend on the availability of 
  10679.  DosGetInfoSeg. 
  10680.  
  10681.  Not adhering to the limits on any of the parameters results in the return code 
  10682.  being set to rc = 327 (ERROR_TS_DATETIME). Also, OS/2 verifies that the day is 
  10683.  possible for the month and the year (even for leap year).  If the day is not 
  10684.  reasonable, OS/2 will also set rc = 327. 
  10685.  
  10686.  
  10687. ΓòÉΓòÉΓòÉ 1.143. DosSetFHandState ΓòÉΓòÉΓòÉ
  10688.  
  10689.                                Bindings:  C, MASM
  10690.  
  10691. This call sets the state of the specified file. 
  10692.  
  10693.  DosSetFHandState     (FileHandle, FileHandleState) 
  10694.  
  10695.  FileHandle (HFILE) - input 
  10696.     File handle to be set. 
  10697.  
  10698.  FileHandleState (USHORT) - input 
  10699.     Contents of the open mode word defined in a previous DosOpen or  DosOpen2 
  10700.     call. 
  10701.  
  10702.     Bit       Description 
  10703.  
  10704.     15        Zero Bit field.  This bit must be set to zero. 
  10705.  
  10706.     14        Write-Through flag: 
  10707.  
  10708.               0 = Writes to the file may be run through the system buffer 
  10709.               cache. 
  10710.  
  10711.               1 = Writes to the file may go through the system buffer cache, 
  10712.               but the data is written (actual file I/O completed) before a 
  10713.               synchronous write call returns. This state of the file defines it 
  10714.               as a synchronous file. For synchronous files, this is a mandatory 
  10715.               bit in that the data must be written out to the medium for 
  10716.               synchronous write operations. 
  10717.  
  10718.               This bit is not inherited by child processes. 
  10719.  
  10720.     13        Fail-Errors flag.  Media I/O errors are handled as follows: 
  10721.  
  10722.               0 = Reported through the system critical error handler. 
  10723.  
  10724.               1 = Reported directly to the caller by way of a return code. 
  10725.  
  10726.               Media I/O errors generated through an IOCTL category 8 function 
  10727.               always get reported directly to the caller by way of a return 
  10728.               code.  The Fail-Errors function applies only to non-IOCTL 
  10729.               handle-based type file I/O calls. 
  10730.  
  10731.               This bit is not inherited by child processes. 
  10732.  
  10733.     12        No-Cache/Cache flag.  The file is opened as follows: 
  10734.  
  10735.               0 = It is advisable for the disk driver to cache the data in I/O 
  10736.               operations on this file. 
  10737.  
  10738.               1 = I/O to the file need not be done through the disk driver 
  10739.               cache. 
  10740.  
  10741.               This bit is an advisory bit, and is used to advise FSDs and 
  10742.               device drivers on whether it is worth caching the data or not. 
  10743.               This bit, like the write-through bit, is a per-handle bit. 
  10744.  
  10745.               This bit is not inherited by child processes. 
  10746.  
  10747.     11-8      Reserved Bits. These bits are reserved and should be set to the 
  10748.               values returned by DosQFHandState in these positions. 
  10749.  
  10750.     7         Inheritance flag: 
  10751.  
  10752.               0 = File handle is inherited by a spawned process resulting from 
  10753.               a DosExecPgm call. 
  10754.  
  10755.               1 = File handle is private to the current process. 
  10756.  
  10757.     6-4       Zero Bit field.  These bits must be set to zero. Any other values 
  10758.               are invalid. 
  10759.  
  10760.     3         Reserved Bit. This bit is reserved and should be set to the value 
  10761.               returned by DosQFHandState for this position. 
  10762.  
  10763.     2-0       Zero Bit field.  These bits must be set to zero. Any other values 
  10764.               are invalid. 
  10765.  
  10766.  rc (USHORT) - return 
  10767.     Return code descriptions are: 
  10768.  
  10769.     0         NO_ERROR 
  10770.     6         ERROR_INVALID_HANDLE 
  10771.     87        ERROR_INVALID_PARAMETER 
  10772.  
  10773.  Remarks 
  10774.  
  10775.  OS/2 does not guarantee the order that sectors are written for multiple sector 
  10776.  writes.  If an application requires several sectors written in a specific 
  10777.  order, the operator should issue them as separate synchronous write 
  10778.  operations. Setting the write-through flag does not affect any previous 
  10779.  writes.  That data may remain in the buffers. When a critical error occurs 
  10780.  that the application cannot handle, it may reset critical error handling to be 
  10781.  performed by the system. This is done by calling DosSetFHandState to turn off 
  10782.  the fail/errors bit and reissuing the I/O call. The expected critical error 
  10783.  reoccurs and control is passed to the system critical error handler. The 
  10784.  precise time that the effect of this function is visible at the application 
  10785.  level is unpredictable when asynchronous I/O is pending. 
  10786.  
  10787.  The file handle state bits set by this function can be queried by 
  10788.  DosQFHandState. 
  10789.  
  10790.  
  10791.  Family API Considerations 
  10792.  
  10793.  Some options operate  differently in the DOS mode than in OS/2 mode. 
  10794.  Therefore, the following restrictions apply to DosSetFHandState when coding 
  10795.  for the DOS mode: 
  10796.  
  10797.  o The validity of the file handle is not checked. 
  10798.  o The Inheritance flag must be set equal to zero. (This flag is not supported 
  10799.    in DOS 2.X.) 
  10800.  o The Write-Through flag must be set equal to zero. 
  10801.  o The Fail-Errors flag must be set equal to zero. 
  10802.  
  10803.  
  10804.  Named Pipe Considerations 
  10805.  
  10806.  DosSetFHandState allows setting of the inheritance (I) and Write-Through (W) 
  10807.  bits.  Setting W to 1 prevents write-behind operations on remote pipes. 
  10808.  
  10809.  
  10810. ΓòÉΓòÉΓòÉ 1.144. DosSetFileInfo ΓòÉΓòÉΓòÉ
  10811.  
  10812.                                Bindings:  C, MASM
  10813.  
  10814. This call sets attribute and extended attribute information for a file. 
  10815.  
  10816.  DosSetFileInfo     (FileHandle, FileInfoLevel, FileInfoBuf, FileInfoBufSize) 
  10817.  
  10818.  FileHandle (HFILE) - input 
  10819.     File handle. 
  10820.  
  10821.  FileInfoLevel (USHORT) - input 
  10822.     Level of file information being set. A value of 1 or 2 can be specified. 
  10823.     The structures described in FileInfoBuf indicate the information being set 
  10824.     for each of these levels. 
  10825.  
  10826.  FileInfoBuf (PBYTE) - input 
  10827.     Address of the storage area containing the structures for file information 
  10828.     levels. 
  10829.  
  10830.     Level 1 Information 
  10831.        FileInfoBuf contains the following structure, to which information is 
  10832.        specified in the following format: 
  10833.  
  10834.        filedate (FDATE) 
  10835.           Structure containing the date of file creation. 
  10836.  
  10837.           Bit       Description 
  10838.           15-9      Year, in binary, of file creation 
  10839.           8-5       Month, in binary, of file creation 
  10840.           4-0       Day, in binary, of file creation. 
  10841.  
  10842.        filetime (FTIME) 
  10843.           Structure containing the time of file creation. 
  10844.  
  10845.           Bit       Description 
  10846.           15-11     Hours, in binary, of file creation 
  10847.           10-5      Minutes, in binary, of file creation 
  10848.           4-0       Seconds, in binary number of two-second increments, of file 
  10849.                     creation. 
  10850.  
  10851.        fileaccessdate (FDATE) 
  10852.           Structure containing the date of last access. See FDATE in filedate. 
  10853.  
  10854.        fileaccesstime (FTIME) 
  10855.           Structure containing the time of last access. See FTIME in filetime. 
  10856.  
  10857.        writeaccessdate (FDATE) 
  10858.           Structure containing the date of last write. See FDATE in filedate. 
  10859.  
  10860.        writeaccesstime (FTIME) 
  10861.           Structure containing the time of last write. See FTIME in filetime. 
  10862.  
  10863.        filesize (ULONG) 
  10864.           File size. 
  10865.  
  10866.        filealloc (ULONG) 
  10867.           Allocated file size. 
  10868.  
  10869.        fileattrib (USHORT) 
  10870.           Attributes of the file, defined in DosSetFileMode. 
  10871.  
  10872.     Level 2 Information 
  10873.        FileInfoBuf contains an EAOP structure, which has the following format: 
  10874.  
  10875.        fpGEAList (PGEALIST) 
  10876.           Address of GEAList. GEAList is a packed array of variable length "get 
  10877.           EA" structures, each containing an EA name and the length of the 
  10878.           name. 
  10879.  
  10880.        fpFEAList (PFEALIST) 
  10881.           Address of FEAList. FEAList is a packed array of variable length 
  10882.           "full EA" structures, each containing an EA name and its 
  10883.           corresponding value, as well as the lengths of the name and the 
  10884.           value. 
  10885.  
  10886.        oError (ULONG) 
  10887.           Offset into structure where error has occurred. 
  10888.  
  10889.        Level 2 sets a series of EA name/value pairs. On input, FileInfoBuf is 
  10890.        an EAOP structure above.  fpGEAList is ignored. fpFEAList points to a 
  10891.        data area where the relevant FEA list is to be found.  oError is 
  10892.        ignored. Following is the format of the FEAList structure: 
  10893.  
  10894.        cbList (ULONG) 
  10895.           Length of the FEA list, including the length itself. 
  10896.  
  10897.        list (FEA) 
  10898.           List of FEA structures.  An FEA structure has the following format: 
  10899.  
  10900.           Flags (BYTE) 
  10901.              Bit indicator describing the characteristics of the EA being 
  10902.              defined. 
  10903.  
  10904.              Bit       Description 
  10905.              7         Critical EA. 
  10906.              6-0       Reserved and must be set to zero. 
  10907.  
  10908.              If bit 7 is set to 1, this indicates a critical EA.  If bit 7 is 
  10909.              0, this means the EA is noncritical; that is, the EA is not 
  10910.              essential to the intended use by an application of the file with 
  10911.              which it is associated. 
  10912.  
  10913.           cbName (BYTE) 
  10914.              Length of EA ASCIIZ name, which does not include the null 
  10915.              character. 
  10916.  
  10917.           cbValue (USHORT) 
  10918.              Length of EA value, which cannot exceed 64KB. 
  10919.  
  10920.           szName (PSZ) 
  10921.              Address of the ASCIIZ name of EA. 
  10922.  
  10923.           aValue (PSZ) 
  10924.              Address of the free-format value of EA. 
  10925.  
  10926.        Note: 
  10927.           The szName and aValue fields are not included as part of header or 
  10928.           include files.  Because of their variable lengths, these entries must 
  10929.           be built manually. 
  10930.  
  10931.        On output, fpGEAList is unchanged.  fpFEAList is unchanged as is the 
  10932.        area pointed to by fpFEAList.  If an error occurred during the set, 
  10933.        oError is the offset of the FEA where the error occurred.  The API 
  10934.        return code is the error code corresponding to the condition generating 
  10935.        the error.  If no error occurred, oError is undefined. 
  10936.  
  10937.  FileInfoBufSize (USHORT) - input 
  10938.     Length of FileInfoBuf. 
  10939.  
  10940.  rc (USHORT) - return 
  10941.     Return code descriptions are: 
  10942.  
  10943.     0         NO_ERROR 
  10944.     1         ERROR_INVALID_FUNCTION 
  10945.     5         ERROR_ACCESS_DENIED 
  10946.     6         ERROR_INVALID_HANDLE 
  10947.     87        ERROR_INVALID_PARAMETER 
  10948.     122       ERROR_INSUFFICIENT_BUFFER 
  10949.     124       ERROR_INVALID_LEVEL 
  10950.     130       ERROR_DIRECT_ACCESS_HANDLE 
  10951.     254       ERROR_INVALID_EA_NAME 
  10952.     255       ERROR_EA_LIST_INCONSISTENT 
  10953.  
  10954.  Remarks 
  10955.  
  10956.  DosSetFileInfo is successful only when the file is opened for write access, 
  10957.  with a deny-both sharing mode specified for access to the file by other 
  10958.  processes.  If the file is already opened with conflicting sharing rights, the 
  10959.  call to DosOpen or DosOpen2 will fail. 
  10960.  
  10961.  A 0 value in the date and time components of a field does not change the 
  10962.  field.  For example, if both "last write date" and "last write time" are 
  10963.  specified as 0 in the Level 1 information structure, then both attributes of 
  10964.  the file are left unchanged.  If either "last write date" or "last write time" 
  10965.  are specified as non-zero, both attributes of the file are set to the new 
  10966.  values. 
  10967.  
  10968.  The FAT file system supports modification of only the dates and times of the 
  10969.  last write. Creation and last access dates and times are not affected. 
  10970.  
  10971.  The last modification date and time will get changed if the extended 
  10972.  attributes are modified. 
  10973.  
  10974.  
  10975.  Family API Considerations 
  10976.  
  10977.  It is not possible to create a label with leading blank characters in DOS 
  10978.  mode, because of restrictions on the previous Interrupt 21h function call 
  10979.  (create an FCB type file), which must be used by FAPI. 
  10980.  
  10981.  
  10982. ΓòÉΓòÉΓòÉ 1.145. DosSetFileMode ΓòÉΓòÉΓòÉ
  10983.  
  10984.                                Bindings:  C, MASM
  10985.  
  10986. This call changes the mode (attribute) of the specified file. 
  10987.  
  10988.  DosSetFileMode     (FileName, NewAttribute, Reserved) 
  10989.  
  10990.  FileName (PSZ) - input 
  10991.     Address of the file path name. 
  10992.  
  10993.     DosQSysInfo is called by an application during initialization to determine 
  10994.     the maximum path length allowed by OS/2. 
  10995.  
  10996.  NewAttribute (USHORT) - input 
  10997.     File's new attribute. File attributes are defined as follows: 
  10998.  
  10999.     Bit       Description 
  11000.     15-6      Reserved and must be zero. 
  11001.     5         File archive 
  11002.     4         Subdirectory 
  11003.     3         Volume label 
  11004.     2         System file (excluded from normal directory searches) 
  11005.     1         Hidden file 
  11006.     0         Read only file 
  11007.  
  11008.     These bits may be set individually or in combination.  For example, an 
  11009.     attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file 
  11010.     that should be archived. 
  11011.  
  11012.  Reserved (ULONG) - input 
  11013.     Reserved must be set to zero. 
  11014.  
  11015.  rc (USHORT) - return 
  11016.     Return code descriptions are: 
  11017.  
  11018.     0         NO_ERROR 
  11019.     2         ERROR_FILE_NOT_FOUND 
  11020.     3         ERROR_PATH_NOT_FOUND 
  11021.     5         ERROR_ACCESS_DENIED 
  11022.     26        ERROR_NOT_DOS_DISK 
  11023.     32        ERROR_SHARING_VIOLATION 
  11024.     36        ERROR_SHARING_BUFFER_EXCEEDED 
  11025.     87        ERROR_INVALID_PARAMETER 
  11026.     108       ERROR_DRIVE_LOCKED 
  11027.     206       ERROR_FILENAME_EXCED_RANGE 
  11028.  
  11029.  Remarks 
  11030.  
  11031.  Attributes for Volume Label (0008H) and Subdirectory (0010H) cannot be changed 
  11032.  using DosSetFileMode. If these attributes are specified, 
  11033.  ERROR_INVALID_PARAMETER is returned. 
  11034.  
  11035.  DosQFileMode is used to query the current settings for file attributes. 
  11036.  Calling DosQFSInfo obtains volume label information. 
  11037.  
  11038.  Attributes of root directories cannot be changed using DosSetFileMode. If 
  11039.  these attributes are specified, ERROR_ACCESS_DENIED is returned. 
  11040.  
  11041.  
  11042. ΓòÉΓòÉΓòÉ 1.146. DosSetFSInfo ΓòÉΓòÉΓòÉ
  11043.  
  11044.                                Bindings:  C, MASM
  11045. This call sets information for a file system device. 
  11046.  
  11047.  DosSetFSInfo     (DriveNumber, FSInfoLevel, FSInfoBuf, FSInfoBufSize) 
  11048.  
  11049.  DriveNumber (USHORT) - input 
  11050.     Logical drive number, for example, 0 = default and 1 = A, and the FSD for 
  11051.     the media currently in that drive. A value of '0xFFFF' notes that FSInfoBuf 
  11052.     contains the ASCIIZ path name of the FSD. 
  11053.  
  11054.  FSInfoLevel (USHORT) - input 
  11055.     Level of file information to be set. A value of 2 is the only valid value 
  11056.     for FSInfoLevel. 
  11057.  
  11058.  FSInfoBuf (PBYTE) - input 
  11059.     Address of the storage area where the system gets the new file system 
  11060.     information. 
  11061.  
  11062.     Level 2 Information 
  11063.        Level 2 information is specified in the following format: 
  11064.  
  11065.        Byte      Description 
  11066.        1         Length of Volume Label (null not included) 
  11067.        2-N       Volume Label ASCIIZ string. 
  11068.  
  11069.  FSInfoBufSize (USHORT) - input 
  11070.     Length of FSInfoBuf. 
  11071.  
  11072.  rc (USHORT) - return 
  11073.     Return code descriptions are: 
  11074.  
  11075.     0         NO_ERROR 
  11076.     15        ERROR_INVALID_DRIVE 
  11077.     82        ERROR_CANNOT_MAKE 
  11078.     122       ERROR_INSUFFICIENT_BUFFER 
  11079.     123       ERROR_INVALID_NAME 
  11080.     124       ERROR_INVALID_LEVEL 
  11081.     154       ERROR_LABEL_TOO_LONG 
  11082.  
  11083.  Remarks 
  11084.  
  11085.  Trailing blanks supplied at volume label definition time are not returned by 
  11086.  DosQFSInfo. 
  11087.  
  11088.  File system information can be set only if the volume is opened in a mode that 
  11089.  allows write-access. 
  11090.  
  11091.  
  11092. ΓòÉΓòÉΓòÉ 1.147. DosSetMaxFH ΓòÉΓòÉΓòÉ
  11093.  
  11094.                                Bindings:  C, MASM
  11095.  
  11096. This call defines the maximum number of file handles for the current process. 
  11097.  
  11098.  DosSetMaxFH     (NumberHandles) 
  11099.  
  11100.  NumberHandles (USHORT) - input 
  11101.     Total number of file handles to be provided. 
  11102.  
  11103.  rc (USHORT) - return 
  11104.     Return code descriptions are: 
  11105.  
  11106.     0         NO_ERROR 
  11107.     8         ERROR_NOT_ENOUGH_MEMORY 
  11108.     87        ERROR_INVALID_PARAMETER 
  11109.  
  11110.  Remarks 
  11111.  
  11112.  OS/2 initially allots 20 file handles to a process, which is the recommended 
  11113.  amount for an application.  However, if the system limit has not been reached, 
  11114.  this amount can be increased with DosSetMaxFH. When this call is made, all 
  11115.  open file handles are preserved. 
  11116.  
  11117.  
  11118. ΓòÉΓòÉΓòÉ 1.148. DosSetNmPHandState ΓòÉΓòÉΓòÉ
  11119.  
  11120.                                Bindings:  C, MASM
  11121.  
  11122. This call sets the read and blocking modes of a named pipe. 
  11123.  
  11124.  DosSetNmPHandState      (Handle, PipeHandleState) 
  11125.  
  11126.  Handle (HPIPE) - input 
  11127.     Handle of the named pipe returned by DosMakeNmPipe or DosOpen. 
  11128.  
  11129.  PipeHandleState (USHORT) - input 
  11130.     Named pipe handle state, consists of the following bit fields: 
  11131.  
  11132.     Bit       Description 
  11133.  
  11134.     15        Blocking flag: 
  11135.  
  11136.               0 = Reads /Writes block if no data available. 
  11137.  
  11138.               1 = Reads/Writes return immediately if no data available. 
  11139.  
  11140.               Reads normally block until at least partial data can be returned. 
  11141.               Writes by default block until all bytes requested have been 
  11142.               written.  Non-blocking mode (B = 1) changes this behavior as 
  11143.               follows: 
  11144.  
  11145.        DosRead 
  11146.                  Returns BytesRead = 0 if no data is available. 
  11147.        DosWrite 
  11148.                  Returns BytesWritten = 0 if there is not enough buffer space 
  11149.                  available in the pipe.  Otherwise, the entire data area is 
  11150.                  transferred. 
  11151.  
  11152.     14-10     Reserved and must be set to zero. 
  11153.  
  11154.     9-8       Read Mode flag: 
  11155.  
  11156.               00 = Read pipe as byte stream. 
  11157.  
  11158.               01 = Read pipe as a message stream. 
  11159.  
  11160.     7-0       Reserved and must be set to zero. 
  11161.  
  11162.  rc (USHORT) - return 
  11163.     Return code descriptions are: 
  11164.  
  11165.     0         NO_ERROR 
  11166.     87        ERROR_INVALID_PARAMETER 
  11167.     230       ERROR_BAD_PIPE 
  11168.     231       ERROR_PIPE_BUSY 
  11169.     233       ERROR_PIPE_NOT_CONNECTED 
  11170.  
  11171.  Remarks 
  11172.  
  11173.  The read mode and blocking/non-blocking mode of a named pipe can be changed. 
  11174.  The pipe mode can not be changed to non-blocking when another thread is 
  11175.  blocked on an I/O to the same end of the pipe. 
  11176.  
  11177.  
  11178. ΓòÉΓòÉΓòÉ 1.149. DosSetNmPipeSem ΓòÉΓòÉΓòÉ
  11179.  
  11180.                                Bindings:  C, MASM
  11181.  
  11182. This call attaches a system semaphore to a local named pipe. 
  11183.  
  11184.  DosSetNmPipeSem     (Handle, SemHandle, KeyHandle) 
  11185.  
  11186.  Handle (HPIPE) - input 
  11187.     Handle of the named pipe returned by DosMakeNmPipe or DosOpen. 
  11188.  
  11189.  SemHandle (HSEM) - input 
  11190.     A system semaphore handle that is cleared when the pipe (identified by 
  11191.     Handle) has read data or write space available. 
  11192.  
  11193.  KeyHandle (USHORT) - input 
  11194.     An arbitrary value that is used to associate named pipe actions with result 
  11195.     codes in DosQNmPipeSemState. 
  11196.  
  11197.  rc (USHORT) - return 
  11198.     Return code descriptions are: 
  11199.  
  11200.     0         NO_ERROR 
  11201.     6         ERROR_INVALID_HANDLE 
  11202.     87        ERROR_INVALID_PARAMETER 
  11203.     120       ERROR_INVALID_FUNCTION 
  11204.     187       ERROR_SEM_NOT_FOUND 
  11205.     230       ERROR_BAD_PIPE 
  11206.     233       ERROR_PIPE_NOT_CONNECTED 
  11207.  
  11208.  Remarks 
  11209.  
  11210.  This call is intended for use only with local named pipes. If an attempt is 
  11211.  made to attach a semaphore to a remote named pipe, ERROR_INVALID_FUNCTION is 
  11212.  returned. 
  11213.  
  11214.  DosSetNmPipeSem supports serving applications that need to handle a large 
  11215.  number of incoming pipes. By using semaphores, the application avoids such 
  11216.  resource-consuming methods as dedicating a thread for each incoming pipe, or 
  11217.  polling each pipe with non-blocking I/O. Instead, the application issues a 
  11218.  DosSemWait or a  DosMuxSemWait and waits for notification that I/O can be 
  11219.  performed. 
  11220.  
  11221.  The system semaphore indicated by SemHandle is attached to the named pipe 
  11222.  indicated by Handle. Up to two semaphores may be attached to a pipe, one for 
  11223.  the serving side and one for the client side.  If a semaphore is already 
  11224.  attached to a side of the pipe, the semaphore is overridden. 
  11225.  
  11226.  The arbitrary value assigned to KeyHandle as input for DosSetNmPipeSem is used 
  11227.  by DosQNmPipeSemState as output. This enables the application to distinguish 
  11228.  events specific to a particular pipe when several pipes are attached to the 
  11229.  same semaphore. DosQNmPipeSemState can be used to provide additional 
  11230.  information about the I/O that can be performed on the set of pipes. 
  11231.  
  11232.  
  11233. ΓòÉΓòÉΓòÉ 1.150. DosSetPathInfo ΓòÉΓòÉΓòÉ
  11234.  
  11235.                                Bindings:  C, MASM
  11236.  
  11237. This call sets attribute and extended attribute information for a file or 
  11238. subdirectory. 
  11239.  
  11240.  DosSetPathInfo     (PathName, PathInfoLevel, PathInfoBuf, PathInfoBufSize, 
  11241.                     PathInfoFlags, Reserved) 
  11242.  
  11243.  PathName (PSZ) - input 
  11244.     Address of the ASCIIZ full path name of the file or subdirectory. Global 
  11245.     file name characters are not permitted. 
  11246.  
  11247.     DosQSysInfo is called by an application during initialization to determine 
  11248.     the maximum path length allowed by OS/2. 
  11249.  
  11250.  PathInfoLevel (USHORT) - input 
  11251.     Level of file object information being defined. A value of 1 or 2 can be 
  11252.     specified. The structures described in PathInfoBuf indicate the information 
  11253.     being set for each of these levels. 
  11254.  
  11255.  PathInfoBuf (PBYTE) - input 
  11256.     Address of the storage area containing the file information being set. 
  11257.  
  11258.     Level 1 Information 
  11259.        PathInfoBuf contains the following structure, to which information is 
  11260.        specified in the following format: 
  11261.  
  11262.        filedate (FDATE) 
  11263.           Structure containing the date of creation. 
  11264.  
  11265.           Bit       Description 
  11266.           15-9      Year, in binary, of creation 
  11267.           8-5       Month, in binary, of creation 
  11268.           4-0       Day, in binary, of creation. 
  11269.  
  11270.        filetime (FTIME) 
  11271.           Structure containing the time of creation. 
  11272.  
  11273.           Bit       Description 
  11274.           15-11     Hours, in binary, of creation 
  11275.           10-5      Minutes, in binary, of creation 
  11276.           4-0       Seconds, in binary number of two-second increments, of 
  11277.                     creation. 
  11278.  
  11279.        fileaccessdate (FDATE) 
  11280.           Structure containing the date of last access. See FDATE in filedate. 
  11281.  
  11282.        fileaccesstime (FTIME) 
  11283.           Structure containing the time of last access. See FTIME in filetime. 
  11284.  
  11285.        writeaccessdate (FDATE) 
  11286.           Structure containing the date of last write. See FDATE in filedate. 
  11287.  
  11288.        writeaccesstime (FTIME) 
  11289.           Structure containing the time of last write. See FTIME in filetime. 
  11290.  
  11291.     Level 2 Information 
  11292.        PathInfoBuf contains an EAOP structure, which has the following format: 
  11293.  
  11294.        fpGEAList (PGEALIST) 
  11295.           Address of GEAList. GEAList is a packed array of variable length "get 
  11296.           EA" structures, each containing an EA name and the length of the 
  11297.           name. 
  11298.  
  11299.        fpFEAList (PFEALIST) 
  11300.           Address of FEAList. FEAList is a packed array of variable length 
  11301.           "full EA" structures, each containing an EA name and its 
  11302.           corresponding value, as well as the lengths of the name and the 
  11303.           value. 
  11304.  
  11305.        oError (ULONG) 
  11306.           Offset into structure where error has occurred. 
  11307.  
  11308.           Level 2 sets a series of EA name/value pairs. On input, FileInfoBuf 
  11309.           is an EAOP structure above.  fpGEAList is ignored. fpFEAList points 
  11310.           to a data area where the relevant FEA list is to be found.  oError is 
  11311.           ignored. Following is the format of the FEAList structure: 
  11312.  
  11313.        cbList (ULONG) 
  11314.           Length of the FEA list, including the length itself. 
  11315.  
  11316.        list (FEA) 
  11317.           List of FEA structures.  An FEA structure has the following format: 
  11318.  
  11319.           Flags (BYTE) 
  11320.              Bit indicator describing the characteristics of the EA being 
  11321.              defined. 
  11322.  
  11323.              Bit       Description 
  11324.              7         Critical EA. 
  11325.              6-0       Reserved and must be set to zero. 
  11326.  
  11327.              If bit 7 is set to 1, this indicates a critical EA.  If bit 7 is 
  11328.              0, this means the EA is noncritical; that is, the EA is not 
  11329.              essential to the intended use by an application of the file with 
  11330.              which it is associated. 
  11331.  
  11332.           cbName (BYTE) 
  11333.              Length of EA ASCIIZ name, which does not include the null 
  11334.              character. 
  11335.  
  11336.           cbValue (USHORT) 
  11337.              Length of EA value, which cannot exceed 64KB. 
  11338.  
  11339.           szName (PSZ) 
  11340.              Address of the ASCIIZ name of EA. 
  11341.  
  11342.           aValue (PSZ) 
  11343.              Address of the free-format value of EA. 
  11344.  
  11345.        Note: 
  11346.           The szName and aValue fields are not included as part of header or 
  11347.           include files.  Because of their variable lengths, these entries must 
  11348.           be built manually. 
  11349.  
  11350.        On output, fpGEAList is unchanged.  fpFEAList is unchanged as is the 
  11351.        area pointed to by fpFEAList.  If an error occurred during the set, 
  11352.        oError is the offset of the FEA where the error occurred.  The API 
  11353.        return code is the error code corresponding to the condition generating 
  11354.        the error.  If no error occurred, oError is undefined. 
  11355.  
  11356.  PathInfoBufSize (USHORT) - input 
  11357.     Length of PathInfoBuf. 
  11358.  
  11359.  PathInfoFlags (USHORT) - input 
  11360.     PathInfoFlags contain information on how the set operation is performed. 
  11361.     Only one bit is defined.  If PathInfoFlags = 0010H, then the information 
  11362.     being set must be written out to disk before returning  to the application. 
  11363.     This guarantees that the EAs have been written to disk. All other bits are 
  11364.     reserved and must be zero. 
  11365.  
  11366.  Reserved (ULONG) - input 
  11367.     Reserved, must be set to zero. 
  11368.  
  11369.  rc (USHORT) - return 
  11370.     Return code descriptions are: 
  11371.  
  11372.     0         NO_ERROR 
  11373.     32        ERROR_SHARING_VIOLATION 
  11374.     87        ERROR_INVALID_PARAMETER 
  11375.     124       ERROR_INVALID_LEVEL 
  11376.     206       ERROR_FILENAME_EXCED_RANGE 
  11377.     122       ERROR_INSUFFICIENT_BUFFER 
  11378.     254       ERROR_INVALID_EA_NAME 
  11379.     255       ERROR_EA_LIST_INCONSISTENT 
  11380.  
  11381.  Remarks 
  11382.  
  11383.  To set any level of file information for a file or subdirectory with 
  11384.  DosSetPathInfo, a process must have exclusive write access to the closed file 
  11385.  object. Thus, if the file object is already accessed by another process, a 
  11386.  call to DosSetPathInfo fails. 
  11387.  
  11388.  A zero (0) value in both the date and time components of a field cause that 
  11389.  field to be left unchanged.  For example, if both "Last write date" and "Last 
  11390.  write time" are specified as zero in the Level 0001H information structure, 
  11391.  then both attributes of the file are left unchanged. If either "Last write 
  11392.  date" or "Last write time" are specified as non-zero, then both attributes of 
  11393.  the file are set to the new values. 
  11394.  
  11395.  The write-through bit in PathInfo Flags should be used only in cases where it 
  11396.  is necessary, for data integrity purposes, to write the EAs out to disk 
  11397.  immediately, instead of caching them and writing them out later. Setting the 
  11398.  write-through bit all the time may degrade the performance. 
  11399.  
  11400.  The last modification date and time will get changed if the extended 
  11401.  attributes are modified. 
  11402.  
  11403.  
  11404. ΓòÉΓòÉΓòÉ 1.151. DosSetProcCp ΓòÉΓòÉΓòÉ
  11405.  
  11406.                                Bindings:  C, MASM
  11407.  
  11408. This call allows a process to set its code page. 
  11409.  
  11410.  DosSetProcCp     (CodePage, Reserved) 
  11411.  
  11412.  CodePage (USHORT) - input 
  11413.     Code page identifier word that has one of the following values: 
  11414.  
  11415.     Value     Definition 
  11416.     437       IBM PC US 437 code page 
  11417.     850       Multilingual code page 
  11418.     860       Portuguese code page 
  11419.     863       Canadian-French code page 
  11420.     865       Nordic code page. 
  11421.  
  11422.  Reserved (USHORT) - input 
  11423.     Reserved must be set to zero. 
  11424.  
  11425.  rc (USHORT) - return 
  11426.     Return code description is: 
  11427.  
  11428.     0         NO_ERROR 
  11429.     472       ERROR_INVALID_CODEPAGE 
  11430.  
  11431.  Remarks 
  11432.  
  11433.  DosSetProcCp sets the process code page of the calling process.  The code page 
  11434.  of a process is used in the following ways.  First, the printer code page is 
  11435.  set to the process code page through the file system and printer spooler when 
  11436.  the process makes an open printer request. Calling DosSetProcCp does not 
  11437.  affect the code page of a printer opened prior to the call and does not affect 
  11438.  the code page of a printer opened by another process. Second, country 
  11439.  dependent information, by default, is retrieved encoded in the code page of 
  11440.  the calling process.  And third, a newly created process inherits its process 
  11441.  code page from its parent process. DosSetProcCp does not affect the display or 
  11442.  keyboard code page. Also see DosSetCp. 
  11443.  
  11444.  
  11445. ΓòÉΓòÉΓòÉ 1.152. DosSetPrty ΓòÉΓòÉΓòÉ
  11446.  
  11447.                                Bindings:  C, MASM
  11448.  
  11449. This call allows a process to change the priority of all the threads of any 
  11450. process; or all the threads of the current process or a child process, as well 
  11451. as any descendants; or a single thread within the current process. When a 
  11452. process changes the priority of threads in other processes, only default 
  11453. priorities are changed. 
  11454.  
  11455.  DosSetPrty     (Scope, PriorityClass, PriorityDelta, ID) 
  11456.  
  11457.  Scope (USHORT) - input 
  11458.     The extent of the priority change. 
  11459.  
  11460.     Value     Definition 
  11461.  
  11462.     0         All the threads of any process. 
  11463.  
  11464.     1         All the threads of a process and any descendants. The indicated 
  11465.               process must be the current process or a process created by the 
  11466.               current process. Detached processes may not be specified. The 
  11467.               indicated process may possibly have terminated. 
  11468.  
  11469.     2         A single thread of the current process. 
  11470.  
  11471.  PriorityClass (USHORT) - input 
  11472.     Priority class of a process. The values and descriptions are: 
  11473.  
  11474.     Value     Definition 
  11475.     0         No change, leave as is 
  11476.     1         Idle-time 
  11477.     2         Regular 
  11478.     3         Time-critical. 
  11479.     4         Fixed-high. 
  11480.  
  11481.  PriorityDelta (SHORT) - input 
  11482.     Delta priority to apply to the process's current base priority level.  This 
  11483.     value must range from -31 to +31. 
  11484.  
  11485.  ID (USHORT) - input 
  11486.     A process ID (scope = 0 or 1) or a thread ID (scope = 2). If this operand 
  11487.     is equal to zero, the current process or thread is assumed. 
  11488.  
  11489.  rc (USHORT) - return 
  11490.     Return code descriptions are: 
  11491.  
  11492.     0         NO_ERROR 
  11493.     303       ERROR_INVALID_PROCID 
  11494.     304       ERROR_INVALID_PDELTA 
  11495.     305       ERROR_NOT_DESCENDANT 
  11496.     307       ERROR_INVALID_PCLASS 
  11497.     308       ERROR_INVALID_SCOPE 
  11498.     309       ERROR_INVALID_THREADID 
  11499.  
  11500.  Remarks 
  11501.  
  11502.  The OS/2 scheduler has a concept of priority classes and levels.  DosSetPrty 
  11503.  allows threads to move between classes in response to changes in their 
  11504.  execution environments. Within each class, a thread's priority level can vary 
  11505.  because of a DosSetPrty request or action taken by the system. 
  11506.  System-initiated priority variation is performed as a combination of a 
  11507.  specific thread's actions and the overall system activity. 
  11508.  
  11509.  A time-critical thread has the highest priority class and executes before any 
  11510.  fixed-high, regular, or idle-time threads. A fixed-high thread has a priority 
  11511.  class that is lower than time-critical but executes before any regular or 
  11512.  idle-time threads. 
  11513.  
  11514.  Time-critical threads have static priorities that are not varied by OS/2. 
  11515.  Threads are scheduled in priority order, with round-robin scheduling of 
  11516.  threads of equal priority. 
  11517.  
  11518.  For each of the four priority classes, there are 32 distinct priority levels, 
  11519.  0 to +31. Whenever DosSetPrty is issued with a class specification, but no 
  11520.  value is specified for PriorityDelta, the base priority level defaults to 
  11521.  zero. 
  11522.  
  11523.  The priority level of a process consists of a computed priority value that is 
  11524.  based upon the display status (foreground or background) of the process, its 
  11525.  recent I/O and processor time-usage history, and other factors. The signed 
  11526.  value specified in PriorityDelta is added to the computed priority to produce 
  11527.  the actual priority used by the scheduler. The result is restricted to the 
  11528.  valid range, based upon the current priority class. 
  11529.  
  11530.  Specifying a higher priority delta allows a thread to obtain better processor 
  11531.  scheduling than it normally would.  A lower priority delta gives the thread 
  11532.  less processor resource than it normally receives. 
  11533.  
  11534.  When used with PriorityClass to change to a different class, the delta value 
  11535.  applies to the base priority. A new base level of 0 is assigned the target 
  11536.  thread and any PriorityDelta specified is relative to zero. 
  11537.  
  11538.  A process can change the priority of any thread within its current process. 
  11539.  However, when a process changes the priority of threads in another process, 
  11540.  only those with default priorities are changed. The priority of any thread in 
  11541.  another process that has explicitly changed its priority from the default with 
  11542.  DosSetPrty is not changed. 
  11543.  
  11544.  The initial thread of execution for an application is given a regular class 
  11545.  priority that varies by the system. A thread started with DosCreateThread 
  11546.  inherits the priority of the thread in the process that creates it. A child 
  11547.  process started by a DosExecPgm call inherits the priority of the thread in 
  11548.  the parent process that creates it. 
  11549.  
  11550.  
  11551. ΓòÉΓòÉΓòÉ 1.153. DosSetSession ΓòÉΓòÉΓòÉ
  11552.  
  11553.                                Bindings:  C, MASM
  11554.  
  11555. This call sets the status of a child session. 
  11556.  
  11557.  DosSetSession     (SessID, StatusData) 
  11558.  
  11559.  SessID (USHORT) - input 
  11560.     ID of the target session.  The value specified for SessID must have been 
  11561.     returned on a prior call to DosStartSession. 
  11562.  
  11563.  StatusData (PSTATUSDATA) - input 
  11564.     Address of the session status data structure: 
  11565.  
  11566.     length (USHORT) 
  11567.        Length of structure, including length. 
  11568.  
  11569.        6         Only valid value. 
  11570.  
  11571.     selectind (USHORT) 
  11572.        Specifies whether the target session is flagged as selectable or 
  11573.        non-selectable: The operator can continue to select a non-selectable 
  11574.        (bonded) windowed session by pressing a mouse button within a visible 
  11575.        part of the window. 
  11576.  
  11577.        Value     Definition 
  11578.        0         Leave current setting unchanged. 
  11579.        1         Selectable. 
  11580.        2         Non-selectable. 
  11581.  
  11582.     bondind (USHORT) 
  11583.        Specifies which session to bring to the foreground the next time the 
  11584.        parent session is selected. The operator may continue to select a 
  11585.        non-selectable (bonded) windowed session by pressing a mouse button 
  11586.        within a visible part of the window. 
  11587.  
  11588.        Value     Definition 
  11589.  
  11590.        0         Leave current setting unchanged. 
  11591.  
  11592.        1         Establish a bond between parent session and child session. The 
  11593.                  child session is brought to the foreground the next time the 
  11594.                  parent session is selected, or when the child session itself 
  11595.                  is selected. 
  11596.  
  11597.        2         Bring either the parent session to the foreground the next 
  11598.                  time the parent session is selected, or the child session if 
  11599.                  the child session is selected. Any bond previously established 
  11600.                  with a child session is broken. 
  11601.  
  11602.  rc (USHORT) - return 
  11603.     Return code descriptions are: 
  11604.  
  11605.     0         NO_ERROR 
  11606.     369       ERROR_SMG_INVALID_SESSION_ID 
  11607.     418       ERROR_SMG_INVALID_CALL 
  11608.     452       ERROR_SMG_SESSION_NOT_PARENT 
  11609.     455       ERROR_SMG_INVALID_BOND_OPTION 
  11610.     456       ERROR_SMG_INVALID_SELECT_OPT 
  11611.     461       ERROR_SMG_INVALID_DATA_LENGTH 
  11612.  
  11613.  Remarks 
  11614.  
  11615.  DosSetSession sets one or both of the following structure elements related to 
  11616.  a child session.  The elements can be set individually by the parent session, 
  11617.  and either one can be changed without affecting the current setting of the 
  11618.  other: 
  11619.  
  11620.  selectind 
  11621.            Sets the child session selectable or non-selectable. 
  11622.  bondind 
  11623.            Bonds the child session to the parent session. If the operator 
  11624.            selects the parent session from the Task Manager, the child session 
  11625.            is brought to the foreground. 
  11626.  
  11627.  These elements only affect selections made by the operator from the switch 
  11628.  list, not selections made by the parent session. When a parent session selects 
  11629.  its own session, the parent session is brought to the foreground even if a 
  11630.  bond is in effect.  When a parent session selects a child session, the child 
  11631.  session is brought to the foreground even if the parent session had set the 
  11632.  child session to be non-selectable. 
  11633.  
  11634.  DosSetSession may be issued by a process only for a child session it started 
  11635.  with a DosStartSession request, specifying Related=1. Neither the parent 
  11636.  session nor any grandchild session may be the target of DosSetSession. 
  11637.  
  11638.  A bond established between a parent session and a child session can be broken 
  11639.  by reissuing DosSetSession and specifying either: 
  11640.  
  11641.  bondind = 2 
  11642.            Breaks the bond between the parent session and the child session. 
  11643.  bondind = 1 
  11644.            Establishes a bond with a different child session.  In this case the 
  11645.            bond with the previous child session is broken. 
  11646.  
  11647.  Assume a bond is established between session A and its immediate child session 
  11648.  B.  Assume another bond is established between session B and its immediate 
  11649.  child session C.  Now if the operator selects session A, session C is brought 
  11650.  to the foreground.  However, if session A selects its own session, session A 
  11651.  is brought to the foreground. If session A selects session B, session C is 
  11652.  brought to the foreground. In the latter case, the bond between B and C is 
  11653.  honored. 
  11654.  
  11655.  Assume a bond is established between session A and its immediate child session 
  11656.  B, and assume B is non-selectable.  The operator cannot select session B 
  11657.  directly.  However, if the operator selects session A, session B is brought to 
  11658.  the foreground. 
  11659.  
  11660.  A parent session can run in either the foreground or background when 
  11661.  DosSetSession is issued. 
  11662.  
  11663.  
  11664. ΓòÉΓòÉΓòÉ 1.154. DosSetSigHandler ΓòÉΓòÉΓòÉ
  11665.  
  11666.                                Bindings:  C, MASM
  11667.  
  11668. This call notifies OS/2 of a handler for a signal.  It may also be used to 
  11669. ignore a signal or install a default action for a signal. 
  11670.  
  11671.  DosSetSigHandler     (Routine, PrevAddress, PrevAction, Action, SigNumber) 
  11672.  
  11673.  Routine (PFNSIGHANDLER) - input 
  11674.     Address of the entry point of routine that receives control when a signal 
  11675.     equal to SigNumber is received. 
  11676.  
  11677.  PrevAddress (PFNSIGHANDLER FAR *) - output 
  11678.     Address of the previous signal handler.  This operand may be coded as null 
  11679.     (= 0), then it is ignored. 
  11680.  
  11681.  PrevAction (PUSHORT) - output 
  11682.     Address of the previous signal action.  Only values 0 to 3 are returned. 
  11683.     This operand may be coded as null (= 0), then it is ignored. 
  11684.  
  11685.  Action (USHORT) - input 
  11686.     Indicates what action to take when the specified signal is received: 
  11687.  
  11688.     Value     Definition 
  11689.     0         The system default action is installed for the signal. 
  11690.     1         The signal is to be ignored. 
  11691.     2         The routine receives control when the SigNumber occurs. 
  11692.     3         It is an error for any program to signal this SigNumber to this 
  11693.               process. 
  11694.     4         The current signal is reset without affecting the disposition of 
  11695.               the signal. 
  11696.  
  11697.  SigNumber (USHORT) - input 
  11698.     Signal number to be intercepted by this signal handler.  The signal numbers 
  11699.     defined are: 
  11700.  
  11701.     Value     Definition 
  11702.     1         Ctrl-C (SIGINTR) 
  11703.     3         Program terminated (SIGTERM) 
  11704.     4         Ctrl-Break (SIGBREAK) 
  11705.     5         Process flag A (SIGPFA) 
  11706.     6         Process flag B (SIGPFB) 
  11707.     7         Process flag C (SIGPFC) 
  11708.  
  11709.  Note: 
  11710.     Presentation Manager applications may not establish signal handlers for 
  11711.     Ctrl-C and Ctrl-Break.  Establishing a signal handler for Ctrl-C and 
  11712.     Ctrl-Break is supported for VIO-Windowable and full-screen applications. 
  11713.  
  11714.     The following chart indicates what signal to specify to cause the signal 
  11715.     handler to get control for the CTRL-C and CTRL-Break key sequences in each 
  11716.     of the keyboard modes (ASCII and Binary): 
  11717.  
  11718.          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11719.          Γöé               Γöé ASCII Mode   Γöé BINARY Mode   Γöé
  11720.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11721.          Γöé CTRL-C        Γöé SIGINTR      Γöé               Γöé
  11722.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11723.          Γöé CTRL-Break    Γöé SIGINTR      Γöé SIGBREAK      Γöé
  11724.          ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11725.  
  11726.  rc (USHORT) - return 
  11727.     Return code descriptions are: 
  11728.  
  11729.     0         NO_ERROR 
  11730.     1         ERROR_INVALID_FUNCTION 
  11731.     209       ERROR_INVALID_SIGNAL_NUMBER 
  11732.     210       ERROR_THREAD_1_INACTIVE 
  11733.  
  11734.  Remarks 
  11735.  
  11736.  When the signal indicated by SigNumber occurs, the signal handling routine 
  11737.  receives control with: 
  11738.  
  11739.  (SS:SP) 
  11740.            Far return address 
  11741.  (SS:SP+4) 
  11742.            SigNumber being processed 
  11743.  (SS:SP+6) 
  11744.            SigArg furnished on the DosFlagProcess request, if appropriate. 
  11745.  
  11746.  Other than SS, SP, CS, IP and flags, all registers contain the same values 
  11747.  they contained at the time the signal was received. The handler may exit by 
  11748.  executing an intersegment return instruction, or by manually setting the stack 
  11749.  frame to some known state and jumping to some known location.  If the former 
  11750.  option is selected, execution resumes where it was interrupted, and all 
  11751.  registers are restored to their values at the time of the interruption. 
  11752.  
  11753.  The signal handler is given control under the first thread  of a process, not 
  11754.  a thread created by the DosCreateThread system request. It is invalid to issue 
  11755.  this system call when thread 1 has terminated.  If thread 1 terminates with 
  11756.  other threads still active, all signals are reset to the default action. 
  11757.  
  11758.  To return from the signal, the handler must remove the signal number and 
  11759.  signal argument passed as parameters.  For handlers written in most high-level 
  11760.  languages, this is done automatically.  A handler written in assembler 
  11761.  language must execute a 
  11762.  Far RET 4 instruction or its equivalent, to return to the caller. The signal 
  11763.  handler may also reset the stack pointer to some previous valid stack frame 
  11764.  and jump to some other part of the program. 
  11765.  
  11766.  The values returned in PrevAddress and PrevAction are to be used for restoring 
  11767.  the previous signal handler when the current process no longer wishes to 
  11768.  intercept this signal.  For Action = 4, no values are returned for PrevAddress 
  11769.  or PrevAction. 
  11770.  
  11771.  When a signal is issued from the base keyboard device driver in response to a 
  11772.  Ctrl-C or Ctrl-Break key press, the default action terminates the process if 
  11773.  the application did not install a signal handler for any signal numbers 1-4. 
  11774.  
  11775.  For signals of type SIGINTR or SIGBREAK, a call to DosSetSigHandler also 
  11776.  determines which process within the current session is signalled as a result 
  11777.  of a device driver call to Device Helper Services for the SendEvent function 
  11778.  and CTRL-C (or CTRL-BREAK) event type.  (See the IBM Operating System/2 
  11779.  Version 1.2 I/O Subsystems And Device Support Volume 1, Device Helper Services 
  11780.  discussion). This process is known as the `signal focus" for SIGINTR (or 
  11781.  SIGBREAK) within its session.  The signal focus for SIGINTR need not be the 
  11782.  same process as the signal focus for SIGBREAK.  The determination for signal 
  11783.  focus follows. 
  11784.  
  11785.  Initially, a session has no signal focus for SIGINTR (or SIGBREAK).  A process 
  11786.  becomes the signal focus for SIGINTR ( or SIGBREAK) within its session if it 
  11787.  calls DosSetSigHandler with ActionCode equal to 1, 2, or 3. A process remains 
  11788.  the signal focus until: 
  11789.  
  11790.  o The process terminates. 
  11791.  o The process calls DosSetSigHandler with ActionCode equal to zero. 
  11792.  o Another process calls DosSetSigHandler with ActionCode equal to 1, 2, or 3. 
  11793.  
  11794.  In the first two cases, the parent or its closest related ancestor process 
  11795.  that has a handler installed for the appropriate signal becomes the focus.  If 
  11796.  no eligible process exists, the session ceases to have a signal focus for that 
  11797.  signal. 
  11798.  
  11799.  If a device driver makes a SendEvent call for CTRL-C or CTRL-BREAK and the 
  11800.  current session has no focus for the corresponding signal, all processes in 
  11801.  the session are signaled with SIGTERM to terminate. 
  11802.  
  11803.  
  11804.  Family API Considerations 
  11805.  
  11806.  Some options operate differently in the DOS mode than in OS/2 mode. 
  11807.  Therefore, the following restriction applies to DosSetSigHandler when coding 
  11808.  in DOS mode: 
  11809.  
  11810.  o The only signals recognized in DOS are SIGINTR (Ctrl-C) and SIGBREAK. 
  11811.  
  11812.  o The option Action=3 generates an "invalid signal number" error. 
  11813.  
  11814.  o If SigNumber is any value other than SIGINTR or SIGBREAK, then an "invalid 
  11815.    signal number" error is generated. 
  11816.  
  11817.  SIGINTR is fully supported, and SIGBREAK is related to SIGINTR. Therefore, if 
  11818.  SIGINTR is specified, both SIGINTR and SIGBREAK are transferred to the SIGINTR 
  11819.  handler.  SIGBREAK is permitted as a coded value, but the request to set 
  11820.  SIGBREAK is ignored.  To be compatible in all environments, SIGBREAK and 
  11821.  SIGINTR should be considered together in all cases. 
  11822.  
  11823.  
  11824. ΓòÉΓòÉΓòÉ 1.155. DosSetVec ΓòÉΓòÉΓòÉ
  11825.  
  11826.                                Bindings:  C, MASM
  11827.  
  11828. This call allows a process to register an address to be used when a machine 
  11829. exception occurs. 
  11830.  
  11831.  DosSetVec    (VecNum, Routine, PrevAddress) 
  11832.  
  11833.  VecNum (USHORT) - input 
  11834.     Number of the vector to be serviced by this routine. Valid values are: 
  11835.  
  11836.     Value     Definition 
  11837.     00        Divide overflow 
  11838.     04        Overflow 
  11839.     05        Bound 
  11840.     06        Invalid opcode 
  11841.     07        Processor extension not available 
  11842.     16        Processor extension error. 
  11843.  
  11844.  Routine (PFN) - input 
  11845.     Address of a routine to be entered when the exception occurs. If this 
  11846.     parameter is 0, any previous address is de-registered. 
  11847.  
  11848.  PrevAddress (PFN) - output 
  11849.     Address of the previous handler routine.  This is provided so a handler may 
  11850.     be set, then later restored to the previous handler. 
  11851.  
  11852.  rc (USHORT) - return 
  11853.     Return code descriptions are: 
  11854.  
  11855.     1         ERROR_INVALID_FUNCTION 
  11856.     50        ERROR_NOT_SUPPORTED 
  11857.  
  11858.  Remarks 
  11859.  
  11860.  The DosSetVec process is analogous to setting an address in the interrupt 
  11861.  vector table when running in 8086 mode. 
  11862.  
  11863.  Should an exception occur, and the process has registered a handler, that 
  11864.  handler is entered as if its address had been stored in the CPU's interrupt 
  11865.  vector, except that the interrupt is still enabled.  If no address has been 
  11866.  registered for that vector, the process terminates. 
  11867.  
  11868.  When a process registers an exception handler for VecNum 7 (processor 
  11869.  extension not available), the machine status word (MSW) for that process is 
  11870.  set to indicate that a numeric processor extension (NPX) 287 is not present in 
  11871.  the machine.  The Emulate bit is set and the Monitor Processor bit is reset. 
  11872.  This is done without regard for the true state of the hardware. 
  11873.  
  11874.  When a process de-registers a handler for VecNum 7, the MSW is set to reflect 
  11875.  the true state of the hardware. 
  11876.  
  11877.  When an NPX287 exception is processing, the NPX287 status word is passed to 
  11878.  the exception handler by being pushed on the stack before the exception 
  11879.  handler is invoked.  When the exception handler has completed execution, this 
  11880.  word must be popped from the stack before an IRET is issued to return to the 
  11881.  exception handler interface routine. 
  11882.  
  11883.  
  11884.  Family API Considerations 
  11885.  
  11886.  Some options operate differently in the DOS mode than in OS/2 mode. 
  11887.  Therefore, the following restriction applies to DosSetVec when coding for the 
  11888.  DOS mode. 
  11889.  
  11890.  VecNum = 7 not supported. 
  11891.  
  11892.  
  11893. ΓòÉΓòÉΓòÉ 1.156. DosSetVerify ΓòÉΓòÉΓòÉ
  11894.  
  11895.                                Bindings:  C, MASM
  11896.  
  11897. This call sets the verify switch. 
  11898.  
  11899.  DosSetVerify    (VerifySetting) 
  11900.  
  11901.  VerifySetting (USHORT) - input 
  11902.     New state of Verify Mode for the requesting process as shown below: 
  11903.  
  11904.     Value     Definition 
  11905.     0         Verify mode is not active. 
  11906.     1         Verify mode is active. 
  11907.  
  11908.  rc (USHORT) - return 
  11909.     Return code descriptions are: 
  11910.  
  11911.     0         NO_ERROR 
  11912.     118       ERROR_INVALID_VERIFY_SWITCH 
  11913.  
  11914.  Remarks 
  11915.  
  11916.  When verify is active, OS/2 performs a verify operation each time it does a 
  11917.  file write to assure proper data recording on the disk. Although disk 
  11918.  recording errors are rare, this function has been provided for applications to 
  11919.  verify the proper recording of critical data. 
  11920.  
  11921.  
  11922. ΓòÉΓòÉΓòÉ 1.157. DosSizeSeg ΓòÉΓòÉΓòÉ
  11923.  
  11924.                                Bindings:  C, MASM
  11925.  
  11926. This call returns the size of a segment. 
  11927.  
  11928.  DosSizeSeg    (Selector, Size) 
  11929.  
  11930.  Selector (SEL) - input 
  11931.     Selector/segment of the segment for which size is to be determined. This 
  11932.     must be the base selector in the case of a huge segment. 
  11933.  
  11934.  Size (PULONG) - output 
  11935.     Address of the returned segment size.  For non-huge segments, size is in 
  11936.     the range 0 through 64KB. For huge segments, size equals (NUMSEG << 16) + 
  11937.     ASIZE where NUMSEG and ASIZE are the last values passed successfully to 
  11938.     DosAllocHuge or DosReallocHuge for this huge segment. 
  11939.  
  11940.  rc (USHORT) - return 
  11941.     Return code description is: 
  11942.  
  11943.     0         NO_ERROR 
  11944.  
  11945.  Remarks 
  11946.  
  11947.  This function provides compatibility for family applications that must run in 
  11948.  DOS or OS/2 mode. DosSizeSeg returns the actual size of memory allocated by a 
  11949.  DosAllocSeg or DosAllocHuge request and is intended for use when the 
  11950.  application is running in DOS mode, where allocations are rounded up to the 
  11951.  next paragraph. 
  11952.  
  11953.  
  11954. ΓòÉΓòÉΓòÉ 1.158. DosShutdown ΓòÉΓòÉΓòÉ
  11955.  
  11956.                                Bindings:  C, MASM
  11957.  
  11958. This call locks out changes to all file systems and forces system buffers to 
  11959. disk in preparation for system power off. 
  11960.  
  11961.  DosShutdown   (Reserved) 
  11962.  
  11963.  Reserved (ULONG) - input 
  11964.     Double-word whose value must be zero. 
  11965.  
  11966.  rc (USHORT) - return 
  11967.     Return code description is: 
  11968.  
  11969.     0         NO_ERROR 
  11970.     274       ERROR_ALREADY_SHUTDOWN 
  11971.     87        ERROR_INVALID_PARAMETER 
  11972.  
  11973.  Remarks 
  11974.  
  11975.  DosShutdown may take several minutes to complete depending on the amount of 
  11976.  data buffered. 
  11977.  
  11978.  Other API function calls that change file system data called while the system 
  11979.  is shutdown will either return the error ERROR_ALREADY_SHUTDOWN or block 
  11980.  permanently. 
  11981.  
  11982.  It should be noted that it will not be possible to increase memory overcommit 
  11983.  once the DosShutdown has been called.  This means that in low memory 
  11984.  situations some functions may fail due to a lack of memory.  This is of 
  11985.  particular importance to the process calling DosShutdown.  All memory that the 
  11986.  calling process will ever need should be allocated before calling DosShutdown. 
  11987.  This includes implicit memory allocation that may be done on behalf of the 
  11988.  caller by system functions. 
  11989.  
  11990.  When DosShutdown returns successfully, it is safe to power the system off or 
  11991.  to reboot it. 
  11992.  
  11993.  
  11994. ΓòÉΓòÉΓòÉ 1.159. DosSleep ΓòÉΓòÉΓòÉ
  11995.  
  11996.                                Bindings:  C, MASM
  11997.  
  11998. This call suspends the current thread for a specified time.  If the requested 
  11999. interval is 0, the call gives up the remainder of the current time slice. 
  12000.  
  12001.  DosSleep    (TimeInterval) 
  12002.  
  12003.  TimeInterval (ULONG) - input 
  12004.     Time interval in milliseconds until the thread is awakened. 
  12005.  
  12006.  rc (USHORT) - return 
  12007.     Return code descriptions are: 
  12008.  
  12009.     0         NO_ERROR 
  12010.     322       ERROR_TS_WAKEUP 
  12011.  
  12012.  Remarks 
  12013.  
  12014.  DosSleep suspends the current thread for the specified time period.  The 
  12015.  actual time it is asleep may be off by a clock tick or two, depending on the 
  12016.  execution status of other threads running in the system. 
  12017.  
  12018.  If the time is 0, the thread gives up the remainder of the current time slice 
  12019.  and allows any other ready threads of equal priority to run with the current 
  12020.  thread for its next slice. Because the amount of sleep time specified is 0, an 
  12021.  immediate return with 0 delay is made if no other ready thread is found. 
  12022.  However, DosSleep does not yield to a thread of lower priority. 
  12023.  
  12024.  If the time is non-0, the time is rounded up to the resolution of the 
  12025.  scheduler clock. 
  12026.  
  12027.  If DosSleep is used to regularly poll an external source to determine the 
  12028.  occurrence of some event, a time equal to the longest response interval should 
  12029.  be used. 
  12030.  
  12031.  For short time intervals, the rounding-up process combined with the thread 
  12032.  priority interactions may cause a sleeping interval to be longer than 
  12033.  requested.  Also, when a process completes sleeping, it is scheduled for 
  12034.  execution.  But that execution could be delayed by hardware interrupts or by 
  12035.  another thread running at a higher priority.  A program should not use the 
  12036.  DosSleep call as a substitute for a real-time clock because rounding of the 
  12037.  sleep interval causes cumulative errors. 
  12038.  
  12039.  Asynchronous timers can be started with DosTimerAsync and  DosTimerStart. 
  12040.  DosTimerAsync starts a one-shot asynchronous timer, and DosTimerStart starts a 
  12041.  periodic interval timer.  DosTimerStop is issued to stop these timers. 
  12042.  
  12043.  Note:  To ensure optimum performance, you should not use DosSleep in a 
  12044.         single-thread Presentation Manager application. See WinStartTimer. 
  12045.  
  12046.  
  12047.  Family API Considerations 
  12048.  
  12049.  Some options operate differently in the DOS mode than in OS/2 mode. 
  12050.  Therefore, the following restrictions apply to DosSleep when coding in DOS 
  12051.  mode: 
  12052.  
  12053.  o DosSleep accuracy can be in error by 0.5%. 
  12054.  o DosSleep can degrade system performance of non-foreground program operations 
  12055.    when DOS mode is in foreground. 
  12056.  
  12057.  
  12058. ΓòÉΓòÉΓòÉ 1.160. DosSMRegisterDD ΓòÉΓòÉΓòÉ
  12059.  
  12060.                                Bindings:  C, MASM
  12061.  
  12062. Allows a device driver to register itself with the Session Manager. 
  12063.  
  12064.  DosSMRegisterDD      (RegisterData) 
  12065.  
  12066.  RegisterData (PREGISTERDATA) - input 
  12067.     Address of the structure containing the RegisterData necessary for this 
  12068.     call. 
  12069.  
  12070.     Length (USHORT) 
  12071.        Length of the data structure in bytes including Length itself.  Length 
  12072.        is 8 for 
  12073.        OS/2 version 1.2. 
  12074.  
  12075.     Notification (USHORT) 
  12076.        Bit map that informs the session manager when to issue the notification 
  12077.        IOCTL to the device driver.  The bits of this word are defined as 
  12078.        follows: 
  12079.  
  12080.        Bit       Description 
  12081.        15-4      Reserved and must be set to zero. 
  12082.        3         Session termination notification.  Action = 8 
  12083.        2         Post-Session restore notification.  Action = 4 
  12084.        1         Post-Session save notification.  Action = 2 
  12085.        0         Pre-Session save notification.  Action = 1 
  12086.  
  12087.        Action is the unsigned integer in the Action field of the notification 
  12088.        IOCTL.  This tells the device driver what is happening. Notice that the 
  12089.        integers correspond to bits 0 to 3 being set. 
  12090.  
  12091.     DDName (ULONG) 
  12092.        Address of the device name, as an ASCIIZ string (ie. SCREEN$, KBD$, 
  12093.        etc.). 
  12094.  
  12095.  rc (USHORT) - return 
  12096.     Return code descriptions are: 
  12097.  
  12098.     418       ERROR_SMG_INVALID_CALL 
  12099.     461       ERROR_SMG_INVALID_DATA_LENGTH 
  12100.     515       ERROR_SMG_TOO_MANY_DDS 
  12101.     516       ERROR_SMG_INVALID_NOTIFICATION 
  12102.  
  12103.  Remarks 
  12104.  
  12105.  The Session Manger calls the registered device driver during a session switch, 
  12106.  based on the specific form of notifications required. 
  12107.  
  12108.  The notification IOCTL passed to the device driver has the following format: 
  12109.  
  12110.  Size      Definition 
  12111.  WORD      DevIOCtl packet length, including the length itself 
  12112.  WORD      Screen switch notification type 
  12113.  WORD      Incoming session number 
  12114.  WORD      Outgoing session number. 
  12115.  
  12116.  The device driver passes a bit map that informs the session manager when the 
  12117.  device driver needs to be called. The possible phases are: 
  12118.  
  12119.  Before a session save 
  12120.  After a session save (before a restore) 
  12121.  After a session restore 
  12122.  After a session termination. 
  12123.  
  12124.  The device drivers must issue this API only during their initialization phase. 
  12125.  After the session manager has been initialized, it rejects all further calls 
  12126.  to this API, returning ERROR_SMG_INVALID_CALL. 
  12127.  
  12128.  
  12129. ΓòÉΓòÉΓòÉ 1.161. DosStartSession ΓòÉΓòÉΓòÉ
  12130.  
  12131.                                Bindings:  C, MASM
  12132.  
  12133. This call allows a program to start another program in a session. 
  12134.  
  12135.  DosStartSession     (StartData, SessID, ProcID) 
  12136.  
  12137.  StartData (PSTARTDATA) - input 
  12138.     Address of the start session structure: 
  12139.  
  12140.     length (USHORT) 
  12141.        Length in bytes of the data structure, including length.  A length of 24 
  12142.        bytes may be specified for OS/2 1.0 applications, or for applications 
  12143.        that do not take advantage of the environment or windowing data. 
  12144.  
  12145.        A length of 30 bytes may be specified for OS/2 applications that want to 
  12146.        use only the environment and inheritance features. 
  12147.  
  12148.        A length of 50 bytes may be selected for applications that want to use 
  12149.        all the functions provided by DosStartSession. However, a length of 50 
  12150.        bytes is not allowed if the Session Manager detects that the 
  12151.        Presentation Manager is not present. 
  12152.  
  12153.     related (USHORT) 
  12154.        Specifies whether the session created is related to the calling session, 
  12155.        with the following values: 
  12156.  
  12157.        Value     Definition 
  12158.        0         New session is an independent session (not related). 
  12159.        1         New session is a child session (related). 
  12160.  
  12161.        An independent session is not a child session and cannot be controlled 
  12162.        by the calling program.  It cannot be specified as the target of 
  12163.        DosSelectSession, DosSetSession, or  DosStopSession.  Note that termq is 
  12164.        ignored for independent sessions, and the value of zero is returned for 
  12165.        the SessID and ProcID parameters. 
  12166.  
  12167.        The calling program (parent session) may specify a child session as the 
  12168.        target of DosSelectSession, DosSetSession, and DosStopSession, for 
  12169.        related sessions. The SessID and ProcID parameters, and termq, are 
  12170.        applicable only when related = 1 is specified. 
  12171.  
  12172.        Note also that for related sessions, although a parent session/child 
  12173.        session relationship is established, a parent process/child process 
  12174.        relationship is not established. 
  12175.  
  12176.     fgbg (USHORT) 
  12177.        Specifies whether the new session should be started in the foreground or 
  12178.        background: 
  12179.  
  12180.        Value     Definition 
  12181.        0         Start session in foreground. 
  12182.        1         Start session in background. 
  12183.  
  12184.     traceopt (USHORT) 
  12185.        Specifies tracing options for the program started in the new session: 
  12186.  
  12187.        Value     Definition 
  12188.        0         Trace off. 
  12189.        1         Trace on; no notification of descendants. 
  12190.        2         Trace on; all descendant sessions. For traceopt = 2, a 
  12191.                  termination queue must be supplied and related set to 1. Refer 
  12192.                  to "Debugger Considerations" in the Remarks section for 
  12193.                  additional information. 
  12194.  
  12195.     pgmtitle (PSZ) 
  12196.        A far pointer to an ASCIIZ string containing the program title.  The 
  12197.        string can be up to 61 bytes long, including the terminating byte of 0. 
  12198.        If pgmtitle is zero or a NULL pointer, then DosStartSession defaults the 
  12199.        program title to the name pgmname points to, minus any leading drive and 
  12200.        path information. 
  12201.  
  12202.     pgmname (PSZ) 
  12203.        Can be one of the following: 
  12204.  
  12205.        o A far address to a NULL string. 
  12206.        o A NULL pointer (a far address equal to zero). 
  12207.        o An address of an ASCIIZ string containing the fully qualified drive, 
  12208.          path, and file name of the program to be loaded. If pgmname is a far 
  12209.          address to a NULL string, or if it is a NULL pointer, the program name 
  12210.          defaults to the command processor defined in the CONFIG.SYS/PROTSHELL 
  12211.          statement. For example, if PROTSHELL=PMSHELL.EXE CMD.EXE, the program 
  12212.          name defaults to CMD.EXE. 
  12213.  
  12214.     pgminputs (PBYTE) 
  12215.        A far pointer to an ASCIIZ string containing the input arguments to be 
  12216.        passed to the program. 
  12217.  
  12218.        Note:  The maximum value allowed for the combined length of pgmname and 
  12219.               pgminputs is 1024 characters. For more information on pgmname and 
  12220.               pgminputs, see "Program Name/Program Input Considerations:" in 
  12221.               the Remarks section. 
  12222.  
  12223.     termq (PBYTE) 
  12224.        Can be one of the following: 
  12225.  
  12226.        o A far address to a NULL string. 
  12227.        o A NULL pointer (a far address equal to zero). 
  12228.        o A far pointer to an ASCIIZ string containing the fully qualified path 
  12229.          and file name of an OS/2 queue created by a DosCreateQueue request. 
  12230.          See "Parent/Child Termination Considerations" in the Remarks section 
  12231.          for additional information. 
  12232.  
  12233.          The process that originally issued the DosStartSession request, also 
  12234.          issues DosReadQueue.  Because this is the only process that has 
  12235.          addressability to the notification data element, it is important that 
  12236.          the NoWait parameter of DosReadQueue is set equal to zero.  This 
  12237.          process must also issue DosFreeSeg to free the segment containing the 
  12238.          data element after it reads and processes the data element. 
  12239.  
  12240.     environment (PBYTE) 
  12241.        Can be one of the following: 
  12242.  
  12243.        o A far address to a NULL string. 
  12244.        o A NULL pointer (a far address equal to zero). 
  12245.        o A far pointer to an ASCIIZ environment string (see DosExecPgm) to be 
  12246.          passed to the program started in the new session; it may be used for 
  12247.          independent or related DosStartSession calls. When environment = 0 
  12248.          (content of the string is not specified and a far address of 0 is 
  12249.          passed), the program in the new session inherits the environment of 
  12250.          the Shell  if inheritopt = 0, or the environment of the program 
  12251.          issuing the DosStartSession call if inheritopt = 1. 
  12252.  
  12253.     inheritopt (USHORT) 
  12254.        Specifies whether the program started in the new session should inherit 
  12255.        the calling process' environment and open file handles: 
  12256.  
  12257.        Value     Definition 
  12258.        0         Inherit from Shell process 
  12259.        1         Inherit from calling process. Note that inheritopt is 
  12260.                  applicable whether the session being started is an independent 
  12261.                  or related session.  After the DosStartSession request has 
  12262.                  completed, the new program's parent process is the Shell, not 
  12263.                  the process that issued the DosStartSession call. See 
  12264.                  "Parent/Child Relationships" in the Remarks section. 
  12265.  
  12266.     sessiontype (USHORT) 
  12267.        Type of session that should be created for this program: 
  12268.  
  12269.        Value     Definition 
  12270.        0         Use pgmhandle or allow the Shell to establish the session type 
  12271.        1         Full screen session 
  12272.        2         Text-windowed session for programs using the Base Video 
  12273.                  Subsystem 
  12274.        3         Presentation Manager session. 
  12275.  
  12276.     iconfile (PSZ) 
  12277.        Can be one of the following: 
  12278.  
  12279.        o A far address to a NULL string 
  12280.        o A NULL pointer (a far address equal to zero) 
  12281.        o A far pointer to an ASCIIZ string containing the fully qualified 
  12282.          drive, path and file name of an icon definition. The system provides 
  12283.          an icon for windowed applications if an icon file name is not provided 
  12284.          on the DosStartSession call. 
  12285.  
  12286.     pgmhandle (ULONG) 
  12287.        This is either 0 or the program handle returned by the WinAddProgram 
  12288.        call.  The program handle identifies the program in the installation 
  12289.        file to be started, the program title, the session type, and the initial 
  12290.        window size and position.  However, information may be specified on the 
  12291.        DosStartSession call to override the information in the installation 
  12292.        file for this invocation of the program. 
  12293.  
  12294.        See "Program Handle Considerations:" in the Remarks section for more 
  12295.        information. 
  12296.  
  12297.     pgmcontrol (USHORT) 
  12298.        Specifies the initial state for a windowed application.  This parameter 
  12299.        is ignored for full-screen sessions. The initial window state may be 
  12300.        defined as a combination of the following bit values: 
  12301.  
  12302.        Bit       Description 
  12303.        15        Use specified position and size. 
  12304.        14-4      Reserved and must be set to zero. 
  12305.        3         No auto close (for windowed session only). 
  12306.        2         Minimize. 
  12307.        1         Maximize. 
  12308.        0         Invisible. 
  12309.  
  12310.     initxpos (USHORT) 
  12311.        Initial X coordinate in pels for the initial session window. 
  12312.        Coordinates (0,0) indicate the bottom left corner of the display.  This 
  12313.        parameter is ignored for full-screen sessions. 
  12314.  
  12315.     initypos (USHORT) 
  12316.        Initial Y coordinate in pels for the initial session window. 
  12317.        Coordinates (0,0) indicate the bottom left corner of the display.  It is 
  12318.        ignored for full-screen sessions. 
  12319.  
  12320.     initxsize (USHORT) 
  12321.        Initial X extent in pels for the initial session window.  It is ignored 
  12322.        for full-screen sessions. 
  12323.  
  12324.     initysize (USHORT) 
  12325.        Initial Y extent in pels for the initial session window.  It is ignored 
  12326.        for full-screen sessions. 
  12327.  
  12328.  SessID (PUSHORT) - output 
  12329.     Address of the session ID associated with the child session created. SessID 
  12330.     is returned only when the value specified for related is 1. The SessID 
  12331.     returned can be specified on subsequent calls to DosSelectSession, 
  12332.     DosSetSession, and DosStopSession. 
  12333.  
  12334.  ProcID (PUSHORT) - output 
  12335.     Address of the process ID associated with the child process created. ProcID 
  12336.     is returned only when the value specified for related is 1. The ProcID 
  12337.     returned may not be used on any OS/2 calls, for example, DosSetPrty, that 
  12338.     require a parent process/child process relationship. See "Parent/Child 
  12339.     Relationships" in the Remarks section. 
  12340.  
  12341.  rc (USHORT) - return 
  12342.     Return code descriptions are: 
  12343.  
  12344.     0         NO_ERROR 
  12345.     370       ERROR_SMG_NO_SESSIONS 
  12346.     418       ERROR_SMG_INVALID_CALL 
  12347.     453       ERROR_SMG_INVALID_START_MODE 
  12348.     454       ERROR_SMG_INVALID_RELATED_OPT 
  12349.     457       ERROR_SMG_START_IN_BACKGROUND 
  12350.     460       ERROR_SMG_PROCESS_NOT_PARENT 
  12351.     461       ERROR_SMG_INVALID_DATA_LENGTH 
  12352.     478       ERROR_SMG_INVALID_TRACE_OPTION
  12353.     491       ERROR_SMG_INVALID_PROGRAM_TYPE 
  12354.     492       ERROR_SMG_INVALID_PGM_CONTROL 
  12355.     493       ERROR_SMG_INVALID_INHERIT_OPT 
  12356.     503       ERROR_SMG_INVALID_DEBUG_PARMS 
  12357.  
  12358.  Any error code returned from DosOpen, DosLoadModule, and DosExecPgm is also 
  12359.  possible from DosStartSession. 
  12360.  
  12361.  
  12362.  Remarks 
  12363.  
  12364.  When a length of 24 bytes is specified, DosStartSession assumes the iconfile, 
  12365.  pgmhandle, sessiontype, pgmcontrol, initxpos, initypos, initxsize, and 
  12366.  initysize parameters to be 0.  A value of 0 allows the Shell to establish the 
  12367.  program title, icon definition, session type, program control, window size, 
  12368.  and window position for the specified program. 
  12369.  Foreground/Background Considerations: 
  12370.  
  12371.  If fgbg = 0 is specified, and if neither the calling program nor any of its 
  12372.  descendant sessions is executing in the foreground, the new session is started 
  12373.  in the background. The ERROR_SMG_START_IN_BACKGROUND error code is also 
  12374.  returned in this case. The foreground session for windowed applications is the 
  12375.  session of the application that owns the window focus. 
  12376.  Parent/Child Relationships: 
  12377.  
  12378.  When related = 1 is specified, DosStartSession establishes a parent 
  12379.  session/child session relationship.  A parent process/child process 
  12380.  relationship is not established. The parent process is the Shell process, just 
  12381.  as if the operator had started the program from the Shell menu. The ProcID 
  12382.  returned by DosStartSession may not be used by any OS/2 calls (for example, 
  12383.  DosSetPrty) that require a parent process/child process relationship. Once a 
  12384.  process has issued a DosStartSession, specifying related = 1, no other process 
  12385.  within that session may issue related DosStartSession calls until all the 
  12386.  dependent sessions have terminated. 
  12387.  Debugger Considerations: 
  12388.  
  12389.  Debuggers may want to debug all processes associated with an application, no 
  12390.  matter how the process was started (DosExecPgm or DosStartSession).  A special 
  12391.  trace option, traceopt = 2, has been provided for this purpose.  When traceopt 
  12392.  = 2 is specified, the debugger must also supply the name of an existing queue 
  12393.  as the termination queue name and related = 1 on the DosStartSession call. 
  12394.  
  12395.  The Session Manager notifies the debugger whenever a new session is created 
  12396.  through DosStartSession from the initial session started with traceopt = 2 or 
  12397.  from any descending session.  The queue is posted regardless of how the new 
  12398.  session is started: related, independent, with or without inheritance, and is 
  12399.  executed for tracing.  It is the responsibility of the debugger to resume the 
  12400.  new process' execution through DosPtrace. 
  12401.  
  12402.  The debugger must issue DosReadQueue to receive notification when a child 
  12403.  session is created.  The word containing the request parameter returned by 
  12404.  DosReadQueue is one.  The data element structure returned has the following 
  12405.  format: 
  12406.  
  12407.  Size      Definition 
  12408.  WORD      Session ID 
  12409.  WORD      Process ID 
  12410.  WORD      Parent Session ID 
  12411.  WORD      Parent Process ID 
  12412.  
  12413.  DosReadQueue, with the NoWait parameter set to zero, should be issued by the 
  12414.  debugger.  This is the only process that has addressability to the 
  12415.  notification data element.  After reading and processing the data element, the 
  12416.  debugger must free the segment containing the data element using DosFreeSeg. 
  12417.  
  12418.  The debugger may use DosSelectSession to switch itself or any descendant 
  12419.  session into the foreground whenever the current foreground session is a 
  12420.  descendant of the debugger. 
  12421.  
  12422.  Some debuggers may enhance usability by using more than one display. 
  12423.  Therefore, when a debugger registers with the Session Manager by using a 
  12424.  traceopt of 2, the debugger is allowed to update the physical  video buffer in 
  12425.  the range of B000-B7FF, as long as the foreground session is a descendant of 
  12426.  the debugger. The debugger is not allowed to update the physical video buffer 
  12427.  when a session is switched into the foreground that is not a descendant of the 
  12428.  debugger or when a popup occurs. 
  12429.  Program Name/Program Input Considerations: 
  12430.  
  12431.  The program identified by pgmname is executed directly with no intermediate 
  12432.  secondary command 
  12433.  (CMD.EXE) process. Alternatively, the program can be executed indirectly 
  12434.  through a secondary command 
  12435.  (CMD.EXE) process by specifying CMD.EXE for pgmname and by specifying either 
  12436.  /C or /K followed by the drive, path, and file name of the application to be 
  12437.  loaded for pgminputs. If the /C parameter is inserted at the beginning of the 
  12438.  pgminputs string, the session terminates when the application program 
  12439.  terminates.  If the /K parameter is inserted at the beginning of the pgminputs 
  12440.  string, the operator sees the OS/2 command line prompt displayed when the 
  12441.  application terminates.  The operator can then either enter the name of 
  12442.  another program or command to execute or enter the OS/2 EXIT command to 
  12443.  terminate the session. 
  12444.  
  12445.  When the pgmname is accessed with a far address of 0 or the ASCIIZ string is 
  12446.  null, the program specified as a parameter to the Shell in the PROTSHELL 
  12447.  statement in the CONFIG.SYS file is executed and passed the specified 
  12448.  pgminputs.  This is the OS/2 mode command processor (CMD.EXE) by default. 
  12449.  
  12450.  When pgmname is equal to the command processor named on the PROTSHELL 
  12451.  statement in CONFIG.SYS, or when the pgmname = NULL and length = 24 or 30 
  12452.  bytes, either the command processor named in CONFIG.SYS or the default CMD.EXE 
  12453.  is started within the same session as the caller of DosStartSession. 
  12454.  Program Handle Considerations: 
  12455.  
  12456.  If a process issues a DosStartSession specifying only the program handle, it 
  12457.  must change to the working directory before it issues the DosStartSession, and 
  12458.  start the new process inherited.  If a process is started with inheritopt = 0, 
  12459.  that process must change to the correct directory. 
  12460.  Parent/Child Termination Considerations: 
  12461.  
  12462.  A parent session has only one termination queue.  The parent creates the 
  12463.  termination queue before it issues its first DosStartSession call specifying 
  12464.  the name of the queue.  An application can use the termination queue for 
  12465.  another purpose by passing a unique request parameter through the 
  12466.  DosWriteQueue/DosReadQueue interface.  Request parameter values 0 through 99 
  12467.  are reserved for OS/2.  Request parameter values greater than 99 are available 
  12468.  for application use. 
  12469.  
  12470.  If a parent session specifies the termq parameter on more than one 
  12471.  DosStartSession call, the parameter is ignored on subsequent calls. Once a 
  12472.  parent establishes a termination queue, the queue is posted when any child 
  12473.  session terminates.  The queue is posted regardless of who terminates the 
  12474.  child session (for example, child, parent, or operator) and whether the 
  12475.  termination is normal or abnormal. The termq data element structure has the 
  12476.  following format: 
  12477.  
  12478.  Size      Description 
  12479.  WORD      Session ID of child 
  12480.  WORD      Result code. 
  12481.  
  12482.  When a child session terminates, the result code returned in the termq data 
  12483.  element is the result code of the program specified by pgmname assuming 
  12484.  either: 
  12485.  
  12486.   1. The program is executed directly with no intermediate secondary command 
  12487.      (CMD.EXE) process, or 
  12488.   2. The program is executed indirectly through a secondary command (CMD.EXE) 
  12489.      process and the /C parameter is specified. 
  12490.  
  12491.  If the program is executed indirectly through a secondary command (CMD.EXE) 
  12492.  process and the /K parameter is specified, the result code of the processed 
  12493.  command is returned. 
  12494.  
  12495.  When a child session running in the foreground terminates, the parent session 
  12496.  becomes the foreground session. When a parent session terminates, any child 
  12497.  sessions it created with DosStartSession, specifying related = 1, are 
  12498.  terminated. When an independent session, created specifying related = 0, 
  12499.  running in the foreground terminates, the Shell chooses the next foreground 
  12500.  session. 
  12501.  Descendant Considerations: 
  12502.  
  12503.  A session started through DosStartSession may in turn issue DosStartSession. 
  12504.  These rules apply: 
  12505.  
  12506.  o The SessID specified on DosSelectSession, DosSetSession, and DosStopSession 
  12507.    may be only the SessID of an immediate child session, not a grandchild 
  12508.    session, and so forth. 
  12509.  
  12510.  o Suppose a bond is established between session A and its immediate child 
  12511.    session B, and another bond is established between session B and its 
  12512.    immediate child session C.  When the operator selects session A, session C 
  12513.    is brought to the foreground.  See DosSetSession for a description of what 
  12514.    establishing a bond means. 
  12515.  
  12516.  o When a session terminates, all of its descendants (children, grandchildren, 
  12517.    and so forth) are terminated. 
  12518.  
  12519.  Application Type Consideration: 
  12520.  
  12521.  You may use DosExecPgm to start a process that is of the same type as the 
  12522.  starting process. Process types include Presentation Manager, text-windowed, 
  12523.  and full-screen. You may not use DosExecPgm to start a process that is of a 
  12524.  different type than the starting process. 
  12525.  
  12526.  You must use DosStartSession to start a new process from a process that is of 
  12527.  a different type. For example, use DosStartSession to start a Presentation 
  12528.  Manager process from a non-Presentation Manager process. 
  12529.  
  12530.  
  12531. ΓòÉΓòÉΓòÉ 1.162. DosStopSession ΓòÉΓòÉΓòÉ
  12532.  
  12533.                                Bindings:  C, MASM
  12534.  
  12535. This call terminates a session previously started with DosStartSession. 
  12536.  
  12537.  DosStopSession      (TargetOption, SessID, Reserved) 
  12538.  
  12539.  TargetOption (USHORT) - input 
  12540.     Specifies whether the session specified by SessID or all sessions should be 
  12541.     terminated. 
  12542.  
  12543.     Value     Definition 
  12544.     0         Terminate session specified. 
  12545.     1         Terminate all child sessions and descendant sessions. 
  12546.  
  12547.  SessID (USHORT) - input 
  12548.     Session ID session to be terminated.  The value specified must equal the 
  12549.     SessID returned on a previous DosStartSession call. SessID is ignored if 
  12550.     TargetOption = 1. 
  12551.  
  12552.  Reserved (ULONG) - input 
  12553.     A doubleword of 0's. 
  12554.  
  12555.  rc (USHORT) - return 
  12556.     Return code descriptions are: 
  12557.  
  12558.     0         NO_ERROR 
  12559.     369       ERROR_SMG_INVALID_SESSION_ID 
  12560.     418       ERROR/SMG_INVALID_CALL 
  12561.     452       ERROR_SMG_SESSION_NOT_PARENT 
  12562.     458       ERROR_SMG_INVALID_STOP_OPTION 
  12563.     459       ERROR_SMG_BAD_RESERVE 
  12564.  
  12565.  Remarks 
  12566.  
  12567.  DosStopSession may be issued by a parent session only for a child session. 
  12568.  The parent session cannot issue this call with itself as the target or a 
  12569.  descendant of a child session as the target. However, if the child session 
  12570.  specified with DosStopSession does have descendants, these sessions are also 
  12571.  terminated. 
  12572.  
  12573.  DosStopSession may terminate only child sessions originally started by the 
  12574.  caller with DosStartSession specifying Related = 1.  Sessions started as 
  12575.  independent sessions cannot be stopped by this call. 
  12576.  
  12577.  A parent session may be running in either the foreground or background when 
  12578.  DosStopSession is issued. If a child session is running in the foreground at 
  12579.  the time it is stopped, the parent session becomes the foreground session. 
  12580.  DosStopSession breaks any bond that was established between the parent session 
  12581.  and child session by a DosSetSession request. 
  12582.  
  12583.  The process running in the session specified on the DosStopSession call may 
  12584.  refuse to terminate.  DosStopSession returns a normal return code in this 
  12585.  case.  The only way to ensure that a target session has terminated is to wait 
  12586.  for notification of its demise by a termination queue created with a 
  12587.  DosStartSession request. 
  12588.  
  12589.  
  12590. ΓòÉΓòÉΓòÉ 1.163. DosSubAlloc ΓòÉΓòÉΓòÉ
  12591.  
  12592.                                Bindings:  C, MASM
  12593.  
  12594. This call suballocates portions of a segment allocated by DosAllocSeg or 
  12595. DosAllocShrSeg, and initialized by  DosSubSet. 
  12596.  
  12597.  DosSubAlloc     (SegSelector, BlockOffset, Size) 
  12598.  
  12599.  SegSelector (SEL) - input 
  12600.     Data segment selector that allocates the memory. 
  12601.  
  12602.  BlockOffset (PUSHORT) - output 
  12603.     Address of the allocated block offset. 
  12604.  
  12605.  Size (USHORT) - input 
  12606.     Memory block size requested in bytes. 
  12607.  
  12608.  rc (USHORT) - return 
  12609.     Return code descriptions are: 
  12610.  
  12611.     0         NO_ERROR 
  12612.     311       ERROR_DOSSUB_NOMEM 
  12613.     313       ERROR_DOSSUB_BADSIZE 
  12614.  
  12615.  Remarks 
  12616.  
  12617.  Before a segment allocated by DosAllocSeg or DosAllocShrSeg can be 
  12618.  suballocated, it must first be initialized for suballocation by a call to 
  12619.  DosSubSet. 
  12620.  
  12621.  Allocation size must be a multiple of four bytes.  Otherwise, it is rounded up 
  12622.  to a multiple of four bytes. The maximum value for the size parameter is the 
  12623.  size that was set with DosSubSet minus 8. Note that no paragraph (16-byte) 
  12624.  alignment is required; all requests are serviced on a byte alignment basis. 
  12625.  
  12626.  A suballocated block of memory in a suballocated segment is freed by a call to 
  12627.  DosSubFree. 
  12628.  
  12629.  
  12630. ΓòÉΓòÉΓòÉ 1.164. DosSubFree ΓòÉΓòÉΓòÉ
  12631.  
  12632.                                Bindings:  C, MASM
  12633.  
  12634. This call frees memory previously allocated by DosSubAlloc. 
  12635.  
  12636.  DosSubFree     (SegSelector, BlockOffset, Size) 
  12637.  
  12638.  SegSelector (SEL) - input 
  12639.     Data segment selector. 
  12640.  
  12641.  BlockOffset (USHORT) - input 
  12642.     Memory block offset.  The value specified must equal the BlockOffset 
  12643.     returned on a previous DosSubAlloc call. 
  12644.  
  12645.  Size (USHORT) - input 
  12646.     Size, in bytes, of the block to be freed. 
  12647.  
  12648.  rc (USHORT) - return 
  12649.     Return code descriptions are: 
  12650.  
  12651.     0         NO_ERROR 
  12652.     312       ERROR_DOSSUB_OVERLAP 
  12653.     313       ERROR_DOSSUB_BADSIZE 
  12654.  
  12655.  Remarks 
  12656.  
  12657.  DosSubFree specifies the offset of a block of memory previously suballocated 
  12658.  by a DosSubAlloc request. If the block specified overlaps memory in the 
  12659.  segment that is not suballocated, an error is returned. Like DosSubAlloc, the 
  12660.  size parameter must be a multiple of four bytes; otherwise, it is rounded up 
  12661.  to a multiple of four bytes. 
  12662.  
  12663.  The allocated segment is freed by calling DosFreeSeg. 
  12664.  
  12665.  
  12666. ΓòÉΓòÉΓòÉ 1.165. DosSubSet ΓòÉΓòÉΓòÉ
  12667.  
  12668.                                Bindings:  C, MASM
  12669.  
  12670. This call is used to initialize a segment or to reset a reallocated segment for 
  12671. suballocation. 
  12672.  
  12673.  DosSubSet    (SegSelector, Flags, Size) 
  12674.  
  12675.  SegSelector (SEL) - input 
  12676.     Target data segment selector. 
  12677.  
  12678.  Flags (USHORT) - input 
  12679.     0 = Increasing the size of a segment already initialized. 
  12680.  
  12681.     1 = Initializing a segment. 
  12682.  
  12683.  Size (USHORT) - input 
  12684.     Segment size in bytes. 
  12685.  
  12686.  rc (USHORT) - return 
  12687.     Return code descriptions are: 
  12688.  
  12689.     0         NO_ERROR 
  12690.     310       ERROR_DOSSUB_SHRINK 
  12691.     313       ERROR_DOSSUB_BADSIZE 
  12692.     314       ERROR_DOSSUB_BADFLAG 
  12693.  
  12694.  Remarks 
  12695.  
  12696.  To initialize a segment for suballocation, issue DosSubSet before issuing 
  12697.  DosSubAlloc and set Flags = 1.  The segment must have been allocated with 
  12698.  DosAllocSeg or DosAllocShrSeg. 
  12699.  
  12700.  If a segment allocated by a DosAllocSeg call has already been set for 
  12701.  suballocation, and a call to DosSubAlloc returns Error_DOSSUB_NOMEM, the 
  12702.  segment's size can be increased by a call to DosReallocSeg. After 
  12703.  reallocation, the segment must be reset by a DosSubSet. Failure to reset the 
  12704.  segment after changing its size can yield unpredictable results. 
  12705.  
  12706.  The size parameter should be a multiple of four bytes, or it is rounded up to 
  12707.  a multiple of four.  Note in DosSubSet, a size parameter of 0 indicates the 
  12708.  segment is 64KB, while in DosSubAlloc and  DosSubFree, a size parameter of 0 
  12709.  is an error.  Other than this special case of 0 meaning 64KB, the minimum size 
  12710.  that can be set is 12 bytes. 
  12711.  
  12712.  
  12713. ΓòÉΓòÉΓòÉ 1.166. DosSuspendThread ΓòÉΓòÉΓòÉ
  12714.  
  12715.                                Bindings:  C, MASM
  12716.  
  12717. This call temporarily suspends execution of another thread within the current 
  12718. process until a DosResumeThread call is issued. 
  12719.  
  12720.  DosSuspendThread     (ThreadID) 
  12721.  
  12722.  ThreadID (TID) - input 
  12723.     Thread ID to be suspended. 
  12724.  
  12725.  rc (USHORT) - return 
  12726.     Return code descriptions are: 
  12727.  
  12728.     0         NO_ERROR 
  12729.     309       ERROR_INVALID_THREADID 
  12730.  
  12731.  Remarks 
  12732.  
  12733.  A thread's execution is suspended when another thread in its process issues 
  12734.  DosSuspendThread, specifying the ID of the target thread. The thread may not 
  12735.  be suspended immediately because it may have locked some system resources that 
  12736.  have to be freed first.  However, the thread is not allowed to execute further 
  12737.  application program instructions until a corresponding DosResumeThread is 
  12738.  issued. 
  12739.  
  12740.  DosSuspendThread permits the suspension of only one other thread within the 
  12741.  current process. If a thread needs to disable all thread switching within its 
  12742.  process so the calling thread can execute time-critical code, it uses 
  12743.  DosEnterCritSec and DosExitCritSec calls. 
  12744.  
  12745.  
  12746. ΓòÉΓòÉΓòÉ 1.167. DosTimerAsync ΓòÉΓòÉΓòÉ
  12747.  
  12748.                                Bindings:  C, MASM
  12749.  
  12750. This call starts a timer that runs asynchronously to the thread issuing the 
  12751. request and clears a system semaphore when the specified interval expires. 
  12752.  
  12753.  DosTimerAsync     (TimeInterval, SemHandle, Handle) 
  12754.  
  12755.  TimeInterval (ULONG) - input 
  12756.     Number of milliseconds (rounded up to the next clock tick) that passes 
  12757.     before the semaphore is cleared. 
  12758.  
  12759.  SemHandle (HSEM) - input 
  12760.     Handle of the system semaphore used to communicate the time out to the 
  12761.     calling thread.  This semaphore should be set by DosSemSet before 
  12762.     DosTimerAsync is called. 
  12763.  
  12764.  Handle (PHTIMER) - output 
  12765.     Address of the timer handle. This handle may be passed to DosTimerStop to 
  12766.     stop this timer before its time interval expires. 
  12767.  
  12768.  rc (USHORT) - return 
  12769.     Return code descriptions are: 
  12770.  
  12771.     0         NO_ERROR 
  12772.     323       ERROR_TS_SEMHANDLE 
  12773.     324       ERROR_TS_NOTIMER 
  12774.  
  12775.  Remarks 
  12776.  
  12777.  DosTimerAsync is used to wait for a single asynchronous time.  The thread 
  12778.  waits for the time out by issuing a DosSemWait. 
  12779.  
  12780.  This function is the asynchronous analog of DosSleep. This function allows a 
  12781.  thread to start a timer while it is performing another task. This timer can be 
  12782.  canceled by calling the DosTimerStop function with the timer handle returned 
  12783.  by DosTimerAsync. 
  12784.  
  12785.  If another time out is needed, the semaphore is set and DosTimerAsync is 
  12786.  reissued. To ensure reliable detection of the timer expiration, the system 
  12787.  semaphore should be set prior to calling DosTimerAsync. 
  12788.  
  12789.  To set a periodic interval timer, see DosTimerStart. 
  12790.  
  12791.  
  12792. ΓòÉΓòÉΓòÉ 1.168. DosTimerStart ΓòÉΓòÉΓòÉ
  12793.  
  12794.                                Bindings:  C, MASM
  12795.  
  12796. This call starts a periodic interval timer that runs asynchronously to the 
  12797. thread issuing the request. The semaphore is continually cleared at the 
  12798. specified time interval until the timer is turned off by DosTimerStop. 
  12799.  
  12800.  DosTimerStart     (TimeInterval, SemHandle, Handle) 
  12801.  
  12802.  TimeInterval (ULONG) - input 
  12803.     Number of milliseconds (rounded up to the next clock tick) that passes 
  12804.     before the semaphore is cleared. 
  12805.  
  12806.  SemHandle (HSEM) - input 
  12807.     Handle of the system semaphore used to communicate the time out to the 
  12808.     calling thread.  This semaphore should be set by DosSemSet before the next 
  12809.     clear by the timer. 
  12810.  
  12811.  Handle (PHTIMER) - output 
  12812.     Address of the timer handle. This handle may be passed to DosTimerStop to 
  12813.     stop the periodic timer. 
  12814.  
  12815.  rc (USHORT) - return 
  12816.     Return code descriptions are: 
  12817.  
  12818.     0         NO_ERROR 
  12819.     323       ERROR_TS_SEMHANDLE 
  12820.     324       ERROR_TS_NOTIMER 
  12821.  
  12822.  Remarks 
  12823.  
  12824.  DosTimerStart allows a timer to start and run asynchronously to a thread. A 
  12825.  timer interval is canceled by using the timer handle in the DosTimerStop call. 
  12826.  This prevents the semaphore indicated in the DosTimerStart call from being 
  12827.  sent notifications. 
  12828.  
  12829.  The application detects the expirations of the timer when the semaphore is set 
  12830.  prior to the next expiration of the timer. When an application waits for this 
  12831.  semaphore to clear, more than one clearing of the timer may occur before the 
  12832.  application resumes execution.  If it is necessary to determine the actual 
  12833.  elapsed time, the Global Information Segment milliseconds field can be saved 
  12834.  by a DosGetInfoSeg request before calling DosTimerStart.  This saved value is 
  12835.  compared to the current value when the process resumes. 
  12836.  
  12837.  
  12838. ΓòÉΓòÉΓòÉ 1.169. DosTimerStop ΓòÉΓòÉΓòÉ
  12839.  
  12840.                                Bindings:  C, MASM
  12841.  
  12842. This call stops a periodic interval timer started by DosTimerStart, or an 
  12843. asynchronous timer started by DosTimerAsync. 
  12844.  
  12845.  DosTimerStop     (Handle) 
  12846.  
  12847.  Handle (HTIMER) - input 
  12848.     Handle of the timer to be stopped. 
  12849.  
  12850.  rc (USHORT) - return 
  12851.     Return code descriptions are: 
  12852.  
  12853.     0         NO_ERROR 
  12854.     326       ERROR_TS_HANDLE 
  12855.  
  12856.  Remarks 
  12857.  
  12858.  DosTimerStop is used to stop an asynchronous one-shot timer started with 
  12859.  DosTimerAsync or an asynchronous periodic interval timer started with 
  12860.  DosTimerStart. 
  12861.  
  12862.  No assumptions can be made about the state of the semaphore specified with 
  12863.  DosTimerStart or DosTimerAsync. The application should put the semaphores into 
  12864.  a known state. 
  12865.  
  12866.  
  12867. ΓòÉΓòÉΓòÉ 1.170. DosTransactNmPipe ΓòÉΓòÉΓòÉ
  12868.  
  12869.                                Bindings:  C, MASM
  12870.  
  12871. This call performs a write followed by a read on a duplex message pipe. 
  12872.  
  12873.  DosTransactNmPipe     (Handle, InBuffer, InBufferLen, OutBuffer, OutBufferLen, 
  12874.                        BytesOut) 
  12875.  
  12876.  Handle (HPIPE) - input 
  12877.     Named pipe handle returned by DosMakeNmPipe or  DosOpen. 
  12878.  
  12879.  InBuffer (PBYTE) - input 
  12880.     Address of the buffer to write to the pipe. 
  12881.  
  12882.  InBufferLen (USHORT) - input 
  12883.     Number of bytes to be written. 
  12884.  
  12885.  OutBuffer (PBYTE) - output 
  12886.     Address of the buffer for returned data. 
  12887.  
  12888.  OutBufferLen (USHORT) - input 
  12889.     Maximum size, number of bytes, of returned data. 
  12890.  
  12891.  BytesOut (PUSHORT) - output 
  12892.     Address of the number of bytes read. 
  12893.  
  12894.  rc (USHORT) - return 
  12895.     Return code descriptions are: 
  12896.  
  12897.     0         NO_ERROR 
  12898.     11        ERROR_BAD_FORMAT 
  12899.     230       ERROR_BAD_PIPE 
  12900.     231       ERROR_PIPE_BUSY 
  12901.     233       ERROR_PIPE_NOT_CONNECTED 
  12902.     234       ERROR_MORE_DATA 
  12903.  
  12904.  Remarks 
  12905.  
  12906.  DosTransactNmPipe is intended for use only on duplex message pipes. If this 
  12907.  call is issued and the pipe is not a duplex message pipe, ERROR_BAD_FORMAT is 
  12908.  returned. 
  12909.  
  12910.  This call enables you to implement transaction-oriented dialogs. 
  12911.  DosTransactNmPipe writes the entire InBuffer to the pipe and then reads a 
  12912.  response from the pipe into the OutBuffer.  The current state of 
  12913.  blocking/non-blocking has no effect. DosTransactNmPipe does not return until a 
  12914.  message has been read into the OutBuffer.  If the OutBuffer is too small to 
  12915.  contain the response message, ERROR_MORE_DATA is returned, as described for 
  12916.  DosRead. 
  12917.  
  12918.  
  12919. ΓòÉΓòÉΓòÉ 1.171. DosUnlockSeg ΓòÉΓòÉΓòÉ
  12920.  
  12921.                                Bindings:  C, MASM
  12922.  
  12923. This call unlocks a discardable segment. 
  12924.  
  12925.  DosUnlockSeg    (Selector) 
  12926.  
  12927.  Selector (SEL) - input 
  12928.     Segment selector to be unlocked. 
  12929.  
  12930.  rc (USHORT) - return 
  12931.     Return code descriptions are: 
  12932.  
  12933.     0         NO_ERROR 
  12934.     5         ERROR_ACCESS_DENIED 
  12935.     158       ERROR_NOT_LOCKED 
  12936.  
  12937.  Remarks 
  12938.  
  12939.  DosUnlockSeg is called to free memory for possible discard by the system in a 
  12940.  low memory situation. The memory being freed is originally allocated by a call 
  12941.  to DosAllocSeg or DosAllocHuge with AllocFlags bit 2 set. This memory may have 
  12942.  been reallocated by a call to DosReallocSeg or DosReallocHuge after discard by 
  12943.  the system. 
  12944.  
  12945.  Allocation and reallocation calls for discardable memory automatically lock 
  12946.  the memory for access by the calling process. Thus, to access the segment, the 
  12947.  caller does not have to lock the segment with DosLockSeg.  Once a discardable 
  12948.  segment is unlocked by a  DosUnlockSeg request, access to the segment is 
  12949.  gained by a successful DosLockSeg request. 
  12950.  
  12951.  DosUnlockSeg may also be used on segments that are non-discardable, in which 
  12952.  case it has no effect. 
  12953.  
  12954.  
  12955. ΓòÉΓòÉΓòÉ 1.172. DosWaitNmPipe ΓòÉΓòÉΓòÉ
  12956.  
  12957.                                Bindings:  C, MASM
  12958.  
  12959. This call waits for the availability of a named pipe instance. 
  12960.  
  12961.  DosWaitNmPipe     (FileName, TimeOut) 
  12962.  
  12963.  FileName (PSZ) - input 
  12964.     Address of the ASCIIZ name of the pipe to be opened. Pipes are name 
  12965.     \PIPE\FileName. 
  12966.  
  12967.  TimeOut (ULONG) - input 
  12968.     Maximum time in milliseconds to wait for the named pipe to become 
  12969.     available.  When a zero value is used, the DosMakeNmPipe specified default 
  12970.     value is used. When a minus one value is used, an indefinite wait is 
  12971.     entered. 
  12972.  
  12973.  rc (USHORT) - return 
  12974.     Return code descriptions are: 
  12975.  
  12976.     0         NO_ERROR 
  12977.     2         ERROR_FILE_NOT_FOUND 
  12978.     95        ERROR_INTERRUPT 
  12979.     231       ERROR_PIPE_BUSY 
  12980.  
  12981.  Remarks 
  12982.  
  12983.  This call should be used only when ERROR_PIPE_BUSY is returned from a DosOpen 
  12984.  call. 
  12985.  
  12986.  DosWaitNmPipe allows an application to wait for a server on a named pipe for 
  12987.  which all instances are currently busy. The call waits up to TimeOut 
  12988.  milliseconds (or a default time if TimeOut is zero). 
  12989.  
  12990.  When a pipe instance becomes available, it is given to the process whose 
  12991.  thread has the highest priority. The priority of a thread may be changed with 
  12992.  DosSetPrty. 
  12993.  
  12994.  
  12995. ΓòÉΓòÉΓòÉ 1.173. DosWrite ΓòÉΓòÉΓòÉ
  12996.  
  12997.                                Bindings:  C, MASM
  12998.  
  12999. This call transfers the specified number of bytes from a buffer to the 
  13000. specified file, synchronously with respect to the requesting process's 
  13001. execution. 
  13002.  
  13003.  DosWrite    (FileHandle, BufferArea, BufferLength, BytesWritten) 
  13004.  
  13005.  FileHandle (HFILE) - input 
  13006.     File handle from DosOpen. 
  13007.  
  13008.  BufferArea (PVOID) - input 
  13009.     Address of the output buffer. 
  13010.  
  13011.  BufferLength (USHORT) - input 
  13012.     Number of bytes to write. 
  13013.  
  13014.  BytesWritten (PUSHORT) - output 
  13015.     Address of the number of bytes written. 
  13016.  
  13017.  rc (USHORT) - return 
  13018.     Return code descriptions are: 
  13019.  
  13020.     0         NO_ERROR 
  13021.     5         ERROR_ACCESS_DENIED 
  13022.     6         ERROR_INVALID_HANDLE 
  13023.     26        ERROR_NOT_DOS_DISK 
  13024.     33        ERROR_LOCK_VIOLATION 
  13025.     109       ERROR_BROKEN_PIPE 
  13026.  
  13027.  Remarks 
  13028.  
  13029.  On output, BytesWritten is the number of bytes actually written.  If 
  13030.  BytesWritten is different from BufferLength, this usually indicates 
  13031.  insufficient disk space. 
  13032.  
  13033.  A BufferLength value of 0 is not considered an error.  No data transfer 
  13034.  occurs.  There is no effect on the file or the file pointer. 
  13035.  
  13036.  Buffers that are multiples of the hardware's base physical unit for data 
  13037.  written to the file on these base boundaries, are written directly to the 
  13038.  device.  (The base physical unit is defined as the smallest block that can be 
  13039.  physically written to the device.)  Other buffer sizes force some I/O to go 
  13040.  through an internal system buffer and greatly reduce the efficiency of I/O 
  13041.  operation. 
  13042.  
  13043.  The file pointer is moved by read and write operations. It can be moved to a 
  13044.  desired position by calling DosChgFilePtr. 
  13045.  
  13046.  If the file is read-only, the write to the file is not performed. 
  13047.  
  13048.  
  13049.  Family API Considerations 
  13050.  
  13051.  Some options operate differently in the DOS mode than in OS/2 mode. 
  13052.  Therefore, the following restriction applies to DosWrite when coding for the 
  13053.  DOS mode. 
  13054.  
  13055.  o Only single-byte DosWrite requests can be made to the COM device, because 
  13056.    the COM device driver for the DOS environment does not support multiple-byte 
  13057.    I/O. 
  13058.  
  13059.  
  13060.  Named Pipe Considerations 
  13061.  
  13062.  DosWrite is also used to write bytes or messages to a named pipe. 
  13063.  
  13064.  Each write to a message pipe writes a message whose size is the length of the 
  13065.  write; DosWrite automatically encodes message lengths in the pipe, so 
  13066.  applications need not encode this information in the buffer being written. 
  13067.  
  13068.  Writes in blocking mode always write all requested bytes before returning. In 
  13069.  non-blocking mode, if the message size is bigger than the buffer size, the 
  13070.  write blocks. If the message size is smaller than the pipe but not enough 
  13071.  space is left in the pipe, the write returns immediately with a value of zero, 
  13072.  indicating no bytes were written. 
  13073.  
  13074.  In the case of a byte pipe, if the number of bytes to be written exceeds the 
  13075.  space available in the pipe, DosWrite writes as many bytes as it can and 
  13076.  returns with the number of bytes actually written. 
  13077.  
  13078.  An attempt to write to a pipe whose other end has been closed returns 
  13079.  ERROR_BROKEN_PIPE. 
  13080.  
  13081.  
  13082. ΓòÉΓòÉΓòÉ 1.174. DosWriteAsync ΓòÉΓòÉΓòÉ
  13083.  
  13084.                                Bindings:  C, MASM
  13085.  
  13086. This call asynchronously transfers the specified number of bytes from a buffer 
  13087. to a file. 
  13088.  
  13089.  DosWriteAsync     (FileHandle, RamSemaphore, ReturnCode, BufferArea, 
  13090.                    BufferLength, BytesWritten) 
  13091.  
  13092.  FileHandle (HFILE) - input 
  13093.     File handle obtained from DosOpen. 
  13094.  
  13095.  RamSemaphore (PULONG) - input 
  13096.     Address used by the system to signal the caller that the write operation is 
  13097.     complete. 
  13098.  
  13099.  ReturnCode (PUSHORT) - output 
  13100.     Address of the I/O error return code. 
  13101.  
  13102.  BufferArea (PVOID) - input 
  13103.     Address of the output buffer. 
  13104.  
  13105.  BufferLength (USHORT) - input 
  13106.     Number of bytes to be written. 
  13107.  
  13108.  BytesWritten (PUSHORT) - output 
  13109.     Address of the number of bytes written. 
  13110.  
  13111.  rc (USHORT) - return 
  13112.     Return code descriptions are: 
  13113.  
  13114.     0         NO_ERROR 
  13115.     5         ERROR_ACCESS_DENIED 
  13116.     6         ERROR_INVALID_HANDLE 
  13117.     26        ERROR_NOT_DOS_DISK 
  13118.     33        ERROR_LOCK_VIOLATION 
  13119.     89        ERROR_NO_PROC_SLOTS 
  13120.     109       ERROR_BROKEN_PIPE 
  13121.  
  13122.  Remarks 
  13123.  
  13124.  A BufferLength value of 0 is not considered an error.  No data transfer 
  13125.  occurs.  There is no effect on the file or the file pointer. 
  13126.  
  13127.  A call to DosWriteAsync may return before the write is complete. To wait for 
  13128.  the asynchronous write to complete, RamSemaphore must be set by the 
  13129.  application before the DosWriteAsync call is made.  The application issues 
  13130.  DosSemSet to set the semaphore, calls DosWriteAsync, and then issues 
  13131.  DosSemWait to wait for the clearing of the semaphore, which signals the write 
  13132.  is complete. 
  13133.  
  13134.  When RamSemaphore is cleared, BytesWritten identifies the number of bytes 
  13135.  written.  If BytesWritten is different from BufferLength, it usually indicates 
  13136.  insufficient disk space. 
  13137.  
  13138.  The program must not modify the contents of BufferArea or look at the values 
  13139.  returned in ReturnCode or BytesWritten until after RamSemaphore is cleared. 
  13140.  
  13141.  Buffers that are multiples in size of the hardware's base physical unit for 
  13142.  data, written to the file on these base boundaries, are written directly to 
  13143.  the device.  (The base physical unit is defined as the smallest block that can 
  13144.  be physically written to the device.)  Other buffer sizes force at least some 
  13145.  I/O to go through an internal system buffer (if the file handle state bit 
  13146.  indicates that internal buffers may be used) and reduce the efficiency of I/O 
  13147.  operation. 
  13148.  
  13149.  The read/write pointer is moved by I/O operations. It can also be moved to a 
  13150.  desired position by calling DosChgFilePtr. The value of the pointer is updated 
  13151.  by the File Level Request Router before the I/O request is queued to the 
  13152.  device driver. 
  13153.  
  13154.  If the file is read-only, the write to the file is not performed. 
  13155.  
  13156.  Note:  If it is necessary to make a DosWriteAsync request from within a 
  13157.         segment that has I/O privilege, DosCallback may be used to invoke a 
  13158.         privilege level 3 segment, which makes the actual DosWriteAsync 
  13159.         request. 
  13160.  
  13161.  
  13162.  Named Pipe Considerations 
  13163.  
  13164.  DosWriteAsync is also used to write bytes and messages to named pipes. 
  13165.  
  13166.  Each write to a message pipe writes a message whose size is the length of the 
  13167.  write; DosWriteAsync automatically encodes message lengths in the pipe, so 
  13168.  applications need not encode this information in the buffer being written. 
  13169.  
  13170.  Writes in blocking mode always write all requested bytes before returning. In 
  13171.  non-blocking mode, if the message size is bigger than the buffer size, the 
  13172.  write blocks . If the message size is smaller than the pipe, but not enough 
  13173.  space is left in the pipe, DosWriteAsync returns immediately with a value of 
  13174.  zero, indicating no bytes were written. 
  13175.  
  13176.  In the case of a byte pipe, if the number of bytes to be written exceeds the 
  13177.  space available in the pipe, DosWriteAsync writes as many bytes as it can and 
  13178.  returns with the number of bytes actually written. 
  13179.  
  13180.  An attempt to write to a pipe whose other end has been closed returns with 
  13181.  ERROR_BROKEN_PIPE. 
  13182.  
  13183.  
  13184. ΓòÉΓòÉΓòÉ 1.175. DosWriteQueue ΓòÉΓòÉΓòÉ
  13185.  
  13186.                                Bindings:  C, MASM
  13187.  
  13188. This call adds an element to a queue. 
  13189.  
  13190.  DosWriteQueue     (QueueHandle, Request, DataLength, DataBuffer, ElemPriority) 
  13191.  
  13192.  QueueHandle (HQUEUE) - input 
  13193.     Queue handle. 
  13194.  
  13195.  Request (USHORT) - input 
  13196.     A value to be passed with the queue element.  This word is used for event 
  13197.     encoding by the specific application. 
  13198.  
  13199.  DataLength (USHORT) - input 
  13200.     Length of the data being sent to the queue. 
  13201.  
  13202.  DataBuffer (PBYTE) - input 
  13203.     Address of the data buffer where data, that is to be placed in the queue, 
  13204.     is located. 
  13205.  
  13206.  ElemPriority (UCHAR) - input 
  13207.     Priority of the element being added to the queue.  If the priority is 
  13208.     specified as 15, the element is added to the top of the queue (that is, in 
  13209.     LIFO order). If the priority is specified as 0, the element is added as the 
  13210.     last element in the queue (that is, in FIFO order). Elements with the same 
  13211.     priority are in FIFO order.  This parameter is valid for priority-type 
  13212.     queues only. 
  13213.  
  13214.  rc (USHORT) - return 
  13215.     Return code descriptions are: 
  13216.  
  13217.     0         NO_ERROR 
  13218.     334       ERROR_QUE_NO_MEMORY 
  13219.     337       ERROR_QUE_INVALID_HANDLE 
  13220.  
  13221.  Remarks 
  13222.  
  13223.  DosWriteQueue adds entries to a specified queue. 
  13224.  
  13225.  The Request, DataLength and DataBuffer parameters contain data understood by 
  13226.  the thread adding the element to the queue and by the thread that receives the 
  13227.  queue element. There is no special meaning to this data; applications may use 
  13228.  these parameters for any purpose they wish. OS/2 does not alter this data; it 
  13229.  simply copies this data intact. OS/2 does not validate the address of 
  13230.  DataBuffer or the DataLength. 
  13231.  
  13232.  If the queue owner has defined a semaphore for use in its notification when 
  13233.  elements are added to the queue and if that semaphore is a RAM semaphore, then 
  13234.  that semaphore must be in a segment which is shared among both the queue 
  13235.  owner's process and this process.  If that semaphore handle is for a system 
  13236.  semaphore, then that semaphore must be opened by this process before making a 
  13237.  DosWriteQueue request to the queue. 
  13238.  
  13239.  If the owning process is terminated, or if the queue is closed before this 
  13240.  request is issued, ERROR_QUE_INVALID_HANDLE is returned. 
  13241.  
  13242.  If the owning process invokes a system semaphore when DosReadQueue or 
  13243.  DosPeekQueue is issued, other processes that issue DosWriteQueue must first 
  13244.  issue DosOpenSem to access the system semaphore. 
  13245.  
  13246.  
  13247. ΓòÉΓòÉΓòÉ <hidden> DosAllocHuge ΓòÉΓòÉΓòÉ
  13248.  
  13249. #define INCL_DOSMEMMGR
  13250.  
  13251. USHORT  rc = DosAllocHuge(NumSeg, Size, Selector, MaxNumSeg, AllocFlags);
  13252.  
  13253. USHORT           NumSeg;        /* Number of 65536-byte segments */
  13254. USHORT           Size;          /* Number of bytes in last segment */
  13255. PSEL             Selector;      /* The first Selector
  13256.                                     allocated (returned) */
  13257. USHORT           MaxNumSeg;     /* Max number of 65536-byte segments */
  13258. USHORT           AllocFlags;    /* Allocation flags */
  13259.  
  13260. USHORT           rc;            /* return code */
  13261.  
  13262. Example 
  13263.  
  13264. This example requests a block of memory with 4 segments, the last segment 
  13265. having 1,040 bytes.  The block of memory will never be larger than 8 segments. 
  13266. The memory can be shared with DosGiveSeg API calls.  The system can discard the 
  13267. memory if it needs too. 
  13268.  
  13269. #define INCL_DOSMEMMGR
  13270.  
  13271. #define NUMBER_OF_SEGMENTS 4
  13272. #define BYTES_IN_LAST_SEGMENT 1040
  13273. #define MAXIMUM_SEG_SIZE 8
  13274. #define ALLOC_FLAG SEG_GIVEABLE | SEG_DISCARDABLE
  13275.  
  13276. SEL    Selector;
  13277. USHORT rc;
  13278.  
  13279.    rc = DosAllocHuge(NUMBER_OF_SEGMENTS,     /* # of 65536-byte
  13280.                                                       segments */
  13281.                      BYTES_IN_LAST_SEGMENT,  /* # of bytes in last
  13282.                                                          segment */
  13283.                      &Selector,              /* The 1st selector
  13284.                                                      allocated */
  13285.                      MAXIMUM_SEG_SIZE,       /* Max number of
  13286.                                                        segments */
  13287.                      ALLOC_FLAG);            /* Allocation flags */
  13288.  
  13289.  
  13290. ΓòÉΓòÉΓòÉ <hidden> DosAllocSeg ΓòÉΓòÉΓòÉ
  13291.  
  13292. #define INCL_DOSMEMMGR
  13293.  
  13294. USHORT  rc = DosAllocSeg(Size, Selector, AllocFlags);
  13295.  
  13296. USHORT           Size;          /* Number of bytes requested */
  13297. PSEL             Selector;      /* Selector allocated (returned) */
  13298. USHORT           AllocFlags;    /* Allocation flags */
  13299.  
  13300. USHORT           rc;            /* return code */
  13301.  
  13302. Example 
  13303.  
  13304. This example requests a segment of memory with 30,128 bytes.  The segment can 
  13305. be shared with a DosGetSeg API call. 
  13306.  
  13307. #define INCL_DOSMEMMGR
  13308.  
  13309. #define NUMBER_OF_BYTES 30128
  13310. #define ALLOC_FLAG SEG_GETTABLE
  13311.  
  13312. SEL    Selector;
  13313. USHORT rc;
  13314.  
  13315.    rc = DosAllocSeg(NUMBER_OF_BYTES,     /* # of bytes requested */
  13316.                     &Selector,           /* Selector allocated */
  13317.                     ALLOC_FLAG);         /* Allocation flags */
  13318.  
  13319. The following example requests a segment of memory with 4,000 bytes. The 
  13320. following example also shows how to suspend and resume execution of a thread 
  13321. within a process.  The main thread creates Thread2 and allows it to begin 
  13322. executing.  Thread2 iterates through a loop that prints a line and then sleeps, 
  13323. relinquishing its time slice to the main thread. After one iteration by 
  13324. Thread2, the main thread suspends Thread2 and then resumes it.  Subsequently, 
  13325. Thread2 completes the remaining three iterations. 
  13326.  
  13327. #define INCL_DOSPROCESS
  13328.  
  13329. #include <os2.h>
  13330.  
  13331. #define   SEGSIZE       4000   /* Number of bytes requested in segment */
  13332. #define   ALLOCFLAGS    0      /* Segment allocation flags - no sharing */
  13333. #define   SLEEPSHORT    5L     /* Sleep interval - 5 milliseconds */
  13334. #define   SLEEPLONG     75L    /* Sleep interval - 75 milliseconds */
  13335. #define   RETURN_CODE   0      /* Return code for DosExit() */
  13336.  
  13337. VOID APIENTRY Thread2()
  13338. {
  13339.   USHORT     i;
  13340.  
  13341.   /* Loop with four iterations */
  13342.   for(i=1; i<5; i++)
  13343.   {
  13344.     printf("In Thread2, i is now %d\n", i);
  13345.     /* Sleep to relinquish time slice to main thread */
  13346.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  13347.   }
  13348.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  13349.           RETURN_CODE);            /* Return code */
  13350. }
  13351.  
  13352.  
  13353. main()
  13354. {
  13355.   TID        ThreadID;             /* Thread identification */
  13356.   SEL        ThreadStackSel;       /* Segment selector for thread stack */
  13357.   PBYTE      StackEnd;             /* Ptr. to end of thread stack */
  13358.   USHORT     rc;
  13359.  
  13360.   /** Allocate segment for thread stack; make pointer to end **/
  13361.   /**  of stack. **/
  13362.   /** We must allocate a segment in order to preserve **/
  13363.   /**  segment protection for the thread.  **/
  13364.  
  13365.   rc = DosAllocSeg(SEGSIZE,             /* Number of bytes requested */
  13366.                    &ThreadStackSel,     /* Segment selector (returned) */
  13367.                    ALLOCFLAGS);         /* Allocation flags - no sharing */
  13368.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  13369.  
  13370.   /** Start Thread2 **/
  13371.   if(!(rc=DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  13372.                        &ThreadID,                 /* Thread ID (returned) */
  13373.                        StackEnd)))   /* End of thread stack */
  13374.     printf("Thread2 created.\n");
  13375.  
  13376.   /* Sleep to relinquish time slice to Thread2 */
  13377.   if(!(DosSleep(SLEEPSHORT)))                  /* Sleep interval */
  13378.     printf("Slept a little to let Thread2 execute.\n");
  13379.  
  13380.   /***** Suspend Thread2, do some work, then resume Thread2 *****/
  13381.   if(!(rc=DosSuspendThread(ThreadID)))         /* Thread ID */
  13382.     printf("Thread2 SUSPENDED.\n");
  13383.   printf("Perform work that will not be interrupted by Thread2.\n");
  13384.   if(!(rc=DosResumeThread(ThreadID)))          /* Thread ID */
  13385.     printf("Thread2 RESUMED.\n");
  13386.   printf("Now we may be interrupted by Thread2.\n");
  13387.  
  13388.   /* Sleep to allow Thread2 to complete */
  13389.   DosSleep(SLEEPLONG);                         /* Sleep interval */
  13390. }
  13391.  
  13392.  
  13393. ΓòÉΓòÉΓòÉ <hidden> DosAllocShrSeg ΓòÉΓòÉΓòÉ
  13394.  
  13395. #define INCL_DOSMEMMGR
  13396.  
  13397. USHORT  rc = DosAllocShrSeg(Size, Name, Selector);
  13398.  
  13399. USHORT           Size;          /* Number of bytes requested */
  13400. PSZ              Name;          /* Name string */
  13401. PSEL             Selector;      /* Selector allocated (returned) */
  13402.  
  13403. USHORT           rc;            /* return code */
  13404.  
  13405. Example 
  13406.  
  13407. This example requests a segment of memory with 27 bytes named "stock.dat". 
  13408.  
  13409. #define INCL_DOSMEMMGR
  13410.  
  13411. #define NUMBER_OF_BYTES 27
  13412. #define NAME_SEG "\\SHAREMEM\\stock.dat"
  13413.  
  13414. SEL    Selector;
  13415. USHORT rc;
  13416.  
  13417.    rc = DosAllocShrSeg(NUMBER_OF_BYTES,   /* # of bytes requested */
  13418.                        NAME_SEG,          /* Name string */
  13419.                        &Selector);        /* Selector allocated */
  13420.  
  13421.  
  13422. ΓòÉΓòÉΓòÉ <hidden> DosBeep ΓòÉΓòÉΓòÉ
  13423.  
  13424. #define INCL_DOSPROCESS
  13425.  
  13426. USHORT  rc = DosBeep(Frequency, Duration);
  13427.  
  13428. USHORT           Frequency;     /* Hertz (Hz) */
  13429. USHORT           Duration;      /* Length of sound */
  13430.  
  13431. USHORT           rc;            /* return code */
  13432.  
  13433. Example 
  13434.  
  13435. This example generates a beep for 1 second (1,000 milliseconds) at a frequency 
  13436. of 1,380. 
  13437.  
  13438. #define INCL_DOSPROCESS
  13439.  
  13440. #define BEEP_FREQUENCY 1380
  13441. #define BEEP_DURATION 1000
  13442.  
  13443. USHORT  rc;
  13444.  
  13445.    rc = DosBeep(BEEP_FREQUENCY,
  13446.                 BEEP_DURATION);
  13447.  
  13448.  
  13449. ΓòÉΓòÉΓòÉ <hidden> DosBufReset ΓòÉΓòÉΓòÉ
  13450.  
  13451. #define INCL_DOSFILEMGR
  13452.  
  13453. USHORT  rc = DosBufReset(FileHandle);
  13454.  
  13455. HFILE            FileHandle;    /* File handle */
  13456.  
  13457. USHORT           rc;            /* return code */
  13458.  
  13459. Example 
  13460.  
  13461. This example opens a file, writes some data to the file's buffer, then flushes 
  13462. the file's system buffer. 
  13463.  
  13464. #define INCL_DOSFILEMGR
  13465.  
  13466. #define OPEN_FILE 0x01
  13467. #define CREATE_FILE 0x10
  13468. #define FILE_ARCHIVE 0x20
  13469. #define FILE_EXISTS OPEN_FILE
  13470. #define FILE_NOEXISTS CREATE_FILE
  13471. #define DASD_FLAG 0
  13472. #define INHERIT 0x80
  13473. #define WRITE_THRU 0
  13474. #define FAIL_FLAG 0
  13475. #define SHARE_FLAG 0x10
  13476. #define ACCESS_FLAG 0x02
  13477.  
  13478. #define FILE_NAME "test.dat"
  13479. #define FILE_SIZE 800L
  13480. #define FILE_ATTRIBUTE FILE_ARCHIVE
  13481. #define RESERVED 0L
  13482.  
  13483. HFILE   FileHandle;
  13484. USHORT  Wrote;
  13485. USHORT  Action;
  13486. PSZ     FileData[100];
  13487. USHORT  rc;
  13488.  
  13489.  
  13490.    Action = 2;
  13491.    strcpy(FileData, "Data...");
  13492.    if(!DosOpen(FILE_NAME,                /* File path name */
  13493.                 &FileHandle,             /* File handle */
  13494.                 &Action,                 /* Action taken */
  13495.                 FILE_SIZE,               /* File primary allocation */
  13496.                 FILE_ATTRIBUTE,          /* File attribute */
  13497.                 FILE_EXISTS | FILE_NOEXISTS,      /* Open function type */
  13498.                 DASD_FLAG | INHERIT |            /* Open mode of the file */
  13499.                 WRITE_THRU | FAIL_FLAG |
  13500.                 SHARE_FLAG | ACCESS_FLAG,
  13501.                 RESERVED))               /* Reserved (must be zero) */
  13502.       if(!DosWrite(FileHandle,           /* File handle */
  13503.                    (PVOID) FileData,     /* User buffer */
  13504.                    sizeof(FileData),     /* Buffer length */
  13505.                    &Wrote))              /* Bytes written */
  13506.         rc = DosBufReset(FileHandle);    /* File handle */
  13507.  
  13508.  
  13509. ΓòÉΓòÉΓòÉ <hidden> DosCallback ΓòÉΓòÉΓòÉ
  13510.  
  13511. #define INCL_DOSDEVICES
  13512.  
  13513. VOID    DosCallback(Ring3Routine);
  13514.  
  13515. PFN              Ring3Routine;  /* Address of privilege level 3 routine */
  13516.  
  13517.  
  13518. ΓòÉΓòÉΓòÉ <hidden> DosCallNmPipe ΓòÉΓòÉΓòÉ
  13519.  
  13520. #define INCL_DOSNMPIPES
  13521.  
  13522. USHORT  rc = DosCallNmPipe(FileName, InBuffer, InBufferLen, OutBuffer,
  13523.                              OutBufferLen, BytesOut, TimeOut);
  13524.  
  13525. PSZ              FileName;      /* Pipe name */
  13526. PBYTE            InBuffer;      /* Write buffer address */
  13527. USHORT           InBufferLen;   /* Write buffer length */
  13528. PBYTE            OutBuffer;     /* Read buffer address */
  13529. USHORT           OutBufferLen;  /* Read buffer length *
  13530. PUSHORT          BytesOut;      /* Bytes read (returned) */
  13531. ULONG            TimeOut;       /* Maximum wait time */
  13532.  
  13533. USHORT           rc;            /* return code */
  13534.  
  13535.  
  13536. ΓòÉΓòÉΓòÉ <hidden> DosCaseMap ΓòÉΓòÉΓòÉ
  13537.  
  13538. typedef struct _COUNTRYCODE {   /* ctryc */
  13539.  
  13540.   USHORT country;               /* country code */
  13541.   USHORT codepage;              /* code page */
  13542.  
  13543. } COUNTRYCODE;
  13544.  
  13545. #define INCL_DOSNLS
  13546.  
  13547. USHORT  rc = DosCaseMap(Length, Structure, BinaryString);
  13548.  
  13549. USHORT           Length;        /* Length of string to case map */
  13550. PCOUNTRYCODE     Structure;     /* Input data structure */
  13551. PCHAR            BinaryString;  /* Address of binary string */
  13552.  
  13553. USHORT           rc;            /* return code */
  13554.  
  13555. Example 
  13556.  
  13557. This example case maps a string for the default country and code page 850. 
  13558.  
  13559. #define INCL_DOSNLS
  13560.  
  13561. #define CURRENT_COUNTRY 0
  13562. #define NLS_CODEPAGE 850
  13563.  
  13564. COUNTRYCODE Country;
  13565. CHAR        BinString[30];
  13566. USHORT      rc;
  13567.  
  13568.  
  13569.    Country.country = CURRENT_COUNTRY;         /* Country code */
  13570.    Country.codepage = NLS_CODEPAGE;           /* Code page */
  13571.    strcpy(BinString,"Howdy");                 /* String to map */
  13572.    rc = DosCaseMap(sizeof(BinString),         /* Length of string */
  13573.                    &Country,                  /* Input data structure */
  13574.                    BinString);                /* String */
  13575.  
  13576.  
  13577. ΓòÉΓòÉΓòÉ <hidden> DosChDir ΓòÉΓòÉΓòÉ
  13578.  
  13579. #define INCL_DOSFILEMGR
  13580.  
  13581. USHORT  rc = DosChDir(DirName, Reserved);
  13582.  
  13583. PSZ              DirName;       /* Directory path name *
  13584. ULONG            0;             /* Reserved (must be zero) */
  13585.  
  13586. USHORT           rc;            /* return code */
  13587.  
  13588. Example 
  13589.  
  13590. This example changes directories to \os2\system. 
  13591.  
  13592. #define INCL_DOSFILEMGR
  13593.  
  13594. #define PATH "\\os2\\system"
  13595. #define RESERVED 0L
  13596.  
  13597. USHORT rc;
  13598.  
  13599.    rc = DosChDir(PATH, RESERVED);
  13600.  
  13601.  
  13602. ΓòÉΓòÉΓòÉ <hidden> DosChgFilePtr ΓòÉΓòÉΓòÉ
  13603.  
  13604. #define INCL_DOSFILEMGR
  13605.  
  13606. USHORT  rc = DosChgFilePtr(FileHandle, Distance, MoveType, NewPointer);
  13607.  
  13608. HFILE            FileHandle;    /* File handle */
  13609. LONG             Distance;      /* Distance to move in bytes */
  13610. USHORT           MoveType;      /* Method of moving (0, 1, 2) */
  13611. PULONG           NewPointer;    /* New Pointer Location */
  13612.  
  13613. USHORT           rc;            /* return code */
  13614.  
  13615. Example 
  13616.  
  13617. This example opens file test.dat, writes some data, and resets the file pointer 
  13618. to the beginning of the file. 
  13619.  
  13620. #define INCL_DOSFILEMGR
  13621.  
  13622. #define OPEN_FILE 0x01
  13623. #define CREATE_FILE 0x10
  13624. #define FILE_ARCHIVE 0x20
  13625. #define FILE_EXISTS OPEN_FILE
  13626. #define FILE_NOEXISTS CREATE_FILE
  13627. #define DASD_FLAG 0
  13628. #define INHERIT 0x80
  13629. #define WRITE_THRU 0
  13630. #define FAIL_FLAG 0
  13631. #define SHARE_FLAG 0x10
  13632. #define ACCESS_FLAG 0x02
  13633.  
  13634. #define FILE_NAME "test.dat"
  13635. #define FILE_SIZE 800L
  13636. #define FILE_ATTRIBUTE FILE_ARCHIVE
  13637. #define RESERVED 0L
  13638.  
  13639. HFILE   FileHandle;
  13640. USHORT  Wrote;
  13641. USHORT  Action;
  13642. PUSHORT Local
  13643. PSZ     FileData[100];
  13644. USHORT  rc;
  13645.  
  13646.  
  13647.    Action = 2;
  13648.    strcpy(FileData, "Data...");
  13649.    if(!DosOpen(FILE_NAME,                /* File path name */
  13650.                 &FileHandle,             /* File handle */
  13651.                 &Action,                 /* Action taken */
  13652.                 FILE_SIZE,               /* File primary allocation */
  13653.                 FILE_ATTRIBUTE,          /* File attribute */
  13654.                 FILE_EXISTS | FILE_NOEXISTS,      /* Open function type */
  13655.                 DASD_FLAG | INHERIT |            /* Open mode of the file */
  13656.                 WRITE_THRU | FAIL_FLAG |
  13657.                 SHARE_FLAG | ACCESS_FLAG,
  13658.                 RESERVED))               /* Reserved (must be zero) */
  13659.       if(!DosWrite(FileHandle,           /* File handle */
  13660.                    (PVOID) FileData,     /* User buffer */
  13661.                    sizeof(FileData),     /* Buffer length */
  13662.                    &Wrote))              /* Bytes written */
  13663.          rc = DosChgFilePtr(FileHandle,  /* File handle */
  13664.                             MOVE_DIST,   /* Distance to move in bytes */
  13665.                             FILE_BEG,    /* Method of moving */
  13666.                             &Local);     /* New pointer location */
  13667.  
  13668.  
  13669. ΓòÉΓòÉΓòÉ <hidden> DosCLIAccess ΓòÉΓòÉΓòÉ
  13670.  
  13671. #define INCL_DOSDEVICES
  13672.  
  13673. USHORT  rc = DosCLIAccess(VOID);
  13674.  
  13675.  
  13676. USHORT           rc;            /* return code */
  13677.  
  13678. Example 
  13679.  
  13680. This example requests I/O privilege for disabling and enabling interrupts. 
  13681.  
  13682. #define INCL_DOSDEVICES
  13683.  
  13684. USHORT rc;
  13685.  
  13686.    rc = DosCLIAccess();      /* Request I/O privilege */
  13687.  
  13688.  
  13689. ΓòÉΓòÉΓòÉ <hidden> DosClose ΓòÉΓòÉΓòÉ
  13690.  
  13691. #define INCL_DOSFILEMGR
  13692.  
  13693. USHORT  rc = DosClose(FileHandle);
  13694.  
  13695. HFILE            FileHandle;    /* File handle */
  13696.  
  13697. USHORT           rc;            /* return code */
  13698.  
  13699. Example 
  13700.  
  13701. This example opens a file, then closes it. 
  13702.  
  13703. #define INCL_DOSFILEMGR
  13704.  
  13705. #define OPEN_FILE 0x01
  13706. #define CREATE_FILE 0x10
  13707. #define FILE_ARCHIVE 0x20
  13708. #define FILE_EXISTS OPEN_FILE
  13709. #define FILE_NOEXISTS CREATE_FILE
  13710. #define DASD_FLAG 0
  13711. #define INHERIT 0x80
  13712. #define WRITE_THRU 0
  13713. #define FAIL_FLAG 0
  13714. #define SHARE_FLAG 0x10
  13715. #define ACCESS_FLAG 0x02
  13716.  
  13717. #define FILE_NAME "test.dat"
  13718. #define FILE_SIZE 800L
  13719. #define FILE_ATTRIBUTE FILE_ARCHIVE
  13720. #define RESERVED 0L
  13721.  
  13722. HFILE   FileHandle;
  13723. USHORT  Wrote;
  13724. USHORT  Action;
  13725. PSZ     FileData[100];
  13726. USHORT  rc;
  13727.  
  13728.    Action = 2;
  13729.    strcpy(FileData, "Data...");
  13730.    if(!DosOpen(FILE_NAME,                /* File path name */
  13731.                 &FileHandle,             /* File handle */
  13732.                 &Action,                 /* Action taken */
  13733.                 FILE_SIZE,               /* File primary allocation */
  13734.                 FILE_ATTRIBUTE,          /* File attribute */
  13735.                 FILE_EXISTS | FILE_NOEXISTS,      /* Open function type */
  13736.                 DASD_FLAG | INHERIT |            /* Open mode of the file */
  13737.                 WRITE_THRU | FAIL_FLAG |
  13738.                 SHARE_FLAG | ACCESS_FLAG,
  13739.                 RESERVED))               /* Reserved (must be zero) */
  13740.       rc = DosClose(FileHandle);         /* File Handle */
  13741.  
  13742.  
  13743. ΓòÉΓòÉΓòÉ <hidden> DosCloseQueue ΓòÉΓòÉΓòÉ
  13744.  
  13745. #define INCL_DOSQUEUES
  13746.  
  13747. USHORT  rc = DosCloseQueue(QueueHandle);
  13748.  
  13749. HQUEUE           QueueHandle;   /* Handle of queue */
  13750.  
  13751. USHORT           rc;            /* return code */
  13752.  
  13753. Example 
  13754.  
  13755. This example opens a queue named special.que, then closes it. 
  13756.  
  13757. #define INCL_DOSQUEUES
  13758.  
  13759. #define QUE_FIFO 0
  13760. #define QUE_NAME "\\QUEUES\\special.que"
  13761.  
  13762. HQUEUE QueueHandle;
  13763. USHORT rc;
  13764.  
  13765.    if(!DosCreateQueue(&QueueHandle,        /* Queue handle */
  13766.                       QUE_FIFO,            /* Ordering to use for
  13767.                                                   elements */
  13768.                       QUE_NAME))           /* Queue name string */
  13769.       rc = DosCloseQueue(QueueHandle);     /* Queue handle */
  13770.  
  13771.  
  13772. ΓòÉΓòÉΓòÉ <hidden> DosCloseSem ΓòÉΓòÉΓòÉ
  13773.  
  13774. #define INCL_DOSSEMAPHORES
  13775.  
  13776. USHORT  rc = DosCloseSem(SemHandle);
  13777.  
  13778. HSEM             SemHandle;     /* Semaphore handle  */
  13779.  
  13780. USHORT           rc;            /* return code */
  13781.  
  13782. Example 
  13783.  
  13784. This example creates a semaphore named timeout.sem, then closes it. 
  13785.  
  13786. #define INCL_DOSSEMAPHORES
  13787.  
  13788. #define SEM_OWNERSHIP 0
  13789. #define SEM_NAME "\\SEM\\timeout.sem"
  13790.  
  13791. HSEM   SemHandle;
  13792. USHORT rc;
  13793.  
  13794.    if(!DosCreateSem(SEM_OWNERSHIP,    /* Indicate ownership */
  13795.                     &SemHandle,       /* Semaphore handle */
  13796.                     SEM_NAME))        /* Semaphore name string */
  13797.       rc = DosCloseSem(SemHandle);    /* Semaphore handle */
  13798.  
  13799. The following example illustrates the serialization of access to a shared 
  13800. resource between threads of the same process.  The program creates a 
  13801. nonexclusive system semaphore named resource.sem, requests access to the 
  13802. semaphore, clears it, and finally closes the semaphore.  For an illustration of 
  13803. notification of events, see the example given in DosOpenSem, DosSemSet, or 
  13804. DosSemWait. 
  13805.  
  13806. #define INCL_DOSSEMAPHORES
  13807.  
  13808. #include <os2.h>
  13809.  
  13810. #define SEM_NAME "\\SEM\\resource.sem"  /* Semaphore name */
  13811. #define TIMEOUT 1500L                   /* Timeout (in milliseconds) */
  13812.  
  13813.  
  13814. main()
  13815. {
  13816.   HSEM SemHandle;
  13817.   USHORT rc;
  13818.  
  13819.   /* Note: the semaphore could have been created by another    */
  13820.   /*       thread.                                             */
  13821.   DosCreateSem(CSEM_PUBLIC,         /* Ownership - nonexclusive */
  13822.                &SemHandle,          /* Semaphore handle (returned) */
  13823.                SEM_NAME);           /* Semaphore name */
  13824.   if(!(rc = DosSemRequest(SemHandle,       /* Semaphore Handle */
  13825.                          TIMEOUT)))        /* Timeout Period   */
  13826.   {
  13827.     /* Semaphore obtained; resource may now be used. */
  13828.     /* Clear the semaphore after using resource.     */
  13829.     if(DosSemClear(SemHandle))
  13830.     {
  13831.       /* Semaphore exclusively owned by another process --  */
  13832.       /* cannot clear now.                                  */
  13833.     }
  13834.   }
  13835.   else
  13836.   {
  13837.     /* Semaphore not obtained: error processing (i.e. switch on rc) */
  13838.   }
  13839.   /* Semaphore no longer needed; close it */
  13840.   if(DosCloseSem(SemHandle))
  13841.   {
  13842.     /* Semaphore is still set -- cannot close now */
  13843.   }
  13844. }
  13845.  
  13846.  
  13847. ΓòÉΓòÉΓòÉ <hidden> DosConnectNmPipe ΓòÉΓòÉΓòÉ
  13848.  
  13849. #define INCL_DOSNMPIPES
  13850.  
  13851. USHORT  rc = DosConnectNmPipe(Handle);
  13852.  
  13853. HPIPE            Handle;        /* Pipe handle */
  13854.  
  13855. USHORT           rc;            /* return code */
  13856.  
  13857.  
  13858. ΓòÉΓòÉΓòÉ <hidden> DosCopy ΓòÉΓòÉΓòÉ
  13859.  
  13860. #define INCL_DOSFILEMGR
  13861.  
  13862. USHORT  rc = DosCopy(SourceName, TargetName, OpMode, 0);
  13863.  
  13864. PSZ              SourceName;    /* Source path name */
  13865. PSZ              TargetName;    /* Target path name */
  13866. USHORT           OpMode;        /* Operation mode */
  13867. ULONG            0;             /* Reserved (must be zero) */
  13868.  
  13869. USHORT           rc;            /* return code */
  13870.  
  13871.  
  13872. ΓòÉΓòÉΓòÉ <hidden> DosCreateCSAlias ΓòÉΓòÉΓòÉ
  13873.  
  13874. #define INCL_DOSMEMMGR
  13875.  
  13876. USHORT  rc = DosCreateCSAlias(DataSelector, CodeSelector);
  13877.  
  13878. SEL              DataSelector;  /* Data segment selector */
  13879. PSEL             CodeSelector;  /* Code segment selector (returned) */
  13880.  
  13881. USHORT           rc;            /* return code */
  13882.  
  13883. Example 
  13884.  
  13885. This example requests a block of memory (data segment) then requests a 
  13886. descriptor of the segment marking it as a code segment. 
  13887.  
  13888. #define INCL_DOSMEMMGR
  13889.  
  13890. #define NUMBER_OF_BYTES 120
  13891. #define ALLOC_FLAG SEG_GETTABLE
  13892.  
  13893. SEL    CodeSel;
  13894. SEL    Selector;
  13895. USHORT rc;
  13896.  
  13897.    if(!DosAllocSeg(NUMBER_OF_BYTES,         /* # of bytes requested */
  13898.                    &Selector,               /* Selector allocated */
  13899.                    ALLOC_FLAG))             /* Allocation flags */
  13900.       rc = DosCreateCSAlias(Selector,       /* Data segment selector */
  13901.                             &CodeSel);      /* Code segment selector */
  13902.  
  13903.  
  13904. ΓòÉΓòÉΓòÉ <hidden> DosCreateQueue ΓòÉΓòÉΓòÉ
  13905.  
  13906. #define INCL_DOSQUEUES
  13907.  
  13908. USHORT  rc = DosCreateQueue(RWHandle, QueuePrty, QueueName);
  13909.  
  13910. PHQUEUE          RWHandle;      /* Address to put queue handle (returned) */
  13911. USHORT           QueuePrty;     /* Ordering to use for elements */
  13912. PSZ              QueueName;     /* Pointer to queue name string */
  13913.  
  13914. USHORT           rc;            /* return code */
  13915.  
  13916. Example 
  13917.  
  13918. This example creates a queue named special.que. 
  13919.  
  13920. #define INCL_DOSQUEUES
  13921.  
  13922. #define QUE_FIFO 0
  13923. #define QUE_NAME "\\QUEUES\\special.que"
  13924.  
  13925. HQUEUE QueueHandle;
  13926. USHORT rc;
  13927.  
  13928.    rc = DosCreateQueue(&QueueHandle,        /* Queue handle */
  13929.                        QUE_FIFO,            /* Ordering to use for
  13930.                                                    elements */
  13931.                        QUE_NAME);           /* Queue name string */
  13932.  
  13933.  
  13934. ΓòÉΓòÉΓòÉ <hidden> DosCreateSem ΓòÉΓòÉΓòÉ
  13935.  
  13936. #define INCL_DOSSEMAPHORES
  13937.  
  13938. USHORT  rc = DosCreateSem(NoExclusive, SemHandle, SemName);
  13939.  
  13940. USHORT           NoExclusive;   /* Indicate no exclusive ownership */
  13941. PHSYSSEM         SemHandle;     /* Semaphore handle (returned) */
  13942. PSZ              SemName;       /* Semaphore name string */
  13943.  
  13944. USHORT           rc;            /* return code */
  13945.  
  13946. Example 
  13947.  
  13948. This example creates a semaphore named timeout.sem. 
  13949.  
  13950. #define INCL_DOSSEMAPHORES
  13951.  
  13952. #define SEM_OWNERSHIP 0
  13953. #define SEM_NAME "\\SEM\\timeout.sem"
  13954.  
  13955. HSEM   SemHandle;
  13956. USHORT rc;
  13957.  
  13958.  
  13959.    rc = DosCreateSem(SEM_OWNERSHIP,    /* Indicate ownership */
  13960.                      &SemHandle,       /* Semaphore handle */
  13961.                      SEM_NAME);        /* Semaphore name string */
  13962.  
  13963. The following example illustrates the serialization of access to a shared 
  13964. resource between threads of the same process.  The program creates a 
  13965. nonexclusive system semaphore named resource.sem, requests access to the 
  13966. semaphore, clears it, and finally closes the semaphore.  For an illustration of 
  13967. notification of events, see the example given in DosOpenSem, DosSemSet, or 
  13968. DosSemWait. 
  13969.  
  13970. #define INCL_DOSSEMAPHORES
  13971.  
  13972. #include <os2.h>
  13973.  
  13974. #define SEM_NAME "\\SEM\\resource.sem"  /* Semaphore name */
  13975. #define TIMEOUT 1500L                   /* Timeout (in milliseconds) */
  13976.  
  13977.  
  13978. main()
  13979. {
  13980.   HSEM SemHandle;
  13981.   USHORT rc;
  13982.  
  13983.   /* Note: the semaphore could have been created by another    */
  13984.   /*       thread.                                             */
  13985.   DosCreateSem(CSEM_PUBLIC,         /* Ownership - nonexclusive */
  13986.                &SemHandle,          /* Semaphore handle (returned) */
  13987.                SEM_NAME);           /* Semaphore name */
  13988.   if(!(rc = DosSemRequest(SemHandle,       /* Semaphore Handle */
  13989.                          TIMEOUT)))        /* Timeout Period   */
  13990.   {
  13991.     /* Semaphore obtained; resource may now be used. */
  13992.     /* Clear the semaphore after using resource.     */
  13993.     if(DosSemClear(SemHandle))
  13994.     {
  13995.       /* Semaphore exclusively owned by another process --  */
  13996.       /* cannot clear now.                                  */
  13997.     }
  13998.   }
  13999.   else
  14000.   {
  14001.     /* Semaphore not obtained: error processing (i.e. switch on rc) */
  14002.   }
  14003.   /* Semaphore no longer needed; close it */
  14004.   if(DosCloseSem(SemHandle))
  14005.   {
  14006.     /* Semaphore is still set -- cannot close now */
  14007.   }
  14008. }
  14009.  
  14010.  
  14011. ΓòÉΓòÉΓòÉ <hidden> DosCreateThread ΓòÉΓòÉΓòÉ
  14012.  
  14013. #define INCL_DOSPROCESS
  14014.  
  14015. USHORT  rc = DosCreateThread(PgmAddress, ThreadIDWord, NewThreadStack);
  14016.  
  14017. PFNTHREAD        PgmAddress;     /* Program address */
  14018. PTID             ThreadIDWord;   /* New thread ID (returned) */
  14019. PBYTE            NewThreadStack; /* End of stack for new thread */
  14020.  
  14021. USHORT           rc;             /* return code */
  14022.  
  14023. Example 
  14024.  
  14025. In this example, a second thread is started at TestRoutine with a stack size of 
  14026. 4096 bytes. Remember to compile with Stack checking disabled (-Gs).  Also, 
  14027. threads started with DosCreateThread should not use some C library functions. 
  14028. See chapter 6 of the 
  14029. IBM C/2 Language Reference (version 1.1) for a discussion of threads and the 
  14030. C functions _beginthread and _endthread.  This example can be compiled as 
  14031. follows: 
  14032.  
  14033.  clm -YMS -Gs example.c 
  14034.  
  14035. #define INCL_DOSPROCESS
  14036. #define INCL_VIO
  14037. #define SLEEP_THREAD1 5000L
  14038. #define SLEEP_THREAD2 1000L
  14039. #define VIO_HANDLE 0
  14040. #define RETURN_CODE 0
  14041.  
  14042. TID    ThreadID;
  14043. BYTE   ThreadStackArea[4096];
  14044. USHORT rc;
  14045.  
  14046. VOID APIENTRY TestRoutine( )
  14047.    {
  14048.    USHORT r;
  14049.  
  14050.    r = DosSleep(SLEEP_THREAD2);        /* Interval size */
  14051.    r = VioWrtTTY("...Thread2...",      /* String to be written */
  14052.                  14,                   /* Length of string */
  14053.                  VIO_HANDLE);          /* Video handle */
  14054.    DosExit(EXIT_THREAD,                /* Indicates end thread of process */
  14055.            RETURN_CODE);               /* Result code */
  14056.    }
  14057.  
  14058. main( )
  14059.    {
  14060.    rc = DosCreateThread( (PFNTHREAD) TestRoutine,     /* Program address */
  14061.                         &ThreadID,                    /* New thread ID */
  14062.                         &ThreadStackArea[4095]);     /* End of stack for
  14063.                                                                new thread */
  14064.    rc = DosSleep(SLEEP_THREAD2);       /* Interval size */
  14065.    printf("...Thread1...\n");
  14066.    }
  14067.  
  14068. The following example shows how to suspend and resume execution of a thread 
  14069. within a process.  The main thread creates Thread2 and allows it to begin 
  14070. executing.  Thread2 iterates through a loop that prints a line and then sleeps, 
  14071. relinquishing its time slice to the main thread. After one iteration by 
  14072. Thread2, the main thread suspends Thread2 and then resumes it.  Subsequently, 
  14073. Thread2 completes the remaining three iterations. 
  14074.  
  14075. #define INCL_DOSPROCESS
  14076.  
  14077. #include <os2.h>
  14078.  
  14079. #define   SEGSIZE       4000   /* Number of bytes requested in segment */
  14080. #define   ALLOCFLAGS    0      /* Segment allocation flags - no sharing */
  14081. #define   SLEEPSHORT    5L     /* Sleep interval - 5 milliseconds */
  14082. #define   SLEEPLONG     75L    /* Sleep interval - 75 milliseconds */
  14083. #define   RETURN_CODE   0      /* Return code for DosExit() */
  14084.  
  14085. VOID APIENTRY Thread2()
  14086. {
  14087.   USHORT     i;
  14088.  
  14089.   /* Loop with four iterations */
  14090.   for(i=1; i<5; i++)
  14091.   {
  14092.     printf("In Thread2, i is now %d\n", i);
  14093.     /* Sleep to relinquish time slice to main thread */
  14094.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  14095.   }
  14096.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  14097.           RETURN_CODE);            /* Return code */
  14098. }
  14099.  
  14100.  
  14101. main()
  14102. {
  14103.   TID        ThreadID;             /* Thread identification */
  14104.   SEL        ThreadStackSel;       /* Segment selector for thread stack */
  14105.   PBYTE      StackEnd;             /* Ptr. to end of thread stack */
  14106.   USHORT     rc;
  14107.  
  14108.   /** Allocate segment for thread stack; make pointer to **/
  14109.   /**  end of stack. **/
  14110.   /** We must allocate a segment in order to preserve **/
  14111.   /**  segment protection for the thread. **/
  14112.  
  14113.   rc = DosAllocSeg(SEGSIZE,             /* Number of bytes requested */
  14114.                    &ThreadStackSel,     /* Segment selector (returned) */
  14115.                    ALLOCFLAGS);         /* Allocation flags - no sharing */
  14116.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  14117.  
  14118.   /** Start Thread2 **/
  14119.   if(!(rc=DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  14120.                        &ThreadID,                 /* Thread ID (returned) */
  14121.                        StackEnd)))   /* End of thread stack */
  14122.     printf("Thread2 created.\n");
  14123.  
  14124.   /* Sleep to relinquish time slice to Thread2 */
  14125.   if(!(DosSleep(SLEEPSHORT)))                  /* Sleep interval */
  14126.     printf("Slept a little to let Thread2 execute.\n");
  14127.  
  14128.   /***** Suspend Thread2, do some work, then resume Thread2 *****/
  14129.   if(!(rc=DosSuspendThread(ThreadID)))         /* Thread ID */
  14130.     printf("Thread2 SUSPENDED.\n");
  14131.   printf("Perform work that will not be interrupted by Thread2.\n");
  14132.   if(!(rc=DosResumeThread(ThreadID)))          /* Thread ID */
  14133.     printf("Thread2 RESUMED.\n");
  14134.   printf("Now we may be interrupted by Thread2.\n");
  14135.  
  14136.   /* Sleep to allow Thread2 to complete */
  14137.   DosSleep(SLEEPLONG);                         /* Sleep interval */
  14138. }
  14139.  
  14140.  
  14141. ΓòÉΓòÉΓòÉ <hidden> DosCwait ΓòÉΓòÉΓòÉ
  14142.  
  14143. typedef struct _RESULTCODES {  /* resc */
  14144.  
  14145.   USHORT codeTerminate;        /* Termination Code */
  14146.   USHORT codeResult;           /* Exit Code */
  14147.  
  14148. } RESULTCODES;
  14149.  
  14150. #define INCL_DOSPROCESS
  14151.  
  14152. USHORT  rc = DosCwait(ActionCode, WaitOption, ReturnCodes, ProcessIDWord,
  14153.                              ProcessID);
  14154.  
  14155. USHORT           ActionCode;    /* Execution options */
  14156. USHORT           WaitOption;    /* Wait options */
  14157. PRESULTCODES     ReturnCodes;   /* Termination Codes (returned) */
  14158. PPID             ProcessIDWord; /* Process ID (returned) */
  14159. PID              ProcessID;     /* Process ID of process to wait for */
  14160.  
  14161. USHORT           rc;            /* return code */
  14162.  
  14163. Example 
  14164.  
  14165. This example starts a child session (the program simple.exe) and then waits for 
  14166. the child process's termination. 
  14167.  
  14168. #define INCL_DOSPROCESS
  14169.  
  14170. #define START_PROGRAM "simple.exe"
  14171.  
  14172. CHAR        LoadError[100];
  14173. PSZ         Args;
  14174. PSZ         Envs;
  14175. RESULTCODES ReturnCodes;
  14176. USHORT      Pid;
  14177. USHORT      rc;
  14178.  
  14179.    strcpy(Args, "-a2 -l");             /* Pass arguments '-a2' and '-l' */
  14180.    if(!DosExecPgm(LoadError,                     /* Object name buffer */
  14181.                   sizeof(LoadError),             /* Length of object name
  14182.                                                      buffer */
  14183.                   EXEC_ASYNCRESULT,              /* Asynchronous/Trace
  14184.                                                         flags */
  14185.                   Args,                          /* Argument string */
  14186.                   Envs,                          /* Environment string */
  14187.                   &ReturnCodes,                  /* Termination codes */
  14188.                   START_PROGRAM))                /* Program file name */
  14189.       rc = DosCwait(DCWA_PROCESS,                /* Execution options */
  14190.                     DCWW_WAIT,                   /* Wait options */
  14191.                     &ReturnCodes,                /* Termination codes */
  14192.                     &Pid,                        /* Process ID */
  14193.                     ReturnCodes.codeTerminate);  /* Process ID of process
  14194.                                                      to wait for */
  14195.  
  14196.  
  14197. ΓòÉΓòÉΓòÉ <hidden> DosDelete ΓòÉΓòÉΓòÉ
  14198.  
  14199. #define INCL_DOSFILEMGR
  14200.  
  14201. USHORT  rc = DosDelete(FileName, Reserved);
  14202.  
  14203. PSZ              FileName;      /* File name path */
  14204. ULONG            0;             /* Reserved (must be zero) */
  14205.  
  14206. USHORT           rc;            /* return code */
  14207.  
  14208. Example 
  14209.  
  14210. This example deletes a file in the current directory named test.dat. 
  14211.  
  14212. #define INCL_DOSFILEMGR
  14213.  
  14214. #define FILE_DELETE "test.dat"
  14215. #define RESERVED 0L
  14216.  
  14217. USHORT rc;
  14218.  
  14219.    rc = DosDelete(FILE_DELETE,    /* File path name */
  14220.                   RESERVED);      /* Reserved (must be zero) */
  14221.  
  14222.  
  14223. ΓòÉΓòÉΓòÉ <hidden> DosDevConfig ΓòÉΓòÉΓòÉ
  14224.  
  14225. #define INCL_DOSDEVICES
  14226.  
  14227. USHORT  rc = DosDevConfig(DeviceInfo, Item, Parm);
  14228.  
  14229. PVOID            DeviceInfo;    /* Returned information */
  14230. USHORT           Item;          /* Item number */
  14231. USHORT           Parm;          /* Reserved */
  14232.  
  14233. USHORT           rc;            /* return */
  14234.  
  14235. Example 
  14236.  
  14237. This example gets information about model type, monitor and coprocessor and 
  14238. display it. 
  14239.  
  14240. #define INCL_DOSDEVICES
  14241.  
  14242. #define MACHINE_MODEL 5
  14243. #define DISPLAY_TYPE 6
  14244. #define FIND_COPROCESSOR 3
  14245. #define RESERVED 0L
  14246.  
  14247. BYTE   DeviceInfo;
  14248. USHORT rc;
  14249.  
  14250.    if(!DosDevConfig(&DeviceInfo,            /* Returned information */
  14251.                     MACHINE_MODEL,          /* Item number */
  14252.                     RESERVED))              /* Reserved */
  14253.       printf("Model Type %d ",DeviceInfo);
  14254.  
  14255.    if(!DosDevConfig(&DeviceInfo,            /* Returned information */
  14256.                     DISPLAY_TYPE,           /* Item number */
  14257.                     RESERVED))              /* Reserved */
  14258.       if (DeviceInfo)
  14259.          printf("Color display ");
  14260.       else
  14261.          printf("Mono display ");
  14262.  
  14263.    if(!DosDevConfig(&DeviceInfo,            /* Returned information */
  14264.                     FIND_COPROCESSOR,       /* Item number */
  14265.                     RESERVED))              /* Reserved */
  14266.       if (DeviceInfo)
  14267.          printf("Coprocessor");
  14268.       else
  14269.          printf("No Coprocessor");
  14270.  
  14271.  
  14272. ΓòÉΓòÉΓòÉ <hidden> DosDevIOCtl ΓòÉΓòÉΓòÉ
  14273.  
  14274. #define INCL_DOSDEVICES
  14275.  
  14276. USHORT  rc = DosDevIOCtl(Data, ParmList, Function, Category, DevHandle);
  14277.  
  14278. PVOID            Data;          /* Data area */
  14279. PVOID            ParmList;      /* Command arguments */
  14280. USHORT           Function;      /* Device function */
  14281. USHORT           Category;      /* Device category */
  14282. HFILE            DevHandle;     /* Specifies the device */
  14283.  
  14284. USHORT           rc;            /* return code */
  14285.  
  14286.  
  14287. ΓòÉΓòÉΓòÉ <hidden> DosDevIOCtl2 ΓòÉΓòÉΓòÉ
  14288.  
  14289. #define INCL_DOSDEVICES
  14290.  
  14291. USHORT  rc = DosDevIOCtl2(Data, ParmList, Function, Category, DevHandle);
  14292.  
  14293. PVOID            Data;          /* Data area */
  14294. USHORT           DataLength     /* Data area length */
  14295. PVOID            ParmList;      /* Command arguments */
  14296. USHORT           ParmListLength /* Command arguments list length */
  14297. USHORT           Function;      /* Device function */
  14298. USHORT           Category;      /* Device category */
  14299. HFILE            DevHandle;     /* Specifies the device */
  14300.  
  14301. USHORT           rc;            /* return code */
  14302.  
  14303.  
  14304. ΓòÉΓòÉΓòÉ <hidden> DosDisConnectNmPipe ΓòÉΓòÉΓòÉ
  14305.  
  14306. #define INCL_DOSNMPIPES
  14307.  
  14308. USHORT  rc = DosDisConnectNmPipe(Handle);
  14309.  
  14310. HPIPE            Handle;        /* Pipe handle */
  14311.  
  14312. USHORT           rc;            /* return code */
  14313.  
  14314.  
  14315. ΓòÉΓòÉΓòÉ <hidden> DosDupHandle ΓòÉΓòÉΓòÉ
  14316.  
  14317. #define INCL_DOSFILEMGR
  14318.  
  14319. USHORT  rc = DosDupHandle(OldFileHandle, NewFileHandle);
  14320.  
  14321. HFILE            OldFileHandle; /* Existing file handle */
  14322. PHFILE           NewFileHandle; /* New file handle (returned) */
  14323.  
  14324. USHORT           rc;            /* return code */
  14325.  
  14326. Example 
  14327.  
  14328. This example opens a file, creates a second file handle, then closes the file 
  14329. with the second handle. 
  14330.  
  14331. #define INCL_DOSFILEMGR
  14332.  
  14333. #define OPEN_FILE 0x01
  14334. #define CREATE_FILE 0x10
  14335. #define FILE_ARCHIVE 0x20
  14336. #define FILE_EXISTS OPEN_FILE
  14337. #define FILE_NOEXISTS CREATE_FILE
  14338. #define DASD_FLAG 0
  14339. #define INHERIT 0x80
  14340. #define WRITE_THRU 0
  14341. #define FAIL_FLAG 0
  14342. #define SHARE_FLAG 0x10
  14343. #define ACCESS_FLAG 0x02
  14344.  
  14345. #define FILE_NAME "test.dat"
  14346. #define FILE_SIZE 800L
  14347. #define FILE_ATTRIBUTE FILE_ARCHIVE
  14348. #define RESERVED 0L
  14349.  
  14350. HFILE   FileHandle;
  14351. HFILE   NewHandle
  14352. USHORT  Wrote;
  14353. USHORT  Action;
  14354. PSZ     FileData[100];
  14355. USHORT  rc;
  14356.  
  14357.    Action = 2;
  14358.    strcpy(FileData, "Data...");
  14359.    if(!DosOpen(FILE_NAME,                /* File path name */
  14360.                 &FileHandle,             /* File handle */
  14361.                 &Action,                 /* Action taken */
  14362.                 FILE_SIZE,               /* File primary allocation */
  14363.                 FILE_ATTRIBUTE,          /* File attribute */
  14364.                 FILE_EXISTS | FILE_NOEXISTS,              /* Open function
  14365.                                                                      type */
  14366.                 DASD_FLAG | INHERIT |            /* Open mode of the file */
  14367.                 WRITE_THRU | FAIL_FLAG |
  14368.                 SHARE_FLAG | ACCESS_FLAG,
  14369.                 RESERVED))               /* Reserved (must be zero) */
  14370.       rc = DosDupHandle(FileHandle,      /* Existing file handle */
  14371.                         &NewHandle);     /* New file handle */
  14372.  
  14373.  
  14374. ΓòÉΓòÉΓòÉ <hidden> DosEditName ΓòÉΓòÉΓòÉ
  14375.  
  14376. #define INCL_DOSFILEMGR
  14377.  
  14378. USHORT  rc = DosEditName(EditLevel, SourceString, EditString, TargetBuf,
  14379.                           TargetBufLen);
  14380.  
  14381. USHORT           EditLevel;     /* Level of meta editing semantics  */
  14382. PSZ              SourceString;  /* String to transform  */
  14383. PSZ              EditString;    /* Editing string */
  14384. PBYTE            TargetBuf;     /* Destination string buffer  */
  14385. USHORT           TargetBufLen;  /* Destination string buffer length */
  14386.  
  14387. USHORT           rc;            /* return code */
  14388.  
  14389.  
  14390. ΓòÉΓòÉΓòÉ <hidden> DosEnterCritSec ΓòÉΓòÉΓòÉ
  14391.  
  14392. #define INCL_DOSPROCESS
  14393.  
  14394. USHORT  rc = DosEnterCritSec(VOID);
  14395.  
  14396. USHORT           rc;            /* return code */
  14397.  
  14398. Example 
  14399.  
  14400. This example enters a section that will not be pre-empted, performs a simple 
  14401. task, and then exits quickly. 
  14402.  
  14403. #define INCL_DOSPROCESS
  14404.  
  14405. USHORT flag;
  14406.  
  14407.    DosEnterCritSec();                       /* Enter critical code
  14408.                                                section */
  14409.    flag = TRUE;                             /* Perform some work */
  14410.    DosExitCritSec();                        /* Exit critical code section */
  14411.  
  14412.  
  14413. ΓòÉΓòÉΓòÉ <hidden> DosEnumAttribute ΓòÉΓòÉΓòÉ
  14414.  
  14415. typedef struct _DENA1 {  /* level 1 info returned from DosEnumAttribute */
  14416.   UCHAR  reserved;       /* 0                                           */
  14417.   UCHAR  cbName;         /* length of name excluding NULL               */
  14418.   USHORT cbValue;        /* length of value                             */
  14419.   UCHAR  szName[1];      /* variable length asciiz name                 */
  14420. } DENA1;
  14421.  
  14422. #define INCL_DOSFILEMGR
  14423.  
  14424. USHORT  rc = DosEnumAttribute(RefType, FileRef, EntryNum, EnumBuf,
  14425.                                EnumBufSize, EnumCnt, InfoLevel, Reserved);
  14426.  
  14427. USHORT           RefType;       /* Type of reference  */
  14428. PVOID            FileRef;       /* Handle or Name  */
  14429. ULONG            EntryNum;      /* Starting entry in EA list  */
  14430. PVOID            EnumBuf;       /* Data buffer  */
  14431. ULONG            EnumBufSize;   /* Data buffer size  */
  14432. PULONG           EnumCnt;       /* Count of entries to return  */
  14433. ULONG            InfoLevel;     /* Level of information requested  */
  14434. ULONG            0;             /* Reserved (must be zero)  */
  14435.  
  14436. USHORT           rc;            /* return code */  */
  14437.  
  14438.  
  14439. ΓòÉΓòÉΓòÉ <hidden> DosErrClass ΓòÉΓòÉΓòÉ
  14440.  
  14441. #define INCL_DOSMISC
  14442.  
  14443. USHORT  rc = DosErrClass(Code, Class, Action, Locus);
  14444.  
  14445. USHORT           Code;          /* Error code for analysis */
  14446. PUSHORT          Class;         /* Error classification (returned) */
  14447. PUSHORT          Action;        /* Recommended action (returned) */
  14448. PUSHORT          Locus;         /* Error locus (returned) */
  14449.  
  14450. USHORT           rc;            /* return code */
  14451.  
  14452. Example 
  14453.  
  14454. This example attempts to delete a non-existent file.  The error returned is 
  14455. then plugged into DosErrClass for more information about the error and what 
  14456. actions should be taken. 
  14457.  
  14458. #define INCL_DOSQUEUES
  14459.  
  14460. #define RESERVED 0L
  14461. #define FILE_DELETE "adlkjf.dkf"
  14462.  
  14463. USHORT Error;
  14464. USHORT Class;
  14465. USHORT Action;
  14466. USHORT Locus;
  14467. USHORT rc;
  14468.  
  14469.    Error = DosDelete(FILE_DELETE,      /* File name path */
  14470.                      RESERVED);        /* Reserved (must be zero) */
  14471.    rc = DosErrClass(Error,             /* Error code for analysis */
  14472.                     &Class,            /* Error classification */
  14473.                     &Action,           /* Recommended action */
  14474.                     &Locus);           /* Error locus */
  14475.  
  14476.  
  14477. ΓòÉΓòÉΓòÉ <hidden> DosError ΓòÉΓòÉΓòÉ
  14478.  
  14479. #define INCL_DOSMISC
  14480.  
  14481. USHORT  rc = DosError(Flag);
  14482.  
  14483. USHORT           Flags;          /* Action flags */
  14484.  
  14485. USHORT           rc;            /* return code */
  14486.  
  14487. Example 
  14488.  
  14489. This example disables hard error popups and exception popups, then re-enables 
  14490. them. 
  14491.  
  14492. #define INCL_DOSQUEUES
  14493.  
  14494. #define ENABLE_EXCEPTION 0
  14495. #define DISABLE_EXCEPTION 2
  14496. #define ENABLE_HARDERROR 1
  14497. #define DISABLE_HARDERROR 0
  14498. #define DISABLE_ERRORPOPUPS DISABLE_EXCEPTION | DISABLE_HARDERROR
  14499. #define ENABLE_ERRORPOPUPS ENABLE_EXCEPTION | ENABLE_HARDERROR
  14500.  
  14501. USHORT rc;
  14502.  
  14503.    rc = DosError(DISABLE_ERRORPOPUPS); /* Action flag */
  14504.    rc = DosError(ENABLE_ERRORPOPUPS);  /* Action flag */
  14505.  
  14506.  
  14507. ΓòÉΓòÉΓòÉ <hidden> DosExecPgm ΓòÉΓòÉΓòÉ
  14508.  
  14509. typedef struct _RESULTCODES {  /* resc */
  14510.  
  14511.   USHORT codeTerminate;        /* Termination Code -or- Process ID */
  14512.   USHORT codeResult;           /* Exit Code */
  14513.  
  14514. } RESULTCODES;
  14515.  
  14516. #define INCL_DOSPROCESS
  14517.  
  14518. USHORT  rc = DosExecPgm(ObjNameBuf, ObjNameBufL, ExecFlags, ArgPointer,
  14519.                              EnvPointer, ReturnCodes, PgmPointer);
  14520.  
  14521. PCHAR            ObjNameBuf;    /* Address of object name buffer
  14522.                                     (returned) */
  14523. SHORT            ObjNameBufL;   /* Length of object name buffer */
  14524. USHORT           ExecFlags;     /* Execute asynchronously/trace */
  14525. PSZ              ArgPointer;    /* Address of argument string */
  14526. PSZ              EnvPointer;    /* Address of environment string */
  14527. PRESULTCODES     ReturnCodes;   /* Address of termination codes
  14528.                                     (returned) */
  14529. PSZ              PgmPointer;    /* Address of program file name */
  14530.  
  14531. USHORT           rc;            /* return code */
  14532.  
  14533. Example 
  14534.  
  14535. This example starts up the program simple.exe and then waits for it to finish. 
  14536. Then the termination and return codes are printed. 
  14537.  
  14538. #define INCL_DOSPROCESS
  14539.  
  14540. #define START_PROGRAM "simple.exe"
  14541.  
  14542. CHAR        LoadError[100];
  14543. PSZ         Args;
  14544. PSZ         Envs;
  14545. RESULTCODES ReturnCodes;
  14546. USHORT      rc;
  14547.  
  14548.    if(!DosExecPgm(LoadError,           /* Object name buffer */
  14549.                   sizeof(LoadError),   /* Length of object name buffer */
  14550.                   EXEC_SYNC,           /* Asynchronous/Trace flags */
  14551.                   Args,                /* Argument string */
  14552.                   Envs,                /* Environment string */
  14553.                   &ReturnCodes,        /* Termination codes */
  14554.                   START_PROGRAM))      /* Program file name */
  14555.       printf("Termination Code %d  Return Code %d \n",
  14556.              ReturnCodes.codeTerminate,
  14557.              ReturnCodes.codeResult);
  14558.  
  14559.  
  14560. ----------------simple.exe------------------
  14561.  
  14562. #define INCL_DOSPROCESS
  14563.  
  14564. #define RETURN_CODE 0
  14565.  
  14566. main( )
  14567.    {
  14568.    printf("Hello!\n");
  14569.    DosExit(EXIT_PROCESS,          /* End thread/process */
  14570.            RETURN_CODE);          /* Result code */
  14571.    }
  14572.  
  14573. The following example demonstrates how to create a process, obtain process ID 
  14574. information, and kill a process.  Process1 invokes process2 to run 
  14575. asynchronously.  It obtains and prints some PID information, and then kills 
  14576. process2. 
  14577.  
  14578. /* ---- process1.c ---- */
  14579.  
  14580. #define INCL_DOSPROCESS
  14581.  
  14582. #include <os2.h>
  14583.  
  14584. #define START_PROGRAM "process2.exe"   /* Program pointer */
  14585.  
  14586. main()
  14587. {
  14588.  
  14589.   CHAR          ObjFail [50];       /* Object name buffer */
  14590.   RESULTCODES   ReturnCodes;        /*
  14591.   PIDINFO       PidInfo;
  14592.   PID           ParentID;           /*
  14593.   USHORT        rc;
  14594.  
  14595.   printf("Process1 now running. \n");
  14596.  
  14597.   /** Start a child process. **/
  14598.   if(!(DosExecPgm(ObjFail,            /* Object name buffer */
  14599.                   sizeof(ObjFail),    /* Length of obj. name
  14600.                                          buffer */
  14601.                   EXEC_ASYNC,         /* Execution flag - asynchronous */
  14602.                   NULL,               /* No args. to pass to process2*/
  14603.                   NULL,               /* Process2 inherits process1's
  14604.                                          environment */
  14605.                   &ReturnCodes,       /* Ptr. to resultcodes struct. */
  14606.                   START_PROGRAM)))    /* Name of program file */
  14607.     printf("Process2 started. \n");
  14608.  
  14609.   /** Obtain Process ID information and print it **/
  14610.   if(!(rc=DosGetPID(&PidInfo)))       /* Process ID's (returned) */
  14611.     printf("DosGetPID: current process ID is %d; thread ID is %d; parent process ID is %d.\n",
  14612.             PidInfo.pid, PidInfo.tid, PidInfo.pidParent);
  14613.   if(!(rc=DosGetPPID(
  14614.            ReturnCodes.codeTerminate, /* Process whose parent is wanted */
  14615.            &ParentID)))               /* Address to put parent's PID */
  14616.     printf("Child process ID is %d; Parent process ID is %d.\n",
  14617.             ReturnCodes.codeTerminate, ParentID);
  14618.  
  14619.   /** Terminate process2 **/
  14620.   if(!(rc=DosKillProcess(DKP_PROCESSTREE,      /* Action code - kill process and descendants */
  14621.                 ReturnCodes.codeTerminate)))   /* PID of root of process tree */
  14622.     printf("Process2 terminated by process1.\n");
  14623. }
  14624.  
  14625. /* ---- process2.c ---- */
  14626.  
  14627. #define INCL_DOSPROCESS
  14628.  
  14629. #include <os2.h>
  14630.  
  14631. #define SLEEPTIME   500L
  14632. #define RETURN_CODE 0
  14633.  
  14634. main()
  14635. {
  14636.   printf("Process2 now running.\n");
  14637.  
  14638.   /* Sleep to allow process1 to kill it */
  14639.   DosSleep(SLEEPTIME);                /* Sleep interval */
  14640.   DosExit(EXIT_PROCESS,               /* Action Code */
  14641.           RETURN_CODE);               /* Result Code */
  14642. }
  14643.  
  14644.  
  14645. ΓòÉΓòÉΓòÉ <hidden> DosExit ΓòÉΓòÉΓòÉ
  14646.  
  14647. #define INCL_DOSPROCESS
  14648.  
  14649. VOID    DosExit(ActionCode, ResultCode);
  14650.  
  14651. USHORT           ActionCode;    /* Indicates end thread or process */
  14652. USHORT           ResultCode;    /* Result Code to save for DosCwait */
  14653.  
  14654. Example 
  14655.  
  14656. In this example, the main routine starts up another program, simple.exe, and 
  14657. then expects a return code of 3 to be returned. Simple.exe sets the return code 
  14658. with DosExit. 
  14659.  
  14660. #define INCL_DOSPROCESS
  14661.  
  14662. #define START_PROGRAM "simple.exe"
  14663. #define RETURN_OK 3
  14664.  
  14665. CHAR        LoadError[100];
  14666. PSZ         Args;
  14667. PSZ         Envs;
  14668. RESULTCODES ReturnCodes;
  14669. USHORT      rc;
  14670.  
  14671.    if(!DosExecPgm(LoadError,                     /* Object name buffer */
  14672.                   sizeof(LoadError),             /* Length of object name
  14673.                                                      buffer */
  14674.                   EXEC_SYNC,                     /* Asynchronous/Trace
  14675.                                                         flags */
  14676.                   Args,                          /* Argument string */
  14677.                   Envs,                          /* Environment string */
  14678.                   &ReturnCodes,                  /* Termination codes */
  14679.                   START_PROGRAM))                /* Program file name */
  14680.       if (ReturnCodes.codeResult == RETURN_OK)   /* Check result code */
  14681.          printf("things are ok..");
  14682.       else
  14683.          printf("something is wrong...");
  14684.  
  14685.  
  14686. ----------------simple.exe------------------
  14687.  
  14688. #define INCL_DOSPROCESS
  14689.  
  14690. #define RETURN_CODE 3
  14691.  
  14692. main( )
  14693.    {
  14694.    printf("Hello!\n");
  14695.    DosExit(EXIT_THREAD,           /* End thread/process */
  14696.            RETURN_CODE);          /* Result code */
  14697.    }
  14698.  
  14699. The following example shows how to suspend and resume execution of a thread 
  14700. within a process.  The main thread creates Thread2 and allows it to begin 
  14701. executing.  Thread2 iterates through a loop that prints a line and then sleeps, 
  14702. relinquishing its time slice to the main thread. After one iteration by 
  14703. Thread2, the main thread suspends Thread2 and then resumes it.  Subsequently, 
  14704. Thread2 completes the remaining three iterations. 
  14705.  
  14706. #define INCL_DOSPROCESS
  14707.  
  14708. #include <os2.h>
  14709.  
  14710. #define   SEGSIZE       4000   /* Number of bytes requested in segment */
  14711. #define   ALLOCFLAGS    0      /* Segment allocation flags - no sharing */
  14712. #define   SLEEPSHORT    5L     /* Sleep interval - 5 milliseconds */
  14713. #define   SLEEPLONG     75L    /* Sleep interval - 75 milliseconds */
  14714. #define   RETURN_CODE   0      /* Return code for DosExit() */
  14715.  
  14716. VOID APIENTRY Thread2()
  14717. {
  14718.   USHORT     i;
  14719.  
  14720.   /* Loop with four iterations */
  14721.   for(i=1; i<5; i++)
  14722.   {
  14723.     printf("In Thread2, i is now %d\n", i);
  14724.  
  14725.     /* Sleep to relinquish time slice to main thread */
  14726.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  14727.   }
  14728.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  14729.           RETURN_CODE);            /* Return code */
  14730. }
  14731.  
  14732.  
  14733. main()
  14734. {
  14735.   TID        ThreadID;             /* Thread identification */
  14736.   SEL        ThreadStackSel;       /* Segment selector for thread stack */
  14737.   PBYTE      StackEnd;             /* Ptr. to end of thread stack */
  14738.   USHORT     rc;
  14739.  
  14740.   /** Allocate segment for thread stack; make pointer to end of stack. **/
  14741.   /**  We must allocate a segment in order to preserve segment **/
  14742.   /**  protection for the thread.  **/
  14743.  
  14744.   rc = DosAllocSeg(SEGSIZE,             /* Number of bytes requested */
  14745.                    &ThreadStackSel,     /* Segment selector (returned) */
  14746.                    ALLOCFLAGS);         /* Allocation flags - no sharing */
  14747.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  14748.  
  14749.   /** Start Thread2 **/
  14750.   if(!(rc=DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  14751.                        &ThreadID,                 /* Thread ID (returned) */
  14752.                        StackEnd)))   /* End of thread stack */
  14753.     printf("Thread2 created.\n");
  14754.  
  14755.   /* Sleep to relinquish time slice to Thread2 */
  14756.   if(!(DosSleep(SLEEPSHORT)))                  /* Sleep interval */
  14757.     printf("Slept a little to let Thread2 execute.\n");
  14758.  
  14759.   /***** Suspend Thread2, do some work, then resume Thread2 *****/
  14760.   if(!(rc=DosSuspendThread(ThreadID)))         /* Thread ID */
  14761.     printf("Thread2 SUSPENDED.\n");
  14762.   printf("Perform work that will not be interrupted by Thread2.\n");
  14763.   if(!(rc=DosResumeThread(ThreadID)))          /* Thread ID */
  14764.     printf("Thread2 RESUMED.\n");
  14765.   printf("Now we may be interrupted by Thread2.\n");
  14766.  
  14767.   /* Sleep to allow Thread2 to complete */
  14768.   DosSleep(SLEEPLONG);                         /* Sleep interval */
  14769. }
  14770.  
  14771.  
  14772. ΓòÉΓòÉΓòÉ <hidden> DosExitCritSec ΓòÉΓòÉΓòÉ
  14773.  
  14774. #define INCL_DOSPROCESS
  14775.  
  14776. USHORT  rc = DosExitCritSec(VOID);
  14777.  
  14778. USHORT           rc;            /* return code */
  14779.  
  14780. Example 
  14781.  
  14782. This example enters a section that will not be pre-empted, performs a simple 
  14783. task, and then exits quickly. 
  14784.  
  14785. #define INCL_DOSPROCESS
  14786.  
  14787.    DosEnterCritSec();                       /* Enter critical code
  14788.                                                 section */
  14789.    flag = TRUE;                             /* Perform some work */
  14790.    DosExitCritSec();                        /* Exit critical code section */
  14791.  
  14792.  
  14793. ΓòÉΓòÉΓòÉ <hidden> DosExitList ΓòÉΓòÉΓòÉ
  14794.  
  14795. #define INCL_DOSPROCESS
  14796.  
  14797. USHORT  rc = DosExitList(FcnCode_Order, RtnAddress);
  14798.  
  14799. USHORT           FcnCode_Order; /* Function request code/Order */
  14800. PFNEXITLIST      RtnAddress;    /* Address of routine */
  14801.  
  14802. USHORT           rc;            /* return code */
  14803.  
  14804. Example 
  14805.  
  14806. In this example, TestRoutine is added to the exitlist sequence. Routines in the 
  14807. exitlist sequence must use DosExitList instead of DosExit to end. 
  14808.  
  14809. #define INCL_DOSPROCESS
  14810. #define INCL_VIO
  14811. #define ROUTINE_ORDER 0xEE00
  14812. #define VIO_HANDLE 0
  14813.  
  14814. USHORT rc;
  14815.  
  14816. VOID APIENTRY TestRoutine2()
  14817.    {
  14818.    USHORT r;
  14819.  
  14820.    VioWrtTTY("This runs last...\n",         /* String to be written */
  14821.              18,                            /* Length of string */
  14822.              VIO_HANDLE);                   /* Video handle */
  14823.    r = DosExitList(EXLST_EXIT,                   /* Function request
  14824.                                                         code/order */
  14825.                    (PFNEXITLIST) TestRoutine2);  /* Address of routine */
  14826.    }
  14827.  
  14828. main()
  14829.    {
  14830.    rc = DosExitList(EXLST_ADD | ROUTINE_ORDER,   /* Function request
  14831.                                                            code/order */
  14832.                     (PFNEXITLIST) TestRoutine2); /* Address of routine */
  14833.    }
  14834.  
  14835.  
  14836. ΓòÉΓòÉΓòÉ <hidden> DosFileIO ΓòÉΓòÉΓòÉ
  14837.  
  14838. #define INCL_DOSFILEMGR
  14839.  
  14840. USHORT  rc = DosFileIO(FileHandle, CommandList, CommandListLen,
  14841.                          ErrorOffset);
  14842.  
  14843. HFILE           FileHandle;     /* File handle */
  14844. PBYTE           CommandList;    /* Ptr to command buffer */
  14845. USHORT          CommandListLen; /* Length of command buffer  */
  14846. PLONG           ErrorOffset;    /* Ptr to command error offset */
  14847.  
  14848. USHORT           rc;            /* return code */
  14849.  
  14850.  
  14851. ΓòÉΓòÉΓòÉ <hidden> DosFileLocks ΓòÉΓòÉΓòÉ
  14852.  
  14853. #define INCL_DOSFILEMGR
  14854.  
  14855. USHORT  rc = DosFileLocks(FileHandle, UnLockRange, LockRange);
  14856.  
  14857. HFILE            FileHandle;    /* File handle */
  14858. PLONG            UnLockRange;   /* UnLock range */
  14859. PLONG            LockRange;     /* Lock range */
  14860.  
  14861. USHORT           rc;            /* return code */
  14862.  
  14863. Example 
  14864.  
  14865. This example opens a file, writes some data to it, locks a block of the data, 
  14866. and then unlocks it. 
  14867.  
  14868. #define INCL_DOSFILEMGR
  14869.  
  14870. #define OPEN_FILE 0x01
  14871. #define CREATE_FILE 0x10
  14872. #define FILE_ARCHIVE 0x20
  14873. #define FILE_EXISTS OPEN_FILE
  14874. #define FILE_NOEXISTS CREATE_FILE
  14875. #define DASD_FLAG 0
  14876. #define INHERIT 0x80
  14877. #define WRITE_THRU 0
  14878. #define FAIL_FLAG 0
  14879. #define SHARE_FLAG 0x10
  14880. #define ACCESS_FLAG 0x02
  14881.  
  14882. #define FILE_NAME "test.dat"
  14883. #define FILE_SIZE 800L
  14884. #define FILE_ATTRIBUTE FILE_ARCHIVE
  14885. #define RESERVED 0L
  14886. #define NULL_RANGE 0L
  14887.  
  14888. HFILE   FileHandle;
  14889. USHORT  Wrote;
  14890. USHORT  Action;
  14891. PSZ     FileData[100];
  14892. USHORT  rc;
  14893.  
  14894. struct LockStrc
  14895.    {
  14896.    long Offset;
  14897.    long Range;
  14898.    } Area;
  14899.  
  14900. int i;
  14901.  
  14902.    Action = 2;
  14903.    strcpy(FileData, "Data...");
  14904.    Area.Offset = 4;
  14905.    Area.Range = 100;
  14906.  
  14907.    if(!DosOpen(FILE_NAME,                /* File path name */
  14908.                 &FileHandle,             /* File handle */
  14909.                 &Action,                 /* Action taken */
  14910.                 FILE_SIZE,               /* File primary allocation */
  14911.                 FILE_ATTRIBUTE,          /* File attribute */
  14912.                 FILE_EXISTS | FILE_NOEXISTS,              /* Open function
  14913.                                                                     type */
  14914.                 DASD_FLAG | INHERIT |            /* Open mode of the file */
  14915.                 WRITE_THRU | FAIL_FLAG |
  14916.                 SHARE_FLAG | ACCESS_FLAG,
  14917.                 RESERVED))               /* Reserved (must be zero) */
  14918.       {
  14919.       for(i=0; i<200; ++i)
  14920.          DosWrite(FileHandle,            /* File handle */
  14921.                   FileData,              /* User buffer */
  14922.                   sizeof(FileData),      /* Buffer length */
  14923.                   &Wrote);               /* Bytes written */
  14924.       rc = DosFileLocks(FileHandle,            /* File handle */
  14925.                         NULL_RANGE,            /* Unlock range */
  14926.                         (PLONG) &Area);       /* Lock range */
  14927.       rc = DosFileLocks(FileHandle,            /* File handle */
  14928.                         (PLONG) &Area,        /* Unlock range */
  14929.                         NULL_RANGE);           /* Lock range */
  14930.       }
  14931.  
  14932.  
  14933. ΓòÉΓòÉΓòÉ <hidden> DosFindClose ΓòÉΓòÉΓòÉ
  14934.  
  14935. #define INCL_DOSFILEMGR
  14936.  
  14937. USHORT  rc = DosFindClose(DirHandle);
  14938.  
  14939. HDIR             DirHandle;     /* Directory search handle */
  14940.  
  14941. USHORT           rc;            /* return code */
  14942.  
  14943. Example 
  14944.  
  14945. This example searches for a file, then closes the search. 
  14946.  
  14947. #define INCL_DOSFILEMGR
  14948. #define SEARCH_PATTERN "*.*"
  14949. #define FILE_ATTRIBUTE 0
  14950. #define RESERVED 0L
  14951.  
  14952. HDIR  FindHandle;
  14953.  
  14954.    FindHandle = 0x0001;
  14955.    FindCount = 1;
  14956.  
  14957.    rc = DosFindFirst(SEARCH_PATTERN,        /* File pattern */
  14958.                      &FindHandle,           /* Directory search handle */
  14959.                      FILE_ATTRIBUTE,        /* Search attribute */
  14960.                      &FindBuffer,           /* Result buffer */
  14961.                      sizeof(FindBuffer),    /* Result buffer length */
  14962.                      &FindCount,            /* # of entries to find */
  14963.                      RESERVED);             /* Reserved (must be zero) */
  14964.    rc = DosFindClose(FindHandle);           /* Directory search handle */
  14965.  
  14966.  
  14967. ΓòÉΓòÉΓòÉ <hidden> DosFindFirst ΓòÉΓòÉΓòÉ
  14968.  
  14969. typedef struct _FDATE {   /* fdate */
  14970.  
  14971.   unsigned day   : 5;     /* binary day for directory entry */
  14972.   unsigned month : 4;     /* binary month for directory entry */
  14973.   unsigned year  : 7;     /* binary year for directory entry */
  14974.  
  14975. } FDATE;
  14976.  
  14977. typedef struct _FTIME {       /* ftime */
  14978.  
  14979.   unsigned twosecs : 5;       /* binary number of two-second increments */
  14980.   unsigned minutes : 6;       /* binary number of minutes */
  14981.   unsigned hours   : 5;       /* binary number of hours */
  14982.  
  14983. } FTIME;
  14984.  
  14985. typedef struct _FILEFINDBUF {   /* findbuf */
  14986.  
  14987.   FDATE  fdateCreation;         /* file date of creation */
  14988.   FTIME  ftimeCreation;         /* file time of creation */
  14989.   FDATE  fdateLastAccess;       /* file date of last access */
  14990.   FTIME  ftimeLastAccess;       /* file time of last access */
  14991.   FDATE  fdateLastWrite;        /* file date of last write */
  14992.   FTIME  ftimeLastWrite;        /* file time of last write */
  14993.   ULONG  cbFile;                /* file end of data */
  14994.   ULONG  cbFileAlloc;           /* file allocation */
  14995.   USHORT attrFile;              /* file attribute */
  14996.   UCHAR  cchName;               /* length of ASCIIZ name string */
  14997.   CHAR   achName[CCHMAXPATHCOMP]; /* ASCIIZ name string */
  14998.  
  14999. } FILEFINDBUF;
  15000.  
  15001. #define INCL_DOSFILEMGR
  15002.  
  15003. USHORT  rc = DosFindFirst(FileName, DirHandle, Attribute, ResultBuf,
  15004.                              ResultBufLen, SearchCount, Reserved);
  15005.  
  15006. PSZ              FileName;      /* File path name */
  15007. PHDIR            DirHandle;     /* Directory search handle */
  15008. USHORT           Attribute;     /* Search attribute */
  15009. PFILEFINDBUF     ResultBuf;     /* Result buffer */
  15010. USHORT           ResultBufLen;  /* Result buffer length *
  15011. PUSHORT          SearchCount;   /* Number of entries to find */
  15012. ULONG            0;             /* Reserved (must be zero) */
  15013.  
  15014. USHORT           rc;            /* return code */
  15015.  
  15016. Example 
  15017.  
  15018. This example searches for a file matching the pattern 'te??.dat.' 
  15019.  
  15020. #define INCL_DOSFILEMGR
  15021.  
  15022. #define NORMAL_FILES 0
  15023. #define HIDDEN_FILES 2
  15024. #define SEARCH_PATTERN "te??.dat"
  15025. #define FILE_ATTRIBUTE NORMAL_FILES | HIDDEN_FILES
  15026. #define RESERVED 0L
  15027.  
  15028. HDIR        FindHandle;
  15029. FILEFINDBUF FindBuffer;
  15030. USHORT      FindCount;
  15031. USHORT      rc;
  15032.  
  15033.    FindHandle = 0x0001;
  15034.    FindCount = 1;
  15035.  
  15036.    rc = DosFindFirst(SEARCH_PATTERN,        /* File pattern */
  15037.                      &FindHandle,           /* Directory search handle */
  15038.                      FILE_ATTRIBUTE,        /* Search attribute */
  15039.                      &FindBuffer,           /* Result buffer */
  15040.                      sizeof(FindBuffer),    /* Result buffer length */
  15041.                      &FindCount,             /* # of entries to find */
  15042.                      RESERVED);             /* Reserved (must be zero) */
  15043.  
  15044.  
  15045. ΓòÉΓòÉΓòÉ <hidden> DosFindFirst2 ΓòÉΓòÉΓòÉ
  15046.  
  15047. typedef struct _FDATE {   /* fdate */
  15048.  
  15049.   unsigned day   : 5;     /* binary day for directory entry */
  15050.   unsigned month : 4;     /* binary month for directory entry */
  15051.   unsigned year  : 7;     /* binary year for directory entry */
  15052.  
  15053. } FDATE;
  15054.  
  15055. typedef struct _FTIME {       /* ftime */
  15056.  
  15057.   unsigned twosecs : 5;       /* binary number of two-second increments */
  15058.   unsigned minutes : 6;       /* binary number of minutes */
  15059.   unsigned hours   : 5;       /* binary number of hours */
  15060.  
  15061. } FTIME;
  15062.  
  15063. typedef struct _FILEFINDBUF {   /* findbuf */
  15064.  
  15065.   FDATE  fdateCreation;         /* file date of creation */
  15066.   FTIME  ftimeCreation;         /* file time of creation */
  15067.   FDATE  fdateLastAccess;       /* file date of last access */
  15068.   FTIME  ftimeLastAccess;       /* file time of last access */
  15069.   FDATE  fdateLastWrite;        /* file date of last write */
  15070.   FTIME  ftimeLastWrite;        /* file time of last write */
  15071.   ULONG  cbFile;                /* file end of data */
  15072.   ULONG  cbFileAlloc;           /* file allocation */
  15073.   USHORT attrFile;              /* file attribute */
  15074.   UCHAR  cchName;               /* length of ASCIIZ name string */
  15075.   CHAR   achName[CCHMAXPATHCOMP]; /* ASCIIZ name string */
  15076.  
  15077. } FILEFINDBUF;
  15078.  
  15079. typedef struct _FILEFINDBUF2 {   /* findbuf */
  15080.  
  15081.   FDATE  fdateCreation;         /* file date of creation */
  15082.   FTIME  ftimeCreation;         /* file time of creation */
  15083.   FDATE  fdateLastAccess;       /* file date of last access */
  15084.   FTIME  ftimeLastAccess;       /* file time of last access */
  15085.   FDATE  fdateLastWrite;        /* file date of last write */
  15086.   FTIME  ftimeLastWrite;        /* file time of last write */
  15087.   ULONG  cbFile;                /* file end of data */
  15088.   ULONG  cbFileAlloc;           /* file allocation */
  15089.   USHORT attrFile;              /* file attribute */
  15090.   ULONG  cbList;                /* level 2 only field (calculate size of
  15091.                                     buffer) */
  15092.   UCHAR  cchName;               /* length of ASCIIZ name string */
  15093.   CHAR   achName[CCHMAXPATHCOMP]; /* ASCIIZ name string */
  15094.  
  15095. } FILEFINDBUF2;
  15096.  
  15097. typedef struct _GEA {       /* gea */
  15098.  
  15099.   BYTE cbName;            /* name length not including NULL */
  15100.   CHAR szName[1];         /* attribute name */
  15101.  
  15102. } GEA;
  15103.  
  15104. typedef struct _GEALIST {   /* geal */
  15105.  
  15106.   ULONG  cbList;          /* total bytes of structure including full list */
  15107.   GEA list[1];            /* variable length GEA structures */
  15108.  
  15109. } GEALIST;
  15110.  
  15111. typedef struct _FEA {       /* fea */
  15112.  
  15113.   BYTE fEA;               /* flags */
  15114.   BYTE cbName;            /* name length not including NULL */
  15115.   USHORT cbValue;         /* value length */
  15116.  
  15117. } FEA;
  15118.  
  15119. typedef struct _FEALIST {   /* feal */
  15120.  
  15121.   ULONG  cbList;          /* total bytes of structure including full list */
  15122.   FEA list[1];            /* variable length FEA structures */
  15123.  
  15124. } FEALIST;
  15125.  
  15126. typedef struct _EAOP {      /* eaop */
  15127.  
  15128.   PGEALIST fpGEAList;     /* general EA list */
  15129.   PFEALIST fpFEAList;     /* full EA list */
  15130.   ULONG  oError;
  15131.  
  15132. } EAOP;
  15133.  
  15134. #define INCL_DOSFILEMGR
  15135.  
  15136. USHORT  rc = DosFindFirst2(FileName, DirHandle, Attribute, ResultBuf,
  15137.                              ResultBufLen, SearchCount, Reserved);
  15138.  
  15139. PSZ              FileName;      /* File path name */
  15140. PHDIR            DirHandle;     /* Directory search handle */
  15141. USHORT           Attribute;     /* Search attribute */
  15142. PVOID            ResultBuf;     /* Result buffer */
  15143. USHORT           ResultBufLen;  /* Result buffer length *
  15144. PUSHORT          SearchCount;   /* Number of entries to find */
  15145. USHORT           FileInfoLevel; /* File data required */
  15146. ULONG            0;             /* Reserved (must be zero) */
  15147.  
  15148. USHORT           rc;            /* return code */
  15149.  
  15150.  
  15151. ΓòÉΓòÉΓòÉ <hidden> DosFindNext ΓòÉΓòÉΓòÉ
  15152.  
  15153. typedef struct _FDATE {   /* fdate */
  15154.  
  15155.   unsigned day   : 5;     /* binary day for directory entry */
  15156.   unsigned month : 4;     /* binary month for directory entry */
  15157.   unsigned year  : 7;     /* binary year for directory entry */
  15158.  
  15159. } FDATE;
  15160.  
  15161. typedef struct _FTIME {       /* ftime */
  15162.  
  15163.   unsigned twosecs : 5;       /* binary number of two-second increments */
  15164.   unsigned minutes : 6;       /* binary number of minutes */
  15165.   unsigned hours   : 5;       /* binary number of hours */
  15166.  
  15167. } FTIME;
  15168.  
  15169. typedef struct _FILEFINDBUF {   /* findbuf */
  15170.  
  15171.   FDATE  fdateCreation;         /* file date of creation */
  15172.   FTIME  ftimeCreation;         /* file time of creation */
  15173.   FDATE  fdateLastAccess;       /* file date of last access */
  15174.   FTIME  ftimeLastAccess;       /* file time of last access */
  15175.   FDATE  fdateLastWrite;        /* file date of last write */
  15176.   FTIME  ftimeLastWrite;        /* file time of last write */
  15177.   ULONG  cbFile;                /* file end of data */
  15178.   ULONG  cbFileAlloc;           /* file allocation */
  15179.   USHORT attrFile;              /* file attribute */
  15180.   UCHAR  cchName;               /* length of ASCIIZ name string */
  15181.   CHAR   achName[13];           /* ASCIIZ name string */
  15182.  
  15183. } FILEFINDBUF;
  15184.  
  15185. #define INCL_DOSFILEMGR
  15186.  
  15187. USHORT  rc = DosFindNext(DirHandle, ResultBuf, ResultBufLen, SearchCount);
  15188.  
  15189. HDIR             DirHandle;     /* Directory handle */
  15190. PFILEFINDBUF     ResultBuf;     /* Result buffer */
  15191. USHORT           ResultBufLen;  /* Result buffer length */
  15192. PUSHORT          SearchCount;   /* Number of entries to find */
  15193.  
  15194. USHORT           rc;            /* return code */
  15195.  
  15196. Example 
  15197.  
  15198. This example gets the 1st file in the current directory, and then gets the next 
  15199. file. 
  15200.  
  15201. #define INCL_DOSFILEMGR
  15202.  
  15203. #define NORMAL_FILES 0
  15204. #define SEARCH_PATTERN "*.*"
  15205. #define FILE_ATTRIBUTE NORMAL_FILES
  15206. #define RESERVED 0L
  15207.  
  15208. HDIR        FindHandle;
  15209. FILEFINDBUF FindBuffer;
  15210. USHORT      FindCount;
  15211. USHORT      rc;
  15212.  
  15213.    FindHandle = 0x0001;
  15214.    FindCount = 1;
  15215.  
  15216.    if(!DosFindFirst(SEARCH_PATTERN,        /* File pattern */
  15217.                     &FindHandle,           /* Directory search handle */
  15218.                     FILE_ATTRIBUTE,        /* Search attribute */
  15219.                     &FindBuffer,           /* Result buffer */
  15220.                     sizeof(FindBuffer),    /* Result buffer length */
  15221.                     &FindCount,            /* # of entries to find */
  15222.                     RESERVED))             /* Reserved (must be zero) */
  15223.       rc = DosFindNext(FindHandle,         /* Directory handle */
  15224.                        &FindBuffer,        /* Result buffer */
  15225.                        sizeof(FindBuffer), /* Result buffer length */
  15226.                        &FindCount);        /* # of entries to find */
  15227.  
  15228.  
  15229. ΓòÉΓòÉΓòÉ <hidden> DosFlagProcess ΓòÉΓòÉΓòÉ
  15230.  
  15231. #define INCL_DOSSIGNALS
  15232.  
  15233. USHORT  rc = DosFlagProcess(ProcessID, ActionCode, Flagnum, Flagarg);
  15234.  
  15235. PID              ProcessID;     /* Process ID to flag */
  15236. USHORT           ActionCode;    /* Indicate to flag descendants */
  15237. USHORT           Flagnum;       /* Flag number */
  15238. USHORT           Flagarg;       /* Flag argument */
  15239.  
  15240. USHORT           rc;            /* return code */
  15241.  
  15242. Example 
  15243.  
  15244. This example starts a program named 'simple2.exe', and then signals the program 
  15245. with the external flag A. 
  15246.  
  15247. #define INCL_DOSPROCESS
  15248. #define INCL_DOSSIGNALS
  15249.  
  15250. #define PROGRAM_NAME "simple2.exe"
  15251.  
  15252. CHAR        LoadError[100];
  15253. PSZ         Args;
  15254. PSZ         Envs;
  15255. RESULTCODES ReturnCodes;
  15256. USHORT      FlagArg;
  15257. USHORT      rc;
  15258.  
  15259.    FlagArg = 2;
  15260.  
  15261.    if(!DosExecPgm(LoadError,             /* Object name buffer */
  15262.                   sizeof(LoadError),     /* Length of object name buffer */
  15263.                   EXEC_ASYNC,            /* Asynchronous/Trace flags */
  15264.                   Args,                  /* Argument string */
  15265.                   Envs,                  /* Environment string */
  15266.                   &ReturnCodes,          /* Termination codes */
  15267.                   PROGRAM_NAME))         /* Program file name */
  15268.       rc = DosFlagProcess(ReturnCodes.codeTerminate,  /* Process ID to
  15269.                                                           flag */
  15270.                           FLGP_PID,                   /* Indicate to flag
  15271.                                                              descendants */
  15272.                           PFLG_A,                     /* Flag number */
  15273.                           FlagArg);                   /* Flag argument */
  15274.  
  15275. The following example illustrates the use of a user-defined flag to signal 
  15276. time-critical events.  The main thread installs a routine, named 
  15277. FlagA_Handler(), as the signal handler for user-defined Flag A.  It then 
  15278. creates a thread and blocks on a reserved RAM semaphore; this thread obtains 
  15279. its process ID and signals the main thread via Flag A.  The main thread 
  15280. responds by executing the signal handler. 
  15281.  
  15282. #define INCL_DOSPROCESS
  15283. #define INCL_DOSSIGNALS
  15284. #define INCL_DOSERRORS
  15285.  
  15286. #include <os2.h>
  15287.  
  15288. #define TIMEOUT           5000L
  15289.  
  15290. TID         ThreadID;
  15291. BYTE        ThreadStack[4000];
  15292.  
  15293. VOID APIENTRY FlagA_Handler(arg1, arg2)       /* Define signal handler */
  15294.   USHORT      arg1;
  15295.   USHORT      arg2;
  15296. {
  15297.   printf("Handler for Flag A now running.\n");
  15298.   return;
  15299. }
  15300.  
  15301. VOID APIENTRY Thread_A()
  15302. {
  15303.   PIDINFO     PidInfo;
  15304.   USHORT      FlagArg;
  15305.   USHORT      rc;
  15306.  
  15307.   DosGetPID(&PidInfo);
  15308.   printf("Process ID is %d\n", PidInfo.pid);
  15309.   if(!(rc = DosFlagProcess(PidInfo.pid,
  15310.                            FLGP_PID,
  15311.                            PFLG_A,
  15312.                            FlagArg)))
  15313.     printf("FlagA signal sent from ThreadA to main thread.\n");
  15314.   else
  15315.     printf("FlagProcess rc is %d\n", rc)/* Error processing on rc */;
  15316.   DosExit(EXIT_THREAD,                 /* Action Code */
  15317.           RETURN_CODE);                /* Result Code */
  15318.  
  15319. }
  15320.  
  15321. main()
  15322. {
  15323.   ULONG            RamSem = 0L;
  15324.   ULONG far        *RamSemHandle = &RamSem;
  15325.   USHORT           rc;
  15326.  
  15327.   if(!(rc=DosSetSigHandler((PFNSIGHANDLER) FlagA_Handler,
  15328.                            NULL,
  15329.                            NULL,
  15330.                            SIGA_ACCEPT,
  15331.                            SIG_PFLG_A)))
  15332.     printf("Main thread has set FlagA handler.\n");
  15333.   else
  15334.  
  15335.     /* Error processing on rc */;
  15336.   if(!(rc=DosSemRequest(RamSemHandle,
  15337.                         TIMEOUT)))
  15338.     printf("Semaphore obtained.\n");
  15339.   if(!(DosCreateThread((PFNTHREAD) Thread_A,
  15340.                         &ThreadID,
  15341.                         &ThreadStack[3999])))
  15342.     printf("ThreadA created.\n");
  15343.   printf("Main thread will now wait on a Ramsem for a while.\n");
  15344.   if((rc=DosSemRequest(RamSemHandle,
  15345.                        TIMEOUT))
  15346.        == ERROR_INTERRUPT)
  15347.   printf("Main thread interrupted while waiting, rc is %d.\n", rc);
  15348. }
  15349.  
  15350.  
  15351. ΓòÉΓòÉΓòÉ <hidden> DosFreeModule ΓòÉΓòÉΓòÉ
  15352.  
  15353. #define INCL_DOSMODULEMGR
  15354.  
  15355. USHORT  rc = DosFreeModule(ModuleHandle);
  15356.  
  15357. HMODULE          ModuleHandle;  /* Module handle */
  15358.  
  15359. USHORT           rc;            /* return code */
  15360.  
  15361. Example 
  15362.  
  15363. This example tries to load module ABCD. The system searches LIBPATH.  If 
  15364. unsuccessful, the system tries to to load the module from the program's 
  15365. directory (in case the user forgot to update LIBPATH). 
  15366.  
  15367. #define INCL_DOSMODULEMGR
  15368.  
  15369. #define MODULE_NAME "abcd"
  15370. #define FULL_MODULE_NAME "\\nifty\\abcd.dll"
  15371.  
  15372. CHAR    LoadError[100];
  15373. HMODULE ModuleHandle;
  15374. USHORT  rc;
  15375.  
  15376.    if (DosLoadModule(LoadError,                /* Object name buffer */
  15377.                      sizeof(LoadError),        /* Length of object name
  15378.                                                    buffer */
  15379.                      MODULE_NAME,              /* Module name string */
  15380.                      &ModuleHandle) == 2)      /* Module handle */
  15381.       rc = DosLoadModule(LoadError,            /* Object name buffer */
  15382.                          sizeof(LoadError),    /* Length of object name
  15383.                                                    buffer */
  15384.                          FULL_MODULE_NAME,     /* Module name string */
  15385.                          &ModuleHandle);       /* Module handle */
  15386.    rc = DosFreeModule(ModuleHandle);           /* Module handle */
  15387.  
  15388.  
  15389. ΓòÉΓòÉΓòÉ <hidden> DosFreeResource ΓòÉΓòÉΓòÉ
  15390.  
  15391. #define INCL_DOSFREERESOURCE
  15392.  
  15393. USHORT  rc = DosFreeResource(ResAddr);
  15394.  
  15395. PBYTE            ResAddr;       /* Resource address */
  15396.  
  15397. USHORT           rc;            /* return code */
  15398.  
  15399.  
  15400. ΓòÉΓòÉΓòÉ <hidden> DosFreeSeg ΓòÉΓòÉΓòÉ
  15401.  
  15402. #define INCL_DOSMEMMGR
  15403.  
  15404. USHORT  rc = DosFreeSeg(Selector);
  15405.  
  15406. SEL              Selector;      /* Selector */
  15407.  
  15408. USHORT           rc;            /* return code */
  15409.  
  15410. Example 
  15411.  
  15412. This example allocates a segment of 30,250 bytes and then discards the segment. 
  15413.  
  15414. #define INCL_DOSMEMMGR
  15415.  
  15416. #define NUMBER_OF_BYTES 30250
  15417. #define ALLOC_FLAG SEG_GETTABLE
  15418.  
  15419. SEL    Selector;
  15420. USHORT rc;
  15421.  
  15422.    rc = DosAllocSeg(NUMBER_OF_BYTES,     /* # of bytes requested */
  15423.                     &Selector,           /* Selector allocated */
  15424.                     ALLOC_FLAG);         /* Allocation flags */
  15425.    rc = DosFreeSeg(Selector);            /* Segment selector */
  15426.  
  15427.  
  15428. ΓòÉΓòÉΓòÉ <hidden> DosFSAttach ΓòÉΓòÉΓòÉ
  15429.  
  15430. #define INCL_DOSFILEMGR
  15431.  
  15432. USHORT  rc = DosFSAttach(DeviceName, FSDName, DataBuffer, DataBufferLen,
  15433.                           OpFlag, 0);
  15434.  
  15435. PSZ              DeviceName;    /* Device name or drive letter string */
  15436. PSZ              FSDName;       /* FSD name */
  15437. PBYTE            DataBuffer;    /* Attach argument data */
  15438. USHORT           DataBufferLen; /* Buffer length  */
  15439. USHORT           OpFlag;        /* Attach or detach */
  15440. ULONG            0;             /* Reserved (must be zero)  */
  15441.  
  15442. USHORT           rc;            /* return code */
  15443.  
  15444.  
  15445. ΓòÉΓòÉΓòÉ <hidden> DosFSCtl ΓòÉΓòÉΓòÉ
  15446.  
  15447. #define INCL_DOSFILEMGR
  15448.  
  15449. USHORT  rc = DosFSCtl(DataArea, DataLengthMax, DataLength, ParmList,
  15450.                ParmLengthMax, ParmLength, FunctionCode, RouteName,
  15451.                FileHandle, RouteMethod, 0);
  15452.  
  15453. PBYTE           DataArea;       /* Data area  */
  15454. USHORT          DataLengthMax ; /* Data area length */
  15455. PUSHORT         DataLength;     /* Data area length (returned) */
  15456. PBYTE           ParmList;       /* Parameter list */
  15457. USHORT          ParmLengthMax ; /* Parameter list length  */
  15458. PUSHORT         ParmLength;     /* Parameter list length (returned)  */
  15459. USHORT          FunctionCode;   /* Function code  */
  15460. PSZ             RouteName;      /* Path or FSD name */
  15461. HFILE           FileHandle;     /* File handle  */
  15462. USHORT          RouteMethod;    /* Method for routing.  */
  15463. ULONG           0;              /* Reserved (must be zero)  */
  15464.  
  15465. USHORT           rc;            /* return code */
  15466.  
  15467.  
  15468. ΓòÉΓòÉΓòÉ <hidden> DosFSRamSemClear ΓòÉΓòÉΓòÉ
  15469.  
  15470. typedef struct _DOSFSRSEM {   /* dosfsrs */
  15471.  
  15472.   USHORT cb;                  /* Length of this structure (bytes) */
  15473.   PID    pid;                 /* Process ID of owner or zero */
  15474.   TID    tid;                 /* Thread ID of owner or zero */
  15475.   USHORT cUsage;              /* Reference count */
  15476.   USHORT client;              /* 16 bit field for use by owner */
  15477.   ULONG  sem;                 /* OS/2 Ram Semaphore */
  15478.  
  15479. } DOSFSRSEM;
  15480.  
  15481. #define INCL_DOSSEMAPHORES
  15482.  
  15483. USHORT  rc = DosFSRamSemClear(FSRamSemStructure);
  15484.  
  15485. PDOSFSRSEM       FSRamSemStructure;  /* Address of structure */
  15486.  
  15487. USHORT           rc;                 /* return code */
  15488.  
  15489. Example 
  15490.  
  15491. This example requests a FS RAM semaphore and then clears it. 
  15492.  
  15493. #define INCL_DOSSEMAPHORES
  15494.  
  15495. #define NOT_OWNED 0
  15496. #define START 0
  15497. #define START_LONG 0L
  15498. #define TIME_OUT 1000L
  15499.  
  15500. DOSFSRSEM SemStruct;
  15501. USHORT    rc;
  15502.  
  15503.    SemStruct.cb = sizeof(SemStruct);   /* Initialize FS Sem */
  15504.    SemStruct.pid = NOT_OWNED;
  15505.    SemStruct.tid = NOT_OWNED;
  15506.    SemStruct.cUsage = START;
  15507.    SemStruct.client = START;
  15508.    SemStruct.sem = START_LONG;
  15509.  
  15510.    if(!DosFSRamSemRequest(&SemStruct,         /* Address of structure */
  15511.                           TIME_OUT))          /* Timeout */
  15512.       rc = DosFSRamSemClear(&SemStruct);      /* Address of structure */
  15513.  
  15514.  
  15515. ΓòÉΓòÉΓòÉ <hidden> DosFSRamSemRequest ΓòÉΓòÉΓòÉ
  15516.  
  15517. typedef struct _DOSFSRSEM {   /* dosfsrs */
  15518.  
  15519.   USHORT cb;                  /* Length of this structure (bytes) */
  15520.   PID    pid;                 /* Process ID of owner or zero */
  15521.   TID    tid;                 /* Thread ID of owner or zero */
  15522.   USHORT cUsage;              /* Reference count */
  15523.   USHORT client;              /* 16 bit field for use by owner */
  15524.   ULONG  sem;                 /* OS/2 Ram Semaphore */
  15525.  
  15526. } DOSFSRSEM;
  15527.  
  15528. #define INCL_DOSSEMAPHORES
  15529.  
  15530. USHORT  rc = DosFSRamSemRequest(FSRamSemStructure, Timeout);
  15531.  
  15532. PDOSFSRSEM       FSRamSemStructure;  /* Address of structure */
  15533. LONG             Timeout;            /* Timeout (in milliseconds) */
  15534.  
  15535. USHORT           rc;                 /* return code */
  15536.  
  15537. Example 
  15538.  
  15539. This example requests a FS RAM semaphore. 
  15540.  
  15541. #define INCL_DOSSEMAPHORES
  15542.  
  15543. #define NOT_OWNED 0
  15544. #define START 0
  15545. #define START_LONG 0L
  15546. #define TIME_OUT 1000L
  15547.  
  15548. DOSFSRSEM SemStruct;
  15549. USHORT    rc;
  15550.  
  15551.    SemStruct.cb = sizeof(SemStruct);   /* Initialize FS Sem */
  15552.    SemStruct.pid = NOT_OWNED;
  15553.    SemStruct.tid = NOT_OWNED;
  15554.    SemStruct.cUsage = START;
  15555.    SemStruct.client = START;
  15556.    SemStruct.sem = START_LONG;
  15557.  
  15558.    rc = DosFSRamSemRequest(&SemStruct,         /* Address of structure */
  15559.                            TIME_OUT);          /* Timeout */
  15560.  
  15561.  
  15562. ΓòÉΓòÉΓòÉ <hidden> DosGetCollate ΓòÉΓòÉΓòÉ
  15563.  
  15564. typedef struct _COUNTRYCODE {   /* ctryc */
  15565.  
  15566.   USHORT country;               /* country code */
  15567.   USHORT codepage;              /* code page */
  15568.  
  15569. } COUNTRYCODE;
  15570.  
  15571. #define INCL_DOSNLS
  15572.  
  15573. USHORT  rc = DosGetCollate(Length, Structure, MemoryBuffer, DataLength);
  15574.  
  15575. USHORT           Length;        /* Length of data area provided */
  15576. PCOUNTRYCODE     Structure;     /* Input data structure */
  15577. PCHAR            MemoryBuffer;  /* Collate table (returned) */
  15578. PUSHORT          DataLength;    /* Length of collate table (returned) */
  15579.  
  15580. USHORT           rc;            /* return code */
  15581.  
  15582. Example 
  15583.  
  15584. This example gets a collating sequence table for codepage 850 and the current 
  15585. country. 
  15586.  
  15587. #define INCL_DOSNLS
  15588.  
  15589. #define CURRENT_COUNTRY 0
  15590. #define NLS_CODEPAGE 850
  15591.  
  15592. COUNTRYCODE Country;
  15593. CHAR        CollBuffer[256];
  15594. USHORT      Length;
  15595. USHORT      rc;
  15596.  
  15597.    Country.country = CURRENT_COUNTRY;
  15598.    Country.codepage = NLS_CODEPAGE;
  15599.  
  15600.    rc = DosGetCollate(sizeof(CollBuffer),   /* Length of data area
  15601.                                                 provided */
  15602.                       &Country,             /* Input data structure */
  15603.                       CollBuffer,           /* Data area to contain collate
  15604.                                                 table */
  15605.                       &Length);             /* Length of table */
  15606.  
  15607.  
  15608. ΓòÉΓòÉΓòÉ <hidden> DosGetCp ΓòÉΓòÉΓòÉ
  15609.  
  15610. #define INCL_DOSNLS
  15611.  
  15612. USHORT  rc = DosGetCp(Length, CodePageList, DataLength);
  15613.  
  15614. USHORT           Length;        /* Length of list */
  15615. PUSHORT          CodePageList;  /* List (returned) */
  15616. PUSHORT          DataLength;    /* Length of list (returned) */
  15617.  
  15618. USHORT           rc;            /* return code */
  15619.  
  15620. Example 
  15621.  
  15622. This example gets the current code page and then up to 3 other prepared 
  15623. codepages. 
  15624.  
  15625. #define INCL_DOSNLS
  15626.  
  15627. USHORT CpList[8];
  15628. USHORT CpSize;
  15629. USHORT rc;
  15630.  
  15631.    rc = DosGetCp(sizeof(CpList),       /* Length of list */
  15632.                  CpList,               /* List */
  15633.                  &CpSize);             /* Length of returned list */
  15634.  
  15635.  
  15636. ΓòÉΓòÉΓòÉ <hidden> DosGetCtryInfo ΓòÉΓòÉΓòÉ
  15637.  
  15638. typedef struct _COUNTRYCODE {   /* ctryc */
  15639.  
  15640.   USHORT country;               /* country code */
  15641.   USHORT codepage;              /* code page */
  15642.  
  15643. } COUNTRYCODE;
  15644.  
  15645. typedef struct _COUNTRYINFO {   /* ctryi */
  15646.  
  15647.   USHORT country;                   /* country code */
  15648.   USHORT codepage;                  /* code page */
  15649.   USHORT fsDateFmt;                 /* date format */
  15650.   CHAR   szCurrency[5];             /* currency indicator */
  15651.   CHAR   szThousandsSeparator[2];   /* thousands separator */
  15652.   CHAR   szDecimal[2];              /* decimal separator *  /
  15653.   CHAR   szDateSeparator[2];        /* date separator */
  15654.   CHAR   szTimeSeparator[2];        /* time separator */
  15655.   UCHAR  fsCurrencyFmt;             /* bit fields for currency format */
  15656.   UCHAR  cDecimalPlace;             /* currency decimal places */
  15657.   UCHAR  fsTimeFmt;                 /* Time format (AM/PM or 24 hr) */
  15658.   USHORT abReserved1[2];            /* reserved (0) */
  15659.   CHAR   szDataSeparator[2];        /* Data list separator */
  15660.   USHORT abReserved2[5];            /* reserved (0) */
  15661.  
  15662. } COUNTRYINFO;
  15663.  
  15664. #define INCL_DOSNLS
  15665.  
  15666. USHORT  rc = DosGetCtryInfo(Length, Structure, MemoryBuffer, DataLength);
  15667.  
  15668. USHORT           Length;        /* Length of data area provided */
  15669. PCOUNTRYCODE     Structure;     /* Input data structure */
  15670. PCOUNTRYINFO     MemoryBuffer;  /* Country information (returned) */
  15671. PUSHORT          DataLength;    /* Length of data (returned) */
  15672.  
  15673. USHORT           rc;            /* return code */
  15674.  
  15675. Example 
  15676.  
  15677. This example gets country-dependent information. 
  15678.  
  15679. #define INCL_DOSNLS
  15680.  
  15681. #define CURRENT_COUNTRY 0
  15682. #define NLS_CODEPAGE 850
  15683.  
  15684. COUNTRYCODE Country;
  15685. COUNTRYINFO CtryBuffer;
  15686. USHORT      Length;
  15687. USHORT      rc;
  15688.  
  15689.    Country.country = CURRENT_COUNTRY;
  15690.    Country.codepage = NLS_CODEPAGE;
  15691.  
  15692.    rc = DosGetCtryInfo(sizeof(CtryBuffer),       /* Length of data area
  15693.                                                      provided */
  15694.                        &Country,                 /* Input data structure */
  15695.                        &CtryBuffer,              /* Data area to be filled
  15696.                                                          by function */
  15697.                        &Length);                 /* Length of data
  15698.                                                          returned */
  15699.  
  15700.  
  15701. ΓòÉΓòÉΓòÉ <hidden> DosGetDateTime ΓòÉΓòÉΓòÉ
  15702.  
  15703. typedef struct _DATETIME {  /* date */
  15704.  
  15705.   UCHAR   hours;            /* current hour */
  15706.   UCHAR   minutes;          /* current minute */
  15707.   UCHAR   seconds;          /* current second */
  15708.   UCHAR   hundredths;       /* current hundredths of a second */
  15709.   UCHAR   day;              /* current day */
  15710.   UCHAR   month;            /* current month */
  15711.   USHORT  year;             /* current year */
  15712.   SHORT   timezone;         /* minutes of time west of UTC */
  15713.   UCHAR   weekday;          /* current day of week */
  15714.  
  15715. } DATETIME;
  15716.  
  15717. #define INCL_DOSDATETIME
  15718.  
  15719. USHORT  rc = DosGetDateTime(DateTime);
  15720.  
  15721. PDATETIME        DateTime;      /* Address of date/time structure
  15722.                                     (returned) */
  15723.  
  15724. USHORT           rc;            /* return code */
  15725.  
  15726. Example 
  15727.  
  15728. This example gets the current time and date. 
  15729.  
  15730. #define INCL_DOSDATETIME
  15731.  
  15732. DATETIME DateBuffer;
  15733. USHORT   rc;
  15734.  
  15735.    rc = DosGetDateTime(&DateBuffer);        /* Date/Time structure */
  15736.  
  15737. The following example obtains and prints date and time information. It then 
  15738. changes the system date to 5/10/1987 and prints the updated information. 
  15739.  
  15740. #define INCL_DOSDATETIME
  15741.  
  15742. #include <os2.h>
  15743.  
  15744. main()
  15745. {
  15746.   DATETIME   DateTime;       /* Structure to hold date/time info. */
  15747.   USHORT     rc;
  15748.  
  15749.   rc = DosGetDateTime(&DateTime);     /* Address of d/t structure */
  15750.   printf("Today is %d-%d-%d; the time is %d:%d\n", DateTime.month,
  15751.          DateTime.day, DateTime.year, DateTime.hours, DateTime.minutes);
  15752.   DateTime.day = 10;
  15753.   DateTime.month = 5;
  15754.   DateTime.year = 1987;
  15755.   printf("The new date is %d-%d-%d; the time is %d:%d\n", DateTime.month,
  15756.          DateTime.day, DateTime.year, DateTime.hours, DateTime.minutes);
  15757.   rc = DosSetDateTime(&DateTime);    /* Address of d/t structure */
  15758.   printf("rc is %d\n", rc);
  15759.  }
  15760.  
  15761.  
  15762. ΓòÉΓòÉΓòÉ <hidden> DosGetDBCSEv ΓòÉΓòÉΓòÉ
  15763.  
  15764. typedef struct _COUNTRYCODE {   /* ctryc */
  15765.  
  15766.   USHORT country;               /* country code */
  15767.   USHORT codepage;              /* code page */
  15768.  
  15769. } COUNTRYCODE;
  15770.  
  15771. #define INCL_DOSNLS
  15772.  
  15773. USHORT  rc = DosGetDBCSEv(Length, Structure, MemoryBuffer);
  15774.  
  15775. USHORT           Length;        /* Length of data area provided */
  15776. PCOUNTRYCODE     Structure;     /* Input data structure */
  15777. PCHAR            MemoryBuffer;  /* DBCS environmental vector (returned) *
  15778.  
  15779. USHORT           rc;            /* return code */
  15780.  
  15781.  
  15782. ΓòÉΓòÉΓòÉ <hidden> DosGetEnv ΓòÉΓòÉΓòÉ
  15783.  
  15784. #define INCL_DOSMISC
  15785.  
  15786. USHORT  rc = DosGetEnv(EnvSegment, CmdOffset);
  15787.  
  15788. PUSHORT          EnvSegment;    /* Selector (returned) */
  15789. PUSHORT          CmdOffset;     /* Command line offset (returned) */
  15790.  
  15791. USHORT           rc;            /* return code */
  15792.  
  15793. Example 
  15794.  
  15795. The following example shows how one may obtain information for program 
  15796. initialization.  The program locates the environment segment and prints the 
  15797. name of the command from the command line.  It then obtains the OS/2 version 
  15798. number and prints it. 
  15799.  
  15800. #define INCL_DOS
  15801.  
  15802. #include <os2.h>
  15803.  
  15804. #define ENVVARNAME "PATH"
  15805.  
  15806. main()
  15807. {
  15808.   SEL       EnvSel;              /* Environment segment selector
  15809.                                      (returned) */
  15810.   USHORT    CmdOffset;           /* Offset into env. seg. of command line
  15811.                                      (returned) */
  15812.   PSZ FAR   *Commandline;        /* Pointer made by EnvSel and CmdOffset */
  15813.   USHORT    Version;             /* Version numbers (returned) */
  15814.   BYTE      MajorVer;            /* Major version number */
  15815.   BYTE      MinorVer;            /* Minor version number */
  15816.   USHORT    rc;                  /* return code */
  15817.  
  15818.   /** Locate environment segment and offset of command line. **/
  15819.   if(!(rc=DosGetEnv(&EnvSel,       /* Env. seg. selector (returned) */
  15820.                     &CmdOffset)))  /* Offset of command line
  15821.                                            (returned) */
  15822.     printf("Environment located; selector is %x offset is %x\n", EnvSel,
  15823.             CmdOffset);
  15824.  
  15825.   /** Use a macro to make a far pointer out of selector:offset pair.**/
  15826.   /** Notice the far-string pointer specification (%Fs) used to print **/
  15827.  
  15828.   Commandline = MAKEP(EnvSel, CmdOffset);
  15829.   printf("Command entered is %Fs.\n", Commandline);
  15830.  
  15831.   /** Obtain and print version info; use macros to extract info. **/
  15832.   /** We need to divide by 10 to obtain true version numbers.    **/
  15833.  
  15834.   if(!(rc=DosGetVersion(&Version)))
  15835.   {
  15836.     MajorVer = HIBYTE(Version) / 10;
  15837.     MinorVer = LOBYTE(Version) / 10;
  15838.     printf("This is OS/2 version %d.%d\n", MajorVer, MinorVer);
  15839.   }
  15840. }
  15841.  
  15842.  
  15843. ΓòÉΓòÉΓòÉ <hidden> DosGetHugeShift ΓòÉΓòÉΓòÉ
  15844.  
  15845. #define INCL_DOSMEMMGR
  15846.  
  15847. USHORT  rc = DosGetHugeShift(ShiftCount);
  15848.  
  15849. PUSHORT          ShiftCount;    /* Shift Count (returned) */
  15850.  
  15851. USHORT           rc;            /* return code */
  15852.  
  15853.  
  15854. ΓòÉΓòÉΓòÉ <hidden> DosGetInfoSeg ΓòÉΓòÉΓòÉ
  15855.  
  15856. typedef struct _GINFOSEG {
  15857.  
  15858.   ULONG   time;               /* time in seconds */
  15859.   ULONG   msecs;              /* milliseconds    */
  15860.   UCHAR   hour;               /* hours */
  15861.   UCHAR   minutes;            /* minutes */
  15862.   UCHAR   seconds;            /* seconds */
  15863.   UCHAR   hundredths;         /* hundredths */
  15864.   USHORT  timezone;           /* minutes from UTC */
  15865.   USHORT  cusecTimerInterval; /* timer interval (units = 0.0001 seconds) */
  15866.   UCHAR   day;                /* day */
  15867.   UCHAR   month;              /* month */
  15868.   USHORT  year;               /* year */
  15869.   UCHAR   weekday;            /* day of week */
  15870.   UCHAR   uchMajorVersion;    /* major version number */
  15871.   UCHAR   uchMinorVersion;    /* minor version number */
  15872.   UCHAR   chRevisionLetter;   /* revision letter */
  15873.   UCHAR   sgCurrent;          /* current foreground session */
  15874.   UCHAR   sgMax;              /* maximum number of sessions */
  15875.   UCHAR   cHugeShift;         /* shift count for huge elements */
  15876.   UCHAR   fProtectModeOnly;   /* protect mode only indicator */
  15877.   USHORT  pidForeground;      /* pid of last process in foreground
  15878.                                   session */
  15879.   UCHAR   fDynamicSched;      /* dynamic variation flag */
  15880.   UCHAR   csecMaxWait;        /* max wait in seconds */
  15881.   USHORT  cmsecMinSlice;      /* minimum timeslice (milliseconds) */
  15882.   USHORT  cmsecMaxSlice;      /* maximum timeslice (milliseconds) */
  15883.   USHORT  bootdrive;          /* drive from which the system was booted */
  15884.   UCHAR   amecRAS[32];        /* system trace major code
  15885.                                             flag bits */
  15886.   UCHAR   csgWindowableVioMax;/* maximum number of VIO windowable
  15887.                                   sessions */
  15888.   UCHAR   csgPMMax;           /* maximum number of pres. services
  15889.                                   sessions */
  15890.  
  15891. } GINFOSEG;
  15892.  
  15893. typedef struct _LINFOSEG {
  15894.  
  15895.   PID     pidCurrent;        /* current process id */
  15896.   PID     pidParent;         /* process id of parent */
  15897.   USHORT  prtyCurrent;       /* priority of current thread */
  15898.   TID     tidCurrent;        /* thread ID of current thread */
  15899.   USHORT  sgCurrent;         /* session */
  15900.   UCHAR   rfProcStatus;      /* process status */
  15901.   UCHAR   dummy1;
  15902.   BOOL    fForeground;       /* current process has keyboard focus */
  15903.   UCHAR   typeProcess;       /* process type */
  15904.   UCHAR   dummy2;
  15905.   SEL     selEnvironment;    /* environment selector */
  15906.   USHORT  offCmdLine;        /* command line offset */
  15907.   USHORT  cbDataSegment;     /* length of data segment */
  15908.   USHORT  cbStack;           /* stack size */
  15909.   USHORT  cbHeap;            /* heap size */
  15910.   HMODULE hmod;              /* module handle of the application */
  15911.   SEL     selDS;             /* data segment handle of the application */
  15912. } LINFOSEG;
  15913.  
  15914.  
  15915. #define INCL_DOSINFOSEG
  15916.  
  15917. USHORT  rc = DosGetInfoSeg(GlobalSeg, LocalSeg);
  15918.  
  15919. PSEL             GlobalSeg;     /* Address to place global segment
  15920.                                     (selector) */
  15921. PSEL             LocalSeg;      /* Address to place local segment
  15922.                                     (selector) */
  15923.  
  15924. USHORT           rc;            /* return code */
  15925.  
  15926.  
  15927. ΓòÉΓòÉΓòÉ <hidden> DosGetMachineMode ΓòÉΓòÉΓòÉ
  15928.  
  15929. #define INCL_DOSQUEUES
  15930.  
  15931. USHORT  rc = DosGetMachineMode(MachineMode);
  15932.  
  15933. PBYTE            MachineMode;   /* Processor mode (returned) */
  15934.  
  15935. USHORT           rc;            /* return code /*/
  15936.  
  15937.  
  15938. ΓòÉΓòÉΓòÉ <hidden> DosGetMessage ΓòÉΓòÉΓòÉ
  15939.  
  15940. #define INCL_DOSMISC
  15941.  
  15942. USHORT  rc = DosGetMessage(IvTable, IvCount, DataArea, DataLength,
  15943.                              MsgNumber, FileName, MsgLength);
  15944.  
  15945. PCHAR FAR *      IvTable;       /* Table of variables to insert */
  15946. USHORT           IvCount;       /* Number of variables */
  15947. PCHAR            DataArea;      /* Message buffer (returned) */
  15948. USHORT           DataLength;    /* Length of buffer */
  15949. USHORT           MsgNumber;     /* Number of the message */
  15950. PSZ              FileName;      /* Message file path name string */
  15951. PUSHORT          MsgLength;     /* Length of message (returned) */
  15952.  
  15953. USHORT           rc;            /* return code */
  15954.  
  15955.  
  15956. ΓòÉΓòÉΓòÉ <hidden> DosGetModHandle ΓòÉΓòÉΓòÉ
  15957.  
  15958. #define INCL_DOSMODULEMGR
  15959.  
  15960. USHORT  rc = DosGetModHandle(ModuleName, ModuleHandle);
  15961.  
  15962. PSZ              ModuleName;    /* Module name string */
  15963. PHMODULE         ModuleHandle;  /* Module handle (returned) */
  15964.  
  15965. USHORT           rc;            /* return code */
  15966.  
  15967.  
  15968. ΓòÉΓòÉΓòÉ <hidden> DosGetModName ΓòÉΓòÉΓòÉ
  15969.  
  15970. #define INCL_DOSMODULEMGR
  15971.  
  15972. USHORT  rc = DosGetModName(ModuleHandle, BufferLength, Buffer);
  15973.  
  15974. HMODULE          ModuleHandle;  /* Module handle */
  15975. USHORT           BufferLength;  /* Buffer length */
  15976. PCHAR            Buffer;        /* Buffer (returned) */
  15977.  
  15978. USHORT           rc;            /* return code */
  15979.  
  15980.  
  15981. ΓòÉΓòÉΓòÉ <hidden> DosGetPID ΓòÉΓòÉΓòÉ
  15982.  
  15983. typedef struct _PIDINFO {   /* pidi */
  15984.  
  15985.   PID pid;                  /* current process' process ID */
  15986.   TID tid;                  /* current process' thread ID */
  15987.   PID pidParent;            /* process ID of the parent */
  15988.  
  15989. } PIDINFO;
  15990.  
  15991. #define INCL_DOSPROCESS
  15992.  
  15993. USHORT  rc = DosGetPID(ProcessIDsArea);
  15994.  
  15995. PPIDINFO         ProcessIDsArea; /* Process IDs (returned) */
  15996.  
  15997. USHORT           rc;             /* return code */
  15998.  
  15999. Example 
  16000.  
  16001. The following example demonstrates how to create a process, obtain process ID 
  16002. information, and kill a process.  Process1 invokes process2 to run 
  16003. asynchronously.  It obtains and prints some PID information, and then kills 
  16004. process2. 
  16005.  
  16006. /* ---- process1.c ---- */
  16007.  
  16008. #define INCL_DOSPROCESS
  16009.  
  16010. #include <os2.h>
  16011.  
  16012. #define START_PROGRAM "process2.exe"   /* Program pointer */
  16013.  
  16014. main()
  16015. {
  16016.  
  16017.   CHAR          ObjFail [50];       /* Object name buffer */
  16018.   RESULTCODES   ReturnCodes;        /*
  16019.   PIDINFO       PidInfo;
  16020.   PID           ParentID;           /*
  16021.   USHORT        rc;
  16022.  
  16023.   printf("Process1 now running. \n");
  16024.  
  16025.   /** Start a child process. **/
  16026.   if(!(DosExecPgm(ObjFail,            /* Object name buffer */
  16027.                   sizeof(ObjFail),    /* Length of obj. name buffer */
  16028.                   EXEC_ASYNC,         /* Execution flag - asynchronous */
  16029.                   NULL,               /* No args. to pass to process2*/
  16030.                   NULL,               /* Process2 inherits process1's
  16031.                                           environment */
  16032.                   &ReturnCodes,       /* Ptr. to resultcodes struct. */
  16033.                   START_PROGRAM)))    /* Name of program file */
  16034.     printf("Process2 started. \n");
  16035.  
  16036.   /** Obtain Process ID information and print it **/
  16037.   if(!(rc=DosGetPID(&PidInfo)))       /* Process ID's (returned) */
  16038.     printf("DosGetPID: current process ID is %d; thread ID is %d; parent process ID is %d.\n",
  16039.             PidInfo.pid, PidInfo.tid, PidInfo.pidParent);
  16040.   if(!(rc=DosGetPPID(
  16041.            ReturnCodes.codeTerminate, /* Process whose parent is wanted */
  16042.            &ParentID)))               /* Address to put parent's PID */
  16043.     printf("Child process ID is %d; Parent process ID is %d.\n",
  16044.             ReturnCodes.codeTerminate, ParentID);
  16045.  
  16046.   /** Terminate process2 **/
  16047.   if(!(rc=DosKillProcess(DKP_PROCESSTREE,     /* Action code - kill process
  16048.                                                      and descendants */
  16049.                 ReturnCodes.codeTerminate)))  /* PID of root of process tree */
  16050.     printf("Process2 terminated by process1.\n");
  16051.  
  16052. }
  16053.  
  16054.  
  16055. /* ---- process2.c ---- */
  16056.  
  16057. #define INCL_DOSPROCESS
  16058.  
  16059. #include <os2.h>
  16060.  
  16061. #define SLEEPTIME   500L
  16062. #define RETURN_CODE 0
  16063.  
  16064. main()
  16065. {
  16066.   printf("Process2 now running.\n");
  16067.  
  16068.   /* Sleep to allow process1 to kill it */
  16069.   DosSleep(SLEEPTIME);                /* Sleep interval */
  16070.   DosExit(EXIT_PROCESS,               /* Action Code */
  16071.           RETURN_CODE);               /* Result Code */
  16072. }
  16073.  
  16074.  
  16075. ΓòÉΓòÉΓòÉ <hidden> DosGetPPID ΓòÉΓòÉΓòÉ
  16076.  
  16077. #define INCL_DOSPROCESS
  16078.  
  16079. USHORT  rc = DosGetPPID(PID, PPID);
  16080.  
  16081. USHORT           PID;           /* Process whose parent is wanted */
  16082. PUSHORT          PPID;          /* Address to put parent's PID */
  16083.  
  16084. USHORT           rc;            /* return code */
  16085.  
  16086. Example 
  16087.  
  16088. The following example demonstrates how to create a process, obtain process ID 
  16089. information, and kill a process.  Process1 invokes process2 to run 
  16090. asynchronously.  It obtains and prints some PID information, and then kills 
  16091. process2. 
  16092.  
  16093. /* ---- process1.c ---- */
  16094.  
  16095. #define INCL_DOSPROCESS
  16096.  
  16097. #include <os2.h>
  16098.  
  16099. #define START_PROGRAM "process2.exe"   /* Program pointer */
  16100.  
  16101. main()
  16102. {
  16103.   CHAR          ObjFail [50];       /* Object name buffer */
  16104.   RESULTCODES   ReturnCodes;        /*
  16105.   PIDINFO       PidInfo;
  16106.   PID           ParentID;           /*
  16107.   USHORT        rc;
  16108.  
  16109.   printf("Process1 now running. \n");
  16110.  
  16111.   /** Start a child process. **/
  16112.   if(!(DosExecPgm(ObjFail,            /* Object name buffer */
  16113.                   sizeof(ObjFail),    /* Length of obj. name buffer */
  16114.                   EXEC_ASYNC,         /* Execution flag - asynchronous */
  16115.                   NULL,               /* No args. to pass to process2*/
  16116.                   NULL,               /* Process2 inherits process1's
  16117.                                           environment */
  16118.                   &ReturnCodes,       /* Ptr. to resultcodes struct. */
  16119.                   START_PROGRAM)))    /* Name of program file */
  16120.     printf("Process2 started. \n");
  16121.  
  16122.   /** Obtain Process ID information and print it **/
  16123.   if(!(rc=DosGetPID(&PidInfo)))       /* Process ID's (returned) */
  16124.     printf("DosGetPID: current process ID is %d; thread ID is %d; parent process ID is %d.\n",
  16125.             PidInfo.pid, PidInfo.tid, PidInfo.pidParent);
  16126.   if(!(rc=DosGetPPID(
  16127.            ReturnCodes.codeTerminate, /* Process whose parent is wanted */
  16128.            &ParentID)))               /* Address to put parent's PID */
  16129.     printf("Child process ID is %d; Parent process ID is %d.\n",
  16130.             ReturnCodes.codeTerminate, ParentID);
  16131.  
  16132.   /** Terminate process2 **/
  16133.   if(!(rc=DosKillProcess(DKP_PROCESSTREE,     /* Action code - kill process
  16134.                                                       and descendants */
  16135.                 ReturnCodes.codeTerminate)))  /* PID of root of process tree */
  16136.     printf("Process2 terminated by process1.\n");
  16137. }
  16138.  
  16139. /* ---- process2.c ---- */
  16140.  
  16141. #define INCL_DOSPROCESS
  16142.  
  16143. #include <os2.h>
  16144.  
  16145. #define SLEEPTIME   500L
  16146. #define RETURN_CODE 0
  16147.  
  16148. main()
  16149. {
  16150.   printf("Process2 now running.\n");
  16151.  
  16152.   /* Sleep to allow process1 to kill it */
  16153.   DosSleep(SLEEPTIME);                /* Sleep interval */
  16154.   DosExit(EXIT_PROCESS,               /* Action Code */
  16155.           RETURN_CODE);               /* Result Code */
  16156. }
  16157.  
  16158.  
  16159. ΓòÉΓòÉΓòÉ <hidden> DosGetProcAddr ΓòÉΓòÉΓòÉ
  16160.  
  16161. #define INCL_DOSMODULEMGR
  16162.  
  16163. USHORT  rc = DosGetProcAddr(ModuleHandle, ProcName, ProcAddress);
  16164.  
  16165. HMODULE          ModuleHandle;  /* Module handle */
  16166. PSZ              ProcName;      /* Module name string */
  16167. PFN FAR *        ProcAddress;   /* Procedure address (returned) */
  16168.  
  16169. USHORT           rc;            /* return code */
  16170.  
  16171.  
  16172. ΓòÉΓòÉΓòÉ <hidden> DosGetPrty ΓòÉΓòÉΓòÉ
  16173.  
  16174. #define INCL_DOSPROCESS
  16175.  
  16176. USHORT  rc = DosGetPrty(Scope, Priority, ID);
  16177.  
  16178. USHORT           Scope;         /* Indicate scope of query */
  16179. PUSHORT          Priority;      /* Address to put priority (returned) */
  16180. USHORT           ID;            /* Process or thread ID */
  16181.  
  16182. USHORT           rc;            /* return code */
  16183.  
  16184. Example 
  16185.  
  16186. The following example illustrates how to obtain the priority of a thread and 
  16187. how to change the priority.  The main thread creates Thread2 and allows it to 
  16188. begin executing.  Thread2  iterates through a loop that prints a line and then 
  16189. sleeps, relinquishing its time slice to the main thread. After one or two 
  16190. iterations by Thread2, the main thread obtains Thread2's priority information 
  16191. and prints it.  It then raises Thread2's priority to fixed-high, and increments 
  16192. the level by ten.  Since Thread2 is now at a high priority, it immediately 
  16193. finishes its remaining iterations before relinquishing control on a long sleep; 
  16194. at this point, the main thread re-examines Thread2's priority and reports its 
  16195. new priority level.  In this example, it is helpful to understand how the 
  16196. DosSleep calls are used either to relinquish control of the processor, or to 
  16197. keep a thread alive (see DosTimerAsync or DosTimerStart for alternatives to 
  16198. DosSleep). 
  16199.  
  16200. #define INCL_DOSPROCESS
  16201.  
  16202. #include <os2.h>
  16203.  
  16204. #define      PRTYC_FIXEDHIGH   4         /* Priority class: fixed-high */
  16205. #define      PRTY_DELTA        10        /* Priority delta: increase
  16206.                                                 by 10 */
  16207. #define      SEGSIZE           4000      /* Number of bytes requested in
  16208.                                              segment */
  16209. #define      ALLOCFLAGS        0         /* Segment allocation flags - no
  16210.                                              sharing */
  16211. #define      SLEEPSHORT        0L        /* Sleep interval -
  16212.                                              5 milliseconds */
  16213. #define      SLEEPLONG         20L       /* Sleep interval -
  16214.                                              75 milliseconds */
  16215. #define      RETURN_CODE       0         /* Return code for DosExit() */
  16216.  
  16217.  
  16218. VOID APIENTRY Thread2()
  16219. {
  16220.   USHORT     i;
  16221.  
  16222.   /* Loop with four iterations */
  16223.   for(i=1; i<5; i++)
  16224.   {
  16225.     printf("In Thread2, i is now %d\n", i);
  16226.  
  16227.     /** Sleep to relinquish time slice to main thread **/
  16228.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  16229.   }
  16230.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  16231.           RETURN_CODE);            /* Return code */
  16232. }
  16233.  
  16234. main()
  16235. {
  16236.   USHORT     Priority;            /* Thread priority */
  16237.   USHORT     Class;               /* Priority class */
  16238.   USHORT     Level;               /* Priority level */
  16239.   SEL        ThreadStackSel;      /* Segment selector for thread stack */
  16240.   PBYTE      StackEnd;            /* Ptr. to end of thread stack */
  16241.   USHORT     rc;
  16242.  
  16243.   /* Allocate segment for thread stack; this is better than just */
  16244.   /* declaring an array of bytes to use as a stack.  Make pointer eos. */
  16245.  
  16246.   rc = DosAllocSeg(SEGSIZE,                    /* Number of bytes
  16247.                                                    requested */
  16248.                    &ThreadStackSel,            /* Segment selector
  16249.                                                    (returned) */
  16250.                    ALLOCFLAGS);                /* Allocation flags */
  16251.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  16252.  
  16253.   /* Start Thread2 */
  16254.   if(!(DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  16255.                        &ThreadID,              /* Thread ID (returned) */
  16256.                        StackEnd)))             /* End of thread stack */
  16257.     printf("Thread2 created.\n");
  16258.  
  16259.   /** Sleep to allow Thread2 to execute **/
  16260.   if(!(DosSleep(SLEEPLONG)))                       /* Sleep interval */
  16261.     printf("Slept a little to let Thread2 execute.\n");
  16262.  
  16263.   /** Obtain Thread2's priority information and report it **/
  16264.   if(!(rc=DosGetPrty(PRTYS_THREAD,                /* Scope - single
  16265.                                                          thread */
  16266.                      &Priority,                   /* Address to put
  16267.                                                           priority */
  16268.                      ThreadID)))                  /* ID - thread ID */
  16269.   {
  16270.     /* Extract priority class and level information */
  16271.     Class = HIBYTE(Priority);
  16272.     Level = LOBYTE(Priority);
  16273.     printf("Thread2: ID is %d, Priority Class is %d and Level is %d\n",
  16274.            ThreadID, Class, Level);
  16275.   }
  16276.   /** Raise Thread2's priority **/
  16277.   if(!(rc=DosSetPrty(PRTYS_THREAD,             /* Scope - single thread */
  16278.                      PRTYC_FIXEDHIGH,          /* Prty class - fixed-high */
  16279.                      PRTY_DELTA,               /* Prty delta - increase
  16280.                                                       by 10 */
  16281.                      ThreadID)))               /* ID - thread ID */
  16282.   {
  16283.     /* Obtain Thread2' new priority information and report it */
  16284.     rc=DosGetPrty(PRTYS_THREAD,                /* Scope - single thread */
  16285.                   &Priority,                   /* Address to put
  16286.                                                        priority */
  16287.                   ThreadID);                   /* ID - thread ID */
  16288.  
  16289.     /* Extract priority class and level information */
  16290.     Class = HIBYTE(Priority);
  16291.     Level = LOBYTE(Priority);
  16292.     printf("Thread2: ID is %d, New Priority Class is %d and Level is %d\n",
  16293.            ThreadID, Class, Level);
  16294.   }
  16295. }
  16296.  
  16297.  
  16298. ΓòÉΓòÉΓòÉ <hidden> DosGetResource ΓòÉΓòÉΓòÉ
  16299.  
  16300. #define INCL_DOSRESOURCES
  16301.  
  16302. USHORT  rc = DosGetResource(ModHandle, TypeID, NameID, Selector);
  16303.  
  16304. HMODULE          ModHandle;     /* Module handle to get resource from */
  16305. USHORT           TypeID;        /* 16 bit resource type ID */
  16306. USHORT           NameID;        /* 16 bit resource name ID */
  16307. PSEL             Selector;      /* where to return selector */
  16308.  
  16309. USHORT           rc;            /* return code */
  16310.  
  16311.  
  16312. ΓòÉΓòÉΓòÉ <hidden> DosGetResource2 ΓòÉΓòÉΓòÉ
  16313.  
  16314. #define INCL_DOSRESOURCES2
  16315.  
  16316. USHORT  rc = DosGetResource2(ModHandle, TypeID, NameID, ResAddr);
  16317.  
  16318. HMODULE          ModHandle;     /* Module handle to get resource from */
  16319. USHORT           TypeID;        /* 16 bit resource type ID */
  16320. USHORT           NameID;        /* 16 bit resource name ID */
  16321. PULONG           ResAddr;       /* where to return resource address */
  16322.  
  16323. USHORT           rc;            /* return code */
  16324.  
  16325.  
  16326. ΓòÉΓòÉΓòÉ <hidden> DosGetSeg ΓòÉΓòÉΓòÉ
  16327.  
  16328. #define INCL_DOSMEMMGR
  16329.  
  16330. USHORT  rc = DosGetSeg(Selector);
  16331.  
  16332. SEL              Selector;      /*Selector to access */
  16333.  
  16334. USHORT           rc;            /* return code */
  16335.  
  16336.  
  16337. ΓòÉΓòÉΓòÉ <hidden> DosGetShrSeg ΓòÉΓòÉΓòÉ
  16338.  
  16339. #define INCL_DOSMEMMGR
  16340.  
  16341. USHORT  rc = DosGetShrSeg(Name, Selector);
  16342.  
  16343. PSZ              Name;          /* Name string */
  16344. PSEL             Selector;      /* Selector of shared segment */
  16345.  
  16346. USHORT           rc;            /* return code /*
  16347.  
  16348.  
  16349. ΓòÉΓòÉΓòÉ <hidden> DosGetVersion ΓòÉΓòÉΓòÉ
  16350.  
  16351. #define INCL_DOSMISC
  16352.  
  16353. USHORT  rc = DosGetVersion(VersionWord);
  16354.  
  16355. PUSHORT          VersionWord;   /* Version number (returned) */
  16356.  
  16357. USHORT           rc;            /* return code */
  16358.  
  16359. Example 
  16360.  
  16361. The following example shows how one may obtain information for program 
  16362. initialization.  The program locates the environment segment and prints the 
  16363. name of the command from the command line.  It then obtains the OS/2 version 
  16364. number and prints it. 
  16365.  
  16366. #define INCL_DOS
  16367.  
  16368. #include <os2.h>
  16369.  
  16370. #define ENVVARNAME "PATH"
  16371.  
  16372. main()
  16373. {
  16374.   SEL       EnvSel;              /* Environment segment selector
  16375.                                      (returned) */
  16376.   USHORT    CmdOffset;           /* Offset into env. seg. of command line
  16377.                                      (returned) */
  16378.   PSZ FAR   *Commandline;        /* Pointer made by EnvSel and CmdOffset */
  16379.   USHORT    Version;             /* Version numbers (returned) */
  16380.   BYTE      MajorVer;            /* Major version number */
  16381.   BYTE      MinorVer;            /* Minor version number */
  16382.   USHORT    rc;                  /* return code */
  16383.  
  16384.   /** Locate environment segment and offset of command line. **/
  16385.  
  16386.   if(!(rc=DosGetEnv(&EnvSel,       /* Env. seg. selector (returned) */
  16387.                     &CmdOffset)))  /* Offset of command line
  16388.                                            (returned) */
  16389.     printf("Environment located; selector is %x offset is %x\n", EnvSel,
  16390.             CmdOffset);
  16391.  
  16392.   /** Use a macro to make a far pointer out of selector:offset pair.**/
  16393.   /** Notice the far-string pointer specification (%Fs) used to print **/
  16394.  
  16395.   Commandline = MAKEP(EnvSel, CmdOffset);
  16396.   printf("Command entered is %Fs.\n", Commandline);
  16397.  
  16398.   /** Obtain and print version info; use macros to extract info. **/
  16399.   /** We need to divide by 10 to obtain true version numbers.    **/
  16400.  
  16401.   if(!(rc=DosGetVersion(&Version)))
  16402.   {
  16403.     MajorVer = HIBYTE(Version) / 10;
  16404.     MinorVer = LOBYTE(Version) / 10;
  16405.     printf("This is OS/2 version %d.%d\n", MajorVer, MinorVer);
  16406.   }
  16407. }
  16408.  
  16409.  
  16410. ΓòÉΓòÉΓòÉ <hidden> DosGiveSeg ΓòÉΓòÉΓòÉ
  16411.  
  16412. #define INCL_DOSMEMMGR
  16413.  
  16414. USHORT  rc = DosGiveSeg(CallerSegSelector, ProcessID, RecipientSegSelector);
  16415.  
  16416. SEL           CallerSegSelector;    /* Caller's segment selector */
  16417. PID           ProcessID;            /* Process ID of recipient */
  16418. PSEL          RecipientSegSelector; /* Recipient's segment selector
  16419.                                         (returned) */
  16420.  
  16421. USHORT        rc;                   /* return code */
  16422.  
  16423.  
  16424. ΓòÉΓòÉΓòÉ <hidden> DosHoldSignal ΓòÉΓòÉΓòÉ
  16425.  
  16426. #define INCL_DOSSIGNALS
  16427.  
  16428. USHORT  rc = DosHoldSignal(ActionCode);
  16429.  
  16430. USHORT           ActionCode;    /* Indicate to Disable/Enable Signals */
  16431.  
  16432. USHORT           rc;            /* return code */
  16433.  
  16434. Example 
  16435.  
  16436. The following example illustrates the use of the Ctrl-C (SIGINTR) signal to 
  16437. signal time-critical events.  Process1 invokes process2, which establishes a 
  16438. signal handler named CtrlC_Handler() and waits, by blocking on a reserved RAM 
  16439. semaphore, for a signal from process1. A portion of process2 is immune to 
  16440. signalling. 
  16441.  
  16442.  
  16443. #define INCL_DOSPROCESS
  16444. #define INCL_DOSSIGNALS
  16445.  
  16446. #include <os2.h>
  16447.  
  16448. #define SLEEPTIME       200L              /* Sleep interval */
  16449. #define START_PROGRAM   "process2.exe"    /* Program name */
  16450.  
  16451.  
  16452. main()
  16453. {
  16454.   CHAR          ObjFail[50];
  16455.   PSZ           Args;
  16456.   PSZ           Envs;
  16457.   RESULTCODES   ReturnCodes;
  16458.   USHORT        rc;
  16459.  
  16460.   /* Start process2 and check its PID */
  16461.   if(!(DosExecPgm(ObjFail,               /* Object name buffer */
  16462.                   sizeof(ObjFail),       /* Length of obj. name buffer */
  16463.                   EXEC_ASYNC,            /* Execution flag */
  16464.                   Args,                  /* Ptr. to argument string */
  16465.                   Envs,                  /* Ptr. to environment string */
  16466.                   &ReturnCodes,          /* Ptr. to resultcodes struct.*/
  16467.                   START_PROGRAM)))       /* Name of program file */
  16468.     printf("Process2 started.\n");
  16469.   printf("Process2 ID is %d\n", ReturnCodes.codeTerminate);
  16470.  
  16471.   /* Sleep to give time slice to process2 */
  16472.   DosSleep(SLEEPTIME);                   /* Sleep interval */
  16473.  
  16474.   /*** After process2 sets signal handler, send process2 a signal ***/
  16475.   if(!(rc = DosSendSignal(ReturnCodes.codeTerminate,  /* PID of process2 */
  16476.                           SIG_CTRLC)))                /* Signal to send*/
  16477.     printf("Ctrl-C signal sent from Process1 to Process2.\n");
  16478. }
  16479.  
  16480. /* ----- process2.c ----- */
  16481.  
  16482. #define INCL_DOSPROCESS
  16483. #define INCL_DOSSIGNALS
  16484. #define INCL_DOSERRORS
  16485.  
  16486. #include <os2.h>
  16487.  
  16488. #define SLEEPTIME         50L
  16489. #define TIMEOUT           5000L
  16490.  
  16491.  
  16492. VOID APIENTRY CtrlC_Handler(arg1, arg2)    /** Define signal handler **/
  16493.   USHORT      arg1;
  16494.   USHORT      arg2;
  16495. {
  16496.   printf("Handler for Ctrl-C now running.\n");
  16497.   return;
  16498. }
  16499.  
  16500. main()
  16501. {
  16502.   ULONG            RamSem = 0L;   /* Allocate and initialize Ram
  16503.                                       Semaphore */
  16504.   ULONG far        *RamSemHandle = &RamSem;  /* Ram Semaphore handle */
  16505.   USHORT           rc;
  16506.  
  16507.   /* Establish signal handler */
  16508.   if(!(rc=DosSetSigHandler((PFNSIGHANDLER) CtrlC_Handler,
  16509.                            NULL,          /* Previous handler - ignored */
  16510.                            NULL,          /* Previous action - ignored */
  16511.                            SIGA_ACCEPT,   /* Request type */
  16512.                            SIG_CTRLC)))   /* Signal number */
  16513.     printf("Process2 has set Ctrl-C handler.\n");
  16514.   else
  16515.  
  16516.     /* Error processing on rc */;
  16517.   /* Get semaphore for first time */
  16518.   if(!(rc=DosSemRequest(RamSemHandle,       /* Semaphore handle */
  16519.                         TIMEOUT)))          /* Timeout interval */
  16520.     printf("Semaphore obtained.\n");
  16521.  
  16522.   /*** Disable and then enable signal-handling ***/
  16523.   if(!(rc=DosHoldSignal(HLDSIG_DISABLE)))   /** Action code - disable **/
  16524.   {
  16525.     printf("Signalling DISABLED.\n");
  16526.  
  16527.     /* Do signal-proof work here */
  16528.     if(!(rc=DosHoldSignal(HLDSIG_ENABLE)))  /** Action code - enable **/
  16529.       printf("Signalling ENABLED.\n");
  16530.   }
  16531.   /* At this point, process1 may have sent a Ctrl-C signal. */
  16532.   /* Try to obtain semaphore again -- resulting in Timeout. */
  16533.   /* The Timeout, however, may be interrupted by the signal. */
  16534.  
  16535.   printf("Process2 will now wait on a Ramsem for a while.\n");
  16536.   if((rc=DosSemRequest(RamSemHandle,     /* Semaphore handle */
  16537.                        TIMEOUT))         /* Timeout interval */
  16538.      == ERROR_INTERRUPT)
  16539.   printf("Process2 interrupted while waiting, rc is %d.\n", rc);
  16540. }
  16541.  
  16542.  
  16543. ΓòÉΓòÉΓòÉ <hidden> DosInsMessage ΓòÉΓòÉΓòÉ
  16544.  
  16545. #define INCL_DOSMISC
  16546.  
  16547. USHORT  rc = DosInsMessage(IvTable, IvCount, MsgInput, MsgInLength,
  16548.                              DataArea, DataLength, MsgLength);
  16549.  
  16550. PCHAR FAR *      IvTable;       /* Table of variables to insert */
  16551. USHORT           IvCount;       /* Number of variables */
  16552. PSZ              MsgInput;      /* Address of input message */
  16553. USHORT           MsgInLength;   /* Length of input message */
  16554. PCHAR            DataArea;      /* Updated message (returned) */
  16555. USHORT           DataLength;    /* Length of updated message buffer */
  16556. PUSHORT          MsgLength;     /* Length of updated message (returned) */
  16557.  
  16558. USHORT           rc;            /* return code */
  16559.  
  16560.  
  16561. ΓòÉΓòÉΓòÉ <hidden> DosKillProcess ΓòÉΓòÉΓòÉ
  16562.  
  16563. #define INCL_DOSPROCESS
  16564.  
  16565. USHORT  rc = DosKillProcess(ActionCode, ProcessID);
  16566.  
  16567. USHORT           ActionCode;    /* Indicate to flag descendant processes */
  16568. PID              ProcessID;     /* ID of process or root of process tree */
  16569.  
  16570. USHORT           rc;            /* return code */
  16571.  
  16572. Example 
  16573.  
  16574. The following example demonstrates how to create a process, obtain process ID 
  16575. information, and kill a process.  Process1 invokes process2 to run 
  16576. asynchronously.  It obtains and prints some PID information, and then kills 
  16577. process2. 
  16578.  
  16579. /* ---- process1.c ---- */
  16580.  
  16581. #define INCL_DOSPROCESS
  16582.  
  16583. #include <os2.h>
  16584.  
  16585. #define START_PROGRAM "process2.exe"   /* Program pointer */
  16586.  
  16587. main()
  16588. {
  16589.   CHAR          ObjFail [50];       /* Object name buffer */
  16590.   RESULTCODES   ReturnCodes;        /*
  16591.   PIDINFO       PidInfo;
  16592.   PID           ParentID;           /*
  16593.   USHORT        rc;
  16594.  
  16595.   printf("Process1 now running. \n");
  16596.  
  16597.   /** Start a child process. **/
  16598.   if(!(DosExecPgm(ObjFail,            /* Object name buffer */
  16599.                   sizeof(ObjFail),    /* Length of obj. name buffer */
  16600.                   EXEC_ASYNC,         /* Execution flag - asynchronous */
  16601.                   NULL,               /* No args. to pass to process2*/
  16602.                   NULL,               /* Process2 inherits process1's
  16603.                                           environment */
  16604.                   &ReturnCodes,       /* Ptr. to resultcodes struct. */
  16605.                   START_PROGRAM)))    /* Name of program file */
  16606.     printf("Process2 started. \n");
  16607.  
  16608.   /** Obtain Process ID information and print it **/
  16609.   if(!(rc=DosGetPID(&PidInfo)))       /* Process ID's (returned) */
  16610.     printf("DosGetPID: current process ID is %d; thread ID is %d; parent process ID is %d.\n",
  16611.             PidInfo.pid, PidInfo.tid, PidInfo.pidParent);
  16612.   if(!(rc=DosGetPPID(
  16613.            ReturnCodes.codeTerminate, /* Process whose parent is wanted */
  16614.            &ParentID)))               /* Address to put parent's PID */
  16615.     printf("Child process ID is %d; Parent process ID is %d.\n",
  16616.             ReturnCodes.codeTerminate, ParentID);
  16617.  
  16618.   /** Terminate process2 **/
  16619.   if(!(rc=DosKillProcess(DKP_PROCESSTREE,     /* Action code - kill process
  16620.                                                       and descendants */
  16621.                 ReturnCodes.codeTerminate)))  /* PID of root of process tree */
  16622.     printf("Process2 terminated by process1.\n");
  16623. }
  16624.  
  16625.  
  16626. /* ---- process2.c ---- */
  16627.  
  16628. #define INCL_DOSPROCESS
  16629.  
  16630. #include <os2.h>
  16631.  
  16632. #define SLEEPTIME   500L
  16633. #define RETURN_CODE 0
  16634.  
  16635. main()
  16636. {
  16637.   printf("Process2 now running.\n");
  16638.  
  16639.   /* Sleep to allow process1 to kill it */
  16640.   DosSleep(SLEEPTIME);                /* Sleep interval */
  16641.   DosExit(EXIT_PROCESS,               /* Action Code */
  16642.           RETURN_CODE);               /* Result Code */
  16643. }
  16644.  
  16645.  
  16646. ΓòÉΓòÉΓòÉ <hidden> DosLoadModule ΓòÉΓòÉΓòÉ
  16647.  
  16648. #define INCL_DOSMODULEMGR
  16649.  
  16650. USHORT  rc = DosLoadModule(ObjNameBuf, ObjNameBufL, ModuleName,
  16651.                             ModuleHandle);
  16652.  
  16653. PSZ              ObjNameBuf;    /* Address of object name buffer */
  16654. USHORT           ObjNameBufL;   /* Length of object name buffer */
  16655. PSZ              ModuleName;    /* Address of module name string */
  16656. PHMODULE         ModuleHandle;  /* Address of module handle (returned) */
  16657.  
  16658. USHORT           rc;            /* return code */
  16659.  
  16660. Example 
  16661.  
  16662. This example loads a module. 
  16663.  
  16664. #define INCL_DOSMODULEMGR
  16665.  
  16666. #define MODULE_NAME "abcd"
  16667. #define FULL_MODULE_NAME "\\nifty\\abcd.dll"
  16668.  
  16669. CHAR    LoadError[100];
  16670. HMODULE ModuleHandle;
  16671. USHORT  rc;
  16672.  
  16673.    if (DosLoadModule(LoadError,                /* Object name buffer */
  16674.                      sizeof(LoadError),        /* Length of object name
  16675.                                                    buffer */
  16676.                      MODULE_NAME,              /* Module name string */
  16677.                      &ModuleHandle) == 2)      /* Module handle */
  16678.  
  16679.  
  16680. ΓòÉΓòÉΓòÉ <hidden> DosLockSeg ΓòÉΓòÉΓòÉ
  16681.  
  16682. #define INCL_DOSMEMMGR
  16683.  
  16684. USHORT  rc = DosLockSeg(Selector);
  16685.  
  16686. SEL              Selector;      /* Selector to lock */
  16687.  
  16688. USHORT           rc;            /* return code */
  16689.  
  16690.  
  16691. ΓòÉΓòÉΓòÉ <hidden> DosMakeNmPipe ΓòÉΓòÉΓòÉ
  16692.  
  16693. #define INCL_DOSNMPIPES
  16694.  
  16695. USHORT  rc = DosMakeNmPipe(PipeName, PipeHandle, OpenMode, PipeMode,
  16696.                              OutBufSize, InBufSize, TimeOut);
  16697.  
  16698. PSZ              PipeName;      /* Pipe name */
  16699. PHPIPE           PipeHandle;    /* Pipe handle (returned) */
  16700. USHORT           OpenMode;      /* DOS open mode of pipe */
  16701. USHORT           PipeMode;      /* Pipe open mode */
  16702. USHORT           OutBufSize;    /* Advisory outgoing buffer size */
  16703. USHORT           InBufSize;     /* Advisory incoming buffer size */
  16704. ULONG            TimeOut;       /* Timeout for DosWaitNmPipe */
  16705.  
  16706. USHORT           rc;            /* return code */
  16707.  
  16708.  
  16709. ΓòÉΓòÉΓòÉ <hidden> DosMakePipe ΓòÉΓòÉΓòÉ
  16710.  
  16711. #define INCL_DOSQUEUES
  16712.  
  16713. USHORT  rc = DosMakePipe(ReadHandle, WriteHandle, PipeSize);
  16714.  
  16715. PHFILE           ReadHandle;    /* Address to put read handle (returned) */
  16716. PHFILE           WriteHandle;   /* Address to put write handle (returned) */
  16717. USHORT           PipeSize;      /* Size to reserve for the pipe */
  16718.  
  16719. USHORT           rc;            /* return code */
  16720.  
  16721.  
  16722. ΓòÉΓòÉΓòÉ <hidden> DosMemAvail ΓòÉΓòÉΓòÉ
  16723.  
  16724. #define INCL_DOSMEMMGR
  16725.  
  16726. USHORT  rc = DosMemAvail(MemAvailSize);
  16727.  
  16728. PULONG           MemAvailSize;  /* Size available (returned) */
  16729.  
  16730. USHORT           rc;            /* return code */
  16731.  
  16732.  
  16733. ΓòÉΓòÉΓòÉ <hidden> DosMkDir ΓòÉΓòÉΓòÉ
  16734.  
  16735. #define INCL_DOSFILEMGR
  16736.  
  16737. USHORT  rc = DosMkDir(DirName, Reserved);
  16738.  
  16739. PSZ              DirName;       /* New directory string name */
  16740. ULONG            0;             /* Reserved (must be zero) */
  16741.  
  16742. USHORT           rc;            /* return code */
  16743.  
  16744.  
  16745. ΓòÉΓòÉΓòÉ <hidden> DosMkDir2 ΓòÉΓòÉΓòÉ
  16746.  
  16747. typedef struct _GEA {       /* gea */
  16748.  
  16749.   BYTE cbName;            /* name length not including NULL */
  16750.   CHAR szName[1];         /* attribute name */
  16751.  
  16752. } GEA;
  16753.  
  16754. typedef struct _GEALIST {   /* geal */
  16755.  
  16756.   ULONG  cbList;          /* total bytes of structure including full list */
  16757.   GEA list[1];            /* variable length GEA structures */
  16758.  
  16759. } GEALIST;
  16760.  
  16761. typedef struct _FEA {       /* fea */
  16762.  
  16763.   BYTE fEA;               /* flags */
  16764.   BYTE cbName;            /* name length not including NULL */
  16765.   USHORT cbValue;         /* value length */
  16766.  
  16767. } FEA;
  16768.  
  16769. typedef struct _FEALIST {   /* feal */
  16770.  
  16771.   ULONG  cbList;          /* total bytes of structure including full list */
  16772.   FEA list[1];            /* variable length FEA structures */
  16773.  
  16774. } FEALIST;
  16775.  
  16776. typedef struct _EAOP {      /* eaop */
  16777.  
  16778.   PGEALIST fpGEAList;     /* general EA list */
  16779.   PFEALIST fpFEAList;     /* full EA list */
  16780.   ULONG  oError;
  16781.  
  16782. } EAOP;
  16783.  
  16784. #define INCL_DOSFILEMGR
  16785.  
  16786. USHORT  rc = DosMkDir2(DirName, EABuf, Reserved);
  16787.  
  16788. PSZ              DirName;       /* New directory name string */
  16789. PEAOP            EABuf;         /* Extended attribute buffer */
  16790. ULONG            0;             /* Reserved (must be zero) */
  16791.  
  16792. USHORT           rc;            /* return code */
  16793.  
  16794.  
  16795. ΓòÉΓòÉΓòÉ <hidden> DosMonClose ΓòÉΓòÉΓòÉ
  16796.  
  16797. #define INCL_DOSMONITORS
  16798.  
  16799. USHORT  rc = DosMonClose(Handle);
  16800.  
  16801. HMONITOR         Handle;        /* Monitor handle */
  16802.  
  16803. USHORT           rc;            /* return code */
  16804.  
  16805.  
  16806. ΓòÉΓòÉΓòÉ <hidden> DosMonOpen ΓòÉΓòÉΓòÉ
  16807.  
  16808. #define INCL_DOSMONITORS
  16809.  
  16810. USHORT  rc = DosMonOpen(Devname, Handle);
  16811.  
  16812. PSZ              Devname;       /* Device name string */
  16813. PHMONITOR        Handle;        /* Monitor handle (returned) *
  16814.  
  16815. USHORT           rc;            /* return code */
  16816.  
  16817.  
  16818. ΓòÉΓòÉΓòÉ <hidden> DosMonRead ΓòÉΓòÉΓòÉ
  16819.  
  16820. #define INCL_DOSMONITORS
  16821.  
  16822. USHORT  rc = DosMonRead(BufferI, WaitFlag, DataBuffer, Bytecnt);
  16823.  
  16824. PBYTE            BufferI;       /* Monitor input buffer */
  16825. UCHAR            WaitFlag;      /* Block/Run indicator */
  16826. PBYTE            DataBuffer;    /* Buffer into which records are read */
  16827. PUSHORT          Bytecnt;       /* Input/output parm-#bytes (returned) */
  16828.  
  16829. USHORT           rc;            /* return code */
  16830.  
  16831.  
  16832. ΓòÉΓòÉΓòÉ <hidden> DosMonReg ΓòÉΓòÉΓòÉ
  16833.  
  16834. #define INCL_DOSMONITORS
  16835.  
  16836. USHORT  rc = DosMonReg(Handle, BufferI, BufferO, Posflag, Index);
  16837.  
  16838. HMONITOR         Handle;        /* Monitor handle */
  16839. PBYTE            BufferI;       /* Input buffer */
  16840. PBYTE            BufferO;       /* Output buffer */
  16841. USHORT           Posflag;       /* Position flag */
  16842. USHORT           Index;         /* Index */
  16843.  
  16844. USHORT           rc;            /* return code */
  16845.  
  16846.  
  16847. ΓòÉΓòÉΓòÉ <hidden> DosMonWrite ΓòÉΓòÉΓòÉ
  16848.  
  16849. #define INCL_DOSMONITORS
  16850.  
  16851. USHORT  rc = DosMonWrite(BufferO, DataBuffer, Bytecnt);
  16852.  
  16853. PBYTE            BufferO;       /* Monitor output buffer */
  16854. PBYTE            DataBuffer;    /* Buffer from which records are taken */
  16855. USHORT           Bytecnt;       /* Number of bytes */
  16856.  
  16857. USHORT           rc;            /* return code */
  16858.  
  16859.  
  16860. ΓòÉΓòÉΓòÉ <hidden> DosMove ΓòÉΓòÉΓòÉ
  16861.  
  16862. #define INCL_DOSFILEMGR
  16863.  
  16864. USHORT  rc = DosMove(OldPathName, NewPathName, Reserved);
  16865.  
  16866. PSZ              OldPathName;   /* Old path name string */
  16867. PSZ              NewPathName;   /* New path name string */
  16868. ULONG            0;             /* Reserved (must be zero) */
  16869.  
  16870. USHORT           rc;            /* return code */
  16871.  
  16872.  
  16873. ΓòÉΓòÉΓòÉ <hidden> DosMuxSemWait ΓòÉΓòÉΓòÉ
  16874.  
  16875. typedef struct _MUXSEMLIST {   /* mxsl */
  16876.  
  16877.   USHORT  cmxs;                /* count of MuxSem structures */
  16878.   MUXSEM  amxs[16];            /* MuxSem structure */
  16879.  
  16880. } MUXSEMLIST;
  16881.  
  16882. typedef struct _MUXSEM {    /* mxs */
  16883.  
  16884.   USHORT zero;              /* zero */
  16885.   HSEM   hsem;              /* semaphore handle */
  16886.  
  16887. } MUXSEM;
  16888.  
  16889. #define INCL_DOSSEMAPHORES
  16890.  
  16891. USHORT  rc = DosMuxSemWait(IndexNbr, ListAddr, Timeout);
  16892.  
  16893. PUSHORT          IndexNbr;      /* Index number of event (returned) */
  16894. PVOID            ListAddr;      /* Semaphore list */
  16895. LONG             Timeout;       /* Timeout (in milliseconds) */
  16896.  
  16897. USHORT           rc;            /* return code */
  16898.  
  16899. Example 
  16900.  
  16901. The following example illustrates notification of events between threads of the 
  16902. same process. The main thread sets two RAM semaphores and invokes two threads, 
  16903. each of which clears one of the semaphores.  Meanwhile, the main thread waits 
  16904. for either of the two semaphores to clear, and then resumes execution, 
  16905. indicating the thread that notified first. 
  16906.  
  16907. #define INCL_DOSPROCESS
  16908. #define INCL_DOSSEMAPHORES
  16909.  
  16910. #include<os2.h>
  16911. #include<stdio.h>
  16912.  
  16913. #define NUM_SEMS         2       /* Number of semaphores to wait on */
  16914. #define TIMEOUT          2000L   /* Timeout period */
  16915. #define SLEEPTIME        1000L   /* Sleep period for Thread_1 */
  16916. #define RETURN_CODE      0       /* Return Code for thread termination */
  16917.  
  16918. ULONG       RamSem1 = 0L;        /* Allocation and initialization of   */
  16919. ULONG       RamSem2 = 0L;        /*  two RAM semaphores                */
  16920. ULONG far   *RamSem1Handle = &RamSem1;  /* Semaphore handles */
  16921. ULONG far   *RamSem2Handle = &RamSem2;
  16922. TID         ThreadID[2];         /* Thread Identification */
  16923. BYTE        ThreadStack1[4000];  /* Thread Stack Area */
  16924. BYTE        ThreadStack2[4000];
  16925. MUXSEMLIST  SemList;             /* Semaphore list structure */
  16926. USHORT      IndexNbr;            /* Index number for DosMuxSemWait */
  16927. USHORT      rc;                  /* Return Code */
  16928.  
  16929. VOID APIENTRY Thread_1()
  16930. {
  16931.   USHORT r;
  16932.  
  16933.   printf("Begin Thread_1. It will sleep for 1 second. \n");
  16934.  
  16935.   /* Give Thread_2 a chance to execute */
  16936.   DosSleep(SLEEPTIME);                 /* Sleep Interval */
  16937.   if(!(r=DosSemClear(RamSem1Handle)))  /* Semaphore handle */
  16938.     printf("RamSem1 cleared. \n");
  16939.   DosExit(EXIT_THREAD,                 /* Action Code */
  16940.           RETURN_CODE);                /* Result Code */
  16941. }
  16942.  
  16943. VOID APIENTRY Thread_2()
  16944. {
  16945.   USHORT r;
  16946.  
  16947.   printf("Begin Thread_2. It will try to clear RamSem2 now. \n");
  16948.   if(!(r=DosSemClear(RamSem2Handle)))  /* Semaphore Handle */
  16949.     printf("RamSem2 cleared. \n");
  16950.   DosExit(EXIT_THREAD,                 /* Action Code */
  16951.           RETURN_CODE);                /* Result Code */
  16952. }
  16953.  
  16954. main()
  16955. {
  16956.   USHORT  rc;                          /* Return Code */
  16957.  
  16958.   /* Set both semaphores */
  16959.   if(!(rc=DosSemSet(RamSem1Handle)))   /* Semaphore Handle */
  16960.     printf("RamSem1 set. \n");
  16961.   if(!(rc=DosSemSet(RamSem2Handle)))   /* Semaphore Handle */
  16962.     printf("RamSem2 set. \n");
  16963.  
  16964.   /* Initialize Semaphore list structure */
  16965.   SemList.cmxs = NUM_SEMS;             /* Number of semaphores */
  16966.   SemList.amxs[0].zero = 0;            /* This field must be 0 */
  16967.   SemList.amxs[1].zero = 0;            /* This field must be 0 */
  16968.   SemList.amxs[0].hsem = RamSem1Handle;  /* Semaphore handle */
  16969.   SemList.amxs[1].hsem = RamSem2Handle;  /* Semaphore handle */
  16970.  
  16971.   /* Start the two threads */
  16972.   if(!(DosCreateThread((PFNTHREAD) Thread_1,   /* Thread address */
  16973.                        &ThreadID[0],           /* Thread ID
  16974.                                                                  (returned) */
  16975.                        &ThreadStack1[3999])))  /* End of thread
  16976.                                                                  stack */
  16977.     printf("Thread_1 created. \n");
  16978.   if(!(DosCreateThread((PFNTHREAD) Thread_2,   /* Thread address */
  16979.                        &ThreadID[1],           /* Thread ID
  16980.                                                                  (returned) */
  16981.                        &ThreadStack2[3999])))  /* End of thread
  16982.                                                                  stack */
  16983.     printf("Thread_2 created. \n");
  16984.  
  16985.   /* Wait for either semaphore to clear; then, indicate which */
  16986.   /*   thread notified first.                                 */
  16987.  
  16988.   if(!(DosMuxSemWait(&IndexNbr,    /* Index of semaphore   */
  16989.                                    /*   cleared (returned) */
  16990.                      &SemList,     /* Address of sem. list structure */
  16991.                      TIMEOUT)))    /* Timeout period */
  16992.     printf("Back to main thread; semaphore cleared by Thread%d.\n",
  16993.            IndexNbr + 1);
  16994.   }
  16995. }
  16996.  
  16997.  
  16998. ΓòÉΓòÉΓòÉ <hidden> DosNewSize ΓòÉΓòÉΓòÉ
  16999.  
  17000. #define INCL_DOSFILEMGR
  17001.  
  17002. USHORT  rc = DosNewSize(FileHandle, FileSize);
  17003.  
  17004. HFILE            FileHandle;    /* File handle */
  17005. ULONG            FileSize;      /* File's new size */
  17006.  
  17007. USHORT           rc;            /* return code */
  17008.  
  17009.  
  17010. ΓòÉΓòÉΓòÉ <hidden> DosOpen ΓòÉΓòÉΓòÉ
  17011.  
  17012. #define INCL_DOSFILEMGR
  17013.  
  17014. USHORT  rc = DosOpen(FileName, FileHandle, ActionTaken, FileSize,
  17015.                              FileAttribute, OpenFlag, OpenMode, Reserved);
  17016.  
  17017. PSZ              FileName;      /* File path name string */
  17018. PHFILE           FileHandle;    /* File handle (returned) */
  17019. PUSHORT          ActionTaken;   /* Action taken (returned) */
  17020. ULONG            FileSize;      /* File primary allocation */
  17021. USHORT           FileAttribute; /* File Attribute */
  17022. USHORT           OpenFlag;      /* Open function type */
  17023. USHORT           OpenMode;      /* Open mode of the file */
  17024. ULONG            0;             /* Reserved (must be zero) */
  17025.  
  17026. USHORT           rc;            /* return code */
  17027.  
  17028. Example 
  17029.  
  17030. This example opens a file. 
  17031.  
  17032. #define INCL_DOSFILEMGR
  17033.  
  17034. #define OPEN_FILE 0x01
  17035. #define CREATE_FILE 0x10
  17036. #define FILE_ARCHIVE 0x20
  17037. #define FILE_EXISTS OPEN_FILE
  17038. #define FILE_NOEXISTS CREATE_FILE
  17039. #define DASD_FLAG 0
  17040. #define INHERIT 0x80
  17041. #define WRITE_THRU 0
  17042. #define FAIL_FLAG 0
  17043. #define SHARE_FLAG 0x10
  17044. #define ACCESS_FLAG 0x02
  17045.  
  17046. #define FILE_NAME "test.dat"
  17047. #define FILE_SIZE 800L
  17048. #define FILE_ATTRIBUTE FILE_ARCHIVE
  17049. #define RESERVED 0L
  17050.  
  17051. HFILE   FileHandle;
  17052. USHORT  Wrote;
  17053. USHORT  Action;
  17054. PSZ     FileData[100];
  17055. USHORT  rc;
  17056.  
  17057.    Action = 2;
  17058.    strcpy(FileData, "Data...");
  17059.    rc = DosOpen(FILE_NAME,                /* File path name */
  17060.                 &FileHandle,             /* File handle */
  17061.                 &Action,                 /* Action taken */
  17062.                 FILE_SIZE,               /* File primary allocation */
  17063.                 FILE_ATTRIBUTE,          /* File attribute */
  17064.                 FILE_EXISTS | FILE_NOEXISTS,           /* Open function
  17065.                                                                  type */
  17066.                 DASD_FLAG | INHERIT |            /* Open mode of the file */
  17067.                 WRITE_THRU | FAIL_FLAG |
  17068.                 SHARE_FLAG | ACCESS_FLAG,
  17069.                 RESERVED);               /* Reserved (must be zero) */
  17070.  
  17071.  
  17072. ΓòÉΓòÉΓòÉ <hidden> DosOpen2 ΓòÉΓòÉΓòÉ
  17073.  
  17074. typedef struct _GEA {       /* gea */
  17075.  
  17076.   BYTE cbName;            /* name length not including NULL */
  17077.   CHAR szName[1];         /* attribute name */
  17078.  
  17079. } GEA;
  17080.  
  17081. typedef struct _GEALIST {   /* geal */
  17082.  
  17083.   ULONG  cbList;          /* total bytes of structure including full list */
  17084.   GEA list[1];            /* variable length GEA structures */
  17085.  
  17086. } GEALIST;
  17087.  
  17088. typedef struct _FEA {       /* fea */
  17089.  
  17090.   BYTE fEA;               /* flags */
  17091.   BYTE cbName;            /* name length not including NULL */
  17092.   USHORT cbValue;         /* value length */
  17093.  
  17094. } FEA;
  17095.  
  17096. typedef struct _FEALIST {   /* feal */
  17097.  
  17098.   ULONG  cbList;          /* total bytes of structure including full list */
  17099.   FEA list[1];            /* variable length FEA structures */
  17100.  
  17101. } FEALIST;
  17102.  
  17103. typedef struct _EAOP {      /* eaop */
  17104.  
  17105.   PGEALIST fpGEAList;     /* general EA list */
  17106.   PFEALIST fpFEAList;     /* full EA list */
  17107.   ULONG  oError;
  17108.  
  17109. } EAOP;
  17110.  
  17111. #define INCL_DOSFILEMGR
  17112.  
  17113. USHORT  rc = DosOpen2(FileName, FileHandle, ActionTaken, FileSize,
  17114.                              FileAttribute, OpenFlag, OpenMode, EABuf,
  17115.                              Reserved);
  17116.  
  17117. PSZ              FileName;      /* File path name string */
  17118. PHFILE           FileHandle;    /* File handle (returned) */
  17119. PUSHORT          ActionTaken;   /* Action taken (returned) */
  17120. ULONG            FileSize;      /* File primary allocation */
  17121. USHORT           FileAttribute; /* File Attribute */
  17122. USHORT           OpenFlag;      /* Open function type */
  17123. ULONG            OpenMode;      /* Open mode of the file */
  17124. PEAOP            EABuf;         /* Extended attribute buffer */
  17125. ULONG            0;             /* Reserved (must be zero) */
  17126.  
  17127. USHORT           rc;            /* return code */
  17128.  
  17129.  
  17130. ΓòÉΓòÉΓòÉ <hidden> DosOpenQueue ΓòÉΓòÉΓòÉ
  17131.  
  17132. #define INCL_DOSQUEUES
  17133.  
  17134. USHORT  rc = DosOpenQueue(OwnerPID, QueueHandle, QueueName);
  17135.  
  17136. PUSHORT          OwnerPID;      /* Address to put queue owners' PID */
  17137. PHQUEUE          QueueHandle;   /* Address to put handle of queue */
  17138. PSZ              QueueName;     /* Pointer to queue name string */
  17139.  
  17140. USHORT           rc;            /* return code */
  17141.  
  17142.  
  17143. ΓòÉΓòÉΓòÉ <hidden> DosOpenSem ΓòÉΓòÉΓòÉ
  17144.  
  17145. #define INCL_DOSSEMAPHORES
  17146.  
  17147. USHORT  rc = DosOpenSem(SemHandle, SemName);
  17148.  
  17149. PHSEM            SemHandle;     /* Semaphore handle (returned) */
  17150. PSZ              SemName;       /* Semaphore name string */
  17151.  
  17152. USHORT           rc;            /* return code */
  17153.  
  17154. Example 
  17155.  
  17156. The following example illustrates the notification of an event between threads 
  17157. of different processes.  Process1 creates a nonexclusive system semaphore named 
  17158. process1.sem and sets it.  It then invokes process2 to run asynchronously. 
  17159. Process1 then waits, with a timeout of 4.5 seconds, for process2 to open the 
  17160. semaphore and clear it, thereby notifying process1 to resume. Notice that there 
  17161. is a small possibility of process1 missing the notification because process2 
  17162. may clear the semaphore before process1 issues DosSemWait. See the example for 
  17163. DosSemSetWait for an alternative that would correct this. 
  17164.  
  17165. /* ----- process1.c ---- */
  17166.  
  17167. #define INCL_DOSSEMAPHORES
  17168. #define INCL_DOSPROCESS
  17169.  
  17170. #include <os2.h>
  17171.  
  17172.  
  17173. #define SEM_NAME "\\SEM\\process1.sem" /* Semaphore name */
  17174. #define TIMEOUT 4500L                  /* Timeout period */
  17175. #define START_PROGRAM "process2.exe"   /* Name of program file */
  17176.  
  17177. main()
  17178. {
  17179.   HSEM          SemHandle;
  17180.   CHAR          ObjFail [50];
  17181.   PSZ           Args;
  17182.   PSZ           Envs;
  17183.   RESULTCODES   ReturnCodes;
  17184.   USHORT        rc;
  17185.  
  17186.   printf("Process1 now running. \n");
  17187.   rc = DosCreateSem(CSEM_PUBLIC,       /* Ownership - nonexclusive */
  17188.                     &SemHandle,        /* Semaphore handle (returned) */
  17189.                     SEM_NAME);         /* Semaphore name string */
  17190.   printf("Process1.sem created; return code is %d \n", rc);
  17191.  
  17192.   /*** SET the semaphore. ***/
  17193.   if((rc = DosSemSet(SemHandle)))      /* Semaphore handle */
  17194.  
  17195.   /****************************************/
  17196.   {
  17197.     /* Cannot set semaphore -- error processing */
  17198.   }
  17199.   /* Start a separate process */
  17200.   if(!(DosExecPgm(ObjFail,           /* Object name buffer */
  17201.                   sizeof(ObjFail),   /* Length of obj. name buffer */
  17202.                   EXEC_ASYNC,        /* Execution flag - asynchronous */
  17203.                   Args,              /* Ptr. to argument string */
  17204.                   Envs,              /* Ptr. to environment string */
  17205.                   &ReturnCodes,      /* Ptr. to resultcodes struct. */
  17206.                   START_PROGRAM)))   /* Name of program file */
  17207.     printf("Process2 started. Process1 will try to wait for notification. \n");
  17208.  
  17209.   /*** WAIT for a notification from process2 on process1.sem ***/
  17210.   if((rc = DosSemWait(SemHandle,     /* Semaphore handle */
  17211.                       TIMEOUT)))     /* Timeout period */
  17212.  
  17213.   /****************************************/
  17214.   {
  17215.     /* No notification (either interrupt or timeout); error processing */
  17216.   }
  17217.   else
  17218.   {
  17219.     /* Notification received.  Normal processing */
  17220.     printf("Process2 cleared semaphore; process1 running again. \n");
  17221.   }
  17222. }
  17223.  
  17224. /* ----- process2.c ----*/
  17225.  
  17226. #define INCL_DOSSEMAPHORES
  17227.  
  17228. #include <os2.h>
  17229.  
  17230. #define SEM_NAME "\\SEM\\process1.sem"    /* Semaphore name */
  17231.  
  17232. main()
  17233. {
  17234.   HSEM SemHandle;
  17235.   USHORT rc;
  17236.  
  17237.   /* Obtain access to semaphore created by process1 via OPEN */
  17238.   if((rc=DosOpenSem(&SemHandle,           /* Semaphore handle
  17239.                                                   (returned) */
  17240.                     SEM_NAME)))           /* Semaphore Name */
  17241.   /****************************************/
  17242.   {
  17243.     /* Could not open -- error processing (switch on rc). */
  17244.   }
  17245.   else
  17246.   {
  17247.     /* Opened semaphore; normal processing.  Clear semaphore when done. */
  17248.     printf("Semaphore OPENED. \n");
  17249.     if(!(rc=DosSemClear(SemHandle)))      /* Semaphore handle */
  17250.       printf("Semaphore CLEARED. \n");
  17251.   }
  17252. }
  17253.  
  17254.  
  17255. ΓòÉΓòÉΓòÉ <hidden> DosPeekNmPipe ΓòÉΓòÉΓòÉ
  17256.  
  17257. #define INCL_DOSNMPIPES
  17258.  
  17259. USHORT  rc = DosPeekNmPipe(Handle, Buffer, BufferLen, BytesRead,
  17260.                              BytesAvail, PipeState);
  17261.  
  17262. HPIPE            Handle;        /* Pipe handle */
  17263. PBYTE            Buffer;        /* Address of user buffer */
  17264. USHORT           BufferLen;     /* Buffer length */
  17265. PUSHORT          BytesRead;     /* Bytes read (returned) */
  17266. PUSHORT          BytesAvail;    /* Bytes available (returned) */
  17267. PUSHORT          PipeState;     /* Pipe state (returned) */
  17268.  
  17269. USHORT           rc;            /* return code */
  17270.  
  17271.  
  17272. ΓòÉΓòÉΓòÉ <hidden> DosPeekQueue ΓòÉΓòÉΓòÉ
  17273.  
  17274. #define INCL_DOSQUEUES
  17275.  
  17276. USHORT  rc = DosPeekQueue(QueueHandle, Request, DataLength, DataAddress,
  17277.                            ElementCode, NoWait, ElemPriority,
  17278.                            SemaphoreHandle);
  17279.  
  17280. HQUEUE           QueueHandle;     /* Queue handle */
  17281. PULONG           Request;         /* Request identification data
  17282.                                       (returned) */
  17283. PUSHORT          DataLength;      /* Length of element received
  17284.                                       (returned) */
  17285. PULONG           DataAddress;     /* Address of element received
  17286.                                       (returned) */
  17287. PUSHORT          ElementCode;     /* Indicator of element received
  17288.                                       (returned) */
  17289. UCHAR            NoWait;          /* Indicate to not wait if queue
  17290.                                       is empty */
  17291. PBYTE            ElemPriority;    /* Priority of element (returned) */
  17292. ULONG            SemaphoreHandle; /* Semaphore Handle */
  17293.  
  17294. USHORT           rc;              /* return code */
  17295.  
  17296.  
  17297. ΓòÉΓòÉΓòÉ <hidden> DosPFSActivate ΓòÉΓòÉΓòÉ
  17298.  
  17299. #define INCL_DOSPFS
  17300.  
  17301. USHORT  rc = DosPFSActivate(SplHandle, BytesWritten, PrinterName,
  17302.                              CodePage, FontID, SFN, Reserved);
  17303.  
  17304. PVOID            SplHandle;     /* Temporary Spool File handle */
  17305. PULONG           BytesWritten;  /* Number of bytes written (returned) */
  17306. PSZ              PrinterName;   /* Printer name string */
  17307. USHORT           CodePage;      /* Code Page to make active */
  17308. USHORT           FontID;        /* Font ID to make active */
  17309. USHORT           SFN;           /* System File Number */
  17310. ULONG            0;             /* Reserved, set to zero */
  17311.  
  17312. USHORT           rc;            /* return code */
  17313.  
  17314.  
  17315. ΓòÉΓòÉΓòÉ <hidden> DosPFSCloseUser ΓòÉΓòÉΓòÉ
  17316.  
  17317. #define INCL_DOSPFS
  17318.  
  17319. USHORT  rc = DosPFSCloseUser(PrinterName, SFN, Reserved);
  17320.  
  17321. PSZ              PrinterName;   /* Printer name string */
  17322. USHORT           SFN;           /* System File Number */
  17323. ULONG            0;             /* Reserved, set to zero */
  17324.  
  17325. USHORT           rc;            /* return code */
  17326.  
  17327.  
  17328. ΓòÉΓòÉΓòÉ <hidden> DosPFSInit ΓòÉΓòÉΓòÉ
  17329.  
  17330. #define INCL_DOSPFS
  17331.  
  17332. USHORT  rc = DosPFSInit(CPHdw, FontFileName, PrinterType, PrinterName,
  17333.                              Instances, Reserved);
  17334.  
  17335. PUSHORT          CPHdw;         /* Hdw Font definition list */
  17336. PSZ              FontFileName;  /* File pathname of the font file to use */
  17337. PSZ              PrinterType;   /* Printer type string */
  17338. PSZ              PrinterName;   /* Printer name string */
  17339. USHORT           Instances;     /* Number of spool instances */
  17340. ULONG            0;             /* Reserved */
  17341.  
  17342. USHORT           rc;            /* return code */
  17343.  
  17344.  
  17345. ΓòÉΓòÉΓòÉ <hidden> DosPFSQueryAct ΓòÉΓòÉΓòÉ
  17346.  
  17347. #define INCL_DOSPFS
  17348.  
  17349. USHORT  rc = DosPFSQueryAct(PrinterName, CodePage, FontID, SFN, Reserved);
  17350.  
  17351. PSZ              PrinterName;   /* Printer name string */
  17352. PUSHORT          CodePage;      /* Code Page return */
  17353. PUSHORT          FontID;        /* Font ID return */
  17354. USHORT           SFN;           /* System File Number */
  17355. ULONG            0;             /* Reserved, set to zero */
  17356.  
  17357. USHORT           rc;            /* return code */
  17358.  
  17359.  
  17360. ΓòÉΓòÉΓòÉ <hidden> DosPFSVerifyFont ΓòÉΓòÉΓòÉ
  17361.  
  17362. #define INCL_DOSPFS
  17363.  
  17364. USHORT  rc = DosPFSVerifyFont(PrinterName, CodePage, FontID, Reserved);
  17365.  
  17366. PSZ              PrinterName;   /* Printer name string */
  17367. USHORT           CodePage;      /* Code Page to validate */
  17368. USHORT           FontID;        /* Font Id to validate */
  17369. ULONG            0;             /* Reserved, set to zero */
  17370.  
  17371. USHORT           rc;            /* return code */
  17372.  
  17373.  
  17374. ΓòÉΓòÉΓòÉ <hidden> DosPhysicalDisk ΓòÉΓòÉΓòÉ
  17375.  
  17376. #define INCL_DOSDEVICES
  17377.  
  17378. USHORT  rc = DosPhysicalDisk(Function, DataPtr, DataLen, ParmPtr, ParmLen);
  17379.  
  17380. USHORT           Function;      /* Type of information */
  17381. PBYTE            DataPtr;       /* Pointer to return buffer */
  17382. USHORT           DataLen;       /* Return buffer length */
  17383. PBYTE            ParmPtr;       /* Pointer to user-supplied information */
  17384. USHORT           ParmLen;       /* Length of user-supplied information */
  17385.  
  17386. USHORT           rc;            /* return code */
  17387.  
  17388.  
  17389. ΓòÉΓòÉΓòÉ <hidden> DosPortAccess ΓòÉΓòÉΓòÉ
  17390.  
  17391. #define INCL_DOSDEVICES
  17392.  
  17393. USHORT  rc = DosPortAccess(Reserved, TypeOfAccess, FirstPort, LastPort);
  17394.  
  17395. USHORT           0;             /* 0 */
  17396. USHORT           TypeOfAccess;  /* Request or release */
  17397. USHORT           FirstPort;     /* First port number */
  17398. USHORT           LastPort;      /* Last port number */
  17399.  
  17400. USHORT           rc;            /* return code */
  17401.  
  17402.  
  17403. ΓòÉΓòÉΓòÉ <hidden> DosPtrace ΓòÉΓòÉΓòÉ
  17404.  
  17405. #define INCL_DOSQUEUES
  17406.  
  17407. USHORT  rc = DosPtrace(PtraceB);
  17408.  
  17409. PBYTE            PtraceB;       /* Ptrace buffer (returned) */
  17410.  
  17411. USHORT               rc;        /* return code */
  17412.  
  17413.  
  17414. ΓòÉΓòÉΓòÉ <hidden> DosPurgeQueue ΓòÉΓòÉΓòÉ
  17415.  
  17416. #define INCL_DOSQUEUES
  17417.  
  17418. USHORT  rc = DosPurgeQueue(QueueHandle);
  17419.  
  17420. HQUEUE           QueueHandle;   /* Queue handle */
  17421.  
  17422. USHORT           rc;            /* return code */
  17423.  
  17424.  
  17425. ΓòÉΓòÉΓòÉ <hidden> DosPutMessage ΓòÉΓòÉΓòÉ
  17426.  
  17427. #define INCL_DOSMISC
  17428.  
  17429. USHORT  rc = DosPutMessage(FileHandle, MessageLength, MessageBuffer);
  17430.  
  17431. USHORT           FileHandle;    /* Handle of output file/device */
  17432. USHORT           MessageLength; /* Length of message buffer */
  17433. PCHAR            MessageBuffer; /* Message buffer */
  17434.  
  17435. USHORT           rc;            /* return code */
  17436.  
  17437.  
  17438. ΓòÉΓòÉΓòÉ <hidden> DosQAppType ΓòÉΓòÉΓòÉ
  17439.  
  17440. #define INCL_DOSSESMGR
  17441.  
  17442. USHORT  rc = DosQAppType(ExecutableFileName, AppType);
  17443.  
  17444. PSZ           ExecutableFileName; /* Address of executable file path name
  17445.                                       string */
  17446. PUSHORT       AppType;            /* Address to put application type
  17447.                                       flags */
  17448.  
  17449. USHORT        rc;                 /* return code */
  17450.  
  17451.  
  17452. ΓòÉΓòÉΓòÉ <hidden> DosQCurDir ΓòÉΓòÉΓòÉ
  17453.  
  17454. #define INCL_DOSFILEMGR
  17455.  
  17456. USHORT  rc = DosQCurDir(DriveNumber, DirPath, DirPathLen);
  17457.  
  17458. USHORT           DriveNumber;   /* Drive number */
  17459. PBYTE            DirPath;       /* Directory path buffer (returned) */
  17460. PUSHORT          DirPathLen;    /* Directory path buffer length
  17461.                                     (returned) */
  17462.  
  17463. USHORT           rc;            /* return code */
  17464.  
  17465.  
  17466. ΓòÉΓòÉΓòÉ <hidden> DosQCurDisk ΓòÉΓòÉΓòÉ
  17467.  
  17468. #define INCL_DOSFILEMGR
  17469.  
  17470. USHORT  rc = DosQCurDisk(DriveNumber, LogicalDriveMap);
  17471.  
  17472. PUSHORT          DriveNumber;     /* Default drive number (returned) */
  17473. PULONG           LogicalDriveMap; /* Drive map area (returned) */
  17474.  
  17475. USHORT           rc;              /* return code */
  17476.  
  17477.  
  17478. ΓòÉΓòÉΓòÉ <hidden> DosQFHandState ΓòÉΓòÉΓòÉ
  17479.  
  17480. #define INCL_DOSFILEMGR
  17481.  
  17482. USHORT  rc = DosQFHandState(FileHandle, FileHandleState);
  17483.  
  17484. HFILE            FileHandle;      /* File handle */
  17485. PUSHORT          FileHandleState; /* File handle state (returned) */
  17486.  
  17487. USHORT           rc;              /* return code */
  17488.  
  17489.  
  17490. ΓòÉΓòÉΓòÉ <hidden> DosQFileInfo ΓòÉΓòÉΓòÉ
  17491.  
  17492. typedef struct _FDATE {   /* fdate */
  17493.  
  17494.   unsigned day   : 5;     /* binary day for directory entry */
  17495.   unsigned month : 4;     /* binary month for directory entry */
  17496.   unsigned year  : 7;     /* binary year for directory entry */
  17497.  
  17498. } FDATE;
  17499.  
  17500. typedef struct _FTIME {       /* ftime */
  17501.  
  17502.   unsigned twosecs : 5;       /* binary number of two-second increments */
  17503.   unsigned minutes : 6;       /* binary number of minutes */
  17504.   unsigned hours   : 5;       /* binary number of hours */
  17505.  
  17506. } FTIME;
  17507.  
  17508. typedef struct _FILESTATUS {   /* fsts */
  17509.  
  17510.   FDATE  fdateCreation;        /* date of file creation */
  17511.   FTIME  ftimeCreation;        /* time of file creation */
  17512.   FDATE  fdateLastAccess;      /* date of last access */
  17513.   FTIME  ftimeLastAccess;      /* time of last access */
  17514.   FDATE  fdateLastWrite;       /* date of last write */
  17515.   FTIME  ftimeLastWrite;       /* time of last write */
  17516.   ULONG  cbFile;               /* file size (end of data) */
  17517.   ULONG  cbFileAlloc;          /* file allocated size */
  17518.   USHORT attrFile;             /* attributes of the file */
  17519.  
  17520. } FILESTATUS;
  17521.  
  17522. typedef struct _GEA {       /* gea */
  17523.  
  17524.   BYTE cbName;            /* name length not including NULL */
  17525.   CHAR szName[1];         /* attribute name */
  17526.  
  17527. } GEA;
  17528.  
  17529. typedef struct _GEALIST {   /* geal */
  17530.  
  17531.   ULONG  cbList;          /* total bytes of structure including full list */
  17532.   GEA list[1];            /* variable length GEA structures */
  17533.  
  17534. } GEALIST;
  17535.  
  17536. typedef struct _FEA {       /* fea */
  17537.  
  17538.   BYTE fEA;               /* flags */
  17539.   BYTE cbName;            /* name length not including NULL */
  17540.   USHORT cbValue;         /* value length */
  17541.  
  17542. } FEA;
  17543.  
  17544. typedef struct _FEALIST {   /* feal */
  17545.  
  17546.   ULONG  cbList;          /* total bytes of structure including full list */
  17547.   FEA list[1];            /* variable length FEA structures */
  17548.  
  17549. } FEALIST;
  17550.  
  17551. typedef struct _EAOP {      /* eaop */
  17552.  
  17553.   PGEALIST fpGEAList;     /* general EA list */
  17554.   PFEALIST fpFEAList;     /* full EA list */
  17555.   ULONG  oError;
  17556.  
  17557. } EAOP;
  17558.  
  17559. #define INCL_DOSFILEMGR
  17560.  
  17561. USHORT  rc = DosQFileInfo(FileHandle, FileInfoLevel, FileInfoBuf,
  17562.                              FileInfoBufSize);
  17563.  
  17564. HFILE            FileHandle;      /* File handle */
  17565. USHORT           FileInfoLevel;   /* File data required */
  17566. PBYTE            FileInfoBuf;     /* File data buffer (returned) */
  17567. USHORT           FileInfoBufSize; /* File data buffer size */
  17568.  
  17569. USHORT           rc;              /* return code */
  17570.  
  17571.  
  17572. ΓòÉΓòÉΓòÉ <hidden> DosQFileMode ΓòÉΓòÉΓòÉ
  17573.  
  17574. #define INCL_DOSFILEMGR
  17575.  
  17576. USHORT  rc = DosQFileMode(FilePathName, CurrentAttribute, Reserved);
  17577.  
  17578. PSZ              FilePathName;     /* File path name */
  17579. PUSHORT          CurrentAttribute; /* Data area (returned) */
  17580. ULONG            0;                /* Reserved (must be zero) */
  17581.  
  17582. USHORT           rc;               /* return code */
  17583.  
  17584.  
  17585. ΓòÉΓòÉΓòÉ <hidden> DosQFSAttach ΓòÉΓòÉΓòÉ
  17586.  
  17587. #define INCL_DOSFILEMGR
  17588.  
  17589. USHORT  rc = DosQFSAttach(DeviceName, Ordinal, FSAInfoLevel, DataBuffer,
  17590.                             DataBufferLen, 0);
  17591.  
  17592. PSZ              DeviceName;    /* Device name or drive letter string */
  17593. USHORT           Ordinal;       /* Ordinal of entry in name list  */
  17594. USHORT           FSAInfoLevel;  /* Type of attached FSD data required */
  17595. PBYTE            DataBuffer;    /* Returned data buffer */
  17596. PUSHORT          DataBufferLen; /* Buffer length  */
  17597. ULONG            0;             /* Reserved (must be zero)  */
  17598.  
  17599. USHORT           rc;            /* return code */
  17600.  
  17601.  
  17602. ΓòÉΓòÉΓòÉ <hidden> DosQFSInfo ΓòÉΓòÉΓòÉ
  17603.  
  17604. typedef struct _FSALLOCATE {
  17605.     ULONG  idFileSystem;  /* file system ID */
  17606.     ULONG  cSectorUnit;   /* number sectors per allocation unit */
  17607.     ULONG  cUnit;         /* number of allocation units */
  17608.     ULONG  cUnitAvail;    /* available allocation units */
  17609.     USHORT cbSector;      /* bytes per sector */
  17610. } FSALLOCATE;
  17611.  
  17612. typedef struct _FDATE {   /* fdate */
  17613.  
  17614.   unsigned day   : 5;     /* binary day for directory entry */
  17615.   unsigned month : 4;     /* binary month for directory entry */
  17616.   unsigned year  : 7;     /* binary year for directory entry */
  17617.  
  17618. } FDATE;
  17619.  
  17620. typedef struct _FTIME {       /* ftime */
  17621.  
  17622.   unsigned twosecs : 5;   /* binary number of two-second increments */
  17623.   unsigned minutes : 6;   /* binary number of minutes */
  17624.   unsigned hours   : 5;   /* binary number of hours */
  17625.  
  17626. } FTIME;
  17627.  
  17628. typedef struct _FSINFO {    /* fsinf */
  17629.     FDATE fdateCreation;
  17630.     FTIME ftimeCreation;
  17631.     VOLUMELABEL vol;
  17632. } FSINFO;
  17633.  
  17634. typedef struct _VOLUMELABEL { /* vol */
  17635.     BYTE cch;
  17636.     CHAR szVolLabel[12];
  17637. } VOLUMELABEL;
  17638.  
  17639. #define INCL_DOSFILEMGR
  17640.  
  17641. USHORT  rc = DosQFSInfo(DriveNumber, FSInfoLevel, FSInfoBuf, FSInfoBufSize);
  17642.  
  17643. USHORT           DriveNumber;   /* Drive number */
  17644. USHORT           FSInfoLevel;   /* File system data required */
  17645. PBYTE            FSInfoBuf;     /* File system info buffer */
  17646. USHORT           FSInfoBufSize; /* File system info buffer size */
  17647.  
  17648. USHORT           rc;            /* return code */
  17649.  
  17650.  
  17651. ΓòÉΓòÉΓòÉ <hidden> DosQHandType ΓòÉΓòÉΓòÉ
  17652.  
  17653. #define INCL_DOSFILEMGR
  17654.  
  17655. USHORT  rc = DosQHandType(FileHandle, HandType, FlagWord);
  17656.  
  17657. HFILE            FileHandle;    /* File handle */
  17658. PUSHORT          HandType;      /* Handle type (returned) */
  17659. PUSHORT          FlagWord;      /* Device driver attribute (returned) */
  17660.  
  17661. USHORT           rc;            /* return code */
  17662.  
  17663.  
  17664. ΓòÉΓòÉΓòÉ <hidden> DosQNmPHandState ΓòÉΓòÉΓòÉ
  17665.  
  17666. #define INCL_DOSNMPIPES
  17667.  
  17668. USHORT  rc = DosQNmPHandState(Handle, PipeHandleState);
  17669.  
  17670. HPIPE            Handle;          /* Pipe handle */
  17671. PUSHORT          PipeHandleState; /* Pipe handle state */
  17672.  
  17673. USHORT           rc;              /* return code */
  17674.  
  17675.  
  17676. ΓòÉΓòÉΓòÉ <hidden> DosQNmPipeInfo ΓòÉΓòÉΓòÉ
  17677.  
  17678. typedef struct   npi_data1 {    /* PipeInfo data block (returned,
  17679.                                             level 1) */
  17680.    USHORT npi_obuflen;          /* length of outgoing I/O buffer */
  17681.    USHORT npi_ibuflen;          /* length of incoming I/O buffer */
  17682.    UCHAR  npi_maxicnt;          /* maximum number of instances   */
  17683.    UCHAR  npi_curicnt;          /* current number of instances   */
  17684.    UCHAR  npi_namlen;           /* length of pipe name           */
  17685.    CHAR  npi_name[1];           /* start of name       */
  17686. }; /* npi_data1 */
  17687.  
  17688. #define INCL_DOSNMPIPES
  17689.  
  17690. USHORT  rc = DosQNmPipeInfo(Handle, InfoLevel, InfoBuf, InfoBufSize);
  17691.  
  17692. HPIPE            Handle;        /* Pipe handle */
  17693. USHORT           InfoLevel;     /* Pipe data required */
  17694. PBYTE            InfoBuf;       /* Pipe data buffer */
  17695. USHORT           InfoBufSize;   /* Pipe data buffer size */
  17696.  
  17697. USHORT           rc;            /* return code */
  17698.  
  17699.  
  17700. ΓòÉΓòÉΓòÉ <hidden> DosQNmPipeSemState ΓòÉΓòÉΓòÉ
  17701.  
  17702. typedef struct   npss  {        /* QNmPipeSemState information record */
  17703.    UCHAR  npss_status;          /* type of record, 0=EOI, 1=read ok,  */
  17704.                                 /*   2 = write ok, 3 = pipe closed    */
  17705.    UCHAR  npss_flag;            /* additional info, 01=waiting thread */
  17706.    USHORT npss_key;             /* user's key value                   */
  17707.    USHORT npss_avail;           /* available data/space if status=1/2 */
  17708. }; /* npss */
  17709.  
  17710. #define INCL_DOSNMPIPES
  17711.  
  17712. USHORT  rc = DosQNmPipeSemState(SemHandle, InfoBuf, InfoBufLen);
  17713.  
  17714. HSEM             SemHandle;     /* Semaphore handle */
  17715. PBYTE            InfoBuf;       /* Address of returned info */
  17716. USHORT           InfoBufLen;    /* Length of InfoBuf */
  17717.  
  17718. USHORT           rc;            /* return code */
  17719.  
  17720.  
  17721. ΓòÉΓòÉΓòÉ <hidden> DosQPathInfo ΓòÉΓòÉΓòÉ
  17722.  
  17723. typedef struct _FDATE {   /* fdate */
  17724.  
  17725.   unsigned day   : 5;     /* binary day for directory entry */
  17726.   unsigned month : 4;     /* binary month for directory entry */
  17727.   unsigned year  : 7;     /* binary year for directory entry */
  17728.  
  17729. } FDATE;
  17730.  
  17731. typedef struct _FTIME {       /* ftime */
  17732.  
  17733.   unsigned twosecs : 5;       /* binary number of two-second increments */
  17734.   unsigned minutes : 6;       /* binary number of minutes */
  17735.   unsigned hours   : 5;       /* binary number of hours */
  17736.  
  17737. } FTIME;
  17738.  
  17739. typedef struct _FILESTATUS {   /* fsts */
  17740.  
  17741.   FDATE  fdateCreation;        /* date of file creation */
  17742.   FTIME  ftimeCreation;        /* time of file creation */
  17743.   FDATE  fdateLastAccess;      /* date of last access */
  17744.   FTIME  ftimeLastAccess;      /* time of last access */
  17745.   FDATE  fdateLastWrite;       /* date of last write */
  17746.   FTIME  ftimeLastWrite;       /* time of last write */
  17747.   ULONG  cbFile;               /* file size (end of data) */
  17748.   ULONG  cbFileAlloc;          /* file allocated size */
  17749.   USHORT attrFile;             /* attributes of the file */
  17750.  
  17751. } FILESTATUS;
  17752.  
  17753. typedef struct _GEA {       /* gea */
  17754.  
  17755.   BYTE cbName;            /* name length not including NULL */
  17756.   CHAR szName[1];         /* attribute name */
  17757.  
  17758. } GEA;
  17759.  
  17760. typedef struct _GEALIST {   /* geal */
  17761.  
  17762.   ULONG  cbList;          /* total bytes of structure including full list */
  17763.   GEA list[1];            /* variable length GEA structures */
  17764.  
  17765. } GEALIST;
  17766.  
  17767. typedef struct _FEA {       /* fea */
  17768.  
  17769.   BYTE fEA;               /* flags */
  17770.   BYTE cbName;            /* name length not including NULL */
  17771.   USHORT cbValue;         /* value length */
  17772.  
  17773. } FEA;
  17774.  
  17775. typedef struct _FEALIST {   /* feal */
  17776.  
  17777.   ULONG  cbList;          /* total bytes of structure including full list */
  17778.   FEA list[1];            /* variable length FEA structures */
  17779.  
  17780. } FEALIST;
  17781.  
  17782. typedef struct _EAOP {      /* eaop */
  17783.  
  17784.   PGEALIST fpGEAList;     /* general EA list */
  17785.   PFEALIST fpFEAList;     /* full EA list */
  17786.   ULONG  oError;
  17787.  
  17788. } EAOP;
  17789.  
  17790. #define INCL_DOSFILEMGR
  17791.  
  17792. USHORT  rc = DosQPathInfo(PathName, PathInfoLevel, PathInfoBuf,
  17793.                             PathInfoBufSize, 0);
  17794.  
  17795. PSZ             PathName;        /* File or directory path name string */
  17796. USHORT          PathInfoLevel;   /* Data required  */
  17797. PBYTE           PathInfoBuf;     /* Data buffer (returned) */
  17798. USHORT          PathInfoBufSize; /* Data buffer size */
  17799. ULONG           0;               /* Reserved (must be zero)  */
  17800.  
  17801. USHORT          rc;              /* return code */
  17802.  
  17803.  
  17804. ΓòÉΓòÉΓòÉ <hidden> DosQSysInfo ΓòÉΓòÉΓòÉ
  17805.  
  17806. #define INCL_DOSFILEMGR
  17807.  
  17808. USHORT  rc = DosQSysInfo(Index, DataBuf, DataBufLen);
  17809.  
  17810. USHORT           Index;         /* Which variable */
  17811. PBYTE            DataBuf;       /* System information (returned) */
  17812. USHORT           DataBufLen;    /* Data buffer size */
  17813.  
  17814. USHORT           rc;            /* return code */
  17815.  
  17816.  
  17817. ΓòÉΓòÉΓòÉ <hidden> DosQueryQueue ΓòÉΓòÉΓòÉ
  17818.  
  17819. #define INCL_DOSQUEUES
  17820.  
  17821. USHORT  rc = DosQueryQueue(QueueHandle, NumberElements);
  17822.  
  17823. HQUEUE           QueueHandle;    /* Queue handle */
  17824. PUSHORT          NumberElements; /* Size of the queue (returned) */
  17825.  
  17826. USHORT           rc;             /* return code */
  17827.  
  17828.  
  17829. ΓòÉΓòÉΓòÉ <hidden> DosQVerify ΓòÉΓòÉΓòÉ
  17830.  
  17831. #define INCL_DOSFILEMGR
  17832.  
  17833. USHORT  rc = DosQVerify(VerifySetting);
  17834.  
  17835. PUSHORT          VerifySetting; /* Verify setting (returned) */
  17836.  
  17837. USHORT           rc;            /* return code */
  17838.  
  17839.  
  17840. ΓòÉΓòÉΓòÉ <hidden> DosR2StackRealloc ΓòÉΓòÉΓòÉ
  17841.  
  17842. #define INCL_DOSDEVICES
  17843.  
  17844. USHORT  rc = DosR2StackRealloc(NewSize);
  17845.  
  17846. USHORT           NewSize;       /* The new size in bytes for the stack */
  17847.  
  17848. USHORT           rc;            /* return code */
  17849.  
  17850.  
  17851. ΓòÉΓòÉΓòÉ <hidden> DosRead ΓòÉΓòÉΓòÉ
  17852.  
  17853. #define INCL_DOSFILEMGR
  17854.  
  17855. USHORT  rc = DosRead(FileHandle, BufferArea, BufferLength, BytesRead);
  17856.  
  17857. HFILE            FileHandle;    /* File Handle */
  17858. PVOID            BufferArea;    /* User buffer (returned) */
  17859. USHORT           BufferLength;  /* Buffer length */
  17860. PUSHORT          BytesRead;     /* Bytes read (returned) */
  17861.  
  17862. USHORT           rc;            /* return code */
  17863.  
  17864.  
  17865. ΓòÉΓòÉΓòÉ <hidden> DosReadAsync ΓòÉΓòÉΓòÉ
  17866.  
  17867. #define INCL_DOSFILEMGR
  17868.  
  17869. USHORT  rc = DosReadAsync(FileHandle, RamSemaphore, ReturnCode, BufferArea,
  17870.                              BufferLength, BytesRead);
  17871.  
  17872. HFILE            FileHandle;    /* File handle */
  17873. PULONG           RamSemaphore;  /* Ram semaphore */
  17874. PUSHORT          ReturnCode;    /* I/O operation return code (returned) */
  17875. PVOID            BufferArea;    /* User buffer (returned) */
  17876. USHORT           BufferLength;  /* Buffer length */
  17877. PUSHORT          BytesRead;     /* Bytes read (returned) */
  17878.  
  17879. USHORT           rc;            /* return code */
  17880.  
  17881.  
  17882. ΓòÉΓòÉΓòÉ <hidden> DosReadQueue ΓòÉΓòÉΓòÉ
  17883.  
  17884. #define INCL_DOSQUEUES
  17885.  
  17886. USHORT  rc = DosReadQueue(QueueHandle, Request, DataLength, DataAddress,
  17887.                            ElementCode, NoWait, ElemPriority,
  17888.                            SemaphoreHandle);
  17889.  
  17890. HQUEUE           QueueHandle;     /* Queue handle */
  17891. PULONG           Request;         /* Request identification data
  17892.                                       (returned) */
  17893. PUSHORT          DataLength;      /* Length of element received
  17894.                                       (returned) */
  17895. PULONG           DataAddress;     /* Address of element received
  17896.                                       (returned) */
  17897. USHORT           ElementCode;     /* Indicate want a particular element */
  17898. UCHAR            NoWait;          /* Indicate to not wait if queue is
  17899.                                       empty */
  17900. PBYTE            ElemPriority;    /* Priority of element (returned) */
  17901. HSEM             SemaphoreHandle; /* Semaphore handle */
  17902.  
  17903. USHORT            rc;             /* return code */
  17904.  
  17905.  
  17906. ΓòÉΓòÉΓòÉ <hidden> DosReallocHuge ΓòÉΓòÉΓòÉ
  17907.  
  17908. #define INCL_DOSMEMMGR
  17909.  
  17910. USHORT  rc = DosReallocHuge(NumSeg, Size, Selector);
  17911.  
  17912. USHORT           NumSeg;        /* Number of 65536-byte segments
  17913.                                     requested */
  17914. USHORT           Size;          /* Number of bytes in last segment */
  17915. SEL              Selector;      /* Selector */
  17916.  
  17917. USHORT           rc;            /* return code */
  17918.  
  17919.  
  17920. ΓòÉΓòÉΓòÉ <hidden> DosReallocSeg ΓòÉΓòÉΓòÉ
  17921.  
  17922. #define INCL_DOSMEMMGR
  17923.  
  17924. USHORT  rc = DosReallocSeg(Size, Selector);
  17925.  
  17926. USHORT           Size;          /* New size requested in bytes */
  17927. SEL              Selector;      /* Selector */
  17928.  
  17929. USHORT           rc;            /* return code */
  17930.  
  17931.  
  17932. ΓòÉΓòÉΓòÉ <hidden> DosResumeThread ΓòÉΓòÉΓòÉ
  17933.  
  17934. #define INCL_DOSPROCESS
  17935.  
  17936. USHORT  rc = DosResumeThread(ThreadID);
  17937.  
  17938. TID              ThreadID;      /* Thread ID of thread to resume */
  17939.  
  17940. USHORT           rc;            /* return code */
  17941.  
  17942. Example 
  17943.  
  17944. The following example shows how to suspend and resume execution of a thread 
  17945. within a process.  The main thread creates Thread2 and allows it to begin 
  17946. executing.  Thread2 iterates through a loop that prints a line and then sleeps, 
  17947. relinquishing its time slice to the main thread. After one iteration by 
  17948. Thread2, the main thread suspends Thread2 and then resumes it.  Subsequently, 
  17949. Thread2 completes the remaining three iterations. 
  17950.  
  17951. #define INCL_DOSPROCESS
  17952.  
  17953. #include <os2.h>
  17954.  
  17955. #define   SEGSIZE       4000   /* Number of bytes requested in segment */
  17956. #define   ALLOCFLAGS    0      /* Segment allocation flags - no sharing */
  17957. #define   SLEEPSHORT    5L     /* Sleep interval - 5 milliseconds */
  17958. #define   SLEEPLONG     75L    /* Sleep interval - 75 milliseconds */
  17959. #define   RETURN_CODE   0      /* Return code for DosExit() */
  17960.  
  17961. VOID APIENTRY Thread2()
  17962. {
  17963.   USHORT     i;
  17964.  
  17965.   /* Loop with four iterations */
  17966.   for(i=1; i<5; i++)
  17967.   {
  17968.     printf("In Thread2, i is now %d\n", i);
  17969.     /* Sleep to relinquish time slice to main thread */
  17970.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  17971.   }
  17972.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  17973.           RETURN_CODE);            /* Return code */
  17974. }
  17975.  
  17976.  
  17977. main()
  17978. {
  17979.   TID        ThreadID;             /* Thread identification */
  17980.   SEL        ThreadStackSel;       /* Segment selector for thread stack */
  17981.   PBYTE      StackEnd;             /* Ptr. to end of thread stack */
  17982.   USHORT     rc;
  17983.  
  17984.   /** Allocate segment for thread stack; make pointer to end of stack. **/
  17985.   /**  We must allocate a segment in order to preserve segment
  17986.   /**  protection for the thread.  **/
  17987.  
  17988.   rc = DosAllocSeg(SEGSIZE,             /* Number of bytes requested */
  17989.                    &ThreadStackSel,     /* Segment selector (returned) */
  17990.                    ALLOCFLAGS);         /* Allocation flags - no sharing */
  17991.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  17992.  
  17993.   /** Start Thread2 **/
  17994.   if(!(rc=DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  17995.                        &ThreadID,                 /* Thread ID
  17996.                                                           (returned) */
  17997.                        StackEnd)))   /* End of thread stack */
  17998.     printf("Thread2 created.\n");
  17999.  
  18000.   /* Sleep to relinquish time slice to Thread2 */
  18001.   if(!(DosSleep(SLEEPSHORT)))                  /* Sleep interval */
  18002.     printf("Slept a little to let Thread2 execute.\n");
  18003.  
  18004.   /***** Suspend Thread2, do some work, then resume Thread2 *****/
  18005.   if(!(rc=DosSuspendThread(ThreadID)))         /* Thread ID */
  18006.     printf("Thread2 SUSPENDED.\n");
  18007.   printf("Perform work that will not be interrupted by Thread2.\n");
  18008.   if(!(rc=DosResumeThread(ThreadID)))          /* Thread ID */
  18009.     printf("Thread2 RESUMED.\n");
  18010.   printf("Now we may be interrupted by Thread2.\n");
  18011.  
  18012.   /* Sleep to allow Thread2 to complete */
  18013.   DosSleep(SLEEPLONG);                         /* Sleep interval */
  18014. }
  18015.  
  18016.  
  18017. ΓòÉΓòÉΓòÉ <hidden> DosRmDir ΓòÉΓòÉΓòÉ
  18018.  
  18019. #define INCL_DOSFILEMGR
  18020.  
  18021. USHORT  rc = DosRmDir(DirName, Reserved);
  18022.  
  18023. PSZ              DirName;       /* Directory name string */
  18024. ULONG            0;             /* Reserved (must be zero) */
  18025.  
  18026. USHORT           rc;            /* return code */
  18027.  
  18028.  
  18029. ΓòÉΓòÉΓòÉ <hidden> DosScanEnv ΓòÉΓòÉΓòÉ
  18030.  
  18031. #define INCL_DOSQUEUES
  18032.  
  18033. USHORT  rc = DosScanEnv(EnvVarName, ResultPointer);
  18034.  
  18035. PSZ              EnvVarName;    /* Environment variable name string */
  18036. PSZ FAR *        ResultPointer; /* Search result pointer (returned) */
  18037.  
  18038. USHORT           rc;            /* return code */
  18039.  
  18040. Example 
  18041.  
  18042. The following example scans the environment segment for the PATH variable and 
  18043. prints its value.  It then searches the path given by inserting the current 
  18044. directory into the value of the PATH variable for the file named "cmd.exe", and 
  18045. prints the full filename. 
  18046.  
  18047. #define INCL_DOS
  18048.  
  18049. #include <os2.h>
  18050.  
  18051. #define ENVVARNAME            "PATH"       /* Environment variable name */
  18052. #define FILENAME              "cmd.exe"    /* File for which to search */
  18053. #define SEARCH_CUR_DIRECTORY  0x03         /* Search control - current
  18054.                                                      dir., */
  18055.                                            /*   then environment variable */
  18056.  
  18057. main()
  18058. {
  18059.   PSZ FAR   *ResultPointer;        /* Environment scan result pointer
  18060.                                        (returned) */
  18061.   BYTE      ResultBuffer[128];     /* Path search result
  18062.                                                  (returned) */
  18063.   USHORT    rc;                    /* return code */
  18064.  
  18065.   /** Scan environment segment for PATH; notice the far-string pointer **/
  18066.   /**   specification ("%Fs") used to print.                           **/
  18067.  
  18068.   if(!(rc=DosScanEnv(ENVVARNAME,        /* Environment variable name */
  18069.                      &ResultPointer)))  /* Scan result pointer
  18070.                                                 (returned) */
  18071.     printf("%s is %Fs\n", ENVVARNAME, ResultPointer);
  18072.  
  18073.   /** Search current directory + PATH variable for "cmd.exe"   **/
  18074.   if(!(rc=DosSearchPath(SEARCH_CUR_DIRECTORY,    /* Search control
  18075.                                                            vector */
  18076.                         ENVVARNAME,              /* Search path reference
  18077.                                                      string */
  18078.                         FILENAME,                /* File name string */
  18079.                         ResultBuffer,            /* Search result
  18080.                                                      (returned) */
  18081.                         sizeof(ResultBuffer))))  /* Length of search
  18082.                                                      result */
  18083.     printf("Found desired file -- %s\n", ResultBuffer);
  18084. }
  18085.  
  18086.  
  18087. ΓòÉΓòÉΓòÉ <hidden> DosSearchPath ΓòÉΓòÉΓòÉ
  18088.  
  18089. #define INCL_DOSQUEUES
  18090.  
  18091. USHORT  rc = DosSearchPath(Control, PathRef, FileName, ResultBuffer,
  18092.                              ResultBufferLen);
  18093.  
  18094. USHORT           Control;         /* Function control vector */
  18095. PSZ              PathRef;         /* Search path reference string */
  18096. PSZ              FileName;        /* File name string */
  18097. PBYTE            ResultBuffer;    /* Search result buffer (returned) */
  18098. USHORT           ResultBufferLen; /* Search result buffer length */
  18099.  
  18100. USHORT           rc;              /* return code */
  18101.  
  18102. Example 
  18103.  
  18104. The following example scans the environment segment for the PATH variable and 
  18105. prints its value.  It then searches the path given by inserting the current 
  18106. directory into the value of the PATH variable for the file named "cmd.exe", and 
  18107. prints the full filename. 
  18108.  
  18109. #define INCL_DOS
  18110.  
  18111. #include <os2.h>
  18112.  
  18113. #define ENVVARNAME            "PATH"       /* Environment variable name */
  18114. #define FILENAME              "cmd.exe"    /* File for which to search */
  18115. #define SEARCH_CUR_DIRECTORY  0x03         /* Search control - current
  18116.                                                      dir., */
  18117.                                            /*   then environment variable */
  18118.  
  18119. main()
  18120. {
  18121.   PSZ FAR   *ResultPointer;        /* Environment scan result pointer
  18122.                                        (returned) */
  18123.   BYTE      ResultBuffer[128];     /* Path search result
  18124.                                                  (returned) */
  18125.   USHORT    rc;                    /* return code */
  18126.  
  18127.   /** Scan environment segment for PATH; notice the far-string pointer **/
  18128.   /**   specification ("%Fs") used to print.                           **/
  18129.  
  18130.   if(!(rc=DosScanEnv(ENVVARNAME,        /* Environment variable name */
  18131.                      &ResultPointer)))  /* Scan result pointer
  18132.                                                 (returned) */
  18133.     printf("%s is %Fs\n", ENVVARNAME, ResultPointer);
  18134.  
  18135.   /** Search current directory + PATH variable for "cmd.exe"   **/
  18136.   if(!(rc=DosSearchPath(SEARCH_CUR_DIRECTORY,    /* Search control
  18137.                                                            vector */
  18138.                         ENVVARNAME,              /* Search path reference
  18139.                                                      string */
  18140.                         FILENAME,                /* File name string */
  18141.                         ResultBuffer,            /* Search result
  18142.                                                      (returned) */
  18143.                         sizeof(ResultBuffer))))  /* Length of search
  18144.                                                      result */
  18145.     printf("Found desired file -- %s\n", ResultBuffer);
  18146. }
  18147.  
  18148.  
  18149. ΓòÉΓòÉΓòÉ <hidden> DosSelectDisk ΓòÉΓòÉΓòÉ
  18150.  
  18151. #define INCL_DOSFILEMGR
  18152.  
  18153. USHORT  rc = DosSelectDisk(DriveNumber);
  18154.  
  18155. USHORT           DriveNumber;   /* Default drive number */
  18156.  
  18157. USHORT           rc;            /* return code */
  18158.  
  18159.  
  18160. ΓòÉΓòÉΓòÉ <hidden> DosSelectSession ΓòÉΓòÉΓòÉ
  18161.  
  18162. #define INCL_DOSSESMGR
  18163.  
  18164. USHORT  rc = DosSelectSession(SessID, Reserved);
  18165.  
  18166. USHORT           SessID;        /* Session ID */
  18167. ULONG            0;             /* Reserved (must be zero) */
  18168.  
  18169. USHORT           rc;            /* return code */
  18170.  
  18171.  
  18172. ΓòÉΓòÉΓòÉ <hidden> DosSemClear ΓòÉΓòÉΓòÉ
  18173.  
  18174. #define INCL_DOSSEMAPHORES
  18175.  
  18176. USHORT  rc = DosSemClear(SemHandle);
  18177.  
  18178. HSEM             SemHandle;     /* Semaphore handle */
  18179.  
  18180. USHORT           rc;            /* return code */
  18181.  
  18182. Example 
  18183.  
  18184. The following example illustrates the serialization of access to a shared 
  18185. resource between threads of the same process.  The program creates a 
  18186. nonexclusive system semaphore named resource.sem, requests access to the 
  18187. semaphore, clears it, and finally closes the semaphore.  For an illustration of 
  18188. notification of events, see the example given in DosOpenSem, DosSemSet, or 
  18189. DosSemWait. 
  18190.  
  18191. #define INCL_DOSSEMAPHORES
  18192.  
  18193. #include <os2.h>
  18194.  
  18195. #define SEM_NAME "\\SEM\\resource.sem"  /* Semaphore name */
  18196. #define TIMEOUT 1500L                   /* Timeout (in milliseconds) */
  18197.  
  18198.  
  18199. main()
  18200. {
  18201.   HSEM SemHandle;
  18202.   USHORT rc;
  18203.  
  18204.   /* Note: the semaphore could have been created by another    */
  18205.   /*       thread.                                             */
  18206.   DosCreateSem(CSEM_PUBLIC,         /* Ownership - nonexclusive */
  18207.                &SemHandle,          /* Semaphore handle (returned) */
  18208.                SEM_NAME);           /* Semaphore name */
  18209.   if(!(rc = DosSemRequest(SemHandle,       /* Semaphore Handle */
  18210.                          TIMEOUT)))        /* Timeout Period   */
  18211.   {
  18212.     /* Semaphore obtained; resource may now be used. */
  18213.     /* Clear the semaphore after using resource.     */
  18214.     if(DosSemClear(SemHandle))
  18215.     {
  18216.       /* Semaphore exclusively owned by another process --  */
  18217.       /* cannot clear now.                                  */
  18218.     }
  18219.   }
  18220.   else
  18221.   {
  18222.     /* Semaphore not obtained: error processing (i.e. switch on rc) */
  18223.   }
  18224.   /* Semaphore no longer needed; close it */
  18225.   if(DosCloseSem(SemHandle))
  18226.   {
  18227.     /* Semaphore is still set -- cannot close now */
  18228.   }
  18229. }
  18230.  
  18231.  
  18232. ΓòÉΓòÉΓòÉ <hidden> DosSemRequest ΓòÉΓòÉΓòÉ
  18233.  
  18234. #define INCL_DOSSEMAPHORES
  18235.  
  18236. USHORT  rc = DosSemRequest(SemHandle, Timeout);
  18237.  
  18238. HSEM             SemHandle;     /* Semaphore handle */
  18239. LONG             Timeout;       /* Timeout (in milliseconds) */
  18240.  
  18241. USHORT           rc;            /* return code */
  18242.  
  18243. Example 
  18244.  
  18245. The following example illustrates the serialization of access to a shared 
  18246. resource between threads of the same process.  The program creates a 
  18247. nonexclusive system semaphore named resource.sem, requests access to the 
  18248. semaphore, clears it, and finally closes the semaphore.  For an illustration of 
  18249. notification of events, see the example given in DosOpenSem, DosSemSet, or 
  18250. DosSemWait. 
  18251.  
  18252. #define INCL_DOSSEMAPHORES
  18253.  
  18254. #include <os2.h>
  18255.  
  18256. #define SEM_NAME "\\SEM\\resource.sem"  /* Semaphore name */
  18257. #define TIMEOUT 1500L                   /* Timeout (in milliseconds) */
  18258.  
  18259.  
  18260. main()
  18261. {
  18262.   HSEM SemHandle;
  18263.   USHORT rc;
  18264.  
  18265.   /* Note: the semaphore could have been created by another    */
  18266.   /*       thread.                                             */
  18267.  
  18268.   DosCreateSem(CSEM_PUBLIC,         /* Ownership - nonexclusive */
  18269.                &SemHandle,          /* Semaphore handle (returned) */
  18270.                SEM_NAME);           /* Semaphore name */
  18271.   if(!(rc = DosSemRequest(SemHandle,       /* Semaphore Handle */
  18272.                          TIMEOUT)))        /* Timeout Period   */
  18273.   {
  18274.  
  18275.     /* Semaphore obtained; resource may now be used. */
  18276.     /* Clear the semaphore after using resource.     */
  18277.  
  18278.     if(DosSemClear(SemHandle))
  18279.     {
  18280.       /* Semaphore exclusively owned by another process --  */
  18281.       /* cannot clear now.                                  */
  18282.     }
  18283.   }
  18284.   else
  18285.   {
  18286.     /* Semaphore not obtained: error processing (i.e. switch on rc) */
  18287.   }
  18288.   /* Semaphore no longer needed; close it */
  18289.   if(DosCloseSem(SemHandle))
  18290.   {
  18291.     /* Semaphore is still set -- cannot close now */
  18292.   }
  18293. }
  18294.  
  18295.  
  18296. ΓòÉΓòÉΓòÉ <hidden> DosSemSet ΓòÉΓòÉΓòÉ
  18297.  
  18298. #define INCL_DOSSEMAPHORES
  18299.  
  18300. USHORT  rc = DosSemSet(SemHandle);
  18301.  
  18302. HSEM             SemHandle;     /* Semaphore handle */
  18303.  
  18304. USHORT           rc;            /* return code */
  18305.  
  18306. Example 
  18307.  
  18308. The following example illustrates the notification of an event between threads 
  18309. of different processes.  Process1 creates a nonexclusive system semaphore named 
  18310. process1.sem and sets it.  It then invokes process2 to run asynchronously. 
  18311. Process1 then waits, with a time out of 4.5 seconds, for process2 to open the 
  18312. semaphore and clear it, thereby notifying process1 to resume. Notice that there 
  18313. is a small possibility of process1's missing the notification because process2 
  18314. may clear the semaphore before process1 issues DosSemWait. See the example for 
  18315. DosSemSetWait for an alternative that would correct this. 
  18316.  
  18317. /* ----- process1.c ---- */
  18318.  
  18319. #define INCL_DOSSEMAPHORES
  18320. #define INCL_DOSPROCESS
  18321.  
  18322. #include <os2.h>
  18323.  
  18324. #define SEM_NAME "\\SEM\\process1.sem" /* Semaphore name */
  18325. #define TIMEOUT 4500L                  /* Timeout period */
  18326. #define START_PROGRAM "process2.exe"   /* Name of program file */
  18327.  
  18328. main()
  18329. {
  18330.   HSEM          SemHandle;
  18331.   CHAR          ObjFail [50];
  18332.   PSZ           Args;
  18333.   PSZ           Envs;
  18334.   RESULTCODES   ReturnCodes;
  18335.   USHORT        rc;
  18336.  
  18337.   printf("Process1 now running. \n");
  18338.   rc = DosCreateSem(CSEM_PUBLIC,       /* Ownership - nonexclusive */
  18339.                     &SemHandle,        /* Semaphore handle (returned) */
  18340.                     SEM_NAME);         /* Semaphore name string */
  18341.   printf("Process1.sem created; return code is %d \n", rc);
  18342.  
  18343.   /*** SET the semaphore. ***/
  18344.   if((rc = DosSemSet(SemHandle)))      /* Semaphore handle */
  18345.  
  18346.   /****************************************/
  18347.   {
  18348.     /* Cannot set semaphore -- error processing */
  18349.   }
  18350.   /* Start a separate process */
  18351.   if(!(DosExecPgm(ObjFail,           /* Object name buffer */
  18352.                   sizeof(ObjFail),   /* Length of obj. name buffer */
  18353.                   EXEC_ASYNC,        /* Execution flag - asynchronous */
  18354.                   Args,              /* Ptr. to argument string */
  18355.                   Envs,              /* Ptr. to environment string */
  18356.                   &ReturnCodes,      /* Ptr. to resultcodes struct. */
  18357.                   START_PROGRAM)))   /* Name of program file */
  18358.     printf("Process2 started. Process1 will try to wait for notification. \n");
  18359.  
  18360.   /*** WAIT for a notification from process2 on process1.sem ***/
  18361.   if((rc = DosSemWait(SemHandle,     /* Semaphore handle */
  18362.                       TIMEOUT)))     /* Timeout period */
  18363.  
  18364.   /****************************************/
  18365.   {
  18366.     /* No notification (either interrupt or timeout); error processing */
  18367.   }
  18368.   else
  18369.   {
  18370.     /* Notification received.  Normal processing */
  18371.     printf("Process2 cleared semaphore; process1 running again. \n");
  18372.   }
  18373. }
  18374.  
  18375. /* ----- process2.c ----*/
  18376.  
  18377. #define INCL_DOSSEMAPHORES
  18378.  
  18379. #include <os2.h>
  18380.  
  18381. #define SEM_NAME "\\SEM\\process1.sem"    /* Semaphore name */
  18382.  
  18383. main()
  18384. {
  18385.   HSEM SemHandle;
  18386.   USHORT rc;
  18387.  
  18388.   /* Obtain access to semaphore created by process1 via OPEN */
  18389.   if((rc=DosOpenSem(&SemHandle,           /* Semaphore handle
  18390.                                                   (returned) */
  18391.                     SEM_NAME)))           /* Semaphore Name */
  18392.  
  18393.   /****************************************/
  18394.   {
  18395.     /* Could not open -- error processing (switch on rc). */
  18396.   }
  18397.   else
  18398.   {
  18399.     /* Opened semaphore; normal processing.  Clear semaphore when done. */
  18400.     printf("Semaphore OPENED. \n");
  18401.     if(!(rc=DosSemClear(SemHandle)))      /* Semaphore handle */
  18402.       printf("Semaphore CLEARED. \n");
  18403.   }
  18404. }
  18405.  
  18406.  
  18407. ΓòÉΓòÉΓòÉ <hidden> DosSemSetWait ΓòÉΓòÉΓòÉ
  18408.  
  18409. #define INCL_DOSSEMAPHORES
  18410.  
  18411. USHORT  rc = DosSemSetWait(SemHandle, Timeout);
  18412.  
  18413. HSEM             SemHandle;     /* Semaphore handle */
  18414. LONG             Timeout;       /* Timeout (in milliseconds) */
  18415.  
  18416. USHORT           rc;            /* return code */
  18417.  
  18418. Example 
  18419.  
  18420. The following example illustrates the notification of an event between threads 
  18421. of different processes.  Process1 creates a nonexclusive system semaphore named 
  18422. process1.sem.  It then invokes process2 to run asynchronously. Finally, 
  18423. process1 sets the semaphore and waits, with a timeout of 4.5 seconds, for 
  18424. process2 to open the semaphore and clear it. Process1 resumes after this 
  18425. clearance. The following example is different from the one given for DosSemSet 
  18426. and DosSemWait only in that the set and wait functions are performed in one 
  18427. atomic step, via DosSemSetWait.  Hence, in the following example, there is no 
  18428. possibility for process1 to miss the notification because of a premature clear 
  18429. by process2. 
  18430.  
  18431. /* ----- process1.c ---- */
  18432.  
  18433. #define INCL_DOSSEMAPHORES
  18434. #define INCL_DOSPROCESS
  18435.  
  18436. #include <os2.h>
  18437.  
  18438. #define SEM_NAME "\\SEM\\process1.sem" /* Semaphore name */
  18439. #define TIMEOUT 4500L                  /* Timeout period */
  18440. #define START_PROGRAM "process2.exe"   /* Name of program file */
  18441.  
  18442. main()
  18443. {
  18444.   HSEM          SemHandle;
  18445.   CHAR          ObjFail [50];
  18446.   PSZ           Args;
  18447.   PSZ           Envs;
  18448.   RESULTCODES   ReturnCodes;
  18449.   USHORT        rc;
  18450.  
  18451.   printf("Process1 now running. \n");
  18452.   rc = DosCreateSem(CSEM_PUBLIC,       /* Ownership indicator */
  18453.                     &SemHandle,        /* Semaphore handle (returned) */
  18454.                     SEM_NAME);         /* Semaphore name string */
  18455.   printf("Process1.sem created; return code is %d \n", rc);
  18456.  
  18457.   /* Start a separate process */
  18458.   if(!(DosExecPgm(ObjFail,           /* Object name buffer */
  18459.                   sizeof(ObjFail),   /* Length of obj. name buffer */
  18460.                   EXEC_ASYNC,        /* Execution flag - asynchronous */
  18461.                   Args,              /* Ptr. to argument string */
  18462.                   Envs,              /* Ptr. to environment string */
  18463.                   &ReturnCodes,      /* Ptr. to resultcodes struct. */
  18464.                   START_PROGRAM)))   /* Name of program file */
  18465.     printf("Process2 started. Process1 will try to wait for notification. \n");
  18466.  
  18467.   /************* SET semaphore and WAIT for a notification ************/
  18468.   /*************   from process2 on process1.sem           ************/
  18469.  
  18470.   if((rc = DosSemSetWait(SemHandle,     /* Semaphore handle */
  18471.                          TIMEOUT)))     /* Timeout period */
  18472.  
  18473.   /****************************************/
  18474.   {
  18475.     /* No notification (either interrupt or timeout); error processing */
  18476.   }
  18477.   else
  18478.   {
  18479.     /* Notification received.  Normal processing */
  18480.     printf("Process2 cleared semaphore; process1 running again. \n");
  18481.   }
  18482. }
  18483.  
  18484. /* ----- process2.c ----*/
  18485.  
  18486. #define INCL_DOSSEMAPHORES
  18487.  
  18488. #include <os2.h>
  18489.  
  18490. #define SEM_NAME "\\SEM\\process1.sem"    /* Semaphore name */
  18491.  
  18492. main()
  18493. {
  18494.   HSEM SemHandle;
  18495.   USHORT rc;
  18496.  
  18497.   /* Obtain access to semaphore created by process1 via OPEN */
  18498.   if((rc=DosOpenSem(&SemHandle,           /* Semaphore handle
  18499.                                                   (returned) */
  18500.                     SEM_NAME)))           /* Semaphore Name */
  18501.   {
  18502.     /* Could not open -- error processing (switch on rc). */
  18503.   }
  18504.   else
  18505.   {
  18506.     /* Opened semaphore; normal processing.  Clear semaphore when done. */
  18507.     printf("Semaphore OPENED. \n");
  18508.     if(!(rc=DosSemClear(SemHandle)))      /* Semaphore handle */
  18509.       printf("Semaphore CLEARED. \n");
  18510.   }
  18511. }
  18512.  
  18513.  
  18514. ΓòÉΓòÉΓòÉ <hidden> DosSemWait ΓòÉΓòÉΓòÉ
  18515.  
  18516. #define INCL_DOSSEMAPHORES
  18517.  
  18518. USHORT  rc = DosSemWait(SemHandle, Timeout);
  18519.  
  18520. HSEM             SemHandle;     /* Semaphore handle */
  18521. LONG             Timeout;       /* Timeout (in milliseconds) */
  18522.  
  18523. USHORT           rc;            /* return code */
  18524.  
  18525. Example 
  18526.  
  18527. The following example illustrates the notification of an event between threads 
  18528. of different processes.  Process1 creates a nonexclusive system semaphore named 
  18529. process1.sem and sets it.  It then invokes process2 to run asynchronously. 
  18530. Process1 then waits, with a timeout of 4.5 seconds, for process2 to open the 
  18531. semaphore and clear it, thereby notifying process1 to resume. Notice that there 
  18532. is a small possibility of process1's missing the notification because process2 
  18533. may clear the semaphore before process1 issues DosSemWait. See the example for 
  18534. DosSemSetWait for an alternative that would correct this. 
  18535.  
  18536. /* ----- process1.c ---- */
  18537.  
  18538. #define INCL_DOSSEMAPHORES
  18539. #define INCL_DOSPROCESS
  18540.  
  18541. #include <os2.h>
  18542.  
  18543. #define SEM_NAME "\\SEM\\process1.sem" /* Semaphore name */
  18544. #define TIMEOUT 4500L                  /* Timeout period */
  18545. #define START_PROGRAM "process2.exe"   /* Name of program file */
  18546.  
  18547. main()
  18548. {
  18549.   HSEM          SemHandle;
  18550.   CHAR          ObjFail [50];
  18551.   PSZ           Args;
  18552.   PSZ           Envs;
  18553.   RESULTCODES   ReturnCodes;
  18554.   USHORT        rc;
  18555.  
  18556.   printf("Process1 now running. \n");
  18557.   rc = DosCreateSem(CSEM_PUBLIC,       /* Ownership - nonexclusive */
  18558.                     &SemHandle,        /* Semaphore handle (returned) */
  18559.                     SEM_NAME);         /* Semaphore name string */
  18560.   printf("Process1.sem created; return code is %d \n", rc);
  18561.  
  18562.   /*** SET the semaphore. ***/
  18563.   if((rc = DosSemSet(SemHandle)))      /* Semaphore handle */
  18564.  
  18565.   /****************************************/
  18566.   {
  18567.     /* Cannot set semaphore -- error processing */
  18568.   }
  18569.   /* Start a separate process */
  18570.   if(!(DosExecPgm(ObjFail,           /* Object name buffer */
  18571.                   sizeof(ObjFail),   /* Length of obj. name buffer */
  18572.                   EXEC_ASYNC,        /* Execution flag - asynchronous */
  18573.                   Args,              /* Ptr. to argument string */
  18574.                   Envs,              /* Ptr. to environment string */
  18575.                   &ReturnCodes,      /* Ptr. to resultcodes struct. */
  18576.                   START_PROGRAM)))   /* Name of program file */
  18577.     printf("Process2 started. Process1 will try to wait for notification. \n");
  18578.  
  18579.   /*** WAIT for a notification from process2 on process1.sem ***/
  18580.   if((rc = DosSemWait(SemHandle,     /* Semaphore handle */
  18581.                       TIMEOUT)))     /* Timeout period */
  18582.  
  18583.   /****************************************/
  18584.   {
  18585.     /* No notification (either interrupt or timeout); error processing */
  18586.   }
  18587.   else
  18588.   {
  18589.     /* Notification received.  Normal processing */
  18590.     printf("Process2 cleared semaphore; process1 running again. \n");
  18591.   }
  18592. }
  18593.  
  18594. /* ----- process2.c ----*/
  18595.  
  18596. #define INCL_DOSSEMAPHORES
  18597.  
  18598. #include <os2.h>
  18599.  
  18600. #define SEM_NAME "\\SEM\\process1.sem"    /* Semaphore name */
  18601.  
  18602. main()
  18603. {
  18604.   HSEM SemHandle;
  18605.   USHORT rc;
  18606.  
  18607.   /* Obtain access to semaphore created by process1 via OPEN */
  18608.   if((rc=DosOpenSem(&SemHandle,           /* Semaphore handle (returned) */
  18609.                     SEM_NAME)))           /* Semaphore Name */
  18610.  
  18611.   /****************************************/
  18612.   {
  18613.     /* Could not open -- error processing (switch on rc). */
  18614.   }
  18615.   else
  18616.   {
  18617.     /* Opened semaphore; normal processing.  Clear semaphore when done. */
  18618.     printf("Semaphore OPENED. \n");
  18619.     if(!(rc=DosSemClear(SemHandle)))      /* Semaphore handle */
  18620.       printf("Semaphore CLEARED. \n");
  18621.   }
  18622. }
  18623.  
  18624.  
  18625. ΓòÉΓòÉΓòÉ <hidden> DosSendSignal ΓòÉΓòÉΓòÉ
  18626.  
  18627. #define INCL_DOSSIGNALS
  18628.  
  18629. USHORT  rc = DosSendSignal(PID, SigNumber);
  18630.  
  18631. USHORT           PID;           /* PID of root of subtree */
  18632. USHORT           SigNumber;     /* Signal Number to send */
  18633.  
  18634. USHORT           rc;            /* return code */
  18635.  
  18636. Example 
  18637.  
  18638. The following example illustrates the use of the Ctrl-C (SIGINTR) signal to 
  18639. signal time-critical events.  Process1 invokes process2, which establishes a 
  18640. signal handler named CtrlC_Handler() and waits, by blocking on a reserved RAM 
  18641. semaphore, for a signal from process1. A portion of process2 is immune to 
  18642. signalling. 
  18643.  
  18644. /***** process1.c *****/
  18645.  
  18646. #define INCL_DOSPROCESS
  18647. #define INCL_DOSSIGNALS
  18648.  
  18649. #include <os2.h>
  18650.  
  18651. #define SLEEPTIME       200L              /* Sleep interval */
  18652. #define START_PROGRAM   "process2.exe"    /* Program name */
  18653.  
  18654.  
  18655. main()
  18656. {
  18657.   CHAR          ObjFail[50];
  18658.   PSZ           Args;
  18659.   PSZ           Envs;
  18660.   RESULTCODES   ReturnCodes;
  18661.   USHORT        rc;
  18662.  
  18663.   /* Start process2 and check its PID */
  18664.   if(!(DosExecPgm(ObjFail,               /* Object name buffer */
  18665.                   sizeof(ObjFail),       /* Length of obj. name buffer */
  18666.                   EXEC_ASYNC,            /* Execution flag */
  18667.                   Args,                  /* Ptr. to argument string */
  18668.                   Envs,                  /* Ptr. to environment string */
  18669.                   &ReturnCodes,          /* Ptr. to resultcodes
  18670.                                                  struct. */
  18671.                   START_PROGRAM)))       /* Name of program file */
  18672.     printf("Process2 started.\n");
  18673.   printf("Process2 ID is %d\n", ReturnCodes.codeTerminate);
  18674.  
  18675.   /* Sleep to give time slice to process2 */
  18676.   DosSleep(SLEEPTIME);                   /* Sleep interval */
  18677.  
  18678.   /*** After process2 sets signal handler, send process2 a signal ***/
  18679.   if(!(rc = DosSendSignal(ReturnCodes.codeTerminate,  /* PID of process2 */
  18680.                           SIG_CTRLC)))                /* Signal to send */
  18681.     printf("Ctrl-C signal sent from Process1 to Process2.\n");
  18682. }
  18683.  
  18684. /* ----- process2.c ----- */
  18685.  
  18686. #define INCL_DOSPROCESS
  18687. #define INCL_DOSSIGNALS
  18688. #define INCL_DOSERRORS
  18689.  
  18690. #include <os2.h>
  18691.  
  18692. #define SLEEPTIME         50L
  18693. #define TIMEOUT           5000L
  18694.  
  18695.  
  18696. VOID APIENTRY CtrlC_Handler(arg1, arg2)    /** Define signal handler **/
  18697.   USHORT      arg1;
  18698.   USHORT      arg2;
  18699. {
  18700.   printf("Handler for Ctrl-C now running.\n");
  18701.   return;
  18702. }
  18703.  
  18704.  
  18705. main()
  18706. {
  18707.   ULONG            RamSem = 0L;   /* Allocate and initialize Ram Semaphore */
  18708.   ULONG far        *RamSemHandle = &RamSem;  /* Ram Semaphore handle */
  18709.   USHORT           rc;
  18710.  
  18711.   /* Establish signal handler */
  18712.   if(!(rc=DosSetSigHandler((PFNSIGHANDLER) CtrlC_Handler,
  18713.                            NULL,          /* Previous handler - ignored */
  18714.                            NULL,          /* Previous action - ignored */
  18715.                            SIGA_ACCEPT,   /* Request type */
  18716.                            SIG_CTRLC)))   /* Signal number */
  18717.     printf("Process2 has set Ctrl-C handler.\n");
  18718.   else
  18719.     /* Error processing on rc */;
  18720.   /* Get semaphore for first time */
  18721.   if(!(rc=DosSemRequest(RamSemHandle,       /* Semaphore handle */
  18722.                         TIMEOUT)))          /* Timeout interval */
  18723.     printf("Semaphore obtained.\n");
  18724.  
  18725.   /*** Disable and then enable signal-handling ***/
  18726.   if(!(rc=DosHoldSignal(HLDSIG_DISABLE)))   /** Action code - disable **/
  18727.   {
  18728.     printf("Signalling DISABLED.\n");
  18729.  
  18730.     /* Do signal-proof work here */
  18731.     if(!(rc=DosHoldSignal(HLDSIG_ENABLE)))  /** Action code - enable **/
  18732.       printf("Signalling ENABLED.\n");
  18733.   }
  18734.   /* At this point, process1 may have sent a Ctrl-C signal. */
  18735.   /* Try to obtain semaphore again -- resulting in Timeout. */
  18736.   /* The Timeout, however, may be interrupted by the signal. */
  18737.  
  18738.   printf("Process2 will now wait on a Ramsem for a while.\n");
  18739.   if((rc=DosSemRequest(RamSemHandle,     /* Semaphore handle */
  18740.                        TIMEOUT))         /* Timeout interval */
  18741.      == ERROR_INTERRUPT)
  18742.   printf("Process2 interrupted while waiting, rc is %d.\n", rc);
  18743. }
  18744.  
  18745.  
  18746. ΓòÉΓòÉΓòÉ <hidden> DosSetCp ΓòÉΓòÉΓòÉ
  18747.  
  18748. #define INCL_DOSNLS
  18749.  
  18750. USHORT  rc = DosSetCp(CodePage, Reserved);
  18751.  
  18752. USHORT           CodePage;      /* Code page identifier */
  18753. USHORT           0;             /* Reserved, set to zero */
  18754.  
  18755. USHORT           rc;            /* return code */
  18756.  
  18757.  
  18758. ΓòÉΓòÉΓòÉ <hidden> DosSetDateTime ΓòÉΓòÉΓòÉ
  18759.  
  18760. typedef struct _DATETIME {  /* date */
  18761.  
  18762.   UCHAR   hours;            /* current hour */
  18763.   UCHAR   minutes;          /* current minute */
  18764.   UCHAR   seconds;          /* current second */
  18765.   UCHAR   hundredths;       /* current hundredths of a second */
  18766.   UCHAR   day;              /* current day */
  18767.   UCHAR   month;            /* current month */
  18768.   USHORT  year;             /* current year */
  18769.   SHORT   timezone;         /* minutes of time west of UTC */
  18770.   UCHAR   weekday;          /* current day of week */
  18771.  
  18772. } DATETIME;
  18773.  
  18774. #define INCL_DOSDATETIME
  18775.  
  18776. USHORT  rc = DosSetDateTime(DateTime);
  18777.  
  18778. PDATETIME        DateTime;      /* Date/time structure */
  18779.  
  18780. USHORT           rc;            /* return code */
  18781.  
  18782. Example 
  18783.  
  18784. The following example obtains and prints date and time information. It then 
  18785. changes the system date to 5/10/1987 and prints the updated information. 
  18786.  
  18787. #define INCL_DOSDATETIME
  18788.  
  18789. #include <os2.h>
  18790.  
  18791. main()
  18792. {
  18793.   DATETIME   DateTime;       /* Structure to hold date/time info. */
  18794.   USHORT     rc;
  18795.  
  18796.   rc = DosGetDateTime(&DateTime);     /* Address of d/t structure */
  18797.   printf("Today is %d-%d-%d; the time is %d:%d\n", DateTime.month,
  18798.          DateTime.day, DateTime.year, DateTime.hours, DateTime.minutes);
  18799.   DateTime.day = 10;
  18800.   DateTime.month = 5;
  18801.   DateTime.year = 1987;
  18802.   printf("The new date is %d-%d-%d; the time is %d:%d\n", DateTime.month,
  18803.          DateTime.day, DateTime.year, DateTime.hours, DateTime.minutes);
  18804.   rc = DosSetDateTime(&DateTime);    /* Address of d/t structure */
  18805.   printf("rc is %d\n", rc);
  18806.  }
  18807.  
  18808.  
  18809. ΓòÉΓòÉΓòÉ <hidden> DosSetFHandState ΓòÉΓòÉΓòÉ
  18810.  
  18811. #define INCL_DOSFILEMGR
  18812.  
  18813. USHORT  rc = DosSetFHandState(FileHandle, FileHandleState);
  18814.  
  18815. HFILE            FileHandle;      /* File handle */
  18816. USHORT           FileHandleState; /* File handle state */
  18817.  
  18818. USHORT           rc;              /* return code */
  18819.  
  18820.  
  18821. ΓòÉΓòÉΓòÉ <hidden> DosSetFileInfo ΓòÉΓòÉΓòÉ
  18822.  
  18823. typedef struct _FDATE {   /* fdate */
  18824.  
  18825.   unsigned day   : 5;     /* binary day for directory entry */
  18826.   unsigned month : 4;     /* binary month for directory entry */
  18827.   unsigned year  : 7;     /* binary year for directory entry */
  18828.  
  18829. } FDATE;
  18830.  
  18831. typedef struct _FTIME {       /* ftime */
  18832.  
  18833.   unsigned twosecs : 5;       /* binary number of two-second increments */
  18834.   unsigned minutes : 6;       /* binary number of minutes */
  18835.   unsigned hours   : 5;       /* binary number of hours */
  18836.  
  18837. } FTIME;
  18838.  
  18839. typedef struct _FILESTATUS {   /* fsts */
  18840.  
  18841.   FDATE  fdateCreation;        /* date of file creation */
  18842.   FTIME  ftimeCreation;        /* time of file creation */
  18843.   FDATE  fdateLastAccess;      /* date of last access */
  18844.   FTIME  ftimeLastAccess;      /* time of last access */
  18845.   FDATE  fdateLastWrite;       /* date of last write */
  18846.   FTIME  ftimeLastWrite;       /* time of last write */
  18847.   ULONG  cbFile;               /* file size (end of data) */
  18848.   ULONG  cbFileAlloc;          /* file allocated size */
  18849.   USHORT attrFile;             /* attributes of the file */
  18850.  
  18851. } FILESTATUS;
  18852.  
  18853. typedef struct _GEA {       /* gea */
  18854.  
  18855.   BYTE cbName;            /* name length not including NULL */
  18856.   CHAR szName[1];         /* attribute name */
  18857.  
  18858. } GEA;
  18859.  
  18860. typedef struct _GEALIST {   /* geal */
  18861.  
  18862.   ULONG  cbList;          /* total bytes of structure including full list */
  18863.   GEA list[1];            /* variable length GEA structures */
  18864.  
  18865. } GEALIST;
  18866.  
  18867. typedef struct _FEA {       /* fea */
  18868.  
  18869.   BYTE fEA;               /* flags */
  18870.   BYTE cbName;            /* name length not including NULL */
  18871.   USHORT cbValue;         /* value length */
  18872.  
  18873. } FEA;
  18874.  
  18875. typedef struct _FEALIST {   /* feal */
  18876.  
  18877.   ULONG  cbList;          /* total bytes of structure including full list */
  18878.   FEA list[1];            /* variable length FEA structures */
  18879.  
  18880. } FEALIST;
  18881.  
  18882. typedef struct _EAOP {      /* eaop */
  18883.  
  18884.   PGEALIST fpGEAList;     /* general EA list */
  18885.   PFEALIST fpFEAList;     /* full EA list */
  18886.   ULONG  oError;
  18887.  
  18888. } EAOP;
  18889.  
  18890. #define INCL_DOSFILEMGR
  18891.  
  18892. USHORT  rc = DosSetFileInfo(FileHandle, FileInfoLevel, FileInfoBuf,
  18893.                              FileInfoBufSize);
  18894.  
  18895. HFILE            FileHandle;      /* File handle */
  18896. USHORT           FileInfoLevel;   /* File info data required */
  18897. PBYTE            FileInfoBuf;     /* File info buffer */
  18898. USHORT           FileInfoBufSize; /* File info buffer size */
  18899.  
  18900. USHORT           rc;              /* return code */
  18901.  
  18902.  
  18903. ΓòÉΓòÉΓòÉ <hidden> DosSetFileMode ΓòÉΓòÉΓòÉ
  18904.  
  18905. #define INCL_DOSFILEMGR
  18906.  
  18907. USHORT  rc = DosSetFileMode(FileName, NewAttribute, Reserved);
  18908.  
  18909. PSZ              FileName;      /* File path name string */
  18910. USHORT           NewAttribute;  /* New attribute of file */
  18911. ULONG            0;             /* Reserved (must be zero) */
  18912.  
  18913. USHORT           rc;            /* return code */
  18914.  
  18915.  
  18916. ΓòÉΓòÉΓòÉ <hidden> DosSetFSInfo ΓòÉΓòÉΓòÉ
  18917.  
  18918. #define INCL_DOSFILEMGR
  18919.  
  18920. USHORT  rc = DosSetFSInfo(DriveNumber, FSInfoLevel, FSInfoBuf,
  18921.                            FSInfoBufSize);
  18922.  
  18923. USHORT           DriveNumber;   /* Drive number */
  18924. USHORT           FSInfoLevel;   /* File system data type */
  18925. PBYTE            FSInfoBuf;     /* File system info buffer */
  18926. USHORT           FSInfoBufSize; /* File system info buffer size */
  18927.  
  18928. USHORT           rc;            /* return code */
  18929.  
  18930.  
  18931. ΓòÉΓòÉΓòÉ <hidden> DosSetMaxFH ΓòÉΓòÉΓòÉ
  18932.  
  18933. #define INCL_DOSFILEMGR
  18934.  
  18935. USHORT  rc = DosSetMaxFH(NumberHandles);
  18936.  
  18937. USHORT           NumberHandles; /* Number of file handles */
  18938.  
  18939. USHORT           rc;            /* return code */
  18940.  
  18941.  
  18942. ΓòÉΓòÉΓòÉ <hidden> DosSetNmPHandState ΓòÉΓòÉΓòÉ
  18943.  
  18944. #define INCL_DOSNMPIPES
  18945.  
  18946. USHORT  rc = DosSetNmPHandState(Handle, PipeHandleState);
  18947.  
  18948. HPIPE            Handle;          /* Pipe handle */
  18949. USHORT           PipeHandleState; /* Pipe handle state */
  18950.  
  18951. USHORT           rc;              /* return code */
  18952.  
  18953.  
  18954. ΓòÉΓòÉΓòÉ <hidden> DosSetNmPipeSem ΓòÉΓòÉΓòÉ
  18955.  
  18956. #define INCL_DOSNMPIPES
  18957.  
  18958. USHORT  rc = DosSetNmPipeSem(Handle, SemHandle, KeyHandle);
  18959.  
  18960. HPIPE            Handle;        /* Pipe handle */
  18961. HSEM             SemHandle;     /* Semaphore handle */
  18962. USHORT           KeyHandle;     /* Key value */
  18963.  
  18964. USHORT           rc;            /* return code */
  18965.  
  18966.  
  18967. ΓòÉΓòÉΓòÉ <hidden> DosSetPathInfo ΓòÉΓòÉΓòÉ
  18968.  
  18969. typedef struct _GEA {       /* gea */
  18970.  
  18971.   BYTE cbName;            /* name length not including NULL */
  18972.   CHAR szName[1];         /* attribute name */
  18973.  
  18974. } GEA;
  18975.  
  18976. typedef struct _GEALIST {   /* geal */
  18977.  
  18978.   ULONG  cbList;          /* total bytes of structure including full list */
  18979.   GEA list[1];            /* variable length GEA structures */
  18980.  
  18981. } GEALIST;
  18982.  
  18983. typedef struct _FEA {       /* fea */
  18984.  
  18985.   BYTE fEA;               /* flags */
  18986.   BYTE cbName;            /* name length not including NULL */
  18987.   USHORT cbValue;         /* value length */
  18988.  
  18989. } FEA;
  18990.  
  18991. typedef struct _FEALIST {   /* feal */
  18992.  
  18993.   ULONG  cbList;          /* total bytes of structure including full list */
  18994.   FEA list[1];            /* variable length FEA structures */
  18995.  
  18996. } FEALIST;
  18997.  
  18998. typedef struct _EAOP {      /* eaop */
  18999.  
  19000.   PGEALIST fpGEAList;     /* general EA list */
  19001.   PFEALIST fpFEAList;     /* full EA list */
  19002.   ULONG  oError;
  19003.  
  19004. } EAOP;
  19005.  
  19006. #define INCL_DOSFILEMGR
  19007.  
  19008. USHORT  rc = DosSetPathInfo(PathName, PathInfoLevel, PathInfoBuf,
  19009.                               PathInfoBufSize, PathInfoFlags, 0);
  19010.  
  19011. PSZ              PathName;        /* File or directory path name string */
  19012. USHORT           PathInfoLevel;   /* Info data type */
  19013. PBYTE            PathInfoBuf;     /* Info buffer  */
  19014. USHORT           PathInfoBufSize; /* Info buffer size */
  19015. USHORT           PathInfoFlags;   /* Path info flags */
  19016. ULONG            0;               /* Reserved (must be zero)  */
  19017.  
  19018. USHORT           rc;              /* return code */
  19019.  
  19020.  
  19021. ΓòÉΓòÉΓòÉ <hidden> DosSetProcCp ΓòÉΓòÉΓòÉ
  19022.  
  19023. #define INCL_DOSNLS
  19024.  
  19025. USHORT  rc = DosSetProcCp(CodePage, Reserved);
  19026.  
  19027. USHORT           CodePage;      /* Code page identifier */
  19028. USHORT           0;             /* Reserved, set to zero */
  19029.  
  19030. USHORT           rc;            /* return code */
  19031.  
  19032.  
  19033. ΓòÉΓòÉΓòÉ <hidden> DosSetPrty ΓòÉΓòÉΓòÉ
  19034.  
  19035. #define INCL_DOSPROCESS
  19036.  
  19037. USHORT  rc = DosSetPrty(Scope, PriorityClass, PriorityDelta, ID);
  19038.  
  19039. USHORT           Scope;         /* Indicate scope of change */
  19040. USHORT           PriorityClass; /* Priority class to set */
  19041. SHORT            PriorityDelta; /* Priority delta to apply */
  19042. USHORT           ID;            /* Process or thread ID */
  19043.  
  19044. USHORT           rc;            /* return code */
  19045.  
  19046. Example 
  19047.  
  19048. The following example illustrates how to obtain the priority of a thread and 
  19049. how to change the priority.  The main thread creates Thread2 and allows it to 
  19050. begin executing.  Thread2  iterates through a loop that prints a line and then 
  19051. sleeps, relinquishing its time slice to the main thread. After one or two 
  19052. iterations by Thread2, the main thread obtains Thread2's priority information 
  19053. and prints it.  It then raises Thread2's priority to fixed-high, and increments 
  19054. the level by ten.  Since Thread2 is now at a high priority, it immediately 
  19055. finishes its remaining iterations before relinquishing control on a long sleep; 
  19056. at this point, the main thread re-examines Thread2's priority and reports its 
  19057. new priority level.  In this example, it is helpful to understand how the 
  19058. DosSleep calls are used either to relinquish control of the processor, or to 
  19059. keep a thread alive (see DosTimerAsync or DosTimerStart for alternatives to 
  19060. DosSleep). 
  19061.  
  19062. #define INCL_DOSPROCESS
  19063.  
  19064. #include <os2.h>
  19065.  
  19066. #define      PRTYC_FIXEDHIGH   4         /* Priority class: fixed-high */
  19067. #define      PRTY_DELTA        10        /* Priority delta: increase
  19068.                                                 by 10 */
  19069. #define      SEGSIZE           4000      /* Number of bytes requested in
  19070.                                              segment */
  19071. #define      ALLOCFLAGS        0         /* Segment allocation flags - no
  19072.                                              sharing */
  19073. #define      SLEEPSHORT        0L        /* Sleep interval -
  19074.                                              5 milliseconds */
  19075. #define      SLEEPLONG         20L       /* Sleep interval -
  19076.                                              75 milliseconds */
  19077. #define      RETURN_CODE       0         /* Return code for DosExit() */
  19078.  
  19079.  
  19080. VOID APIENTRY Thread2()
  19081. {
  19082.   USHORT     i;
  19083.  
  19084.   /* Loop with four iterations */
  19085.   for(i=1; i<5; i++)
  19086.   {
  19087.     printf("In Thread2, i is now %d\n", i);
  19088.  
  19089.     /** Sleep to relinquish time slice to main thread **/
  19090.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  19091.   }
  19092.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  19093.           RETURN_CODE);            /* Return code */
  19094. }
  19095.  
  19096. main()
  19097. {
  19098.   USHORT     Priority;            /* Thread priority */
  19099.   USHORT     Class;               /* Priority class */
  19100.   USHORT     Level;               /* Priority level */
  19101.   SEL        ThreadStackSel;      /* Segment selector for thread stack */
  19102.   PBYTE      StackEnd;            /* Ptr. to end of thread stack */
  19103.   USHORT     rc;
  19104.  
  19105.   /* Allocate segment for thread stack; this is better than just */
  19106.   /* declaring an array of bytes to use as a stack.  Make pointer eos. */
  19107.   rc = DosAllocSeg(SEGSIZE,                    /* Number of bytes
  19108.                                                    requested */
  19109.                    &ThreadStackSel,            /* Segment selector
  19110.                                                        (returned) */
  19111.                    ALLOCFLAGS);                /* Allocation flags */
  19112.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  19113.  
  19114.   /* Start Thread2 */
  19115.   if(!(DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  19116.                        &ThreadID,              /* Thread ID (returned) */
  19117.                        StackEnd)))             /* End of thread stack */
  19118.     printf("Thread2 created.\n");
  19119.  
  19120.   /** Sleep to allow Thread2 to execute **/
  19121.   if(!(DosSleep(SLEEPLONG)))                       /* Sleep interval */
  19122.     printf("Slept a little to let Thread2 execute.\n");
  19123.  
  19124.   /** Obtain Thread2's priority information and report it **/
  19125.   if(!(rc=DosGetPrty(PRTYS_THREAD,                /* Scope - single
  19126.                                                          thread */
  19127.                      &Priority,                   /* Address to put
  19128.                                                           priority */
  19129.                      ThreadID)))                  /* ID - thread ID */
  19130.   {
  19131.     /* Extract priority class and level information */
  19132.     Class = HIBYTE(Priority);
  19133.     Level = LOBYTE(Priority);
  19134.     printf("Thread2: ID is %d, Priority Class is %d and Level is %d\n",
  19135.            ThreadID, Class, Level);
  19136.   }
  19137.   /** Raise Thread2's priority **/
  19138.   if(!(rc=DosSetPrty(PRTYS_THREAD,             /* Scope - single thread */
  19139.                      PRTYC_FIXEDHIGH,          /* Prty class -
  19140.                                                       fixed-high */
  19141.                      PRTY_DELTA,               /* Prty delta - increase
  19142.                                                       by 10 */
  19143.                      ThreadID)))               /* ID - thread ID */
  19144.   {
  19145.     /* Obtain Thread2' new priority information and report it */
  19146.     rc=DosGetPrty(PRTYS_THREAD,                /* Scope - single thread */
  19147.                   &Priority,                   /* Address to put
  19148.                                                        priority */
  19149.                   ThreadID);                   /* ID - thread ID */
  19150.  
  19151.     /* Extract priority class and level information */
  19152.     Class = HIBYTE(Priority);
  19153.     Level = LOBYTE(Priority);
  19154.     printf("Thread2: ID is %d, New Priority Class is %d and Level is %d\n",
  19155.            ThreadID, Class, Level);
  19156.   }
  19157. }
  19158.  
  19159.  
  19160. ΓòÉΓòÉΓòÉ <hidden> DosSetSession ΓòÉΓòÉΓòÉ
  19161.  
  19162. typedef struct _STATUSDATA {   /* stsdata */
  19163.  
  19164.   USHORT Length;               /* length of this data structure */
  19165.   USHORT SelectInd;            /* 0=leave setting unchanged, 1=selectable
  19166.                                     2=non-selectable */
  19167.   USHORT BondInd;              /* which session to bring to foreground */
  19168.  
  19169. } STATUSDATA;
  19170.  
  19171. #define INCL_DOSSESMGR
  19172.  
  19173. USHORT  rc = DosSetSession(SessID, StatusData);
  19174.  
  19175. USHORT           SessID;        /* Session ID */
  19176. PSTATUSDATA      StatusData;    /* Session status data */
  19177.  
  19178. USHORT           rc;            /* return code */
  19179.  
  19180.  
  19181. ΓòÉΓòÉΓòÉ <hidden> DosSetSigHandler ΓòÉΓòÉΓòÉ
  19182.  
  19183. #define INCL_DOSSIGNALS
  19184.  
  19185. USHORT  rc = DosSetSigHandler(Routine, PrevAddress, PrevAction, Action,
  19186.                              SigNumber);
  19187.  
  19188. PFNSIGHANDLER       Routine;     /* Signal handler */
  19189. PFNSIGHANDLER FAR * PrevAddress; /* Previous handler (returned) */
  19190. PUSHORT             PrevAction;  /* Previous action (returned) */
  19191. USHORT              Action;      /* Indicate request type */
  19192. USHORT              SigNumber;   /* Signal number of interest */
  19193.  
  19194. USHORT              rc;          /* return code */
  19195.  
  19196. Example 
  19197.  
  19198. The following example illustrates the use of a user-defined flag to signal 
  19199. time-critical events.  The main thread installs a routine, named 
  19200. FlagA_Handler(), as the signal handler for user-defined Flag A.  It then 
  19201. creates a thread and blocks on a reserved RAM semaphore; this thread obtains 
  19202. its process ID and signals the main thread via Flag A.  The main thread 
  19203. responds by executing the signal handler. 
  19204.  
  19205. #define INCL_DOSPROCESS
  19206. #define INCL_DOSSIGNALS
  19207. #define INCL_DOSERRORS
  19208.  
  19209. #include <os2.h>
  19210.  
  19211. #define TIMEOUT           5000L
  19212.  
  19213. TID         ThreadID;
  19214. BYTE        ThreadStack[4000];
  19215.  
  19216. VOID APIENTRY FlagA_Handler(arg1, arg2)       /* Define signal handler */
  19217.   USHORT      arg1;
  19218.   USHORT      arg2;
  19219. {
  19220.   printf("Handler for Flag A now running.\n");
  19221.   return;
  19222. }
  19223.  
  19224. VOID APIENTRY Thread_A()
  19225. {
  19226.   PIDINFO     PidInfo;
  19227.   USHORT      FlagArg;
  19228.   USHORT      rc;
  19229.  
  19230.   DosGetPID(&PidInfo);
  19231.   printf("Process ID is %d\n", PidInfo.pid);
  19232.   if(!(rc = DosFlagProcess(PidInfo.pid,
  19233.                            FLGP_PID,
  19234.                            PFLG_A,
  19235.                            FlagArg)))
  19236.     printf("FlagA signal sent from ThreadA to main thread.\n");
  19237.   else
  19238.     printf("FlagProcess rc is %d\n", rc)/* Error processing on rc */;
  19239.   DosExit(EXIT_THREAD,                 /* Action Code */
  19240.           RETURN_CODE);                /* Result Code */
  19241.  
  19242. }
  19243.  
  19244. main()
  19245. {
  19246.   ULONG            RamSem = 0L;
  19247.   ULONG far        *RamSemHandle = &RamSem;
  19248.   USHORT           rc;
  19249.  
  19250.   if(!(rc=DosSetSigHandler((PFNSIGHANDLER) FlagA_Handler,
  19251.                            NULL,
  19252.                            NULL,
  19253.                            SIGA_ACCEPT,
  19254.                            SIG_PFLG_A)))
  19255.     printf("Main thread has set FlagA handler.\n");
  19256.   else
  19257.     /* Error processing on rc */;
  19258.   if(!(rc=DosSemRequest(RamSemHandle,
  19259.                         TIMEOUT)))
  19260.     printf("Semaphore obtained.\n");
  19261.   if(!(DosCreateThread((PFNTHREAD) Thread_A,
  19262.                         &ThreadID,
  19263.                         &ThreadStack[3999])))
  19264.     printf("ThreadA created.\n");
  19265.   printf("Main thread will now wait on a Ramsem for a while.\n");
  19266.   if((rc=DosSemRequest(RamSemHandle,
  19267.                        TIMEOUT))
  19268.        == ERROR_INTERRUPT)
  19269.   printf("Main thread interrupted while waiting, rc is %d.\n", rc);
  19270. }
  19271.  
  19272.  
  19273. ΓòÉΓòÉΓòÉ <hidden> DosSetVec ΓòÉΓòÉΓòÉ
  19274.  
  19275. #define INCL_DOSMISC
  19276.  
  19277. USHORT  rc = DosSetVec(VecNum, Routine, PrevAddress);
  19278.  
  19279. USHORT           VecNum;             /* Function request code */
  19280. PFN              Routine;            /* Handler routine */
  19281. PFN              PrevAddress;        /* Previous handler address
  19282.                                          (returned) */
  19283.  
  19284. USHORT                   rc;         /* return code */
  19285.  
  19286.  
  19287. ΓòÉΓòÉΓòÉ <hidden> DosSetVerify ΓòÉΓòÉΓòÉ
  19288.  
  19289. #define INCL_DOSFILEMGR
  19290.  
  19291. USHORT  rc = DosSetVerify(VerifySetting);
  19292.  
  19293. USHORT           VerifySetting; /* New value of verify switch */
  19294.  
  19295. USHORT           rc;            /* return code */
  19296.  
  19297.  
  19298. ΓòÉΓòÉΓòÉ <hidden> DosSizeSeg ΓòÉΓòÉΓòÉ
  19299.  
  19300. #define INCL_DOSMEMMGR
  19301.  
  19302. USHORT  rc = DosSizeSeg(Selector, Size);
  19303.  
  19304. SEL              Selector;      /* Selector/Segment */
  19305. PULONG           Size;          /* Size of segment (returned) */
  19306.  
  19307. USHORT           rc;            /* return code */
  19308.  
  19309.  
  19310. ΓòÉΓòÉΓòÉ <hidden> DosShutdown ΓòÉΓòÉΓòÉ
  19311.  
  19312. #define INCL_DOSFILEMGR
  19313.  
  19314. USHORT  rc = DosShutdown(Reserved);
  19315.  
  19316. ULONG            Reserved;      /* Reserved, must be set to zero */
  19317.  
  19318. USHORT           rc;            /* return code */
  19319.  
  19320.  
  19321. ΓòÉΓòÉΓòÉ <hidden> DosSleep ΓòÉΓòÉΓòÉ
  19322.  
  19323. #define INCL_DOSPROCESS
  19324.  
  19325. USHORT  rc = DosSleep(TimeInterval);
  19326.  
  19327. ULONG            TimeInterval;  /* Interval size (in milliseconds) */
  19328.  
  19329. USHORT           rc;            /* return code */
  19330.  
  19331. Example 
  19332.  
  19333. The following example illustrates how to obtain the priority of a thread and 
  19334. how to change the priority.  The main thread creates Thread2 and allows it to 
  19335. begin executing.  Thread2  iterates through a loop that prints a line and then 
  19336. sleeps, relinquishing its time slice to the main thread. After one or two 
  19337. iterations by Thread2, the main thread obtains Thread2's priority information 
  19338. and prints it.  It then raises Thread2's priority to fixed-high, and increments 
  19339. the level by ten.  Since Thread2 is now at a high priority, it immediately 
  19340. finishes its remaining iterations before relinquishing control on a long sleep; 
  19341. at this point, the main thread re-examines Thread2's priority and reports its 
  19342. new priority level.  In this example, it is helpful to understand how the 
  19343. DosSleep calls are used either to relinquish control of the processor, or to 
  19344. keep a thread alive (see DosTimerAsync or DosTimerStart for alternatives to 
  19345. DosSleep). 
  19346.  
  19347. #define INCL_DOSPROCESS
  19348.  
  19349. #include <os2.h>
  19350.  
  19351. #define    PRTYC_FIXEDHIGH   4      /* Priority class: fixed-high */
  19352. #define    PRTY_DELTA        10     /* Priority delta: increase by 10 */
  19353. #define    SEGSIZE           4000   /* Number of bytes requested in segment */
  19354. #define    ALLOCFLAGS        0      /* Segment allocation flags - no sharing */
  19355. #define    SLEEPSHORT        0L     /* Sleep interval - 5 milliseconds */
  19356. #define    SLEEPLONG         20L    /* Sleep interval - 75 milliseconds */
  19357. #define    RETURN_CODE       0      /* Return code for DosExit() */
  19358.  
  19359.  
  19360. VOID APIENTRY Thread2()
  19361. {
  19362.   USHORT     i;
  19363.  
  19364.   /* Loop with four iterations */
  19365.   for(i=1; i<5; i++)
  19366.   {
  19367.     printf("In Thread2, i is now %d\n", i);
  19368.  
  19369.     /** Sleep to relinquish time slice to main thread **/
  19370.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  19371.   }
  19372.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  19373.           RETURN_CODE);            /* Return code */
  19374. }
  19375.  
  19376. main()
  19377. {
  19378.   USHORT     Priority;            /* Thread priority */
  19379.   USHORT     Class;               /* Priority class */
  19380.   USHORT     Level;               /* Priority level */
  19381.   SEL        ThreadStackSel;      /* Segment selector for thread stack */
  19382.   PBYTE      StackEnd;            /* Ptr. to end of thread stack */
  19383.   USHORT     rc;
  19384.  
  19385.   /* Allocate segment for thread stack; this is better than just */
  19386.   /* declaring an array of bytes to use as a stack.  Make pointer eos. */
  19387.   rc = DosAllocSeg(SEGSIZE,                    /* Number of bytes requested */
  19388.                    &ThreadStackSel,            /* Segment selector
  19389.                                                        (returned) */
  19390.                    ALLOCFLAGS);                /* Allocation flags */
  19391.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  19392.  
  19393.   /* Start Thread2 */
  19394.   if(!(DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  19395.                        &ThreadID,              /* Thread ID (returned) */
  19396.                        StackEnd)))             /* End of thread stack */
  19397.     printf("Thread2 created.\n");
  19398.  
  19399.   /** Sleep to allow Thread2 to execute **/
  19400.   if(!(DosSleep(SLEEPLONG)))                       /* Sleep interval */
  19401.     printf("Slept a little to let Thread2 execute.\n");
  19402.  
  19403.   /** Obtain Thread2's priority information and report it **/
  19404.   if(!(rc=DosGetPrty(PRTYS_THREAD,                /* Scope - single
  19405.                                                          thread */
  19406.                      &Priority,                   /* Address to put
  19407.                                                           priority */
  19408.                      ThreadID)))                  /* ID - thread ID */
  19409.   {
  19410.     /* Extract priority class and level information */
  19411.     Class = HIBYTE(Priority);
  19412.     Level = LOBYTE(Priority);
  19413.     printf("Thread2: ID is %d, Priority Class is %d and Level is %d\n",
  19414.            ThreadID, Class, Level);
  19415.   }
  19416.   /** Raise Thread2's priority **/
  19417.   if(!(rc=DosSetPrty(PRTYS_THREAD,             /* Scope - single thread */
  19418.                      PRTYC_FIXEDHIGH,          /* Prty class - fixed-high */
  19419.                      PRTY_DELTA,               /* Prty delta - increase
  19420.                                                       by 10 */
  19421.                      ThreadID)))               /* ID - thread ID */
  19422.   {
  19423.     /* Obtain Thread2' new priority information and report it */
  19424.     rc=DosGetPrty(PRTYS_THREAD,                /* Scope - single thread */
  19425.                   &Priority,                   /* Address to put
  19426.                                                        priority */
  19427.                   ThreadID);                   /* ID - thread ID */
  19428.  
  19429.     /* Extract priority class and level information */
  19430.     Class = HIBYTE(Priority);
  19431.     Level = LOBYTE(Priority);
  19432.     printf("Thread2: ID is %d, New Priority Class is %d and Level is %d\n",
  19433.            ThreadID, Class, Level);
  19434.   }
  19435. }
  19436.  
  19437.  
  19438. ΓòÉΓòÉΓòÉ <hidden> DosSMRegisterDD ΓòÉΓòÉΓòÉ
  19439.  
  19440. #define INCL_DOSFILEMGR
  19441.  
  19442. USHORT  rc = DosSMRegisterDD(RegisterData);
  19443.  
  19444. PREGISTERDATA RegisterData;          /* Data packet  */
  19445.  
  19446. USHORT           rc;            /* return code */
  19447.  
  19448.  
  19449. ΓòÉΓòÉΓòÉ <hidden> DosStartSession ΓòÉΓòÉΓòÉ
  19450.  
  19451. typedef struct _STARTDATA {   /* stdata */
  19452.  
  19453.   USHORT cb;                  /* length of data structure in bytes */
  19454.   USHORT Related;             /* 0=independent session, 1=child session */
  19455.   USHORT FgBg;             /* 0=start in foreground, 1=start in background */
  19456.   USHORT TraceOpt;            /* 0=no trace, 1=trace */
  19457.   PSZ    PgmTitle;            /* address of program title */
  19458.   PSZ    PgmName;             /* address of program name */
  19459.   PBYTE  PgmInputs;           /* input arguments */
  19460.   PBYTE  TermQ;               /* address of program queue name */
  19461.   PBYTE  Environment;         /* address of environment string */
  19462.   USHORT InheritOpt;          /* inherit option (shell of program) */
  19463.   USHORT SessionType;         /* session type (standard, windowed, ...) */
  19464.   PSZ    IconFile;            /* address of icon definition */
  19465.   ULONG  PgmHandle;           /* program handle */
  19466.   USHORT PgmControl;          /* initial state of windowed application */
  19467.   USHORT InitXPos;            /* x coordinate of initial session window */
  19468.   USHORT InitYPos;            /* y coordinate of initial session window */
  19469.   USHORT InitXSize;           /* initial size of x */
  19470.   USHORT InitYSize;           /* initial size of y */
  19471.  
  19472. } STARTDATA;
  19473.  
  19474. #define INCL_DOSSESMGR
  19475.  
  19476. USHORT  rc = DosStartSession(StartData, SessID, PID);
  19477.  
  19478. PSTARTDATA       StartData;     /* Start session data */
  19479. PUSHORT          SessID;        /* Session ID (returned) */
  19480. PUSHORT          PID;           /* Process ID (returned) */
  19481.  
  19482. USHORT           rc;            /* return code */
  19483.  
  19484.  
  19485. ΓòÉΓòÉΓòÉ <hidden> DosStopSession ΓòÉΓòÉΓòÉ
  19486.  
  19487. #define INCL_DOSSESMGR
  19488.  
  19489. USHORT  rc = DosStopSession(TargetOption, SessID, Reserved);
  19490.  
  19491. USHORT           TargetOption;  /* Target option */
  19492. USHORT           SessID;        /* Session ID */
  19493. ULONG            0;             /* Reserved (must be zero) */
  19494.  
  19495. USHORT           rc;            /* return code */
  19496.  
  19497.  
  19498. ΓòÉΓòÉΓòÉ <hidden> DosSubAlloc ΓòÉΓòÉΓòÉ
  19499.  
  19500. #define INCL_DOSMEMMGR
  19501.  
  19502. USHORT  rc = DosSubAlloc(SegSelector, BlockOffset, Size);
  19503.  
  19504. SEL              SegSelector;   /* Segment selector */
  19505. PUSHORT          BlockOffset;   /* Block Offset (returned) */
  19506. USHORT           Size;          /* Size of requested block */
  19507.  
  19508. USHORT           rc;            /* return code */
  19509.  
  19510.  
  19511. ΓòÉΓòÉΓòÉ <hidden> DosSubFree ΓòÉΓòÉΓòÉ
  19512.  
  19513. #define INCL_DOSMEMMGR
  19514.  
  19515. USHORT  rc = DosSubFree(SegSelector, BlockOffset, Size);
  19516.  
  19517. SEL              SegSelector;   /* Segment selector */
  19518. USHORT           BlockOffset;   /* Offset of memory block to free */
  19519. USHORT           Size;          /* Size of block in bytes */
  19520.  
  19521. USHORT           rc;            /* return code */
  19522.  
  19523.  
  19524. ΓòÉΓòÉΓòÉ <hidden> DosSubSet ΓòÉΓòÉΓòÉ
  19525.  
  19526. #define INCL_DOSMEMMGR
  19527.  
  19528. USHORT  rc = DosSubSet(SegSelector, Flags, Size);
  19529.  
  19530. SEL              SegSelector;   /* Segment selector */
  19531. USHORT           Flags;         /* Parameter flags */
  19532. USHORT           Size;          /* Size of a block */
  19533.  
  19534. USHORT           rc;            /* return code */
  19535.  
  19536.  
  19537. ΓòÉΓòÉΓòÉ <hidden> DosSuspendThread ΓòÉΓòÉΓòÉ
  19538.  
  19539. #define INCL_DOSPROCESS
  19540.  
  19541. USHORT  rc = DosSuspendThread(ThreadID);
  19542.  
  19543. TID              ThreadID;      /* Thread ID */
  19544.  
  19545. USHORT           rc;            /* return code */
  19546.  
  19547. Example 
  19548.  
  19549. The following example shows how to suspend and resume execution of a thread 
  19550. within a process.  The main thread creates Thread2 and allows it to begin 
  19551. executing.  Thread2 iterates through a loop that prints a line and then sleeps, 
  19552. relinquishing its time slice to the main thread. After one iteration by 
  19553. Thread2, the main thread suspends Thread2 and then resumes it.  Subsequently, 
  19554. Thread2 completes the remaining three iterations. 
  19555.  
  19556. #define INCL_DOSPROCESS
  19557.  
  19558. #include <os2.h>
  19559.  
  19560. #define   SEGSIZE       4000   /* Number of bytes requested in segment */
  19561. #define   ALLOCFLAGS    0      /* Segment allocation flags - no sharing */
  19562. #define   SLEEPSHORT    5L     /* Sleep interval - 5 milliseconds */
  19563. #define   SLEEPLONG     75L    /* Sleep interval - 75 milliseconds */
  19564. #define   RETURN_CODE   0      /* Return code for DosExit() */
  19565.  
  19566. VOID APIENTRY Thread2()
  19567. {
  19568.   USHORT     i;
  19569.  
  19570.   /* Loop with four iterations */
  19571.   for(i=1; i<5; i++)
  19572.   {
  19573.     printf("In Thread2, i is now %d\n", i);
  19574.  
  19575.     /* Sleep to relinquish time slice to main thread */
  19576.     DosSleep(SLEEPSHORT);          /* Sleep interval */
  19577.   }
  19578.   DosExit(EXIT_THREAD,             /* Action code - end a thread */
  19579.           RETURN_CODE);            /* Return code */
  19580. }
  19581.  
  19582. main()
  19583. {
  19584.   TID        ThreadID;             /* Thread identification */
  19585.   SEL        ThreadStackSel;       /* Segment selector for thread stack */
  19586.   PBYTE      StackEnd;             /* Ptr. to end of thread stack */
  19587.   USHORT     rc;
  19588.  
  19589.   /** Allocate segment for thread stack; make pointer to end of stack. **/
  19590.   /**  We must allocate a segment in order to preserve segment
  19591.   /**  protection for the thread.  **/
  19592.  
  19593.   rc = DosAllocSeg(SEGSIZE,             /* Number of bytes requested */
  19594.                    &ThreadStackSel,     /* Segment selector
  19595.                                                 (returned) */
  19596.                    ALLOCFLAGS);         /* Allocation flags - no sharing */
  19597.   StackEnd = MAKEP(ThreadStackSel, SEGSIZE-1);
  19598.  
  19599.   /** Start Thread2 **/
  19600.   if(!(rc=DosCreateThread((PFNTHREAD) Thread2,    /* Thread address */
  19601.                        &ThreadID,                 /* Thread ID
  19602.                                                           (returned) */
  19603.                        StackEnd)))   /* End of thread stack */
  19604.     printf("Thread2 created.\n");
  19605.  
  19606.   /* Sleep to relinquish time slice to Thread2 */
  19607.   if(!(DosSleep(SLEEPSHORT)))                  /* Sleep interval */
  19608.     printf("Slept a little to let Thread2 execute.\n");
  19609.  
  19610.   /***** Suspend Thread2, do some work, then resume Thread2 *****/
  19611.   if(!(rc=DosSuspendThread(ThreadID)))         /* Thread ID */
  19612.     printf("Thread2 SUSPENDED.\n");
  19613.   printf("Perform work that will not be interrupted by Thread2.\n");
  19614.   if(!(rc=DosResumeThread(ThreadID)))          /* Thread ID */
  19615.     printf("Thread2 RESUMED.\n");
  19616.   printf("Now we may be interrupted by Thread2.\n");
  19617.  
  19618.   /* Sleep to allow Thread2 to complete */
  19619.   DosSleep(SLEEPLONG);                         /* Sleep interval */
  19620. }
  19621.  
  19622.  
  19623. ΓòÉΓòÉΓòÉ <hidden> DosTimerAsync ΓòÉΓòÉΓòÉ
  19624.  
  19625. #define INCL_DOSDATETIME
  19626.  
  19627. USHORT  rc = DosTimerAsync(TimeInterval, SemHandle, Handle);
  19628.  
  19629. ULONG            TimeInterval;  /* Interval size (in milliseconds) */
  19630. HSEM             SemHandle;     /* System semaphore handle */
  19631. PHTIMER          Handle;        /* Timer handle (returned) */
  19632.  
  19633. USHORT           rc;            /* return code */
  19634.  
  19635. Example 
  19636.  
  19637. The following example sets an asynchronous one-shot timer for one second. It 
  19638. then sets an asynchronous recurring timer with a one-second interval, reporting 
  19639. each time an interval elapses.  Finally, it stops the recurring timer. 
  19640.  
  19641. #define INCL_DOSDATETIME
  19642. #define INCL_DOSSEMAPHORES
  19643.  
  19644. #include <os2.h>
  19645.  
  19646. #define SEM_NAME        "\\SEM\\timer.sem"  /* Semaphore name */
  19647. #define TIME_INTERVAL   1000L               /* Timer interval
  19648.                                                    (in milliseconds) */
  19649.  
  19650. main()
  19651. {
  19652.   HSEM      SemHandle;
  19653.   HTIMER    TimerHandle;
  19654.   USHORT    i;
  19655.   USHORT    rc;
  19656.  
  19657.   /* Create system semaphore to be used by timers */
  19658.   DosCreateSem(CSEM_PUBLIC,        /* Ownership - nonexclusive */
  19659.                &SemHandle,         /* Semaphore handle (returned) */
  19660.                SEM_NAME);          /* Semaphore name */
  19661.  
  19662.   /* Set the semaphore, then start a one-shot timer */
  19663.   if(!DosSemSet(SemHandle))        /* Semaphore handle */
  19664.     printf("Semaphore set.\n");
  19665.   if(!(rc=DosTimerAsync(TIME_INTERVAL,    /* Timer interval */
  19666.                         SemHandle,        /* Semaphore handle */
  19667.                         &TimerHandle)))   /* Timer handle (returned) */
  19668.     printf("One shot timer for %f seconds started.\n", TIME_INTERVAL/1000.0);
  19669.  
  19670.   /* Report when timer expires (other work may be done here) */
  19671.   if(!DosSemWait(SemHandle,               /* Semaphore handle */
  19672.                  SEM_INDEFINITE_WAIT))    /* Timeout period -
  19673.                                                     indefinite */
  19674.     printf("Time interval has elapsed.\n");
  19675.  
  19676.   /* Start a recurring timer */
  19677.   if(!(rc=DosTimerStart(TIME_INTERVAL,    /* Timer interval */
  19678.                         SemHandle,        /* Semaphore handle */
  19679.                         &TimerHandle)))   /* Timer handle (returned) */
  19680.     printf("Recurring timer with %f second interval started.\n",
  19681.            TIME_INTERVAL/1000.0);
  19682.   /*  */
  19683.   for(i=1; i<4; i++)
  19684.     if(!DosSemSetWait(SemHandle,             /* Semaphore handle */
  19685.                       SEM_INDEFINITE_WAIT))  /* Timeout period -
  19686.                                                        indefinite */
  19687.       printf("Recurring timer cleared semaphore %d times.\n", i);
  19688.   if(!(rc=DosTimerStop(TimerHandle)))        /* Timer handle */
  19689.     printf("Recurring timer has been stopped.\n");
  19690. }
  19691.  
  19692.  
  19693. ΓòÉΓòÉΓòÉ <hidden> DosTimerStart ΓòÉΓòÉΓòÉ
  19694.  
  19695. #define INCL_DOSDATETIME
  19696.  
  19697. USHORT  rc = DosTimerStart(TimeInterval, SemHandle, Handle);
  19698.  
  19699. ULONG            TimeInterval;  /* Interval size (in milliseconds) */
  19700. HSEM             SemHandle;     /* System semaphore handle */
  19701. PHTIMER          Handle;        /* Timer handle (returned) */
  19702.  
  19703. USHORT           rc;            /* return code */
  19704.  
  19705. Example 
  19706.  
  19707. The following example sets an asynchronous one-shot timer for one second. It 
  19708. then sets an asynchronous recurring timer with a one-second interval, reporting 
  19709. each time an interval elapses.  Finally, it stops the recurring timer. 
  19710.  
  19711. #define INCL_DOSDATETIME
  19712. #define INCL_DOSSEMAPHORES
  19713.  
  19714. #include <os2.h>
  19715.  
  19716. #define SEM_NAME        "\\SEM\\timer.sem"  /* Semaphore name */
  19717. #define TIME_INTERVAL   1000L               /* Timer interval
  19718.                                                    (in milliseconds) */
  19719.  
  19720. main()
  19721. {
  19722.   HSEM      SemHandle;
  19723.   HTIMER    TimerHandle;
  19724.   USHORT    i;
  19725.   USHORT    rc;
  19726.  
  19727.   /* Create system semaphore to be used by timers */
  19728.   DosCreateSem(CSEM_PUBLIC,        /* Ownership - nonexclusive */
  19729.                &SemHandle,         /* Semaphore handle (returned) */
  19730.                SEM_NAME);          /* Semaphore name */
  19731.  
  19732.   /* Set the semaphore, then start a one-shot timer */
  19733.   if(!DosSemSet(SemHandle))        /* Semaphore handle */
  19734.     printf("Semaphore set.\n");
  19735.   if(!(rc=DosTimerAsync(TIME_INTERVAL,    /* Timer interval */
  19736.                         SemHandle,        /* Semaphore handle */
  19737.                         &TimerHandle)))   /* Timer handle (returned) */
  19738.     printf("One shot timer for %f seconds started.\n", TIME_INTERVAL/1000.0);
  19739.  
  19740.   /* Report when timer expires (other work may be done here) */
  19741.   if(!DosSemWait(SemHandle,               /* Semaphore handle */
  19742.                  SEM_INDEFINITE_WAIT))    /* Timeout period -
  19743.                                                     indefinite */
  19744.     printf("Time interval has elapsed.\n");
  19745.  
  19746.   /* Start a recurring timer */
  19747.   if(!(rc=DosTimerStart(TIME_INTERVAL,    /* Timer interval */
  19748.                         SemHandle,        /* Semaphore handle */
  19749.                         &TimerHandle)))   /* Timer handle (returned) */
  19750.     printf("Recurring timer with %f second interval started.\n",
  19751.            TIME_INTERVAL/1000.0);
  19752.   /*  */
  19753.   for(i=1; i<4; i++)
  19754.     if(!DosSemSetWait(SemHandle,             /* Semaphore handle */
  19755.                       SEM_INDEFINITE_WAIT))  /* Timeout period -
  19756.                                                        indefinite */
  19757.       printf("Recurring timer cleared semaphore %d times.\n", i);
  19758.   if(!(rc=DosTimerStop(TimerHandle)))        /* Timer handle */
  19759.     printf("Recurring timer has been stopped.\n");
  19760. }
  19761.  
  19762.  
  19763. ΓòÉΓòÉΓòÉ <hidden> DosTimerStop ΓòÉΓòÉΓòÉ
  19764.  
  19765. #define INCL_DOSDATETIME
  19766.  
  19767. USHORT  rc = DosTimerStop(Handle);
  19768.  
  19769. HTIMER           Handle;        /* Handle of the timer */
  19770.  
  19771. USHORT           rc;            /* return code */
  19772.  
  19773. Example 
  19774.  
  19775. The following example sets an asynchronous one-shot timer for one second. It 
  19776. then sets an asynchronous recurring timer with a one-second interval, reporting 
  19777. each time an interval elapses.  Finally, it stops the recurring timer. 
  19778.  
  19779. #define INCL_DOSDATETIME
  19780. #define INCL_DOSSEMAPHORES
  19781.  
  19782. #include <os2.h>
  19783.  
  19784. #define SEM_NAME        "\\SEM\\timer.sem"  /* Semaphore name */
  19785. #define TIME_INTERVAL   1000L               /* Timer interval
  19786.                                                    (in milliseconds) */
  19787.  
  19788. main()
  19789. {
  19790.   HSEM      SemHandle;
  19791.   HTIMER    TimerHandle;
  19792.   USHORT    i;
  19793.   USHORT    rc;
  19794.  
  19795.   /* Create system semaphore to be used by timers */
  19796.   DosCreateSem(CSEM_PUBLIC,        /* Ownership - nonexclusive */
  19797.                &SemHandle,         /* Semaphore handle (returned) */
  19798.                SEM_NAME);          /* Semaphore name */
  19799.  
  19800.   /* Set the semaphore, then start a one-shot timer */
  19801.   if(!DosSemSet(SemHandle))        /* Semaphore handle */
  19802.     printf("Semaphore set.\n");
  19803.   if(!(rc=DosTimerAsync(TIME_INTERVAL,    /* Timer interval */
  19804.                         SemHandle,        /* Semaphore handle */
  19805.                         &TimerHandle)))   /* Timer handle (returned) */
  19806.     printf("One shot timer for %f seconds started.\n", TIME_INTERVAL/1000.0);
  19807.  
  19808.   /* Report when timer expires (other work may be done here) */
  19809.   if(!DosSemWait(SemHandle,               /* Semaphore handle */
  19810.                  SEM_INDEFINITE_WAIT))    /* Timeout period -
  19811.                                                     indefinite */
  19812.     printf("Time interval has elapsed.\n");
  19813.  
  19814.   /* Start a recurring timer */
  19815.   if(!(rc=DosTimerStart(TIME_INTERVAL,    /* Timer interval */
  19816.                         SemHandle,        /* Semaphore handle */
  19817.                         &TimerHandle)))   /* Timer handle (returned) */
  19818.     printf("Recurring timer with %f second interval started.\n",
  19819.            TIME_INTERVAL/1000.0);
  19820.   /*  */
  19821.   for(i=1; i<4; i++)
  19822.     if(!DosSemSetWait(SemHandle,             /* Semaphore handle */
  19823.                       SEM_INDEFINITE_WAIT))  /* Timeout period -
  19824.                                                        indefinite */
  19825.       printf("Recurring timer cleared semaphore %d times.\n", i);
  19826.   if(!(rc=DosTimerStop(TimerHandle)))        /* Timer handle */
  19827.     printf("Recurring timer has been stopped.\n");
  19828. }
  19829.  
  19830.  
  19831. ΓòÉΓòÉΓòÉ <hidden> DosTransactNmPipe ΓòÉΓòÉΓòÉ
  19832.  
  19833. #define INCL_DOSNMPIPES
  19834.  
  19835. USHORT  rc = DosTransactNmPipe(Handle, InBuffer, InBufferLen, OutBuffer,
  19836.                                 OutBufferLen, BytesOut);
  19837.  
  19838. HPIPE            Handle;        /* Pipe handle */
  19839. PBYTE            InBuffer;      /* Write buffer */
  19840. USHORT           InBufferLen;   /* Write buffer length */
  19841. PBYTE            OutBuffer;     /* Read buffer (returned) */
  19842. USHORT           OutBufferLen;  /* Read buffer length */
  19843. PUSHORT          BytesOut;      /* Bytes read (returned) */
  19844.  
  19845. USHORT           rc;            /* return code */
  19846.  
  19847.  
  19848. ΓòÉΓòÉΓòÉ <hidden> DosUnlockSeg ΓòÉΓòÉΓòÉ
  19849.  
  19850. #define INCL_DOSMEMMGR
  19851.  
  19852. USHORT  rc = DosUnlockSeg(Selector);
  19853.  
  19854. SEL              Selector;      /* Selector to unlock */
  19855.  
  19856. USHORT           rc;            /* return code */
  19857.  
  19858.  
  19859. ΓòÉΓòÉΓòÉ <hidden> DosWaitNmPipe ΓòÉΓòÉΓòÉ
  19860.  
  19861. #define INCL_DOSNMPIPES
  19862.  
  19863. USHORT  rc = DosWaitNmPipe(FileName, TimeOut);
  19864.  
  19865. PSZ              FileName;      /* Pipe name */
  19866. ULONG            TimeOut;       /* Maximum wait time */
  19867.  
  19868. USHORT           rc;            /* return code */
  19869.  
  19870.  
  19871. ΓòÉΓòÉΓòÉ <hidden> DosWrite ΓòÉΓòÉΓòÉ
  19872.  
  19873. #define INCL_DOSFILEMGR
  19874.  
  19875. USHORT  rc = DosWrite(FileHandle, BufferArea, BufferLength, BytesWritten);
  19876.  
  19877. HFILE            FileHandle;    /* File handle */
  19878. PVOID            BufferArea;    /* User buffer */
  19879. USHORT           BufferLength;  /* Buffer length */
  19880. PUSHORT          BytesWritten;  /* Bytes written (returned) */
  19881.  
  19882. USHORT           rc;            /* return code */
  19883.  
  19884. Example 
  19885.  
  19886. This example writes to a file. 
  19887.  
  19888. #define INCL_DOSFILEMGR
  19889.  
  19890. #define OPEN_FILE 0x01
  19891. #define CREATE_FILE 0x10
  19892. #define FILE_ARCHIVE 0x20
  19893. #define FILE_EXISTS OPEN_FILE
  19894. #define FILE_NOEXISTS CREATE_FILE
  19895. #define DASD_FLAG 0
  19896. #define INHERIT 0x80
  19897. #define WRITE_THRU 0
  19898. #define FAIL_FLAG 0
  19899. #define SHARE_FLAG 0x10
  19900. #define ACCESS_FLAG 0x02
  19901.  
  19902. #define FILE_NAME "test.dat"
  19903. #define FILE_SIZE 800L
  19904. #define FILE_ATTRIBUTE FILE_ARCHIVE
  19905. #define RESERVED 0L
  19906.  
  19907. HFILE   FileHandle;
  19908. USHORT  Wrote;
  19909. USHORT  Action;
  19910. PSZ     FileData[100];
  19911. USHORT  rc;
  19912.  
  19913.    Action = 2;
  19914.    strcpy(FileData, "Data...");
  19915.    if(!DosOpen(FILE_NAME,                /* File path name */
  19916.                 &FileHandle,             /* File handle */
  19917.                 &Action,                 /* Action taken */
  19918.                 FILE_SIZE,               /* File primary allocation */
  19919.                 FILE_ATTRIBUTE,          /* File attribute */
  19920.                 FILE_EXISTS | FILE_NOEXISTS,    /* Open function type */
  19921.                 DASD_FLAG | INHERIT |           /* Open mode of the file */
  19922.                 WRITE_THRU | FAIL_FLAG |
  19923.                 SHARE_FLAG | ACCESS_FLAG,
  19924.                 RESERVED))               /* Reserved (must be zero) */
  19925.       rc = DosWrite(FileHandle,           /* File handle */
  19926.                    (PVOID) FileData,     /* User buffer */
  19927.                    sizeof(FileData),     /* Buffer length */
  19928.                    &Wrote);              /* Bytes written */
  19929.  
  19930.  
  19931. ΓòÉΓòÉΓòÉ <hidden> DosWriteAsync ΓòÉΓòÉΓòÉ
  19932.  
  19933. #define INCL_DOSFILEMGR
  19934.  
  19935. USHORT  rc = DosWriteAsync(FileHandle, RamSemaphore, ReturnCode,
  19936.                              BufferArea, BufferLength, BytesWritten);
  19937.  
  19938. HFILE            FileHandle;    /* File handle */
  19939. PULONG           RamSemaphore;  /* RAM semaphore */
  19940. PUSHORT          ReturnCode;    /* I/O operation return code (returned) */
  19941. PVOID            BufferArea;    /* User buffer */
  19942. USHORT           BufferLength;  /* Buffer length */
  19943. PUSHORT          BytesWritten;  /* Bytes written (returned) */
  19944.  
  19945. USHORT           rc;            /* return code */
  19946.  
  19947.  
  19948. ΓòÉΓòÉΓòÉ <hidden> DosWriteQueue ΓòÉΓòÉΓòÉ
  19949.  
  19950. #define INCL_DOSQUEUES
  19951.  
  19952. USHORT  rc = DosWriteQueue(QueueHandle, Request, DataLength, DataBuffer,
  19953.                              ElemPriority);
  19954.  
  19955. HQUEUE           QueueHandle;   /* Queue handle */
  19956. USHORT           Request;       /* Request identification data */
  19957. USHORT           DataLength;    /* Length of element being added */
  19958. PBYTE            DataBuffer;    /* Element being added */
  19959. UCHAR            ElemPriority;  /* Priority of element being added */
  19960.  
  19961. USHORT           rc;            /* return code */
  19962.  
  19963.  
  19964. ΓòÉΓòÉΓòÉ <hidden> DosAllocHuge ΓòÉΓòÉΓòÉ
  19965.  
  19966. EXTRN  DosAllocHuge:FAR
  19967. INCL_DOSMEMMGR      EQU 1
  19968.  
  19969. PUSH   WORD    NumSeg        ;Number of 65536-byte segments
  19970. PUSH   WORD    Size          ;Number of bytes in last segment
  19971. PUSH@  WORD    Selector      ;The first Selector allocated (returned)
  19972. PUSH   WORD    MaxNumSeg     ;Max number of 65536-byte segments
  19973. PUSH   WORD    AllocFlags    ;Allocation flags
  19974. CALL   DosAllocHuge
  19975.  
  19976. Returns WORD
  19977.  
  19978.  
  19979. ΓòÉΓòÉΓòÉ <hidden> DosAllocSeg ΓòÉΓòÉΓòÉ
  19980.  
  19981. EXTRN  DosAllocSeg:FAR
  19982. INCL_DOSMEMMGR      EQU 1
  19983.  
  19984. PUSH   WORD    Size          ;Number of bytes requested
  19985. PUSH@  WORD    Selector      ;Selector allocated (returned)
  19986. PUSH   WORD    AllocFlags    ;Allocation flags
  19987. CALL   DosAllocSeg
  19988.  
  19989. Returns WORD
  19990.  
  19991.  
  19992. ΓòÉΓòÉΓòÉ <hidden> DosAllocShrSeg ΓòÉΓòÉΓòÉ
  19993.  
  19994. EXTRN  DosAllocShrSeg:FAR
  19995. INCL_DOSMEMMGR      EQU 1
  19996.  
  19997. PUSH   WORD    Size          ;Number of bytes requested
  19998. PUSH@  ASCIIZ  Name          ;Name string
  19999. PUSH@  WORD    Selector      ;Selector allocated (returned)
  20000. CALL   DosAllocShrSeg
  20001.  
  20002. Returns WORD
  20003.  
  20004.  
  20005. ΓòÉΓòÉΓòÉ <hidden> DosBeep ΓòÉΓòÉΓòÉ
  20006.  
  20007. EXTRN  DosBeep:FAR
  20008. INCL_DOSPROCESS     EQU 1
  20009.  
  20010. PUSH   WORD    Frequency     ;Frequency (in Hertz)
  20011. PUSH   WORD    Duration      ;Length of sound (in milliseconds)
  20012. CALL   DosBeep
  20013.  
  20014. Returns WORD
  20015.  
  20016.  
  20017. ΓòÉΓòÉΓòÉ <hidden> DosBufReset ΓòÉΓòÉΓòÉ
  20018.  
  20019. EXTRN  DosBufReset:FAR
  20020. INCL_DOSFILEMGR     EQU 1
  20021.  
  20022. PUSH   WORD    FileHandle    ;File handle
  20023. CALL   DosBufReset
  20024.  
  20025. Returns WORD
  20026.  
  20027.  
  20028. ΓòÉΓòÉΓòÉ <hidden> DosCallback ΓòÉΓòÉΓòÉ
  20029.  
  20030. EXTRN  DosCallback:FAR
  20031. INCL_DOSDEVICES     EQU 1
  20032.  
  20033. PUSH@  OTHER   Ring3Routine  ;Address of privilege level 3 routine
  20034. CALL   DosCallback
  20035.  
  20036. Returns NONE
  20037.  
  20038.  
  20039. ΓòÉΓòÉΓòÉ <hidden> DosCallNmPipe ΓòÉΓòÉΓòÉ
  20040.  
  20041. EXTRN  DosCallNmPipe:FAR
  20042. INCL_DOSNMPIPES     EQU 1
  20043.  
  20044. PUSH@  ASCIIZ  FileName      ;Pipe name
  20045. PUSH@  OTHER   InBuffer      ;Write buffer
  20046. PUSH   WORD    InBufferLen   ;Write buffer length
  20047. PUSH@  OTHER   OutBuffer     ;Read buffer
  20048. PUSH   WORD    OutBufferLen  ;Read buffer length
  20049. PUSH@  WORD    BytesOut      ;Bytes read (returned)
  20050. PUSH   DWORD   TimeOut       ;Maximum wait time
  20051. CALL   DosCallNmPipe
  20052.  
  20053. Returns WORD
  20054.  
  20055.  
  20056. ΓòÉΓòÉΓòÉ <hidden> DosCaseMap ΓòÉΓòÉΓòÉ
  20057.  
  20058. COUNTRYCODE struc
  20059.  
  20060.   ctryc_country   dw  ? ;country code
  20061.   ctryc_codepage  dw  ? ;code page
  20062.  
  20063. COUNTRYCODE ends
  20064.  
  20065. EXTRN  DosCaseMap:FAR
  20066. INCL_DOSNLS         EQU 1
  20067.  
  20068. PUSH   WORD    Length        ;Length of string to case map
  20069. PUSH@  OTHER   Structure     ;Input data structure
  20070. PUSH@  OTHER   BinaryString  ;Binary string
  20071. CALL   DosCaseMap
  20072.  
  20073. Returns WORD
  20074.  
  20075.  
  20076. ΓòÉΓòÉΓòÉ <hidden> DosChDir ΓòÉΓòÉΓòÉ
  20077.  
  20078. EXTRN  DosChDir:FAR
  20079. INCL_DOSFILEMGR     EQU 1
  20080.  
  20081. PUSH@  ASCIIZ  DirName       ;Directory path name string
  20082. PUSH   DWORD   0             ;Reserved (must be zero)
  20083. CALL   DosChDir
  20084.  
  20085. Returns WORD
  20086.  
  20087.  
  20088. ΓòÉΓòÉΓòÉ <hidden> DosChgFilePtr ΓòÉΓòÉΓòÉ
  20089.  
  20090. EXTRN  DosChgFilePtr:FAR
  20091. INCL_DOSFILEMGR     EQU 1
  20092.  
  20093. PUSH   WORD    FileHandle    ;File handle
  20094. PUSH   DWORD   Distance      ;Distance to move in bytes
  20095. PUSH   WORD    MoveType      ;Method of moving (0, 1, 2)
  20096. PUSH@  DWORD   NewPointer    ;New Pointer Location (returned)
  20097. CALL   DosChgFilePtr
  20098.  
  20099. Returns WORD
  20100.  
  20101.  
  20102. ΓòÉΓòÉΓòÉ <hidden> DosCLIAccess ΓòÉΓòÉΓòÉ
  20103.  
  20104. EXTRN  DosCLIAccess:FAR
  20105. INCL_DOSDEVICES     EQU 1
  20106.  
  20107. CALL   DosCLIAccess
  20108.  
  20109. Returns WORD
  20110.  
  20111.  
  20112. ΓòÉΓòÉΓòÉ <hidden> DosClose ΓòÉΓòÉΓòÉ
  20113.  
  20114. EXTRN  DosClose:FAR
  20115. INCL_DOSFILEMGR     EQU 1
  20116.  
  20117. PUSH   WORD    FileHandle    ;File handle
  20118. CALL   DosClose
  20119.  
  20120. Returns WORD
  20121.  
  20122.  
  20123. ΓòÉΓòÉΓòÉ <hidden> DosCloseQueue ΓòÉΓòÉΓòÉ
  20124.  
  20125. EXTRN  DosCloseQueue:FAR
  20126. INCL_DOSQUEUES      EQU 1
  20127.  
  20128. PUSH   WORD    QueueHandle   ;Queue handle
  20129. CALL   DosCloseQueue
  20130.  
  20131. Returns WORD
  20132.  
  20133.  
  20134. ΓòÉΓòÉΓòÉ <hidden> DosCloseSem ΓòÉΓòÉΓòÉ
  20135.  
  20136. EXTRN  DosCloseSem:FAR
  20137. INCL_DOSSEMAPHORES  EQU 1
  20138.  
  20139. PUSH   DWORD   SemHandle     ;Semaphore handle
  20140. CALL   DosCloseSem
  20141.  
  20142. Returns WORD
  20143.  
  20144.  
  20145. ΓòÉΓòÉΓòÉ <hidden> DosConnectNmPipe ΓòÉΓòÉΓòÉ
  20146.  
  20147. EXTRN  DosConnectNmPipe:FAR
  20148. INCL_DOSNMPIPES     EQU 1
  20149.  
  20150. PUSH   WORD Handle           ;Pipe handle
  20151. CALL   DosConnectNmPipe
  20152.  
  20153. Returns WORD
  20154.  
  20155.  
  20156. ΓòÉΓòÉΓòÉ <hidden> DosCopy ΓòÉΓòÉΓòÉ
  20157.  
  20158. EXTRN  DosCopy:FAR
  20159. INCL_DOSFILEMGR     EQU 1
  20160.  
  20161. PUSH@  ASCIIZ  SourceName    ;Source path name string
  20162. PUSH@  ASCIIZ  TargetName    ;Target path name string
  20163. PUSH   WORD    OpMode        ;Operation mode
  20164. PUSH   DWORD   0             ;Reserved (must be zero)
  20165. CALL   DosCopy
  20166.  
  20167. Returns WORD
  20168.  
  20169.  
  20170. ΓòÉΓòÉΓòÉ <hidden> DosCreateCSAlias ΓòÉΓòÉΓòÉ
  20171.  
  20172. EXTRN  DosCreateCSAlias:FAR
  20173. INCL_DOSMEMMGR      EQU 1
  20174.  
  20175. PUSH   WORD    DataSelector  ;Data segment selector
  20176. PUSH@  WORD    CodeSelector  ;Code segment selector (returned)
  20177. CALL   DosCreateCSAlias
  20178.  
  20179. Returns WORD
  20180.  
  20181.  
  20182. ΓòÉΓòÉΓòÉ <hidden> DosCreateQueue ΓòÉΓòÉΓòÉ
  20183.  
  20184. EXTRN  DosCreateQueue:FAR
  20185. INCL_DOSQUEUES      EQU 1
  20186.  
  20187. PUSH@  WORD    RWHandle      ;Queue handle (returned)
  20188. PUSH   WORD    QueuePrty     ;Ordering to use for elements
  20189. PUSH@  ASCIIZ  QueueName     ;Queue name string
  20190. CALL   DosCreateQueue
  20191.  
  20192. Returns WORD
  20193.  
  20194.  
  20195. ΓòÉΓòÉΓòÉ <hidden> DosCreateSem ΓòÉΓòÉΓòÉ
  20196.  
  20197. EXTRN  DosCreateSem:FAR
  20198. INCL_DOSSEMAPHORES  EQU 1
  20199.  
  20200. PUSH   WORD    NoExclusive   ;Indicate no exclusive ownership
  20201. PUSH@  DWORD   SemHandle     ;Semaphore handle (returned)
  20202. PUSH@  ASCIIZ  SemName       ;Semaphore name string
  20203. CALL   DosCreateSem
  20204.  
  20205. Returns WORD
  20206.  
  20207.  
  20208. ΓòÉΓòÉΓòÉ <hidden> DosCreateThread ΓòÉΓòÉΓòÉ
  20209.  
  20210. EXTRN  DosCreateThread:FAR
  20211. INCL_DOSPROCESS     EQU 1
  20212.  
  20213. PUSH   DWORD   PgmAddress     ;Program address
  20214. PUSH@  WORD    ThreadIDWord   ;New thread ID (returned)
  20215. PUSH@  OTHER   NewThreadStack ;End of stack for new thread
  20216. CALL   DosCreateThread
  20217.  
  20218. Returns WORD
  20219.  
  20220.  
  20221. ΓòÉΓòÉΓòÉ <hidden> DosCwait ΓòÉΓòÉΓòÉ
  20222.  
  20223. RESULTCODES struc
  20224.  
  20225.   resc_codeTerminate dw  ? ;Termination Code
  20226.   resc_codeResult    dw  ? ;Exit Code
  20227.  
  20228. RESULTCODES ends
  20229.  
  20230. EXTRN  DosCwait:FAR
  20231. INCL_DOSPROCESS     EQU 1
  20232.  
  20233. PUSH   WORD    ActionCode    ;Execution options
  20234. PUSH   WORD    WaitOption    ;Wait options
  20235. PUSH@  DWORD   ReturnCodes   ;Termination Codes (returned)
  20236. PUSH@  WORD    ProcessIDWord ;Process ID (returned)
  20237. PUSH   WORD    ProcessID     ;Process ID of process to wait for
  20238. CALL   DosCwait
  20239.  
  20240. Returns WORD
  20241.  
  20242.  
  20243. ΓòÉΓòÉΓòÉ <hidden> DosDelete ΓòÉΓòÉΓòÉ
  20244.  
  20245. EXTRN  DosDelete:FAR
  20246. INCL_DOSFILEMGR     EQU 1
  20247.  
  20248. PUSH@  ASCIIZ  FileName      ;Filename path name string
  20249. PUSH   DWORD   0             ;Reserved (must be zero)
  20250. CALL   DosDelete
  20251.  
  20252. Returns WORD
  20253.  
  20254.  
  20255. ΓòÉΓòÉΓòÉ <hidden> DosDevConfig ΓòÉΓòÉΓòÉ
  20256.  
  20257. EXTRN  DosDevConfig:FAR
  20258. INCL_DOSDEVICES     EQU 1
  20259.  
  20260. PUSH@  OTHER   DeviceInfo    ;Requested information (returned)
  20261. PUSH   WORD    Item          ;Item number
  20262. PUSH   WORD    Parm          ;Reserved (must be zero)
  20263. CALL   DosDevConfig
  20264.  
  20265. Returns WORD
  20266.  
  20267.  
  20268. ΓòÉΓòÉΓòÉ <hidden> DosDevIOCtl ΓòÉΓòÉΓòÉ
  20269.  
  20270. EXTRN  DosDevIOCtl:FAR
  20271. INCL_DOSDEVICES     EQU 1
  20272.  
  20273. PUSH@  OTHER   Data          ;Data area
  20274. PUSH@  OTHER   ParmList      ;Command arguments
  20275. PUSH   WORD    Function      ;Device function
  20276. PUSH   WORD    Category      ;Device category
  20277. PUSH   WORD    DevHandle     ;Device handle
  20278. CALL   DosDevIOCtl
  20279.  
  20280. Returns WORD
  20281.  
  20282.  
  20283. ΓòÉΓòÉΓòÉ <hidden> DosDevIOCtl2 ΓòÉΓòÉΓòÉ
  20284.  
  20285. EXTRN  DosDevIOCtl2:FAR
  20286. INCL_DOSDEVICES     EQU 1
  20287.  
  20288. PUSH@  OTHER   Data           ;Data area
  20289. PUSH   WORD    DataLength     ;Data area length
  20290. PUSH@  OTHER   ParmList       ;Command arguments
  20291. PUSH   WORD    ParmListLength ;Command arguments list length
  20292. PUSH   WORD    Function       ;Device function
  20293. PUSH   WORD    Category       ;Device category
  20294. PUSH   WORD    DevHandle      ;Device handle
  20295. CALL   DosDevIOCtl2
  20296.  
  20297. Returns WORD
  20298.  
  20299.  
  20300. ΓòÉΓòÉΓòÉ <hidden> DosDisConnectNmPipe ΓòÉΓòÉΓòÉ
  20301.  
  20302. EXTRN  DosDisConnectNmPipe:FAR
  20303. INCL_DOSNMPIPES     EQU 1
  20304.  
  20305. PUSH   WORD    Handle        ;Pipe handle
  20306. CALL   DosDisConnectNmPipe
  20307.  
  20308. Returns WORD
  20309.  
  20310.  
  20311. ΓòÉΓòÉΓòÉ <hidden> DosDupHandle ΓòÉΓòÉΓòÉ
  20312.  
  20313. EXTRN  DosDupHandle:FAR
  20314. INCL_DOSFILEMGR     EQU 1
  20315.  
  20316. PUSH   WORD    OldFileHandle ;Existing file handle
  20317. PUSH@  WORD    NewFileHandle ;New file handle (returned)
  20318. CALL   DosDupHandle
  20319.  
  20320. Returns WORD
  20321.  
  20322.  
  20323. ΓòÉΓòÉΓòÉ <hidden> DosEditName ΓòÉΓòÉΓòÉ
  20324.  
  20325. EXTRN DosEditName:FAR
  20326. INCL_DOSFILEMGR     EQU 1
  20327.  
  20328. PUSH   WORD   EditLevel      ;Level of meta editing semantics
  20329. PUSH@  ASCIIZ SourceString   ;String to transform
  20330. PUSH@  ASCIIZ EditString     ;Editing string
  20331. PUSH@  OTHER  TargetBuf      ;Destination string buffer (returned)
  20332. PUSH   WORD   TargetBufLen   ;Destination string buffer length
  20333. CALL   DosEditName
  20334.  
  20335. Returns WORD
  20336.  
  20337.  
  20338. ΓòÉΓòÉΓòÉ <hidden> DosEnterCritSec ΓòÉΓòÉΓòÉ
  20339.  
  20340. EXTRN  DosEnterCritSec:FAR
  20341. INCL_DOSPROCESS     EQU 1
  20342.  
  20343. CALL   DosEnterCritSec
  20344.  
  20345. Returns WORD
  20346.  
  20347.  
  20348. ΓòÉΓòÉΓòÉ <hidden> DosEnumAttribute ΓòÉΓòÉΓòÉ
  20349.  
  20350. DENA1   struc                    ;level 1 info returned from
  20351.                                  ;  DosEnumAttribute
  20352.  
  20353.   level_reserved db           ?  ;0
  20354.   level_cbName   db           ?  ;length of name excluding NULL
  20355.   level_cbValue  dw           ?  ;length of value
  20356.   level_szName   db  1  dup  (?) ;variable length asciiz name
  20357.  
  20358. DENA1   ends
  20359.  
  20360. EXTRN DosEnumAttribute:FAR
  20361. INCL_DOSFILEMGR     EQU 1
  20362.  
  20363. PUSH  WORD   RefType         ;Type of reference
  20364. PUSH@ OTHER  FileRef         ;Handle or Name
  20365. PUSH  DWORD  EntryNum        ;Starting entry in EA list
  20366. PUSH@ OTHER  EnumBuf         ;Data buffer (returned)
  20367. PUSH  DWORD  EnumBufSize     ;Data buffer size
  20368. PUSH@ DWORD  EnumCnt         ;Count of entries to return
  20369. PUSH  DWORD  InfoLevel       ;Level of information requested
  20370. PUSH  DWORD  0               ;Reserved (must be zero)
  20371. CALL  DosEnumAttribute
  20372.  
  20373.  
  20374. ΓòÉΓòÉΓòÉ <hidden> DosErrClass ΓòÉΓòÉΓòÉ
  20375.  
  20376. EXTRN  DosErrClass:FAR
  20377. INCL_DOSMISC      EQU 1
  20378.  
  20379. PUSH   WORD    Code          ;Error code for analysis
  20380. PUSH@  WORD    Class         ;Error classification (returned)
  20381. PUSH@  WORD    Action        ;Recommended action (returned)
  20382. PUSH@  WORD    Locus         ;Error locus (returned)
  20383. CALL   DosErrClass
  20384.  
  20385. Returns WORD
  20386.  
  20387.  
  20388. ΓòÉΓòÉΓòÉ <hidden> DosError ΓòÉΓòÉΓòÉ
  20389.  
  20390. EXTRN  DosError:FAR
  20391. INCL_DOSMISC      EQU 1
  20392.  
  20393. PUSH   WORD    Flags         ;Action flags
  20394. CALL   DosError
  20395.  
  20396. Returns WORD
  20397.  
  20398.  
  20399. ΓòÉΓòÉΓòÉ <hidden> DosExecPgm ΓòÉΓòÉΓòÉ
  20400.  
  20401. RESULTCODES struc
  20402.  
  20403.   resc_codeTerminate dw  ? ;Termination Code -or- Process ID
  20404.   resc_codeResult    dw  ? ;Exit Code
  20405.  
  20406. RESULTCODES ends
  20407.  
  20408. EXTRN  DosExecPgm:FAR
  20409. INCL_DOSPROCESS     EQU 1
  20410.  
  20411. PUSH@  OTHER   ObjNameBuf    ;Object name buffer (returned)
  20412. PUSH   WORD    ObjNameBufL   ;Length of object name buffer
  20413. PUSH   WORD    ExecFlags     ;Execute asynchronously/trace
  20414. PUSH@  ASCIIZ  ArgPointer    ;Address of argument string
  20415. PUSH@  ASCIIZ  EnvPointer    ;Address of environment string
  20416. PUSH@  DWORD   ReturnCodes   ;Termination codes (returned)
  20417. PUSH@  ASCIIZ  PgmPointer    ;Program file path name string
  20418. CALL   DosExecPgm
  20419.  
  20420. Returns WORD
  20421.  
  20422.  
  20423. ΓòÉΓòÉΓòÉ <hidden> DosExit ΓòÉΓòÉΓòÉ
  20424.  
  20425. EXTRN  DosExit:FAR
  20426. INCL_DOSPROCESS     EQU 1
  20427.  
  20428. PUSH   WORD    ActionCode    ;Indicates end thread or process
  20429. PUSH   WORD    ResultCode    ;Result Code to save for DosCwait
  20430. CALL   DosExit
  20431.  
  20432.  
  20433. ΓòÉΓòÉΓòÉ <hidden> DosExitCritSec ΓòÉΓòÉΓòÉ
  20434.  
  20435. EXTRN  DosExitCritSec:FAR
  20436. INCL_DOSPROCESS     EQU 1
  20437.  
  20438. CALL   DosExitCritSec
  20439.  
  20440. Returns WORD
  20441.  
  20442.  
  20443. ΓòÉΓòÉΓòÉ <hidden> DosExitList ΓòÉΓòÉΓòÉ
  20444.  
  20445. EXTRN  DosExitList:FAR
  20446. INCL_DOSPROCESS     EQU 1
  20447.  
  20448. PUSH   WORD    FcnCode_Order ;Function request code/Order
  20449. PUSH   DWORD   RtnAddress    ;Address of routine
  20450. CALL   DosExitList
  20451.  
  20452. Returns WORD
  20453.  
  20454.  
  20455. ΓòÉΓòÉΓòÉ <hidden> DosFileIO ΓòÉΓòÉΓòÉ
  20456.  
  20457. EXTRN DosFileIO:FAR
  20458. INCL_DOSFILEMGR     EQU 1
  20459.  
  20460. PUSH   WORD  FileHandle      ;File handle
  20461. PUSH@  OTHER CommandList     ;Command buffer
  20462. PUSH   WORD  CommandListLen  ;Length of command buffer
  20463. PUSH@  WORD  ErrorOffset     ;Command error offset (returned)
  20464. CALL   DosFileIO
  20465.  
  20466. Returns WORD
  20467.  
  20468.  
  20469. ΓòÉΓòÉΓòÉ <hidden> DosFileLocks ΓòÉΓòÉΓòÉ
  20470.  
  20471. EXTRN  DosFileLocks:FAR
  20472. INCL_DOSFILEMGR     EQU 1
  20473.  
  20474. PUSH   WORD    FileHandle    ;File handle
  20475. PUSH@  OTHER   UnLockRange   ;UnLock range
  20476. PUSH@  OTHER   LockRange     ;Lock range
  20477. CALL   DosFileLocks
  20478.  
  20479. Returns WORD
  20480.  
  20481.  
  20482. ΓòÉΓòÉΓòÉ <hidden> DosFindClose ΓòÉΓòÉΓòÉ
  20483.  
  20484. EXTRN  DosFindClose:FAR
  20485. INCL_DOSFILEMGR     EQU 1
  20486.  
  20487. PUSH   WORD    DirHandle     ;Directory search handle
  20488. CALL   DosFindClose
  20489.  
  20490. Returns WORD
  20491.  
  20492.  
  20493. ΓòÉΓòÉΓòÉ <hidden> DosFindFirst ΓòÉΓòÉΓòÉ
  20494.  
  20495. FDATE   struc
  20496.  
  20497.   fdate_fs  dw  ?
  20498.  
  20499. FDATE   ends
  20500.  
  20501. FTIME   struc
  20502.  
  20503.   ftime_fs  dw  ?
  20504.  
  20505. FTIME   ends
  20506.  
  20507. FILEFINDBUF struc
  20508.  
  20509.   findbuf_fdateCreation   dw (size FDATE)/2 dup (?) ;file date of creation
  20510.   findbuf_ftimeCreation   dw (size FTIME)/2 dup (?) ;file time of creation
  20511.   findbuf_fdateLastAccess dw (size FDATE)/2 dup (?) ;file date of last access
  20512.   findbuf_ftimeLastAccess dw (size FTIME)/2 dup (?) ;file time of last access
  20513.   findbuf_fdateLastWrite  dw (size FDATE)/2 dup (?) ;file date of last write
  20514.   findbuf_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;file time of last write
  20515.   findbuf_cbFile          dd  ? ;file end of data
  20516.   findbuf_cbFileAlloc     dd  ? ;file allocation
  20517.   findbuf_attrFile        dw  ? ;file attribute
  20518.   findbuf_cchName         db  ? ;length of ASCIIZ name string
  20519.   findbuf_achName         db  CCHMAXPATHCOMP dup (?) ;length of ASCIIZ name string
  20520.  
  20521. FILEFINDBUF ends
  20522.  
  20523. EXTRN  DosFindFirst:FAR
  20524. INCL_DOSFILEMGR     EQU 1
  20525.  
  20526. PUSH@  ASCIIZ  FileName      ;File path name string
  20527. PUSH@  WORD    DirHandle     ;Directory search handle (returned)
  20528. PUSH   WORD    Attribute     ;Search attribute
  20529. PUSH@  OTHER   ResultBuf     ;Result buffer
  20530. PUSH   WORD    ResultBufLen  ;Result buffer length
  20531. PUSH@  WORD    SearchCount   ;Number of entries to find
  20532. PUSH   DWORD   0             ;Reserved (must be zero)
  20533. CALL   DosFindFirst
  20534.  
  20535. Returns WORD
  20536.  
  20537.  
  20538. ΓòÉΓòÉΓòÉ <hidden> DosFindFirst2 ΓòÉΓòÉΓòÉ
  20539.  
  20540. FDATE   struc
  20541.  
  20542.   fdate_fs  dw  ?
  20543.  
  20544. FDATE   ends
  20545.  
  20546. FTIME   struc
  20547.  
  20548.   ftime_fs  dw  ?
  20549.  
  20550. FTIME   ends
  20551.  
  20552. FILEFINDBUF struc
  20553.  
  20554.   findbuf_fdateCreation   dw (size FDATE)/2 dup (?) ;file date of creation
  20555.   findbuf_ftimeCreation   dw (size FTIME)/2 dup (?) ;file time of creation
  20556.   findbuf_fdateLastAccess dw (size FDATE)/2 dup (?) ;file date of
  20557.                                                      ;  last access
  20558.   findbuf_ftimeLastAccess dw (size FTIME)/2 dup (?) ;file time of
  20559.                                                      ;  last access
  20560.   findbuf_fdateLastWrite  dw (size FDATE)/2 dup (?) ;file date of
  20561.                                                      ;  last write
  20562.   findbuf_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;file time of
  20563.                                                      ;  last write
  20564.   findbuf_cbFile          dd  ? ;file end of data
  20565.   findbuf_cbFileAlloc     dd  ? ;file allocation
  20566.   findbuf_attrFile        dw  ? ;file attribute
  20567.   findbuf_cchName         db  ? ;length of ASCIIZ name string
  20568.   findbuf_achName         db  CCHMAXPATHCOMP dup (?) ;length of ASCIIZ
  20569.                                                       ;  name string
  20570.  
  20571. FILEFINDBUF ends
  20572.  
  20573. FILEFINDBUF2 struc
  20574.  
  20575.   findbuf_fdateCreation   dw (size FDATE)/2 dup (?) ;file date of creation
  20576.   findbuf_ftimeCreation   dw (size FTIME)/2 dup (?) ;file time of creation
  20577.   findbuf_fdateLastAccess dw (size FDATE)/2 dup (?) ;file date of
  20578.                                                      ;  last access
  20579.   findbuf_ftimeLastAccess dw (size FTIME)/2 dup (?) ;file time of
  20580.                                                      ;  last access
  20581.   findbuf_fdateLastWrite  dw (size FDATE)/2 dup (?) ;file date of
  20582.                                                      ;  last write
  20583.   findbuf_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;file time of
  20584.                                                      ;  last write
  20585.   findbuf_cbFile          dd  ? ;file end of data
  20586.   findbuf_cbFileAlloc     dd  ? ;file allocation
  20587.   findbuf_attrFile        dw  ? ;file attribute
  20588.   findbuf2_cbList         dd  ? ;level 2 only field (calculate size
  20589.                                    ;  of buffer)
  20590.   findbuf_achName         db  CCHMAXPATHCOMP dup (?) ;length of ASCIIZ name
  20591.                                                       ;  string
  20592.   findbuf_achName         db  13 dup (?) ;ASCIIZ name string
  20593.  
  20594. FILEFINDBUF2 ends
  20595.  
  20596. GEA    struc
  20597.  
  20598.   gea_cbName      db  ?          ;name length not including NULL
  20599.   gea_szName      db  1 dup (?)  ;attribute name
  20600.  
  20601. GEA    ends
  20602.  
  20603. GEALIST    struc
  20604.  
  20605.   geal_cbList     dd  ?      ;total bytes of structure including full list
  20606.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  20607.  
  20608. GEALIST    ends
  20609.  
  20610. FEA   struc
  20611.  
  20612.   fea_fEA         db  ? ;flags
  20613.   fea_cbName      db  ? ;name length not including NULL
  20614.   fea_cbValue     dw  ? ;value length
  20615.  
  20616. FEA   ends
  20617.  
  20618. FEALIST struc
  20619.  
  20620.   feal_cbList     dd  ?      ;total bytes of structure including full list
  20621.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  20622.  
  20623. FEALIST ends
  20624.  
  20625. EAOP    struc
  20626.  
  20627.   eaop_fpGEAList  dd  ? ;general EA list
  20628.   eaop_fpFEAList  dd  ? ;full EA list
  20629.   eaop_oError     dd  ? ;
  20630.  
  20631. EAOP    ends
  20632.  
  20633. EXTRN  DosFindFirst2:FAR
  20634. INCL_DOSFILEMGR     EQU 1
  20635.  
  20636. PUSH@  ASCIIZ  FileName      ;File path name string
  20637. PUSH@  WORD    DirHandle     ;Directory search handle (returned)
  20638. PUSH   WORD    Attribute     ;Search attribute
  20639. PUSH@  OTHER   ResultBuf     ;Result buffer
  20640. PUSH   WORD    ResultBufLen  ;Result buffer length
  20641. PUSH@  WORD    SearchCount   ;Number of entries to find
  20642. PUSH   WORD    FileInfoLevel ;File data required
  20643. PUSH   DWORD   0             ;Reserved (must be zero)
  20644. CALL   DosFindFirst2
  20645.  
  20646. Returns WORD
  20647.  
  20648.  
  20649. ΓòÉΓòÉΓòÉ <hidden> DosFindNext ΓòÉΓòÉΓòÉ
  20650.  
  20651. FDATE   struc
  20652.  
  20653.   fdate_fs  dw  ?
  20654.  
  20655. FDATE   ends
  20656.  
  20657. FTIME   struc
  20658.  
  20659.   ftime_fs  dw  ?
  20660.  
  20661. FTIME   ends
  20662.  
  20663. FILEFINDBUF struc
  20664.  
  20665.   findbuf_fdateCreation   dw (size FDATE)/2 dup (?) ;file date of creation
  20666.   findbuf_ftimeCreation   dw (size FTIME)/2 dup (?) ;file time of creation
  20667.   findbuf_fdateLastAccess dw (size FDATE)/2 dup (?) ;file date of
  20668.                                                    ;  last access
  20669.   findbuf_ftimeLastAccess dw (size FTIME)/2 dup (?) ;file time of
  20670.                                                    ;  last access
  20671.   findbuf_fdateLastWrite  dw (size FDATE)/2 dup (?) ;file date of
  20672.                                                    ;  last write
  20673.   findbuf_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;file time of
  20674.                                                    ;  last write
  20675.   findbuf_cbFile          dd  ? ;file end of data
  20676.   findbuf_cbFileAlloc     dd  ? ;file allocation
  20677.   findbuf_attrFile        dw  ? ;file attribute
  20678.   findbuf_cchName         db  ? ;length of ASCIIZ name string
  20679.   findbuf_achName         db  13 dup (?) ;ASCIIZ name string
  20680.  
  20681. FILEFINDBUF ends
  20682.  
  20683. EXTRN  DosFindNext:FAR
  20684. INCL_DOSFILEMGR     EQU 1
  20685.  
  20686. PUSH   WORD    DirHandle     ;Directory search handle
  20687. PUSH@  OTHER   ResultBuf     ;Result buffer
  20688. PUSH   WORD    ResultBufLen  ;Result buffer length
  20689. PUSH@  WORD    SearchCount   ;Number of entries to find
  20690. CALL   DosFindNext
  20691.  
  20692. Returns WORD
  20693.  
  20694.  
  20695. ΓòÉΓòÉΓòÉ <hidden> DosFlagProcess ΓòÉΓòÉΓòÉ
  20696.  
  20697. EXTRN  DosFlagProcess:FAR
  20698. INCL_DOSSIGNALS     EQU 1
  20699.  
  20700. PUSH   WORD    ProcessID     ;Process ID to flag
  20701. PUSH   WORD    ActionCode    ;Indicate to flag descendants
  20702. PUSH   WORD    Flagnum       ;Flag number
  20703. PUSH   WORD    Flagarg       ;Flag argument
  20704. CALL   DosFlagProcess
  20705.  
  20706. Returns WORD
  20707.  
  20708.  
  20709. ΓòÉΓòÉΓòÉ <hidden> DosFreeModule ΓòÉΓòÉΓòÉ
  20710.  
  20711. EXTRN  DosFreeModule:FAR
  20712. INCL_DOSMODULEMGR   EQU 1
  20713.  
  20714. PUSH   WORD    ModuleHandle  ;Module handle
  20715. CALL   DosFreeModule
  20716.  
  20717. Returns WORD
  20718.  
  20719.  
  20720. ΓòÉΓòÉΓòÉ <hidden> DosFreeResource ΓòÉΓòÉΓòÉ
  20721.  
  20722. EXTRN  DosFreeResource:FAR
  20723. INCL_DOSFREERESOURCE   EQU 1
  20724.  
  20725. PUSH   DWORD   ResAddr       ;Resource address
  20726. CALL   DosFreeResource
  20727.  
  20728. Returns WORD
  20729.  
  20730.  
  20731. ΓòÉΓòÉΓòÉ <hidden> DosFreeSeg ΓòÉΓòÉΓòÉ
  20732.  
  20733. EXTRN  DosFreeSeg:FAR
  20734. INCL_DOSMEMMGR      EQU 1
  20735.  
  20736. PUSH   WORD    Selector      ;Selector
  20737. CALL   DosFreeSeg
  20738.  
  20739. Returns WORD
  20740.  
  20741.  
  20742. ΓòÉΓòÉΓòÉ <hidden> DosFSAttach ΓòÉΓòÉΓòÉ
  20743.  
  20744. EXTRN DosFSAttach:FAR
  20745. INCL_DOSFILEMGR     EQU 1
  20746.  
  20747. PUSH@  ASCIIZ DeviceName     ;Device name or drive letter string
  20748. PUSH@  ASCIIZ FSDName        ;FSD name
  20749. PUSH@  OTHER  DataBuffer     ;Attach argument data
  20750. PUSH   WORD   DataBufferLen  ;Buffer length
  20751. PUSH   WORD   OpFlag         ;Attach or detach
  20752. PUSH   DWORD  0              ;Reserved (must be zero)
  20753. CALL   DosFSAttach
  20754.  
  20755. Returns WORD
  20756.  
  20757.  
  20758. ΓòÉΓòÉΓòÉ <hidden> DosFSCtl ΓòÉΓòÉΓòÉ
  20759.  
  20760. EXTRN DosFSCtl:FAR
  20761. INCL_DOSFILEMGR     EQU 1
  20762.  
  20763. PUSH@  OTHER  DataArea       ;Data area
  20764. PUSH   WORD   DataLengthMax  ;Data area length
  20765. PUSH@  WORD   DataLength     ;Data area length (returned)
  20766. PUSH@  OTHER  ParmList       ;Parameter list
  20767. PUSH   WORD   ParmLengthMax  ;Parameter list length
  20768. PUSH@  WORD   ParmLength     ;Parameter list length (returned)
  20769. PUSH   WORD   FunctionCode   ;Function code
  20770. PUSH@  ASCIIZ RouteName      ;Path or FSD name string
  20771. PUSH   WORD   FileHandle     ;File handle
  20772. PUSH   WORD   RouteMethod    ;Method for routing.
  20773. PUSH   DWORD  0              ;Reserved (must be zero)
  20774. CALL   DosFSCtl
  20775.  
  20776. Returns WORD
  20777.  
  20778.  
  20779. ΓòÉΓòÉΓòÉ <hidden> DosFSRamSemClear ΓòÉΓòÉΓòÉ
  20780.  
  20781. DOSFSRSEM struc
  20782.  
  20783.   dosfsrs_cb      dw  ? ;length of this structure (bytes)
  20784.   dosfsrs_pid     dw  ? ;Process ID of owner or zero
  20785.   dosfsrs_tid     dw  ? ;Thread ID of owner or zero
  20786.   dosfsrs_cUsage  dw  ? ;reference count
  20787.   dosfsrs_client  dw  ? ;16 bit field for use by owner
  20788.   dosfsrs_sem     dd  ? ;OS/2 Ram Semaphore
  20789.  
  20790. DOSFSRSEM ends
  20791.  
  20792. EXTRN  DosFSRamSemClear:FAR
  20793. INCL_DOSSEMAPHORES  EQU 1
  20794.  
  20795. PUSH@  OTHER   FSRamSemStructure ;FS Ram Semaphore data structure
  20796. CALL   DosFSRamSemClear
  20797.  
  20798. Returns WORD
  20799.  
  20800.  
  20801. ΓòÉΓòÉΓòÉ <hidden> DosFSRamSemRequest ΓòÉΓòÉΓòÉ
  20802.  
  20803. DOSFSRSEM struc
  20804.  
  20805.   dosfsrs_cb      dw  ? ;length of this structure (bytes)
  20806.   dosfsrs_pid     dw  ? ;Process ID of owner or zero
  20807.   dosfsrs_tid     dw  ? ;Thread ID of owner or zero
  20808.   dosfsrs_cUsage  dw  ? ;reference count
  20809.   dosfsrs_client  dw  ? ;16 bit field for use by owner
  20810.   dosfsrs_sem     dd  ? ;OS/2 Ram Semaphore
  20811.  
  20812. DOSFSRSEM ends
  20813.  
  20814. EXTRN  DosFSRamSemRequest:FAR
  20815. INCL_DOSSEMAPHORES  EQU 1
  20816.  
  20817. PUSH@  OTHER   FSRamSemStructure ;FS Ram Semaphore data structure
  20818. PUSH   DWORD   Timeout           ;Timeout (in milliseconds)
  20819. CALL   DosFSRamSemRequest
  20820.  
  20821. Returns WORD
  20822.  
  20823.  
  20824. ΓòÉΓòÉΓòÉ <hidden> DosGetCollate ΓòÉΓòÉΓòÉ
  20825.  
  20826. COUNTRYCODE struc
  20827.  
  20828.   ctryc_country   dw  ? ;country code
  20829.   ctryc_codepage  dw  ? ;code page
  20830.  
  20831. COUNTRYCODE ends
  20832.  
  20833. EXTRN  DosGetCollate:FAR
  20834. INCL_DOSNLS         EQU 1
  20835.  
  20836. PUSH   WORD    Length        ;Length of data area provided
  20837. PUSH@  OTHER   Structure     ;Input data structure
  20838. PUSH@  OTHER   MemoryBuffer  ;Collate table (returned)
  20839. PUSH@  WORD    DataLength    ;Length of collate table (returned)
  20840. CALL   DosGetCollate
  20841.  
  20842. Returns WORD
  20843.  
  20844.  
  20845. ΓòÉΓòÉΓòÉ <hidden> DosGetCp ΓòÉΓòÉΓòÉ
  20846.  
  20847. EXTRN  DosGetCp:FAR
  20848. INCL_DOSNLS         EQU 1
  20849.  
  20850. PUSH   WORD    Length        ;Length of list
  20851. PUSH@  WORD    CodePageList  ;List (returned)
  20852. PUSH@  WORD    DataLength    ;Length of list (returned)
  20853. CALL   DosGetCp
  20854.  
  20855. Returns WORD
  20856.  
  20857.  
  20858. ΓòÉΓòÉΓòÉ <hidden> DosGetCtryInfo ΓòÉΓòÉΓòÉ
  20859.  
  20860. COUNTRYCODE struc
  20861.  
  20862.   ctryc_country   dw  ? ;country code
  20863.   ctryc_codepage  dw  ? ;code page
  20864.  
  20865. COUNTRYCODE ends
  20866.  
  20867. COUNTRYINFO struc
  20868.  
  20869.   ctryi_country              dw  ? ;country code
  20870.   ctryi_codepage             dw  ? ;code page
  20871.   ctryi_fsDateFmt            dw  ? ;date format
  20872.   ctryi_szCurrency           db  5 dup (?) ;currency indicator
  20873.   ctryi_szThousandsSeparator db  2 dup (?) ;thousands separator
  20874.   ctryi_szDecimal            db  2 dup (?) ;decimal separator
  20875.   ctryi_szDateSeparator      db  2 dup (?) ;date separator
  20876.   ctryi_szTimeSeparator      db  2 dup (?) ;time separator
  20877.   ctryi_fsCurrencyFmt        db  ? ;bit fields for currency format
  20878.   ctryi_cDecimalPlace        db  ? ;currency decimal places
  20879.   ctryi_fsTimeFmt            db  ? ;Time format (AM/PM or 24 hr)
  20880.   ctryi_abReserved1          dw  2 dup (?) ;reserved (0)
  20881.   ctryi_szDataSeparator      db  2 dup (?) ;Data list separator
  20882.   ctryi_abReserved2          dw  5 dup (?) ;reserved (0)
  20883.  
  20884. COUNTRYINFO ends
  20885.  
  20886. EXTRN  DosGetCtryInfo:FAR
  20887. INCL_DOSNLS         EQU 1
  20888.  
  20889. PUSH   WORD    Length        ;Length of data area provided
  20890. PUSH@  OTHER   Structure     ;Input data structure
  20891. PUSH@  OTHER   MemoryBuffer  ;Country information (returned)
  20892. PUSH@  WORD    DataLength    ;Length of data (returned)
  20893. CALL   DosGetCtryInfo
  20894.  
  20895. Returns WORD
  20896.  
  20897.  
  20898. ΓòÉΓòÉΓòÉ <hidden> DosGetDateTime ΓòÉΓòÉΓòÉ
  20899.  
  20900. DATETIME struc
  20901.  
  20902.   date_hours      db  ? ;current hour
  20903.   date_minutes    db  ? ;current minute
  20904.   date_seconds    db  ? ;current second
  20905.   date_hundredths db  ? ;current hundredths of a second
  20906.   date_day        db  ? ;current day
  20907.   date_month      db  ? ;current month
  20908.   date_year       dw  ? ;current year
  20909.   date_timezone   dw  ? ;minutes of time west of UTC
  20910.   date_weekday    db  ? ;current day of week
  20911.  
  20912. DATETIME ends
  20913.  
  20914. EXTRN  DosGetDateTime:FAR
  20915. INCL_DOSDATETIME    EQU 1
  20916.  
  20917. PUSH@  OTHER   DateTime      ;Date/time structure (returned)
  20918. CALL   DosGetDateTime
  20919.  
  20920. Returns WORD
  20921.  
  20922.  
  20923. ΓòÉΓòÉΓòÉ <hidden> DosGetDBCSEv ΓòÉΓòÉΓòÉ
  20924.  
  20925. COUNTRYCODE struc
  20926.  
  20927.   ctryc_country   dw  ? ;country code
  20928.   ctryc_codepage  dw  ? ;code page
  20929.  
  20930. COUNTRYCODE ends
  20931.  
  20932. EXTRN  DosGetDBCSEv:FAR
  20933. INCL_DOSNLS         EQU 1
  20934.  
  20935. PUSH   WORD    Length        ;Length of data area provided
  20936. PUSH@  OTHER   Structure     ;Input data structure
  20937. PUSH@  OTHER   MemoryBuffer  ;DBCS environmental vector (returned)
  20938. CALL   DosGetDBCSEv
  20939.  
  20940. Returns WORD
  20941.  
  20942.  
  20943. ΓòÉΓòÉΓòÉ <hidden> DosGetEnv ΓòÉΓòÉΓòÉ
  20944.  
  20945. EXTRN  DosGetEnv:FAR
  20946. INCL_DOSMISC      EQU 1
  20947.  
  20948. PUSH@  WORD    EnvSegment    ;Selector (returned)
  20949. PUSH@  WORD    CmdOffset     ;Command line offset (returned)
  20950. CALL   DosGetEnv
  20951.  
  20952. Returns WORD
  20953.  
  20954.  
  20955. ΓòÉΓòÉΓòÉ <hidden> DosGetHugeShift ΓòÉΓòÉΓòÉ
  20956.  
  20957. EXTRN  DosGetHugeShift:FAR
  20958. INCL_DOSMEMMGR      EQU 1
  20959.  
  20960. PUSH@  WORD    ShiftCount    ;Shift Count (returned)
  20961. CALL   DosGetHugeShift
  20962.  
  20963. Returns WORD
  20964.  
  20965.  
  20966. ΓòÉΓòÉΓòÉ <hidden> DosGetInfoSeg ΓòÉΓòÉΓòÉ
  20967.  
  20968. GINFOSEG struc
  20969.  
  20970.   gis_time                dd  ? ;time in seconds
  20971.   gis_msecs               dd  ? ;milliseconds
  20972.   gis_hour                db  ? ;hours
  20973.   gis_minutes             db  ? ;minutes
  20974.   gis_seconds             db  ? ;seconds
  20975.   gis_hundredths          db  ? ;hundredths
  20976.   gis_timezone            dw  ? ;minutes from UTC
  20977.   gis_cusecTimerInterval  dw  ? ;timer interval (units = 0.0001 seconds)
  20978.   gis_day                 db  ? ;day
  20979.   gis_month               db  ? ;month
  20980.   gis_year                dw  ? ;year
  20981.   gis_weekday             db  ? ;day of week
  20982.   gis_uchMajorVersion     db  ? ;major version number
  20983.   gis_uchMinorVersion     db  ? ;minor version number
  20984.   gis_chRevisionLetter    db  ? ;revision letter
  20985.   gis_sgCurrent           db  ? ;current foreground session
  20986.   gis_sgMax               db  ? ;maximum number of sessions
  20987.   gis_cHugeShift          db  ? ;shift count for huge elements
  20988.   gis_fProtectModeOnly    db  ? ;protect mode only indicator
  20989.   gis_pidForeground       dw  ? ;pid of last process in foreground session
  20990.   gis_fDynamicSched       db  ? ;dynamic variation flag
  20991.   gis_csecMaxWait         db  ? ;max wait in seconds
  20992.   gis_cmsecMinSlice       dw  ? ;minimum timeslice (milliseconds)
  20993.   gis_cmsecMaxSlice       dw  ? ;maximum timeslice (milliseconds)
  20994.   gis_bootdrive           dw  ? ;drive from which the system was booted
  20995.   gis_amecRAS             db  32 dup (?) ;system trace major code flag bits
  20996.   gis_csgWindowableVioMax db  ? ;maximum number of VIO windowable sessions
  20997.   gis_csgPMMax            db  ? ;maximum number of pres. services sessions
  20998.  
  20999. GINFOSEG ends
  21000.  
  21001. LINFOSEG struc
  21002.  
  21003.   lis_pidCurrent      dw  ? ;current process id
  21004.   lis_pidParent       dw  ? ;process id of parent
  21005.   lis_prtyCurrent     dw  ? ;priority of current thread
  21006.   lis_tidCurrent      dw  ? ;thread ID of current thread
  21007.   lis_sgCurrent       dw  ? ;session
  21008.   lis_rfProcStatus    db  ? ;process status
  21009.   lis_dummy1          db  ? ;
  21010.   lis_fForeground     dw  ? ;current process has keyboard focus
  21011.   lis_typeProcess     db  ? ;process type
  21012.   lis_dummy2          db  ? ;
  21013.   lis_selEnvironment  dw  ? ;environment selector
  21014.   lis_offCmdLine      dw  ? ;command line offset
  21015.   lis_cbDataSegment   dw  ? ;length of data segment
  21016.   lis_cbStack         dw  ? ;stack size
  21017.   lis_cbHeap          dw  ? ;heap size
  21018.   lis_hmod            dw  ? ;module handle of the application
  21019.   lis_selDS           dw  ? ;data segment handle of the application
  21020.  
  21021. LINFOSEG ends
  21022.  
  21023. EXTRN  DosGetInfoSeg:FAR
  21024. INCL_DOSINFOSEG     EQU 1
  21025.  
  21026. PUSH@  WORD    GlobalSeg     ;Global segment selector (returned)
  21027. PUSH@  WORD    LocalSeg      ;Local segment selector (returned)
  21028. CALL   DosGetInfoSeg
  21029.  
  21030. Returns WORD
  21031.  
  21032.  
  21033. ΓòÉΓòÉΓòÉ <hidden> DosGetMachineMode ΓòÉΓòÉΓòÉ
  21034.  
  21035. EXTRN  DosGetMachineMode:FAR
  21036. INCL_DOSQUEUES      EQU 1
  21037.  
  21038. PUSH@  BYTE    MachineMode   ;Processor mode (returned)
  21039. CALL   DosGetMachineMode
  21040.  
  21041. Returns WORD
  21042.  
  21043.  
  21044. ΓòÉΓòÉΓòÉ <hidden> DosGetMessage ΓòÉΓòÉΓòÉ
  21045.  
  21046. EXTRN  DosGetMessage:FAR
  21047. INCL_DOSMISC      EQU 1
  21048.  
  21049. PUSH@  OTHER   IvTable       ;Table of variables to insert
  21050. PUSH   WORD    IvCount       ;Number of variables
  21051. PUSH@  OTHER   DataArea      ;Message buffer (returned)
  21052. PUSH   WORD    DataLength    ;Length of buffer
  21053. PUSH   WORD    MsgNumber     ;Number of the message
  21054. PUSH@  ASCIIZ  FileName      ;Message file path name string
  21055. PUSH@  WORD    MsgLength     ;Length of message (returned)
  21056. CALL   DosGetMessage
  21057.  
  21058. Returns WORD
  21059.  
  21060.  
  21061. ΓòÉΓòÉΓòÉ <hidden> DosGetModHandle ΓòÉΓòÉΓòÉ
  21062.  
  21063. EXTRN  DosGetModHandle:FAR
  21064. INCL_DOSMODULEMGR   EQU 1
  21065.  
  21066. PUSH@  ASCIIZ  ModuleName    ;Module name string
  21067. PUSH@  WORD    ModuleHandle  ;Module handle (returned)
  21068. CALL   DosGetModHandle
  21069.  
  21070. Returns WORD
  21071.  
  21072.  
  21073. ΓòÉΓòÉΓòÉ <hidden> DosGetModName ΓòÉΓòÉΓòÉ
  21074.  
  21075. EXTRN  DosGetModName:FAR
  21076. INCL_DOSMODULEMGR   EQU 1
  21077.  
  21078. PUSH   WORD    ModuleHandle  ;Module handle
  21079. PUSH   WORD    BufferLength  ;Buffer length
  21080. PUSH@  OTHER   Buffer        ;Buffer (returned)
  21081. CALL   DosGetModName
  21082.  
  21083. Returns WORD
  21084.  
  21085.  
  21086. ΓòÉΓòÉΓòÉ <hidden> DosGetPID ΓòÉΓòÉΓòÉ
  21087.  
  21088.  
  21089. PIDINFO struc
  21090.   pidi_pid       dw  ? ;current process' process ID
  21091.   pidi_tid       dw  ? ;current process' thread ID
  21092.   pidi_pidParent dw  ? ;process ID of the parent
  21093.  
  21094. PIDINFO ends
  21095.  
  21096. EXTRN  DosGetPID:FAR
  21097. INCL_DOSPROCESS     EQU 1
  21098.  
  21099. PUSH@  OTHER   ProcessIDsArea ;Process IDs (returned)
  21100. CALL   DosGetPID
  21101.  
  21102. Returns NONE
  21103.  
  21104.  
  21105. ΓòÉΓòÉΓòÉ <hidden> DosGetPPID ΓòÉΓòÉΓòÉ
  21106.  
  21107. EXTRN  DosGetPPID:FAR
  21108. INCL_DOSPROCESS     EQU 1
  21109.  
  21110. PUSH   WORD    PID           ;Process whose parent is wanted
  21111. PUSH@  WORD    PPID          ;Address to put parent's PID
  21112. CALL   DosGetPPID
  21113.  
  21114. Returns NONE
  21115.  
  21116.  
  21117. ΓòÉΓòÉΓòÉ <hidden> DosGetProcAddr ΓòÉΓòÉΓòÉ
  21118.  
  21119. EXTRN  DosGetProcAddr:FAR
  21120. INCL_DOSMODULEMGR   EQU 1
  21121.  
  21122. PUSH   WORD    ModuleHandle  ;Module handle
  21123. PUSH@  ASCIIZ  ProcName      ;Module name string
  21124. PUSH@  DWORD   ProcAddress   ;Procedure address (returned)
  21125. CALL   DosGetProcAddr
  21126.  
  21127. Returns WORD
  21128.  
  21129.  
  21130. ΓòÉΓòÉΓòÉ <hidden> DosGetPrty ΓòÉΓòÉΓòÉ
  21131.  
  21132. EXTRN  DosGetPrty:FAR
  21133. INCL_DOSPROCESS     EQU 1
  21134.  
  21135. PUSH   WORD    Scope         ;Indicate scope of query
  21136. PUSH@  WORD    Priority      ;Priority (returned)
  21137. PUSH   WORD    ID            ;Process or thread ID
  21138. CALL   DosGetPrty
  21139.  
  21140. Returns WORD
  21141.  
  21142.  
  21143. ΓòÉΓòÉΓòÉ <hidden> DosGetResource ΓòÉΓòÉΓòÉ
  21144.  
  21145. EXTRN  DosGetResource:FAR
  21146. INCL_DOSRESOURCES   EQU 1
  21147.  
  21148. PUSH   WORD    ModHandle     ;Module handle to get resource from
  21149. PUSH   WORD    TypeID        ;16 bit resource type ID
  21150. PUSH   WORD    NameID        ;16 bit resource name ID
  21151. PUSH@  WORD    Selector      ;Resource selector (returned)
  21152. CALL   DosGetResource
  21153.  
  21154. Returns WORD
  21155.  
  21156.  
  21157. ΓòÉΓòÉΓòÉ <hidden> DosGetResource2 ΓòÉΓòÉΓòÉ
  21158.  
  21159. EXTRN  DosGetResource2:FAR
  21160. INCL_DOSRESOURCES2  EQU 1
  21161.  
  21162. PUSH   WORD    ModHandle     ;Module handle to get resource from
  21163. PUSH   WORD    TypeID        ;16 bit resource type ID
  21164. PUSH   WORD    NameID        ;16 bit resource name ID
  21165. PUSH@  DWORD   ResAddr       ;Resource address (returned)
  21166. CALL   DosGetResource2
  21167.  
  21168. Returns WORD
  21169.  
  21170.  
  21171. ΓòÉΓòÉΓòÉ <hidden> DosGetSeg ΓòÉΓòÉΓòÉ
  21172.  
  21173. EXTRN  DosGetSeg:FAR
  21174. INCL_DOSMEMMGR      EQU 1
  21175.  
  21176. PUSH   WORD    Selector      ;Selector to access
  21177. CALL   DosGetSeg
  21178.  
  21179. Returns WORD
  21180.  
  21181.  
  21182. ΓòÉΓòÉΓòÉ <hidden> DosGetShrSeg ΓòÉΓòÉΓòÉ
  21183.  
  21184. EXTRN  DosGetShrSeg:FAR
  21185. INCL_DOSMEMMGR      EQU 1
  21186.  
  21187. PUSH@  ASCIIZ  Name          ;Name string
  21188. PUSH@  WORD    Selector      ;Selector of shared segment (returned)
  21189. CALL   DosGetShrSeg
  21190.  
  21191. Returns WORD
  21192.  
  21193.  
  21194. ΓòÉΓòÉΓòÉ <hidden> DosGetVersion ΓòÉΓòÉΓòÉ
  21195.  
  21196. EXTRN  DosGetVersion:FAR
  21197. INCL_DOSMISC      EQU 1
  21198.  
  21199. PUSH@  WORD    VersionWord   ;Version number(returned)
  21200. CALL   DosGetVersion
  21201.  
  21202. Returns WORD
  21203.  
  21204.  
  21205. ΓòÉΓòÉΓòÉ <hidden> DosGiveSeg ΓòÉΓòÉΓòÉ
  21206.  
  21207. EXTRN  DosGiveSeg:FAR
  21208. INCL_DOSMEMMGR      EQU 1
  21209.  
  21210. PUSH   WORD    CallerSegSelector    ;Caller's segment selector
  21211. PUSH   WORD    ProcessID            ;Process ID of recipient
  21212. PUSH@  WORD    RecipientSegSelector ;Recipient's segment selector (returned)
  21213. CALL   DosGiveSeg
  21214.  
  21215. Returns WORD
  21216.  
  21217.  
  21218. ΓòÉΓòÉΓòÉ <hidden> DosHoldSignal ΓòÉΓòÉΓòÉ
  21219.  
  21220. EXTRN  DosHoldSignal:FAR
  21221. INCL_DOSSIGNALS     EQU 1
  21222.  
  21223. PUSH   WORD    ActionCode    ;Indicate to Disable/Enable Signals
  21224. CALL   DosHoldSignal
  21225.  
  21226. Returns NONE
  21227.  
  21228.  
  21229. ΓòÉΓòÉΓòÉ <hidden> DosInsMessage ΓòÉΓòÉΓòÉ
  21230.  
  21231. EXTRN  DosInsMessage:FAR
  21232. INCL_DOSMISC      EQU 1
  21233.  
  21234. PUSH@  OTHER   IvTable       ;Table of variables to insert
  21235. PUSH   WORD    IvCount       ;Number of variables
  21236. PUSH@  ASCIIZ  MsgInput      ;Input message string
  21237. PUSH   WORD    MsgInLength   ;Length of input message
  21238. PUSH@  OTHER   DataArea      ;Updated message (returned)
  21239. PUSH   WORD    DataLength    ;Length of updated message buffer
  21240. PUSH@  WORD    MsgLength     ;Length of updated message (returned)
  21241. CALL   DosInsMessage
  21242.  
  21243. Returns WORD
  21244.  
  21245.  
  21246. ΓòÉΓòÉΓòÉ <hidden> DosKillProcess ΓòÉΓòÉΓòÉ
  21247.  
  21248. EXTRN  DosKillProcess:FAR
  21249. INCL_DOSPROCESS     EQU 1
  21250.  
  21251. PUSH   WORD    ActionCode    ;Indicator for child process termination
  21252. PUSH   WORD    ProcessID     ;ID of the process being terminated
  21253. CALL   DosKillProcess
  21254.  
  21255. Returns WORD
  21256.  
  21257.  
  21258. ΓòÉΓòÉΓòÉ <hidden> DosLoadModule ΓòÉΓòÉΓòÉ
  21259.  
  21260. EXTRN  DosLoadModule:FAR
  21261. INCL_DOSMODULEMGR   EQU 1
  21262.  
  21263. PUSH@  OTHER   ObjNameBuf    ;Object name buffer (returned)
  21264. PUSH   WORD    ObjNameBufL   ;Length of object name buffer
  21265. PUSH@  ASCIIZ  ModuleName    ;Module name string
  21266. PUSH@  WORD    ModuleHandle  ;Module handle (returned)
  21267. CALL           DosLoadModule
  21268.  
  21269. Returns WORD
  21270.  
  21271.  
  21272. ΓòÉΓòÉΓòÉ <hidden> DosLockSeg ΓòÉΓòÉΓòÉ
  21273.  
  21274. EXTRN  DosLockSeg:FAR
  21275. INCL_DOSMEMMGR      EQU 1
  21276.  
  21277. PUSH   WORD    Selector      ;Selector to lock
  21278. CALL   DosLockSeg
  21279.  
  21280. Returns WORD
  21281.  
  21282.  
  21283. ΓòÉΓòÉΓòÉ <hidden> DosMakeNmPipe ΓòÉΓòÉΓòÉ
  21284.  
  21285. EXTRN  DosMakeNmPipe:FAR
  21286. INCL_DOSNMPIPES     EQU 1
  21287.  
  21288. PUSH@  ASCIIZ  PipeName      ;Pipe name
  21289. PUSH@  WORD    PipeHandle    ;Pipe handle (returned)
  21290. PUSH   WORD    OpenMode      ;DOS open mode of pipe
  21291. PUSH   WORD    PipeMode      ;Pipe open mode
  21292. PUSH   WORD    OutBufSize    ;Advisory outgoing buffer size
  21293. PUSH   WORD    InBufSize     ;Advisory incoming buffer size
  21294. PUSH   DWORD   TimeOut       ;Timeout for DosWaitNmPipe
  21295. CALL   DosMakeNmPipe
  21296.  
  21297. Returns WORD
  21298.  
  21299.  
  21300. ΓòÉΓòÉΓòÉ <hidden> DosMakePipe ΓòÉΓòÉΓòÉ
  21301.  
  21302. EXTRN  DosMakePipe:FAR
  21303. INCL_DOSQUEUES      EQU 1
  21304.  
  21305. PUSH@  WORD    ReadHandle    ;Read handle (returned)
  21306. PUSH@  WORD    WriteHandle   ;Write handle (returned)
  21307. PUSH   WORD    PipeSize      ;Size to reserve for the pipe
  21308. CALL   DosMakePipe
  21309.  
  21310. Returns WORD
  21311.  
  21312.  
  21313. ΓòÉΓòÉΓòÉ <hidden> DosMemAvail ΓòÉΓòÉΓòÉ
  21314.  
  21315. EXTRN  DosMemAvail:FAR
  21316. INCL_DOSMEMMGR      EQU 1
  21317.  
  21318. PUSH@  DWORD   MemAvailSize  ;Size available (returned)
  21319. CALL   DosMemAvail
  21320.  
  21321. Returns WORD
  21322.  
  21323.  
  21324. ΓòÉΓòÉΓòÉ <hidden> DosMkDir ΓòÉΓòÉΓòÉ
  21325.  
  21326. EXTRN  DosMkDir:FAR
  21327. INCL_DOSFILEMGR     EQU 1
  21328.  
  21329. PUSH@  ASCIIZ  DirName       ;New directory name string
  21330. PUSH   DWORD   0             ;Reserved (must be zero)
  21331. CALL   DosMkDir
  21332.  
  21333. Returns WORD
  21334.  
  21335.  
  21336. ΓòÉΓòÉΓòÉ <hidden> DosMkDir2 ΓòÉΓòÉΓòÉ
  21337.  
  21338. GEA    struc
  21339.  
  21340.   gea_cbName      db  ?          ;name length not including NULL
  21341.   gea_szName      db  1 dup (?)  ;attribute name
  21342.  
  21343. GEA    ends
  21344.  
  21345. GEALIST    struc
  21346.  
  21347.   geal_cbList     dd  ?      ;total bytes of structure including full list
  21348.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  21349.  
  21350. GEALIST    ends
  21351.  
  21352. FEA   struc
  21353.  
  21354.   fea_fEA         db  ? ;flags
  21355.   fea_cbName      db  ? ;name length not including NULL
  21356.   fea_cbValue     dw  ? ;value length
  21357.  
  21358. FEA   ends
  21359.  
  21360. FEALIST struc
  21361.  
  21362.   feal_cbList     dd  ?      ;total bytes of structure including full list
  21363.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  21364.  
  21365. FEALIST ends
  21366.  
  21367. EAOP    struc
  21368.  
  21369.   eaop_fpGEAList  dd  ? ;general EA list
  21370.   eaop_fpFEAList  dd  ? ;full EA list
  21371.   eaop_oError     dd  ? ;
  21372.  
  21373. EAOP    ends
  21374.  
  21375. EXTRN  DosMkDir2:FAR
  21376. INCL_DOSFILEMGR     EQU 1
  21377.  
  21378. PUSH@  ASCIIZ  DirName       ;New directory name string
  21379. PUSH@  OTHER   EABuf         ;Extended attribute buffer
  21380. PUSH   DWORD   0             ;Reserved (must be zero)
  21381. CALL   DosMkDir2
  21382.  
  21383. Returns WORD
  21384.  
  21385.  
  21386. ΓòÉΓòÉΓòÉ <hidden> DosMonClose ΓòÉΓòÉΓòÉ
  21387.  
  21388. EXTRN  DosMonClose:FAR
  21389. INCL_DOSMONITORS    EQU 1
  21390.  
  21391. PUSH   WORD    Handle        ;Monitor handle
  21392. CALL   DosMonClose
  21393.  
  21394. Returns WORD
  21395.  
  21396.  
  21397. ΓòÉΓòÉΓòÉ <hidden> DosMonOpen ΓòÉΓòÉΓòÉ
  21398.  
  21399. EXTRN  DosMonOpen:FAR
  21400. INCL_DOSMONITORS    EQU 1
  21401.  
  21402. PUSH@  ASCIIZ  Devname       ;Device name string
  21403. PUSH@  WORD    Handle        ;Monitor handle (returned)
  21404. CALL   DosMonOpen
  21405.  
  21406. Returns WORD
  21407.  
  21408.  
  21409. ΓòÉΓòÉΓòÉ <hidden> DosMonRead ΓòÉΓòÉΓòÉ
  21410.  
  21411. EXTRN  DosMonRead:FAR
  21412. INCL_DOSMONITORS    EQU 1
  21413.  
  21414. PUSH@  OTHER   BufferI       ;Monitor input buffer
  21415. PUSH   WORD    WaitFlag      ;Block/Run indicator
  21416. PUSH@  OTHER   DataBuffer    ;Buffer into which records are read
  21417. PUSH@  WORD    Bytecnt       ;Input/output parm-#bytes (returned)
  21418. CALL   DosMonRead
  21419.  
  21420. Returns WORD
  21421.  
  21422.  
  21423. ΓòÉΓòÉΓòÉ <hidden> DosMonReg ΓòÉΓòÉΓòÉ
  21424.  
  21425. EXTRN  DosMonReg:FAR
  21426. INCL_DOSMONITORS    EQU 1
  21427.  
  21428. PUSH   WORD    Handle        ;Monitor handle
  21429. PUSH@  OTHER   BufferI       ;Input buffer
  21430. PUSH@  OTHER   BufferO       ;Output buffer
  21431. PUSH   WORD    Posflag       ;Position flag
  21432. PUSH   WORD    Index         ;Index
  21433. CALL   DosMonReg
  21434.  
  21435. Returns WORD
  21436.  
  21437.  
  21438. ΓòÉΓòÉΓòÉ <hidden> DosMonWrite ΓòÉΓòÉΓòÉ
  21439.  
  21440. EXTRN  DosMonWrite:FAR
  21441. INCL_DOSMONITORS    EQU 1
  21442.  
  21443. PUSH@  OTHER   BufferO       ;Monitor output buffer
  21444. PUSH@  OTHER   DataBuffer    ;Buffer from which records are taken
  21445. PUSH   WORD    Bytecnt       ;Number of bytes
  21446. CALL   DosMonWrite
  21447.  
  21448. Returns WORD
  21449.  
  21450.  
  21451. ΓòÉΓòÉΓòÉ <hidden> DosMove ΓòÉΓòÉΓòÉ
  21452.  
  21453. EXTRN  DosMove:FAR
  21454. INCL_DOSFILEMGR     EQU 1
  21455.  
  21456. PUSH@  ASCIIZ  OldPathName   ;Old path name string
  21457. PUSH@  ASCIIZ  NewPathName   ;New path name string
  21458. PUSH   DWORD   0             ;Reserved (must be zero)
  21459. CALL   DosMove
  21460.  
  21461. Returns WORD
  21462.  
  21463.  
  21464. ΓòÉΓòÉΓòÉ <hidden> DosMuxSemWait ΓòÉΓòÉΓòÉ
  21465.  
  21466. MUXSEMLIST struc
  21467.  
  21468.   mxsl_cmxs dw  ? ;count of MuxSem structures
  21469.   mxsl_amxs dw (size MUXSEM)/2 * 16 dup (?) ;MuxSem structure
  21470.  
  21471. MUXSEMLIST ends
  21472.  
  21473. MUXSEM  struc
  21474.  
  21475.   mxs_zero  dw  ? ;zero
  21476.   mxs_hsem  dd  ? ;semaphore handle
  21477.  
  21478. MUXSEM  ends
  21479.  
  21480. EXTRN  DosMuxSemWait:FAR
  21481. INCL_DOSSEMAPHORES  EQU 1
  21482.  
  21483. PUSH@  WORD    IndexNbr      ;Index number of event (returned)
  21484. PUSH@  OTHER   ListAddr      ;Semaphore list
  21485. PUSH   DWORD   Timeout       ;Timeout (in milliseconds)
  21486. CALL   DosMuxSemWait
  21487.  
  21488. Returns WORD
  21489.  
  21490.  
  21491. ΓòÉΓòÉΓòÉ <hidden> DosNewSize ΓòÉΓòÉΓòÉ
  21492.  
  21493. EXTRN  DosNewSize:FAR
  21494. INCL_DOSFILEMGR     EQU 1
  21495.  
  21496. PUSH   WORD    FileHandle    ;File handle
  21497. PUSH   DWORD   FileSize      ;File's new size
  21498. CALL   DosNewSize
  21499.  
  21500. Returns WORD
  21501.  
  21502.  
  21503. ΓòÉΓòÉΓòÉ <hidden> DosOpen ΓòÉΓòÉΓòÉ
  21504.  
  21505. EXTRN  DosOpen:FAR
  21506. INCL_DOSFILEMGR     EQU 1
  21507.  
  21508. PUSH@  ASCIIZ  FileName      ;File path name string
  21509. PUSH@  WORD    FileHandle    ;File handle (returned)
  21510. PUSH@  WORD    ActionTaken   ;Action taken (returned)
  21511. PUSH   DWORD   FileSize      ;File primary allocation
  21512. PUSH   WORD    FileAttribute ;File Attribute
  21513. PUSH   WORD    OpenFlag      ;Open function type
  21514. PUSH   WORD    OpenMode      ;Open mode of the file
  21515. PUSH   DWORD   0             ;Reserved (must be zero)
  21516. CALL   DosOpen
  21517.  
  21518. Returns WORD
  21519.  
  21520.  
  21521. ΓòÉΓòÉΓòÉ <hidden> DosOpen2 ΓòÉΓòÉΓòÉ
  21522.  
  21523. GEA    struc
  21524.  
  21525.   gea_cbName      db  ?          ;name length not including NULL
  21526.   gea_szName      db  1 dup (?)  ;attribute name
  21527.  
  21528. GEA    ends
  21529.  
  21530. GEALIST    struc
  21531.  
  21532.   geal_cbList     dd  ?      ;total bytes of structure including full list
  21533.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  21534.  
  21535. GEALIST    ends
  21536.  
  21537. FEA   struc
  21538.  
  21539.   fea_fEA         db  ? ;flags
  21540.   fea_cbName      db  ? ;name length not including NULL
  21541.   fea_cbValue     dw  ? ;value length
  21542.  
  21543. FEA   ends
  21544.  
  21545. FEALIST struc
  21546.  
  21547.   feal_cbList     dd  ?      ;total bytes of structure including full list
  21548.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  21549.  
  21550. FEALIST ends
  21551.  
  21552. EAOP    struc
  21553.  
  21554.   eaop_fpGEAList  dd  ? ;general EA list
  21555.   eaop_fpFEAList  dd  ? ;full EA list
  21556.   eaop_oError     dd  ? ;
  21557.  
  21558. EAOP    ends
  21559.  
  21560. EXTRN  DosOpen2:FAR
  21561. INCL_DOSFILEMGR     EQU 1
  21562.  
  21563. PUSH@  ASCIIZ  FileName      ;File path name string
  21564. PUSH@  WORD    FileHandle    ;File handle (returned)
  21565. PUSH@  WORD    ActionTaken   ;Action taken (returned)
  21566. PUSH   DWORD   FileSize      ;File primary allocation
  21567. PUSH   WORD    FileAttribute ;File Attribute
  21568. PUSH   WORD    OpenFlag      ;Open function type
  21569. PUSH   DWORD   OpenMode      ;Open mode of the file
  21570. PUSH@  OTHER   EABuf         ;Extended attribute buffer
  21571. PUSH   DWORD   0             ;Reserved (must be zero)
  21572. CALL   DosOpen2
  21573.  
  21574. Returns WORD
  21575.  
  21576.  
  21577. ΓòÉΓòÉΓòÉ <hidden> DosOpenQueue ΓòÉΓòÉΓòÉ
  21578.  
  21579. EXTRN  DosOpenQueue:FAR
  21580. INCL_DOSQUEUES      EQU 1
  21581.  
  21582. PUSH@  WORD    OwnerPID      ;Queue owners' PID (returned)
  21583. PUSH@  WORD    QueueHandle   ;Queue handle (returned)
  21584. PUSH@  ASCIIZ  QueueName     ;Queue name string
  21585. CALL   DosOpenQueue
  21586.  
  21587. Returns WORD
  21588.  
  21589.  
  21590. ΓòÉΓòÉΓòÉ <hidden> DosOpenSem ΓòÉΓòÉΓòÉ
  21591.  
  21592. EXTRN  DosOpenSem:FAR
  21593. INCL_DOSSEMAPHORES  EQU 1
  21594.  
  21595. PUSH@  DWORD   SemHandle     ;Semaphore handle (returned)
  21596. PUSH@  ASCIIZ  SemName       ;Semaphore name string
  21597. CALL   DosOpenSem
  21598.  
  21599. Returns WORD
  21600.  
  21601.  
  21602. ΓòÉΓòÉΓòÉ <hidden> DosPeekNmPipe ΓòÉΓòÉΓòÉ
  21603.  
  21604. EXTRN  DosPeekNmPipe:FAR
  21605. INCL_DOSNMPIPES     EQU 1
  21606.  
  21607. PUSH   WORD    Handle        ;Pipe handle
  21608. PUSH@  OTHER   Buffer        ;User buffer
  21609. PUSH   WORD    BufferLen     ;Buffer length
  21610. PUSH@  WORD    BytesRead     ;Bytes read (returned)
  21611. PUSH@  DWORD   BytesAvail    ;Bytes available (returned)
  21612. PUSH@  WORD    PipeState     ;Pipe state (returned)
  21613. CALL   DosPeekNmPipe
  21614.  
  21615. Returns WORD
  21616.  
  21617.  
  21618. ΓòÉΓòÉΓòÉ <hidden> DosPeekQueue ΓòÉΓòÉΓòÉ
  21619.  
  21620. EXTRN  DosPeekQueue:FAR
  21621. INCL_DOSQUEUES      EQU 1
  21622.  
  21623. PUSH   WORD    QueueHandle     ;Queue handle
  21624. PUSH@  DWORD   Request         ;Request identification data (returned)
  21625. PUSH@  WORD    DataLength      ;Length of element received (returned)
  21626. PUSH@  DWORD   DataAddress     ;Address of element received (returned)
  21627. PUSH@  WORD    ElementCode     ;Indicator of element received (returned)
  21628. PUSH   OTHER   NoWait          ;Indicate to not wait if queue is empty
  21629. PUSH@  BYTE    ElemPriority    ;Priority of element (returned)
  21630. PUSH   DWORD   SemaphoreHandle ;Semaphore Handle
  21631. CALL   DosPeekQueue
  21632.  
  21633. Returns WORD
  21634.  
  21635.  
  21636. ΓòÉΓòÉΓòÉ <hidden> DosPFSActivate ΓòÉΓòÉΓòÉ
  21637.  
  21638. EXTRN  DosPFSActivate:FAR
  21639. INCL_DOSPFS         EQU 1
  21640.  
  21641. PUSH@  DWORD   SplHandle     ;Temporary Spool File handle
  21642. PUSH@  DWORD   BytesWritten  ;Number of bytes written (returned)
  21643. PUSH@  ASCIIZ  PrinterName   ;Printer name string
  21644. PUSH   WORD    CodePage      ;Code Page to make active
  21645. PUSH   WORD    FontID        ;Font ID to make active
  21646. PUSH   WORD    SFN           ;System File Number
  21647. PUSH   DWORD   0             ;Reserved (must be zero)
  21648. CALL   DosPFSActivate
  21649.  
  21650. Returns WORD
  21651.  
  21652.  
  21653. ΓòÉΓòÉΓòÉ <hidden> DosPFSCloseUser ΓòÉΓòÉΓòÉ
  21654.  
  21655. EXTRN  DosPFSCloseUser:FAR
  21656. INCL_DOSPFS         EQU 1
  21657.  
  21658. PUSH@  ASCIIZ  PrinterName   ;Printer name string
  21659. PUSH   WORD    SFN           ;System File Number
  21660. PUSH   DWORD   0             ;Reserved (must be zero)
  21661. CALL   DosPFSCloseUser
  21662.  
  21663. Returns WORD
  21664.  
  21665.  
  21666. ΓòÉΓòÉΓòÉ <hidden> DosPFSInit ΓòÉΓòÉΓòÉ
  21667.  
  21668. EXTRN  DosPFSInit:FAR
  21669. INCL_DOSPFS         EQU 1
  21670.  
  21671. PUSH@  WORD    CPHdw         ;Hdw Font definition list
  21672. PUSH@  ASCIIZ  FontFileName  ;File pathname of the font file to use
  21673. PUSH@  ASCIIZ  PrinterType   ;Printer type string
  21674. PUSH@  ASCIIZ  PrinterName   ;Printer name string
  21675. PUSH   WORD    Instances     ;Number of spool instances
  21676. PUSH   DWORD   0             ;Reserved (must be zero)
  21677. CALL   DosPFSInit
  21678.  
  21679. Returns WORD
  21680.  
  21681.  
  21682. ΓòÉΓòÉΓòÉ <hidden> DosPFSQueryAct ΓòÉΓòÉΓòÉ
  21683.  
  21684. EXTRN  DosPFSQueryAct:FAR
  21685. INCL_DOSPFS         EQU 1
  21686.  
  21687. PUSH@  ASCIIZ  PrinterName   ;Printer name string
  21688. PUSH@  WORD    CodePage      ;Code Page return
  21689. PUSH@  WORD    FontID        ;Font ID return
  21690. PUSH   WORD    SFN           ;System File Number
  21691. PUSH   DWORD   0             ;Reserved (must be zero)
  21692. CALL   DosPFSQueryAct
  21693.  
  21694. Returns WORD
  21695.  
  21696.  
  21697. ΓòÉΓòÉΓòÉ <hidden> DosPFSVerifyFont ΓòÉΓòÉΓòÉ
  21698.  
  21699. EXTRN  DosPFSVerifyFont:FAR
  21700. INCL_DOSPFS         EQU 1
  21701.  
  21702. PUSH@  ASCIIZ  PrinterName   ;Printer name string
  21703. PUSH   WORD    CodePage      ;Code Page to validate
  21704. PUSH   WORD    FontID        ;Font Id to validate
  21705. PUSH   DWORD   0             ;Reserved (must be zero)
  21706. CALL   DosPFSVerifyFont
  21707.  
  21708. Returns WORD
  21709.  
  21710.  
  21711. ΓòÉΓòÉΓòÉ <hidden> DosPhysicalDisk ΓòÉΓòÉΓòÉ
  21712.  
  21713. EXTRN  DosPhysicalDisk:FAR
  21714. INCL_DOSDEVICES     EQU 1
  21715.  
  21716. PUSH   WORD    Function      ;Type of information
  21717. PUSH@  OTHER   DataPtr       ;Return buffer (returned)
  21718. PUSH   WORD    DataLen       ;Return buffer length
  21719. PUSH@  OTHER   ParmPtr       ;User-supplied information
  21720. PUSH   WORD    ParmLen       ;Length of user-supplied information
  21721. CALL   DosPhysicalDisk
  21722.  
  21723. Returns WORD
  21724.  
  21725.  
  21726. ΓòÉΓòÉΓòÉ <hidden> DosPortAccess ΓòÉΓòÉΓòÉ
  21727.  
  21728. EXTRN  DosPortAccess:FAR
  21729. INCL_DOSDEVICES     EQU 1
  21730.  
  21731. PUSH   WORD    0             ;Reserved (must be zero)
  21732. PUSH   WORD    TypeOfAccess  ;Request or release
  21733. PUSH   WORD    FirstPort     ;First port number
  21734. PUSH   WORD    LastPort      ;Last port number
  21735. CALL   DosPortAccess
  21736.  
  21737. Returns WORD
  21738.  
  21739.  
  21740. ΓòÉΓòÉΓòÉ <hidden> DosPtrace ΓòÉΓòÉΓòÉ
  21741.  
  21742. EXTRN  DosPtrace:FAR
  21743. INCL_DOSQUEUES      EQU 1
  21744.  
  21745. PUSH@  OTHER   Ptrace_B      ;Ptrace buffer (returned)
  21746. CALL   DosPtrace
  21747.  
  21748. Returns WORD
  21749.  
  21750.  
  21751. ΓòÉΓòÉΓòÉ <hidden> DosPurgeQueue ΓòÉΓòÉΓòÉ
  21752.  
  21753. EXTRN  DosPurgeQueue:FAR
  21754. INCL_DOSQUEUES      EQU 1
  21755.  
  21756. PUSH   WORD    QueueHandle   ;Queue handle
  21757. CALL   DosPurgeQueue
  21758.  
  21759. Returns WORD
  21760.  
  21761.  
  21762. ΓòÉΓòÉΓòÉ <hidden> DosPutMessage ΓòÉΓòÉΓòÉ
  21763.  
  21764. EXTRN  DosPutMessage:FAR
  21765. INCL_DOSMISC      EQU 1
  21766.  
  21767. PUSH   WORD    FileHandle    ;Handle of output file/device
  21768. PUSH   WORD    MessageLength ;Length of message buffer
  21769. PUSH@  OTHER   MessageBuffer ;Message buffer
  21770. CALL   DosPutMessage
  21771.  
  21772. Returns WORD
  21773.  
  21774.  
  21775. ΓòÉΓòÉΓòÉ <hidden> DosQAppType ΓòÉΓòÉΓòÉ
  21776.  
  21777. EXTRN  DosQAppType:FAR
  21778. INCL_DOSSESMGR      EQU 1
  21779.  
  21780. PUSH@  ASCIIZ  ExecutableFileName  ;Executable file path name string
  21781. PUSH@  WORD    AppType;            ;Application type flags (returned)
  21782. CALL   DosQAppType
  21783.  
  21784. Returns WORD
  21785.  
  21786.  
  21787. ΓòÉΓòÉΓòÉ <hidden> DosQCurDir ΓòÉΓòÉΓòÉ
  21788.  
  21789. EXTRN  DosQCurDir:FAR
  21790. INCL_DOSFILEMGR     EQU 1
  21791.  
  21792. PUSH   WORD    DriveNumber   ;Drive number
  21793. PUSH@  OTHER   DirPath       ;Directory path buffer (returned)
  21794. PUSH@  WORD    DirPathLen    ;Directory path buffer length (returned)
  21795. CALL   DosQCurDir
  21796.  
  21797. Returns WORD
  21798.  
  21799.  
  21800. ΓòÉΓòÉΓòÉ <hidden> DosQCurDisk ΓòÉΓòÉΓòÉ
  21801.  
  21802. EXTRN  DosQCurDisk:FAR
  21803. INCL_DOSFILEMGR     EQU 1
  21804.  
  21805. PUSH@  WORD    DriveNumber     ;Default drive number (returned)
  21806. PUSH@  DWORD   LogicalDriveMap ;Drive map area (returned)
  21807. CALL   DosQCurDisk
  21808.  
  21809. Returns WORD
  21810.  
  21811.  
  21812. ΓòÉΓòÉΓòÉ <hidden> DosQFHandState ΓòÉΓòÉΓòÉ
  21813.  
  21814. EXTRN  DosQFHandState:FAR
  21815. INCL_DOSFILEMGR     EQU 1
  21816.  
  21817. PUSH   WORD    FileHandle      ;File handle
  21818. PUSH@  WORD    FileHandleState ;File handle state (returned)
  21819. CALL   DosQFHandState
  21820.  
  21821. Returns WORD
  21822.  
  21823.  
  21824. ΓòÉΓòÉΓòÉ <hidden> DosQFileInfo ΓòÉΓòÉΓòÉ
  21825.  
  21826. FDATE   struc
  21827.  
  21828.   fdate_fs  dw  ?
  21829.  
  21830. FDATE   ends
  21831.  
  21832. FTIME   struc
  21833.  
  21834.   ftime_fs  dw  ?
  21835.  
  21836. FTIME   ends
  21837.  
  21838. FILESTATUS struc
  21839.  
  21840.   fsts_fdateCreation   dw (size FDATE)/2 dup (?) ;date of file creation
  21841.   fsts_ftimeCreation   dw (size FTIME)/2 dup (?) ;time of file creation
  21842.   fsts_fdateLastAccess dw (size FDATE)/2 dup (?) ;date of last access
  21843.   fsts_ftimeLastAccess dw (size FTIME)/2 dup (?) ;time of last access
  21844.   fsts_fdateLastWrite  dw (size FDATE)/2 dup (?) ;date of last write
  21845.   fsts_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;time of last write
  21846.   fsts_cbFile          dd  ? ;file size (end of data)
  21847.   fsts_cbFileAlloc     dd  ? ;file allocated size
  21848.   fsts_attrFile        dw  ? ;attributes of the file
  21849.  
  21850. FILESTATUS ends
  21851.  
  21852. GEA    struc
  21853.  
  21854.   gea_cbName      db  ?          ;name length not including NULL
  21855.   gea_szName      db  1 dup (?)  ;attribute name
  21856.  
  21857. GEA    ends
  21858.  
  21859. GEALIST    struc
  21860.  
  21861.   geal_cbList     dd  ?      ;total bytes of structure including full list
  21862.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  21863.  
  21864. GEALIST    ends
  21865.  
  21866. FEA   struc
  21867.  
  21868.   fea_fEA         db  ? ;flags
  21869.   fea_cbName      db  ? ;name length not including NULL
  21870.   fea_cbValue     dw  ? ;value length
  21871.  
  21872. FEA   ends
  21873.  
  21874. FEALIST struc
  21875.  
  21876.   feal_cbList     dd  ?      ;total bytes of structure including full list
  21877.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  21878.  
  21879. FEALIST ends
  21880.  
  21881. EAOP    struc
  21882.  
  21883.   eaop_fpGEAList  dd  ? ;general EA list
  21884.   eaop_fpFEAList  dd  ? ;full EA list
  21885.   eaop_oError     dd  ? ;
  21886.  
  21887. EAOP    ends
  21888.  
  21889. EXTRN  DosQFileInfo:FAR
  21890. INCL_DOSFILEMGR     EQU 1
  21891.  
  21892. PUSH   WORD    FileHandle      ;File handle
  21893. PUSH   WORD    FileInfoLevel   ;File data required
  21894. PUSH@  OTHER   FileInfoBuf     ;File data buffer (returned)
  21895. PUSH   WORD    FileInfoBufSize ;File data buffer size
  21896. CALL   DosQFileInfo
  21897.  
  21898. Returns WORD
  21899.  
  21900.  
  21901. ΓòÉΓòÉΓòÉ <hidden> DosQFileMode ΓòÉΓòÉΓòÉ
  21902.  
  21903. EXTRN  DosQFileMode:FAR
  21904. INCL_DOSFILEMGR     EQU 1
  21905.  
  21906. PUSH@  ASCIIZ  FilePathName     ;File path name
  21907. PUSH@  WORD    CurrentAttribute ;Data area (returned)
  21908. PUSH   DWORD   0                ;Reserved (must be zero)
  21909. CALL   DosQFileMode
  21910.  
  21911. Returns WORD
  21912.  
  21913.  
  21914. ΓòÉΓòÉΓòÉ <hidden> DosQFSAttach ΓòÉΓòÉΓòÉ
  21915.  
  21916. EXTRN DosQFSAttach:FAR
  21917. INCL_DOSFILEMGR     EQU 1
  21918.  
  21919. PUSH@  ASCIIZ DeviceName     ;Device name or drive letter string
  21920. PUSH   WORD   Ordinal        ;Ordinal of entry in name list
  21921. PUSH   WORD   FSAInfoLevel   ;Type of attached FSD data required
  21922. PUSH@  OTHER  DataBuffer     ;Data buffer (returned)
  21923. PUSH@  WORD   DataBufferLen  ;Buffer length (returned)
  21924. PUSH   DWORD  0              ;Reserved (must be zero)
  21925. CALL   DosQFSAttach
  21926.  
  21927. Returns WORD
  21928.  
  21929.  
  21930. ΓòÉΓòÉΓòÉ <hidden> DosQFSInfo ΓòÉΓòÉΓòÉ
  21931.  
  21932. FSALLOCATE struc
  21933.     fsalloc_idFileSystem        dd  ?
  21934.     fsalloc_cSectorUnit         dd  ?
  21935.     fsalloc_cUnit               dd  ?
  21936.     fsalloc_cUnitAvail          dd  ?
  21937.     fsalloc_cbSector            dw  ?
  21938. FSALLOCATE ends
  21939.  
  21940. EXTRN  DosQFSInfo:FAR
  21941. INCL_DOSFILEMGR     EQU 1
  21942.  
  21943. PUSH   WORD    DriveNumber   ;Drive number
  21944. PUSH   WORD    FSInfoLevel   ;File system data required
  21945. PUSH@  OTHER   FSInfoBuf     ;File system info buffer (returned)
  21946. PUSH   WORD    FSInfoBufSize ;File system info buffer size
  21947. CALL   DosQFSInfo
  21948.  
  21949. Returns WORD
  21950.  
  21951.  
  21952. ΓòÉΓòÉΓòÉ <hidden> DosQHandType ΓòÉΓòÉΓòÉ
  21953.  
  21954. EXTRN  DosQHandType:FAR
  21955. INCL_DOSFILEMGR     EQU 1
  21956.  
  21957. PUSH   WORD    FileHandle    ;File handle
  21958. PUSH@  WORD    HandType      ;Handle type (returned)
  21959. PUSH@  WORD    FlagWord      ;Device driver attribute (returned)
  21960. CALL   DosQHandType
  21961.  
  21962. Returns WORD
  21963.  
  21964.  
  21965. ΓòÉΓòÉΓòÉ <hidden> DosQNmPHandState ΓòÉΓòÉΓòÉ
  21966.  
  21967. EXTRN  DosQNmPHandState:FAR
  21968. INCL_DOSNMPIPES     EQU 1
  21969.  
  21970. PUSH   WORD    Handle          ;Pipe handle
  21971. PUSH@  WORD    PipeHandleState ;Pipe handle state (returned)
  21972. CALL   DosQNmPHandState
  21973.  
  21974. Returns WORD
  21975.  
  21976.  
  21977. ΓòÉΓòÉΓòÉ <hidden> DosQNmPipeInfo ΓòÉΓòÉΓòÉ
  21978.  
  21979. EXTRN  DosQNmPipeInfo:FAR
  21980. INCL_DOSNMPIPES     EQU 1
  21981.  
  21982. PUSH   WORD    Handle        ;Pipe handle
  21983. PUSH   WORD    InfoLevel     ;Pipe data required
  21984. PUSH@  OTHER   InfoBuf       ;Pipe data buffer
  21985. PUSH   WORD    InfoBufSize   ;Pipe data buffer size
  21986. CALL   DosQNmPipeInfo
  21987.  
  21988. Returns WORD
  21989.  
  21990.  
  21991. ΓòÉΓòÉΓòÉ <hidden> DosQNmPipeSemState ΓòÉΓòÉΓòÉ
  21992.  
  21993. EXTRN  DosQNmPipeSemState:FAR
  21994. INCL_DOSNMPIPES     EQU 1
  21995.  
  21996. PUSH   DWORD   SemHandle     ;Semaphore handle
  21997. PUSH@  OTHER   InfoBuf       ;Information (returned)
  21998. PUSH   WORD    InfoBufLen    ;Length of InfoBuf
  21999. CALL   DosQNmPipeSemState
  22000.  
  22001. Returns WORD
  22002.  
  22003.  
  22004. ΓòÉΓòÉΓòÉ <hidden> DosQPathInfo ΓòÉΓòÉΓòÉ
  22005.  
  22006. FDATE   struc
  22007.  
  22008.   fdate_fs  dw  ?
  22009.  
  22010. FDATE   ends
  22011.  
  22012. FTIME   struc
  22013.  
  22014.   ftime_fs  dw  ?
  22015.  
  22016. FTIME   ends
  22017.  
  22018. FILESTATUS struc
  22019.  
  22020.   fsts_fdateCreation   dw (size FDATE)/2 dup (?) ;date of file creation
  22021.   fsts_ftimeCreation   dw (size FTIME)/2 dup (?) ;time of file creation
  22022.   fsts_fdateLastAccess dw (size FDATE)/2 dup (?) ;date of last access
  22023.   fsts_ftimeLastAccess dw (size FTIME)/2 dup (?) ;time of last access
  22024.   fsts_fdateLastWrite  dw (size FDATE)/2 dup (?) ;date of last write
  22025.   fsts_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;time of last write
  22026.   fsts_cbFile          dd  ? ;file size (end of data)
  22027.   fsts_cbFileAlloc     dd  ? ;file allocated size
  22028.   fsts_attrFile        dw  ? ;attributes of the file
  22029.  
  22030. FILESTATUS ends
  22031.  
  22032. GEA    struc
  22033.  
  22034.   gea_cbName      db  ?          ;name length not including NULL
  22035.   gea_szName      db  1 dup (?)  ;attribute name
  22036.  
  22037. GEA    ends
  22038.  
  22039. GEALIST    struc
  22040.  
  22041.   geal_cbList     dd  ?      ;total bytes of structure including full list
  22042.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  22043.  
  22044. GEALIST    ends
  22045.  
  22046. FEA   struc
  22047.  
  22048.   fea_fEA         db  ? ;flags
  22049.   fea_cbName      db  ? ;name length not including NULL
  22050.   fea_cbValue     dw  ? ;value length
  22051.  
  22052. FEA   ends
  22053.  
  22054. FEALIST struc
  22055.  
  22056.   feal_cbList     dd  ?      ;total bytes of structure including full list
  22057.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  22058.  
  22059. FEALIST ends
  22060.  
  22061. EAOP    struc
  22062.  
  22063.   eaop_fpGEAList  dd  ? ;general EA list
  22064.   eaop_fpFEAList  dd  ? ;full EA list
  22065.   eaop_oError     dd  ? ;
  22066.  
  22067. EAOP    ends
  22068.  
  22069. EXTRN DosQPathInfo:FAR
  22070. INCL_DOSFILEMGR     EQU 1
  22071.  
  22072. PUSH@  ASCIIZ PathName        ;File or directory path name string
  22073. PUSH   WORD   PathInfoLevel   ;Data required
  22074. PUSH@  OTHER  PathInfoBuf     ;Data buffer (returned)
  22075. PUSH   WORD   PathInfoBufSize ;Data buffer size
  22076. PUSH   DWORD  0               ;Reserved (must be zero)
  22077. CALL   DosQPathInfo
  22078.  
  22079. Returns WORD
  22080.  
  22081.  
  22082. ΓòÉΓòÉΓòÉ <hidden> DosQSysInfo ΓòÉΓòÉΓòÉ
  22083.  
  22084. EXTRN DosQSysInfo:FAR
  22085. INCL_DOSFILEMGR     EQU 1
  22086.  
  22087. PUSH   WORD  Index           ;Which variable
  22088. PUSH@  OTHER DataBuf         ;System information (returned)
  22089. PUSH   WORD  DataBufLen      ;Data buffer size
  22090. CALL   DosQSysInfo
  22091.  
  22092. Returns WORD
  22093.  
  22094.  
  22095. ΓòÉΓòÉΓòÉ <hidden> DosQueryQueue ΓòÉΓòÉΓòÉ
  22096.  
  22097. EXTRN  DosQueryQueue:FAR
  22098. INCL_DOSQUEUES      EQU 1
  22099.  
  22100. PUSH   WORD    QueueHandle    ;Queue handle
  22101. PUSH@  WORD    NumberElements ;Size of the queue (returned)
  22102. CALL   DosQueryQueue
  22103.  
  22104. Returns WORD
  22105.  
  22106.  
  22107. ΓòÉΓòÉΓòÉ <hidden> DosQVerify ΓòÉΓòÉΓòÉ
  22108.  
  22109. EXTRN  DosQVerify:FAR
  22110. INCL_DOSFILEMGR     EQU 1
  22111.  
  22112. PUSH@  WORD    VerifySetting ;Verify setting (returned)
  22113. CALL   DosQVerify
  22114.  
  22115. Returns WORD
  22116.  
  22117.  
  22118. ΓòÉΓòÉΓòÉ <hidden> DosR2StackRealloc ΓòÉΓòÉΓòÉ
  22119.  
  22120. EXTRN  DosR2StackRealloc:FAR
  22121. INCL_DOSDEVICES     EQU 1
  22122.  
  22123. PUSH   WORD    NewSize       ;The new size in bytes for the stack
  22124. CALL   DosR2StackRealloc
  22125.  
  22126. Returns WORD
  22127.  
  22128.  
  22129. ΓòÉΓòÉΓòÉ <hidden> DosRead ΓòÉΓòÉΓòÉ
  22130.  
  22131. EXTRN  DosRead:FAR
  22132. INCL_DOSFILEMGR     EQU 1
  22133.  
  22134. PUSH   WORD    FileHandle    ;File Handle
  22135. PUSH@  OTHER   BufferArea    ;User buffer (returned)
  22136. PUSH   WORD    BufferLength  ;Buffer length
  22137. PUSH@  WORD    BytesRead     ;Bytes read (returned)
  22138. CALL   DosRead
  22139.  
  22140. Returns WORD
  22141.  
  22142.  
  22143. ΓòÉΓòÉΓòÉ <hidden> DosReadAsync ΓòÉΓòÉΓòÉ
  22144.  
  22145. EXTRN  DosReadAsync:FAR
  22146. INCL_DOSFILEMGR     EQU 1
  22147.  
  22148. PUSH   WORD    FileHandle    ;File handle
  22149. PUSH@  DWORD   RamSemaphore  ;Ram semaphore
  22150. PUSH@  WORD    ReturnCode    ;I/O operation return code (returned)
  22151. PUSH@  OTHER   BufferArea    ;User buffer (returned)
  22152. PUSH   WORD    BufferLength  ;Buffer length
  22153. PUSH@  WORD    BytesRead     ;Bytes read (returned)
  22154. CALL   DosReadAsync
  22155.  
  22156. Returns WORD
  22157.  
  22158.  
  22159. ΓòÉΓòÉΓòÉ <hidden> DosReadQueue ΓòÉΓòÉΓòÉ
  22160.  
  22161. EXTRN  DosReadQueue:FAR
  22162. INCL_DOSQUEUES      EQU 1
  22163.  
  22164. PUSH   WORD    QueueHandle     ;Queue handle
  22165. PUSH@  DWORD   Request         ;Request identification data (returned)
  22166. PUSH@  WORD    DataLength      ;Length of element received (returned)
  22167. PUSH@  DWORD   DataAddress     ;Address of element received (returned)
  22168. PUSH   WORD    ElementCode     ;Indicate want a particular element
  22169. PUSH   OTHER   NoWait          ;Indicate to not wait if queue is empty
  22170. PUSH@  BYTE    ElemPriority    ;Priority of element (returned)
  22171. PUSH   DWORD   SemaphoreHandle ;Semaphore handle
  22172. CALL   DosReadQueue
  22173.  
  22174. Returns WORD
  22175.  
  22176.  
  22177. ΓòÉΓòÉΓòÉ <hidden> DosReallocHuge ΓòÉΓòÉΓòÉ
  22178.  
  22179. EXTRN  DosReallocHuge:FAR
  22180. INCL_DOSMEMMGR      EQU 1
  22181.  
  22182. PUSH   WORD    NumSeg        ;Number of 65536-byte segments requested
  22183. PUSH   WORD    Size          ;Number of bytes in last segment
  22184. PUSH   WORD    Selector      ;Selector
  22185. CALL   DosReallocHuge
  22186.  
  22187. Returns WORD
  22188.  
  22189.  
  22190. ΓòÉΓòÉΓòÉ <hidden> DosReallocSeg ΓòÉΓòÉΓòÉ
  22191.  
  22192. EXTRN  DosReallocSeg:FAR
  22193. INCL_DOSMEMMGR      EQU 1
  22194.  
  22195. PUSH   WORD    Size          ;New size requested in bytes
  22196. PUSH   WORD    Selector      ;Selector
  22197. CALL   DosReallocSeg
  22198.  
  22199. Returns WORD
  22200.  
  22201.  
  22202. ΓòÉΓòÉΓòÉ <hidden> DosResumeThread ΓòÉΓòÉΓòÉ
  22203.  
  22204. EXTRN  DosResumeThread:FAR
  22205. INCL_DOSPROCESS     EQU 1
  22206.  
  22207. PUSH   WORD    ThreadID      ;Thread ID
  22208. CALL   DosResumeThread
  22209.  
  22210. Returns WORD
  22211.  
  22212.  
  22213. ΓòÉΓòÉΓòÉ <hidden> DosRmDir ΓòÉΓòÉΓòÉ
  22214.  
  22215. EXTRN  DosRmDir:FAR
  22216. INCL_DOSFILEMGR     EQU 1
  22217.  
  22218. PUSH@  ASCIIZ  DirName       ;Directory name string
  22219. PUSH   DWORD   0             ;Reserved (must be zero)
  22220. CALL   DosRmDir
  22221.  
  22222. Returns WORD
  22223.  
  22224.  
  22225. ΓòÉΓòÉΓòÉ <hidden> DosScanEnv ΓòÉΓòÉΓòÉ
  22226.  
  22227. EXTRN  DosScanEnv:FAR
  22228. INCL_DOSQUEUES      EQU 1
  22229.  
  22230. PUSH@  ASCIIZ  EnvVarName    ;Environment variable name string
  22231. PUSH@  DWORD   ResultPointer ;Search result pointer (returned)
  22232. CALL   DosScanEnv
  22233.  
  22234. Returns WORD
  22235.  
  22236.  
  22237. ΓòÉΓòÉΓòÉ <hidden> DosSearchPath ΓòÉΓòÉΓòÉ
  22238.  
  22239. EXTRN  DosSearchPath:FAR
  22240. INCL_DOSQUEUES      EQU 1
  22241.  
  22242. PUSH   WORD    Control         ;Function control vector
  22243. PUSH@  ASCIIZ  PathRef         ;Search path reference string
  22244. PUSH@  ASCIIZ  FileName        ;File name string
  22245. PUSH@  OTHER   ResultBuffer    ;Search result buffer (returned)
  22246. PUSH   WORD    ResultBufferLen ;Search result buffer length
  22247. CALL   DosSearchPath
  22248.  
  22249. Returns WORD
  22250.  
  22251.  
  22252. ΓòÉΓòÉΓòÉ <hidden> DosSelectDisk ΓòÉΓòÉΓòÉ
  22253.  
  22254. EXTRN  DosSelectDisk:FAR
  22255. INCL_DOSFILEMGR     EQU 1
  22256.  
  22257. PUSH   WORD    DriveNumber   ;Default drive number
  22258. CALL   DosSelectDisk
  22259.  
  22260. Returns WORD
  22261.  
  22262.  
  22263. ΓòÉΓòÉΓòÉ <hidden> DosSelectSession ΓòÉΓòÉΓòÉ
  22264.  
  22265. EXTRN  DosSelectSession:FAR
  22266. INCL_DOSSESMGR      EQU 1
  22267.  
  22268. PUSH   WORD    SessID        ;Session ID
  22269. PUSH   DWORD   0             ;Reserved (must be zero)
  22270. CALL   DosSelectSession
  22271.  
  22272. Returns WORD
  22273.  
  22274.  
  22275. ΓòÉΓòÉΓòÉ <hidden> DosSemClear ΓòÉΓòÉΓòÉ
  22276.  
  22277. EXTRN  DosSemClear:FAR
  22278. INCL_DOSSEMAPHORES  EQU 1
  22279.  
  22280. PUSH   DWORD   SemHandle     ;Semaphore handle
  22281. CALL   DosSemClear
  22282.  
  22283. Returns WORD
  22284.  
  22285.  
  22286. ΓòÉΓòÉΓòÉ <hidden> DosSemRequest ΓòÉΓòÉΓòÉ
  22287.  
  22288. EXTRN  DosSemRequest:FAR
  22289. INCL_DOSSEMAPHORES  EQU 1
  22290.  
  22291. PUSH   DWORD   SemHandle     ;Semaphore handle
  22292. PUSH   DWORD   Timeout       ;Timeout (in milliseconds)
  22293. CALL   DosSemRequest
  22294.  
  22295. Returns WORD
  22296.  
  22297.  
  22298. ΓòÉΓòÉΓòÉ <hidden> DosSemSet ΓòÉΓòÉΓòÉ
  22299.  
  22300. EXTRN  DosSemSet:FAR
  22301. INCL_DOSSEMAPHORES  EQU 1
  22302.  
  22303. PUSH   DWORD   SemHandle     ;Semaphore handle
  22304. CALL   DosSemSet
  22305.  
  22306. Returns WORD
  22307.  
  22308.  
  22309. ΓòÉΓòÉΓòÉ <hidden> DosSemSetWait ΓòÉΓòÉΓòÉ
  22310.  
  22311. EXTRN  DosSemSetWait:FAR
  22312. INCL_DOSSEMAPHORES  EQU 1
  22313.  
  22314. PUSH   DWORD   SemHandle     ;Semaphore handle
  22315. PUSH   DWORD   Timeout       ;Timeout (in milliseconds)
  22316. CALL   DosSemSetWait
  22317.  
  22318. Returns WORD
  22319.  
  22320.  
  22321. ΓòÉΓòÉΓòÉ <hidden> DosSemWait ΓòÉΓòÉΓòÉ
  22322.  
  22323. EXTRN  DosSemWait:FAR
  22324. INCL_DOSSEMAPHORES  EQU 1
  22325.  
  22326. PUSH   DWORD   SemHandle     ;Semaphore handle
  22327. PUSH   DWORD   Timeout       ;Timeout (in milliseconds)
  22328. CALL   DosSemWait
  22329.  
  22330. Returns WORD
  22331.  
  22332.  
  22333. ΓòÉΓòÉΓòÉ <hidden> DosSendSignal ΓòÉΓòÉΓòÉ
  22334.  
  22335. EXTRN  DosSendSignal:FAR
  22336. INCL_DOSSIGNALS     EQU 1
  22337.  
  22338. PUSH   WORD    PID           ;PID of root of subtree
  22339. PUSH   WORD    SigNumber     ;Signal Number to send
  22340. CALL   DosSendSignal
  22341.  
  22342. Returns WORD
  22343.  
  22344.  
  22345. ΓòÉΓòÉΓòÉ <hidden> DosSetCp ΓòÉΓòÉΓòÉ
  22346.  
  22347. EXTRN  DosSetCp:FAR
  22348. INCL_DOSNLS         EQU 1
  22349.  
  22350. PUSH   WORD    CodePage      ;Code page identifier
  22351. PUSH   WORD    0             ;Reserved (must be zero)
  22352. CALL   DosSetCp
  22353.  
  22354. Returns WORD
  22355.  
  22356.  
  22357. ΓòÉΓòÉΓòÉ <hidden> DosSetDateTime ΓòÉΓòÉΓòÉ
  22358.  
  22359. DATETIME struc
  22360.  
  22361.   date_hours      db  ? ;current hour
  22362.   date_minutes    db  ? ;current minute
  22363.   date_seconds    db  ? ;current second
  22364.   date_hundredths db  ? ;current hundredths of a second
  22365.   date_day        db  ? ;current day
  22366.   date_month      db  ? ;current month
  22367.   date_year       dw  ? ;current year
  22368.   date_timezone   dw  ? ;minutes of time west of UTC
  22369.   date_weekday    db  ? ;current day of week
  22370.  
  22371. DATETIME ends
  22372.  
  22373. EXTRN  DosSetDateTime:FAR
  22374. INCL_DOSDATETIME    EQU 1
  22375.  
  22376. PUSH@  OTHER   DateTime      ;Date/time structure
  22377. CALL   DosSetDateTime
  22378.  
  22379. Returns WORD
  22380.  
  22381.  
  22382. ΓòÉΓòÉΓòÉ <hidden> DosSetFHandState ΓòÉΓòÉΓòÉ
  22383.  
  22384. EXTRN  DosSetFHandState:FAR
  22385. INCL_DOSFILEMGR     EQU 1
  22386.  
  22387. PUSH   WORD    FileHandle      ;File handle
  22388. PUSH   WORD    FileHandleState ;File handle state
  22389. CALL   DosSetFHandState
  22390.  
  22391. Returns WORD
  22392.  
  22393.  
  22394. ΓòÉΓòÉΓòÉ <hidden> DosSetFileInfo ΓòÉΓòÉΓòÉ
  22395.  
  22396. FDATE   struc
  22397.  
  22398.   fdate_fs  dw  ?
  22399.  
  22400. FDATE   ends
  22401.  
  22402. FTIME   struc
  22403.  
  22404.   ftime_fs  dw  ?
  22405.  
  22406. FTIME   ends
  22407.  
  22408. FILESTATUS struc
  22409.  
  22410.   fsts_fdateCreation   dw (size FDATE)/2 dup (?) ;date of file creation
  22411.   fsts_ftimeCreation   dw (size FTIME)/2 dup (?) ;time of file creation
  22412.   fsts_fdateLastAccess dw (size FDATE)/2 dup (?) ;date of last access
  22413.   fsts_ftimeLastAccess dw (size FTIME)/2 dup (?) ;time of last access
  22414.   fsts_fdateLastWrite  dw (size FDATE)/2 dup (?) ;date of last write
  22415.   fsts_ftimeLastWrite  dw (size FTIME)/2 dup (?) ;time of last write
  22416.   fsts_cbFile          dd  ? ;file size (end of data)
  22417.   fsts_cbFileAlloc     dd  ? ;file allocated size
  22418.   fsts_attrFile        dw  ? ;attributes of the file
  22419.  
  22420. FILESTATUS ends
  22421.  
  22422. GEA    struc
  22423.  
  22424.   gea_cbName      db  ?          ;name length not including NULL
  22425.   gea_szName      db  1 dup (?)  ;attribute name
  22426.  
  22427. GEA    ends
  22428.  
  22429. GEALIST    struc
  22430.  
  22431.   geal_cbList     dd  ?      ;total bytes of structure including full list
  22432.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  22433.  
  22434. GEALIST    ends
  22435.  
  22436. FEA   struc
  22437.  
  22438.   fea_fEA         db  ? ;flags
  22439.   fea_cbName      db  ? ;name length not including NULL
  22440.   fea_cbValue     dw  ? ;value length
  22441.  
  22442. FEA   ends
  22443.  
  22444. FEALIST struc
  22445.  
  22446.   feal_cbList     dd  ?      ;total bytes of structure including full list
  22447.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  22448.  
  22449. FEALIST ends
  22450.  
  22451. EAOP    struc
  22452.  
  22453.   eaop_fpGEAList  dd  ? ;general EA list
  22454.   eaop_fpFEAList  dd  ? ;full EA list
  22455.   eaop_oError     dd  ? ;
  22456.  
  22457. EAOP    ends
  22458.  
  22459. EXTRN  DosSetFileInfo:FAR
  22460. INCL_DOSFILEMGR     EQU 1
  22461.  
  22462. PUSH   WORD    FileHandle      ;File handle
  22463. PUSH   WORD    FileInfoLevel   ;File info data required
  22464. PUSH@  OTHER   FileInfoBuf     ;File info buffer
  22465. PUSH   WORD    FileInfoBufSize ;File info buffer size
  22466. CALL   DosSetFileInfo
  22467.  
  22468. Returns WORD
  22469.  
  22470.  
  22471. ΓòÉΓòÉΓòÉ <hidden> DosSetFileMode ΓòÉΓòÉΓòÉ
  22472.  
  22473. EXTRN  DosSetFileMode:FAR
  22474. INCL_DOSFILEMGR     EQU 1
  22475.  
  22476. PUSH@  ASCIIZ  FileName      ;File path name string
  22477. PUSH   WORD    NewAttribute  ;New attribute of file
  22478. PUSH   DWORD   0             ;Reserved (must be zero)
  22479. CALL   DosSetFileMode
  22480.  
  22481. Returns WORD
  22482.  
  22483.  
  22484. ΓòÉΓòÉΓòÉ <hidden> DosSetFSInfo ΓòÉΓòÉΓòÉ
  22485.  
  22486. EXTRN  DosSetFSInfo:FAR
  22487. INCL_DOSFILEMGR     EQU 1
  22488.  
  22489. PUSH   WORD    DriveNumber   ;Drive number
  22490. PUSH   WORD    FSInfoLevel   ;File system data type
  22491. PUSH@  OTHER   FSInfoBuf     ;File system info buffer
  22492. PUSH   WORD    FSInfoBufSize ;File system info buffer size
  22493. CALL   DosSetFSInfo
  22494.  
  22495. Returns WORD
  22496.  
  22497.  
  22498. ΓòÉΓòÉΓòÉ <hidden> DosSetMaxFH ΓòÉΓòÉΓòÉ
  22499.  
  22500. EXTRN  DosSetMaxFH:FAR
  22501. INCL_DOSFILEMGR     EQU 1
  22502.  
  22503. PUSH   WORD    NumberHandles ;Number of file handles
  22504. CALL   DosSetMaxFH
  22505.  
  22506. Returns WORD
  22507.  
  22508.  
  22509. ΓòÉΓòÉΓòÉ <hidden> DosSetNmPHandState ΓòÉΓòÉΓòÉ
  22510.  
  22511. EXTRN  DosSetNmPHandState:FAR
  22512. INCL_DOSNMPIPES     EQU 1
  22513.  
  22514. PUSH   WORD    Handle          ;Pipe handle
  22515. PUSH   WORD    PipeHandleState ;Pipe handle state
  22516. CALL   DosSetNmPHandState
  22517.  
  22518. Returns WORD
  22519.  
  22520.  
  22521. ΓòÉΓòÉΓòÉ <hidden> DosSetNmPipeSem ΓòÉΓòÉΓòÉ
  22522.  
  22523. EXTRN  DosSetNmPipeSem:FAR
  22524. INCL_DOSNMPIPES     EQU 1
  22525.  
  22526. PUSH   WORD    Handle        ;Pipe handle
  22527. PUSH   DWORD   SemHandle     ;Semaphore handle
  22528. PUSH   WORD    KeyHandle     ;Key value
  22529. CALL   DosSetNmPipeSem
  22530.  
  22531. Returns WORD
  22532.  
  22533.  
  22534. ΓòÉΓòÉΓòÉ <hidden> DosSetPathInfo ΓòÉΓòÉΓòÉ
  22535.  
  22536. GEA    struc
  22537.  
  22538.   gea_cbName      db  ?          ;name length not including NULL
  22539.   gea_szName      db  1 dup (?)  ;attribute name
  22540.  
  22541. GEA    ends
  22542.  
  22543. GEALIST    struc
  22544.  
  22545.   geal_cbList     dd  ?      ;total bytes of structure including full list
  22546.   geal_list       db  size GEA * 1 dup (?) ;variable length GEA structures
  22547.  
  22548. GEALIST    ends
  22549.  
  22550. FEA   struc
  22551.  
  22552.   fea_fEA         db  ? ;flags
  22553.   fea_cbName      db  ? ;name length not including NULL
  22554.   fea_cbValue     dw  ? ;value length
  22555.  
  22556. FEA   ends
  22557.  
  22558. FEALIST struc
  22559.  
  22560.   feal_cbList     dd  ?      ;total bytes of structure including full list
  22561.   feal_list       db  size FEA * 1 dup (?) ;variable length FEA structures
  22562.  
  22563. FEALIST ends
  22564.  
  22565. EAOP    struc
  22566.  
  22567.   eaop_fpGEAList  dd  ? ;general EA list
  22568.   eaop_fpFEAList  dd  ? ;full EA list
  22569.   eaop_oError     dd  ? ;
  22570.  
  22571. EAOP    ends
  22572.  
  22573. EXTRN DosSetPathInfo:FAR
  22574. INCL_DOSFILEMGR     EQU 1
  22575.  
  22576. PUSH@  ASCIIZ PathName        ;File or directory path name string
  22577. PUSH   WORD   PathInfoLevel   ;Info data type
  22578. PUSH@  OTHER  PathInfoBuf     ;Info buffer
  22579. PUSH   WORD   PathInfoBufSize ;Info buffer size
  22580. PUSH   WORD   Flags           ;Path info flags
  22581. PUSH   DWORD  0               ;Reserved (must be zero)
  22582. CALL   DosSetPathInfo
  22583.  
  22584. Returns WORD
  22585.  
  22586.  
  22587. ΓòÉΓòÉΓòÉ <hidden> DosSetProcCp ΓòÉΓòÉΓòÉ
  22588.  
  22589. EXTRN  DosSetProcCp:FAR
  22590. INCL_DOSNLS         EQU 1
  22591.  
  22592. PUSH   WORD    CodePage      ;Code page identifier
  22593. PUSH   WORD    0             ;Reserved (must be zero)
  22594. CALL   DosSetProcCp
  22595.  
  22596. Returns WORD
  22597.  
  22598.  
  22599. ΓòÉΓòÉΓòÉ <hidden> DosSetPrty ΓòÉΓòÉΓòÉ
  22600.  
  22601. EXTRN  DosSetPrty:FAR
  22602. INCL_DOSPROCESS     EQU 1
  22603.  
  22604. PUSH   WORD    Scope         ;Indicate scope of change
  22605. PUSH   WORD    PriorityClass ;Priority class to set
  22606. PUSH   WORD    PriorityDelta ;Priority delta to apply
  22607. PUSH   WORD    ID            ;Process or thread ID
  22608. CALL   DosSetPrty
  22609.  
  22610. Returns WORD
  22611.  
  22612.  
  22613. ΓòÉΓòÉΓòÉ <hidden> DosSetSession ΓòÉΓòÉΓòÉ
  22614.  
  22615. STATUSDATA struc
  22616.  
  22617.   stsdata_Length    dw  ? ;length of this data structure
  22618.   stsdata_SelectInd dw  ? ;0=leave setting unchanged, 1=selectable
  22619.                              ;2=non-selectable
  22620.   stsdata_BindInd   dw  ? ;which session to bring to foreground
  22621.  
  22622. STATUSDATA ends
  22623.  
  22624. EXTRN  DosSetSession:FAR
  22625. INCL_DOSSESMGR      EQU 1
  22626.  
  22627. PUSH   WORD    SessID        ;Session ID
  22628. PUSH@  OTHER   StatusData    ;Session status data
  22629. CALL   DosSetSession
  22630.  
  22631. Returns WORD
  22632.  
  22633.  
  22634. ΓòÉΓòÉΓòÉ <hidden> DosSetSigHandler ΓòÉΓòÉΓòÉ
  22635.  
  22636. EXTRN  DosSetSigHandler:FAR
  22637. INCL_DOSSIGNALS     EQU 1
  22638.  
  22639. PUSH@  DWORD   Routine        ;Signal handler
  22640. PUSH@  DWORD   PrevAddress    ;Previous handler (returned)
  22641. PUSH@  WORD    PrevAction     ;Previous action (returned)
  22642. PUSH   WORD    Action         ;Indicate request type
  22643. PUSH   WORD    SigNumber      ;Signal number of interest
  22644. CALL   DosSetSigHandler
  22645.  
  22646. Returns WORD
  22647.  
  22648.  
  22649. ΓòÉΓòÉΓòÉ <hidden> DosSetVec ΓòÉΓòÉΓòÉ
  22650.  
  22651. EXTRN  DosSetVec:FAR
  22652. INCL_DOSMISC      EQU 1
  22653.  
  22654. PUSH   WORD    VecNum        ;Function request code
  22655. PUSH@  OTHER   Routine       ;Handler routine address
  22656. PUSH@  DWORD   PrevAddress   ;Previous handler address (returned)
  22657. CALL   DosSetVec
  22658.  
  22659. Returns WORD
  22660.  
  22661.  
  22662. ΓòÉΓòÉΓòÉ <hidden> DosSetVerify ΓòÉΓòÉΓòÉ
  22663.  
  22664. EXTRN  DosSetVerify:FAR
  22665. INCL_DOSFILEMGR     EQU 1
  22666.  
  22667. PUSH   WORD    VerifySetting ;New value of verify switch
  22668. CALL   DosSetVerify
  22669.  
  22670. Returns WORD
  22671.  
  22672.  
  22673. ΓòÉΓòÉΓòÉ <hidden> DosSizeSeg ΓòÉΓòÉΓòÉ
  22674.  
  22675. EXTRN  DosSizeSeg:FAR
  22676. INCL_DOSMEMMGR      EQU 1
  22677.  
  22678. PUSH   WORD    Selector      ;Selector/Segment
  22679. PUSH@  DWORD   Size          ;Size of segment (returned)
  22680. CALL   DosSizeSeg
  22681.  
  22682. Returns WORD
  22683.  
  22684.  
  22685. ΓòÉΓòÉΓòÉ <hidden> DosShutdown ΓòÉΓòÉΓòÉ
  22686.  
  22687. EXTRN  DosShutdown:FAR
  22688. INCL_DOSFILEMGR     EQU 1
  22689.  
  22690. PUSH   DWORD   Reserved      ;Reserved, must be set to zero
  22691. CALL   DosShutdown
  22692.  
  22693. Returns WORD
  22694.  
  22695.  
  22696. ΓòÉΓòÉΓòÉ <hidden> DosSleep ΓòÉΓòÉΓòÉ
  22697.  
  22698. EXTRN  DosSleep:FAR
  22699. INCL_DOSPROCESS     EQU 1
  22700.  
  22701. PUSH   DWORD   TimeInterval  ;Interval size (in milliseconds)
  22702. CALL   DosSleep
  22703.  
  22704. Returns WORD
  22705.  
  22706.  
  22707. ΓòÉΓòÉΓòÉ <hidden> DosSMRegisterDD ΓòÉΓòÉΓòÉ
  22708.  
  22709. EXTRN  DosSMRegisterDD:FAR
  22710. INCL_DOSFILEMGR     EQU 1
  22711.  
  22712. PUSH@  OTHER RegisterData        ;Data packet
  22713. CALL   DosSMRegisterDD
  22714.  
  22715. Returns WORD
  22716.  
  22717.  
  22718. ΓòÉΓòÉΓòÉ <hidden> DosStartSession ΓòÉΓòÉΓòÉ
  22719.  
  22720. STARTDATA struc
  22721.  
  22722.   stdata_Length      dw  ? ;length of data structure in bytes
  22723.   stdata_Related     dw  ? ;0=independent session, 1=child session
  22724.   stdata_FgBg        dw  ? ;0=start in foreground, 1=start in background
  22725.   stdata_TraceOpt    dw  ? ;0=no trace, 1=trace
  22726.   stdata_PgmTitle    dd  ? ;address of program title
  22727.   stdata_PgmName     dd  ? ;address of program name
  22728.   stdata_PgmInputs   dd  ? ;input arguments
  22729.   stdata_TermQ       dd  ? ;address of program queue name
  22730.   stdata_Environment dd  ? ;address of environment string
  22731.   stdata_InheritOpt  dw  ? ;inherit option (shell of program)
  22732.   stdata_SessionType dw  ? ;session type (standard, windowed, ...)
  22733.   stdata_IconFile    dd  ? ;address of icon definition
  22734.   stdata_PgmHandle   dd  ? ;program handle
  22735.   stdata_PgmControl  dw  ? ;initial state of windowed application
  22736.   stdata_InitXPos    dw  ? ;x coordinate of initial session window
  22737.   stdata_InitYPos    dw  ? ;y coordinate of initial session window
  22738.   stdata_InitXSize   dw  ? ;initial size of x
  22739.   stdata_InitYSize   dw  ? ;initial size of y
  22740.  
  22741. STARTDATA ends
  22742.  
  22743. EXTRN  DosStartSession:FAR
  22744. INCL_DOSSESMGR      EQU 1
  22745.  
  22746. PUSH@  OTHER   StartData     ;Start session data
  22747. PUSH@  WORD    SessID        ;Session ID (returned)
  22748. PUSH@  WORD    PID           ;Process ID (returned)
  22749. CALL   DosStartSession
  22750.  
  22751. Returns WORD
  22752.  
  22753.  
  22754. ΓòÉΓòÉΓòÉ <hidden> DosStopSession ΓòÉΓòÉΓòÉ
  22755.  
  22756. EXTRN  DosStopSession:FAR
  22757. INCL_DOSSESMGR      EQU 1
  22758.  
  22759. PUSH   WORD    TargetOption  ;Target option
  22760. PUSH   WORD    SessID        ;Session ID
  22761. PUSH   DWORD   0             ;Reserved (must be zero)
  22762. CALL   DosStopSession
  22763.  
  22764. Returns WORD
  22765.  
  22766.  
  22767. ΓòÉΓòÉΓòÉ <hidden> DosSubAlloc ΓòÉΓòÉΓòÉ
  22768.  
  22769. EXTRN  DosSubAlloc:FAR
  22770. INCL_DOSMEMMGR      EQU 1
  22771.  
  22772. PUSH   WORD    SegSelector   ;Segment selector
  22773. PUSH@  WORD    BlockOffset   ;Block Offset (returned)
  22774. PUSH   WORD    Size          ;Size of requested block
  22775. CALL   DosSubAlloc
  22776.  
  22777. Returns WORD
  22778.  
  22779.  
  22780. ΓòÉΓòÉΓòÉ <hidden> DosSubFree ΓòÉΓòÉΓòÉ
  22781.  
  22782. EXTRN  DosSubFree:FAR
  22783. INCL_DOSMEMMGR      EQU 1
  22784.  
  22785. PUSH   WORD    SegSelector   ;Segment selector
  22786. PUSH   WORD    BlockOffset   ;Offset of memory block to free
  22787. PUSH   WORD    Size          ;Size of block in bytes
  22788. CALL   DosSubFree
  22789.  
  22790. Returns WORD
  22791.  
  22792.  
  22793. ΓòÉΓòÉΓòÉ <hidden> DosSubSet ΓòÉΓòÉΓòÉ
  22794.  
  22795. EXTRN  DosSubSet:FAR
  22796. INCL_DOSMEMMGR      EQU 1
  22797.  
  22798. PUSH   WORD    SegSelector   ;Segment selector
  22799. PUSH   WORD    Flags         ;Parameter flags
  22800. PUSH   WORD    Size          ;Size of a segment
  22801. CALL   DosSubSet
  22802.  
  22803. Returns WORD
  22804.  
  22805.  
  22806. ΓòÉΓòÉΓòÉ <hidden> DosSuspendThread ΓòÉΓòÉΓòÉ
  22807.  
  22808. EXTRN  DosSuspendThread:FAR
  22809. INCL_DOSPROCESS     EQU 1
  22810.  
  22811. PUSH   WORD    ThreadID      ;Thread ID
  22812. CALL   DosSuspendThread
  22813.  
  22814. Returns WORD
  22815.  
  22816.  
  22817. ΓòÉΓòÉΓòÉ <hidden> DosTimerAsync ΓòÉΓòÉΓòÉ
  22818.  
  22819. EXTRN  DosTimerAsync:FAR
  22820. INCL_DOSDATETIME    EQU 1
  22821.  
  22822. PUSH   DWORD   TimeInterval  ;Interval size (in milliseconds)
  22823. PUSH   DWORD   SemHandle     ;System semaphore handle
  22824. PUSH@  WORD    Handle        ;Timer handle (returned)
  22825. CALL   DosTimerAsync
  22826.  
  22827. Returns WORD
  22828.  
  22829.  
  22830. ΓòÉΓòÉΓòÉ <hidden> DosTimerStart ΓòÉΓòÉΓòÉ
  22831.  
  22832. EXTRN  DosTimerStart:FAR
  22833. INCL_DOSDATETIME    EQU 1
  22834.  
  22835. PUSH   DWORD   TimeInterval  ;Interval size (in milliseconds)
  22836. PUSH   DWORD   SemHandle     ;System semaphore handle
  22837. PUSH@  WORD    Handle        ;Timer handle (returned)
  22838. CALL   DosTimerStart
  22839.  
  22840. Returns WORD
  22841.  
  22842.  
  22843. ΓòÉΓòÉΓòÉ <hidden> DosTimerStop ΓòÉΓòÉΓòÉ
  22844.  
  22845. EXTRN  DosTimerStop:FAR
  22846. INCL_DOSDATETIME    EQU 1
  22847.  
  22848. PUSH   WORD    Handle        ;Handle of the timer
  22849. CALL   DosTimerStop
  22850.  
  22851. Returns WORD
  22852.  
  22853.  
  22854. ΓòÉΓòÉΓòÉ <hidden> DosTransactNmPipe ΓòÉΓòÉΓòÉ
  22855.  
  22856. EXTRN  DosTransactNmPipe:FAR
  22857. INCL_DOSNMPIPES     EQU 1
  22858.  
  22859. PUSH   WORD    Handle        ;Pipe handle
  22860. PUSH@  OTHER   InBuffer      ;Write buffer
  22861. PUSH   WORD    InBufferLen   ;Write buffer length
  22862. PUSH@  OTHER   OutBuffer     ;Read buffer (returned)
  22863. PUSH   WORD    OutBufferLen  ;Read buffer length
  22864. PUSH@  WORD    BytesOut      ;Bytes read (returned)
  22865. CALL   DosTransactNmPipe
  22866.  
  22867. Returns WORD
  22868.  
  22869.  
  22870. ΓòÉΓòÉΓòÉ <hidden> DosUnlockSeg ΓòÉΓòÉΓòÉ
  22871.  
  22872. EXTRN  DosUnlockSeg:FAR
  22873. INCL_DOSMEMMGR      EQU 1
  22874.  
  22875. PUSH   WORD Selector         ;Selector to unlock
  22876. CALL   DosUnlockSeg
  22877.  
  22878. Returns WORD
  22879.  
  22880.  
  22881. ΓòÉΓòÉΓòÉ <hidden> DosWaitNmPipe ΓòÉΓòÉΓòÉ
  22882.  
  22883. EXTRN  DosWaitNmPipe:FAR
  22884. INCL_DOSNMPIPES     EQU 1
  22885.  
  22886. PUSH@  ASCIIZ  FileName      ;Pipe name
  22887. PUSH   DWORD   TimeOut       ;Maximum wait time
  22888. CALL   DosWaitNmPipe
  22889.  
  22890. Returns WORD
  22891.  
  22892.  
  22893. ΓòÉΓòÉΓòÉ <hidden> DosWrite ΓòÉΓòÉΓòÉ
  22894.  
  22895. EXTRN  DosWrite:FAR
  22896. INCL_DOSFILEMGR     EQU 1
  22897.  
  22898. PUSH   WORD    FileHandle    ;File handle
  22899. PUSH@  OTHER   BufferArea    ;User buffer
  22900. PUSH   WORD    BufferLength  ;Buffer length
  22901. PUSH@  WORD    BytesWritten  ;Bytes written (returned)
  22902. CALL   DosWrite
  22903.  
  22904. Returns WORD
  22905.  
  22906.  
  22907. ΓòÉΓòÉΓòÉ <hidden> DosWriteAsync ΓòÉΓòÉΓòÉ
  22908.  
  22909. EXTRN  DosWriteAsync:FAR
  22910. INCL_DOSFILEMGR     EQU 1
  22911.  
  22912. PUSH   WORD    FileHandle    ;File handle
  22913. PUSH@  DWORD   RamSemaphore  ;Ram semaphore
  22914. PUSH@  WORD    ReturnCode    ;I/O operation return code (returned)
  22915. PUSH@  OTHER   BufferArea    ;User buffer
  22916. PUSH   WORD    BufferLength  ;Buffer length
  22917. PUSH@  WORD    BytesWritten  ;Bytes written (returned)
  22918. CALL   DosWriteAsync
  22919.  
  22920. Returns WORD
  22921.  
  22922.  
  22923. ΓòÉΓòÉΓòÉ <hidden> DosWriteQueue ΓòÉΓòÉΓòÉ
  22924.  
  22925. EXTRN  DosWriteQueue:FAR
  22926. INCL_DOSQUEUES      EQU 1
  22927.  
  22928. PUSH   WORD    QueueHandle   ;Queue handle
  22929. PUSH   WORD    Request       ;Request identification data
  22930. PUSH   WORD    DataLength    ;Length of element being added
  22931. PUSH@  OTHER   DataBuffer    ;Element being added
  22932. PUSH   WORD    ElemPriority  ;Priority of element being added
  22933. CALL   DosWriteQueue
  22934.  
  22935. Returns WORD
  22936.  
  22937.  
  22938. ΓòÉΓòÉΓòÉ 2. Keyboard Function Calls ΓòÉΓòÉΓòÉ
  22939.  
  22940. This section reflects the Keyboard API interface of OS/2 only. 
  22941.  
  22942. For information regarding the keyboard IOCTL interface and keyboard monitor 
  22943. refer to IBM Operating System/2 Version 1.2 I/O Subsystems And Device Support 
  22944. Volume 1. 
  22945.  
  22946. Notes: 
  22947.  
  22948.   1. Calls marked xPM are not supported by Presentation Manager, and must not 
  22949.      be used by Presentation Manager applications.  An error code is returned 
  22950.      if any of these calls are issued. 
  22951.  
  22952.   2. Calls marked xWPM are not windowable and are not supported by Presentation 
  22953.      Manager. They can be used in OS/2 mode. 
  22954.  
  22955.   3. Calls marked FAPI are present in the Family API. 
  22956.  
  22957.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  22958.         Γöé   FUNCTION CALL        ICON        Γöé
  22959.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22960.         Γöé   KbdCharIn            FAPI xPM    Γöé
  22961.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22962.         Γöé   KbdClose             xPM         Γöé
  22963.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22964.         Γöé   KbdDeRegister        xWPM        Γöé
  22965.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22966.         Γöé   KbdFlushBuffer       FAPI xPM    Γöé
  22967.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22968.         Γöé   KbdFreeFocus         xPM         Γöé
  22969.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22970.         Γöé   KbdGetCp             xPM         Γöé
  22971.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22972.         Γöé   KbdGetFocus          xPM         Γöé
  22973.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22974.         Γöé   KbdGetStatus         FAPI xPM    Γöé
  22975.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22976.         Γöé   KbdOpen              xPM         Γöé
  22977.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22978.         Γöé   KbdPeek              FAPI xPM    Γöé
  22979.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22980.         Γöé   KbdRegister          xWPM        Γöé
  22981.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22982.         Γöé   KbdSetCp             xPM         Γöé
  22983.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22984.         Γöé   KbdSetCustXt         xPM         Γöé
  22985.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22986.         Γöé   KbdSetFgnd           xPM         Γöé
  22987.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22988.         Γöé   KbdSetStatus         FAPI xPM    Γöé
  22989.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22990.         Γöé   KbdStringIn          FAPI xPM    Γöé
  22991.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22992.         Γöé   KbdSynch             xWPM        Γöé
  22993.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  22994.         Γöé   KbdXlate             xPM         Γöé
  22995.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  22996.  
  22997.  
  22998. ΓòÉΓòÉΓòÉ 2.1. KbdCharIn ΓòÉΓòÉΓòÉ
  22999.  
  23000.                                Bindings:  C, MASM
  23001.  
  23002. This call returns a character data record from the keyboard. 
  23003.  
  23004.  KbdCharIn    (CharData, IOWait, KbdHandle) 
  23005.  
  23006.  CharData (PKBDKEYINFO) - output 
  23007.     Address of the character data structure: 
  23008.  
  23009.     asciicharcode (UCHAR) 
  23010.        ASCII character code. The scan code received from the keyboard is 
  23011.        translated to the ASCII character code. 
  23012.  
  23013.     scancode (UCHAR) 
  23014.        Code received from the keyboard.  The scan code received from the 
  23015.        keyboard is translated to the ASCII character code. 
  23016.  
  23017.     status (UCHAR) 
  23018.        State of the keystroke event: 
  23019.  
  23020.        Bit       Description 
  23021.  
  23022.        7-6       00 = Undefined 
  23023.  
  23024.                  01 = Final character, interim character flag off 
  23025.  
  23026.                  10 = Interim character 
  23027.  
  23028.                  11 = Final character, interim character flag on. 
  23029.  
  23030.        5         1 = Immediate conversion requested. 
  23031.  
  23032.        4-2       Reserved. 
  23033.  
  23034.        1         0 = Scan code is a character. 
  23035.  
  23036.                  1 = Scan code is not a character; is an extended key code from 
  23037.                  the keyboard. 
  23038.  
  23039.        0         1 = Shift status returned without character. 
  23040.  
  23041.     reserved (UCHAR) 
  23042.        NLS shift status.  Reserved, set to zero. 
  23043.  
  23044.     shiftkeystat (USHORT) 
  23045.        Shift key status. 
  23046.  
  23047.        Bit       Description 
  23048.        15        SysReq key down 
  23049.        14        CapsLock key down 
  23050.        13        NumLock key down 
  23051.        12        ScrollLock key down 
  23052.        11        Right Alt key down 
  23053.        10        Right Ctrl key down 
  23054.        9         Left Alt key down 
  23055.        8         Left Ctrl key down 
  23056.        7         Insert on 
  23057.        6         CapsLock on 
  23058.        5         NumLock on 
  23059.        4         ScrollLock on 
  23060.        3         Either Alt key down 
  23061.        2         Either Ctrl key down 
  23062.        1         Left Shift key down 
  23063.        0         Right Shift key down 
  23064.  
  23065.     time (ULONG) 
  23066.        Time stamp indicating when a key was pressed.  It is specified in 
  23067.        milliseconds from the time the system was started. 
  23068.  
  23069.  IOWait (USHORT) - input 
  23070.     Wait if a character is not available. 
  23071.  
  23072.     Value     Definition 
  23073.     0         Requestor waits for a character if one is not available. 
  23074.     1         Requestor gets an immediate return if no character is available. 
  23075.  
  23076.  KbdHandle (HKBD) - input 
  23077.     Default keyboard or the logical keyboard. 
  23078.  
  23079.  rc (USHORT) - return 
  23080.     Return code descriptions are: 
  23081.  
  23082.     0         NO_ERROR 
  23083.     375       ERROR_KBD_INVALID_IOWAIT 
  23084.     439       ERROR_KBD_INVALID_HANDLE 
  23085.     445       ERROR_KBD_FOCUS_REQUIRED 
  23086.     447       ERROR_KBD_KEYBOARD_BUSY 
  23087.     464       ERROR_KBD_DETACHED 
  23088.     504       ERROR_KBD_EXTENDED_SG 
  23089.  
  23090.  Remarks 
  23091.  
  23092.  On an enhanced keyboard, the secondary enter key returns the normal character 
  23093.  0DH and a scan code of E0H. 
  23094.  
  23095.  Double-byte character codes (DBCS) require two function calls to obtain the 
  23096.  entire code. 
  23097.  
  23098.  If shift report is set with KbdSetStatus, the CharData record returned 
  23099.  reflects changed shift information only. 
  23100.  
  23101.  Extended ASCII codes are identified with the status byte, bit 1 on and the 
  23102.  ASCII character code being either 00H or E0H. Both conditions must be 
  23103.  satisfied for the character to be an extended keystroke.  For extended ASCII 
  23104.  codes, the scan code byte returned is the second code (extended code). Usually 
  23105.  the extended ASCII code is the scan code of the primary key that was pressed. 
  23106.  
  23107.  A thread in the foreground session that repeatedly polls the keyboard with 
  23108.  KbdCharIn (with no wait), can prevent all regular priority class threads from 
  23109.  executing.  If polling must be used and a minimal amount of other processing 
  23110.  is being performed, the thread should periodically yield to the CPU by issuing 
  23111.  a DosSleep call for an interval of at least 5 milliseconds. 
  23112.  
  23113.  
  23114.  Family API Considerations 
  23115.  
  23116.  Some options operate differently in the DOS mode than in the OS /2 mode. 
  23117.  Therefore, the following restrictions apply to KbdCharIn when coding in the 
  23118.  DOS mode: 
  23119.  
  23120.  o The CharData structure includes everything except the time stamp. 
  23121.  o Interim character is not supported 
  23122.  o Status can be 0 or 40H 
  23123.  o KbdHandle is ignored. 
  23124.  
  23125.  
  23126. ΓòÉΓòÉΓòÉ 2.2. KbdClose ΓòÉΓòÉΓòÉ
  23127.  
  23128.                                Bindings:  C, MASM
  23129.  
  23130. This call closes the existing logical keyboard identified by the keyboard 
  23131. handle. 
  23132.  
  23133.  KbdClose     (KbdHandle) 
  23134.  
  23135.  KbdHandle (HKBD) - input 
  23136.     Default keyboard or the logical keyboard. 
  23137.  
  23138.  rc (USHORT) - return 
  23139.     Return code descriptions are: 
  23140.  
  23141.     0         NO_ERROR 
  23142.     439       ERROR_KBD_INVALID_HANDLE 
  23143.     464       ERROR_KBD_DETACHED 
  23144.     504       ERROR_KBD_EXTENDED_SG 
  23145.  
  23146.  Remarks 
  23147.  
  23148.  KbdClose blocks while another thread has the keyboard focus (by way of 
  23149.  KbdGetFocus) until the thread with the focus issues KbdFreeFocus.  Therefore, 
  23150.  to prevent KbdClose from blocking, it is recommended that KbdClose be issued 
  23151.  only while the current thread has the focus.  For example: 
  23152.  
  23153.  KbdGetFocus       Wait until focus available on handle 0. 
  23154.  KbdClose          Close a logical keyboard handle. 
  23155.  KbdClose          Close another logical keyboard handle. 
  23156.  KbdClose          Close still another logical keyboard handle. 
  23157.  KbdFreeFocus      Give up the focus on handle 0. 
  23158.  
  23159.  
  23160. ΓòÉΓòÉΓòÉ 2.3. KbdDeRegister ΓòÉΓòÉΓòÉ
  23161.  
  23162.                                Bindings:  C, MASM
  23163.  
  23164. This call deregisters a keyboard subsystem previously registered within a 
  23165. session.  Only the process that issued the KbdRegister may issue KbdDeRegister. 
  23166.  
  23167.  KbdDeRegister     ( ) 
  23168.  
  23169.  rc (USHORT) - return 
  23170.     Return code descriptions are: 
  23171.  
  23172.     0         NO_ERROR 
  23173.     411       ERROR_KBD_DEREGISTER 
  23174.     464       ERROR_KBD_DETACHED 
  23175.     504       ERROR_KBD_EXTENDED_SG 
  23176.  
  23177.  
  23178. ΓòÉΓòÉΓòÉ 2.4. KbdFlushBuffer ΓòÉΓòÉΓòÉ
  23179.  
  23180.                                Bindings:  C, MASM
  23181.  
  23182. This call clears the keystroke buffer. 
  23183.  
  23184.  KbdFlushBuffer    (KbdHandle) 
  23185.  
  23186.  KbdHandle (HKBD) - input 
  23187.     Default keyboard or the logical keyboard. 
  23188.  
  23189.  rc (USHORT) - return 
  23190.     Return code descriptions are: 
  23191.  
  23192.     0         NO_ERROR 
  23193.     439       ERROR_KBD_INVALID_HANDLE 
  23194.     445       ERROR_KBD_FOCUS_REQUIRED 
  23195.     447       ERROR_KBD_KEYBOARD_BUSY 
  23196.     464       ERROR_KBD_DETACHED 
  23197.     504       ERROR_KBD_EXTENDED_SG 
  23198.  
  23199.  Remarks 
  23200.  
  23201.  KbdFlushBuffer completes when the handle has access to the physical keyboard 
  23202.  (focus), or is equal to zero and no other handle has the focus. 
  23203.  
  23204.  
  23205.  Family API Considerations 
  23206.  
  23207.  Some options operate differently in the DOS mode than in the OS/2 mode.  The 
  23208.  KbdHandle is ignored when coding in the DOS mode. 
  23209.  
  23210.  
  23211. ΓòÉΓòÉΓòÉ 2.5. KbdFreeFocus ΓòÉΓòÉΓòÉ
  23212.  
  23213.                                Bindings:  C, MASM
  23214.  
  23215. This call frees the logical-to-physical keyboard bond created by KbdGetFocus. 
  23216.  
  23217.  KbdFreeFocus    (KbdHandle) 
  23218.  
  23219.  KbdHandle (HKBD) - input 
  23220.     Default keyboard or the logical keyboard. 
  23221.  
  23222.  rc (USHORT) - return 
  23223.     Return code descriptions are: 
  23224.  
  23225.     0         NO_ERROR 
  23226.     439       ERROR_KBD_INVALID_HANDLE 
  23227.     445       ERROR_KBD_FOCUS_REQUIRED 
  23228.     464       ERROR_KBD_DETACHED 
  23229.     504       ERROR_KBD_EXTENDED_SG 
  23230.  
  23231.  Remarks 
  23232.  
  23233.  KbdFreeFocus may be replaced by issuing KbdRegister.  Unlike other keyboard 
  23234.  subsystem functions, the replaced KbdFreeFocus is called only if there is an 
  23235.  outstanding focus. 
  23236.  
  23237.  
  23238. ΓòÉΓòÉΓòÉ 2.6. KbdGetCp ΓòÉΓòÉΓòÉ
  23239.  
  23240.                                Bindings:  C, MASM
  23241.  
  23242. This call allows a process to query the code page being used to translate scan 
  23243. codes to ASCII characters. 
  23244.  
  23245.  KbdGetCp    (Reserved, CodePageID, KbdHandle) 
  23246.  
  23247.  Reserved (ULONG) - input 
  23248.     Reserved and must be set to zero. 
  23249.  
  23250.  CodePageID (PUSHORT) - output 
  23251.     Address of the code page ID located in the application's data area. The 
  23252.     keyboard support copies the current code page ID for a specified keyboard 
  23253.     handle into this word.  The code page ID is equivalent to one of the code 
  23254.     page IDs specified in the CONFIG.SYS CODEPAGE = statement or 0000. 
  23255.  
  23256.  KbdHandle (HKBD) - input 
  23257.     Default keyboard or the logical keyboard. 
  23258.  
  23259.  rc (USHORT) - return 
  23260.     Return code descriptions are: 
  23261.  
  23262.     0         NO_ERROR 
  23263.     373       ERROR_KBD_PARAMETER 
  23264.     439       ERROR_KBD_INVALID_HANDLE 
  23265.     445       ERROR_KBD_FOCUS_REQUIRED 
  23266.     447       ERROR_KBD_KEYBOARD_BUSY 
  23267.     464       ERROR_KBD_DETACHED 
  23268.     504       ERROR_KBD_EXTENDED_SG 
  23269.  
  23270.  Remarks 
  23271.  
  23272.  The CodePageID is the currently active keyboard code page. A value of 0 
  23273.  indicates the code page translation table in use is the ROM code page 
  23274.  translation table provided by the hardware. 
  23275.  
  23276.  
  23277. ΓòÉΓòÉΓòÉ 2.7. KbdGetFocus ΓòÉΓòÉΓòÉ
  23278.  
  23279.                                Bindings:  C, MASM
  23280.  
  23281. This call binds the logical keyboard to the physical keyboard. 
  23282.  
  23283.  KbdGetFocus    (IOWait, KbdHandle) 
  23284.  
  23285.  IOWait (USHORT) - input 
  23286.     Wait if the physical keyboard is already in use by a logical keyboard. 
  23287.  
  23288.     Value     Definition 
  23289.     0         Indicates that the caller wants to wait for the bond. 
  23290.     1         Indicates that the caller does not want to wait for the bond. 
  23291.  
  23292.  KbdHandle (HKBD) - input 
  23293.     Default keyboard or the logical keyboard. 
  23294.  
  23295.  rc (USHORT) - return 
  23296.     Return code descriptions are: 
  23297.  
  23298.     0         NO_ERROR 
  23299.     439       ERROR_KBD_INVALID_HANDLE 
  23300.     446       ERROR_KBD_FOCUS_ALREADY_ACTIVE 
  23301.     447       ERROR_KBD_KEYBOARD_BUSY 
  23302.     464       ERROR_KBD_DETACHED 
  23303.     504       ERROR_KDB_EXTENDED_SG 
  23304.  
  23305.  The keyboard handle identifies which logical keyboard to bind to.  If the 
  23306.  physical keyboard is not bound to a logical or default keyboard, then the bind 
  23307.  proceeds immediately.  The logical keyboard, identified by the handle, 
  23308.  receives all further key strokes from the physical keyboard.  If the physical 
  23309.  keyboard is already in use by a logical keyboard, then the thread issuing 
  23310.  KbdGetFocus waits until the bond can be made.  Waiting threads do not execute 
  23311.  in any definable order. 
  23312.  
  23313.  
  23314. ΓòÉΓòÉΓòÉ 2.8. KbdGetHWId ΓòÉΓòÉΓòÉ
  23315.  
  23316.                                Bindings:  C, MASM
  23317.  
  23318. Returns the attached keyboard's hardware-generated Identification value. 
  23319.  
  23320.  KbdGetHWId     (KeyboardID, KbdHandle) 
  23321.  
  23322.  KeyboardID (PKBDHWID) - input 
  23323.     Pointer to the caller's data area where the following structure and data 
  23324.     values are: 
  23325.  
  23326.     length (USHORT) - input/output 
  23327.        On input, this field should contain the length of the KeyboardID 
  23328.        structure.  The minimum input length value allowed is 2.  On output, 
  23329.        this field contains the actual number of bytes returned. 
  23330.  
  23331.     keybdid (USHORT) - output 
  23332.        OS/2 supported keyboards and their hardware generated IDs are as 
  23333.        follows: 
  23334.  
  23335.        ID        Keyboard 
  23336.        0000H     Undetermined keyboard type 
  23337.        0001H     PC-AT Standard Keyboard 
  23338.        AB41H     101 Key Enhanced Keyboard 
  23339.        AB41H     102 Key Enhanced Keyboard 
  23340.        AB54H     88 and 89 Key Enhanced Keyboards 
  23341.        AB85H     122 Key Enhanced Keyboard 
  23342.  
  23343.     reserved (USHORT) 
  23344.        Reserved and returned set to zero. 
  23345.  
  23346.     reserved (USHORT) 
  23347.        Reserved and returned set to zero. 
  23348.  
  23349.  KbdHandle (HKBD) - input 
  23350.     Word identifying the logical keyboard. 
  23351.  
  23352.  rc (USHORT) - return 
  23353.     Return code descriptions are: 
  23354.  
  23355.     0         NO_ERROR 
  23356.     373       ERROR_KBD_PARAMETER 
  23357.     447       ERROR_KBD_KEYBOARD_BUSY 
  23358.     464       ERROR_KBD_DETACHED 
  23359.     504       ERROR_KBD_EXTENDED_SG 
  23360.  
  23361.  Remarks 
  23362.  
  23363.  In past OS/2 releases, all keyboards could be supported by knowing the 
  23364.  hardware family information available with keyboard IOCTL 77H. However, with 
  23365.  the addition of the 122-key keyboard, recognition was not containable by 
  23366.  hardware family information alone.  The 122-key keyboard has a number of 
  23367.  differences from other keyboards.  Therefore, applications performing 
  23368.  keystroke specific functions may need to determine specifically which keyboard 
  23369.  is attached. 
  23370.  
  23371.  This function is of particular usefulness for applications providing Custom 
  23372.  Translate Tables and mapping keyboard layouts. 
  23373.  
  23374.  
  23375. ΓòÉΓòÉΓòÉ 2.9. KbdGetStatus ΓòÉΓòÉΓòÉ
  23376.  
  23377.                                Bindings:  C, MASM
  23378.  
  23379. This call gets the current state of the keyboard. 
  23380.  
  23381.  KbdGetStatus    (StatData, KbdHandle) 
  23382.  
  23383.  StatData (PKBDINFO) - output 
  23384.     Address of the keyboard status structure: 
  23385.  
  23386.     length (USHORT) 
  23387.        Length, in bytes, of this data structure, including length. 
  23388.  
  23389.        10        Only valid value. 
  23390.  
  23391.     sysstate (USHORT) 
  23392.        State as follows: 
  23393.  
  23394.        Bit       Description 
  23395.        15-9      Reserved, set to zero. 
  23396.        8         Shift return is on. 
  23397.        7         Length of the turn-around character (meaningful only if bit 6 
  23398.                  is on). 
  23399.        6         Turn-around character is modified. 
  23400.        5         Interim character flags are modified. 
  23401.        4         Shift state is modified. 
  23402.        3         ASCII mode is on. 
  23403.        2         Binary mode is on. 
  23404.        1         Echo off. 
  23405.        0         Echo on. 
  23406.  
  23407.     turnchardef (USHORT) 
  23408.        Definition of the turn-around character. In ASCII and extended-ASCII 
  23409.        format, the turn-around character is defined as the carriage return.  In 
  23410.        ASCII format only, the turn-around character is defined in the low-order 
  23411.        byte. 
  23412.  
  23413.     intcharflag (USHORT) 
  23414.        Interim character flags: 
  23415.  
  23416.        Bit       Description 
  23417.        15-8      NLS shift state. 
  23418.        7         Interim character flag is on. 
  23419.        6         Reserved, set to zero. 
  23420.        5         Application requested immediate conversion. 
  23421.        4-0       Reserved, set to zero. 
  23422.  
  23423.     shiftstate (USHORT) 
  23424.        Shift state as follows: 
  23425.  
  23426.        Bit       Description 
  23427.        15        SysReq key down 
  23428.        14        CapsLock key down 
  23429.        13        NumLock key down 
  23430.        12        ScrollLock key down 
  23431.        11        Right Alt key down 
  23432.        10        Right Ctrl key down 
  23433.        9         Left Alt key down 
  23434.        8         Left Ctrl key down 
  23435.        7         Insert on 
  23436.        6         CapsLock on 
  23437.        5         NumLock on 
  23438.        4         ScrollLock on 
  23439.        3         Either Alt key down 
  23440.        2         Either Ctrl key down 
  23441.        1         Left Shift key down 
  23442.        0         Right Shift key down. 
  23443.  
  23444.  KbdHandle (HKBD) - input 
  23445.     Default keyboard or the logical keyboard. 
  23446.  
  23447.  rc (USHORT) - return 
  23448.     Return code descriptions are: 
  23449.  
  23450.     0         NO_ERROR 
  23451.     376       ERROR_KBD_INVALID_LENGTH 
  23452.     439       ERROR_KBD_INVALID_HANDLE 
  23453.     445       ERROR_KBD_FOCUS_REQUIRED 
  23454.     447       ERROR_KBD_KEYBOARD_BUSY 
  23455.     464       ERROR_KBD_DETACHED 
  23456.     504       ERROR_KBD_EXTENDED_SG 
  23457.  
  23458.  Remarks 
  23459.  
  23460.  The initial state of the keyboard is established by the system at application 
  23461.  load time.  Some default states may be modified by the application through 
  23462.  KbdSetStatus.  KbdGetStatus returns only those keyboard parameters initially 
  23463.  set by KbdSetStatus. The returned parameters are: 
  23464.  
  23465.  o Input Mode 
  23466.  o Interim Character Flags 
  23467.  o Shift State 
  23468.  o Echo State 
  23469.  o Turnaround Character 
  23470.  
  23471.  KbdGetStatus completes only when the handle has access to the physical 
  23472.  keyboard (focus) or the handle is 0 and no other handle has the focus. 
  23473.  
  23474.  
  23475.  Family API Considerations 
  23476.  
  23477.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  23478.  Therefore, the following restrictions apply to KbdGetStatus when coding in the 
  23479.  DOS mode: 
  23480.  
  23481.  o Interim character is not supported 
  23482.  o TurnAround character is not supported 
  23483.  o NLS_SHIFT_STATE is always NULL. 
  23484.  o KbdHandle is ignored. 
  23485.  
  23486.  
  23487. ΓòÉΓòÉΓòÉ 2.10. KbdOpen ΓòÉΓòÉΓòÉ
  23488.  
  23489.                                Bindings:  C, MASM
  23490.  
  23491. This call creates a new logical keyboard. 
  23492.  
  23493.  KbdOpen    (KbdHandle) 
  23494.  
  23495.  KbdHandle (PHKBD) - output 
  23496.     Address of the logical keyboard. 
  23497.  
  23498.  rc (USHORT) - return 
  23499.     Return code descriptions are: 
  23500.  
  23501.     0         NO_ERROR 
  23502.     440       ERROR_KBD_NO_MORE_HANDLE 
  23503.     441       ERROR_KBD_CANNOT_CREATE_KCB 
  23504.     464       ERROR_KBD_DETACHED 
  23505.     504       ERROR_KBD_EXTENDED_SG 
  23506.  
  23507.  Remarks 
  23508.  
  23509.  KbdOpen blocks while another thread has the keyboard focus (by way of 
  23510.  KbdGetFocus) until the thread with the focus issues KbdFreeFocus.  Therefore, 
  23511.  to prevent KbdOpen from blocking, it is recommended that KbdOpen be issued 
  23512.  only while the current thread has the focus.  For example: 
  23513.  
  23514.  KbdGetFocus       wait until focus available on handle 0 
  23515.  KbdOpen           get a logical keyboard handle 
  23516.  KbdOpen           get another logical keyboard handle 
  23517.  KbdOpen           get yet another logical keyboard handle 
  23518.  KbdFreeFocus      give up the focus on handle 0. 
  23519.  
  23520.  
  23521. ΓòÉΓòÉΓòÉ 2.11. KbdPeek ΓòÉΓòÉΓòÉ
  23522.  
  23523.                                Bindings:  C, MASM
  23524.  
  23525. This call returns any available character data record from the keyboard without 
  23526. removing it from the buffer. 
  23527.  
  23528.  KbdPeek    (CharData, KbdHandle) 
  23529.  
  23530.  CharData (PKBDKEYINFO) - output 
  23531.     Address of the character data information: 
  23532.  
  23533.     asciicharcode (UCHAR) 
  23534.        ASCII character code. The scan code received from the keyboard is 
  23535.        translated to the ASCII character code. 
  23536.  
  23537.     scancode (UCHAR) 
  23538.        Code received from the keyboard hardware. 
  23539.  
  23540.     status (UCHAR) 
  23541.        State of the keystroke event: 
  23542.  
  23543.        Bit       Description 
  23544.  
  23545.        7-6       00 = Undefined. 
  23546.  
  23547.                  01 = Final character, interim character flag off. 
  23548.  
  23549.                  10 = Interim character. 
  23550.  
  23551.                  11 = Final character, interim character flag on. 
  23552.  
  23553.        5         1 = Immediate conversion requested. 
  23554.  
  23555.        4-2       Reserved, set to zero. 
  23556.  
  23557.        1         0 = Scan code is a character. 
  23558.  
  23559.                  1 = Scan code is not a character; it is an extended key code 
  23560.                  from the keyboard. 
  23561.  
  23562.        0         1 = Shift status returned without character. 
  23563.  
  23564.     reserved (UCHAR) 
  23565.        NLS shift status.  Reserved, set to zero. 
  23566.  
  23567.     shiftkeystat (USHORT) 
  23568.        Shift key status. 
  23569.  
  23570.        Bit       Description 
  23571.        15        SysReq key down 
  23572.        14        CapsLock key down 
  23573.        13        NumLock key down 
  23574.        12        ScrollLock key down 
  23575.        11        Right Alt key down 
  23576.        10        Right Ctrl key down 
  23577.        9         Left Alt key down 
  23578.        8         Left Ctrl key down 
  23579.        7         Insert on 
  23580.        6         CapsLock on 
  23581.        5         NumLock on 
  23582.        4         ScrollLock on 
  23583.        3         Either Alt key down 
  23584.        2         Either Ctrl key down 
  23585.        1         Left Shift key down 
  23586.        0         Right Shift key down 
  23587.  
  23588.     time (ULONG) 
  23589.        Time stamp indicating when a key was pressed.  It is specified in 
  23590.        milliseconds from the time the system was started. 
  23591.  
  23592.  KbdHandle (HKBD) - input 
  23593.     Default keyboard or the logical keyboard. 
  23594.  
  23595.  rc (USHORT) - return 
  23596.     Return code descriptions are: 
  23597.  
  23598.     0         NO_ERROR 
  23599.     439       ERROR_KBD_INVALID_HANDLE 
  23600.     445       ERROR_KBD_FOCUS_REQUIRED 
  23601.     447       ERROR_KBD_KEYBOARD_BUSY 
  23602.     464       ERROR_KBD_DETACHED 
  23603.     504       ERROR_KBD_EXTENDED_SG 
  23604.  
  23605.  Remarks 
  23606.  
  23607.  On an enhanced keyboard, the secondary enter key returns the normal character 
  23608.  0DH and a scan code of E0H. 
  23609.  
  23610.  Double-byte character codes (DBCS) require two function calls to obtain the 
  23611.  entire code. 
  23612.  
  23613.  If shift report is set with KbdSetStatus the CharData record returned, 
  23614.  reflects changed shift information only. 
  23615.  
  23616.  Extended ASCII codes are identified with the status byte, bit 1 on and the 
  23617.  ASCII character code being either 00H or E0H. Both conditions must be 
  23618.  satisfied for the character to be an extended keystroke.  For extended ASCII 
  23619.  codes, the scan code byte returned is the second code (extended code). Usually 
  23620.  the extended ASCII code is the scan code of the primary key that was pressed. 
  23621.  
  23622.  A thread in the foreground session that repeatedly polls the keyboard with 
  23623.  KbdCharIn (with no wait), can prevent all regular priority class threads from 
  23624.  executing.  If polling must be used and a minimal amount of other processing 
  23625.  is being performed, the thread should periodically yield the CPU by issuing a 
  23626.  DosSleep call for an interval of at least 5 milliseconds. 
  23627.  
  23628.  
  23629.  Family API Considerations 
  23630.  
  23631.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  23632.  Therefore, the following restrictions apply to KbdPeek when coding for the DOS 
  23633.  mode: 
  23634.  
  23635.  o The CharData structure includes everything except the time stamp. 
  23636.  o Interim character is not supported. 
  23637.  o Status can be 0 or 1. 
  23638.  o KbdHandle is ignored. 
  23639.  
  23640.  
  23641. ΓòÉΓòÉΓòÉ 2.12. KbdRegister ΓòÉΓòÉΓòÉ
  23642.  
  23643.                                Bindings:  C, MASM
  23644.  
  23645. This call registers a keyboard subsystem within a session. 
  23646.  
  23647.  KbdRegister    (ModuleName, EntryPoint, FunctionMask) 
  23648.  
  23649.  ModuleName (PSZ) - input 
  23650.     Address of the dynamic link module name.  Maximum length is 9 bytes 
  23651.     (including ASCIIZ terminator). 
  23652.  
  23653.  EntryPoint (PSZ) - input 
  23654.     Address of the dynamic link entry point name of a routine that receives 
  23655.     control when any of the registered functions are called.  Maximum length is 
  23656.     33 bytes (including ASCIIZ terminator). 
  23657.  
  23658.  FunctionMask (ULONG) - input 
  23659.     A bit mask where each bit identifies a keyboard function being registered. 
  23660.     The bit values are: 
  23661.  
  23662.     Bit       Description 
  23663.     31-15     Reserved, must be set to zero. 
  23664.     14        KbdGetHWId 
  23665.     13        KbdSetCustXt 
  23666.     12        KbdXlate 
  23667.     11        KbdSetCp 
  23668.     10        KbdGetCp 
  23669.     9         KbdFreeFocus 
  23670.     8         KbdGetFocus 
  23671.     7         KbdClose 
  23672.     6         KbdOpen 
  23673.     5         KbdStringIn 
  23674.     4         KbdSetStatus 
  23675.     3         KbdGetStatus 
  23676.     2         KbdFlushBuffer 
  23677.     1         KbdPeek 
  23678.     0         KbdCharIn 
  23679.  
  23680.  rc (USHORT) - return 
  23681.     Return code descriptions are: 
  23682.  
  23683.     0         NO_ERROR 
  23684.     408       ERROR_KBD_INVALID_ASCIIZ 
  23685.     409       ERROR_KBD_INVALID_MASK 
  23686.     410       ERROR_KBD_REGISTER 
  23687.     464       ERROR_KBD_DETACHED 
  23688.     504       ERROR_KBD_EXTENDED_SG 
  23689.  
  23690.  Remarks 
  23691.  
  23692.  There can be only one KbdRegister call outstanding for each session without an 
  23693.  intervening KbdDeRegister. KbdDeRegister must be issued by the same process 
  23694.  that issued the KbdRegister. 
  23695.  
  23696.  
  23697. ΓòÉΓòÉΓòÉ 2.13. KbdSetCp ΓòÉΓòÉΓòÉ
  23698.  
  23699.                                Bindings:  C, MASM
  23700.  
  23701. This call allows the process to set the code page used to translate key strokes 
  23702. received from the keyboard. 
  23703.  
  23704.  KbdSetCp    (Reserved, CodePageID, KbdHandle) 
  23705.  
  23706.  Reserved (USHORT) - input 
  23707.     Reserved and must be set to zero. 
  23708.  
  23709.  CodePageID (USHORT) - input 
  23710.     CodePageID represents a code-page ID in the application's data area. The 
  23711.     code-page ID must be equivalent to one of the code-page IDs specified on 
  23712.     the CONFIG.SYS CODEPAGE = statement or 0000. If the code-page ID does not 
  23713.     match one of the IDs on the CODEPAGE = statement, an error results. The 
  23714.     code-page word must have one of these code-page identifiers: 
  23715.  
  23716.     Identifier Description 
  23717.     0         Resident code page 
  23718.     437       IBM PC US 437 
  23719.     850       Multilingual 
  23720.     860       Portuguese 
  23721.     863       Canadian-French 
  23722.     865       Nordic. 
  23723.  
  23724.  KbdHandle (HKBD) - input 
  23725.     Default keyboard or the logical keyboard. 
  23726.  
  23727.  rc (USHORT) - return 
  23728.     Return code descriptions are: 
  23729.  
  23730.     0         NO_ERROR 
  23731.     439       ERROR_KBD_INVALID_HANDLE 
  23732.     445       ERROR_KBD_FOCUS_REQUIRED 
  23733.     447       ERROR_KBD_KEYBOARD_BUSY 
  23734.     448       ERROR_KBD_INVALID_CODEPAGE 
  23735.     464       ERROR_KBD_DETACHED 
  23736.     504       ERROR_KBD_EXTENDED_SG 
  23737.  
  23738.  Remarks 
  23739.  
  23740.  Keyboard code page support is not available without the DEVINFO=KBD statement 
  23741.  in the CONFIG.SYS file.  Refer to IBM Operating System/2 Standard Edition 
  23742.  Version 1.2 Using Advanced Features for a complete description of CODEPAGE and 
  23743.  DEVINFO. 
  23744.  
  23745.  
  23746. ΓòÉΓòÉΓòÉ 2.14. KbdSetCustXt ΓòÉΓòÉΓòÉ
  23747.  
  23748.                                Bindings:  C, MASM
  23749.  
  23750. This call installs, on the specified handle, the translate table which this 
  23751. call points to. This translate table affects only this handle. 
  23752.  
  23753.  KbdSetCustXt    (Xlatetable, KbdHandle) 
  23754.  
  23755.  Xlatetable (PUSHORT) - input 
  23756.     A pointer to the translation table used to translate scan code to ASCII 
  23757.     code for a specified handle.  The format of the translate table is 
  23758.     documented in the Set Code Page IOCTL 50H.  Refer to IBM Operating System/2 
  23759.     Version 1.2 I/O Subsystems And Device Support Volume 1 for a complete 
  23760.     discussion of Set Code Page IOCTL 50H. 
  23761.  
  23762.  KbdHandle (HKBD) - input 
  23763.     Default keyboard or the logical keyboard. 
  23764.  
  23765.  rc (USHORT) - return 
  23766.     Return code descriptions are: 
  23767.  
  23768.     0         NO_ERROR 
  23769.     377       ERROR_KBD_INVALID_ECHO_MASK 
  23770.     378       ERROR_KBD_INVALID_INPUT_MASK 
  23771.     439       ERROR_KBD_INVALID_HANDLE 
  23772.     445       ERROR_KBD_FOCUS_REQUIRED 
  23773.     447       ERROR_KBD_KEYBOARD_BUSY 
  23774.     464       ERROR_KBD_DETACHED 
  23775.     504       ERROR_KBD_EXTENDED_SG 
  23776.  
  23777.  Remarks 
  23778.  
  23779.  The translate table must be maintained in the caller's memory.  No copy of the 
  23780.  translate table is made by KbdSetCustXt. 
  23781.  
  23782.  KbdSetCp reverses the action of KbdSetCustXt and sets the handle equal to one 
  23783.  of the system translate tables.  If memory is dynamically allocated by the 
  23784.  caller for the translate table and is freed before the KbdSetCp is performed, 
  23785.  KbdSetCp and future translations may fail. 
  23786.  
  23787.  
  23788. ΓòÉΓòÉΓòÉ 2.15. KbdSetFgnd ΓòÉΓòÉΓòÉ
  23789.  
  23790.                                Bindings:  C, MASM
  23791.  
  23792. This call raises the priority of the foreground keyboard's thread. 
  23793.  
  23794.  KbdSetFgnd    ( ) 
  23795.  
  23796.  rc (USHORT) - return 
  23797.     Return code descriptions are: 
  23798.  
  23799.     0         NO_ERROR 
  23800.     447       ERROR_KBD_KEYBOARD_BUSY 
  23801.     504       ERROR_KBD_EXTENDED_SG 
  23802.  
  23803.  Remarks 
  23804.  
  23805.  KbdSetFgnd marks the current process that owns the keyboard. Threads in this 
  23806.  process receive a priority boost.  The previous foreground keyboard threads 
  23807.  lose their priority boost. 
  23808.  
  23809.  This function should only be issued by a Keyboard Subsystem during KbdCharIn 
  23810.  or KbdStringIn processing. 
  23811.  
  23812.  
  23813. ΓòÉΓòÉΓòÉ 2.16. KbdSetStatus ΓòÉΓòÉΓòÉ
  23814.  
  23815.                                Bindings:  C, MASM
  23816.  
  23817. This call sets the characteristics of the keyboard. 
  23818.  
  23819.  KbdSetStatus    (StatData, KbdHandle) 
  23820.  
  23821.  StatData (PKBDINFO) - input 
  23822.     Address of the keyboard status structure: 
  23823.  
  23824.     length (USHORT) 
  23825.        Length, in bytes, of this data structure, including length. 
  23826.  
  23827.        10        Only valid value. 
  23828.  
  23829.     sysstate (USHORT) 
  23830.        The system state altered by this call. If bits 0 and 1 are off, the echo 
  23831.        state of the system is not altered. If bits 2 and 3 are off, the binary 
  23832.        and ASCII state of the system is not altered.  If bits 0 and 1 are on, 
  23833.        or if bits 2 and 3 are on, the function returns an error.  If binary 
  23834.        mode is set, echo is ignored. 
  23835.  
  23836.        Bit       Description 
  23837.        15-9      Reserved, set to zero 
  23838.        8         Shift return is on 
  23839.        7         Length of the turn-around character (meaningful only if bit 6 
  23840.                  is on). 
  23841.        6         Turn-around character is modified 
  23842.        5         Interim character flags are modified 
  23843.        4         Shift state is modified 
  23844.        3         ASCII mode is on 
  23845.        2         Binary mode is on 
  23846.        1         Echo off 
  23847.        0         Echo on 
  23848.  
  23849.     turnchardef (USHORT) 
  23850.        Definition of the turn-around character. In ASCII and extended-ASCII 
  23851.        format, the turn-around character is defined as the carriage return.  In 
  23852.        ASCII format only, the turn-around character is defined in the low-order 
  23853.        byte. 
  23854.  
  23855.     intcharflag (USHORT) 
  23856.        Interim character flags: 
  23857.  
  23858.        Bit       Description 
  23859.        15-8      NLS shift state. 
  23860.        7         Interim character flag is on 
  23861.        6         Reserved, set to zero 
  23862.        5         Application requested immediate conversion 
  23863.        4-0       Reserved, set to zero 
  23864.  
  23865.     shiftstate (USHORT) 
  23866.        Shift state. 
  23867.  
  23868.        Bit       Description 
  23869.        15        SysReq key down 
  23870.        14        CapsLock key down 
  23871.        13        NumLock key down 
  23872.        12        ScrollLock key down 
  23873.        11        Right Alt key down 
  23874.        10        Right Ctrl key down 
  23875.        9         Left Alt key down 
  23876.        8         Left Ctrl key down 
  23877.        7         Insert on 
  23878.        6         CapsLock on 
  23879.        5         NumLock on 
  23880.        4         ScrollLock on 
  23881.        3         Either Alt key down 
  23882.        2         Either Ctrl key down 
  23883.        1         Left Shift key down 
  23884.        0         Right Shift key down 
  23885.  
  23886.  KbdHandle (HKBD) - input 
  23887.     Default keyboard or the logical keyboard. 
  23888.  
  23889.  rc (USHORT) - return 
  23890.     Return code descriptions are: 
  23891.  
  23892.     0         NO_ERROR 
  23893.     376       ERROR_KBD_INVALID_LENGTH 
  23894.     377       ERROR_KBD_INVALID_ECHO_MASK 
  23895.     378       ERROR_KBD_INVALID_INPUT_MASK 
  23896.     439       ERROR_KBD_INVALID_HANDLE 
  23897.     445       ERROR_KBD_FOCUS_REQUIRED 
  23898.     447       ERROR_KBD_KEYBOARD_BUSY 
  23899.     464       ERROR_KBD_DETACHED 
  23900.     504       ERROR_KBD_EXTENDED_SG 
  23901.  
  23902.  Remarks 
  23903.  
  23904.  Shift return (bit 8 in sysstate) must be disabled in ASCII mode. 
  23905.  
  23906.  KbdSetStatus is ignored for a Vio-windowed application. 
  23907.  
  23908.  
  23909.  Family API Considerations 
  23910.  
  23911.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  23912.  Therefore, the following restrictions apply to KbdSetStatus when coding in the 
  23913.  DOS mode: 
  23914.  
  23915.  o KbdSetStatus does not accept a bit mask of 10 (ASCII on, Echo Off). 
  23916.  o Raw (binary) Mode and Echo On are not supported and return an error if 
  23917.    requested. 
  23918.  o KbdHandle is ignored. 
  23919.  o Interim character is not supported. 
  23920.  o Turnaround character is not supported. 
  23921.  
  23922.  
  23923. ΓòÉΓòÉΓòÉ 2.17. KbdStringIn ΓòÉΓòÉΓòÉ
  23924.  
  23925.                                Bindings:  C, MASM
  23926.  
  23927. This call reads a character string (character codes only) from the keyboard. 
  23928.  
  23929.  KbdStringIn   (CharBuffer, StringLength, IOWait, KbdHandle) 
  23930.  
  23931.  CharBuffer (PCH) - output 
  23932.     Address of the character string buffer. 
  23933.  
  23934.  StringLength (PSTRINGINBUF) - input/output 
  23935.     Address of the length of the character string buffer.  On entry, buflen is 
  23936.     the maximum length, in bytes, of the buffer. The maximum length that can be 
  23937.     specified is 255. Template processing has meaning only in the ASCII mode. 
  23938.  
  23939.     buflen (USHORT) 
  23940.        Length of the input buffer. 
  23941.  
  23942.     inputlen (USHORT) 
  23943.        Number of bytes read into the buffer. 
  23944.  
  23945.  IOWait (USHORT) - input 
  23946.     Wait if a character is not available. 
  23947.  
  23948.     Value     Definition 
  23949.  
  23950.     0         Wait.  In Binary input mode, the requestor waits until CharBuffer 
  23951.               is full.  In ASCII input mode, the requestor waits until a 
  23952.               carriage return is pressed. 
  23953.  
  23954.     1         No wait.  The requestor gets an immediate return if no characters 
  23955.               are available.  If characters are available, KbdStringIn returns 
  23956.               immediately with as many characters as are available (up to the 
  23957.               maximum).  No wait is not supported in ASCII input mode. 
  23958.  
  23959.  KbdHandle (HKBD) - input 
  23960.     Default keyboard or the logical keyboard. 
  23961.  
  23962.  rc (USHORT) - return 
  23963.     Return code descriptions are: 
  23964.  
  23965.     0         NO_ERROR 
  23966.     375       ERROR_KBD_INVALID_IOWAIT 
  23967.     439       ERROR_KBD_INVALID_HANDLE 
  23968.     445       ERROR_KBD_FOCUS_REQUIRED 
  23969.     464       ERROR_KBD_DETACHED 
  23970.     504       ERROR_KBD_EXTENDED_SG 
  23971.  
  23972.  Remarks 
  23973.  
  23974.  The character strings may be optionally echoed on the display if echo mode is 
  23975.  set. When echo is on each character is echoed as it is read from the keyboard. 
  23976.  Echo mode and BINARY mode are mutually exclusive. Reference KbdSetStatus and 
  23977.  KbdGetStatus for more information. 
  23978.  
  23979.  The default input mode is ASCII. In ASCII mode, 2-byte character codes only 
  23980.  return in complete form. An extended ASCII code is returned in a 2-byte 
  23981.  string. The first byte is 0DH or E0H and the next byte is an extended code. 
  23982.  
  23983.  In input mode (BINARY, ASCII), The following returns can be set and retrieved 
  23984.  with KbdSetStatus and KbdGetStatus: 
  23985.  
  23986.  Turnaround Character 
  23987.  Echo Mode 
  23988.  Interim Character Flag 
  23989.  Shift State 
  23990.  
  23991.  The received input length is also used by the KbdStringIn line edit functions 
  23992.  for re-displaying and entering a caller specified string. On the next 
  23993.  KbdStringIn call the received input length indicates the length of the input 
  23994.  buffer that may be recalled by the user using the line editing keys. A value 
  23995.  of 0 inhibits the line editing function for the current KbdStringIn request. 
  23996.  
  23997.  KbdStringIn completes when the handle has access to the physical keyboard 
  23998.  (focus), or is equal to zero and no other handle has the focus. 
  23999.  
  24000.  
  24001.  Family API Considerations 
  24002.  
  24003.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  24004.  Therefore, the following restrictions apply to KbdStringIn when coding in the 
  24005.  DOS mode: 
  24006.  
  24007.  o KbdHandle is ignored 
  24008.  
  24009.  Refer to the DosRead Family API Considerations for differences between DOS and 
  24010.  OS/2 node when reading from a handle opened to the CON device. 
  24011.  
  24012.  
  24013. ΓòÉΓòÉΓòÉ 2.18. KbdSynch ΓòÉΓòÉΓòÉ
  24014.  
  24015.                                Bindings:  C, MASM
  24016.  
  24017. This call synchronizes access from a keyboard subsystem to the keyboard device 
  24018. driver. 
  24019.  
  24020.  KbdSynch    (IOWait) 
  24021.  
  24022.  IOWait (USHORT) - input 
  24023.     Wait for the bond.  Values are: 
  24024.  
  24025.     Value     Definition 
  24026.     0         Indicates the requestor does not wait for access to the device 
  24027.               driver. 
  24028.     1         Indicates the requestor waits for access to the device driver. 
  24029.  
  24030.  rc (USHORT) - return 
  24031.     Return code descriptions are: 
  24032.  
  24033.     0         NO_ERROR 
  24034.     121       ERROR_SEM_TIMEOUT 
  24035.  
  24036.  Remarks 
  24037.  
  24038.  KbdSynch blocks all other threads within a session until return from the 
  24039.  subsystem to the router.  To ensure proper synchronization, KbdSynch should be 
  24040.  issued by a keyboard subsystem if it intends to issue a DosDevIOCtl or access 
  24041.  dynamically shared data.  KbdSynch does not protect globally shared data from 
  24042.  threads in other sessions. 
  24043.  
  24044.  
  24045. ΓòÉΓòÉΓòÉ 2.19. KbdXlate ΓòÉΓòÉΓòÉ
  24046.  
  24047.                                Bindings:  C, MASM
  24048.  
  24049. This call translates scan codes with shift states into ASCII codes. 
  24050.  
  24051.  KbdXlate  (XlateRecord, KbdHandle) 
  24052.  
  24053.  XlateRecord (PKBDTRANS) - input 
  24054.     Address of the translation record structure: 
  24055.  
  24056.     chardata (KBDKEYINFO) 
  24057.        Character data information structure as defined in KbdCharIn call. 
  24058.  
  24059.     kbdflag (USHORT) 
  24060.        See the KbdDDFlagWord call in the "Keyboard Device Driver" section of 
  24061.        IBM Operating System/2 Version 1.2 I/O Subsystems And Device Support 
  24062.        Volume 1. 
  24063.  
  24064.     xlate (USHORT) 
  24065.        Translation flag: 
  24066.  
  24067.        Value     Definition 
  24068.        0         Translation incomplete. 
  24069.        1         Translation complete. 
  24070.  
  24071.     xlatestate1 (USHORT) 
  24072.        Identifies the state of translation across successive calls; initially 
  24073.        the value should be zero. It may take several calls to this function to 
  24074.        complete a character. The value should not be changed unless a new 
  24075.        translation is required, that is, reset value to zero. 
  24076.  
  24077.     xlatestate2 (USHORT) 
  24078.        See description for xlatestate1. 
  24079.  
  24080.  KbdHandle (HKBD) - input 
  24081.     Default keyboard or the logical keyboard. 
  24082.  
  24083.  rc (USHORT) - return 
  24084.     Return code descriptions are: 
  24085.  
  24086.     0         NO_ERROR 
  24087.     439       ERROR_KBD_INVALID_HANDLE 
  24088.     445       ERROR_KBD_FOCUS_REQUIRED 
  24089.     447       ERROR_KBD_KEYBOARD_BUSY 
  24090.     464       ERROR_KBD_DETACHED 
  24091.     504       ERROR_KBD_EXTENDED_SG 
  24092.  
  24093.  Remarks 
  24094.  
  24095.  It may take several calls to complete a translation because of accent key 
  24096.  combinations, or other complex operations. 
  24097.  
  24098.  The Xlatestate1 and Xlatestate2 are for use by the keyboard translation 
  24099.  routines.  These fields are reserved and must only be accessed by the caller 
  24100.  prior to starting a translation sequence and then they must be set to zero. 
  24101.  The KbdXlate function is intended to be used for translating a particular scan 
  24102.  code for a given shift state.  The KbdXlate function is not intended to be a 
  24103.  replacement for the OS/2 system keystroke translation function. 
  24104.  
  24105.  
  24106. ΓòÉΓòÉΓòÉ <hidden> KbdCharIn ΓòÉΓòÉΓòÉ
  24107.  
  24108. typedef struct _KBDKEYINFO {   /* kbci */
  24109.   UCHAR    chChar;             /* ASCII character code */
  24110.   UCHAR    chScan;             /* Scan Code */
  24111.   UCHAR    fbStatus;           /* State of the character */
  24112.   UCHAR    bNlsShift;          /* Reserved (set to zero) */
  24113.   USHORT   fsState;            /* State of the shift keys */
  24114.   ULONG    time;               /* Time stamp of keystroke (ms since ipl) */
  24115. }KBDKEYINFO;
  24116.  
  24117. #define INCL_KBD
  24118.  
  24119. USHORT  rc = KbdCharIn(CharData, IOWait, KbdHandle);
  24120.  
  24121. PKBDKEYINFO      CharData;      /* Buffer for data */
  24122. USHORT           IOWait;        /* Indicate if wait */
  24123. HKBD             KbdHandle;     /* Keyboard handle */
  24124.  
  24125. USHORT           rc;            /* return code */
  24126.  
  24127.  
  24128. ΓòÉΓòÉΓòÉ <hidden> KbdClose ΓòÉΓòÉΓòÉ
  24129.  
  24130. #define INCL_KBD
  24131.  
  24132. USHORT  rc = KbdClose(KbdHandle);
  24133.  
  24134. HKBD             KbdHandle;     /* Keyboard handle */
  24135.  
  24136. USHORT           rc;            /* return code */
  24137.  
  24138.  
  24139. ΓòÉΓòÉΓòÉ <hidden> KbdDeRegister ΓòÉΓòÉΓòÉ
  24140.  
  24141. #define INCL_KBD
  24142.  
  24143. USHORT  rc = KbdDeRegister(VOID);
  24144.  
  24145. USHORT           rc;            /* return code */
  24146.  
  24147.  
  24148. ΓòÉΓòÉΓòÉ <hidden> KbdFlushBuffer ΓòÉΓòÉΓòÉ
  24149.  
  24150. #define INCL_KBD
  24151.  
  24152. USHORT  rc = KbdFlushBuffer(KbdHandle);
  24153.  
  24154. HKBD             KbdHandle;     /* Keyboard handle */
  24155.  
  24156. USHORT           rc;            /* return code */
  24157.  
  24158.  
  24159. ΓòÉΓòÉΓòÉ <hidden> KbdFreeFocus ΓòÉΓòÉΓòÉ
  24160.  
  24161. #define INCL_KBD
  24162.  
  24163. USHORT  rc = KbdFreeFocus(KbdHandle);
  24164.  
  24165. HKBD             KbdHandle;     /* Keyboard handle */
  24166.  
  24167. USHORT           rc;            /* return code */
  24168.  
  24169.  
  24170. ΓòÉΓòÉΓòÉ <hidden> KbdGetCp ΓòÉΓòÉΓòÉ
  24171.  
  24172. #define INCL_KBD
  24173.  
  24174. USHORT  rc = KbdGetCp(Reserved, CodePageID, KbdHandle);
  24175.  
  24176. ULONG            Reserved;      /* Reserved (must be zero) */
  24177. PUSHORT          CodePageID;    /* Code Page ID */
  24178. HKBD             KbdHandle;     /* Keyboard handle */
  24179.  
  24180. USHORT           rc;            /* return code */
  24181.  
  24182.  
  24183. ΓòÉΓòÉΓòÉ <hidden> KbdGetFocus ΓòÉΓòÉΓòÉ
  24184.  
  24185. #define INCL_KBD
  24186.  
  24187. USHORT  rc = KbdGetFocus(IOWait, KbdHandle);
  24188.  
  24189. USHORT           IOWait;        /* Indicate if wait */
  24190. HKBD             KbdHandle;     /* Keyboard handle */
  24191.  
  24192. USHORT           rc;            /* return code */
  24193.  
  24194.  
  24195. ΓòÉΓòÉΓòÉ <hidden> KbdGetHWId ΓòÉΓòÉΓòÉ
  24196.  
  24197. typedef struct _KBDHWID {
  24198.   USHORT length;              /* length in bytes of this structure */
  24199.   USHORT kbd_id;              /* attached keyboard's hardware ID
  24200.                                   (returned) */
  24201.   USHORT reserved1;           /* reserved (set to zero) */
  24202.   USHORT reserved2;           /* reserved (set to zero) */
  24203. }KBDHWID;
  24204.  
  24205. #define INCL_KBD
  24206.  
  24207. USHORT  rc = KbdGetHWId(KeyboardID, KbdHandle);
  24208.  
  24209. PKBDHWID         KeyboardID;    /* Keyboard ID structure (returned) */
  24210. HKBD             KbdHandle;     /* Keyboard handle  */
  24211.  
  24212. USHORT           rc;            /* return code */
  24213.  
  24214.  
  24215. ΓòÉΓòÉΓòÉ <hidden> KbdGetStatus ΓòÉΓòÉΓòÉ
  24216.  
  24217. typedef struct _KBDINFO {     /* kbst */
  24218.   USHORT cb;                  /* length in bytes of this structure */
  24219.   USHORT fsMask;              /* bit mask of functions to be altered */
  24220.   USHORT chTurnAround;        /* define TurnAround character */
  24221.   USHORT fsInterim;           /* interim character flags */
  24222.   USHORT fsState;             /* shift states */
  24223. }KBDINFO;
  24224.  
  24225. #define INCL_KBD
  24226.  
  24227. USHORT  rc = KbdGetStatus(Structure, KbdHandle);
  24228.  
  24229. PKBDINFO         Structure;     /* Data structure */
  24230. HKBD             KbdHandle;     /* Keyboard handle */
  24231.  
  24232. USHORT           rc;            /* return code */
  24233.  
  24234.  
  24235. ΓòÉΓòÉΓòÉ <hidden> KbdOpen ΓòÉΓòÉΓòÉ
  24236.  
  24237. #define INCL_KBD
  24238.  
  24239. USHORT  rc = KbdOpen(KbdHandle);
  24240.  
  24241. PHKBD            KbdHandle;     /* Keyboard handle */
  24242.  
  24243. USHORT           rc;            /* return code */
  24244.  
  24245.  
  24246. ΓòÉΓòÉΓòÉ <hidden> KbdPeek ΓòÉΓòÉΓòÉ
  24247.  
  24248. typedef struct _KBDKEYINFO {   /* kbci */
  24249.   UCHAR    chChar;             /* ASCII character code */
  24250.   UCHAR    chScan;             /* Scan Code */
  24251.   UCHAR    fbStatus;           /* State of the character */
  24252.   UCHAR    bNlsShift;          /* Reserved (set to zero) */
  24253.   USHORT   fsState;            /* State of the shift keys */
  24254.   ULONG    time;               /* Time stamp of keystroke (ms since ipl) */
  24255. }KBDKEYINFO;
  24256.  
  24257. #define INCL_KBD
  24258.  
  24259. USHORT  rc = KbdPeek(CharData, KbdHandle);
  24260.  
  24261. PKBDKEYINFO      CharData;      /* Buffer for data */
  24262. HKBD             KbdHandle;     /* Keyboard handle */
  24263.  
  24264. USHORT           rc;            /* return code */
  24265.  
  24266.  
  24267. ΓòÉΓòÉΓòÉ <hidden> KbdRegister ΓòÉΓòÉΓòÉ
  24268.  
  24269. #define INCL_KBD
  24270.  
  24271. USHORT  rc = KbdRegister(ModuleName, EntryPoint, FunctionMask);
  24272.  
  24273. PSZ              ModuleName;    /* Module name */
  24274. PSZ              EntryPoint;    /* Entry point name */
  24275. ULONG            FunctionMask;  /* Function mask */
  24276.  
  24277. USHORT           rc;            /* return code */
  24278.  
  24279.  
  24280. ΓòÉΓòÉΓòÉ <hidden> KbdSetCp ΓòÉΓòÉΓòÉ
  24281.  
  24282. #define INCL_KBD
  24283.  
  24284. USHORT  rc = KbdSetCp(Reserved, CodePageID, KbdHandle);
  24285.  
  24286. USHORT           Reserved;      /* Reserved (must be zero) */
  24287. USHORT           CodePageID;    /* code page ID */
  24288. HKBD             KbdHandle;     /* Keyboard handle */
  24289.  
  24290. USHORT           rc;            /* return code */
  24291.  
  24292.  
  24293. ΓòÉΓòÉΓòÉ <hidden> KbdSetCustXt ΓòÉΓòÉΓòÉ
  24294.  
  24295. #define INCL_KBD
  24296.  
  24297. USHORT  rc = KbdSetCustXt(Xlatetable, KbdHandle);
  24298.  
  24299. PUSHORT          Xlatetable;    /* Translation Table */
  24300. HKBD             KbdHandle;     /* Keyboard handle */
  24301.  
  24302. USHORT           rc;            /* return code */
  24303.  
  24304.  
  24305. ΓòÉΓòÉΓòÉ <hidden> KbdSetFgnd ΓòÉΓòÉΓòÉ
  24306.  
  24307. #define INCL_KBD
  24308.  
  24309. USHORT  rc = KbdSetFgnd(VOID);
  24310.  
  24311. USHORT           rc;            /* return code */
  24312.  
  24313.  
  24314. ΓòÉΓòÉΓòÉ <hidden> KbdSetStatus ΓòÉΓòÉΓòÉ
  24315.  
  24316. typedef struct _KBDINFO {     /* kbst */
  24317.   USHORT cb;                  /* length in bytes of this structure */
  24318.   USHORT fsMask;              /* bit mask of functions to be altered */
  24319.   USHORT chTurnAround;        /* define TurnAround character */
  24320.   USHORT fsInterim;           /* interim character flags */
  24321.   USHORT fsState;             /* shift states */
  24322. }KBDINFO;
  24323.  
  24324. #define INCL_KBD
  24325.  
  24326. USHORT  rc = KbdSetStatus(Structure, KbdHandle);
  24327.  
  24328. PKBDINFO         Structure;     /* Data structure */
  24329. HKBD             KbdHandle;     /* Keyboard Handle */
  24330.  
  24331. USHORT           rc;            /* return code */
  24332.  
  24333.  
  24334. ΓòÉΓòÉΓòÉ <hidden> KbdStringIn ΓòÉΓòÉΓòÉ
  24335.  
  24336. typedef struct _STRINGINBUF {   /* kbsi */
  24337.   USHORT cb;                    /* input buffer length */
  24338.   USHORT cchIn;                 /* received input length */
  24339. } STRINGINBUF;
  24340.  
  24341. #define INCL_KBD
  24342.  
  24343. USHORT  rc = KbdStringIn(CharBuffer, Length, IOWait, KbdHandle);
  24344.  
  24345. PCH              CharBuffer;    /* Char string buffer */
  24346. PSTRINGINBUF     Length;        /* Length table */
  24347. USHORT           IOWait;        /* Indicate if wait for char */
  24348. HKBD             KbdHandle;     /* Keyboard handle */
  24349.  
  24350. USHORT           rc;            /* return code */
  24351.  
  24352.  
  24353. ΓòÉΓòÉΓòÉ <hidden> KbdSynch ΓòÉΓòÉΓòÉ
  24354.  
  24355. #define INCL_KBD
  24356.  
  24357. USHORT  rc = KbdSynch(IOWait);
  24358.  
  24359. USHORT           IOWait;        /* Indicate if wait */
  24360.  
  24361. USHORT           rc;            /* return code */
  24362.  
  24363.  
  24364. ΓòÉΓòÉΓòÉ <hidden> KbdXlate ΓòÉΓòÉΓòÉ
  24365.  
  24366. typedef struct _KBDTRANS {    /* kbxl */
  24367.   UCHAR      chChar;          /* ASCII character code */
  24368.   UCHAR      chScan;          /* Scan code */
  24369.   UCHAR      fbStatus;        /* State of the character */
  24370.   UCHAR      bNlsShift;       /* Shift status (reserved set to zero) */
  24371.   USHORT     fsState;         /* Shift state */
  24372.   ULONG      time;
  24373.   USHORT     fsDD;
  24374.   USHORT     fsXlate;
  24375.   USHORT     fsShift;
  24376.   USHORT     sZero;
  24377. } KBDTRANS;
  24378.  
  24379. #define INCL_KBD
  24380.  
  24381. USHORT  rc = KbdXlate(XlateRecord, KbdHandle);
  24382.  
  24383. PKBDTRANS        XlateRecord;   /* Translation Record */
  24384. HKBD             KbdHandle;     /* Keyboard handle */
  24385.  
  24386. USHORT           rc;            /* return code */
  24387.  
  24388.  
  24389. ΓòÉΓòÉΓòÉ <hidden> KbdCharIn ΓòÉΓòÉΓòÉ
  24390.  
  24391. KBDKEYINFO struc
  24392.   kbci_chChar    db  ? ;ASCII character code
  24393.   kbci_chScan    db  ? ;Scan Code
  24394.   kbci_fbStatus  db  ? ;State of the character
  24395.   kbci_bNlsShift db  ? ;Reserved (set to zero)
  24396.   kbci_fsState   dw  ? ;state of the shift keys
  24397.   kbci_time      dd  ? ;time stamp of keystroke (ms since ipl)
  24398. KBDKEYINFO ends
  24399.  
  24400. EXTRN  KbdCharIn:FAR
  24401. INCL_KBD            EQU 1
  24402.  
  24403. PUSH@  OTHER   CharData      ;Buffer for data
  24404. PUSH   WORD    IOWait        ;Indicate if wait
  24405. PUSH   WORD    KbdHandle     ;Keyboard handle
  24406. CALL   KbdCharIn
  24407.  
  24408. Returns WORD
  24409.  
  24410.  
  24411. ΓòÉΓòÉΓòÉ <hidden> KbdClose ΓòÉΓòÉΓòÉ
  24412.  
  24413. EXTRN  KbdClose:FAR
  24414. INCL_KBD            EQU 1
  24415.  
  24416. PUSH   WORD    KbdHandle     ;Keyboard handle
  24417. CALL   KbdClose
  24418.  
  24419. Returns WORD
  24420.  
  24421.  
  24422. ΓòÉΓòÉΓòÉ <hidden> KbdDeRegister ΓòÉΓòÉΓòÉ
  24423.  
  24424. EXTRN KbdDeRegister:FAR
  24425. INCL_KBD            EQU 1
  24426.  
  24427. CALL   KbdDeRegister
  24428.  
  24429. Returns WORD
  24430.  
  24431.  
  24432. ΓòÉΓòÉΓòÉ <hidden> KbdFlushBuffer ΓòÉΓòÉΓòÉ
  24433.  
  24434. EXTRN  KbdFlushBuffer:FAR
  24435. INCL_KBD            EQU 1
  24436.  
  24437. PUSH   WORD    KbdHandle     ;Keyboard handle
  24438. CALL   KbdFlushBuffer
  24439.  
  24440. Returns WORD
  24441.  
  24442.  
  24443. ΓòÉΓòÉΓòÉ <hidden> KbdFreeFocus ΓòÉΓòÉΓòÉ
  24444.  
  24445. EXTRN  KbdFreeFocus:FAR
  24446. INCL_KBD            EQU 1
  24447.  
  24448. PUSH   WORD    KbdHandle     ;Keyboard handle
  24449. CALL   KbdFreeFocus
  24450.  
  24451. Returns WORD
  24452.  
  24453.  
  24454. ΓòÉΓòÉΓòÉ <hidden> KbdGetCp ΓòÉΓòÉΓòÉ
  24455.  
  24456. EXTRN  KbdGetCp:FAR
  24457. INCL_KBD            EQU 1
  24458.  
  24459. PUSH   DWORD   Reserved      ;Reserved (must be zero)
  24460. PUSH@  WORD    CodePageID    ;Code Page ID
  24461. PUSH   WORD    KbdHandle     ;Keyboard handle
  24462. CALL   KbdGetCp
  24463.  
  24464. Returns WORD
  24465.  
  24466.  
  24467. ΓòÉΓòÉΓòÉ <hidden> KbdGetFocus ΓòÉΓòÉΓòÉ
  24468.  
  24469. EXTRN  KbdGetFocus:FAR
  24470. INCL_KBD            EQU 1
  24471.  
  24472. PUSH   WORD    IOWait        ;Indicate if wait
  24473. PUSH   WORD    KbdHandle     ;Keyboard handle
  24474. CALL   KbdGetFocus
  24475.  
  24476. Returns WORD
  24477.  
  24478.  
  24479. ΓòÉΓòÉΓòÉ <hidden> KbdGetHWId ΓòÉΓòÉΓòÉ
  24480.  
  24481. KBDHWID struc
  24482.   length;             dw  ? ;length in bytes of this structure
  24483.   kbd_id;             dw  ? ;attached keyboard's hardware ID (returned)
  24484.   reserved1;          dw  ? ;reserved (set to zero)
  24485.   reserved2;          dw  ? ;reserved (set to zero)
  24486. KBDHWID ends
  24487.  
  24488. EXTRN KbdGetHWId:FAR
  24489. INCL_KBD            EQU 1
  24490.  
  24491. PUSH@ OTHER  KeyboardID      ;Keyboard ID structure (returned)
  24492. PUSH  WORD   KbdHandle       ;Keyboard handle
  24493. CALL  KbdGetHWId
  24494.  
  24495. Returns WORD
  24496.  
  24497.  
  24498. ΓòÉΓòÉΓòÉ <hidden> KbdGetStatus ΓòÉΓòÉΓòÉ
  24499.  
  24500. KBDINFO struc
  24501.   kbst_cb           dw  ? ;length in bytes of this structure
  24502.   kbst_fsMask       dw  ? ;bit mask of functions to be altered
  24503.   kbst_chTurnAround dw  ? ;define TurnAround character
  24504.   kbst_fsInterim    dw  ? ;interim character flags
  24505.   kbst_fsState      dw  ? ;shift states
  24506. KBDINFO ends
  24507.  
  24508. EXTRN  KbdGetStatus:FAR
  24509. INCL_KBD            EQU 1
  24510.  
  24511. PUSH@  OTHER   Structure     ;Data structure
  24512. PUSH   WORD    KbdHandle     ;Keyboard handle
  24513. CALL   KbdGetStatus
  24514.  
  24515. Returns WORD
  24516.  
  24517.  
  24518. ΓòÉΓòÉΓòÉ <hidden> KbdOpen ΓòÉΓòÉΓòÉ
  24519.  
  24520. EXTRN  KbdOpen:FAR
  24521. INCL_KBD            EQU 1
  24522.  
  24523. PUSH@  WORD    KbdHandle     ;Keyboard handle
  24524. CALL   KbdOpen
  24525.  
  24526. Returns WORD
  24527.  
  24528.  
  24529. ΓòÉΓòÉΓòÉ <hidden> KbdPeek ΓòÉΓòÉΓòÉ
  24530.  
  24531. KBDKEYINFO struc
  24532.   kbci_chChar    db  ? ;ASCII character code
  24533.   kbci_chScan    db  ? ;Scan Code
  24534.   kbci_fbStatus  db  ? ;State of the character
  24535.   kbci_bNlsShift db  ? ;Reserved (set to zero)
  24536.   kbci_fsState   dw  ? ;state of the shift keys
  24537.   kbci_time      dd  ? ;time stamp of keystroke (ms since ipl)
  24538. KBDKEYINFO ends
  24539.  
  24540. EXTRN  KbdPeek:FAR
  24541. INCL_KBD            EQU 1
  24542.  
  24543. PUSH@  OTHER   CharData      ;Buffer for data
  24544. PUSH   WORD    KbdHandle     ;Keyboard handle
  24545. CALL   KbdPeek
  24546.  
  24547. Returns WORD
  24548.  
  24549.  
  24550. ΓòÉΓòÉΓòÉ <hidden> KbdRegister ΓòÉΓòÉΓòÉ
  24551.  
  24552. EXTRN  KbdRegister:FAR
  24553. INCL_KBD            EQU 1
  24554.  
  24555. PUSH@  ASCIIZ  ModuleName    ;Module name
  24556. PUSH@  ASCIIZ  EntryPoint    ;Entry point name
  24557. PUSH   DWORD   FunctionMask  ;Function mask
  24558. CALL   KbdRegister
  24559.  
  24560. Returns WORD
  24561.  
  24562.  
  24563. ΓòÉΓòÉΓòÉ <hidden> KbdSetCp ΓòÉΓòÉΓòÉ
  24564.  
  24565. EXTRN  KbdSetCp:FAR
  24566. INCL_KBD            EQU 1
  24567.  
  24568. PUSH   WORD    Reserved      ;Reserved (must be zero)
  24569. PUSH   WORD    CodePageID    ;code page ID
  24570. PUSH   WORD    KbdHandle     ;Keyboard handle
  24571. CALL   KbdSetCp
  24572.  
  24573. Returns WORD
  24574.  
  24575.  
  24576. ΓòÉΓòÉΓòÉ <hidden> KbdSetCustXt ΓòÉΓòÉΓòÉ
  24577.  
  24578. EXTRN  KbdSetCustXt:FAR
  24579. INCL_KBD            EQU 1
  24580.  
  24581. PUSH@  WORD    CodePage      ;Translation Table
  24582. PUSH   WORD    KbdHandle     ;Keyboard handle
  24583. CALL   KbdSetCustXt
  24584.  
  24585. Returns WORD
  24586.  
  24587.  
  24588. ΓòÉΓòÉΓòÉ <hidden> KbdSetFgnd ΓòÉΓòÉΓòÉ
  24589.  
  24590. EXTRN  KbdSetFgnd:FAR
  24591. INCL_KBD            EQU 1
  24592.  
  24593. CALL   KbdSetFgnd
  24594.  
  24595. Returns WORD
  24596.  
  24597.  
  24598. ΓòÉΓòÉΓòÉ <hidden> KbdSetStatus ΓòÉΓòÉΓòÉ
  24599.  
  24600. KBDINFO struc
  24601.   kbst_cb           dw  ? ;length in bytes of this structure
  24602.   kbst_fsMask       dw  ? ;bit mask of functions to be altered
  24603.   kbst_chTurnAround dw  ? ;define TurnAround character
  24604.   kbst_fsInterim    dw  ? ;interim character flags
  24605.   kbst_fsState      dw  ? ;shift states
  24606. KBDINFO ends
  24607.  
  24608. EXTRN  KbdSetStatus:FAR
  24609. INCL_KBD            EQU 1
  24610.  
  24611. PUSH@  OTHER   Structure     ;Data structure
  24612. PUSH   WORD    KbdHandle     ;Keyboard Handle
  24613. CALL   KbdSetStatus
  24614.  
  24615. Returns WORD
  24616.  
  24617.  
  24618. ΓòÉΓòÉΓòÉ <hidden> KbdStringIn ΓòÉΓòÉΓòÉ
  24619.  
  24620. STRINGINBUF struc
  24621.   kbsi_cb    dw  ? ;input buffer length
  24622.   kbsi_cchIn dw  ? ;received input length
  24623. STRINGINBUF ends
  24624.  
  24625. EXTRN  KbdStringIn:FAR
  24626. INCL_KBD            EQU 1
  24627.  
  24628. PUSH@  OTHER   CharBuffer    ;Char string buffer
  24629. PUSH@  OTHER   Length        ;Length table
  24630. PUSH   WORD    IOWait        ;Indicate if wait for char
  24631. PUSH   WORD    KbdHandle     ;Keyboard handle
  24632. CALL   KbdStringIn
  24633.  
  24634. Returns WORD
  24635.  
  24636.  
  24637. ΓòÉΓòÉΓòÉ <hidden> KbdSynch ΓòÉΓòÉΓòÉ
  24638.  
  24639. EXTRN  KbdSynch:FAR
  24640. INCL_KBD            EQU 1
  24641.  
  24642. PUSH   WORD    IOWait        ;Indicate if wait
  24643. CALL   KbdSynch
  24644.  
  24645. Returns WORD
  24646.  
  24647.  
  24648. ΓòÉΓòÉΓòÉ <hidden> KbdXlate ΓòÉΓòÉΓòÉ
  24649.  
  24650. KBDTRANS struc
  24651.   kbxl_chChar    db  ? ;ASCII character code
  24652.   kbxl_chScan    db  ? ;scan code
  24653.   kbxl_fbStatus  db  ? ;State of the character
  24654.   kbxl_bNlsShift db  ? ;shift status (reserved set to zero)
  24655.   kbxl_fsState   dw  ? ;shift state
  24656.   kbxl_time      dd  ?
  24657.   kbxl_fsDD      dw  ?
  24658.   kbxl_fsXlate   dw  ?
  24659.   kbxl_fsShift   dw  ?
  24660.   kbxl_sZero     dw  ?
  24661. KBDTRANS ends
  24662.  
  24663. EXTRN  KbdXlate:FAR
  24664. INCL_KBD            EQU 1
  24665.  
  24666. PUSH@  OTHER   XlateRecord   ;Translation Record
  24667. PUSH   WORD    KbdHandle     ;Keyboard handle
  24668. CALL   KbdXlate
  24669.  
  24670. Returns WORD
  24671.  
  24672.  
  24673. ΓòÉΓòÉΓòÉ 3. Mouse Function Calls ΓòÉΓòÉΓòÉ
  24674.  
  24675. This section reflects the Mouse API interface of OS/2 only. 
  24676.  
  24677. For information regarding mouse device drivers, mouse pointer draw device, 
  24678. mouse installation and mouse IOCTLs, refer to IBM Operating System/2 Version 
  24679. 1.2 I/O Subsystems And Device Support Volume 1. 
  24680.  
  24681. Notes: 
  24682.  
  24683.   1. Calls marked xPM are not supported by Presentation Manager, and must not 
  24684.      be used by Presentation Manager applications.  An error code is returned 
  24685.      if any of these calls are issued. 
  24686.  
  24687.   2. Calls marked xWPM are not windowable and are not supported by Presentation 
  24688.      Manager. They can be used in OS/2 mode. 
  24689.  
  24690.   3. Calls marked FAPI are present in the Family API. 
  24691.  
  24692.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  24693.         Γöé   FUNCTION CALL          ICON    Γöé
  24694.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24695.         Γöé   MouClose               xPM     Γöé
  24696.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24697.         Γöé   MouDeRegister          xWPM    Γöé
  24698.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé
  24699.         Γöé   MouDrawPtr             xPM     Γöé
  24700.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24701.         Γöé   MouFlushQue            xPM     Γöé
  24702.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24703.         Γöé   MouGetDevStatus        xPM     Γöé
  24704.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24705.         Γöé   MouGetEventMask        xPM     Γöé
  24706.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24707.         Γöé   MouGetNumButtons       xPM     Γöé
  24708.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24709.         Γöé   MouGetNumMickeys       xPM     Γöé
  24710.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24711.         Γöé   MouGetNumQueEl         xPM     Γöé
  24712.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24713.         Γöé   MouGetPtrPos           xPM     Γöé
  24714.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24715.         Γöé   MouGetPtrShape         xPM     Γöé
  24716.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24717.         Γöé   MouGetScaleFact        xPM     Γöé
  24718.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24719.         Γöé   MouInitReal            xWPM    Γöé
  24720.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24721.         Γöé   MouOpen                xPM     Γöé
  24722.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24723.         Γöé   MouReadEventQue        xPM     Γöé
  24724.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24725.         Γöé   MouRegister            xWPM    Γöé
  24726.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24727.         Γöé   MouRemovePtr           xPM     Γöé
  24728.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24729.         Γöé   MouSetDevStatus        xPM     Γöé
  24730.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24731.         Γöé   MouSetEventMask        xPM     Γöé
  24732.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24733.         Γöé   MouSetPtrPos           xPM     Γöé
  24734.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24735.         Γöé   MouSetPtrShape         xPM     Γöé
  24736.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24737.         Γöé   MouSetScaleFact        xPM     Γöé
  24738.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  24739.         Γöé   MouSynch               xWPM    Γöé
  24740.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  24741.  
  24742.  
  24743. ΓòÉΓòÉΓòÉ 3.1. MouClose ΓòÉΓòÉΓòÉ
  24744.  
  24745.                                Bindings:  C, MASM
  24746.  
  24747. This call closes the mouse device for the current session. 
  24748.  
  24749.  MouClose    (DeviceHandle) 
  24750.  
  24751.  DeviceHandle (HMOU) - input 
  24752.     Mouse device handle from a previous MouOpen. 
  24753.  
  24754.  rc (USHORT) - return 
  24755.     Return code descriptions are: 
  24756.  
  24757.     0         NO_ERROR 
  24758.     385       ERROR_MOUSE_NO_DEVICE 
  24759.     466       ERROR_MOU_DETACHED 
  24760.     501       ERROR_MOUSE_NO_CONSOLE 
  24761.     505       ERROR_MOU_EXTENDED_SG 
  24762.  
  24763.  Remarks 
  24764.  
  24765.  MouClose closes the mouse device for the current session and removes the mouse 
  24766.  device driver handle from the list of valid open mouse device handles. 
  24767.  
  24768.  
  24769. ΓòÉΓòÉΓòÉ 3.2. MouDeRegister ΓòÉΓòÉΓòÉ
  24770.  
  24771.                                Bindings:  C, MASM
  24772.  
  24773. This call deregisters a mouse subsystem previously registered within a session. 
  24774.  
  24775.  MouDeRegister    ( ) 
  24776.  
  24777.  rc (USHORT) - return 
  24778.     Return code descriptions are: 
  24779.  
  24780.     0         NO_ERROR 
  24781.     385       ERROR_MOUSE_NO_DEVICE 
  24782.     416       ERROR_MOUSE_DEREGISTER 
  24783.     466       ERROR_MOU_DETACHED 
  24784.     505       ERROR_MOU_EXTENDED_SG 
  24785.  
  24786.  Remarks 
  24787.  
  24788.  Processes issuing MouDeRegister calls must conform to the following rules: 
  24789.  
  24790.  o The process that issued the MouRegister must release the session (by a 
  24791.    MouDeRegister) from the registered subsystem before another PID may issue 
  24792.    MouRegister. 
  24793.  
  24794.  o The process that issued the MouRegister is the only process that may issue 
  24795.    MouDeRegister against the currently registered subsystem. 
  24796.  
  24797.  o After the owning process has released the subsystem with a MouDeRegister, 
  24798.    any other process in the session may issue a MouRegister and therefore 
  24799.    modify the mouse support for the entire session. 
  24800.  
  24801.  
  24802. ΓòÉΓòÉΓòÉ 3.3. MouDrawPtr ΓòÉΓòÉΓòÉ
  24803.  
  24804.                                Bindings:  C, MASM
  24805.  
  24806. This call allows a process to notify the mouse device driver that an area 
  24807. previously restricted to the pointer image is now available to the mouse device 
  24808. driver. 
  24809.  
  24810.  MouDrawPtr  (DeviceHandle) 
  24811.  
  24812.  DeviceHandle (HMOU) - input 
  24813.     Mouse device handle from a previous MouOpen. 
  24814.  
  24815.  rc (USHORT) - return 
  24816.     Return code descriptions are: 
  24817.  
  24818.     0         NO_ERROR 
  24819.     385       ERROR_MOUSE_NO_DEVICE 
  24820.     466       ERROR_MOU_DETACHED 
  24821.     501       ERROR_MOUSE_NO_CONSOLE 
  24822.     505       ERROR_MOU_EXTENDED_SG 
  24823.  
  24824.  Remarks 
  24825.  
  24826.  The collision area (the pointer image restricted area) is established by 
  24827.  MouOpen and by MouRemovePtr. MouDrawPtr nullifies the effect of the 
  24828.  MouRemovePtr command. If there was no previous MouDrawPtr command or if a 
  24829.  previous  MouDrawPtr command has already nullified the collision area, the 
  24830.  MouRemovePtr command is effectively a null operation. 
  24831.  
  24832.  This call is required to begin session pointer image drawing. Immediately 
  24833.  after MouOpen is issued, the collision area is defined as the size of the 
  24834.  display. A MouDrawPtr is issued to begin pointer drawing after the  MouOpen. 
  24835.  
  24836.  
  24837. ΓòÉΓòÉΓòÉ 3.4. MouFlushQue ΓòÉΓòÉΓòÉ
  24838.  
  24839.                                Bindings:  C, MASM
  24840.  
  24841. This call directs the mouse driver to flush (empty) the mouse event queue and 
  24842. the monitor chain data for the session. 
  24843.  
  24844.  MouFlushQue     (DeviceHandle) 
  24845.  
  24846.  DeviceHandle (HMOU) - input 
  24847.     Mouse device handle from a previous MouOpen. 
  24848.  
  24849.  rc (USHORT) - return 
  24850.     Return code descriptions are: 
  24851.  
  24852.     0         NO_ERROR 
  24853.     385       ERROR_MOUSE_NO_DEVICE 
  24854.     466       ERROR_MOU_DETACHED 
  24855.     501       ERROR_MOUSE_NO_CONSOLE 
  24856.     505       ERROR_MOU_EXTENDED_SG 
  24857.  
  24858.  
  24859. ΓòÉΓòÉΓòÉ 3.5. MouGetDevStatus ΓòÉΓòÉΓòÉ
  24860.  
  24861.                                Bindings:  C, MASM
  24862.  
  24863. This call returns status flags for the installed mouse device driver. 
  24864.  
  24865.  MouGetDevStatus     (DeviceStatus, DeviceHandle) 
  24866.  
  24867.  DeviceStatus (PUSHORT) - output 
  24868.     Address of the current status flag settings for the installed mouse device 
  24869.     driver. 
  24870.  
  24871.     The return value is a 2-byte set of bit flags. 
  24872.  
  24873.     Bit       Description 
  24874.     15-10     Reserved, set to zero. 
  24875.     9         Set if mouse data returned in mickeys, not pels. 
  24876.     8         Set if the drawing operations for pointer draw routine are 
  24877.               disabled. 
  24878.     7-4       Reserved, set to zero. 
  24879.     3         Set if pointer draw routine disabled by unsupported mode. 
  24880.     2         Set if flush in progress. 
  24881.     1         Set if block read in progress. 
  24882.     0         Set if event queue busy with I/O. 
  24883.  
  24884.  DeviceHandle (HMOU) - input 
  24885.     Mouse device handle from a previous MouOpen. 
  24886.  
  24887.  rc (USHORT) - return 
  24888.     Return code descriptions are: 
  24889.  
  24890.     0         NO_ERROR 
  24891.     385       ERROR_MOUSE_NO_DEVICE 
  24892.     466       ERROR_MOU_DETACHED 
  24893.     501       ERROR_MOUSE_NO_CONSOLE 
  24894.     505       ERROR_MOU_EXTENDED_SG 
  24895.  
  24896.  
  24897. ΓòÉΓòÉΓòÉ 3.6. MouGetEventMask ΓòÉΓòÉΓòÉ
  24898.  
  24899.                                Bindings:  C, MASM
  24900.  
  24901. This call returns the current value of the mouse event queue mask. 
  24902.  
  24903.  MouGetEventMask    (EventMask, DeviceHandle) 
  24904.  
  24905.  EventMask (PUSHORT) - output 
  24906.     Address in application storage where the current mouse device driver's 
  24907.     event mask is returned to the caller by the mouse device driver. 
  24908.  
  24909.     The EventMask is set by MouSetEventMask, and has the following definition: 
  24910.  
  24911.     Bit       Description 
  24912.     15-7      Reserved, set to zero. 
  24913.     6         Set to report button 3 press/release events, without mouse 
  24914.               motion. 
  24915.     5         Set to report button 3 press/release events, with mouse motion. 
  24916.     4         Set to report button 2 press/release events, without mouse 
  24917.               motion. 
  24918.     3         Set to report button 2 press/release events, with mouse motion. 
  24919.     2         Set to report button 1 press/release events, without mouse 
  24920.               motion. 
  24921.     1         Set to report button 1 press/release events, with mouse motion. 
  24922.     0         Set to report mouse motion events with no button press/release 
  24923.               events. 
  24924.  
  24925.  DeviceHandle (HMOU) - input 
  24926.     Handle of the mouse device from a previous MouOpen. 
  24927.  
  24928.  rc (USHORT) - return 
  24929.     Return code descriptions are: 
  24930.  
  24931.     0         NO_ERROR 
  24932.     385       ERROR_MOUSE_NO_DEVICE 
  24933.     466       ERROR_MOU_DETACHED 
  24934.     501       ERROR_MOUSE_NO_CONSOLE 
  24935.     505       ERROR_MOU_EXTENDED_SG 
  24936.  
  24937.  Remarks 
  24938.  
  24939.  Buttons are logically numbered from left to right. 
  24940.  
  24941.  
  24942. ΓòÉΓòÉΓòÉ 3.7. MouGetNumButtons ΓòÉΓòÉΓòÉ
  24943.  
  24944.                                Bindings:  C, MASM
  24945.  
  24946. This call returns the number of buttons supported on the installed mouse 
  24947. driver. 
  24948.  
  24949.  MouGetNumButtons     (NumberOfButtons, DeviceHandle) 
  24950.  
  24951.  NumberOfButtons (PUSHORT) - output 
  24952.     Address of the number of physical buttons. The return values for the number 
  24953.     of buttons supported are: 
  24954.  
  24955.     Value     Definition 
  24956.     1         One mouse button 
  24957.     2         Two mouse buttons 
  24958.     3         Three mouse buttons. 
  24959.  
  24960.  DeviceHandle (HMOU) - input 
  24961.     Handle of the mouse device from a previous MouOpen. 
  24962.  
  24963.  rc (USHORT) - return 
  24964.     Return code descriptions are: 
  24965.  
  24966.     385       ERROR_MOUSE_NO_DEVICE 
  24967.     466       ERROR_MOU_DETACHED 
  24968.     501       ERROR_MOUSE_NO_CONSOLE 
  24969.     505       ERROR_MOU_EXTENDED_SG 
  24970.  
  24971.  
  24972. ΓòÉΓòÉΓòÉ 3.8. MouGetNumMickeys ΓòÉΓòÉΓòÉ
  24973.  
  24974.                                Bindings:  C, MASM
  24975.  
  24976. This call returns the number of mickeys in each centimeter for the installed 
  24977. mouse driver. 
  24978.  
  24979.  MouGetNumMickeys     (NumberOfMickeys, DeviceHandle) 
  24980.  
  24981.  NumberOfMickeys (PUSHORT) - output 
  24982.     Address of the number of physical mouse motion units. Mouse motion units 
  24983.     are reported in mickeys in each centimeter. This value is constant based 
  24984.     upon the mouse device attached. 
  24985.  
  24986.  DeviceHandle (HMOU) - input 
  24987.     Handle of the mouse device from a previous MouOpen. 
  24988.  
  24989.  rc (USHORT) - return 
  24990.     Return code descriptions are: 
  24991.  
  24992.     0         NO_ERROR 
  24993.     385       ERROR_MOUSE_NO_DEVICE 
  24994.     466       ERROR_MOU_DETACHED 
  24995.     501       ERROR_MOUSE_NO_CONSOLE 
  24996.     505       ERROR_MOU_EXTENDED_SG 
  24997.  
  24998.  
  24999. ΓòÉΓòÉΓòÉ 3.9. MouGetNumQueEl ΓòÉΓòÉΓòÉ
  25000.  
  25001.                                Bindings:  C, MASM
  25002.  
  25003. This call returns the current status for the mouse device driver event queue. 
  25004.  
  25005.  MouGetNumQueEl    (QueDataRecord, DeviceHandle) 
  25006.  
  25007.  QueDataRecord (PMOUQUEINFO) - output 
  25008.     Address of the mouse queue status structure: 
  25009.  
  25010.     numqelements (USHORT) 
  25011.        Current number of event queue elements, in the range 0 <> value <> 
  25012.        maxnumqelements. 
  25013.  
  25014.     maxnumqelements (USHORT) 
  25015.        Maximum number of queue elements as specified in the QSIZE = NN 
  25016.        parameter in DEVICE=MOUSExxx.SYS statement in CONFIG.SYS. 
  25017.  
  25018.  DeviceHandle (HMOU) - input 
  25019.     Contains the handle of the mouse device obtained from a previous MouOpen. 
  25020.  
  25021.  rc (USHORT) - return 
  25022.     Return code descriptions are: 
  25023.  
  25024.     0         NO_ERROR 
  25025.     385       ERROR_MOUSE_NO_DEVICE 
  25026.     466       ERROR_MOU_DETACHED 
  25027.     501       ERROR_MOUSE_NO_CONSOLE 
  25028.     505       ERROR_MOU_EXTENDED_SG 
  25029.  
  25030.  Remarks 
  25031.  
  25032.  The maxnumqelements returned by this function is established during mouse 
  25033.  device driver configuration.  See the mouse DEVICE=MOUSExxx.SYS statement in 
  25034.  the IBM Operating System/2 Version 1.2 Command Reference for further details. 
  25035.  
  25036.  
  25037. ΓòÉΓòÉΓòÉ 3.10. MouGetPtrPos ΓòÉΓòÉΓòÉ
  25038.  
  25039.                                Bindings:  C, MASM
  25040.  
  25041. This call queries the mouse driver to determine the current row and column 
  25042. coordinate position of the mouse pointer. 
  25043.  
  25044.  MouGetPtrPos    (PtrPos, DeviceHandle) 
  25045.  
  25046.  PtrPos (PPTRLOC) - output 
  25047.     Address of the mouse pointer position structure: 
  25048.  
  25049.     pointerrow (USHORT) 
  25050.        Current pointer row coordinate (pels or characters). 
  25051.  
  25052.     pointercol (USHORT) 
  25053.        Current pointer column coordinate (pels or characters). 
  25054.  
  25055.  DeviceHandle (HMOU) - input 
  25056.     Contains the handle of the mouse device obtained from a previous MouOpen. 
  25057.  
  25058.  rc (USHORT) - return 
  25059.     Return code descriptions are: 
  25060.  
  25061.     0         NO_ERROR 
  25062.     385       ERROR_MOUSE_NO_DEVICE 
  25063.     466       ERROR_MOU_DETACHED 
  25064.     501       ERROR_MOUSE_NO_CONSOLE 
  25065.     505       ERROR_MOU_EXTENDED_SG 
  25066.  
  25067.  Remarks 
  25068.  
  25069.  For a text window (VIO) application, the text window is a view on the larger 
  25070.  logical video buffer (LVB).  The mouse pointer can be outside that view and 
  25071.  still be within the extent of the LVB.  MouGetPtrPos then returns the 
  25072.  coordinates of the cell under the mouse pointer. If the pointer is outside the 
  25073.  LVB image extent, the coordinates of the nearest LVB cell are returned. In 
  25074.  either case, the LVB is scrolled until the reported LVB cell appears within 
  25075.  the view window. 
  25076.  
  25077.  
  25078. ΓòÉΓòÉΓòÉ 3.11. MouGetPtrShape ΓòÉΓòÉΓòÉ
  25079.  
  25080.                                Bindings:  C, MASM
  25081.  
  25082. This call allows a process to get (copy) the pointer shape for the session. 
  25083.  
  25084.  MouGetPtrShape    (PtrBuffer, PtrDefRec, DeviceHandle) 
  25085.  
  25086.  PtrBuffer (PBYTE) - output 
  25087.     Address of an area in application storage where the pointer draw device 
  25088.     driver returns the pointer bit image.  See MouSetPtrShape for a further 
  25089.     description of the resulting content of this buffer. 
  25090.  
  25091.  PtrDefRec (PPTRSHAPE) - input/output 
  25092.     Address of a structure in application storage where the application stores 
  25093.     the data necessary for the pointer device driver to return information 
  25094.     about the Row by Col image for each bit plane for the mode the display is 
  25095.     currently running.  See MouSetPtrShape for a further description of the 
  25096.     contents of this structure. 
  25097.  
  25098.     TotLength (USHORT) 
  25099.        Length of the pointer buffer available for the pointer device driver to 
  25100.        build a Row by Col image for each bit plane for the mode the display is 
  25101.        currently running. This value is supplied by the application.  If the 
  25102.        value is too small, pointer draw places the true length of the image in 
  25103.        this field, and returns an error. 
  25104.  
  25105.        For all OS/2 system-supported modes, TotLength is specified in bytes and 
  25106.        is 
  25107.        equal to: 
  25108.  
  25109.        Mono & Text Modes 
  25110.                  For text mode height and width must be 1, so length is always 
  25111.                  4. 
  25112.  
  25113.                                   TotLength = (height in chars) * (width in chars) * 2 * 2
  25114.                                             = 1 * 1 * 2 * 2
  25115.                                             = 4
  25116.  
  25117.        Graphics Mode 
  25118.                  Width-in-pels must be a multiple of 8. 
  25119.  
  25120.                                   TotLength = (height in pels)*(width in pels)*(bits per pel)*2/8
  25121.  
  25122.        Modes 4 and 5 (320 X 200) 
  25123.  
  25124.                                   TotLength = (height) * (width) * 2 * 2 / 8
  25125.  
  25126.        Mode 6 (640 X 200) 
  25127.  
  25128.                                   TotLength = (height) * (width) * 1 * 2 / 8
  25129.  
  25130.                  Length calculations produce byte boundary buffer sizes. 
  25131.  
  25132.     col (USHORT) 
  25133.        Number of columns in the mouse shape. In graphics modes, this field 
  25134.        contains the pel width (columns) of the mouse shape for the session and 
  25135.        must be greater than or equal to 1. In text modes, col must equal 1. 
  25136.  
  25137.     row (USHORT) 
  25138.        Number of rows in the mouse shape. In graphics modes, this field 
  25139.        contains the pel height (rows) of the mouse shape for the session and 
  25140.        must be greater than or equal to 1. In text modes, row must equal 1. 
  25141.  
  25142.     coloffset (USHORT) 
  25143.        This value is returned by the mouse device driver to indicate the 
  25144.        relative column offset within the pointer image.  The value defines the 
  25145.        center (hotspot) of the pointer image. This value is a signed number 
  25146.        that represents either character or pel offset, depending on the display 
  25147.        mode. 
  25148.  
  25149.     rowoffset (USHORT) 
  25150.        This value is returned by the mouse device driver to indicate the 
  25151.        relative row offset within the pointer image.  The value defines the 
  25152.        center (hotspot) of the pointer image. This value is a signed number 
  25153.        that represents either character or pel offset, depending on the display 
  25154.        mode. 
  25155.  
  25156.  DeviceHandle (HMOU) - input 
  25157.     Handle of the mouse device from a previous MouOpen. 
  25158.  
  25159.  rc (USHORT) - return 
  25160.     Return code descriptions are: 
  25161.  
  25162.     0         NO_ERROR 
  25163.     385       ERROR_MOUSE_NO_DEVICE 
  25164.     387       ERROR_MOUSE_INV_PARMS 
  25165.     466       ERROR_MOU_DETACHED 
  25166.     501       ERROR_MOUSE_NO_CONSOLE 
  25167.     505       ERROR_MOU_EXTENDED_SG 
  25168.  
  25169.  Remarks 
  25170.  
  25171.  The application passes a parameter list with the same meaning as defined for 
  25172.  MouSetPtrShape to the mouse device driver.  The mouse device driver copies the 
  25173.  parameters that describe the pointer shape and attributes into the pointer 
  25174.  definition control block pointed to by the PtrDefRec parameter.  The word 0 
  25175.  (buffer length = TotLength) pointer definition record parameter field must 
  25176.  contain the size in bytes of the application buffer where the device driver is 
  25177.  to insert the sessions pointer image.  All other words in the parameter list 
  25178.  are returned to the application by MouGetPtrShape. 
  25179.  
  25180.  If the buffer size is insufficient, the TotLength field contains the actual 
  25181.  size in bytes of the returned pointer image. 
  25182.  
  25183.  The pointer shape may be set by the application with MouSetPtrShape or may be 
  25184.  the default image provided by the installed Pointer Device Driver. 
  25185.  
  25186.  
  25187. ΓòÉΓòÉΓòÉ 3.12. MouGetScaleFact ΓòÉΓòÉΓòÉ
  25188.  
  25189.                                Bindings:  C, MASM
  25190.  
  25191. This call returns a pair of 1-word scaling factors for the current mouse 
  25192. device. 
  25193.  
  25194.  MouGetScaleFact    (ScaleStruct, DeviceHandle) 
  25195.  
  25196.  ScaleStruct (PSCALEFACT) - output 
  25197.     Address of the control block structure that contains the current row and 
  25198.     column coordinate scaling factors.  The scaling factors must be greater 
  25199.     than or equal to 1 
  25200.     and less than or equal to (32K - 1). 
  25201.  
  25202.     rowscale (USHORT) 
  25203.        Row scaling factor. 
  25204.  
  25205.     colscale (USHORT) 
  25206.        Column scaling factor. 
  25207.  
  25208.        See MouSetScaleFact for more information. 
  25209.  
  25210.  DeviceHandle (HMOU) - input 
  25211.     Contains the handle of the mouse device obtained from a previous MouOpen. 
  25212.  
  25213.  rc (USHORT) - return 
  25214.     Return code descriptions are: 
  25215.  
  25216.     0         NO_ERROR 
  25217.     385       ERROR_MOUSE_NO_DEVICE 
  25218.     466       ERROR_MOU_DETACHED 
  25219.     501       ERROR_MOUSE_NO_CONSOLE 
  25220.     505       ERROR_MOU_EXTENDED_SG 
  25221.  
  25222.  Remarks 
  25223.  
  25224.  The units of the scale factor depend on the mode of the display screen for the 
  25225.  session.  If the screen is operating in text mode, the scaling units are 
  25226.  relative to characters. If the screen is operating in graphics mode, the 
  25227.  scaling units are relative to pels. 
  25228.  
  25229.  
  25230. ΓòÉΓòÉΓòÉ 3.13. MouInitReal ΓòÉΓòÉΓòÉ
  25231.  
  25232.                                Bindings:  C, MASM
  25233.  
  25234. This call initializes mouse pointer draw support for DOS mode. 
  25235.  
  25236.  MouInitReal   (DriverName) 
  25237.  
  25238.  DriverName (PSZ) - input 
  25239.     Address of the name of the Pointer Draw Device Driver used as the 
  25240.     pointer-image drawing routine for the DOS mode session. 
  25241.  
  25242.     The name of the device driver must be included in the CONFIG.SYS file at 
  25243.     system start-up time. 
  25244.  
  25245.     If the selector portion of the far address is zero and the offset portion 
  25246.     is non-zero, the offset portion identifies the power-up display 
  25247.     configuration. 
  25248.  
  25249.  rc (USHORT) - return 
  25250.     Return code descriptions are: 
  25251.  
  25252.     0         NO_ERROR 
  25253.     385       ERROR_MOUSE_NO_DEVICE 
  25254.     466       ERROR_MOU_DETACHED 
  25255.     412       ERROR_MOUSE_SMG_ONLY 
  25256.     501       ERROR_MOUSE_NO_CONSOLE 
  25257.     505       ERROR_MOU_EXTENDED_SG 
  25258.  
  25259.  Remarks 
  25260.  
  25261.  MouInitReal is issued by the Base Video Subsystem at system initialization 
  25262.  time. 
  25263.  
  25264.  The DOS mode mouse API (INT 33H), in contrast to the OS/2 mode Mouse API, does 
  25265.  not contain an OPEN command. In addition, there is only one session for DOS 
  25266.  mode. 
  25267.  
  25268.  The default pointer draw routine for DOS mode is located in the same pointer 
  25269.  draw device driver, POINTER$, that is used for OS/2 mode.  Establishing 
  25270.  addressability to the pointer draw routine must be done during system 
  25271.  initialization.  This requires passing the entry point of the DOS mode pointer 
  25272.  draw routine to the mouse device driver.  This is the purpose of the 
  25273.  MouInitReal call.  It passes the address of the default, power-up pointer draw 
  25274.  routine for DOS mode to the mouse device driver.  This initialization is 
  25275.  transparent to applications. 
  25276.  
  25277.  This call is for use only by the Base Video Subsystem when invoked during 
  25278.  system initialization under the shell/session manager PID. 
  25279.  
  25280.  The error code ERROR_MOUSE_SMG_ONLY is valid from shell process only. 
  25281.  
  25282.  
  25283. ΓòÉΓòÉΓòÉ 3.14. MouOpen ΓòÉΓòÉΓòÉ
  25284.  
  25285.                                Bindings:  C, MASM
  25286.  
  25287. This call opens the mouse device for the current session. 
  25288.  
  25289.  MouOpen   (DriverName, DeviceHandle) 
  25290.  
  25291.  DriverName (PSZ) - input 
  25292.     DriverName is a far pointer to an ASCIIZ string in application storage 
  25293.     containing the name of the pointer draw device driver to be used as the 
  25294.     pointer-image drawing routine for this session. 
  25295.  
  25296.     The name of the device driver must be included in the CONFIG.SYS file at 
  25297.     system start-up time.  Applications that use the default pointer draw 
  25298.     device driver supplied by the system must push a double-word of 0s in place 
  25299.     of an address. 
  25300.  
  25301.     DriverName has a different definition when the caller is the Base Video 
  25302.     Subsystem (BVS).  In this case the selector portion of the far address is 
  25303.     zero.  The offset portion is non-zero and contains a display configuration 
  25304.     number (sequentially numbered where 1 is the first display configuration). 
  25305.     The MouOpen call issued by BVS is executed on the VioSetMode path.  Using 
  25306.     the display configuration number passed on the MouOpen call, the Base Mouse 
  25307.     Subsystem can detect a change in display configurations.  This form of the 
  25308.     MouOpen call is not recommended for applications.  Applications should 
  25309.     either push the far address of an ASCIIZ pointer draw device driver name or 
  25310.     push two words of zeros. 
  25311.  
  25312.  DeviceHandle (PHMOU) - output 
  25313.     Address of a 1-word value that represents the mouse handle returned to the 
  25314.     application. 
  25315.  
  25316.  rc (USHORT) - return 
  25317.     Return code descriptions are: 
  25318.  
  25319.     0         NO_ERROR 
  25320.     385       ERROR_MOUSE_NO_DEVICE 
  25321.     390       ERROR_MOUSE_INV_MODULE_PT 
  25322.     466       ERROR_MOU_DETACHED 
  25323.     501       ERROR_MOUSE_NO_CONSOLE 
  25324.     505       ERROR_MOU_EXTENDED_SG 
  25325.  
  25326.  Remarks 
  25327.  
  25328.  MouOpen initializes the Mouse functions to a known state.  The application may 
  25329.  have to issue additional mouse functions to establish the environment it 
  25330.  desires.  For example, after the MouOpen, the collision area is defined to be 
  25331.  the size of the entire display. Therefore, to get the pointer to be displayed, 
  25332.  the application must issue a MouDrawPtr to remove the collision area. 
  25333.  
  25334.  The state of the mouse after the first MouOpen is: 
  25335.  
  25336.  o Row/Col scale factors set to 16/8. (See MouSetScaleFact.) 
  25337.  o All events reported.  (See MouSetEventMask.) 
  25338.  o Empty event queue.  (See MouReadEventQue and MouGetNumQueEl.) 
  25339.  o All user settable Device Status bits reset.  (Set to zero.  See 
  25340.    MouSetDevStatus.) 
  25341.  o Pointer set to center of screen if valid display mode is set.  (See 
  25342.    MouSetPtrPos.) 
  25343.  o Pointer shape set to the default for the pointer device driver currently 
  25344.    registered in the session. (See MouSetPtrShape.) 
  25345.  o Collision area equal to full screen.  (See MouDrawPtr and MouRemovePtr.) 
  25346.  
  25347.  
  25348. ΓòÉΓòÉΓòÉ 3.15. MouReadEventQue ΓòÉΓòÉΓòÉ
  25349.  
  25350.                                Bindings:  C, MASM
  25351.  
  25352. This call reads an event from the mouse device FIFO event queue, and places it 
  25353. in a structure provided by the application. 
  25354.  
  25355.  MouReadEventQue     (Buffer, ReadType, DeviceHandle) 
  25356.  
  25357.  Buffer (PMOUEVENTINFO) - output 
  25358.     Address of the status of the mouse event queue. 
  25359.  
  25360.     moustate (USHORT) 
  25361.        State of the mouse at the time of the event. 
  25362.  
  25363.        Bit       Description 
  25364.        15-7      Reserved, set to zero. 
  25365.        6         Set if button 3 is down. 
  25366.        5         Set if mouse is moving and button 3 is down. 
  25367.        4         Set if button 2 is down. 
  25368.        3         Set if mouse is moving and button 2 is down. 
  25369.        2         Set if button 1 is down. 
  25370.        1         Set if mouse is moving and button 1 is down. 
  25371.        0         Set if mouse is moving and no buttons are down. 
  25372.  
  25373.     eventtime (ULONG) 
  25374.        Time stamp (in milliseconds) since the system was started. 
  25375.  
  25376.     row (USHORT) 
  25377.        Absolute or relative row position. 
  25378.  
  25379.     col (USHORT) 
  25380.        Absolute or relative column position. 
  25381.  
  25382.  ReadType (PUSHORT) - input 
  25383.     Address of the action to take when MouReadEventQue is issued and the mouse 
  25384.     event queue is empty. If the mouse event queue is not empty, this parameter 
  25385.     is not examined by the mouse support.  ReadType values are: 
  25386.  
  25387.     Value     Definition 
  25388.     0         No Wait for data on empty queue (return a NULL record) 
  25389.     1         WAIT for data on empty queue. 
  25390.  
  25391.  DeviceHandle (HMOU) - input 
  25392.     Handle of the mouse device from a previous MouOpen. 
  25393.  
  25394.  rc (USHORT) - return 
  25395.     Return code descriptions are: 
  25396.  
  25397.     0         NO_ERROR 
  25398.     385       ERROR_MOUSE_NO_DEVICE 
  25399.     387       ERROR_MOUSE_INV_PARMS 
  25400.     393       ERROR_MOUSE_NO_DATA 
  25401.     466       ERROR_MOU_DETACHED 
  25402.     501       ERROR_MOUSE_NO_CONSOLE 
  25403.     505       ERROR_MOU_EXTENDED_SG 
  25404.  
  25405.  Remarks 
  25406.  
  25407.  The types of queued events are directly affected by the current value of the 
  25408.  Mouse EventMask.  MouSetEventMask is used to indicate the types of events 
  25409.  desired, and MouGetEventMask is used to query the current value of the mask. 
  25410.  Refer to these functions for further explanation of the masking of events. 
  25411.  
  25412.  Recognition of the mouse transition depends on the use of MouState returned in 
  25413.  the event record.  The application should focus on bit transitions that occur 
  25414.  in this word.  It is important to properly set the event mask with 
  25415.  MouSetEventMask for reporting the state transitions. 
  25416.  
  25417.  MouState reports the state of the mouse that resulted from the action that 
  25418.  caused the event.  The action can be pressing or releasing a button, and/or 
  25419.  moving the mouse.  All status is given, regardless of the EventMask that was 
  25420.  used to determine whether or not to report the event. 
  25421.  
  25422.  For example, assume the EventMask indicates that the application wishes only 
  25423.  button 1 event.  The EventMask has only bits 1 and 2 set in this case.  Also 
  25424.  assume the current state of the mouse is no buttons down, and mouse is not 
  25425.  moving.  At this point, button 1 is pressed causing an event; the status shows 
  25426.  button 1 down (bit 2 set).  Next the mouse is moved, thereby causing more 
  25427.  events; status shows bit 1 set.  Finally, mouse is stopped and button 1 is 
  25428.  released.  The event shows status with no bits set. 
  25429.  
  25430.  Next, button 2 is pressed.  No event occurs.  Mouse is then moved; again, no 
  25431.  event.  Then, while mouse is still in motion, button 1 is pressed; an event is 
  25432.  generated with bits 1 and 3 set in the state word. While mouse is still in 
  25433.  motion, both buttons are released.  Because button 1 changes states, an event 
  25434.  occurs.  The state word has bit 0 set.  Finally, mouse is stopped.  No event 
  25435.  occurs, again because no button 1 transition has taken place. 
  25436.  
  25437.  The Row and Column fields in the Buffer Parameter may contain either absolute 
  25438.  display coordinates or relative mouse motion in mickeys. See MouSetDevStatus 
  25439.  for additional  information. 
  25440.  
  25441.  
  25442. ΓòÉΓòÉΓòÉ 3.16. MouRegister ΓòÉΓòÉΓòÉ
  25443.  
  25444.                                Bindings:  C, MASM
  25445.  
  25446. This call registers a mouse subsystem within a session. 
  25447.  
  25448.  MouRegister     (ModuleName, EntryName, Mask) 
  25449.  
  25450.  ModuleName (PSZ) - input 
  25451.     Address of the dynamic link module name.  The maximum length is 9 bytes 
  25452.     (including ASCIIZ terminator). 
  25453.  
  25454.  EntryName (PSZ) - input 
  25455.     Address of the dynamic link entry point name of a routine that receives 
  25456.     control when any of the registered functions are called.  The maximum 
  25457.     length is 33 bytes (including ASCIIZ terminator). 
  25458.  
  25459.  Mask (ULONG) - input 
  25460.     A mask of bits, where each bit set to 1 identifies a mouse function being 
  25461.     registered.  Bit values are: 
  25462.  
  25463.     Bit       Description 
  25464.     31-22     Reserved, set to zero 
  25465.     21        MouSetDevStatus 
  25466.     20        MouFlushQue 
  25467.     19        MouInitReal 
  25468.     18        MouSetPtrPos 
  25469.     17        MouGetPtrPos 
  25470.     16        MouRemovePtr 
  25471.     15        MouDrawPtr 
  25472.     14        MouSetPtrShape 
  25473.     13        MouGetPtrShape 
  25474.     12        MouClose 
  25475.     11        MouOpen 
  25476.     10        Reserved 
  25477.     9         Reserved 
  25478.     8         MouSetEventMask 
  25479.     7         MouSetScaleFact 
  25480.     6         MouGetEventMask 
  25481.     5         MouGetScaleFact 
  25482.     4         MouReadEventQue 
  25483.     3         MouGetNumQueEl 
  25484.     2         MouGetDevStatus 
  25485.     1         MouGetNumMickeys 
  25486.     0         MouGetNumButtons. 
  25487.  
  25488.  rc (USHORT) - return 
  25489.     Return code descriptions are: 
  25490.  
  25491.     0         NO_ERROR 
  25492.     385       ERROR_MOUSE_NO_DEVICE 
  25493.     413       ERROR_MOUSE_INVALID_ASCIIZ 
  25494.     414       ERROR_MOUSE_INVALID_MASK 
  25495.     415       ERROR_MOUSE_REGISTER 
  25496.     466       ERROR_MOU_DETACHED 
  25497.     505       ERROR_MOU_EXTENDED_SG 
  25498.  
  25499.  Remarks 
  25500.  
  25501.  The Base Mouse Subsystem is the default mouse subsystem. There can be only one 
  25502.  MouRegister outstanding for each session without an intervening MouDeRegister. 
  25503.  MouDeRegister must be issued by the same process that issued MouRegister. 
  25504.  
  25505.  When any registered function is called, control is routed to EntryName.  When 
  25506.  this routine is entered, four additional values are pushed onto the stack. 
  25507.  The first is the index number (Word) of the function being called.  The second 
  25508.  is a near pointer (Word). The third is the caller's DS register (Word).  The 
  25509.  fourth is the return address (DWord) to the mouse router.  For example, if 
  25510.  MouGetNumMickeys were called and control routed to EntryName, the stack would 
  25511.  appear as if the following instructions were executed: 
  25512.  
  25513.   PUSH@ WORD    NumberOfMickeys
  25514.   PUSH  WORD    DeviceHandle
  25515.   CALL  FAR     MouGetNumMickeys
  25516.   PUSH  WORD    Function Code
  25517.   CALL  NEAR    Entry point in Mouse Router
  25518.   PUSH  DS
  25519.   CALL  FAR     EntryName.
  25520.  
  25521.  When a registered function returns to the Mouse Router, AX is interpreted as 
  25522.  follows: 
  25523.  
  25524.  AX = 0 
  25525.     No error.  Do not invoke the Base Mouse Subsystem routine. Return AX = 0. 
  25526.  
  25527.  AX = -1 
  25528.     Invoke the BaseMouse Subsystem routine.  Return AX = return code from the 
  25529.     Base Mouse Subsystem. 
  25530.  
  25531.  AX = error (if not 0 or -1) 
  25532.     Do not invoke the Base Mouse Subsystem Routine.  Return AX = error. 
  25533.  
  25534.  When the mouse router receives a mouse call, it routes it to the Base Mouse 
  25535.  Subsystem unless an application or other mouse subsystem has previously issued 
  25536.  MouRegister for that call.  If the call was registered, the subsystem is 
  25537.  entered at the EntryName specified, and provided with the applicable function 
  25538.  code. 
  25539.  
  25540.  The registered function mask is used to determine whether a requested 
  25541.  function is performed by the registered mouse subsystem or default to the Base 
  25542.  Mouse Subsystem. 
  25543.  
  25544.  The following list shows the relationship of the mouse API calls and the 
  25545.  Function Code passed to either the Base Mouse Subsystem or a registered mouse 
  25546.  subsystem. 
  25547.  
  25548.  MOU API calls               Function Code 
  25549.  MouGetNumButtons            00H 
  25550.  MouGetNumMickeys            01H 
  25551.  MouGetDevStatus             02H 
  25552.  MouGetNumQueEl              03H 
  25553.  MouReadEventQue             03H 
  25554.  MouGetScaleFact             05H 
  25555.  MouGetEventMask             06H 
  25556.  MouSetScaleFact             07H 
  25557.  MouSetEventMask             08H 
  25558.  Reserved                    09H 
  25559.  Reserved                    0AH 
  25560.  MouOpen                     0BH 
  25561.  MouClose                    0CH 
  25562.  MouGetPtrShape              0DH 
  25563.  MouSetPtrShape              0EH 
  25564.  MouDrawPtr                  0FH 
  25565.  MouRemovePtr                10H 
  25566.  MouGetPtrPos                11H 
  25567.  MouSetPtrPos                12H 
  25568.  MouInitReal                 13H 
  25569.  MouFlushQue                 14H 
  25570.  MouSetDevStatus             15H 
  25571.  
  25572.  A registered mouse sybsystem must leave the stack, on exit, in the exact state 
  25573.  it was received. 
  25574.  
  25575.  
  25576. ΓòÉΓòÉΓòÉ 3.17. MouRemovePtr ΓòÉΓòÉΓòÉ
  25577.  
  25578.                                Bindings:  C, MASM
  25579.  
  25580. This call allows a process to notify the mouse device driver that the area 
  25581. defined by the passed parameters is for the exclusive use of the application. 
  25582. This area is defined as the collision area and is not available to the mouse 
  25583. device driver when drawing pointer images. 
  25584.  
  25585.  MouRemovePtr    (PtrArea, DeviceHandle) 
  25586.  
  25587.  PtrArea (PNOPTRRECT) - input 
  25588.     Address of the pointer shape collision area structure: 
  25589.  
  25590.     leftrow (USHORT) 
  25591.        Upper left row coordinate (pels or characters). 
  25592.  
  25593.     leftcol (USHORT) 
  25594.        Upper left column coordinate (pels or characters). 
  25595.  
  25596.     rightrow (USHORT) 
  25597.        Lower right row coordinate (pels or characters). 
  25598.  
  25599.     rightcol (USHORT) 
  25600.        Lower right column coordinate (pels or characters). 
  25601.  
  25602.  DeviceHandle (HMOU) - input 
  25603.     Handle of the mouse device from a previous MouOpen. 
  25604.  
  25605.  rc (USHORT) - return 
  25606.     Return code descriptions are: 
  25607.  
  25608.     0         NO_ERROR 
  25609.     385       ERROR_MOUSE_NO_DEVICE 
  25610.     387       ERROR_MOUSE_INV_PARMS 
  25611.     466       ERROR_MOU_DETACHED 
  25612.     501       ERROR_MOUSE_NO_CONSOLE 
  25613.     505       ERROR_MOU_EXTENDED_SG 
  25614.  
  25615.  Remarks 
  25616.  
  25617.  MouRemovePtr may be issued by any process in the session. However, only one 
  25618.  collision area is active at a time. Each MouRemovePtr command has the effect 
  25619.  of resetting the collision area to the location and area specified by the 
  25620.  current command. 
  25621.  
  25622.  If the logical pointer position is outside of the collision area specified by 
  25623.  the latest MouRemovePtr command, the pointer image is drawn. 
  25624.  
  25625.  The MouDrawPtr command effectively cancels the  MouRemovePtr command and 
  25626.  allows the pointer to be drawn anywhere on the screen, until a new 
  25627.  MouRemovePtr command is issued. 
  25628.  
  25629.  
  25630. ΓòÉΓòÉΓòÉ 3.18. MouSetDevStatus ΓòÉΓòÉΓòÉ
  25631.  
  25632.                                Bindings:  C, MASM
  25633.  
  25634. This call sets the mouse device driver status flags for the installed mouse 
  25635. device driver. 
  25636.  
  25637.  MouSetDevStatus     (DeviceStatus, DeviceHandle) 
  25638.  
  25639.  DeviceStatus (PUSHORT) - input 
  25640.     Address of the desired status flag settings. 
  25641.  
  25642.     The passed parameter is a 2-byte set of flags.  Only the high-order byte 
  25643.     has meaning. 
  25644.  
  25645.     Bit       Description 
  25646.     15-10     Reserved, set to zero. 
  25647.     9         Set if mouse device is to return data in mickeys. 
  25648.     8         Set if the drawing operations for the pointer draw routine are to 
  25649.               be disabled. 
  25650.     7-0       Reserved, set to zero. 
  25651.  
  25652.  DeviceHandle (HMOU) - input 
  25653.     Handle of the mouse device from a previous MouOpen. 
  25654.  
  25655.  rc (USHORT) - return 
  25656.     Return code descriptions are: 
  25657.  
  25658.     0         NO_ERROR 
  25659.     385       ERROR_MOUSE_NO_DEVICE 
  25660.     387       ERROR_MOUSE_INV_PARMS 
  25661.     466       ERROR_MOU_DETACHED 
  25662.     501       ERROR_MOUSE_NO_CONSOLE 
  25663.     505       ERROR_MOU_EXTENDED_SG 
  25664.  
  25665.  Remarks 
  25666.  
  25667.  MouSetDevStatus is the complement to MouGetDevStatus. However, not all status 
  25668.  flags may be set with MouSetDevStatus. Only the flags corresponding to the 
  25669.  following functions may be modified: 
  25670.  
  25671.  o Return data in mickeys. 
  25672.  
  25673.    Normally, mouse data is returned to the application with the absolute 
  25674.    display mode coordinates of the pointer image position on the display 
  25675.    screen.  By setting this status flag, mouse data is returned in relative 
  25676.    mickeys, a unit of mouse movement. 
  25677.  
  25678.  o Don't call pointer draw device. 
  25679.  
  25680.    Normally, the pointer draw device driver is called for all drawing 
  25681.    operations. By setting this status flag, the mouse device driver does not 
  25682.    call the pointer draw device driver.  The application must draw any required 
  25683.    pointer image on the screen. 
  25684.  
  25685.  
  25686. ΓòÉΓòÉΓòÉ 3.19. MouSetEventMask ΓòÉΓòÉΓòÉ
  25687.  
  25688.                                Bindings:  C, MASM
  25689.  
  25690. This call assigns a new event mask to the current mouse device driver. 
  25691.  
  25692.  MouSetEventMask     (EventMask, DeviceHandle) 
  25693.  
  25694.  EventMask (PUSHORT) - input 
  25695.     Address of a value in application storage used to indicate what mouse 
  25696.     events are to be placed on the event queue (see MouReadEventQue) and which 
  25697.     events are to be ignored. 
  25698.  
  25699.     The EventMask bit values are described below: 
  25700.  
  25701.     Bit       Description 
  25702.     15-7      Reserved, set to zero. 
  25703.     6         Set to report button 3 press/release events, without mouse motion 
  25704.     5         Set to report button 3 press/release events, with mouse motion 
  25705.     4         Set to report button 2 press/release events, without mouse motion 
  25706.     3         Set to report button 2 press/release events, with mouse motion 
  25707.     2         Set to report button 1 press/release events, without mouse motion 
  25708.     1         Set to report button 1 press/release events, with mouse motion 
  25709.     0         Set to mouse motion events with no button press/release events. 
  25710.  
  25711.     A bit clear setting (set to zero) in an EventMask bit position indicates 
  25712.     that the associated type of event is not reported to the application. Note 
  25713.     also that the mouse buttons are always numbered from left to right. When 
  25714.     the mouse is properly positioned for use, the left-hand button is button 1. 
  25715.  
  25716.  DeviceHandle (HMOU) - input 
  25717.     Handle of the mouse device from a previous MouOpen. 
  25718.  
  25719.  rc (USHORT) - return 
  25720.     Return code descriptions are: 
  25721.  
  25722.     0         NO_ERROR 
  25723.     385       ERROR_MOUSE_NO_DEVICE 
  25724.     466       ERROR_MOU_DETACHED 
  25725.     501       ERROR_MOUSE_NO_CONSOLE 
  25726.     505       ERROR_MOU_EXTENDED_SG 
  25727.  
  25728.  Remarks 
  25729.  
  25730.  Setting a bit in the event mask means that the associated event is reported on 
  25731.  the mouse FIFO event queue.  See MouReadEventQue for examples of event mask 
  25732.  use. 
  25733.  
  25734.  
  25735. ΓòÉΓòÉΓòÉ 3.20. MouSetPtrPos ΓòÉΓòÉΓòÉ
  25736.  
  25737.                                Bindings:  C, MASM
  25738.  
  25739. This call directs the mouse driver to set a new row and column coordinate 
  25740. position for the mouse pointer. 
  25741.  
  25742.  MouSetPtrPos     (PtrPos, DeviceHandle) 
  25743.  
  25744.  PtrPos (PPTRLOC) - input 
  25745.     Address of the mouse pointer position structure: 
  25746.  
  25747.     pointerrow (USHORT) 
  25748.        New pointer row coordinate (pels or characters). 
  25749.  
  25750.     pointercol (USHORT) 
  25751.        New pointer column coordinate (pels or characters). 
  25752.  
  25753.  DeviceHandle (HMOU) - input 
  25754.     Handle of the mouse device from a previous MouOpen. 
  25755.  
  25756.  rc (USHORT) - return 
  25757.     Return code descriptions are: 
  25758.  
  25759.     0         NO_ERROR 
  25760.     385       ERROR_MOUSE_NO_DEVICE 
  25761.     387       ERROR_MOUSE_INV_PARMS 
  25762.     466       ERROR_MOU_DETACHED 
  25763.     501       ERROR_MOUSE_NO_CONSOLE 
  25764.     505       ERROR_MOU_EXTENDED_SG 
  25765.  
  25766.  Remarks 
  25767.  
  25768.  The application must ensure that the coordinate position specified conforms to 
  25769.  the current display mode orientation for the session.  Pel values must be used 
  25770.  for graphics modes and character values for text modes. 
  25771.  
  25772.  This function has no effect on the display's current collision area definition 
  25773.  as specified by the MouDrawPtr call. If the mouse pointer image is directed 
  25774.  into a defined collision area, the pointer image is not drawn until either the 
  25775.  pointer is moved outside the collision area or the collision area is released 
  25776.  by the MouDrawPtr call. 
  25777.  
  25778.  
  25779. ΓòÉΓòÉΓòÉ 3.21. MouSetPtrShape ΓòÉΓòÉΓòÉ
  25780.  
  25781.                                Bindings:  C, MASM
  25782.  
  25783. This call allows a process to set the pointer shape and size to be used as the 
  25784. mouse device driver pointer image for all applications in a session. 
  25785.  
  25786.  MouSetPtrShape    (PtrBuffer, PtrDefRec, DeviceHandle) 
  25787.  
  25788.  PtrBuffer (PBYTE) - input 
  25789.     Address of a buffer containing the bit image used by the mouse device 
  25790.     driver as the pointer shape for that session. The buffer consists of AND 
  25791.     and XOR pointer masks in a format meaningful to the pointer draw device 
  25792.     driver. 
  25793.  
  25794.     For CGA compatible text modes (0, 1, 2, and 3) the following describes the 
  25795.     AND and XOR pointer mask bit definitions for each character cell of the 
  25796.     masks.  Bit values are: 
  25797.  
  25798.     Bit       Description 
  25799.     15        Blinking 
  25800.     14-12     Background color 
  25801.     11        Intensity 
  25802.     10-8      Foreground color 
  25803.     7-0       Character 
  25804.  
  25805.  PtrDefRec (PPTRSHAPE) - input 
  25806.     Address of the structure where the application stores the necessary data 
  25807.     for the pointer draw device driver to build a row-by-column image for each 
  25808.     bit plane for the current display mode.  The pointer definition record 
  25809.     structure follows: 
  25810.  
  25811.     TotLength (USHORT) 
  25812.        The total length of the data necessary for the pointer draw device 
  25813.        driver to build a row-by-column image for each bit plane for the current 
  25814.        display mode. 
  25815.  
  25816.        For all OS/2 system-supported modes, TotLength is specified in bytes and 
  25817.        is 
  25818.        equal to: 
  25819.  
  25820.        Mono & Text Modes 
  25821.                  For text mode height and width must be 1, so length is always 
  25822.                  4. 
  25823.  
  25824.                                   TotLength = (height in chars) * (width in chars) * 2 * 2
  25825.                                              = 1 * 1 * 2 * 2
  25826.                                              = 4
  25827.  
  25828.        Graphics Mode 
  25829.                  Width-in-pels must be a multiple of 8. 
  25830.  
  25831.                                   TotLength = (height in pels)*(width in pels)*(bits per pel)*2/8
  25832.  
  25833.        Modes 4 and 5 (320 X 200) 
  25834.  
  25835.                                   TotLength = (height) * (width) * 2 * 2 / 8
  25836.  
  25837.        Mode 6 (640 X 200) 
  25838.  
  25839.                                   TotLength = (height) * (width) * 1 * 2 / 8
  25840.  
  25841.                  Length calculations produce byte boundary buffer sizes. 
  25842.  
  25843.     col (USHORT) 
  25844.        Number of columns in the mouse shape. In graphics modes, this field 
  25845.        contains the pel width (columns) of the mouse shape for the session and 
  25846.        must be greater than or equal to 1. In text modes, col must equal 1. 
  25847.  
  25848.     row (USHORT) 
  25849.        Number of rows in the mouse shape. In graphics modes, this field 
  25850.        contains the pel height (rows) of the mouse shape for the session and 
  25851.        must be greater than or equal to 1. In text modes, row must equal 1. 
  25852.  
  25853.     coloffset (USHORT) 
  25854.        This value is returned by the mouse device driver to indicate the 
  25855.        relative column offset within the pointer image.  The value defines the 
  25856.        center (hotspot) of the pointer image. This value is a signed number 
  25857.        that represents either character or pel offset, depending on the display 
  25858.        mode. 
  25859.  
  25860.     rowoffset (USHORT) 
  25861.        This value is returned by the mouse device driver to indicate the 
  25862.        relative row offset within the pointer image.  The value defines the 
  25863.        center (hotspot) of the pointer image. This value is a signed number 
  25864.        that represents either character or pel offset, depending on the display 
  25865.        mode. 
  25866.  
  25867.  Programming Note: 
  25868.     For other custom displays and for the extended modes of the EGA attachment, 
  25869.     it is possible to set the display to modes that require multiple bit 
  25870.     planes.  In these cases, the area sized by the row and column limits must 
  25871.     be repeated for each bit plane supported in that mode.  Consequently, the 
  25872.     calling process must supply enough data to allow the mouse device driver to 
  25873.     draw the pointer shape on all currently supported bit planes in that 
  25874.     session. For text modes, row and column offset must equal 0. 
  25875.  
  25876.  DeviceHandle (HMOU) - input 
  25877.     Contains the handle of the mouse device obtained from a previous MouOpen. 
  25878.  
  25879.  rc (USHORT) - return 
  25880.     Return code descriptions are: 
  25881.  
  25882.     0         NO_ERROR 
  25883.     385       ERROR_MOUSE_NO_DEVICE 
  25884.     387       ERROR_MOUSE_INV_PARMS 
  25885.     466       ERROR_MOU_DETACHED 
  25886.     501       ERROR_MOUSE_NO_CONSOLE 
  25887.     505       ERROR_MOU_EXTENDED_SG 
  25888.  
  25889.  Remarks 
  25890.  
  25891.  An application passes a data image to the mouse device driver that the mouse 
  25892.  driver applies to the screen whenever the logical pointer position is not 
  25893.  located in the application-defined collision  area.  The application 
  25894.  synchronizes use of the screen with the mouse driver by way of MouRemovePtr 
  25895.  and MouDrawPtr. 
  25896.  
  25897.  The pointer shape is dependent on the display device driver used to support 
  25898.  the display device.  OS/2 supports text and graphics modes. These modes are 
  25899.  restricted to modes 0 through 7, depending on the display device.  Character 
  25900.  modes (modes 0, 1, 2, 3, and 7) support the pointer cursor only as a reverse 
  25901.  block character.  This reverse block character has a character height and 
  25902.  width equal to 1. 
  25903.  
  25904.  The pointer shape is mapped by the Pointer Draw Device Driver and determined 
  25905.  completely by the application.  The height and width may vary from 1 through 
  25906.  the pel size of the display screen.  For restrictions concerning the Pointer 
  25907.  Draw Device Driver, see IBM Operating System/2 Version 1.2 I/O Subsystems And 
  25908.  Device Support Volume 1. 
  25909.  
  25910.  
  25911. ΓòÉΓòÉΓòÉ 3.22. MouSetScaleFact ΓòÉΓòÉΓòÉ
  25912.  
  25913.                                Bindings:  C, MASM
  25914.  
  25915. This call assigns to the current mouse device driver a new pair of 1-word 
  25916. scaling factors. 
  25917.  
  25918.  MouSetScaleFact     (ScaleStruct, DeviceHandle) 
  25919.  
  25920.  ScaleStruct (PSCALEFACT) - input 
  25921.     Address of the control block structure that contains the current row and 
  25922.     column coordinate scaling factors. The scaling factors must be greater than 
  25923.     or equal to 1 and less than or equal to (32K - 1). 
  25924.  
  25925.     rowscale (USHORT) 
  25926.        Row scaling factor. 
  25927.  
  25928.     colscale (USHORT) 
  25929.        Column scaling factor. 
  25930.  
  25931.  DeviceHandle (HMOU) - input 
  25932.     Handle of the mouse device from a previous MouOpen. 
  25933.  
  25934.  rc (USHORT) - return 
  25935.     Return code descriptions are: 
  25936.  
  25937.     0         NO_ERROR 
  25938.     385       ERROR_MOUSE_NO_DEVICE 
  25939.     387       ERROR_MOUSE_INV_PARMS 
  25940.     466       ERROR_MOU_DETACHED 
  25941.     501       ERROR_MOUSE_NO_CONSOLE 
  25942.     505       ERROR_MOU_EXTENDED_SG 
  25943.  
  25944.  Remarks 
  25945.  
  25946.  MouSetScaleFact sets the mickey-to-pixel ratio for mouse motion.  The row 
  25947.  scale and column scale ratios specify a number of mickeys for each 8 pixels. 
  25948.  The default value for the row scale is 16 mickeys for each 8 pixels.  The 
  25949.  default value for the column scale is 8 mickeys to 8 pixels. 
  25950.  
  25951.  The number of pixels moved does not have to correspond 1-to-1 with the number 
  25952.  of mickeys the mouse moves.  The scaling factor defines a sensitivity for the 
  25953.  mouse that is a ratio of the number of mickeys required to move the cursor 8 
  25954.  pixels on the screen.  The sensitivity determines at what rate the cursor 
  25955.  moves on the screen. 
  25956.  
  25957.  
  25958. ΓòÉΓòÉΓòÉ 3.23. MouSynch ΓòÉΓòÉΓòÉ
  25959.  
  25960.                                Bindings:  C, MASM
  25961.  
  25962. This call provides synchronous access for a mouse subsystem to the mouse device 
  25963. driver. 
  25964.  
  25965.  MouSynch    (IOWait) 
  25966.  
  25967.  IOWait (USHORT) - input 
  25968.     Wait for access. The flag Word is defined as follows: 
  25969.  
  25970.     Value     Definition 
  25971.     0         Control immediately returned to requestor. 
  25972.     1         Requestor waits until mouse device driver is free. 
  25973.  
  25974.  rc (USHORT) - return 
  25975.     Return code descriptions are: 
  25976.  
  25977.     0         NO_ERROR 
  25978.     121       ERROR_SEM_TIMEOUT 
  25979.  
  25980.  Remarks 
  25981.  
  25982.  MouSynch blocks all other threads within a session until the semaphore clears 
  25983.  (returns from the subsystem to the router).  To ensure proper synchronization, 
  25984.  MouSynch should be issued by a mouse subsystem if it intends to access 
  25985.  dynamically modifiable shared data for each session or if it intends to issue 
  25986.  a DosDevIOCtl. MouSynch does not protect globally shared data from threads in 
  25987.  other sessions. 
  25988.  
  25989.  
  25990. ΓòÉΓòÉΓòÉ <hidden> MouClose ΓòÉΓòÉΓòÉ
  25991.  
  25992. #define INCL_MOU
  25993.  
  25994. USHORT  rc = MouClose(DeviceHandle);
  25995.  
  25996. HMOU             DeviceHandle;  /* Mouse device handle */
  25997.  
  25998. USHORT           rc;            /* return code */
  25999.  
  26000.  
  26001. ΓòÉΓòÉΓòÉ <hidden> MouDeRegister ΓòÉΓòÉΓòÉ
  26002.  
  26003. #define INCL_MOU
  26004.  
  26005. USHORT  rc = MouDeRegister(VOID);
  26006.  
  26007. USHORT           rc;            /* return code */
  26008.  
  26009.  
  26010. ΓòÉΓòÉΓòÉ <hidden> MouDrawPtr ΓòÉΓòÉΓòÉ
  26011.  
  26012. #define INCL_MOU
  26013.  
  26014. USHORT  rc = MouDrawPtr(DeviceHandle);
  26015.  
  26016. HMOU             DeviceHandle;  /* Mouse device handle */
  26017.  
  26018. USHORT           rc;            /* return code */
  26019.  
  26020.  
  26021. ΓòÉΓòÉΓòÉ <hidden> MouFlushQue ΓòÉΓòÉΓòÉ
  26022.  
  26023. #define INCL_MOU
  26024.  
  26025. USHORT  rc = MouFlushQue(DeviceHandle);
  26026.  
  26027. HMOU             DeviceHandle;  /* Mouse device handle */
  26028.  
  26029. USHORT           rc;            /* return code */
  26030.  
  26031.  
  26032. ΓòÉΓòÉΓòÉ <hidden> MouGetDevStatus ΓòÉΓòÉΓòÉ
  26033.  
  26034. #define INCL_MOU
  26035.  
  26036. USHORT  rc = MouGetDevStatus(DeviceStatus, DeviceHandle);
  26037.  
  26038. PUSHORT          DeviceStatus;  /* Current status flags */
  26039. HMOU             DeviceHandle;  /* Mouse device handle */
  26040.  
  26041. USHORT           rc;            /* return code */
  26042.  
  26043.  
  26044. ΓòÉΓòÉΓòÉ <hidden> MouGetEventMask ΓòÉΓòÉΓòÉ
  26045.  
  26046. #define INCL_MOU
  26047.  
  26048. USHORT  rc = MouGetEventMask(EventMask, DeviceHandle);
  26049.  
  26050. PUSHORT          EventMask;     /* Event Mask word */
  26051. HMOU             DeviceHandle;  /* Mouse device handle */
  26052.  
  26053. USHORT           rc;            /* return code */
  26054.  
  26055.  
  26056. ΓòÉΓòÉΓòÉ <hidden> MouGetNumButtons ΓòÉΓòÉΓòÉ
  26057.  
  26058. #define INCL_MOU
  26059.  
  26060. USHORT  rc = MouGetNumButtons(NumberOfButtons, DeviceHandle);
  26061.  
  26062. PUSHORT          NumberOfButtons;  /* Number of mouse buttons */
  26063. HMOU             DeviceHandle;     /* Mouse device handle */
  26064.  
  26065. USHORT           rc;               /* return code */
  26066.  
  26067.  
  26068. ΓòÉΓòÉΓòÉ <hidden> MouGetNumMickeys ΓòÉΓòÉΓòÉ
  26069.  
  26070. #define INCL_MOU
  26071.  
  26072. USHORT  rc = MouGetNumMickeys(NumberOfMickeys, DeviceHandle);
  26073.  
  26074. PUSHORT          NumberOfMickeys; /* Number mickeys/centimeter */
  26075. HMOU             DeviceHandle;    /* Mouse device handle */
  26076.  
  26077. USHORT           rc;              /* return code */
  26078.  
  26079.  
  26080. ΓòÉΓòÉΓòÉ <hidden> MouGetNumQueEl ΓòÉΓòÉΓòÉ
  26081.  
  26082. typedef struct _MOUQUEINFO {   /* mouqi */
  26083.   USHORT cEvents;              /* current number of event queue elements */
  26084.   USHORT cmaxEvents;           /* MaxNumQueElements value */
  26085. } MOUQUEINFO;
  26086.  
  26087. #define INCL_MOU
  26088.  
  26089. USHORT  rc = MouGetNumQueEl(QueDataRecord, DeviceHandle);
  26090.  
  26091. PMOUQUEINFO      QueDataRecord; /* Ptr to 2-word structure */
  26092. HMOU             DeviceHandle;  /* Mouse device handle */
  26093.  
  26094. USHORT           rc;            /* return code */
  26095.  
  26096.  
  26097. ΓòÉΓòÉΓòÉ <hidden> MouGetPtrPos ΓòÉΓòÉΓòÉ
  26098.  
  26099. typedef struct _PTRLOC {    /* moupl */
  26100.   USHORT row;               /* pointer row coordinate screen
  26101.                                  position */
  26102.   USHORT col;               /* pointer column coordinate screen
  26103.                                  position */
  26104. } PTRLOC;
  26105.  
  26106. #define INCL_MOU
  26107.  
  26108. USHORT  rc = MouGetPtrPos(PtrPos, DeviceHandle);
  26109.  
  26110. PPTRLOC          PtrPos;        /* Double word structure */
  26111. HMOU             DeviceHandle;  /* Mouse device handle */
  26112.  
  26113. USHORT           rc;            /* return code */
  26114.  
  26115.  
  26116. ΓòÉΓòÉΓòÉ <hidden> MouGetPtrShape ΓòÉΓòÉΓòÉ
  26117.  
  26118. typedef struct _PTRSHAPE {   /* moups */
  26119.   USHORT cb;                 /* total length necessary to build image */
  26120.   USHORT col;                /* # of columns in mouse shape */
  26121.   USHORT row;                /* number of rows in mouse shape */
  26122.   USHORT colHot;             /* column coordinate of pointer image
  26123.                                   hotspot */
  26124.   USHORT rowHot;             /* row coordinate of pointer image
  26125.                                   hotspot */
  26126. } PTRSHAPE;
  26127.  
  26128. #define INCL_MOU
  26129.  
  26130. USHORT  rc = MouGetPtrShape(PtrBuffer, PtrDefRec, DeviceHandle);
  26131.  
  26132. PBYTE            PtrBuffer;     /* Pointer shape buffer */
  26133. PPTRSHAPE        PtrDefRec;     /* Pointer definition struct */
  26134. HMOU             DeviceHandle;  /* Mouse device handle */
  26135.  
  26136. USHORT           rc;            /* return code */
  26137.  
  26138.  
  26139. ΓòÉΓòÉΓòÉ <hidden> MouGetScaleFact ΓòÉΓòÉΓòÉ
  26140.  
  26141. typedef struct _SCALEFACT {   /* mousc */
  26142.   USHORT rowScale;            /* row scaling factor */
  26143.   USHORT colScale;            /* column coordinate scaling factor */
  26144. } SCALEFACT;
  26145.  
  26146. #define INCL_MOU
  26147.  
  26148. USHORT  rc = MouGetScaleFact(ScaleStruct, DeviceHandle);
  26149.  
  26150. PSCALEFACT       ScaleStruct;   /* 2-word structure */
  26151. HMOU             DeviceHandle;  /* Mouse device handle */
  26152.  
  26153. USHORT           rc;            /* return code */
  26154.  
  26155.  
  26156. ΓòÉΓòÉΓòÉ <hidden> MouInitReal ΓòÉΓòÉΓòÉ
  26157.  
  26158. #define INCL_MOU
  26159.  
  26160. USHORT  rc = MouInitReal(DriverName);
  26161.  
  26162. PSZ              DriverName;    /* Pointer draw driver name */
  26163.  
  26164. USHORT           rc;            /* return code */
  26165.  
  26166.  
  26167. ΓòÉΓòÉΓòÉ <hidden> MouOpen ΓòÉΓòÉΓòÉ
  26168.  
  26169. #define INCL_MOU
  26170.  
  26171. USHORT  rc = MouOpen(DriverName, DeviceHandle);
  26172.  
  26173. PSZ              DriverName;    /* Pointer draw driver name */
  26174. PHMOU            DeviceHandle;  /* Mouse device handle */
  26175.  
  26176. USHORT           rc;            /* return code */
  26177.  
  26178.  
  26179. ΓòÉΓòÉΓòÉ <hidden> MouReadEventQue ΓòÉΓòÉΓòÉ
  26180.  
  26181. typedef struct _MOUEVENTINFO {  /* mouev */
  26182.   USHORT fs;                    /* State of mouse at time event was
  26183.                                       reported */
  26184.   ULONG  time;                  /* Time since boot in milliseconds */
  26185.   USHORT row;                   /* Absolute/relative row position */
  26186.   USHORT col;                   /* Absolute/relative column position */
  26187. }MOUEVENTINFO;
  26188.  
  26189. #define INCL_MOU
  26190.  
  26191. USHORT  rc = MouReadEventQue(Buffer, ReadType, DeviceHandle);
  26192.  
  26193. PMOUEVENTINFO    Buffer;        /* 10 byte Structure address */
  26194. PUSHORT          ReadType;      /* Read type */
  26195. HMOU             DeviceHandle;  /* Mouse device handle */
  26196.  
  26197. USHORT           rc;            /* return code */
  26198.  
  26199.  
  26200. ΓòÉΓòÉΓòÉ <hidden> MouRegister ΓòÉΓòÉΓòÉ
  26201.  
  26202. #define INCL_MOU
  26203.  
  26204. USHORT  rc = MouRegister(ModuleName, EntryName, Mask);
  26205.  
  26206. PSZ              ModuleName;    /* Module Name */
  26207. PSZ              EntryName;     /* Entry Name */
  26208. ULONG            Mask;          /* Function Mask */
  26209.  
  26210. USHORT           rc;            /* return code */
  26211.  
  26212.  
  26213. ΓòÉΓòÉΓòÉ <hidden> MouRemovePtr ΓòÉΓòÉΓòÉ
  26214.  
  26215. typedef struct _NOPTRRECT {   /* mourt */
  26216.   USHORT row;                 /* upper left row coordinates */
  26217.   USHORT col;                 /* upper left column coordinates */
  26218.   USHORT cRow;
  26219.   USHORT cCol;
  26220. } NOPTRRECT;
  26221.  
  26222. #define INCL_MOU
  26223.  
  26224. USHORT  rc = MouRemovePtr(PtrArea, DeviceHandle);
  26225.  
  26226. PNOPTRRECT       PtrArea;       /* Address of pointer data block */
  26227. HMOU             DeviceHandle;  /* Mouse device handle */
  26228.  
  26229. USHORT           rc;            /* return code */
  26230.  
  26231.  
  26232. ΓòÉΓòÉΓòÉ <hidden> MouSetDevStatus ΓòÉΓòÉΓòÉ
  26233.  
  26234. #define INCL_MOU
  26235.  
  26236. USHORT  rc = MouSetDevStatus(DeviceStatus, DeviceHandle);
  26237.  
  26238. PUSHORT          DeviceStatus;  /* Status flags */
  26239. HMOU             DeviceHandle;  /* Mouse device handle */
  26240.  
  26241. USHORT           rc;            /* return code */
  26242.  
  26243.  
  26244. ΓòÉΓòÉΓòÉ <hidden> MouSetEventMask ΓòÉΓòÉΓòÉ
  26245.  
  26246. #define INCL_MOU
  26247.  
  26248. USHORT  rc = MouSetEventMask(EventMask, DeviceHandle);
  26249.  
  26250. PUSHORT          EventMask;     /* Mouse device event mask ptr */
  26251. HMOU             DeviceHandle;  /* Mouse device handle */
  26252.  
  26253. USHORT           rc;            /* return code */
  26254.  
  26255.  
  26256. ΓòÉΓòÉΓòÉ <hidden> MouSetPtrPos ΓòÉΓòÉΓòÉ
  26257.  
  26258. typedef struct _PTRLOC {    /* moupl */
  26259.   USHORT row;               /* pointer row coordinate screen
  26260.                                  position */
  26261.   USHORT col;               /* pointer column coordinate screen
  26262.                                  position */
  26263. } PTRLOC;
  26264.  
  26265. #define INCL_MOU
  26266.  
  26267. USHORT  rc = MouSetPtrPos(PtrPos, DeviceHandle);
  26268.  
  26269. PPTRLOC          PtrPos;        /* Double word structure */
  26270. HMOU             DeviceHandle;  /* Mouse device handle */
  26271.  
  26272. USHORT           rc;            /* return code */
  26273.  
  26274.  
  26275. ΓòÉΓòÉΓòÉ <hidden> MouSetPtrShape ΓòÉΓòÉΓòÉ
  26276.  
  26277. typedef struct _PTRSHAPE {   /* moups */
  26278.   USHORT cb;                 /* total length necessary to build
  26279.                                   image */
  26280.   USHORT col;                /* # of columns in mouse shape */
  26281.   USHORT row;                /* number of rows in mouse shape */
  26282.   USHORT colHot;             /* column coordinate of pointer image
  26283.                                   hotspot */
  26284.   USHORT rowHot;             /* row coordinate of pointer image
  26285.                                   hotspot */
  26286. } PTRSHAPE;
  26287.  
  26288. #define INCL_MOU
  26289.  
  26290. USHORT  rc = MouSetPtrShape(PtrBuffer, PtrDefRec, DeviceHandle);
  26291.  
  26292. PBYTE            PtrBuffer;     /* Pointer shape buffer */
  26293. PPTRSHAPE        PtrDefRec;     /* Pointer definition record */
  26294. HMOU             DeviceHandle;  /* Mouse device handle */
  26295.  
  26296. USHORT           rc;            /* return code */
  26297.  
  26298.  
  26299. ΓòÉΓòÉΓòÉ <hidden> MouSetScaleFact ΓòÉΓòÉΓòÉ
  26300.  
  26301. typedef struct _SCALEFACT {   /* mousc */
  26302.   USHORT rowScale;            /* row scaling factor */
  26303.   USHORT colScale;            /* column coordinate scaling factor */
  26304. } SCALEFACT;
  26305.  
  26306. #define INCL_MOU
  26307.  
  26308. USHORT  rc = MouSetScaleFact(ScaleStruct, DeviceHandle);
  26309.  
  26310. PSCALEFACT       ScaleStruct;   /* 2-word structure */
  26311. HMOU             DeviceHandle;  /* Mouse device handle */
  26312.  
  26313. USHORT           rc;            /* return code */
  26314.  
  26315.  
  26316. ΓòÉΓòÉΓòÉ <hidden> MouSynch ΓòÉΓòÉΓòÉ
  26317.  
  26318. #define INCL_MOU
  26319.  
  26320. USHORT  rc = MouSynch(IOWait);
  26321.  
  26322. USHORT           IOWait;        /* Indicate wait/no wait */
  26323.  
  26324. USHORT           rc;            /* return code */
  26325.  
  26326.  
  26327. ΓòÉΓòÉΓòÉ <hidden> MouClose ΓòÉΓòÉΓòÉ
  26328.  
  26329. EXTRN  MouClose:FAR
  26330. INCL_MOU            EQU 1
  26331.  
  26332. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26333. CALL   MouClose
  26334.  
  26335. Returns WORD
  26336.  
  26337.  
  26338. ΓòÉΓòÉΓòÉ <hidden> MouDeRegister ΓòÉΓòÉΓòÉ
  26339.  
  26340. EXTRN  MouDeRegister:FAR
  26341. INCL_MOU            EQU 1
  26342.  
  26343. CALL   MouDeRegister
  26344.  
  26345. Returns WORD
  26346.  
  26347.  
  26348. ΓòÉΓòÉΓòÉ <hidden> MouDrawPtr ΓòÉΓòÉΓòÉ
  26349.  
  26350. EXTRN  MouDrawPtr:FAR
  26351. INCL_MOU            EQU 1
  26352.  
  26353. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26354. CALL   MouDrawPtr
  26355.  
  26356. Returns WORD
  26357.  
  26358.  
  26359. ΓòÉΓòÉΓòÉ <hidden> MouFlushQue ΓòÉΓòÉΓòÉ
  26360.  
  26361. EXTRN  MouFlushQue:FAR
  26362. INCL_MOU            EQU 1
  26363.  
  26364. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26365. CALL   MouFlushQue
  26366.  
  26367. Returns WORD
  26368.  
  26369.  
  26370. ΓòÉΓòÉΓòÉ <hidden> MouGetDevStatus ΓòÉΓòÉΓòÉ
  26371.  
  26372. EXTRN  MouGetDevStatus:FAR
  26373. INCL_MOU            EQU 1
  26374.  
  26375. PUSH@  WORD    DeviceStatus  ;Current status flags
  26376. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26377. CALL   MouGetDevStatus
  26378.  
  26379. Returns WORD
  26380.  
  26381.  
  26382. ΓòÉΓòÉΓòÉ <hidden> MouGetEventMask ΓòÉΓòÉΓòÉ
  26383.  
  26384. EXTRN  MouGetEventMask:FAR
  26385. INCL_MOU            EQU 1
  26386.  
  26387. PUSH@  WORD    EventMask     ;Event Mask word
  26388. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26389. CALL   MouGetEventMask
  26390.  
  26391. Returns WORD
  26392.  
  26393.  
  26394. ΓòÉΓòÉΓòÉ <hidden> MouGetNumButtons ΓòÉΓòÉΓòÉ
  26395.  
  26396. EXTRN  MouGetNumButtons:FAR
  26397. INCL_MOU            EQU 1
  26398.  
  26399. PUSH@  WORD    NumberOfButtons ;Number of mouse buttons
  26400. PUSH   WORD    DeviceHandle    ;Mouse device handle
  26401. CALL   MouGetNumButtons
  26402.  
  26403. Returns WORD
  26404.  
  26405.  
  26406. ΓòÉΓòÉΓòÉ <hidden> MouGetNumMickeys ΓòÉΓòÉΓòÉ
  26407.  
  26408. EXTRN  MouGetNumMickeys:FAR
  26409. INCL_MOU            EQU 1
  26410.  
  26411. PUSH@  WORD    NumberOfMickeys ;Number mickeys/centimeter
  26412. PUSH   WORD    DeviceHandle    ;Mouse device handle
  26413. CALL   MouGetNumMickeys
  26414.  
  26415. Returns WORD
  26416.  
  26417.  
  26418. ΓòÉΓòÉΓòÉ <hidden> MouGetNumQueEl ΓòÉΓòÉΓòÉ
  26419.  
  26420. MOUQUEINFO struc
  26421.   mouqi_cEvents    dw  ? ;current number of event queue elements
  26422.   mouqi_cmaxEvents dw  ? ;MaxNumQueElements value
  26423. MOUQUEINFO ends
  26424.  
  26425. EXTRN  MouGetNumQueEl:FAR
  26426. INCL_MOU            EQU 1
  26427.  
  26428. PUSH@  OTHER   QueDataRecord  ;Ptr to 2-word structure
  26429. PUSH   WORD    DeviceHandle   ;Mouse device handle
  26430. CALL   MouGetNumQueEl
  26431.  
  26432. Returns WORD
  26433.  
  26434.  
  26435. ΓòÉΓòÉΓòÉ <hidden> MouGetPtrPos ΓòÉΓòÉΓòÉ
  26436.  
  26437. PTRLOC  struc
  26438.   moupl_row  dw  ? ;pointer row coordinate screen position
  26439.   moupl_col  dw  ? ;pointer column coordinate screen position
  26440. PTRLOC  ends
  26441.  
  26442. EXTRN  MouGetPtrPos:FAR
  26443. INCL_MOU            EQU 1
  26444.  
  26445. PUSH@  OTHER   PtrPos        ;Double word structure
  26446. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26447. CALL   MouGetPtrPos
  26448.  
  26449. Returns WORD
  26450.  
  26451.  
  26452. ΓòÉΓòÉΓòÉ <hidden> MouGetPtrShape ΓòÉΓòÉΓòÉ
  26453.  
  26454. PTRSHAPE struc
  26455.   moups_cb      dw  ? ;total length necessary to build image
  26456.   moups_col     dw  ? ;# of columns in mouse shape
  26457.   moups_row     dw  ? ;number of rows in mouse shape
  26458.   moups_colHot  dw  ? ;column coordinate of pointer image hotspot
  26459.   moups_rowHot  dw  ? ;row coordinate of pointer image hotspot
  26460. PTRSHAPE ends
  26461.  
  26462. EXTRN  MouGetPtrShape:FAR
  26463. INCL_MOU            EQU 1
  26464.  
  26465. PUSH@  OTHER   PtrBuffer     ;Pointer shape buffer
  26466. PUSH@  OTHER   PtrDefRec     ;Pointer definition struct
  26467. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26468. CALL   MouGetPtrShape
  26469.  
  26470. Returns WORD
  26471.  
  26472.  
  26473. ΓòÉΓòÉΓòÉ <hidden> MouGetScaleFact ΓòÉΓòÉΓòÉ
  26474.  
  26475. SCALEFACT struc
  26476.   mousc_rowScale  dw  ? ;row scaling factor
  26477.   mousc_colScale  dw  ? ;column coordinate scaling factor
  26478. SCALEFACT ends
  26479.  
  26480. EXTRN  MouGetScaleFact:FAR
  26481. INCL_MOU            EQU 1
  26482.  
  26483. PUSH@  OTHER   ScaleStruct   ;2-word structure
  26484. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26485. CALL   MouGetScaleFact
  26486.  
  26487. Returns WORD
  26488.  
  26489.  
  26490. ΓòÉΓòÉΓòÉ <hidden> MouInitReal ΓòÉΓòÉΓòÉ
  26491.  
  26492. EXTRN  MouInitReal:FAR
  26493. INCL_MOU            EQU 1
  26494.  
  26495. PUSH@  ASCIIZ  DriverName    ;Pointer draw driver name
  26496. CALL   MouInitReal
  26497.  
  26498. Returns WORD
  26499.  
  26500.  
  26501. ΓòÉΓòÉΓòÉ <hidden> MouOpen ΓòÉΓòÉΓòÉ
  26502.  
  26503. EXTRN  MouOpen:FAR
  26504. INCL_MOU            EQU 1
  26505.  
  26506. PUSH@  ASCIIZ  DriverName    ;Pointer draw driver name
  26507. PUSH@  WORD    DeviceHandle  ;Mouse device handle
  26508. CALL   MouOpen
  26509.  
  26510. Returns WORD
  26511.  
  26512.  
  26513. ΓòÉΓòÉΓòÉ <hidden> MouReadEventQue ΓòÉΓòÉΓòÉ
  26514.  
  26515. MOUEVENTINFO struc
  26516.   mouev_fs   dw  ?  ;State of mouse at time event was reported
  26517.   mouev_time dd  ?  ;time since boot in milliseconds
  26518.   mouev_row  dw  ?  ;absolute/relative row position
  26519.   mouev_col  dw  ?  ;absolute/relative column position
  26520. MOUEVENTINFO ends
  26521.  
  26522. EXTRN  MouReadEventQue:FAR
  26523. INCL_MOU            EQU 1
  26524.  
  26525. PUSH@  OTHER   Buffer        ;10 byte Structure address
  26526. PUSH@  WORD    ReadType      ;Read type
  26527. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26528. CALL   MouReadEventQue
  26529.  
  26530. Returns WORD
  26531.  
  26532.  
  26533. ΓòÉΓòÉΓòÉ <hidden> MouRegister ΓòÉΓòÉΓòÉ
  26534.  
  26535. EXTRN   MouRegister:FAR
  26536. INCL_MOU            EQU 1
  26537.  
  26538. PUSH@  ASCIIZ  ModuleName    ;Module Name
  26539. PUSH@  ASCIIZ  EntryName     ;Entry Name
  26540. PUSH   DWORD   Mask          ;Function Mask
  26541. CALL   MouRegister
  26542.  
  26543. Returns WORD
  26544.  
  26545.  
  26546. ΓòÉΓòÉΓòÉ <hidden> MouRemovePtr ΓòÉΓòÉΓòÉ
  26547.  
  26548. NOPTRRECT struc
  26549.  mourt_row  dw  ? ;upper left row coordinates
  26550.  mourt_col  dw  ? ;upper left column coordinates
  26551.  mourt_cRow dw  ?
  26552.  mourt_cCol dw  ?
  26553. NOPTRRECT ends
  26554.  
  26555. EXTRN MouRemovePtr:FAR
  26556. INCL_MOU            EQU 1
  26557.  
  26558. PUSH@  OTHER   PtrArea       ;Address of pointer data block
  26559. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26560. CALL   MouRemovePtr
  26561.  
  26562. Returns WORD
  26563.  
  26564.  
  26565. ΓòÉΓòÉΓòÉ <hidden> MouSetDevStatus ΓòÉΓòÉΓòÉ
  26566.  
  26567. EXTRN  MouSetDevStatus:FAR
  26568. INCL_MOU            EQU 1
  26569.  
  26570. PUSH@  WORD    DeviceStatus  ;Status flags
  26571. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26572. CALL   MouSetDevStatus
  26573.  
  26574. Returns WORD
  26575.  
  26576.  
  26577. ΓòÉΓòÉΓòÉ <hidden> MouSetEventMask ΓòÉΓòÉΓòÉ
  26578.  
  26579. EXTRN  MouSetEventMask:FAR
  26580. INCL_MOU            EQU 1
  26581.  
  26582. PUSH@  WORD    EventMask     ;Mouse device event mask ptr
  26583. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26584. CALL   MouSetEventMask
  26585.  
  26586. Returns WORD
  26587.  
  26588.  
  26589. ΓòÉΓòÉΓòÉ <hidden> MouSetPtrPos ΓòÉΓòÉΓòÉ
  26590.  
  26591. PTRLOC  struc
  26592.   moupl_row  dw  ? ;pointer row coordinate screen position
  26593.   moupl_col  dw  ? ;pointer column coordinate screen position
  26594. PTRLOC  ends
  26595.  
  26596. EXTRN  MouSetPtrPos:FAR
  26597. INCL_MOU            EQU 1
  26598.  
  26599. PUSH@  OTHER   PtrPos        ;Double word structure
  26600. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26601. CALL   MouSetPtrPos
  26602.  
  26603. Returns WORD
  26604.  
  26605.  
  26606. ΓòÉΓòÉΓòÉ <hidden> MouSetPtrShape ΓòÉΓòÉΓòÉ
  26607.  
  26608. PTRSHAPE struc
  26609.   moups_cb      dw  ? ;total length necessary to build image
  26610.   moups_col     dw  ? ;# of columns in mouse shape
  26611.   moups_row     dw  ? ;number of rows in mouse shape
  26612.   moups_colHot  dw  ? ;column coordinate of pointer image hotspot
  26613.   moups_rowHot  dw  ? ;row coordinate of pointer image hotspot
  26614. PTRSHAPE ends
  26615.  
  26616. EXTRN  MouSetPtrShape:FAR
  26617. INCL_MOU            EQU 1
  26618.  
  26619. PUSH@  OTHER   PtrBuffer     ;Pointer shape buffer
  26620. PUSH@  OTHER   PtrDefRec     ;Pointer definition record
  26621. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26622. CALL   MouSetPtrShape
  26623.  
  26624. Returns WORD
  26625.  
  26626.  
  26627. ΓòÉΓòÉΓòÉ <hidden> MouSetScaleFact ΓòÉΓòÉΓòÉ
  26628.  
  26629. SCALEFACT struc
  26630.   mousc_rowScale  dw  ? ;row scaling factor
  26631.   mousc_colScale  dw  ? ;column coordinate scaling factor
  26632. SCALEFACT ends
  26633.  
  26634. EXTRN  MouSetScaleFact:FAR
  26635. INCL_MOU            EQU 1
  26636.  
  26637. PUSH@  OTHER   ScaleStruct   ;2-word structure
  26638. PUSH   WORD    DeviceHandle  ;Mouse device handle
  26639. CALL   MouSetScaleFact
  26640.  
  26641. Returns WORD
  26642.  
  26643.  
  26644. ΓòÉΓòÉΓòÉ <hidden> MouSynch ΓòÉΓòÉΓòÉ
  26645.  
  26646. EXTRN  MouSynch:FAR
  26647. INCL_MOU            EQU 1
  26648.  
  26649. PUSH   WORD    IOWait        ;Indicate wait/no wait
  26650. CALL   MouSynch
  26651.  
  26652. Returns WORD
  26653.  
  26654.  
  26655. ΓòÉΓòÉΓòÉ 4. Video Function Calls ΓòÉΓòÉΓòÉ
  26656.  
  26657. This section reflects the Video API interface of OS/2 only. 
  26658.  
  26659. If ERROR_VIO_SEE_ERROR_LOG is returned, further information about the error 
  26660. that occurred can be obtained by calling WinGetLast Error. 
  26661.  
  26662. Notes: 
  26663.  
  26664.   1. Calls marked xPM are not supported by Presentation Manager, and must not 
  26665.      be used by Presentation Manager applications.  An error code is returned 
  26666.      if any of these calls are issued. 
  26667.  
  26668.   2. Calls marked xWPM are not windowable and are not supported by Presentation 
  26669.      Manager.  They can be used in OS/2 mode. 
  26670.  
  26671.   3. Calls marked FAPI are present in the Family API. 
  26672.  
  26673.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  26674.         Γöé   FUNCTION CALL          ICON         Γöé
  26675.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26676.         Γöé   VioDeRegister          xWPM         Γöé
  26677.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26678.         Γöé   VioGetConfig           FAPI         Γöé
  26679.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26680.         Γöé   VioGetCurPos           FAPI         Γöé
  26681.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26682.         Γöé   VioGetCurType          FAPI         Γöé
  26683.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26684.         Γöé   VioGetFont             FAPI xWPM    Γöé
  26685.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26686.         Γöé   VioGetMode             FAPI xPM     Γöé
  26687.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26688.         Γöé   VioGetPhysBuf          FAPI xWPM    Γöé
  26689.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26690.         Γöé   VioGetState            FAPI xWPM    Γöé
  26691.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26692.         Γöé   VioModeUndo            xWPM         Γöé
  26693.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26694.         Γöé   VioModeWait            xWPM         Γöé
  26695.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26696.         Γöé   VioPrtSc               xWPM         Γöé
  26697.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26698.         Γöé   VioPrtScToggle         xWPM         Γöé
  26699.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26700.         Γöé   VioReadCellStr         FAPI         Γöé
  26701.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26702.         Γöé   VioReadCharStr         FAPI         Γöé
  26703.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26704.         Γöé   VioRegister            xWPM         Γöé
  26705.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26706.         Γöé   VioSavRedrawUndo       xWPM         Γöé
  26707.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26708.         Γöé   VioSavRedrawWait       xWPM         Γöé
  26709.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26710.         Γöé   VioScrLock             FAPI xWPM    Γöé
  26711.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26712.         Γöé   VioScrollDn            FAPI         Γöé
  26713.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26714.         Γöé   VioScrollLf            FAPI         Γöé
  26715.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26716.         Γöé   VioScrollRt            FAPI         Γöé
  26717.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26718.         Γöé   VioScrollUp            FAPI         Γöé
  26719.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26720.         Γöé   VioScrUnLock           FAPI xWPM    Γöé
  26721.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26722.         Γöé   VioSetCurPos           FAPI         Γöé
  26723.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26724.         Γöé   VioSetCurType          FAPI         Γöé
  26725.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26726.         Γöé   VioSetFont             FAPI xWPM    Γöé
  26727.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26728.         Γöé   VioSetMode             FAPI xPM     Γöé
  26729.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26730.         Γöé   VioSetState            FAPI xWPM    Γöé
  26731.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26732.         Γöé   VioWrtCellStr          FAPI         Γöé
  26733.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26734.         Γöé   VioWrtCharStr          FAPI         Γöé
  26735.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26736.         Γöé   VioWrtCharStrAtt       FAPI         Γöé
  26737.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26738.         Γöé   VioWrtNAttr            FAPI         Γöé
  26739.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26740.         Γöé   VioWrtNCell            FAPI         Γöé
  26741.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26742.         Γöé   VioWrtNChar            FAPI         Γöé
  26743.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  26744.         Γöé   VioWrtTTY              FAPI         Γöé
  26745.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  26746.  
  26747.  
  26748. ΓòÉΓòÉΓòÉ 4.1. VioDeRegister ΓòÉΓòÉΓòÉ
  26749.  
  26750.                                Bindings:  C, MASM
  26751.  
  26752. This call deregisters a video subsystem previously registered within a session. 
  26753.  
  26754.  VioDeRegister   ( ) 
  26755.  
  26756.  rc (USHORT) - return 
  26757.     Return code descriptions are: 
  26758.  
  26759.     0         NO_ERROR 
  26760.     404       ERROR_VIO_DEREGISTER 
  26761.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  26762.     465       ERROR_VIO_DETACHED 
  26763.     494       ERROR_VIO_EXTENDED_SG 
  26764.  
  26765.  Remarks 
  26766.  
  26767.  VioDeRegister must be issued by the same process that issued the previous 
  26768.  VioRegister.  After VioDeRegister is issued, subsequent video calls are 
  26769.  processed by the Base Video Subsystem. 
  26770.  
  26771.  
  26772. ΓòÉΓòÉΓòÉ 4.2. VioEndPopUp ΓòÉΓòÉΓòÉ
  26773.  
  26774.                                Bindings:  C, MASM
  26775.  
  26776. This call is issued by the application when it no longer requires the temporary 
  26777. screen obtained through a previous VioPopUp call. 
  26778.  
  26779.  VioEndPopUp     (VioHandle) 
  26780.  
  26781.  VioHandle (HVIO) - input 
  26782.     A reserved word of 0s. 
  26783.  
  26784.  rc (USHORT) - return 
  26785.     Return code descriptions are: 
  26786.  
  26787.     0         NO_ERROR 
  26788.     405       ERROR_VIO_NO_POPUP 
  26789.     436       ERROR_VIO_INVALID_HANDLE 
  26790.  
  26791.  Remarks 
  26792.  
  26793.  When the application issues a VioEndPopUp call, all video calls are directed 
  26794.  to the application's normal video buffer. 
  26795.  
  26796.  
  26797.  PM Considerations 
  26798.  
  26799.  An error is returned if issued with a non-zero handle. 
  26800.  
  26801.  
  26802. ΓòÉΓòÉΓòÉ 4.3. VioGetAnsi ΓòÉΓòÉΓòÉ
  26803.  
  26804.                                Bindings:  C, MASM
  26805.  
  26806. This call returns the current ANSI status On/Off state. 
  26807.  
  26808.  VioGetAnsi  (Indicator, VioHandle) 
  26809.  
  26810.  Indicator (PUSHORT) - output 
  26811.     Address of the current ANSI status. A value of 1 indicates ANSI is active, 
  26812.     and a value of 0 indicates ANSI is not active. 
  26813.  
  26814.  VioHandle (HVIO) - input 
  26815.     This must be zero unless the caller is a Presentation Manager application, 
  26816.     in which case it must be the value returned by VioGetPs. 
  26817.  
  26818.  rc (USHORT) - return 
  26819.     Return code descriptions are: 
  26820.  
  26821.     0         NO_ERROR 
  26822.     436       ERROR_VIO_INVALID_HANDLE 
  26823.     465       ERROR_VIO_DETACHED 
  26824.  
  26825.  
  26826. ΓòÉΓòÉΓòÉ 4.4. VioGetBuf ΓòÉΓòÉΓòÉ
  26827.  
  26828.                                Bindings:  C, MASM
  26829.  
  26830. This call returns the address of the logical video buffer (LVB). 
  26831.  
  26832.  VioGetBuf    (LVBPtr, Length, VioHandle) 
  26833.  
  26834.  LVBPtr (PULONG) - output 
  26835.     Address of the selector and offset of the logical video buffer. 
  26836.     Applications should not assume the offset portion of this far address is 0. 
  26837.  
  26838.  Length (PUSHORT) - output 
  26839.     Address of the length buffer in bytes.  The length is: number of rows * 
  26840.     number of columns * size of cell. 
  26841.  
  26842.  VioHandle (HVIO) - input 
  26843.     This must be zero unless the caller is a Presentation Manager application, 
  26844.     in which case it must be the value returned by VioGetPs. 
  26845.  
  26846.  rc (USHORT) - return 
  26847.     Return code descriptions are: 
  26848.  
  26849.     0         NO_ERROR 
  26850.     355       ERROR_VIO_MODE 
  26851.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  26852.     436       ERROR_VIO_INVALID_HANDLE 
  26853.     465       ERROR_VIO_DETACHED 
  26854.  
  26855.  Remarks 
  26856.  
  26857.  An application using VioGetBuf can prepare a screen in the application's own 
  26858.  logical video buffer (LVB) offline.  When the application is in the 
  26859.  foreground, the physical screen buffer is updated from the LVB when VioShowBuf 
  26860.  is issued.  When the application runs in the background, the physical screen 
  26861.  buffer is updated when the application is switched to the foreground. 
  26862.  
  26863.  Once VioGetBuf is issued, all VioWrtXX calls issued while the application is 
  26864.  running in the foreground are written to the physical display buffer and LVB. 
  26865.  If a VioGetPhysBuf is subsequently issued, then the  VioWrtXX calls are only 
  26866.  written to the physical display buffer.  They are no longer written to the 
  26867.  LVB. 
  26868.  
  26869.  VioGetMode may be used to determine the dimensions of the buffer. 
  26870.  
  26871.  If VioSetMode is issued following a VioGetBuf call, the size of the logical 
  26872.  video buffer is adjusted to correspond to the new mode.  There is one logical 
  26873.  video buffer per session (or presentation space if AVIO application) that 
  26874.  corresponds to the current mode on the current display configuration. 
  26875.  
  26876.  
  26877.  PM Considerations 
  26878.  
  26879.  This function returns the address and length of the Advanced VIO presentation 
  26880.  space.  The presentation space may be used to directly manipulate displayed 
  26881.  information. 
  26882.  
  26883.  
  26884. ΓòÉΓòÉΓòÉ 4.5. VioGetConfig ΓòÉΓòÉΓòÉ
  26885.  
  26886.                                Bindings:  C, MASM
  26887.  
  26888. This call returns the video display configuration. 
  26889.  
  26890.  VioGetConfig    (ConfigID, ConfigData, VioHandle) 
  26891.  
  26892.  ConfigID (USHORT) - input 
  26893.     Identifies for which display configuration information is being requested: 
  26894.  
  26895.     Value     Definition 
  26896.     0         Current configuration 
  26897.     1         Primary configuration 
  26898.     2         Secondary configuration. 
  26899.  
  26900.     For OS/2 1.2, when ConfigID = 0, the current configuration is returned 
  26901.     rather than the primary configuration (as was returned in OS/2 1.0 and 
  26902.     1.1).  This change makes the OS/2 mode version of VioGetConfig match the 
  26903.     family API version that has returned the current configuration starting 
  26904.     with OS/2 1.0. OS/2 1.0 and 1.1 applications that issued VioGetConfig to 
  26905.     determine the display configuration benefit from this change.  The 
  26906.     application can run on the configuration selected by the operator (by 
  26907.     issuing the MODE command before invoking the application) rather than 
  26908.     switching away from the operator selected display. 
  26909.  
  26910.  ConfigData (PVIOCONFIGINFO) - output 
  26911.     Address of structure where the display configuration is returned. 
  26912.  
  26913.     length (USHORT) 
  26914.        Input parameter to VioGetConfig.  Length specifies the length of the 
  26915.        data structure in bytes including Length itself.  The maximum size 
  26916.        structure required in OS/2 1.0 and 1.1 is 10 bytes. 
  26917.  
  26918.        The maximum size structure required in OS/2 1.2 is variable and can be 
  26919.        determined by issuing VioGetConfig with Length set to 2. When Length is 
  26920.        set to 2 on input, VioGetConfig returns the size of the maximum 
  26921.        structure required in the Length field on output.  When Length is not 
  26922.        equal to 2 on input, the Length field is modified on output to reflect 
  26923.        the actual number of bytes returned.  That is, if more than the maximum 
  26924.        size was specified, the maximum size is returned.  However, if less than 
  26925.        the maximum size is specified, the value returned reflects the number of 
  26926.        bytes of complete fields returned. 
  26927.  
  26928.     adaptertype (USHORT) 
  26929.        Display adapter type. 
  26930.  
  26931.        Value     Definition 
  26932.        0         Monochrome-compatible 
  26933.        1         Color Graphics Adapter (CGA) 
  26934.        2         Enhanced Graphics Adapter (EGA) 
  26935.        3         VGA or PS/2 Display Adapter 
  26936.        4-6       Reserved 
  26937.        7         IBM Personal System/2 Display Adapter 8514/A. 
  26938.        8         IBM PS/2 Image Adapter/A 
  26939.        9         IBM PS/2 XGA Display Adapter 
  26940.  
  26941.        Values ranging from 0-4095 are reserved for IBM. 
  26942.  
  26943.     displaytype (USHORT) 
  26944.        Display or monitor type. 
  26945.  
  26946.        Value     Definition 
  26947.        0         Monochrome display 
  26948.        1         Color display 
  26949.        2         Enhanced Color Display 
  26950.        3         PS/2 Monochrome Display 8503 
  26951.        4         PS/2 Color Displays 8512 and 8513 
  26952.        5-8       Reserved 
  26953.        9         PS/2 Color Display 8514 
  26954.        10        IBM Plasma Display Panel 
  26955.        11        Monochrome Displays 8507 and 8604 
  26956.        12        PS/2 Color Display 8515 
  26957.        13        Reserved 
  26958.  
  26959.        Values ranging from 0-4095 are reserved for IBM. 
  26960.  
  26961.     adaptmem (ULONG) 
  26962.        Amount of memory, in bytes, on the adapter. 
  26963.  
  26964.     Configuration# (USHORT) 
  26965.        Number of the display configuration that this data corresponds to. This 
  26966.        is assigned by the video subsystem, not the Base Video Handler (BVH). 
  26967.  
  26968.     VDHVersion (USHORT) 
  26969.        This field is reserved. 
  26970.  
  26971.     Flag bits (USHORT) 
  26972.        Are defined as follows: 
  26973.  
  26974.        Bit       Description 
  26975.        15-1      Reserved 
  26976.        0         Power up display configuration. 
  26977.  
  26978.     Hardware state buffer size (ULONG) 
  26979.        Size of the buffer required by the Base Video Handler (BVH) to save the 
  26980.        full hardware state excluding the physical display buffer. 
  26981.  
  26982.     Max buffer size - full save (ULONG) 
  26983.        Maximum size buffer required by the BVH to save the full physical 
  26984.        display buffer. 
  26985.  
  26986.     Max buffer size - partial save (ULONG) 
  26987.        Maximum size buffer required by the BVH to save the portion of the 
  26988.        physical display buffer that is overlaid by a pop-up. 
  26989.  
  26990.     Offset to emulated adapter types (USHORT) 
  26991.        Offset within the configuration data structure to the following 
  26992.        information describing what other display adapters are emulated by this 
  26993.        display adapter. 
  26994.  
  26995.        Number of Data words (USHORT) 
  26996.           Contains a one word field specifying a count of data words to follow. 
  26997.  
  26998.        Data word 1 (USHORT) 
  26999.           Bits set in the data words identify display adapters emulated.  Data 
  27000.           word 1 has the following definition: 
  27001.  
  27002.           Bit       Description 
  27003.           0         Monochrome/printer adapter 
  27004.           1         Color graphics adapter 
  27005.           2         Enhanced graphics adapter 
  27006.           3         VGA or PS/2 display adapter 
  27007.           4-6       Reserved 
  27008.           7         8514/A Adapter 
  27009.           8         IBM PS/2 Image Adapter/A 
  27010.           9         IBM PS/2 XGA Adapter 
  27011.           10-15     Reserved. 
  27012.  
  27013.        Data word 2 (USHORT) 
  27014.           Reserved. 
  27015.  
  27016.        Data word N (USHORT) 
  27017.           Reserved. 
  27018.  
  27019.     Offset to emulated display types (USHORT) 
  27020.        Offset within the configuration data structure to the following 
  27021.        information describing what other displays are emulated by this display. 
  27022.  
  27023.        Number of Data words (USHORT) 
  27024.           One word field specifying a count of data words to follow. 
  27025.  
  27026.        Data word 1 (USHORT) 
  27027.           Bits set in the data words identify displays emulated.  Data word 1 
  27028.           has the following definition: 
  27029.  
  27030.           Bit       Description 
  27031.           0         5151 monochrome display 
  27032.           1         5153 color  display 
  27033.           2         5154 enhanced color display 
  27034.           3         8503 monochrome display 
  27035.           4         8512 or 8513 color display 
  27036.           5-8       Reserved 
  27037.           9         8514 color display 
  27038.           10        IBM Plasma Display Panel 
  27039.           11        Monochrome Displays 8507 and 8604 
  27040.           12        8515 color display 
  27041.           13-15     Reserved. 
  27042.  
  27043.        Data word 2 (USHORT) 
  27044.           Reserved 
  27045.  
  27046.        Data word N (USHORT) 
  27047.           Reserved. 
  27048.  
  27049.  VioHandle (HVIO) - input 
  27050.     This must be zero unless the caller is a Presentation Manager application, 
  27051.     in which case it must be the value returned by VioGetPs. 
  27052.  
  27053.  rc (USHORT) - return 
  27054.     Return code descriptions are: 
  27055.  
  27056.     0         NO_ERROR 
  27057.     421       ERROR_VIO_INVALID_PARMS 
  27058.     436       ERROR_VIO_INVALID_HANDLE 
  27059.     438       ERROR_VIO_INVALID_LENGTH 
  27060.     465       ERROR_VIO_DETACHED 
  27061.  
  27062.  Remarks 
  27063.  
  27064.  The values returned may not be correct if the adapter cannot be properly 
  27065.  identified by the Base Video Handler (BVH) selected at system installation 
  27066.  time.  It can also be incorrect if the physical setup does not match that 
  27067.  indicated by the presence of the adapter or by adapter switches.  For example, 
  27068.  it is impossible to detect the absence of a display on a CGA or the display 
  27069.  attached to an EGA, despite the setup switches. 
  27070.  
  27071.  
  27072. ΓòÉΓòÉΓòÉ 4.6. VioGetCp ΓòÉΓòÉΓòÉ
  27073.  
  27074.                                Bindings:  C, MASM
  27075.  
  27076. This call allows a process to query the code page currently used to display 
  27077. text data. 
  27078.  
  27079.  VioGetCp    (Reserved, CodePageID, VioHandle) 
  27080.  
  27081.  Reserved (USHORT) - input 
  27082.     A reserved word of 0s. 
  27083.  
  27084.  CodePageID (PUSHORT) - output 
  27085.     Address of a word in the application's data area. The current video code 
  27086.     page is returned in this word. 
  27087.  
  27088.  VioHandle (HVIO) - input 
  27089.     This must be zero unless the caller is a Presentation Manager application, 
  27090.     in which case it must be the value returned by VioGetPs. 
  27091.  
  27092.  rc (USHORT) - return 
  27093.     Return code descriptions are: 
  27094.  
  27095.     0         NO_ERROR 
  27096.     355       ERROR_VIO_MODE 
  27097.     436       ERROR_VIO_INVALID_HANDLE 
  27098.     465       ERROR_VIO_DETACHED 
  27099.     468       ERROR_VIO_USER_FONT 
  27100.  
  27101.  Remarks 
  27102.  
  27103.  The display code page ID previously set by VioSetCp, or inherited from the 
  27104.  requesting process, is returned to the caller. 
  27105.  
  27106.  The code page tag returned is the currently active code page. A value of 0000 
  27107.  indicates that the code page in use is the ROM code page provided by the 
  27108.  hardware. 
  27109.  
  27110.  If ERROR_VIO_USER_FONT is returned, it indicates a user font that was 
  27111.  previously loaded with VioSetFont is the active code page. 
  27112.  
  27113.  
  27114. ΓòÉΓòÉΓòÉ 4.7. VioGetCurPos ΓòÉΓòÉΓòÉ
  27115.  
  27116.                                Bindings:  C, MASM
  27117.  
  27118. This call returns the coordinates of the cursor. 
  27119.  
  27120.  VioGetCurPos    (Row, Column, VioHandle) 
  27121.  
  27122.  Row (PUSHORT) - output 
  27123.     Address of the current Row position of the cursor where 0 is the top row. 
  27124.  
  27125.  Column (PUSHORT) - output 
  27126.     Address of the current column position of the cursor where 0 is the 
  27127.     leftmost column. 
  27128.  
  27129.  VioHandle (HVIO) - input 
  27130.     This must be zero unless the caller is a Presentation Manager application, 
  27131.     in which case it must be the value returned by VioGetPs. 
  27132.  
  27133.  rc (USHORT) - return 
  27134.     Return code descriptions are: 
  27135.  
  27136.     0         NO_ERROR 
  27137.     355       ERROR_VIO_MODE 
  27138.     436       ERROR_VIO_INVALID_HANDLE 
  27139.     465       ERROR_VIO_DETACHED 
  27140.  
  27141.  
  27142. ΓòÉΓòÉΓòÉ 4.8. VioGetCurType ΓòÉΓòÉΓòÉ
  27143.  
  27144.                                Bindings:  C, MASM
  27145.  
  27146. This call returns the cursor type. 
  27147.  
  27148.  VioGetCurType   (CursorData, VioHandle) 
  27149.  
  27150.  CursorData (PVIOCURSORINFO) - output 
  27151.     Address of the cursor characteristics structure: 
  27152.  
  27153.     startline (USHORT) 
  27154.        Horizontal scan line in the character cell that marks the top line of 
  27155.        the cursor.  If the character cell has n scan lines, 0 is the top scan 
  27156.        line of the character cell and (n-1) is the bottom scan line. 
  27157.  
  27158.     endline (USHORT) 
  27159.        Horizontal scan line in the character cell that marks the bottom line of 
  27160.        the cursor.  Scan lines within a character cell are numbered as defined 
  27161.        in startline. 
  27162.  
  27163.     cursorwidth (USHORT) 
  27164.        Width of the cursor. In text modes, cursorwidth is the number of 
  27165.        columns. The maximum number supported by the OS/2 base video subsystem 
  27166.        is 1. In graphics modes, cursorwidth is the number of pels. 
  27167.  
  27168.     cursorattrib (USHORT) 
  27169.        A value of -1 denotes a hidden cursor, all other values in text mode 
  27170.        denote normal cursor and in graphics mode denote color attribute. 
  27171.  
  27172.  VioHandle (HVIO) - input 
  27173.     This must be zero unless the caller is a Presentation Manager application, 
  27174.     in which case it must be the value returned by VioGetPs. 
  27175.  
  27176.  rc (USHORT) - return 
  27177.     Return code descriptions are: 
  27178.  
  27179.     0         NO_ERROR 
  27180.     355       ERROR_VIO_MODE 
  27181.     436       ERROR_VIO_INVALID_HANDLE 
  27182.     465       ERROR_VIO_DETACHED 
  27183.  
  27184.  Remarks 
  27185.  
  27186.  If CursorStartLine  and CursorEndLine  were originally specified as 
  27187.  percentages on VioSetCurType (using negative values), the positive values into 
  27188.  which they were translated are returned. Refer to VioSetCurType for more 
  27189.  information on how percentages can be used to set CursorStartLine  and 
  27190.  CursorEndLine independent of the number of scan lines per character cell. 
  27191.  
  27192.  
  27193.  Family API Considerations 
  27194.  
  27195.  In DOS mode, VioGetCurType returns only two values for cursorattrib: 
  27196.  0 = visible cursor, and -1 = hidden cursor. 
  27197.  
  27198.  
  27199. ΓòÉΓòÉΓòÉ 4.9. VioGetFont ΓòÉΓòÉΓòÉ
  27200.  
  27201.                                Bindings:  C, MASM
  27202.  
  27203. This call returns either the font table of the size specified or the font in 
  27204. use. 
  27205.  
  27206.  VioGetFont    (RequestBlock, VioHandle) 
  27207.  
  27208.  RequestBlock (PVIOFONTINFO) - input/output 
  27209.     Address of the font structure that returns current RAM font or specified 
  27210.     ROM or code page font depending on the request type: 
  27211.  
  27212.     length (USHORT) 
  27213.        Length of structure, including length. 
  27214.  
  27215.        14        Only valid value. 
  27216.  
  27217.     reqtype (USHORT) 
  27218.        Request type: 
  27219.  
  27220.        Value     Definition 
  27221.        0         Get current RAM font for EGA, VGA, or IBM Personal System/2 
  27222.                  Display Adapter. 
  27223.        1         Get ROM font for CGA, EGA, VGA, or IBM Personal System/2 
  27224.                  Display Adapter. 
  27225.  
  27226.     pelcolumns (USHORT) 
  27227.        Pel columns in character cell. 
  27228.  
  27229.     pelrows (USHORT) 
  27230.        Pel rows in character cell. 
  27231.  
  27232.     fonttable (PVOID) 
  27233.        Address of the requested font table returned in a caller-supplied data 
  27234.        area.  If the storage area is accessed by way of an address of 0, a 
  27235.        system-supplied segment containing the requested font table is returned. 
  27236.  
  27237.     tablelength (USHORT) 
  27238.        Length, in bytes, of the caller-supplied data area where the font table 
  27239.        is returned. 
  27240.  
  27241.  VioHandle (HVIO) - input 
  27242.     Reserved word of 0s. 
  27243.  
  27244.  rc (USHORT) - return 
  27245.     Return code descriptions are: 
  27246.  
  27247.     0         NO_ERROR 
  27248.     355       ERROR_VIO_MODE 
  27249.     421       ERROR_VIO_INVALID_PARMS 
  27250.     438       ERROR_VIO_INVALID_LENGTH 
  27251.     465       ERROR_VIO_DETACHED 
  27252.     467       ERROR_VIO_FONT 
  27253.     494       ERROR_VIO_EXTENDED_SG 
  27254.  
  27255.  Remarks 
  27256.  
  27257.  For reqtype = 1, return ROM font, the font size requested must be supported by 
  27258.  the display adapter installed.  The 8x8, 8x14, 9x14, 8x16, or 9x16 character 
  27259.  font may be requested for the VGA or PS/2 Display Adapters.  The 8x8, 8x14, or 
  27260.  9x14 font may be requested for the enhanced graphics adapter.  The 8x8 font 
  27261.  may be requested for the color graphics adapter. 
  27262.  
  27263.  Note:  Although graphics mode support is provided in VioGetFont, this support 
  27264.         is not provided by the Base Video Handlers provided with OS/2. 
  27265.  
  27266.  For reqtype = 1, return ROM font, the far address returned is a ROM pointer 
  27267.  only for those fonts where the font table for the full 256-character set is 
  27268.  actually contained in ROM. Otherwise, the far address returned is a RAM 
  27269.  pointer. Note that for 8x8 on the CGA, the font table for the full 
  27270.  256-character set is returned. For 9x14 or 9x16 the font table for the full 
  27271.  256-character set is also returned.  Partial fonts are not returned. The 9x14 
  27272.  and 9x16 fonts are derived from variations of the 8x14 and 8x16 fonts, 
  27273.  respectively, where the definitions of fonts for those characters that are 
  27274.  different, are replaced. 
  27275.  
  27276.  For VioGetFont specifying reqtype = 1, return ROM font, the font returned is 
  27277.  derived from the fonts contained in the system, EGA, VGA, and PS/2 Display 
  27278.  Adapter BIOS data areas as applicable. There is an exception for the EGA, VGA 
  27279.  and PS/2 Display Adapter when VioSetCp or VioSetFont has been issued. In that 
  27280.  case, the font of the size requested is returned from the active code page or 
  27281.  the list of user fonts already set. 
  27282.  
  27283.  
  27284. ΓòÉΓòÉΓòÉ 4.10. VioGetMode ΓòÉΓòÉΓòÉ
  27285.  
  27286.                                Bindings:  C, MASM
  27287.  
  27288. This call returns the mode of the display. 
  27289.  
  27290.  VioGetMode    (ModeData, VioHandle) 
  27291.  
  27292.  ModeData (PVIOMODEINFO) - input/output 
  27293.     Far address of a structure where mode characteristics are returned. 
  27294.  
  27295.     length (USHORT) 
  27296.        Input parameter to VioGetMode.  Length specifies the length of the data 
  27297.        structure in bytes including Length itself.  The value specified on 
  27298.        input controls the amount of mode data returned. The minimum structure 
  27299.        size required is 2 bytes, and the maximum structure size required is 34 
  27300.        bytes. For OS/2 1.2, a length of 2 returns the size of the maximum 
  27301.        structure required for all the mode data. When length is not equal to 2, 
  27302.        the length field is modified on output to reflect the actual number of 
  27303.        bytes returned. 
  27304.  
  27305.     type (UCHAR) 
  27306.        Mode characteristics bit mask: 
  27307.  
  27308.        Bit       Description 
  27309.  
  27310.        7-4       Reserved 
  27311.  
  27312.        3         0 = VGA-compatible modes 0 thru 13H 
  27313.  
  27314.                  1 = Native mode 
  27315.  
  27316.        2         0 = Enable color burst 
  27317.  
  27318.                  1 = Disable color burst 
  27319.  
  27320.        1         0 = Text mode 
  27321.  
  27322.                  1 = Graphics mode 
  27323.  
  27324.        0         0 = Monochrome compatible mode 
  27325.  
  27326.                  1 = Other. 
  27327.  
  27328.     numcolors (UCHAR) 
  27329.        Number of colors defined as a power of 2.  This is equivalent to the 
  27330.        number of color bits that define the color, for example: 
  27331.  
  27332.        Value     Definition 
  27333.        0         Monochrome modes 7, 7+, and F. 
  27334.        1         2 colors 
  27335.        2         4 colors 
  27336.        4         16 colors 
  27337.        8         256 colors 
  27338.  
  27339.     textcols (USHORT) 
  27340.        Number of text columns. 
  27341.  
  27342.     textrows (USHORT) 
  27343.        Number of text rows. 
  27344.  
  27345.     pelcols (USHORT) 
  27346.        Horizontal resolution, number of pel columns. 
  27347.  
  27348.     pelrows (USHORT) 
  27349.        Vertical resolution, number of pel rows. 
  27350.  
  27351.     Attribute Format (UCHAR) 
  27352.        Format of the attributes. 
  27353.  
  27354.     Number of Attributes (UCHAR) 
  27355.        Number of attributes in a character cell. 
  27356.  
  27357.     Buffer Address (ULONG) 
  27358.        32-bit physical address of the physical display buffer for this mode. 
  27359.  
  27360.     Buffer Length (ULONG) 
  27361.        Length of the physical display buffer for this mode. 
  27362.  
  27363.     Full Buffer Size (ULONG) 
  27364.        Size of the buffer required for a full save of the physical display 
  27365.        buffer for this mode. 
  27366.  
  27367.     Partial Buffer Size (ULONG) 
  27368.        Size of the buffer required for a partial (pop-up) save of the physical 
  27369.        display buffer for this mode. 
  27370.  
  27371.     Extended Data Area Address (PCH) 
  27372.        Far address to an extended mode data structure or zero if none. The 
  27373.        format of the extended mode data structure is determined by the device 
  27374.        driver and is unknown to OS/2. 
  27375.  
  27376.  VioHandle (HVIO) - input 
  27377.     Reserved word of 0s. 
  27378.  
  27379.  rc (USHORT) - return 
  27380.     Return code descriptions are: 
  27381.  
  27382.     0         NO_ERROR 
  27383.     436       ERROR_VIO_INVALID_HANDLE 
  27384.     438       ERROR_VIO_INVALID_LENGTH 
  27385.     465       ERROR_VIO_DETACHED 
  27386.     494       ERROR_VIO_EXTENDED_SG 
  27387.  
  27388.  Remarks 
  27389.  
  27390.  Refer to VioSetMode for examples. 
  27391.  
  27392.  
  27393. ΓòÉΓòÉΓòÉ 4.11. VioGetPhysBuf ΓòÉΓòÉΓòÉ
  27394.  
  27395.                                Bindings:  C, MASM
  27396.  
  27397. This call gets addressability to the physical display buffer. 
  27398.  
  27399.  VioGetPhysBuf     (DisplayBuf, Reserved) 
  27400.  
  27401.  DisplayBuf(PVIOPHYSBUF) - input/output 
  27402.     Address of the data structure that contains the physical display buffer 
  27403.     address and length on input and returns the selectors used to address the 
  27404.     display buffer. 
  27405.  
  27406.     displaybufaddr (PBYTE) 
  27407.        Address of the 32 bit start address (selector:offset) of the physical 
  27408.        display buffer passed as input. If displaybuflen is 0, then 
  27409.        displaybufaddr is the far address of the PhysBuf Block described below. 
  27410.  
  27411.     displaybuflen (ULONG) 
  27412.        32 bit length of the physical display buffer. If displaybuflen is 0, 
  27413.        then displaybufaddr is treated as the far address of the PhysBuf Block 
  27414.        described below and the Selector List is not present. 
  27415.  
  27416.     selectors (SEL) 
  27417.        Selector list. 
  27418.  
  27419.        Returns the selectors (each of word-length) that address the physical 
  27420.        display buffer. The first selector returned in the list, addresses the 
  27421.        first 64KB of the physical display buffer or displaybuflen, whichever is 
  27422.        smaller.  If displaybuflen is greater than 64KB, the second selector 
  27423.        addresses the second 64KB. 
  27424.  
  27425.        The last selector returned in the list, addresses the remainder of the 
  27426.        display buffer.  The application is responsible for ensuring enough 
  27427.        space is reserved for the selector list to accommodate the specified 
  27428.        buffer length. 
  27429.  
  27430.     PhysBuf Block (PhysBuf) 
  27431.        Address of the data structure.  The PhysBuf Block is a variable length 
  27432.        data structure.  The first word is the Length of the PhysBuf Block in 
  27433.        bytes.  The remaining words of the structure are the selectors that 
  27434.        address the physical video buffer.  If Length is specified as 2, the 
  27435.        required length of the PhysBuf Block is returned in its place. 
  27436.  
  27437.        PhysBuf Block (USHORT) 
  27438.           Length of PhysBuf structure in bytes 
  27439.  
  27440.        selector (SEL) 
  27441.           First selector 
  27442.  
  27443.        selector (SEL) 
  27444.           Next selector 
  27445.  
  27446.        selector (SEL) 
  27447.           ... ... 
  27448.  
  27449.        selector (SEL) 
  27450.           Last selector 
  27451.  
  27452.  Reserved (USHORT) - input 
  27453.     Reserved word of 0s. 
  27454.  
  27455.  rc (USHORT) - return 
  27456.     Return code descriptions are: 
  27457.  
  27458.     0         NO_ERROR 
  27459.     350       ERROR_VIO_PTR 
  27460.     429       ERROR_VIO_IN_BG 
  27461.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  27462.     436       ERROR_VIO_INVALID_HANDLE 
  27463.     465       ERROR_VIO_DETACHED 
  27464.     494       ERROR_VIO_EXTENDED_SG 
  27465.  
  27466.  Remarks 
  27467.  
  27468.  If displaybuflen = 0, VioGetPhysBuf returns a selector that addresses the 
  27469.  physical display buffer corresponding to the current mode.  One selector is 
  27470.  returned in Selector List. If a VioGetPhysBuf is issued after a VioGetBuf, 
  27471.  then all  VioWrtXX calls will on longer be written to the LVB.  They will only 
  27472.  be written to the physical display buffer. An application uses VioGetPhysBuf 
  27473.  to get addressability to the physical display buffer.  The selector returned 
  27474.  by VioGetPhysBuf may be used only when an application program is executing in 
  27475.  the foreground. When an application wants to access the physical display 
  27476.  buffer, the application must call VioScrLock.  VioScrLock either waits until 
  27477.  the program is running in the foreground or returns a warning when the program 
  27478.  is running in the background.  For more information refer to VioScrLock and 
  27479.  VioScrUnLock. 
  27480.  
  27481.  The buffer range specified for the physical screen buffer must fall between 
  27482.  hex 'A0000' and 'BFFFF' inclusive. An application may issue VioGetPhysBuf only 
  27483.  when it is running in the foreground.  An application may issue VioGetPhysBuf 
  27484.  more than once. 
  27485.  
  27486.  
  27487. ΓòÉΓòÉΓòÉ 4.12. VioGetState ΓòÉΓòÉΓòÉ
  27488.  
  27489.                                Bindings:  C, MASM
  27490.  
  27491. This call returns the current settings of the palette registers, overscan 
  27492. (border) color, blink/background intensity switch, color registers, underline 
  27493. location, or target VioSetMode display configuration. 
  27494.  
  27495.  VioGetState   (RequestBlock, VioHandle) 
  27496.  
  27497.  RequestBlock (PVOID) - input/output 
  27498.     Address of the video state structures consisting of six different 
  27499.     structures depending on the request type: 
  27500.  
  27501.     Type      Definition 
  27502.     0         Get palette registers 
  27503.     1         Get overscan (border) color 
  27504.     2         Get blink/background intensity switch 
  27505.     3         Get color registers 
  27506.     4         Reserved 
  27507.     5         Get the scan line for underlining 
  27508.     6         Get target VioSetMode display configuration. 
  27509.     7         Reserved The six structures, depending on request type, are: 
  27510.  
  27511.     VIOPALSTATE 
  27512.        Applies to EGA, VGA, or IBM Personal System/2 Display Adapter. 
  27513.  
  27514.        length (USHORT) - input 
  27515.           Length of structure, including length. 
  27516.  
  27517.           38        Maximum valid value. 
  27518.  
  27519.        type (USHORT) - input 
  27520.           Request type 0 for palette registers. 
  27521.  
  27522.        palette (USHORT) - input 
  27523.           First palette register in the palette register sequence; must be 
  27524.           specified in the range 0 through 15. The palette registers are 
  27525.           returned in sequential order.  The number returned is based upon 
  27526.           length. 
  27527.  
  27528.        color (USHORT*(length-6)/2) - output 
  27529.           Color value for each palette register.  The maximum number of entries 
  27530.           in the color value array is 16. 
  27531.  
  27532.     VIOOVERSCAN 
  27533.        Applies to CGA, VGA, or IBM Personal System/2 Display Adapter. 
  27534.  
  27535.        length (USHORT) - input 
  27536.           Length of structure, including length. 
  27537.  
  27538.           6         Only valid value. 
  27539.  
  27540.        type (USHORT) - input 
  27541.           Request type 1 for overscan (border) color. 
  27542.  
  27543.        color (USHORT) - input 
  27544.           Color value. 
  27545.  
  27546.     VIOINTENSITY 
  27547.        Applies to CGA, EGA, MCGA, VGA, or IBM Personal System/2 Display 
  27548.        Adapter. 
  27549.  
  27550.        length (USHORT) - input 
  27551.           Length of structure, including length. 
  27552.  
  27553.           6         Only valid value. 
  27554.  
  27555.        type (USHORT) - input 
  27556.           Request type 2 for blink/background intensity switch. 
  27557.  
  27558.        switch (USHORT) - output 
  27559.           Switch set as: 
  27560.  
  27561.           Value     Definition 
  27562.           0         Blinking foreground colors enabled. 
  27563.           1         High intensity background colors enabled. 
  27564.  
  27565.     VIOCOLORREG 
  27566.        Applies to VGA, or IBM Personal System/2 Display Adapter. 
  27567.  
  27568.        length (USHORT) - input 
  27569.           Length of structure, including length. 
  27570.  
  27571.           12        Length in bytes. 
  27572.  
  27573.        type (USHORT) - input 
  27574.           Request type 3 for color registers. 
  27575.  
  27576.        first color (USHORT) - input 
  27577.           First color register to get in the color register sequence; must be 
  27578.           specified in the range 0 through 255. The color registers are 
  27579.           returned in sequential order. 
  27580.  
  27581.        number color (USHORT) - input 
  27582.           Number of color registers to get; must be specified in the range 1 
  27583.           through 256. 
  27584.  
  27585.        datarea (PCH) - input 
  27586.           Far address of a data area where the color registers are returned. 
  27587.           The size of the data area must be three bytes times the number of 
  27588.           color registers to get. The format of each entry returned is as 
  27589.           follows: 
  27590.  
  27591.           Byte 1    Red value 
  27592.           Byte 2    Green value 
  27593.           Byte 3    Blue value 
  27594.  
  27595.     VIOSETULINELOC 
  27596.        Applies to EGA, VGA, or IBM Personal System/2 Display Adapter. 
  27597.  
  27598.        length (USHORT) - input 
  27599.           Length of structure, including length. 
  27600.  
  27601.           6         Length in bytes. 
  27602.  
  27603.        type (USHORT) - input 
  27604.           Request type 5 to get the scan line for underlining. Underlining is 
  27605.           enabled only when the foreground color is 1 or 9. 
  27606.  
  27607.        scanline (USHORT) - output 
  27608.           The value returned is in the range 0 through 31 and is the scan line 
  27609.           minus 1.  A value of 32 means underlining is disabled. 
  27610.  
  27611.     VIOSETTARGET 
  27612.  
  27613.        length (USHORT) - input 
  27614.           Length of structure, including length. 
  27615.  
  27616.           6         Length in bytes. 
  27617.  
  27618.        type (USHORT) - input 
  27619.           Request type 6 to get display configuration selected to be the target 
  27620.           of the next VioSetMode. 
  27621.  
  27622.        select (USHORT) - output 
  27623.           Configuration: 
  27624.  
  27625.           Value     Definition 
  27626.           0         Default selection algorithm. See VioSetMode. 
  27627.           1         Primary 
  27628.           2         Secondary. 
  27629.  
  27630.  VioHandle (HVIO) - input 
  27631.     Reserved word of 0s. 
  27632.  
  27633.  rc (USHORT) - return 
  27634.     Return code descriptions are: 
  27635.  
  27636.     0         NO_ERROR 
  27637.     355       ERROR_VIO_MODE 
  27638.     421       ERROR_VIO_INVALID_PARMS 
  27639.     436       ERROR_VIO_INVALID_HANDLE 
  27640.     438       ERROR_VIO_INVALID_LENGTH 
  27641.     465       ERROR_VIO_DETACHED 
  27642.     494       ERROR_VIO_EXTENDED_SG 
  27643.  
  27644.  
  27645.  Family API Considerations 
  27646.  
  27647.  Request type = 6, Get Target VioSetMode Display Configuration, and request 
  27648.  type = 5, Get Underline Location, are not supported in the family API. 
  27649.  
  27650.  
  27651. ΓòÉΓòÉΓòÉ 4.13. VioGlobalReg ΓòÉΓòÉΓòÉ
  27652.  
  27653.                                Bindings:  C, MASM
  27654.  
  27655. VioGlobalReg allows a subsystem to receive notification at the completion of 
  27656. VIO calls issued by all applications running in full-screen sessions. 
  27657.  
  27658.  VioGlobalReg    (ModuleName, EntryPoint, FunctionMask1, FunctionMask2, 0) 
  27659.  
  27660.  ModuleName (PSZ) - input 
  27661.     Address of the ASCIIZ string containing the 1-8 character file name of the 
  27662.     subsystem.  The maximum length of the ASCIIZ string is 9 bytes including 
  27663.     the terminating byte of zero.  The module must be a dynamic link library 
  27664.     but the name supplied must not include the .DLL extension. 
  27665.  
  27666.  EntryPoint (PSZ) - input 
  27667.     Address of the ASCIIZ name string containing the dynamic link entry point 
  27668.     name of the routine in the subsystem to receive control when any of the 
  27669.     registered functions is called.  The maximum length of the ASCIIZ string is 
  27670.     33 bytes including the terminating byte of zero. 
  27671.  
  27672.  FunctionMask1 (ULONG) - input 
  27673.     A bit mask where each bit identifies a video function being registered. 
  27674.     The bit definitions are shown below.  The first word pushed onto the stack 
  27675.     contains the high-order 16 bits of the function mask, and the second word 
  27676.     contains the low-order 
  27677.     16 bits. 
  27678.  
  27679.  
  27680.           BIT   REGISTERED FUNCTION         BIT   REGISTERED FUNCTION
  27681.          ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  27682.           31    VioPrtScToggle              15    VioWrtCharStr
  27683.           30    VioEndPopUp                 14    VioWrtTTY
  27684.           29    VioPopUp                    13    VioWrtNCell
  27685.           28    VioSavRedrawUndo            12    VioWrtNAttr
  27686.           27    VioSavRedrawWait            11    VioWrtNChar
  27687.           26    VioScrUnLock                10    VioReadCellStr
  27688.           25    VioScrLock                  9     VioReadCharStr
  27689.           24    VioPrtSc                    8     VioShowBuf
  27690.           23    VioGetAnsi                  7     VioSetMode
  27691.           22    VioSetAnsi                  6     VioSetCurType
  27692.           21    VioScrollRt                 5     VioSetCurPos
  27693.           20    VioScrollLf                 4     VioGetPhysBuf
  27694.           19    VioScrollDn                 3     VioGetBuf
  27695.           18    VioScrollUp                 2     VioGetMode
  27696.           17    VioWrtCellStr               1     VioGetCurType
  27697.           16    VioWrtCharStrAtt            0     VioGetCurPos
  27698.  
  27699.  FunctionMask2 (ULONG) - input 
  27700.     A bit mask where each bit identifies a video function being registered. 
  27701.     The bit mask has the format shown below.  The first word pushed onto the 
  27702.     stack contains the high order 16 bits of the function mask, and the second 
  27703.     word contains the low order 16 bits. Unused bits are reserved and must be 
  27704.     set to zero. 
  27705.  
  27706.     Bit       Registered Function 
  27707.  
  27708.     31-11     Reserved, must be set to zero. 
  27709.     10        VioDeRegister 
  27710.     9         VioRegister 
  27711.     8         VioSetState 
  27712.     7         VioGetState 
  27713.     6         VioSetFont 
  27714.     5         VioGetCp 
  27715.     4         VioSetCp 
  27716.     3         VioGetConfig 
  27717.     2         VioGetFont 
  27718.     1         VioModeUndo 
  27719.     0         VioModeWait 
  27720.  
  27721.  Reserved (LONG) - input 
  27722.     Reserved and must be zero. 
  27723.  
  27724.  rc (USHORT) - return 
  27725.     Return code descriptions are: 
  27726.  
  27727.     0         NO_ERROR 
  27728.     349       ERROR_VIO_INVALID_MASK 
  27729.     403       ERROR_VIO_INVALID_ASCIIZ 
  27730.     426       ERROR_VIO_REGISTER 
  27731.     494       ERROR_VIO_EXTENDED_SG 
  27732.  
  27733.  Remarks 
  27734.  
  27735.  Notification of VIO calls issued within the hard error handler and DOS (real 
  27736.  mode) sessions is not provided. 
  27737.  
  27738.  When control is routed to EntryPoint, the stack appears as it did after the 
  27739.  original VIO call except that four additional values have been  pushed onto 
  27740.  the stack.  The first is the index number (WORD) of the routine called.  The 
  27741.  second is a near pointer (WORD).  The third is the caller's DS register 
  27742.  (WORD).  The fourth is the return address (DWORD) to the VIO router. 
  27743.  
  27744.  For example, if VioSetCurPos were a registered function, the stack would 
  27745.  appear as if the following instruction sequence were executed if VioSetCurPos 
  27746.  were called and control routed to EntryPoint: 
  27747.  
  27748.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  27749.    Γöé PUSH     WORD     Row                                 Γöé
  27750.    Γöé PUSH     WORD     Column                              Γöé
  27751.    Γöé PUSH     WORD     VioHandle                           Γöé
  27752.    Γöé CALL     FAR      VioSetCurPos                        Γöé
  27753.    Γöé PUSH     WORD     Index                               Γöé
  27754.    Γöé CALL     NEAR     Entry point in Vio router           Γöé
  27755.    Γöé PUSH     WORD     Caller's DS                         Γöé
  27756.    Γöé CALL     FAR      Dynamic link entry point            Γöé
  27757.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  27758.  
  27759.  The index numbers that correspond to the registered functions are listed 
  27760.  below: 
  27761.  
  27762.  0  VioGetPhysBuf          22 VioSetAnsi 
  27763.  1  VioGetBuf              23 VioGetAnsi 
  27764.  2  VioShowBuf             24 VioPrtSc 
  27765.  3  VioGetCurPos           25 VioScrLock 
  27766.  4  VioGetCurType          26 VioScrUnLock 
  27767.  5  VioGetMode             27 VioSavRedrawWait 
  27768.  6  VioSetCurPos           28 VioSavRedrawUndo 
  27769.  7  VioSetCurType          29 VioPopUp 
  27770.  8  VioSetMode             30 VioEndPopUp 
  27771.  9  VioReadCharStr         31 VioPrtScToggle 
  27772.  10 VioReadCellStr         32 VioModeWait 
  27773.  11 VioWrtNChar            33 VioModeUndo 
  27774.  12 VioWrtNAttr            34 VioGetFont 
  27775.  13 VioWrtNCell            35 VioGetConfig 
  27776.  14 VioWrtCharStr          36 VioSetCp 
  27777.  15 VioWrtCharStrAtt       37 VioGetCp 
  27778.  16 VioWrtCellStr          38 VioSetFont 
  27779.  17 VioWrtTTY              39 VioGetState 
  27780.  18 VioScrollUp            40 VioSetState 
  27781.  19 VioScrollDn            41 VioRegister 
  27782.  20 VioScrollLf            42 VioDeRegister 
  27783.  21 VioScrollRt 
  27784.  
  27785.  On entry to the global subsystem, AX contains the return code that is returned 
  27786.  to the application that issued the VIO call.  The global subsystem must return 
  27787.  with all stack parameters and all general purpose registers, including AX, 
  27788.  restored to the same values as on entry. 
  27789.  
  27790.  All VIO functions within a session are serialized on a thread basis.  That is, 
  27791.  when a global subsystem receives control, it can safely assume that it is not 
  27792.  called again from the same session until the current call has completed. 
  27793.  Note, however, that VIO calls across different sessions are not serialized. 
  27794.  
  27795.  VioGlobalReg may only be issued during system initialization. After system 
  27796.  initialization, VioGlobalReg returns ERROR_VIO_REGISTER.  A globally 
  27797.  registered subsystem is active for the life of the system. 
  27798.  
  27799.  If multiple global subsystems are registered, they  are given control in the 
  27800.  order that they are registered. 
  27801.  
  27802.  A globally registered subsystem receives control on VIO calls issued from all 
  27803.  full-screen sessions except the hard error handler and DOS (real mode) 
  27804.  sessions. 
  27805.  
  27806.  
  27807. ΓòÉΓòÉΓòÉ 4.14. VioModeUndo ΓòÉΓòÉΓòÉ
  27808.  
  27809.                                Bindings:  C, MASM
  27810.  
  27811. This call allows one thread within a process to cancel a VioModeWait issued by 
  27812. another thread within the same process. 
  27813.  
  27814.  VioModeUndo     (OwnerIndic, KillIndic, Reserved) 
  27815.  
  27816.  OwnerIndic (USHORT) - input 
  27817.     Indicates whether the thread issuing VioModeUndo wants ownership of 
  27818.     VioModeWait to be reserved for its process. 
  27819.  
  27820.     Value     Definition 
  27821.     0         Reserve ownership 
  27822.     1         Give up ownership. 
  27823.  
  27824.  KillIndic (USHORT) - input 
  27825.     Indicates whether the thread (with the outstanding VioModeWait) should be 
  27826.     returned an error code or be terminated. 
  27827.  
  27828.     Value     Definition 
  27829.     0         Return error code 
  27830.     1         Terminate thread. 
  27831.  
  27832.  Reserved (USHORT) - input 
  27833.     Reserved word of 0s. 
  27834.  
  27835.  rc (USHORT) - return 
  27836.     Return code descriptions are: 
  27837.  
  27838.     0         NO_ERROR 
  27839.     421       ERROR_VIO_INVALID_PARMS 
  27840.     422       ERROR_VIO_FUNCTION_OWNED 
  27841.     427       ERROR_VIO_NO_MODE_THREAD 
  27842.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  27843.     465       ERROR_VIO_DETACHED 
  27844.     486       ERROR_VIO_BAD_RESERVE 
  27845.     494       ERROR_VIO_EXTENDED_SG 
  27846.  
  27847.  Remarks 
  27848.  
  27849.  VioModeUndo may be issued only by a thread within the process that owns 
  27850.  VioModeWait.  The thread issuing VioModeUndo can either reserve ownership of 
  27851.  the VioModeWait function for its process or give up ownership.  The thread 
  27852.  whose VioModeWait is cancelled is optionally terminated. 
  27853.  
  27854.  
  27855. ΓòÉΓòÉΓòÉ 4.15. VioModeWait ΓòÉΓòÉΓòÉ
  27856.  
  27857.                                Bindings:  C, MASM
  27858.  
  27859. This call allows a graphics mode application to be notified when it must 
  27860. restore its video mode, state, and modified display adapter registers.  The 
  27861. return from this function call provides the notification. 
  27862.  
  27863.  VioModeWait     (RequestType, NotifyType, Reserved) 
  27864.  
  27865.  RequestType (USHORT) - input 
  27866.     Application request event. RequestType = 0 indicates the application wants 
  27867.     to be notified at the end of a pop-up to restore its mode.  RequestType = 0 
  27868.     is the only event supported by VioModeWait. 
  27869.  
  27870.  NotifyType (PUSHORT) - output 
  27871.     Address of the operation to be performed by the application returning from 
  27872.     VioModeWait.  NotifyType = 0, indicating restore mode, is the only type of 
  27873.     notification returned. 
  27874.  
  27875.  Reserved (USHORT) - input 
  27876.     Reserved word of 0s. 
  27877.  
  27878.  rc (USHORT) - return 
  27879.     Return code descriptions are: 
  27880.  
  27881.     0         NO_ERROR 
  27882.     421       ERROR_VIO_INVALID_PARMS 
  27883.     422       ERROR_VIO_FUNCTION_OWNED 
  27884.     423       ERROR_VIO_RETURN 
  27885.     424       ERROR_SCS_INVALID_FUNCTION 
  27886.     428       ERROR_VIO_NO_SAVE_RESTORE_THD 
  27887.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  27888.     465       ERROR_VIO_DETACHED 
  27889.     494       ERROR_VIO_EXTENDED_SG 
  27890.  
  27891.  Remarks 
  27892.  
  27893.  At the completion of an application or hard error pop-up (reference VioPopUp), 
  27894.  OS/2 notifies the session that was originally interrupted for the pop-up to 
  27895.  restore its mode.  The return from this function call provides that 
  27896.  notification.  The thread that issued the call must perform the restore and 
  27897.  then immediately re-issue VioModeWait. 
  27898.  
  27899.  When an application's VioModeWait thread is notified, the thread must restore 
  27900.  its video mode, state, and modified display adapter registers.  An 
  27901.  application's VioModeWait thread does not restore the physical display buffer. 
  27902.  OS/2 saves/restores the physical display buffer over a pop-up. 
  27903.  
  27904.  Only one process for a session can issue VioModeWait.  The first process that 
  27905.  issues VioModeWait becomes the owner of this function. (Refer to VioModeUndo.) 
  27906.  
  27907.  An application must issue VioModeWait only if it writes directly to the 
  27908.  registers on the display adapter. Otherwise, the application can allow OS/2 to 
  27909.  perform the required restore by not issuing VioModeWait. 
  27910.  
  27911.  When an application issues VioModeWait, it is also required to issue 
  27912.  VioSavRedrawWait to be notified at screen switch time to perform a full save 
  27913.  or restore (reference VioSavRedrawWait. Two application threads must be 
  27914.  dedicated to performing these operations. 
  27915.  
  27916.  
  27917. ΓòÉΓòÉΓòÉ 4.16. VioPopUp ΓòÉΓòÉΓòÉ
  27918.  
  27919.                                Bindings:  C, MASM
  27920.  
  27921. This call is issued by an application process when it requires a temporary 
  27922. screen to display a momentary message to the user. 
  27923.  
  27924.  VioPopUp    (Options, VioHandle) 
  27925.  
  27926.  Options (PUSHORT) - input 
  27927.     Address of the bit flags that indicate which options to the application are 
  27928.     being selected. 
  27929.  
  27930.     Bit       Description 
  27931.  
  27932.     15-2      Reserved, set to zero. 
  27933.  
  27934.     1         0 = Non-transparent operation.  The video mode is set to 
  27935.               text-mode 3, 3*, 3+, 7, or 7+. The highest resolution supported 
  27936.               by the primary display adapter configured in the system is 
  27937.               selected.  The screen is cleared, and the cursor is positioned in 
  27938.               the upper left corner of the display. 
  27939.  
  27940.               1 = Transparent operation.  If the video mode of the outgoing 
  27941.               foreground session is text (mode 2, 3, 7, or one of the * or + 
  27942.               variations of these modes), no mode change occurs.  The screen is 
  27943.               not cleared, and the cursor remains in its current position.  If 
  27944.               transparent operation is selected, and if the video mode of the 
  27945.               outgoing foreground session is not text (or if the outgoing 
  27946.               foreground session has a VioSavRedrawWait thread), the pop-up 
  27947.               request is refused. A unique error code 
  27948.               ERROR_VIO_TRANSPARENT_POPUP is returned in this case. 
  27949.  
  27950.               OS/2 is responsible for saving and restoring the physical display 
  27951.               buffer of the previous foreground session around a pop-up.  This 
  27952.               is true whether transparent or non-transparent operation is 
  27953.               selected. 
  27954.  
  27955.     0         0 = Return with unique error code ERROR_VIO_EXISTING_POPUP if 
  27956.               pop-up is not immediately available. 
  27957.  
  27958.               1 = Wait if pop-up is not immediately available. 
  27959.  
  27960.  VioHandle (HVIO) - input 
  27961.     Reserved words of 0s. 
  27962.  
  27963.  rc (USHORT) - return 
  27964.     Return code descriptions are: 
  27965.  
  27966.     0         NO_ERROR 
  27967.     405       ERROR_VIO_NO_POPUP 
  27968.     406       ERROR_VIO_EXISTING_POPUP 
  27969.     483       ERROR_VIO_TRANSPARENT_POPUP 
  27970.  
  27971.  Remarks 
  27972.  
  27973.  VioPopUp is normally issued by the application when it is running in the 
  27974.  background and wishes to immediately display a message to the user without 
  27975.  waiting to become the active foreground session. 
  27976.  
  27977.  When an application process issues VioPopUp, it should wait for the return 
  27978.  from the request.  If the process allows any of its threads to write to the 
  27979.  screen before VioPopUp returns a successful return code, the screen output may 
  27980.  be directed to the application's normal video buffer rather than to the pop-up 
  27981.  screen. If the process allows any of its threads to issue keyboard or mouse 
  27982.  calls before VioPopUp returns a successful return code, the input is directed 
  27983.  from the application's normal session. Once the process that issued VioPopUp 
  27984.  receives a successful return code, video and keyboard calls issued by any of 
  27985.  the threads in the pop-up process are directed to the pop-up screen.  This 
  27986.  continues until the process issues VioEndPopUp. At that time video and 
  27987.  keyboard calls resume being directed to the application's normal video buffer. 
  27988.  
  27989.  There may be only one pop-up in existence at any time.  If a process requests 
  27990.  a pop-up and a pop-up already exists, the process has the choice of waiting 
  27991.  for the prior pop-up to complete or receiving an immediate return with an 
  27992.  error code.  The error code indicates that the operation failed due to an 
  27993.  existing pop-up having captured the screen. 
  27994.  
  27995.  Video pop-ups provide a mechanism for a background application to notify the 
  27996.  operator of an abnormal event the operator must take some action.  When 
  27997.  considering the suitability of using pop-ups in a particular situation, the 
  27998.  possible disruptive effect of pop-ups to the operator should be considered. 
  27999.  If the operator were interrupted frequently by pop-ups issued by background 
  28000.  applications, the operator would not effectively work with the foreground 
  28001.  application. 
  28002.  
  28003.  While a video pop-up is in the foreground, the operator cannot use the hot key 
  28004.  to switch to another application or to the shell .  Before the operator can 
  28005.  switch another application or the shell to the foreground, the pop-up 
  28006.  application must issue VioEndPopUp. 
  28007.  
  28008.  While a video pop-up is in effect, all video calls from the previous 
  28009.  foreground session are blocked until the process that issued VioPopUp issues 
  28010.  VioEndPopUp. 
  28011.  
  28012.  When VioPopUp is issued, only the process within the session that issued 
  28013.  VioPopUp is brought to the foreground.  Assuming the session was already the 
  28014.  foreground session, any video calls issued by other processes in that session 
  28015.  are blocked until the process that issued VioPopUp issues VioEndPopUp. 
  28016.  
  28017.  DosExecPgm may not be issued by a process during a pop-up. The following video 
  28018.  calls are the only calls that may be issued during the pop-up by the process 
  28019.  that issued VioPopUp: 
  28020.  
  28021.  VioEndPopUp         VioScrollLf 
  28022.  VioGetConfig        VioSetCurPos 
  28023.  VioGetCp            VioSetCurType 
  28024.  VioGetFont          VioSetCp 
  28025.  VioGetAnsi          VioSetFont 
  28026.  VioGetState         VioSetState 
  28027.  VioGetCurPos        VioWrtNChar 
  28028.  VioGetCurType       VioWrtNAttr 
  28029.  VioGetMode          VioWrtNCell 
  28030.  VioReadCharStr      VioWrtCharStr 
  28031.  VioReadCellStr      VioWrtCharStrAtt 
  28032.  VioScrollRt         VioWrtCellStr 
  28033.  VioScrollUp         VioWrtTTY 
  28034.  VioScrollDn 
  28035.  
  28036.  Selectors to the physical display buffer that the issuing process obtained on 
  28037.  a prior VioGetPhysBuf call may not be used during the pop-up. 
  28038.  
  28039.  When an application registers a replacement for VioPopUp within a session, the 
  28040.  registered routine is invoked only when that session is in the foreground.  If 
  28041.  VioPopUp is issued when that session is in the background, the OS/2 default 
  28042.  routine is invoked. If the application's session is using a keyboard or mouse 
  28043.  monitor, the monitor does not intercept data while the pop-up is active. 
  28044.  
  28045.  
  28046.  PM Considerations 
  28047.  
  28048.  This function can be used from within a PM application.  Kbdxxx, Mouxxx, and 
  28049.  Vioxxx calls (with a zero handle) are all allowed between VioPopUp and 
  28050.  VioEndPopUp, and are directed to the pop-up screen.  An error is returned if 
  28051.  issued with a non-zero handle. 
  28052.  
  28053.  
  28054. ΓòÉΓòÉΓòÉ 4.17. VioPrtSc ΓòÉΓòÉΓòÉ
  28055.  
  28056.                                Bindings:  C, MASM
  28057.  
  28058. This call is issued by the Session Manager when the operator presses PrtSc. 
  28059.  
  28060.  VioPrtSc  (VioHandle) 
  28061.  
  28062.  VioHandle (HVIO) - input 
  28063.     Reserved word of 0s. 
  28064.  
  28065.  rc (USHORT) - return 
  28066.     Return code descriptions are: 
  28067.  
  28068.     0         NO_ERROR 
  28069.     355       ERROR_VIO_MODE 
  28070.     402       ERROR_VIO_SMG_ONLY 
  28071.     436       ERROR_VIO_INVALID_HANDLE 
  28072.     465       ERROR_VIO_DETACHED 
  28073.  
  28074.  Remarks 
  28075.  
  28076.  VioPrtSc supports text modes 0 through 3, and 7. An Alternate Video Subsystem 
  28077.  may want to register a replacement for VioPrtSc. An advanced video subsystem 
  28078.  could set a graphics mode while the mode known to the base video subsystem 
  28079.  PrtSc routine is text.  Then, if the operator presses PrtSc, the printer 
  28080.  output is unpredictable. VioPrtSc is reserved for use by the session manager. 
  28081.  Application programs may not issue VioPrtSc. 
  28082.  
  28083.  Three beeps are generated if a hard error is detected while writing to the 
  28084.  printer. 
  28085.  
  28086.  
  28087. ΓòÉΓòÉΓòÉ 4.18. VioPrtScToggle ΓòÉΓòÉΓòÉ
  28088.  
  28089.                                Bindings:  C, MASM
  28090.  
  28091. This call is called by the Session Manager when the operator presses Ctrl and 
  28092. PrtSc. 
  28093.  
  28094.  VioPrtScToggle   (VioHandle) 
  28095.  
  28096.  VioHandle (HVIO) - input 
  28097.     Reserved word of 0s. 
  28098.  
  28099.  rc (USHORT) - return 
  28100.     Return code descriptions are: 
  28101.  
  28102.     0         NO_ERROR 
  28103.     355       ERROR_VIO_MODE 
  28104.     402       ERROR_VIO_SMG_ONLY 
  28105.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28106.     436       ERROR_VIO_INVALID_HANDLE 
  28107.     465       ERROR_VIO_DETACHED 
  28108.  
  28109.  Remarks 
  28110.  
  28111.  VioPrtScToggle toggles the Ctrl and PrtSc state of the foreground session. 
  28112.  When the Ctrl and PrtSc state is on, all VioWrtTTY calls from that session are 
  28113.  echoed to the print device. 
  28114.  
  28115.  VioPrtScToggle can only be called by the session manager. If an application 
  28116.  issues this call, it receives an error code. 
  28117.  
  28118.  Three beeps are generated if a hard error is detected while writing to the 
  28119.  printer.  When Ctrl and PrtSc is turned off, the operator may have to press 
  28120.  the Enter key to cause output spooled while Ctrl and PrtSc was active to be 
  28121.  printed. This is because the spool files are closed when the next VioWrtTTY is 
  28122.  executed in the session, such as writing the prompt in response to the Enter 
  28123.  key. 
  28124.  
  28125.  
  28126. ΓòÉΓòÉΓòÉ 4.19. VioReadCellStr ΓòÉΓòÉΓòÉ
  28127.  
  28128.                                Bindings:  C, MASM
  28129.  
  28130. This call reads a string of character-attribute pairs (cells) from the screen, 
  28131. starting at the specified location. 
  28132.  
  28133.  VioReadCellStr     (CellStr, Length, Row, Column, VioHandle) 
  28134.  
  28135.  CellStr (PCH) - output 
  28136.     Address of the buffer where the cell string is returned. 
  28137.  
  28138.  Length (PUSHORT) - input/output 
  28139.     Address of the buffer length in bytes.  Length must take into account that 
  28140.     each character-attribute(s) entry in the buffer is 2 or 4 bytes.  If the 
  28141.     length of the buffer is not sufficient, the last entry is not complete. 
  28142.  
  28143.  Row (USHORT) - input 
  28144.     Starting row of the field to read, 0 is the top row. 
  28145.  
  28146.  Column (USHORT) - input 
  28147.     Starting column of the field to read, 0 is the leftmost column. 
  28148.  
  28149.  VioHandle (HVIO) - input 
  28150.     This must be zero unless the caller is a Presentation Manager application, 
  28151.     in which case it must be the value returned by VioGetPs. 
  28152.  
  28153.  rc (USHORT) - return 
  28154.     Return code descriptions are: 
  28155.  
  28156.     0         NO_ERROR 
  28157.     355       ERROR_VIO_MODE 
  28158.     358       ERROR_VIO_ROW 
  28159.     359       ERROR_VIO_COL 
  28160.     436       ERROR_VIO_INVALID_HANDLE 
  28161.     465       ERROR_VIO_DETACHED 
  28162.  
  28163.  Remarks 
  28164.  
  28165.  If a string read comes to the end of the line and is not complete, the string 
  28166.  read continues at the beginning of the next line.  If the read comes to the 
  28167.  end of the screen and is not complete, the read terminates and the length is 
  28168.  set to the length of the buffer that was filled. 
  28169.  
  28170.  
  28171.  PM Considerations 
  28172.  
  28173.  VioReadCellStr reads a string of character/attributes (or cells) from the 
  28174.  Advanced VIO presentation space starting at the specified location. 
  28175.  
  28176.  
  28177. ΓòÉΓòÉΓòÉ 4.20. VioReadCharStr ΓòÉΓòÉΓòÉ
  28178.  
  28179.                                Bindings:  C, MASM
  28180.  
  28181. This call reads a string of characters from the display starting at the 
  28182. specified location. 
  28183.  
  28184.  VioReadCharStr     (CharStr, Length, Row, Column, VioHandle) 
  28185.  
  28186.  CharStr (PCH) - output 
  28187.     Address of the buffer where the character string is returned. 
  28188.  
  28189.  Length (PUSHORT) - input/output 
  28190.     Address of the buffer length in bytes. 
  28191.  
  28192.  Row (USHORT) - input 
  28193.     Starting row of the field to read, 0 is the top row. 
  28194.  
  28195.  Column (USHORT) - input 
  28196.     Starting column of the field to read, 0 is the leftmost column. 
  28197.  
  28198.  VioHandle (HVIO) - input 
  28199.     This must be zero unless the caller is a Presentation Manager application, 
  28200.     in which case it must be the value returned by VioGetPs. 
  28201.  
  28202.  rc (USHORT) - return 
  28203.     Return code descriptions are: 
  28204.  
  28205.     0         NO_ERROR 
  28206.     355       ERROR_VIO_MODE 
  28207.     358       ERROR_VIO_ROW 
  28208.     359       ERROR_VIO_COL 
  28209.     436       ERROR_VIO_INVALID_HANDLE 
  28210.     465       ERROR_VIO_DETACHED 
  28211.  
  28212.  Remarks 
  28213.  
  28214.  If a string read comes to the end of the line and is not complete, then the 
  28215.  string read continues at the beginning of the next line.  If the read comes to 
  28216.  the end of the screen and is not complete, the read terminates and the length 
  28217.  is set to the number of characters read. 
  28218.  
  28219.  
  28220.  PM Considerations 
  28221.  
  28222.  VioReadCharStr reads a character string from the Advanced VIO presentation 
  28223.  space starting at the specified location. 
  28224.  
  28225.  
  28226. ΓòÉΓòÉΓòÉ 4.21. VioRegister ΓòÉΓòÉΓòÉ
  28227.  
  28228.                                Bindings:  C, MASM
  28229.  
  28230. This call registers an alternate video subsystem within a session. 
  28231.  
  28232.  VioRegister    (ModuleName, EntryPoint, FunctionMask1, FunctionMask2) 
  28233.  
  28234.  ModuleName (PSZ) - input 
  28235.     Address of the ASCIIZ string containing the 1-8 character file name of the 
  28236.     subsystem.  The maximum length of the ASCIIZ string is 9 bytes including 
  28237.     the terminating byte of zero.  The module must be a dynamic link library 
  28238.     but the name supplied must not include the .DLL extension. 
  28239.  
  28240.  EntryPoint (PSZ) - input 
  28241.     Address of the ASCIIZ name string containing the dynamic link entry point 
  28242.     name of the routine in the subsystem to receive control when any of the 
  28243.     registered functions is called.  The maximum length of the ASCIIZ string is 
  28244.     33 bytes including the terminating byte of zero. 
  28245.  
  28246.  FunctionMask1 (ULONG) - input 
  28247.     A bit mask where each bit identifies a video function being registered. 
  28248.     The bit definitions are shown below.  The first word pushed onto the stack 
  28249.     contains the high-order 16 bits of the function mask, and the second word 
  28250.     contains the low-order 
  28251.     16 bits. 
  28252.  
  28253.  
  28254.           BIT   REGISTERED FUNCTION         BIT   REGISTERED FUNCTION
  28255.          ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ-
  28256.           31    VioPrtScToggle              15    VioWrtCharStr
  28257.           30    VioEndPopUp                 14    VioWrtTTY
  28258.           29    VioPopUp                    13    VioWrtNCell
  28259.           28    VioSavRedrawUndo            12    VioWrtNAttr
  28260.           27    VioSavRedrawWait            11    VioWrtNChar
  28261.           26    VioScrUnLock                10    VioReadCellStr
  28262.           25    VioScrLock                  9     VioReadCharStr
  28263.           24    VioPrtSc                    8     VioShowBuf
  28264.           23    VioGetAnsi                  7     VioSetMode
  28265.           22    VioSetAnsi                  6     VioSetCurType
  28266.           21    VioScrollRt                 5     VioSetCurPos
  28267.           20    VioScrollLf                 4     VioGetPhysBuf
  28268.           19    VioScrollDn                 3     VioGetBuf
  28269.           18    VioScrollUp                 2     VioGetMode
  28270.           17    VioWrtCellStr               1     VioGetCurType
  28271.           16    VioWrtCharStrAtt            0     VioGetCurPos
  28272.  
  28273.  FunctionMask2 (ULONG) - input 
  28274.     A bit mask where each bit identifies a video function being registered. 
  28275.     The bit mask has the format shown below. The first word pushed onto the 
  28276.     stack contains the high order 16 bits of the function mask, and the second 
  28277.     word contains the low order 16 bits. Unused bits are reserved and must be 
  28278.     set to zero. 
  28279.  
  28280.     Bit       Description 
  28281.     31-9      Reserved, set to zero 
  28282.     8         VioSetState 
  28283.     7         VioGetState 
  28284.     6         VioSetFont 
  28285.     5         VioGetCp 
  28286.     4         VioSetCp 
  28287.     3         VioGetConfig 
  28288.     2         VioGetFont 
  28289.     1         VioModeUndo 
  28290.     0         VioModeWait 
  28291.  
  28292.  rc (USHORT) - return 
  28293.     Return code descriptions are: 
  28294.  
  28295.     0         NO_ERROR 
  28296.     349       ERROR_VIO_INVALID_MASK 
  28297.     403       ERROR_VIO_INVALID_ASCIIZ 
  28298.     426       ERROR_VIO_REGISTER 
  28299.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28300.     465       ERROR_VIO_DETACHED 
  28301.     494       ERROR_VIO_EXTENDED_SG 
  28302.  
  28303.  Remarks 
  28304.  
  28305.  An alternate video subsystem must register which video calls it handles. The 
  28306.  default OS/2 video subsystem is the Base Video Subsystem. 
  28307.  
  28308.  When any of the registered functions are called, control is routed to 
  28309.  EntryPoint.  When this routine is entered, four additional values (5 words) 
  28310.  are pushed onto the stack. 
  28311.  
  28312.  The first value is the index number (Word) of the routine being called.  The 
  28313.  second value is a near pointer (Word).  The third value is the caller's DS 
  28314.  register (Word).  The fourth value is the return address (DWord) to the VIO 
  28315.  router. 
  28316.  
  28317.  For example, if VioSetCurPos were a registered function, the stack would 
  28318.  appear as if the following instruction sequence were executed if VioSetCurPos 
  28319.  were called and control routed to EntryPoint: 
  28320.  
  28321.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  28322.    Γöé PUSH     WORD     Row                                 Γöé
  28323.    Γöé PUSH     WORD     Column                              Γöé
  28324.    Γöé PUSH     WORD     VioHandle                           Γöé
  28325.    Γöé CALL     FAR      VioSetCurPos                        Γöé
  28326.    Γöé PUSH     WORD     Index                               Γöé
  28327.    Γöé CALL     NEAR     Entry point in Vio router           Γöé
  28328.    Γöé PUSH     WORD     Caller's DS                         Γöé
  28329.    Γöé CALL     FAR      Dynamic link entry point            Γöé
  28330.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  28331.  
  28332.  The index numbers that correspond to the registered functions are listed 
  28333.  below: 
  28334.  
  28335.  0  VioGetPhysBuf          22 VioSetAnsi 
  28336.  1  VioGetBuf              23 VioGetAnsi 
  28337.  2  VioShowBuf             24 VioPrtSc 
  28338.  3  VioGetCurPos           25 VioScrLock 
  28339.  4  VioGetCurType          26 VioScrUnLock 
  28340.  5  VioGetMode             27 VioSavRedrawWait 
  28341.  6  VioSetCurPos           28 VioSavRedrawUndo 
  28342.  7  VioSetCurType          29 VioPopUp 
  28343.  8  VioSetMode             30 VioEndPopUp 
  28344.  9  VioReadCharStr         31 VioPrtScToggle 
  28345.  10 VioReadCellStr         32 VioModeWait 
  28346.  11 VioWrtNChar            33 VioModeUndo 
  28347.  12 VioWrtNAttr            34 VioGetFont 
  28348.  13 VioWrtNCell            35 VioGetConfig 
  28349.  14 VioWrtCharStr          36 VioSetCp 
  28350.  15 VioWrtCharStrAtt       37 VioGetCp 
  28351.  16 VioWrtCellStr          38 VioSetFont 
  28352.  17 VioWrtTTY              39 VioGetState 
  28353.  18 VioScrollUp            40 VioSetState 
  28354.  19 VioScrollDn 
  28355.  20 VioScrollLf 
  28356.  21 VioScrollRt 
  28357.  
  28358.  When a registered function returns to the video router, the return code is 
  28359.  interpreted as follows: 
  28360.  
  28361.  Return code = 0 
  28362.            No error.  Do not invoke the corresponding Base Video Subsystem 
  28363.            routine.  Return to caller with Return code = 0. 
  28364.  
  28365.  Return code = -1 
  28366.            No error.  Invoke the corresponding Base Video Subsystem routine. 
  28367.            Return to caller with Return code = return code from Base Video 
  28368.            Subsystem. 
  28369.  
  28370.  Return code = error (not 0 or -1) 
  28371.            Do not invoke the corresponding Base Video Subsystem routine. Return 
  28372.            to caller with Return code = error. 
  28373.  
  28374.  When an application registers a replacement for VioPopUp within a session, the 
  28375.  registered routine is only invoked when that session is in the foreground.  If 
  28376.  VioPopUp is issued when that session is in the background, the OS/2 default 
  28377.  routine is invoked. 
  28378.  
  28379.  An alternate video subsystem should be designed so the routines registered do 
  28380.  not cause any hard errors when they are invoked. Otherwise, a system lockout 
  28381.  occurs.  Code and data segments of registered routines, that might be loaded 
  28382.  from diskette, must be preloaded. 
  28383.  
  28384.  All VIO functions within a session are serialized on a thread basis.  That is, 
  28385.  when an alternate video subsystem receives control, it can safely assume that 
  28386.  it is not called again from the same session until  the current call has 
  28387.  completed. 
  28388.  
  28389.  
  28390. ΓòÉΓòÉΓòÉ 4.22. VioSavRedrawUndo ΓòÉΓòÉΓòÉ
  28391.  
  28392.                                Bindings:  C, MASM
  28393.  
  28394. This call allows one thread within a process to cancel a VioSavRedrawWait 
  28395. issued by another thread within the same process. 
  28396.  
  28397.  VioSavRedrawUndo     (OwnerIndic, KillIndic, VioHandle) 
  28398.  
  28399.  OwnerIndic (USHORT) - input 
  28400.     Indicates whether the thread issuing VioSavRedrawUndo wants ownership of 
  28401.     VioSavRedrawWait to be reserved for its process. 
  28402.  
  28403.     Value     Definition 
  28404.     0         Reserve ownership 
  28405.     1         Give up ownership. 
  28406.  
  28407.  KillIndic (USHORT) - input 
  28408.     Indicates whether the thread with the outstanding VioSavRedrawWait should 
  28409.     be returned an error code or be terminated. 
  28410.  
  28411.     Value     Definition 
  28412.     0         Return error code 
  28413.     1         Terminate thread. 
  28414.  
  28415.  VioHandle (HVIO) - input 
  28416.     Reserved word of 0s. 
  28417.  
  28418.  rc (USHORT) - return 
  28419.     Return code descriptions are: 
  28420.  
  28421.     0         NO_ERROR 
  28422.     421       ERROR_VIO_INVALID_PARMS 
  28423.     422       ERROR_VIO_FUNCTION_OWNED 
  28424.     428       ERROR_VIO_NO_SAVE_RESTORE_THD 
  28425.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28426.     465       ERROR_VIO_DETACHED 
  28427.     494       ERROR_VIO_EXTENDED_SG 
  28428.  
  28429.  Remarks 
  28430.  
  28431.  The issuing thread can reserve ownership of VioSavRedrawWait for its process 
  28432.  or give it up. The thread whose VioSavRedrawWait was cancelled is optionally 
  28433.  terminated. VioSavRedrawUndo may be issued only by a thread within the same 
  28434.  process that owns VioSavRedrawWait. 
  28435.  
  28436.  
  28437. ΓòÉΓòÉΓòÉ 4.23. VioSavRedrawWait ΓòÉΓòÉΓòÉ
  28438.  
  28439.                                Bindings:  C, MASM
  28440.  
  28441. This call notifies a graphics mode application when it must save or redraw its 
  28442. screen image. 
  28443.  
  28444.  VioSavRedrawWait     (SavRedrawIndic, NotifyType, VioHandle) 
  28445.  
  28446.  SavRedrawIndic (USHORT) - input 
  28447.     Indicates which events the application is waiting for: 
  28448.  
  28449.     Value     Definition 
  28450.     0         The session manager notifies the application for both save and 
  28451.               redraw operations. 
  28452.     1         The session manager notifies the application for redraw 
  28453.               operations only. 
  28454.  
  28455.  NotifyType (PUSHORT) - output 
  28456.     Address that specifies the operation to be performed by the application 
  28457.     upon return from VioSavRedrawWait: 
  28458.  
  28459.     Value     Definition 
  28460.     0         Save screen image 
  28461.     1         Restore screen image. 
  28462.  
  28463.  VioHandle (HVIO) - input 
  28464.     Reserved word of 0s. 
  28465.  
  28466.  rc (USHORT) - return 
  28467.     Return code descriptions are: 
  28468.  
  28469.     0         NO_ERROR 
  28470.     421       ERROR_VIO_INVALID_PARMS 
  28471.     422       ERROR_VIO_FUNCTION_OWNED 
  28472.     423       ERROR_VIO_RETURN 
  28473.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28474.     436       ERROR_VIO_INVALID_HANDLE 
  28475.     465       ERROR_VIO_DETACHED 
  28476.     494       ERROR_VIO_EXTENDED_SG 
  28477.  
  28478.  Remarks 
  28479.  
  28480.  OS/2 uses VioSavRedrawWait to notify a graphics mode application to save or 
  28481.  restore its screen image at screen switch time.  The application in the 
  28482.  outgoing foreground session is notified to perform a save.  The application in 
  28483.  the incoming foreground session is notified to perform a restore.  The 
  28484.  application must perform the action requested and immediately re-issue 
  28485.  VioSavRedrawWait.  When an application performs a save, it saves its physical 
  28486.  display buffer, video mode, and any other information the application needs to 
  28487.  completely redraw its screen at restore time. 
  28488.  
  28489.  Only one process per session can issue VioSavRedrawWait.  The process that 
  28490.  first issues VioSavRedrawWait becomes the owner of the function. 
  28491.  
  28492.  A text mode application must issue VioSavRedrawWait only if the application 
  28493.  writes directly to the registers on the display adapter. Assuming 
  28494.  VioSavRedrawWait is not issued by a text mode application, OS/2 performs the 
  28495.  required saves and restores. 
  28496.  
  28497.  An application that issues VioSavRedrawWait may also need to issue 
  28498.  VioModeWait.  This would allow the application to be notified when it must 
  28499.  restore its mode at the completion of an application or hard error pop-up. 
  28500.  Refer to VioModeWait for more information.  Two application threads would be 
  28501.  required to perform these operations in this case. 
  28502.  
  28503.  At the time a VioSavRedrawWait thread is notified, the session is in 
  28504.  transition to/from the background.  Although the session's official status is 
  28505.  background, any selector to the physical display buffer previously obtained by 
  28506.  the VioSavRedrawWait process (through VioGetPhysBuf) is valid at this time. 
  28507.  The physical display buffer must be accessed without issuing VioScrLock. 
  28508.  Since the session's official status is background, any thread waits if it 
  28509.  issues VioScrLock with the "wait if unsuccessful" option. 
  28510.  
  28511.  An application containing a VioSavRedrawWait thread should be designed so that 
  28512.  the process does not cause any hard errors while the VioSavRedrawWait thread 
  28513.  is running, otherwise a system lockout may occur. 
  28514.  
  28515.  An application's VioSavRedrawWait thread may be notified to perform a restore 
  28516.  before it is notified to perform a save.  This happens if the application was 
  28517.  running in the background the first time it issued VioSavRedrawWait.  The 
  28518.  return from this function call provides the notification.  The thread that 
  28519.  issues the call performs the save or redraw and then reissues VioSavRedrawWait 
  28520.  to wait until its screen image must be saved or redrawn again. 
  28521.  
  28522.  
  28523. ΓòÉΓòÉΓòÉ 4.24. VioScrLock ΓòÉΓòÉΓòÉ
  28524.  
  28525.                                Bindings:  C, MASM
  28526.  
  28527. This call requests ownership of (locks) the physical display buffer. 
  28528.  
  28529.  VioScrLock    (WaitFlag, Status, VioHandle) 
  28530.  
  28531.  WaitFlag (USHORT) - input 
  28532.     Indicates whether the process should block until the screen I/O can take 
  28533.     place. 
  28534.  
  28535.     Value     Definition 
  28536.     0         Return if screen I/O not available 
  28537.     1         Wait until screen I/O is available. 
  28538.  
  28539.  Status (PUCHAR) - output 
  28540.     Address of the Indicator of whether the lock is successful, described 
  28541.     below. 
  28542.  
  28543.     Value     Definition 
  28544.     0         Lock successful 
  28545.     1         Lock unsuccessful (in the case of no wait). 
  28546.  
  28547.               Status is returned only when AX = 0. 
  28548.  
  28549.               Status = 1 may be returned only when WaitFlag = 0. 
  28550.  
  28551.  VioHandle (HVIO) - input 
  28552.     Reserved word of 0s. 
  28553.  
  28554.  rc (USHORT) - return 
  28555.     Return code descriptions are: 
  28556.  
  28557.     0         NO_ERROR 
  28558.     366       ERROR_VIO_WAIT_FLAG 
  28559.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28560.     434       ERROR_VIO_LOCK 
  28561.     436       ERROR_VIO_INVALID_HANDLE 
  28562.     465       ERROR_VIO_DETACHED 
  28563.     494       ERROR_VIO_EXTENDED_SG 
  28564.  
  28565.  Remarks 
  28566.  
  28567.  This function call permits a process to determine if I/O to the physical 
  28568.  screen buffer can take place.  This prevents the process from writing to the 
  28569.  physical buffer when the process is in the background. Processes must 
  28570.  cooperate with the system in coordinating screen accesses. 
  28571.  
  28572.  Screen switching is disabled while the screen lock is in place. If a screen 
  28573.  switch is suspended by a screen lock, and if the application holding the lock 
  28574.  does not issue VioScrUnLock within a system-defined time limit, the screen 
  28575.  switch occurs, and the process holding the lock is frozen in the background. A 
  28576.  process should yield the screen lock as soon as possible to avoid being frozen 
  28577.  when running in the background.  The timeout on the lock does not begin until 
  28578.  a screen switch is requested. 
  28579.  
  28580.  When the screen lock is in effect and another thread in the same or different 
  28581.  process (in the same session) issues VioScrLock, the second thread receives an 
  28582.  error code.  VioScrUnLock must be issued by a thread within the same process 
  28583.  that issued VioScrLock. 
  28584.  
  28585.  
  28586.  Family API Considerations 
  28587.  
  28588.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  28589.  Therefore, the following restriction applies to VioScrLock when coding in the 
  28590.  DOS mode: 
  28591.  
  28592.  The status always indicates the lock is successful (Return code = 0). 
  28593.  
  28594.  
  28595. ΓòÉΓòÉΓòÉ 4.25. VioScrollDn ΓòÉΓòÉΓòÉ
  28596.  
  28597.                                Bindings:  C, MASM
  28598.  
  28599. This call scrolls the entire display buffer (or area specified within the 
  28600. display buffer) down. 
  28601.  
  28602.  VioScrollDn   (TopRow, LeftCol, BotRow, RightCol, Lines, Cell, VioHandle) 
  28603.  
  28604.  TopRow (USHORT) - input 
  28605.     Top row to be scrolled. 
  28606.  
  28607.  LeftCol (USHORT) - input 
  28608.     Left column to be scrolled. 
  28609.  
  28610.  BotRow (USHORT) - input 
  28611.     Bottom row to be scrolled. 
  28612.  
  28613.  RightCol (USHORT) - input 
  28614.     Right column to be scrolled. 
  28615.  
  28616.  Lines (USHORT) - input 
  28617.     Number of lines to be inserted at the top of the screen area being 
  28618.     scrolled. If 0 is specified, no lines are scrolled. 
  28619.  
  28620.  Cell (PBYTE) - input 
  28621.     Address of the character-attribute(s) pair (2 or 4 bytes) used as a fill 
  28622.     character on inserted lines. 
  28623.  
  28624.  VioHandle (HVIO) - input 
  28625.     This must be zero unless the caller is a Presentation Manager application, 
  28626.     in which case it must be the value returned by VioGetPs. 
  28627.  
  28628.  rc (USHORT) - return 
  28629.     Return code descriptions are: 
  28630.  
  28631.     0         NO_ERROR 
  28632.     355       ERROR_VIO_MODE 
  28633.     358       ERROR_VIO_ROW 
  28634.     359       ERROR_VIO_COL 
  28635.     436       ERROR_VIO_INVALID_HANDLE 
  28636.     465       ERROR_VIO_DETACHED 
  28637.  
  28638.  Remarks 
  28639.  
  28640.  TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen. 
  28641.  
  28642.  If a value greater than the maximum value is specified for TopRow, LeftCol, 
  28643.  BotRow, RightCol, or Lines, the maximum value for that parameter is used. 
  28644.  
  28645.  If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines = 65535 (or -1 in 
  28646.  assembler language), the entire screen is filled with the character-attribute 
  28647.  pair defined by Cell. 
  28648.  
  28649.  
  28650. ΓòÉΓòÉΓòÉ 4.26. VioScrollLf ΓòÉΓòÉΓòÉ
  28651.  
  28652.                                Bindings:  C, MASM
  28653.  
  28654. This call scrolls the entire display buffer (or area specified within the 
  28655. display buffer) to the left. 
  28656.  
  28657.  VioScrollLf   (TopRow, LeftCol, BotRow, RightCol, Lines, Cell, VioHandle) 
  28658.  
  28659.  TopRow (USHORT) - input 
  28660.     Top row to be scrolled. 
  28661.  
  28662.  LeftCol (USHORT) - input 
  28663.     Left column to be scrolled. 
  28664.  
  28665.  BotRow (USHORT) - input 
  28666.     Bottom row to be scrolled. 
  28667.  
  28668.  RightCol (USHORT) - input 
  28669.     Right column to be scrolled. 
  28670.  
  28671.  Lines (USHORT) - input 
  28672.     Number of columns to be inserted at the right of the screen area being 
  28673.     scrolled. If 0 is specified, no lines are scrolled. 
  28674.  
  28675.  Cell (PBYTE) - input 
  28676.     Address of the character attribute(s) pair (2 or 4 bytes) used as a fill 
  28677.     character on inserted columns. 
  28678.  
  28679.  VioHandle (HVIO) - input 
  28680.     This must be zero unless the caller is a Presentation Manager application, 
  28681.     in which case it must be the value returned by VioGetPs. 
  28682.  
  28683.  rc (USHORT) - return 
  28684.     Return code descriptions are: 
  28685.  
  28686.     0         NO_ERROR 
  28687.     355       ERROR_VIO_MODE 
  28688.     358       ERROR_VIO_ROW 
  28689.     359       ERROR_VIO_COL 
  28690.     436       ERROR_VIO_INVALID_HANDLE 
  28691.     465       ERROR_VIO_DETACHED 
  28692.  
  28693.  Remarks 
  28694.  
  28695.  TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen. 
  28696.  
  28697.  If a value greater than the maximum value is specified for TopRow, LeftCol, 
  28698.  BotRow, RightCol, or Lines, the maximum value for that parameter is used. 
  28699.  
  28700.  If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines = 65535 (or -1 in 
  28701.  assembler language), the entire screen is filled with the character-attribute 
  28702.  pair defined by Cell. 
  28703.  
  28704.  
  28705. ΓòÉΓòÉΓòÉ 4.27. VioScrollRt ΓòÉΓòÉΓòÉ
  28706.  
  28707.                                Bindings:  C, MASM
  28708.  
  28709. This call scrolls the entire display buffer (or area specified within the 
  28710. display buffer) to the right. 
  28711.  
  28712.  VioScrollRt   (TopRow, LeftCol, BotRow, RightCol, Lines, Cell, VioHandle) 
  28713.  
  28714.  TopRow (USHORT) - input 
  28715.     Top row to be scrolled. 
  28716.  
  28717.  LeftCol (USHORT) - input 
  28718.     Left column to be scrolled. 
  28719.  
  28720.  BotRow (USHORT) - input 
  28721.     Bottom row to be scrolled. 
  28722.  
  28723.  RightCol (USHORT) - input 
  28724.     Right column to be scrolled. 
  28725.  
  28726.  Lines (USHORT) - input 
  28727.     Number of columns to be inserted at the left of the screen area being 
  28728.     scrolled. If 0 is specified, no lines are scrolled. 
  28729.  
  28730.  Cell (PBYTE) - input 
  28731.     Address of the character attribute(s) pair (2 or 4 bytes) used as a fill 
  28732.     character on inserted columns. 
  28733.  
  28734.  VioHandle (HVIO) - input 
  28735.     This must be zero unless the caller is a Presentation Manager application, 
  28736.     in which case it must be the value returned by VioGetPs. 
  28737.  
  28738.  rc (USHORT) - return 
  28739.     Return code descriptions are: 
  28740.  
  28741.     0         NO_ERROR 
  28742.     355       ERROR_VIO_MODE 
  28743.     358       ERROR_VIO_ROW 
  28744.     359       ERROR_VIO_COL 
  28745.     436       ERROR_VIO_INVALID_HANDLE 
  28746.     465       ERROR_VIO_DETACHED 
  28747.  
  28748.  Remarks 
  28749.  
  28750.  TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen. 
  28751.  
  28752.  If a value greater than the maximum value is specified for TopRow, LeftCol, 
  28753.  BotRow, RightCol, or Lines, the maximum value for that parameter is used. 
  28754.  
  28755.  If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines = 65535 (or -1 in 
  28756.  assembler language), the entire screen is filled with the character-attribute 
  28757.  pair defined by Cell. 
  28758.  
  28759.  
  28760. ΓòÉΓòÉΓòÉ 4.28. VioScrollUp ΓòÉΓòÉΓòÉ
  28761.  
  28762.                                Bindings:  C, MASM
  28763.  
  28764. This call scrolls the entire display buffer (or area specified within the 
  28765. display buffer) up. 
  28766.  
  28767.  VioScrollUp   (TopRow, LeftCol, BotRow, RightCol, Lines, Cell, VioHandle) 
  28768.  
  28769.  TopRow (USHORT) - input 
  28770.     Top row to be scrolled. 
  28771.  
  28772.  LeftCol (USHORT) - input 
  28773.     Left column to be scrolled. 
  28774.  
  28775.  BotRow (USHORT) - input 
  28776.     Bottom row to be scrolled. 
  28777.  
  28778.  RightCol (USHORT) - input 
  28779.     Right column to be scrolled. 
  28780.  
  28781.  Lines (USHORT) - input 
  28782.     Number of lines to be inserted at the bottom of the screen area being 
  28783.     scrolled. 
  28784.     If 0 is specified, no lines are scrolled. 
  28785.  
  28786.  Cell (PBYTE) - input 
  28787.     Address of the character attribute(s) pair (2 or 4 bytes) used as a fill 
  28788.     character on inserted lines. 
  28789.  
  28790.  VioHandle (HVIO) - input 
  28791.     This must be zero unless the caller is a Presentation Manager application, 
  28792.     in which case it must be the value returned by VioGetPs. 
  28793.  
  28794.  rc (USHORT) - return 
  28795.     Return code descriptions are: 
  28796.  
  28797.     0         NO_ERROR 
  28798.     355       ERROR_VIO_MODE 
  28799.     358       ERROR_VIO_ROW 
  28800.     359       ERROR_VIO_COL 
  28801.     436       ERROR_VIO_INVALID_HANDLE 
  28802.     465       ERROR_VIO_DETACHED 
  28803.  
  28804.  Remarks 
  28805.  
  28806.  TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen. 
  28807.  
  28808.  If a value greater than the maximum value is specified for TopRow, LeftCol, 
  28809.  BotRow, RightCol, or Lines, the maximum value for that parameter is used. 
  28810.  
  28811.  If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines = 65535 (or -1 in 
  28812.  assembler language), the entire screen is filled with the character-attribute 
  28813.  pair defined by Cell. 
  28814.  
  28815.  
  28816. ΓòÉΓòÉΓòÉ 4.29. VioScrUnLock ΓòÉΓòÉΓòÉ
  28817.  
  28818.                                Bindings:  C, MASM
  28819.  
  28820. This call releases ownership of (unlocks) the physical display buffer. 
  28821.  
  28822.  VioScrUnLock    (VioHandle) 
  28823.  
  28824.  VioHandle (HVIO) - input 
  28825.     Reserved word of 0s. 
  28826.  
  28827.  rc (USHORT) - return 
  28828.     Return code descriptions are: 
  28829.  
  28830.     0         NO_ERROR 
  28831.     367       ERROR_VIO_UNLOCK 
  28832.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28833.     436       ERROR_VIO_INVALID_HANDLE 
  28834.     465       ERROR_VIO_DETACHED 
  28835.     494       ERROR_VIO_EXTENDED_SG 
  28836.  
  28837.  Remarks 
  28838.  
  28839.  This call releases the screen lock that is set by VioScrLock. The VioScrUnLock 
  28840.  call must be issued by a thread in the same process as the thread that issued 
  28841.  VioScrLock. 
  28842.  
  28843.  
  28844.  Family API Considerations 
  28845.  
  28846.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  28847.  Therefore, the following restriction applies to VioScrUnLock when coding in 
  28848.  the DOS mode: 
  28849.  
  28850.  The status always indicates the unlock is successful (return code = 0). 
  28851.  
  28852.  
  28853. ΓòÉΓòÉΓòÉ 4.30. VioSetAnsi ΓòÉΓòÉΓòÉ
  28854.  
  28855.                                Bindings:  C, MASM
  28856.  
  28857. This call activates or deactivates ANSI support. 
  28858.  
  28859.  VioSetAnsi    (Indicator, VioHandle) 
  28860.  
  28861.  Indicator (USHORT) - input 
  28862.     Equals 1 to activate ANSI support or 0 to deactivate ANSI. 
  28863.  
  28864.  VioHandle (HVIO) - input 
  28865.     This must be zero unless the caller is a Presentation Manager application, 
  28866.     in which case it must be the value returned by VioGetPs. 
  28867.  
  28868.  rc (USHORT) - return 
  28869.     Return code descriptions are: 
  28870.  
  28871.     0         NO_ERROR 
  28872.     355       ERROR_VIO_MODE 
  28873.     421       ERROR_VIO_INVALID_PARMS 
  28874.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  28875.     436       ERROR_VIO_INVALID_HANDLE 
  28876.     465       ERROR_VIO_DETACHED 
  28877.  
  28878.  Remarks 
  28879.  
  28880.  For ANSI support, "ON" is the default. 
  28881.  
  28882.  
  28883. ΓòÉΓòÉΓòÉ 4.31. VioSetCp ΓòÉΓòÉΓòÉ
  28884.  
  28885.                                Bindings:  C, MASM
  28886.  
  28887. This call allows a process to set the code page used to display text data on 
  28888. the screen for the specified handle. 
  28889.  
  28890.  VioSetCp    (Reserved, CodePageID, VioHandle) 
  28891.  
  28892.  Reserved (USHORT) - input 
  28893.     Reserved word of 0s. 
  28894.  
  28895.  CodePageID (USHORT) - input 
  28896.     The CodePageID must be either 0, -1, -2, or have been specified on the 
  28897.     CONFIG.SYS CODEPAGE = statement. A value of 0000 indicates that the code 
  28898.     page is to be set to the default ROM code page provided by the hardware. A 
  28899.     value of -1 enables the user font codepage if user fonts have previously 
  28900.     been set with VioSetFont. A value of -2 disables the user font and 
  28901.     re-enables the prepared system codepage or ROM codepage that was active 
  28902.     before the user font was enabled. 
  28903.  
  28904.     If the code page ID is not 0, -1, -2, or does not match one of the ID's on 
  28905.     the CODEPAGE = statement, an error results. Refer to IBM Operating System/2 
  28906.     Command Reference for a complete description of CODEPAGE. 
  28907.  
  28908.  VioHandle (HVIO) - input 
  28909.     This must be zero unless the caller is a Presentation Manager application, 
  28910.     in which case it must be the value returned by VioGetPs. 
  28911.  
  28912.  rc (USHORT) - return 
  28913.     Return code descriptions are: 
  28914.  
  28915.     0         NO_ERROR 
  28916.     355       ERROR_VIO_MODE 
  28917.     436       ERROR_VIO_INVALID_HANDLE 
  28918.     465       ERROR_VIO_DETACHED 
  28919.     469       ERROR_VIO_BAD_CP 
  28920.     470       ERROR_VIO_NO_CP 
  28921.     471       ERROR_VIO_NA_CP 
  28922.  
  28923.  Remarks 
  28924.  
  28925.  VioSetCp can be used to enable and disable the user font code page as well as 
  28926.  the prepared system code pages.  If a prepared system code page or the ROM 
  28927.  code page is specified, any previously set code page is disabled and the 
  28928.  specified code page is enabled. 
  28929.  
  28930.  Specifying the special code page of -1 enables the user font code page if user 
  28931.  fonts have previously been set.  Specifying the special code page of -2 
  28932.  disables the user font code page and re-enables the prepared system code page 
  28933.  or ROM code page that was active before the user font code page was enabled. 
  28934.  
  28935.  
  28936.  PM Considerations 
  28937.  
  28938.  Valid CodePageID values are 0 or one that was specified on the CONFIG.SYS 
  28939.  CODEPAGE = statement; -1 and -2 are not valid for PM. 
  28940.  
  28941.  This call can be used to set an EBCDIC code page for Advanced VIO.  For a 
  28942.  full-screen or Vio-windowed application, this function causes the displayed 
  28943.  characters to be reinterpreted immediately in the new code page.  For a 
  28944.  Presentation Manager application, the characters in the base font are 
  28945.  reinterpreted in the new code page only when other events cause the characters 
  28946.  to be repainted.  This function has no effect on displayed characters that use 
  28947.  a font other than the base font. 
  28948.  
  28949.  
  28950. ΓòÉΓòÉΓòÉ 4.32. VioSetCurPos ΓòÉΓòÉΓòÉ
  28951.  
  28952.                                Bindings:  C, MASM
  28953.  
  28954. This call sets the cursor's coordinates on the screen. 
  28955.  
  28956.  VioSetCurPos    (Row, Column, VioHandle) 
  28957.  
  28958.  Row (USHORT) - input 
  28959.     New cursor row position, 0 is the top row. 
  28960.  
  28961.  Column (USHORT) - input 
  28962.     New cursor column position, 0 is the leftmost column. 
  28963.  
  28964.  VioHandle (HVIO) - input 
  28965.     This must be zero unless the caller is a Presentation Manager application, 
  28966.     in which case it must be the value returned by VioGetPs. 
  28967.  
  28968.  rc (USHORT) - return 
  28969.     Return code descriptions are: 
  28970.  
  28971.     0         NO_ERROR 
  28972.     355       ERROR_VIO_MODE 
  28973.     358       ERROR_VIO_ROW 
  28974.     359       ERROR_VIO_COL 
  28975.     436       ERROR_VIO_INVALID_HANDLE 
  28976.     465       ERROR_VIO_DETACHED 
  28977.  
  28978.  
  28979. ΓòÉΓòÉΓòÉ 4.33. VioSetCurType ΓòÉΓòÉΓòÉ
  28980.  
  28981.                                Bindings:  C, MASM
  28982.  
  28983. This call sets the cursor type. 
  28984.  
  28985.  VioSetCurType    (CursorData, VioHandle) 
  28986.  
  28987.  CursorData (PVIOCURSORINFO) - input 
  28988.     Address of the cursor characteristics structure: 
  28989.  
  28990.     startline (USHORT) 
  28991.        Horizontal scan line in the character cell that marks the top line of 
  28992.        the cursor.  If the character cell has n scan lines, 0 is the top scan 
  28993.        line of the character cell and (n - 1) is the bottom scan line. 
  28994.  
  28995.     endline (USHORT) 
  28996.        Horizontal scan line in the character cell that marks the bottom line of 
  28997.        the cursor.  Scan lines within a character cell are numbered as defined 
  28998.        in startline.  The maximum value allowed is 31. 
  28999.  
  29000.     cursorwidth (USHORT) 
  29001.        Width of the cursor. In text modes, cursorwidth is the number of 
  29002.        columns. The maximum number supported by the OS/2 base video subsystem 
  29003.        is 1. In graphics modes, cursorwidth is the number of pels. 
  29004.  
  29005.        A value of 0 specifies the default width.  In text modes, this is 1 
  29006.        column. In graphics modes, this is the number of pels equivalent to the 
  29007.        width of one character. 
  29008.  
  29009.     cursorattrib (USHORT) 
  29010.        A value of -1 denotes a hidden cursor, all other values denote a normal 
  29011.        cursor. 
  29012.  
  29013.  VioHandle (HVIO) - input 
  29014.     This must be zero unless the caller is a Presentation Manager application, 
  29015.     in which case it must be the value returned by VioGetPs. 
  29016.  
  29017.  rc (USHORT) - return 
  29018.     Return code descriptions are: 
  29019.  
  29020.     0         NO_ERROR 
  29021.     355       ERROR_VIO_MODE 
  29022.     356       ERROR_VIO_WIDTH 
  29023.     421       ERROR_VIO_INVALID_PARMS 
  29024.     436       ERROR_VIO_INVALID_HANDLE 
  29025.     465       ERROR_VIO_DETACHED 
  29026.  
  29027.  Remarks 
  29028.  
  29029.  To set CursorStartLine and CursorEndLine independent of the number of scan 
  29030.  lines for each character cell, you may specify these parameters as 
  29031.  percentages.  OS/2 then calculates the physical start and end scan lines, 
  29032.  respectively, by multiplying the percentage specified for the parameter by the 
  29033.  total number of scan lines in the character cell and rounding to the nearest 
  29034.  scan line. Percentages are specified as negative 
  29035.  values (or 0) in the range 0 through -100.  Specifying CursorStartLine = -90 
  29036.  and 
  29037.  CursorEndLine = -100 requests a cursor that occupies the bottom 10 percent of 
  29038.  the character cell. 
  29039.  
  29040.  
  29041.  PM Considerations 
  29042.  
  29043.  Set the cursor type.  The cursor type consists of the cursor start line, end 
  29044.  line, width (assumed 0 - one column width) and attribute (normal or hidden). 
  29045.  
  29046.  
  29047. ΓòÉΓòÉΓòÉ 4.34. VioSetFont ΓòÉΓòÉΓòÉ
  29048.  
  29049.                                Bindings:  C, MASM
  29050.  
  29051. This call downloads a display font.  The font being set must be compatible with 
  29052. the current mode. 
  29053.  
  29054.  VioSetFont    (RequestBlock, VioHandle) 
  29055.  
  29056.  RequestBlock (PVIOFONTINFO) - input 
  29057.     Address of the font structure containing the request: 
  29058.  
  29059.     length (USHORT) 
  29060.        Length of structure, including length. 
  29061.  
  29062.        14        Only valid value. 
  29063.  
  29064.     reqtype (USHORT) 
  29065.        Request type: 
  29066.  
  29067.        Type      Definition 
  29068.        0         Set current RAM font for EGA, VGA, or IBM Personal System/2 
  29069.                  Display Adapter. 
  29070.  
  29071.     pelcolumns (USHORT) 
  29072.        Pel columns in character cell. 
  29073.  
  29074.     pelrows (USHORT) 
  29075.        Pel rows in character cell. 
  29076.  
  29077.     fonttable (PVOID) 
  29078.        Address of the data area containing font table to set. 
  29079.  
  29080.     tablelength (USHORT) 
  29081.        Length, in bytes, of the caller-supplied data area; must be 256 times 
  29082.        the character cell height specified in pelrows. 
  29083.  
  29084.  VioHandle (HVIO) - input 
  29085.     Reserved word of 0s. 
  29086.  
  29087.  rc (USHORT) - return 
  29088.     Return code descriptions are: 
  29089.  
  29090.     0         NO_ERROR 
  29091.     355       ERROR_VIO_MODE 
  29092.     421       ERROR_VIO_INVALID_PARMS 
  29093.     436       ERROR_VIO_INVALID_HANDLE 
  29094.     438       ERROR_VIO_INVALID_LENGTH 
  29095.     465       ERROR_VIO_DETACHED 
  29096.     467       ERROR_VIO_FONT 
  29097.     468       ERROR_VIO_USER_FONT 
  29098.     494       ERROR_VIO_EXTENDED_SG 
  29099.  
  29100.  Remarks 
  29101.  
  29102.  VioSetFont is applicable only for the enhanced graphics adapter, VGA or IBM 
  29103.  Personal System/2 Display Adapter. 
  29104.  
  29105.  Note:  Although graphics mode support is provided in VioSetFont, this support 
  29106.         is not provided by the Base Video Handlers provided with OS/2. 
  29107.  
  29108.  When VioSetFont is issued, the current code page is reset. If VioGetCp is 
  29109.  subsequently issued, the error code ERROR_VIO_USER_FONT is returned. Return 
  29110.  code, ERROR_VIO_USER_FONT represents a warning.  It indicates that although 
  29111.  the font could not be loaded into the adapter using the current mode, the font 
  29112.  was saved as part of a special user font code page for use with a later 
  29113.  VioSetMode. Successfully setting a user font sets the special user font code 
  29114.  page, just as if a code page of -1 was specified using VioSetCp. 
  29115.  
  29116.  The user font code page consists of the most recent user font of each size 
  29117.  that was set by VioSetFont.  For example, if two 8x12 fonts and three 8x16 
  29118.  fonts had been set, only two fonts, the most recent of the 8x12 and 8x16 
  29119.  fonts, would be saved. 
  29120.  
  29121.  The special code page is used in the same way as those code pages specified on 
  29122.  the CODEPAGE = statement in CONFIG.SYS. 
  29123.  
  29124.  
  29125. ΓòÉΓòÉΓòÉ 4.35. VioSetMode ΓòÉΓòÉΓòÉ
  29126.  
  29127.                                Bindings:  C, MASM
  29128.  
  29129. This call sets the mode of the display. 
  29130.  
  29131.  VioSetMode    (ModeData, VioHandle) 
  29132.  
  29133.  ModeData (PVIOMODEINFO) - input 
  29134.     Address of the mode characteristics structure: 
  29135.  
  29136.     length (USHORT) 
  29137.        Input parameter to VioSetMode.  Length specifies the length of the data 
  29138.        structure in bytes including Length itself.  The minimum structure size 
  29139.        required is 3 bytes. OS/2 sets to the first mode (in the list of modes 
  29140.        supported by this display configuration) with a data structure matching 
  29141.        the mode data specified. 
  29142.  
  29143.     type (UCHAR) 
  29144.        Mode characteristics bit mask: 
  29145.  
  29146.        Bit       Description 
  29147.  
  29148.        7-4       Reserved, set to zero. 
  29149.  
  29150.        3         0 = VGA-compatible modes 0 thru 13H. 
  29151.  
  29152.                  1 = Native mode. 
  29153.  
  29154.        2         0 = Enable color burst 
  29155.  
  29156.                  1 = Disable color burst. 
  29157.  
  29158.        1         0 = Text mode. 
  29159.  
  29160.                  1 = Graphics mode. 
  29161.  
  29162.        0         0 = Monochrome compatible mode. 
  29163.  
  29164.                  1 = Other. 
  29165.  
  29166.     numcolors (UCHAR) 
  29167.        Number of colors defined as a power of 2.  This is equivalent to the 
  29168.        number of color bits that define the color, for example: 
  29169.  
  29170.        Value     Definition 
  29171.        0         Monochrome modes 7, 7+, and F. 
  29172.        1         2 colors. 
  29173.        2         4 colors. 
  29174.        4         16 colors. 
  29175.        8         256 colors. 
  29176.  
  29177.     textcols (USHORT) 
  29178.        Number of text columns. 
  29179.  
  29180.     textrows (USHORT) 
  29181.        Number of text rows. 
  29182.  
  29183.     pelcols (USHORT) 
  29184.        Horizontal resolution, number of pel columns. 
  29185.  
  29186.     pelrows (USHORT) 
  29187.        Vertical resolution, number of pel rows. 
  29188.  
  29189.     Attribute Format (UCHAR) 
  29190.        Identifies the format of the attributes. 
  29191.  
  29192.     Number of Attributes (UCHAR) 
  29193.        Identifies the number of attributes in a character cell. 
  29194.  
  29195.     Buffer Address (ULONG) 
  29196.        32-bit physical address of the physical display buffer for this mode. 
  29197.  
  29198.     Buffer Length (ULONG) 
  29199.        Length of the physical display buffer for this mode. 
  29200.  
  29201.     Full Buffer Size (ULONG) 
  29202.        Size of the buffer required for a full save of the physical display 
  29203.        buffer for this mode. 
  29204.  
  29205.     Partial Buffer Size (ULONG) 
  29206.        Size of the buffer required for a partial (pop-up) save of the physical 
  29207.        display buffer for this mode. 
  29208.  
  29209.     Extended Data Area Address (PCH) 
  29210.        Far address to an extended mode data structure or zero if none.  The 
  29211.        format of the extended mode data structure is determined by the device 
  29212.        driver and is unknown to OS/2. 
  29213.  
  29214.  VioHandle (HVIO) - input 
  29215.     Reserved word of 0s. 
  29216.  
  29217.  rc (USHORT) - return 
  29218.     Return code descriptions are: 
  29219.  
  29220.     0         NO_ERROR 
  29221.     355       ERROR_VIO_MODE 
  29222.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  29223.     436       ERROR_VIO_INVALID_HANDLE 
  29224.     438       ERROR_VIO_INVALID_LENGTH 
  29225.     465       ERROR_VIO_DETACHED 
  29226.     467       ERROR_VIO_FONT 
  29227.     468       ERROR_VIO_USER_FONT 
  29228.     494       ERROR_VIO_EXTENDED_SG 
  29229.  
  29230.  Remarks 
  29231.  
  29232.  VioSetMode initializes the cursor position and type. 
  29233.  
  29234.  VioSetMode does not clear the screen. To clear the screen, use one of the 
  29235.  VioScrollxx calls. 
  29236.  
  29237.  The disable color burst bit in the Type field in the VioSetMode data structure 
  29238.  is functional only for the CGA and VGA. This bit causes the color portion of 
  29239.  the video signal to be suppressed, producing a black and white mode on 
  29240.  composite monitors attached to the CGA.  On VGA, the bit causes the color 
  29241.  lookup table to be loaded with values that produce shades of gray instead of 
  29242.  colors, again producing a black and white mode. For all other combinations of 
  29243.  adapters and displays, the setting of this bit is recorded and returned on any 
  29244.  subsequent VioGetMode call, but otherwise is ignored. 
  29245.  
  29246.  For text modes in full-screen sessions, the number of rows on the screen is 
  29247.  determined by the availability of fonts  of the correct size.  For any 
  29248.  specified mode, the size of the character defined by the font must be 
  29249.  (Horizontal Resolution)/(Text Columns) dots wide and (Vertical 
  29250.  Resolution)/(Text Rows) dots high. For example, an 8x8 font would support 39 
  29251.  through 43 text rows if the screen resolution were 640x350. 
  29252.  
  29253.  If VioSetState request type 6 has been issued previously to select the target 
  29254.  display configuration for VioSetMode, the mode is set on the display 
  29255.  configuration selected. If that display configuration does not support the 
  29256.  mode specified, an error is returned. 
  29257.  
  29258.  Assuming no target display configuration for VioSetMode is selected, the mode 
  29259.  is set on the primary configuration. If the primary configuration does not 
  29260.  support the mode specified, the mode is set on the secondary configuration. 
  29261.  
  29262.  The table below shows the VioSetMode parameters required to set all the modes 
  29263.  supported by the CGA, EGA, VGA, and PS/2 Display Adapters.  The modes native 
  29264.  to the 8514/A and other advanced video adapters are set with the Adapter 
  29265.  (programming) Interface to these adapters, not VioSetMode. 
  29266.  
  29267.  Note:  Although graphics mode support is provided in VioSetMode, this support 
  29268.         is not provided by the Base Video Handlers provided with OS/2. 
  29269.  
  29270.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29271.    Table  5-1. Display Mode Attributes Supported by Adapters
  29272.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29273.    BIOS  TYPE  COLOR  COLS  ROWS  HRES  VRES   VALID ADAPTER/DISPLAY
  29274.    MODE                                        COMBINATIONS [EMULATED]
  29275.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29276.    0     5     4      40    25    320   200    [CGA/CD], CGA/Comp,
  29277.                                                [EGA/CD], [EGA/ECD],
  29278.                                                VGA/Mono, VGA/Color,
  29279.                                                VGA/Plasma
  29280.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29281.    0*    5     4      40    25    320   350    [EGA/ECD], VGA/Mono,
  29282.                                                VGA/Color, VGA/Plasma
  29283.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29284.    0+    5     4      40    25    360   400    VGA/Mono, VGA/Color
  29285.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29286.    0#    5     4      40    25    320   400    VGA/Mono, VGA/Color,
  29287.                                                VGA/Plasma
  29288.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29289.    1     1     4      40    25    320   200    CGA/CD, CGA/Comp,
  29290.                                                EGA/CD, EGA/ECD,
  29291.                                                [VGA/Mono], VGA/Color,
  29292.                                                [VGA/Plasma]
  29293.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29294.    1*    1     4      40    25    320   350    EGA/ECD, [VGA/Mono],
  29295.                                                VGA/Color, [VGA/Plasma]
  29296.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29297.    1+    1     4      40    25    360   400    [VGA/Mono], VGA/Color
  29298.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29299.    1#    1     4      40    25    320   400    [VGA/Mono], VGA/Color,
  29300.                                                [VGA/Plasma]
  29301.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29302.    2     5     4      80    25    640   200    [CGA/CD], CGA/Comp,
  29303.                                                [EGA/CD], [EGA/ECD],
  29304.                                                VGA/Mono, VGA/Color,
  29305.                                                VGA/Plasma
  29306.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29307.    2*    5     4      80    25    640   350    [EGA/ECD], VGA/Mono,
  29308.                                                VGA/Color, VGA/Plasma
  29309.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29310.    2+    5     4      80    25    720   400    VGA/Mono, VGA/Color
  29311.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29312.    2#    5     4      80    25    640   400    VGA/Mono, VGA/Color,
  29313.                                                VGA/Plasma
  29314.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29315.    3     1     4      80    25    640   200    CGA/CD, CGA/Comp,
  29316.                                                EGA/CD, EGA/ECD,
  29317.                                                [VGA/Mono], VGA/Color,
  29318.                                                [VGA/Plasma]
  29319.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29320.    3*    1     4      80    25    640   350    EGA/ECD, [VGA/Mono],
  29321.                                                VGA/Color, [VGA/Plasma]
  29322.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29323.    3+    1     4      80    25    720   400    [VGA/Mono], VGA/Color
  29324.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29325.    3#    1     4      80    25    640   400    [VGA/Mono], VGA/Color,
  29326.                                                [VGA/Plasma]
  29327.   -ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29328.    7     0     0      80    25    720   350    MPA/MD, EGA/MD,
  29329.                                                VGA/Mono, VGA/Color
  29330.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29331.    7+    0     0      80    25    720   400    VGA/Mono, VGA/Color
  29332.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29333.    7#    0     0      80    25    640   400    VGA/Mono, VGA/Color,
  29334.                                                VGA/Plasma
  29335.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29336.    n/a   0     0      80    25    640   350    VGA/Mono, VGA/Color,
  29337.                                                VGA/Plasma
  29338.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29339.    n/a   1     4      80    30    720   480    [VGA/Mono], VGA/Color
  29340.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29341.    n/a   1     4      80    30    640   480    [VGA/Mono], VGA/Color,
  29342.                                                [VGA/Plasma]
  29343.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29344.    4     3     2      [40]  [25]  320   200    CGA/CD, CGA/Comp,
  29345.                                                EGA/CD, EGA/ECD,
  29346.                                                [VGA/Mono], VGA/Color,
  29347.                                                [VGA/Plasma]
  29348.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29349.    5     7     2      [40]  [25]  320   200    [CGA/CD], CGA/Comp,
  29350.                                                [EGA/CD], [EGA/ECD],
  29351.                                                VGA/Mono, VGA/Color,
  29352.                                                VGA/Plasma
  29353.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29354.    6     3     1      [80]  [25]  640   200    CGA/CD, CGA/Comp,
  29355.                                                EGA/CD, EGA/ECD,
  29356.                                                VGA/Mono, VGA/Color,
  29357.                                                VGA/Plasma
  29358.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29359.    D     3     4      [40]  [25]  320   200    EGA/CD, EGA/ECD,
  29360.                                                [VGA/Mono], VGA/Color,
  29361.                                                [VGA/Plasma]
  29362.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29363.    E     3     4      [80]  [25]  640   200    EGA/CD, EGA/ECD,
  29364.                                                [VGA/Mono], VGA/Color,
  29365.                                                [VGA/Plasma]
  29366.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29367.    F     2     0      [80]  [25]  640   350    EGA/MD, VGA/Mono,
  29368.                                                VGA/Color, VGA/Plasma
  29369.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29370.    10    3     4      [80]  [25]  640   350    EGA/ECD, [VGA/Mono],
  29371.                                                VGA/Color, [VGA/Plasma]
  29372.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29373.    11    3     1      [80]  [30]  640   480    VGA/Mono, VGA/Color,
  29374.                                                VGA/Plasma
  29375.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29376.    12    3     4      [80]  [30]  640   480    [VGA/Mono], VGA/Color,
  29377.                                                [VGA/Plasma]
  29378.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29379.    13    3     8      [40]  [25]  320   200    [VGA/Mono], VGA/Color,
  29380.                                                [VGA/Plasma]
  29381.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29382.    n/a   11    8      [80]  [30]  640   480    [8514A/Mono],
  29383.                                                8514A/Color
  29384.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29385.    n/a   11    4      [80]  [30]  640   480    [8514A/Mono],
  29386.                                                8514A/Color
  29387.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29388.    n/a   11    8      [85]  [38]  1024  768    [8514A/HMono],
  29389.                                                8514A/HColor
  29390.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29391.    n/a   11    4      [85]  [38]  1024  768    [8514A/HMono],
  29392.                                                8514A/HColor
  29393.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29394.    Display Adapters:
  29395.  
  29396.    MPA       Monochrome/Printer Adapter
  29397.    CGA       Color Graphics Adapter
  29398.    EGA       Enhanced Graphics Adapter
  29399.    VGA       Video Graphics Array, PS/2 Display Adapter
  29400.    8514A     8514/A Display Adapter
  29401.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29402.    Displays:
  29403.  
  29404.    MD        5151 Monochrome Display
  29405.    CD        5153 Color Display
  29406.    ECD       5154 Enhanced Color Display
  29407.    MONO      8503 PS/2 Monochrome Display, 8507/8604 Display
  29408.    HMONO     8507/8604 Display
  29409.    COLOR     8512/13 PS/2 Color Display, 8514 Display
  29410.    HCOLOR    8514 Display
  29411.    PLASMA    Plasma Display Panel
  29412.    COMP      Composite Video Monitor
  29413.  
  29414.    Notes:
  29415.  
  29416.    1.  Types 0, 1, and 5 are text modes; types 2, 3, 7, and 11 are
  29417.        graphics modes.
  29418.    2.  For BIOS modes 0, 2, 5, the color burst is disabled on the
  29419.        CGA and VGA.
  29420.    3.  The Personal System/2 Display Adapter 8514/A(TM) has advanced
  29421.        function modes, which are supported through the 8514/A display
  29422.        adapter interface, not the VIO Subsystem.  Refer to the
  29423.        Personal System/2 Display Adapter 8514/A Technical Reference
  29424.        for details of this support.
  29425.  
  29426.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  29427.  
  29428.  Note:  For text modes in full-screen, the number of rows may differ from the 
  29429.         mode table due to the availability of fonts of the correct size as 
  29430.         described 
  29431.         above. 
  29432.  
  29433.  
  29434.  PM Considerations 
  29435.  
  29436.  Windowable VIO sessions support only 80-column, color text modes. When 
  29437.  VioSetMode is called from a Windowable VIO session, it only verifies that an 
  29438.  80-column text mode was requested, with Text Rows between 1 and 255.  The 
  29439.  resulting mode, which can be queried using VioGetMode, always has Type = 1, 
  29440.  Color = 4, Text Columns = 80, 
  29441.  Text Rows = requested Text Rows, Horizontal Resolution = 640, and Vertical 
  29442.  Resolution = 16 * (Text Rows). 
  29443.  
  29444.  
  29445.  Family API Considerations 
  29446.  
  29447.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  29448.  Therefore, the following consideration applies to VioSetMode when coding for 
  29449.  the DOS mode: 
  29450.  
  29451.  VioSetMode clears the screen. 
  29452.  
  29453.  
  29454. ΓòÉΓòÉΓòÉ 4.36. VioSetState ΓòÉΓòÉΓòÉ
  29455.  
  29456.                                Bindings:  C, MASM
  29457.  
  29458. This call performs one of the following functions; set palette registers, sets 
  29459. the overscan (border) color, set the blink/background intensity switch, set 
  29460. color registers, set the underline location, or set the target VioSetMode 
  29461. display configuration. 
  29462.  
  29463.  VioSetState    (RequestBlock, VioHandle) 
  29464.  
  29465.  RequestBlock (PVOID) - input 
  29466.     Address of the video state structures consisting of six different 
  29467.     structures depending on the request type: 
  29468.  
  29469.     Type      Definition 
  29470.     0         Set palette registers 
  29471.     1         Set overscan (border) color 
  29472.     2         Set blink/background intensity switch 
  29473.     3         Set color registers 
  29474.     4         Reserved 
  29475.     5         Set underline location 
  29476.     6         Set target VioSetMode display configuration 
  29477.     7         Reserved The six structures, depending on request type, are: 
  29478.  
  29479.     VIOPALSTATE 
  29480.        Applies to EGA, VGA, or IBM Personal System/2 Display Adapter. 
  29481.  
  29482.        length (USHORT) - input 
  29483.           Length of structure, including length. 
  29484.  
  29485.           38        Maximum valid value. 
  29486.  
  29487.        reqtype (USHORT) - input 
  29488.           Request type 0 for palette registers. 
  29489.  
  29490.        palette (USHORT) - input 
  29491.           First palette register in the palette register sequence; must be 
  29492.           specified in the range 0 through 15. The palette registers are 
  29493.           returned in sequential order.  The number returned is based upon 
  29494.           length. 
  29495.  
  29496.        color (USHORT*(length-6)/2) - input 
  29497.           Color value for each palette register.  The maximum number of entries 
  29498.           in the color value array is 16. 
  29499.  
  29500.     VIOOVERSCAN 
  29501.        Applies to CGA, VGA, or IBM Personal System/2 Display Adapter. 
  29502.  
  29503.        length (USHORT) - input 
  29504.           Length of structure, including length. 
  29505.  
  29506.           6         Only valid value. 
  29507.  
  29508.        reqtype (USHORT) - input 
  29509.           Request type 1 for overscan (border) color. 
  29510.  
  29511.        color (USHORT) - input 
  29512.           Color value. 
  29513.  
  29514.     VIOINTENSITY 
  29515.        Applies to CGA, EGA, MCGA, VGA, or IBM Personal System/2 Display 
  29516.        Adapter. 
  29517.  
  29518.        length (USHORT) - input 
  29519.           Length of structure, including length. 
  29520.  
  29521.           6         Only valid value. 
  29522.  
  29523.        reqtype (USHORT) - input 
  29524.           Request type 2 for blink/background intensity switch. 
  29525.  
  29526.        switch (USHORT) - input 
  29527.           Switch set as: 
  29528.  
  29529.           Value     Definition 
  29530.           0         Blinking foreground colors enabled. 
  29531.           1         High intensity background colors enabled. 
  29532.  
  29533.        VIOCOLORREG 
  29534.           Applies to VGA, or IBM Personal System/2 Display Adapter. 
  29535.  
  29536.           length (USHORT) - input 
  29537.              Length of structure, including length. 
  29538.  
  29539.              12        Only valid value. 
  29540.  
  29541.           type (USHORT) - input 
  29542.              Request type 3 for color registers. 
  29543.  
  29544.           first color (USHORT) - input 
  29545.              First color register to set in the color register sequence; must 
  29546.              be specified in the range 0 through 255. The color registers are 
  29547.              set in sequential order. 
  29548.  
  29549.           number color (USHORT) - input 
  29550.              Number of color registers to set; must be specified in the range 1 
  29551.              through 256. 
  29552.  
  29553.           datarea (PCH) - input 
  29554.              Far address of a data area containing one three-byte entry for 
  29555.              each color register to be set. The format of each entry is as 
  29556.              follows: 
  29557.  
  29558.              Byte 1    Red value 
  29559.              Byte 2    Green value 
  29560.              Byte 3    Blue value. 
  29561.  
  29562.        VIOSETULINELOC 
  29563.           Applies to EGA, VGA, or IBM Personal System/2 Display Adapter. 
  29564.  
  29565.           length (USHORT) - input 
  29566.              Length of structure, including length. 
  29567.  
  29568.              6         Only valid value. 
  29569.  
  29570.           type (USHORT) - input 
  29571.              Request type 5 to set the scan line for underlining. Underlining 
  29572.              is enabled 
  29573.              only when the foreground color is 1 or 9. 
  29574.  
  29575.           scanline (USHORT) - input 
  29576.              Scan line minus 1. Values of 0 through 31 are acceptable. A value 
  29577.              of 32 means underlining is disabled. 
  29578.  
  29579.        VIOSETTARGET 
  29580.  
  29581.           length (USHORT) - input 
  29582.              Length of structure, including length. 
  29583.  
  29584.              6         Only valid value. 
  29585.  
  29586.           type (USHORT) - input 
  29587.              Request type 6 to set display configuration to be the target of 
  29588.              the next VioSetMode. 
  29589.  
  29590.           select (USHORT) - input 
  29591.              Configuration: 
  29592.  
  29593.              Value     Definition 
  29594.              0         Default selection algorithm.  See VioSetMode. 
  29595.              1         Primary 
  29596.              2         Secondary. 
  29597.  
  29598.  VioHandle (HVIO) - input 
  29599.     Reserved word of 0s. 
  29600.  
  29601.  rc (USHORT) - return 
  29602.     Return code descriptions are: 
  29603.  
  29604.     0         NO_ERROR 
  29605.     355       ERROR_VIO_MODE 
  29606.     421       ERROR_VIO_INVALID_PARMS 
  29607.     436       ERROR_VIO_INVALID_HANDLE 
  29608.     438       ERROR_VIO_INVALID_LENGTH 
  29609.     465       ERROR_VIO_DETACHED 
  29610.     494       ERROR_VIO_EXTENDED_SG 
  29611.  
  29612.  
  29613.  Family API Considerations 
  29614.  
  29615.  Request type = 6, Set Target VioSetMode Display Configuration, and request 
  29616.  type = 5, 
  29617.  Set Underline Location, are not supported in the family API. 
  29618.  
  29619.  Some options operate differently in the DOS mode than in the OS/2 mode. 
  29620.  Therefore, the following considerations applies to VioSetMode when coding for 
  29621.  the DOS mode: 
  29622.  
  29623.  
  29624.     VioSetMode clears the screen.
  29625.  
  29626.  
  29627. ΓòÉΓòÉΓòÉ 4.37. VioShowBuf ΓòÉΓòÉΓòÉ
  29628.  
  29629.                                Bindings:  C, MASM
  29630.  
  29631. This call updates the physical display buffer with the logical video buffer 
  29632. (LVB). 
  29633.  
  29634.  VioShowBuf    (Offset, Length, VioHandle) 
  29635.  
  29636.  Offset (USHORT) - input 
  29637.     Starting offset within the logical video buffer at which the update to the 
  29638.     screen is to start. 
  29639.  
  29640.  Length (USHORT) - input 
  29641.     Length of the area to be updated to the screen. 
  29642.  
  29643.  VioHandle (HVIO) - input 
  29644.     This must be zero unless the caller is a Presentation Manager application, 
  29645.     in which case it must be the value returned by VioGetPs. 
  29646.  
  29647.  rc (USHORT) - return 
  29648.     Return code descriptions are: 
  29649.  
  29650.     0         NO_ERROR 
  29651.     355       ERROR_VIO_MODE 
  29652.     430       ERROR_VIO_ILLEGAL_DURING_POPUP 
  29653.     436       ERROR_VIO_INVALID_HANDLE 
  29654.     465       ERROR_VIO_DETACHED 
  29655.  
  29656.  Remarks 
  29657.  
  29658.  VioShowBuf is ignored unless it is issued by a process that has previously 
  29659.  called VioGetBuf and that is currently executing in the foreground. 
  29660.  
  29661.  
  29662.  PM Considerations 
  29663.  
  29664.  This function updates the display with the Advanced VIO presentation space. 
  29665.  
  29666.  
  29667. ΓòÉΓòÉΓòÉ 4.38. VioWrtCellStr ΓòÉΓòÉΓòÉ
  29668.  
  29669.                                Bindings:  C, MASM
  29670.  
  29671. This call writes a string of character-attribute pairs (cells) to the display. 
  29672.  
  29673.  VioWrtCellStr   (CellStr, Length, Row, Column, VioHandle) 
  29674.  
  29675.  CellStr (PCH) - input 
  29676.     Address of the string of character-attribute(s) cells to be written. 
  29677.  
  29678.  Length (USHORT) - input 
  29679.     Length, in bytes, of the string to be written.  Each character-attribute(s) 
  29680.     cell is 
  29681.     2 or 4 bytes. 
  29682.  
  29683.  Row (USHORT) - input 
  29684.     Starting cursor row. 
  29685.  
  29686.  Column (USHORT) - input 
  29687.     Starting cursor column. 
  29688.  
  29689.  VioHandle (HVIO) - input 
  29690.     This must be zero unless the caller is a Presentation Manager application, 
  29691.     in which case it must be the value returned by VioGetPs. 
  29692.  
  29693.  rc (USHORT) - return 
  29694.     Return code descriptions are: 
  29695.  
  29696.     0         NO_ERROR 
  29697.     355       ERROR_VIO_MODE 
  29698.     358       ERROR_VIO_ROW 
  29699.     359       ERROR_VIO_COL 
  29700.     436       ERROR_VIO_INVALID_HANDLE 
  29701.     465       ERROR_VIO_DETACHED 
  29702.  
  29703.  Remarks 
  29704.  
  29705.  If a string write gets to the end of the line and is not complete, the string 
  29706.  write continues at the beginning of the next line.  If the write gets to the 
  29707.  end of the screen, the write terminates. 
  29708.  
  29709.  
  29710.  PM Considerations 
  29711.  
  29712.  Write a character-attribute string to the Advanced VIO presentation space. 
  29713.  The caller must specify the starting location on the presentation space where 
  29714.  the string is to be written. 
  29715.  
  29716.  
  29717. ΓòÉΓòÉΓòÉ 4.39. VioWrtCharStr ΓòÉΓòÉΓòÉ
  29718.  
  29719.                                Bindings:  C, MASM
  29720.  
  29721. This call writes a character string to the display. 
  29722.  
  29723.  VioWrtCharStr     (CharStr, Length, Row, Column, VioHandle) 
  29724.  
  29725.  CharStr (PCH) - input 
  29726.     Address of the character string to be written. 
  29727.  
  29728.  Length (USHORT) - input 
  29729.     Length, in bytes, of the character string. 
  29730.  
  29731.  Row (USHORT) - input 
  29732.     Starting cursor row. 
  29733.  
  29734.  Column (USHORT) - input 
  29735.     Starting cursor column. 
  29736.  
  29737.  VioHandle (HVIO) - input 
  29738.     This must be zero unless the caller is a Presentation Manager application, 
  29739.     in which case it must be the value returned by VioGetPs. 
  29740.  
  29741.  rc (USHORT) - return 
  29742.     Return code descriptions are: 
  29743.  
  29744.     0         NO_ERROR 
  29745.     355       ERROR_VIO_MODE 
  29746.     358       ERROR_VIO_ROW 
  29747.     359       ERROR_VIO_COL 
  29748.     436       ERROR_VIO_INVALID_HANDLE 
  29749.     465       ERROR_VIO_DETACHED 
  29750.  
  29751.  Remarks 
  29752.  
  29753.  If a string write gets to the end of the line and is not complete, the string 
  29754.  write continues at the beginning of the next line.  If the write gets to the 
  29755.  end of the screen, the write terminates. 
  29756.  
  29757.  
  29758.  PM Considerations 
  29759.  
  29760.  Write a character string to the Advanced VIO presentation space.  The caller 
  29761.  must specify the starting location on the presentation space where the string 
  29762.  is to be written. 
  29763.  
  29764.  
  29765. ΓòÉΓòÉΓòÉ 4.40. VioWrtCharStrAtt ΓòÉΓòÉΓòÉ
  29766.  
  29767.                                Bindings:  C, MASM
  29768.  
  29769. This call writes a character string with repeated attribute to the display. 
  29770.  
  29771.  VioWrtCharStrAtt     (CharStr, Length, Row, Column, Attr, VioHandle) 
  29772.  
  29773.  CharStr (PCH) - input 
  29774.     Address of the character string to be written. 
  29775.  
  29776.  Length (USHORT) - input 
  29777.     Length, in bytes, of the character string. 
  29778.  
  29779.  Row (USHORT) - input 
  29780.     Starting cursor row. 
  29781.  
  29782.  Column (USHORT) - input 
  29783.     Starting cursor column. 
  29784.  
  29785.  Attr (PBYTE) - input 
  29786.     Address of the attribute(s) (1 or 3 bytes) to be used in the display buffer 
  29787.     for each character of the string written. 
  29788.  
  29789.  VioHandle (HVIO) - input 
  29790.     This must be zero unless the caller is a Presentation Manager application, 
  29791.     in which case it must be the value returned by VioGetPs. 
  29792.  
  29793.  rc (USHORT) - return 
  29794.     Return code descriptions are: 
  29795.  
  29796.     0         NO_ERROR 
  29797.     355       ERROR_VIO_MODE 
  29798.     358       ERROR_VIO_ROW 
  29799.     359       ERROR_VIO_COL 
  29800.     436       ERROR_VIO_INVALID_HANDLE 
  29801.     465       ERROR_VIO_DETACHED 
  29802.  
  29803.  Remarks 
  29804.  
  29805.  If a string write gets to the end of the line and is not complete, the string 
  29806.  write continues at the beginning of the next line.  If the write gets to the 
  29807.  end of the screen, the write terminates. 
  29808.  
  29809.  
  29810.  PM Considerations 
  29811.  
  29812.  Write a character string with a repeated attribute string to the Advanced VIO 
  29813.  presentation space. The caller must specify the starting location on the 
  29814.  presentation space where the string is to be written. 
  29815.  
  29816.  
  29817. ΓòÉΓòÉΓòÉ 4.41. VioWrtNAttr ΓòÉΓòÉΓòÉ
  29818.  
  29819.                                Bindings:  C, MASM
  29820.  
  29821. This call writes an attribute to the display a specified number of times. 
  29822.  
  29823.  VioWrtNAttr    (Attr, Times, Row, Column, VioHandle) 
  29824.  
  29825.  Attr (PBYTE) - input 
  29826.     Address of the attribute(s) (1 or 3 bytes) to be written. 
  29827.  
  29828.  Times (USHORT) - input 
  29829.     Number of times to write the attribute. 
  29830.  
  29831.  Row (USHORT) - input 
  29832.     Starting cursor row. 
  29833.  
  29834.  Column (USHORT) - input 
  29835.     Starting cursor column. 
  29836.  
  29837.  VioHandle (HVIO) - input 
  29838.     This must be zero unless the caller is a Presentation Manager application, 
  29839.     in which case it must be the value returned by VioGetPs. 
  29840.  
  29841.  rc (USHORT) - return 
  29842.     Return code descriptions are: 
  29843.  
  29844.     0         NO_ERROR 
  29845.     355       ERROR_VIO_MODE 
  29846.     358       ERROR_VIO_ROW 
  29847.     359       ERROR_VIO_COL 
  29848.     436       ERROR_VIO_INVALID_HANDLE 
  29849.     465       ERROR_VIO_DETACHED 
  29850.  
  29851.  Remarks 
  29852.  
  29853.  If a repeated write gets to the end of the line and is not complete, the write 
  29854.  continues at the beginning of the next line.  If the write gets to the end of 
  29855.  the screen, the write terminates. 
  29856.  
  29857.  
  29858.  PM Considerations 
  29859.  
  29860.  Write an attribute code to the Advanced VIO presentation space a specified 
  29861.  number of times.  The caller must specify the starting location on the 
  29862.  presentation space where the string is to be written. 
  29863.  
  29864.  
  29865. ΓòÉΓòÉΓòÉ 4.42. VioWrtNCell ΓòÉΓòÉΓòÉ
  29866.  
  29867.                                Bindings:  C, MASM
  29868.  
  29869. This call writes a cell (character-attribute pair) to the display a specified 
  29870. number of times. 
  29871.  
  29872.  VioWrtNCell   (Cell, Times, Row, Column, VioHandle) 
  29873.  
  29874.  Cell (PBYTE) - input 
  29875.     Address of the character-attribute(s) cell (2 or 4 bytes) to be written. 
  29876.  
  29877.  Times (USHORT) - input 
  29878.     Number of times to write the cell. 
  29879.  
  29880.  Row (USHORT) - input 
  29881.     Starting cursor row. 
  29882.  
  29883.  Column (USHORT) - input 
  29884.     Starting cursor column. 
  29885.  
  29886.  VioHandle (HVIO) - input 
  29887.     This must be zero unless the caller is a Presentation Manager application, 
  29888.     in which case it must be the value returned by VioGetPs. 
  29889.  
  29890.  rc (USHORT) - return 
  29891.     Return code descriptions are: 
  29892.  
  29893.     0         NO_ERROR 
  29894.     355       ERROR_VIO_MODE 
  29895.     358       ERROR_VIO_ROW 
  29896.     359       ERROR_VIO_COL 
  29897.     436       ERROR_VIO_INVALID_HANDLE 
  29898.     465       ERROR_VIO_DETACHED 
  29899.  
  29900.  Remarks 
  29901.  
  29902.  If a repeated write gets to the end of the line and is not complete, the write 
  29903.  continues at the beginning of the next line.  If the write gets to the end of 
  29904.  the screen, the write terminates. 
  29905.  
  29906.  
  29907.  PM Considerations 
  29908.  
  29909.  Write a cell (character-attribute) to the Advanced VIO presentation space a 
  29910.  specified number of times.  The caller must specify the starting location on 
  29911.  the presentation space where the string is to be written. 
  29912.  
  29913.  
  29914. ΓòÉΓòÉΓòÉ 4.43. VioWrtNChar ΓòÉΓòÉΓòÉ
  29915.  
  29916.                                Bindings:  C, MASM
  29917.  
  29918. VioWrtNChar writes a character to the display a specified number of times. 
  29919.  
  29920.  VioWrtNChar     (Char, Times, Row, Column, VioHandle) 
  29921.  
  29922.  Char (PCH) - input 
  29923.     Address of the character to be written. 
  29924.  
  29925.  Times (USHORT) - input 
  29926.     Number of times to write the character. 
  29927.  
  29928.  Row (USHORT) - input 
  29929.     Starting cursor row. 
  29930.  
  29931.  Column (USHORT) - input 
  29932.     Starting cursor column. 
  29933.  
  29934.  VioHandle (HVIO) - input 
  29935.     This must be zero unless the caller is a Presentation Manager application, 
  29936.     in which case it must be the value returned by VioGetPs. 
  29937.  
  29938.  rc (USHORT) - return 
  29939.     Return code descriptions are: 
  29940.  
  29941.     0         NO_ERROR 
  29942.     355       ERROR_VIO_MODE 
  29943.     358       ERROR_VIO_ROW 
  29944.     359       ERROR_VIO_COL 
  29945.     436       ERROR_VIO_INVALID_HANDLE 
  29946.     465       ERROR_VIO_DETACHED 
  29947.  
  29948.  Remarks 
  29949.  
  29950.  If a repeated write gets to the end of the line and is not complete, the write 
  29951.  continues at the beginning of the next line.  If the write gets to the end of 
  29952.  the screen, the write terminates. 
  29953.  
  29954.  
  29955.  PM Considerations 
  29956.  
  29957.  Write a character to the Advanced VIO presentation space a number of times. 
  29958.  The caller must specify the starting location on the presentation space where 
  29959.  the string is to be written. 
  29960.  
  29961.  
  29962. ΓòÉΓòÉΓòÉ 4.44. VioWrtTTY ΓòÉΓòÉΓòÉ
  29963.  
  29964.                                Bindings:  C, MASM
  29965.  
  29966. This call writes a character string to the display starting at the current 
  29967. cursor position. 
  29968. At the completion of the write, the cursor is positioned at the first position 
  29969. beyond the end of the string. 
  29970.  
  29971.  VioWrtTTY    (CharStr, Length, VioHandle) 
  29972.  
  29973.  CharStr (PCH) - input 
  29974.     Address of the string to be written. 
  29975.  
  29976.  Length (USHORT) - input 
  29977.     Length of the character string in bytes. 
  29978.  
  29979.  VioHandle (HVIO) - input 
  29980.     This must be zero unless the caller is a Presentation Manager application, 
  29981.     in which case it must be the value returned by VioGetPs. 
  29982.  
  29983.  rc (USHORT) - return 
  29984.     Return code descriptions are: 
  29985.  
  29986.     0         NO_ERROR 
  29987.     355       ERROR_VIO_MODE 
  29988.     436       ERROR_VIO_INVALID_HANDLE 
  29989.     465       ERROR_VIO_DETACHED 
  29990.  
  29991.  Remarks 
  29992.  
  29993.  If a string write gets to the end of the line and is not complete, the string 
  29994.  write continues at the beginning of the next line.  If the write gets to the 
  29995.  end of the screen, the screen is scrolled, and the write continues until 
  29996.  completed. 
  29997.  
  29998.  The characters carriage return, line feed, backspace, tab, and bell are 
  29999.  treated as commands rather than printable characters.  Backspace is a 
  30000.  non-destructive backspace.  Tabs are expanded to provide standard 8-byte-wide 
  30001.  fields.  VioWrtTTY is the only video call affected by Ctrl-PrtSc and ANSI. 
  30002.  
  30003.  Characters are written using the current attribute defined by ANSI or the 
  30004.  default value 7. 
  30005.  
  30006.  VioWrtTTY is supported in graphics mode to process ANSI sequences. This allows 
  30007.  the application to enter and exit a graphics mode. 
  30008.  
  30009.  
  30010.  PM Considerations 
  30011.  
  30012.  Write a character string from the current cursor position in TTY mode to the 
  30013.  Advanced VIO presentation space.  The cursor is positioned after the last 
  30014.  character written at the end of the write. 
  30015.  
  30016.  
  30017. ΓòÉΓòÉΓòÉ <hidden> VioDeRegister ΓòÉΓòÉΓòÉ
  30018.  
  30019. #define INCL_VIO
  30020.  
  30021. USHORT  rc = VioDeRegister(VOID);
  30022.  
  30023. USHORT           rc;            /* return code */
  30024.  
  30025.  
  30026. ΓòÉΓòÉΓòÉ <hidden> VioEndPopUp ΓòÉΓòÉΓòÉ
  30027.  
  30028. #define INCL_VIO
  30029.  
  30030. USHORT  rc = VioEndPopUp(VioHandle);
  30031.  
  30032. HVIO             VioHandle;     /* Vio device handle */
  30033.  
  30034. USHORT           rc;            /* return code */
  30035.  
  30036.  
  30037. ΓòÉΓòÉΓòÉ <hidden> VioGetAnsi ΓòÉΓòÉΓòÉ
  30038.  
  30039. #define INCL_VIO
  30040.  
  30041. USHORT  rc = VioGetAnsi(Indicator, VioHandle);
  30042.  
  30043. PUSHORT          Indicator;     /* On/Off indicator (returned) */
  30044. HVIO             VioHandle;     /* Vio handle */
  30045.  
  30046. USHORT           rc;            /* return code */
  30047.  
  30048.  
  30049. ΓòÉΓòÉΓòÉ <hidden> VioGetBuf ΓòÉΓòÉΓòÉ
  30050.  
  30051. #define INCL_VIO
  30052.  
  30053. USHORT  rc = VioGetBuf(LVBPtr, Length, VioHandle);
  30054.  
  30055. PULONG           LVBPtr;        /* Points to LVB */
  30056. PUSHORT          Length;        /* Length of buffer */
  30057. HVIO             VioHandle;     /* Vio handle */
  30058.  
  30059. USHORT           rc;            /* return code */
  30060.  
  30061.  
  30062. ΓòÉΓòÉΓòÉ <hidden> VioGetConfig ΓòÉΓòÉΓòÉ
  30063.  
  30064. typedef struct _VIOCONFIGINFO {  /* vioin  */
  30065.   USHORT  cb     ;               /* Length of this data structure */
  30066.   USHORT  adapter;               /* Display adapter type */
  30067.   USHORT  display;               /* Display/monitor type */
  30068.   ULONG   cbMemory;              /* Amount of memory on the adapter
  30069.                                      in bytes */
  30070.   USHORT  Configuration;
  30071.   USHORT  VDHVersion;
  30072.   USHORT  Flags;
  30073.   ULONG   HWBufferSize;
  30074.   ULONG   FullSaveSize;
  30075.   ULONG   PartSaveSize;
  30076.   USHORT  EMAdaptersOFF;         /* Offset to emulated adapter types */
  30077.   USHORT  EMDisplaysOFF;         /* Offset to emulated display types */
  30078. } VIOCONFIGINFO;
  30079.  
  30080. #define INCL_VIO
  30081.  
  30082. USHORT  rc = VioGetConfig(ConfigID, ConfigData, VioHandle);
  30083.  
  30084. USHORT           ConfigID;      /* Configuration ID */
  30085. PVIOCONFIGINFO   ConfigData;    /* Configuration data */
  30086. HVIO             VioHandle;     /* Vio handle */
  30087.  
  30088. USHORT           rc;            /* return code */
  30089.  
  30090.  
  30091. ΓòÉΓòÉΓòÉ <hidden> VioGetCp ΓòÉΓòÉΓòÉ
  30092.  
  30093. #define INCL_VIO
  30094.  
  30095. USHORT  rc = VioGetCp(Reserved, CodePageID, VioHandle);
  30096.  
  30097. USHORT           Reserved;      /* Reserved (must be zero) */
  30098. PUSHORT          CodePageID;    /* Code page ID */
  30099. HVIO             VioHandle;     /* Video handle */
  30100.  
  30101. USHORT           rc;            /* return code */
  30102.  
  30103.  
  30104. ΓòÉΓòÉΓòÉ <hidden> VioGetCurPos ΓòÉΓòÉΓòÉ
  30105.  
  30106. #define INCL_VIO
  30107.  
  30108. USHORT  rc = VioGetCurPos(Row, Column, VioHandle);
  30109.  
  30110. PUSHORT          Row;           /* Row return data */
  30111. PUSHORT          Column;        /* Column return data */
  30112. HVIO             VioHandle;     /* Vio handle */
  30113.  
  30114. USHORT           rc;            /* return code */
  30115.  
  30116.  
  30117. ΓòÉΓòÉΓòÉ <hidden> VioGetCurType ΓòÉΓòÉΓòÉ
  30118.  
  30119. typedef struct _VIOCURSORINFO {  /* vioci */
  30120.   USHORT   yStart;               /*cursor start line */
  30121.   USHORT   cEnd;                 /* cursor end line */
  30122.   USHORT   cx;                   /* cursor width */
  30123.   USHORT   attr;                 /* -1=hidden cursor, any other=normal
  30124.                                        cursor */
  30125. } VIOCURSORINFO;
  30126.  
  30127. #define INCL_VIO
  30128.  
  30129. USHORT  rc = VioGetCurType(CursorData, VioHandle);
  30130.  
  30131. PVIOCURSORINFO   CursorData;    /* Cursor characteristics */
  30132. HVIO             VioHandle;     /* Vio handle */
  30133.  
  30134. USHORT           rc;            /* return code */
  30135.  
  30136.  
  30137. ΓòÉΓòÉΓòÉ <hidden> VioGetFont ΓòÉΓòÉΓòÉ
  30138.  
  30139. typedef struct _VIOFONTINFO {   /* viofi */
  30140.   USHORT  cb;                 /* length of this structure */
  30141.   USHORT  type;               /* request type */
  30142.   USHORT  cxCell;             /* pel columns in character cell */
  30143.   USHORT  cyCell;             /* pel rows in character cell */
  30144.   PVOID   pbData;             /* requested font table (returned) */
  30145.   USHORT  cbData;             /* length of caller supplied data area
  30146.                                 (in bytes) */
  30147. } VIOFONTINFO;
  30148.  
  30149. #define INCL_VIO
  30150.  
  30151. USHORT  rc = VioGetFont(RequestBlock, VioHandle);
  30152.  
  30153. PVIOFONTINFO     RequestBlock;  /* Request block */
  30154. HVIO             VioHandle;     /* Vio handle */
  30155.  
  30156. USHORT           rc;            /* return code */
  30157.  
  30158.  
  30159. ΓòÉΓòÉΓòÉ <hidden> VioGetMode ΓòÉΓòÉΓòÉ
  30160.  
  30161. typedef struct _VIOMODEINFO {
  30162.   USHORT cb;                    /* Length of the entire data structure  */
  30163.   UCHAR  fbType;                /* Bit mask of mode being set           */
  30164.   UCHAR  color;                 /* Number of colors (power of 2)        */
  30165.   USHORT col;                   /* Number of text columns               */
  30166.   USHORT row;                   /* Number of text rows                  */
  30167.   USHORT hres;                  /* Horizontal resolution                */
  30168.   USHORT vres;                  /* Vertical resolution                  */
  30169.   UCHAR  fmt_ID;                /* Attribute format                     */
  30170.   UCHAR  attrib;                /* Number of attributes                 */
  30171.   ULONG  buf_addr;
  30172.   ULONG  buf_length;
  30173.   ULONG  full_length;
  30174.   ULONG  partial_length;
  30175.   PCH    ext_data_addr;
  30176.   } VIOMODEINFO;
  30177. typedef VIOMODEINFO far *PVIOMODEINFO;
  30178.  
  30179. #define INCL_VIO
  30180.  
  30181. USHORT  rc = VioGetMode(ModeData, VioHandle);
  30182.  
  30183. PVIOMODEINFO     ModeData;      /* Mode characteristics */
  30184. HVIO             VioHandle;     /* Vio handle */
  30185.  
  30186. USHORT           rc;            /* return code */
  30187.  
  30188.  
  30189. ΓòÉΓòÉΓòÉ <hidden> VioGetPhysBuf ΓòÉΓòÉΓòÉ
  30190.  
  30191. typedef struct _VIOPHYSBUF {   /* viopb */
  30192.   PBYTE    pBuf;               /* Buffer start address */
  30193.   ULONG    cb;                 /* Buffer length */
  30194.   SEL      asel[1];            /* Selector list */
  30195. } VIOPHYSBUF;
  30196.  
  30197. #define INCL_VIO
  30198.  
  30199. USHORT  rc = VioGetPhysBuf(Structure, Reserved);
  30200.  
  30201. PVIOPHYSBUF      Structure;     /* Data structure */
  30202. USHORT           Reserved;      /* Reserved (must be zero) */
  30203.  
  30204. USHORT           rc;            /* return code */
  30205.  
  30206.  
  30207. ΓòÉΓòÉΓòÉ <hidden> VioGetState ΓòÉΓòÉΓòÉ
  30208.  
  30209. typedef struct _VIOPALSTATE {
  30210.   USHORT  cb;                   /* Length of this structure in bytes */
  30211.   USHORT  type;                 /* Request type=0 get palette registers */
  30212.   USHORT  iFirst;               /* First palette register to return */
  30213.   USHORT  acolor[1];            /* Color value palette register */
  30214.   }VIOPALSTATE;
  30215. typedef VIOPALSTATE far *PVIOPALSTATE;
  30216.  
  30217. typedef struct _VIOOVERSCAN {
  30218.   USHORT  cb;                   /* Length of this structure */
  30219.   USHORT  type;                 /* Request type=1 get overscan
  30220.                                     (border) color */
  30221.   USHORT  color;                /* Color value */
  30222.   }VIOOVERSCAN;
  30223. typedef VIOOVERSCAN far *PVIOOVERSCAN;
  30224.  
  30225. typedef struct _VIOINTENSITY {
  30226.   USHORT  cb;                   /* Length of this structure */
  30227.   USHORT  type;                 /* Request type=2 get blink/background
  30228.                                     intensity switch */
  30229.   USHORT  fs;                   /* Value of blink/background switch */
  30230.   }VIOINTENSITY;
  30231. typedef VIOINTENSITY far *PVIOINTENSITY;
  30232.  
  30233. typedef struct _VIOCOLORREG {   /* viocreg */
  30234.   USHORT  cb;
  30235.   USHORT  type;
  30236.   USHORT  firstcolorreg;
  30237.   USHORT  numcolorregs;
  30238.   PCH     colorregaddr;
  30239.   }VIOCOLORREG;
  30240. typedef VIOCOLORREG far *PVIOCOLORREG;
  30241.  
  30242. typedef struct _VIOSETULINELOC { /* viouline */
  30243.   USHORT  cb;
  30244.   USHORT  type;
  30245.   USHORT  scanline;
  30246.   }VIOSETULINELOC;
  30247. typedef VIOSETULINELOC far *PVIOSETULINELOC;
  30248.  
  30249. typedef struct _VIOSETTARGET {  /* viosett */
  30250.   USHORT  cb;
  30251.   USHORT  type;
  30252.   USHORT  defaultalgorithm;
  30253.   }VIOSETTARGET;
  30254. typedef VIOSETTARGET far *PVIOSETTARGET;
  30255.  
  30256. #define INCL_VIO
  30257.  
  30258. USHORT  rc = VioGetState(RequestBlock, VioHandle);
  30259.  
  30260. PVOID            RequestBlock;  /* Request block */
  30261. HVIO             VioHandle;     /* Vio handle */
  30262.  
  30263. USHORT           rc;            /* return code */
  30264.  
  30265.  
  30266. ΓòÉΓòÉΓòÉ <hidden> VioGlobalReg ΓòÉΓòÉΓòÉ
  30267.  
  30268. #define INCL_VIO
  30269.  
  30270. USHORT  rc = VioGlobalReg(ModuleName, EntryPoint, FunctionMask1,
  30271.                            FunctionMask2, 0);
  30272.  
  30273. PSZ          ModuleName;        /* Module name  */
  30274. PSZ          EntryPoint;        /* Entry point name */
  30275. ULONG        FunctionMask1;     /* Function mask 1  */
  30276. ULONG        FunctionMask2;     /* Function mask 2  */
  30277. LONG         0;                 /* Reserved (must be zero) */
  30278.  
  30279. USHORT           rc;            /* return code */
  30280.  
  30281.  
  30282. ΓòÉΓòÉΓòÉ <hidden> VioModeUndo ΓòÉΓòÉΓòÉ
  30283.  
  30284. #define INCL_VIO
  30285.  
  30286. USHORT  rc = VioModeUndo(OwnerIndic, KillIndic, Reserved);
  30287.  
  30288. USHORT           OwnerIndic;    /* Ownership indicator */
  30289. USHORT           KillIndic;     /* Terminate indicator */
  30290. USHORT           Reserved;      /* Reserved (must be zero) */
  30291.  
  30292. USHORT           rc;            /* return code */
  30293.  
  30294.  
  30295. ΓòÉΓòÉΓòÉ <hidden> VioModeWait ΓòÉΓòÉΓòÉ
  30296.  
  30297. #define INCL_VIO
  30298.  
  30299. USHORT  rc = VioModeWait(RequestType, NotifyType, Reserved);
  30300.  
  30301. USHORT           RequestType;   /* Request type */
  30302. PUSHORT          NotifyType;    /* Notify type (returned) */
  30303. USHORT           Reserved;      /* Reserved (must be zero) */
  30304.  
  30305. USHORT           rc;            /* return code */
  30306.  
  30307.  
  30308. ΓòÉΓòÉΓòÉ <hidden> VioPopUp ΓòÉΓòÉΓòÉ
  30309.  
  30310. #define INCL_VIO
  30311.  
  30312. USHORT  rc = VioPopUp(Options, VioHandle);
  30313.  
  30314. PUSHORT          Options;       /* Option Flags */
  30315. HVIO             VioHandle;     /* Vio handle */
  30316.  
  30317. USHORT           rc;            /* return code */
  30318.  
  30319.  
  30320. ΓòÉΓòÉΓòÉ <hidden> VioPrtSc ΓòÉΓòÉΓòÉ
  30321.  
  30322. #define INCL_VIO
  30323.  
  30324. USHORT  rc = VioPrtSc(VioHandle);
  30325.  
  30326. HVIO             VioHandle;     /* Vio handle */
  30327.  
  30328. USHORT           rc;            /* return code */
  30329.  
  30330.  
  30331. ΓòÉΓòÉΓòÉ <hidden> VioPrtScToggle ΓòÉΓòÉΓòÉ
  30332.  
  30333. #define INCL_VIO
  30334.  
  30335. USHORT  rc = VioPrtScToggle(VioHandle);
  30336.  
  30337. HVIO             VioHandle;     /* Vio handle */
  30338.  
  30339. USHORT           rc;            /* return code */
  30340.  
  30341.  
  30342. ΓòÉΓòÉΓòÉ <hidden> VioReadCellStr ΓòÉΓòÉΓòÉ
  30343.  
  30344. #define INCL_VIO
  30345.  
  30346. USHORT  rc = VioReadCellStr(CellStr, Length, Row, Column, VioHandle);
  30347.  
  30348. PCH              CellStr;       /* Cell string buffer */
  30349. PUSHORT          Length;        /* Length of cell string buffer */
  30350. USHORT           Row;           /* Starting row location */
  30351. USHORT           Column;        /* Starting column location */
  30352. HVIO             VioHandle;     /* Video handle */
  30353.  
  30354. USHORT           rc;            /* return code */
  30355.  
  30356.  
  30357. ΓòÉΓòÉΓòÉ <hidden> VioReadCharStr ΓòÉΓòÉΓòÉ
  30358.  
  30359. #define INCL_VIO
  30360.  
  30361. USHORT  rc = VioReadCharStr(CharStr, Length, Row, Column, VioHandle);
  30362.  
  30363. PCH              CharStr;       /* Character buffer */
  30364. PUSHORT          Length;        /* Length of buffer */
  30365. USHORT           Row;           /* Starting row location */
  30366. USHORT           Column;        /* Starting column location */
  30367. HVIO             VioHandle;     /* Video handle */
  30368.  
  30369. USHORT           rc;            /* return code */
  30370.  
  30371.  
  30372. ΓòÉΓòÉΓòÉ <hidden> VioRegister ΓòÉΓòÉΓòÉ
  30373.  
  30374. #define INCL_VIO
  30375.  
  30376. USHORT  rc = VioRegister(ModuleName, EntryPoint, FunctionMask1,
  30377.                              FunctionMask2);
  30378.  
  30379. PSZ              ModuleName;    /* Module name */
  30380. PSZ              EntryPoint;    /* Entry point name */
  30381. ULONG            FunctionMask1; /* Function mask 1 */
  30382. ULONG            FunctionMask2; /* Function mask 2 */
  30383.  
  30384. USHORT           rc;            /* return code */
  30385.  
  30386.  
  30387. ΓòÉΓòÉΓòÉ <hidden> VioSavRedrawUndo ΓòÉΓòÉΓòÉ
  30388.  
  30389. #define INCL_VIO
  30390.  
  30391. USHORT  rc = VioSavRedrawUndo(OwnerIndic, KillIndic, VioHandle);
  30392.  
  30393. USHORT           OwnerIndic;    /* Ownership indicator */
  30394. USHORT           KillIndic;     /* Terminate indicator */
  30395. HVIO             VioHandle;     /* Video handle */
  30396.  
  30397. USHORT           rc;            /* return code */
  30398.  
  30399.  
  30400. ΓòÉΓòÉΓòÉ <hidden> VioSavRedrawWait ΓòÉΓòÉΓòÉ
  30401.  
  30402. #define INCL_VIO
  30403.  
  30404. USHORT  rc = VioSavRedrawWait(SavRedrawIndic, NotifyType, VioHandle);
  30405.  
  30406. USHORT           SavRedrawIndic; /* Save/redraw indicator */
  30407. PUSHORT          NotifyType;     /* Notify type (returned) */
  30408. HVIO             VioHandle;      /* Video handle */
  30409.  
  30410. USHORT           rc;             /* return code */
  30411.  
  30412.  
  30413. ΓòÉΓòÉΓòÉ <hidden> VioScrLock ΓòÉΓòÉΓòÉ
  30414.  
  30415. #define INCL_VIO
  30416.  
  30417. USHORT  rc = VioScrLock(WaitFlag, Status, VioHandle);
  30418.  
  30419. USHORT           WaitFlag;      /* Block or not */
  30420. PUCHAR           Status;        /* Lock status (returned) */
  30421. HVIO             VioHandle;     /* Video handle */
  30422.  
  30423. USHORT           rc;            /* return code */
  30424.  
  30425.  
  30426. ΓòÉΓòÉΓòÉ <hidden> VioScrollDn ΓòÉΓòÉΓòÉ
  30427.  
  30428. #define INCL_VIO
  30429.  
  30430. USHORT  rc = VioScrollDn(TopRow, LeftCol, BotRow, RightCol, Lines, Cell,
  30431.                              VioHandle);
  30432.  
  30433. USHORT           TopRow;        /* Top row */
  30434. USHORT           LeftCol;       /* Left column */
  30435. USHORT           BotRow;        /* Bottom row */
  30436. USHORT           RightCol;      /* Right column */
  30437. USHORT           Lines;         /* Number of lines */
  30438. PBYTE            Cell;          /* Cell to be written */
  30439. HVIO             VioHandle;     /* Video handle */
  30440.  
  30441. USHORT           rc;            /* return code */
  30442.  
  30443.  
  30444. ΓòÉΓòÉΓòÉ <hidden> VioScrollLf ΓòÉΓòÉΓòÉ
  30445.  
  30446. #define INCL_VIO
  30447.  
  30448. USHORT  rc = VioScrollLf(TopRow, LeftCol, BotRow, RightCol, Lines, Cell,
  30449.                              VioHandle);
  30450.  
  30451. USHORT           TopRow;        /* Top row */
  30452. USHORT           LeftCol;       /* Left column */
  30453. USHORT           BotRow;        /* Bottom row */
  30454. USHORT           RightCol;      /* Right column */
  30455. USHORT           Lines;         /* Number of lines */
  30456. PBYTE            Cell;          /* Cell to be written */
  30457. HVIO             VioHandle;     /* Video Handle */
  30458.  
  30459. USHORT           rc;            /* return code */
  30460.  
  30461.  
  30462. ΓòÉΓòÉΓòÉ <hidden> VioScrollRt ΓòÉΓòÉΓòÉ
  30463.  
  30464. #define INCL_VIO
  30465.  
  30466. USHORT  rc = VioScrollRt(TopRow, LeftCol, BotRow, RightCol, Lines, Cell,
  30467.                              VioHandle);
  30468.  
  30469. USHORT           TopRow;        /* Top row */
  30470. USHORT           LeftCol;       /* Left column */
  30471. USHORT           BotRow;        /* Bottom row */
  30472. USHORT           RightCol;      /* Right column */
  30473. USHORT           Lines;         /* Number of lines */
  30474. PBYTE            Cell;          /* Cell to be written */
  30475. HVIO             VioHandle;     /* Video handle */
  30476.  
  30477. USHORT           rc;            /* return code */
  30478.  
  30479.  
  30480. ΓòÉΓòÉΓòÉ <hidden> VioScrollUp ΓòÉΓòÉΓòÉ
  30481.  
  30482. #define INCL_VIO
  30483.  
  30484. USHORT  rc = VioScrollUp(TopRow, LeftCol, BotRow, RightCol, Lines, Cell,
  30485.                              VioHandle);
  30486.  
  30487. USHORT           TopRow;        /* Top row */
  30488. USHORT           LeftCol;       /* Left column */
  30489. USHORT           BotRow;        /* Bottom row */
  30490. USHORT           RightCol;      /* Right column */
  30491. USHORT           Lines;         /* Number of lines */
  30492. PBYTE            Cell;          /* Fill character */
  30493. HVIO             VioHandle;     /* Video handle */
  30494.  
  30495. USHORT           rc;            /* return code */
  30496.  
  30497.  
  30498. ΓòÉΓòÉΓòÉ <hidden> VioScrUnLock ΓòÉΓòÉΓòÉ
  30499.  
  30500. #define INCL_VIO
  30501.  
  30502. USHORT  rc = VioScrUnLock(VioHandle);
  30503.  
  30504. HVIO             VioHandle;     /* Video handle */
  30505.  
  30506. USHORT           rc;            /* return code */
  30507.  
  30508.  
  30509. ΓòÉΓòÉΓòÉ <hidden> VioSetAnsi ΓòÉΓòÉΓòÉ
  30510.  
  30511. #define INCL_VIO
  30512.  
  30513. USHORT  rc = VioSetAnsi(Indicator, VioHandle);
  30514.  
  30515. USHORT           Indicator;     /* On/Off indicator */
  30516. HVIO             VioHandle;     /* Video handle */
  30517.  
  30518. USHORT           rc;            /* return code */
  30519.  
  30520.  
  30521. ΓòÉΓòÉΓòÉ <hidden> VioSetCp ΓòÉΓòÉΓòÉ
  30522.  
  30523. #define INCL_VIO
  30524.  
  30525. USHORT  rc = VioSetCp(Reserved, CodePageID, VioHandle);
  30526.  
  30527. USHORT           Reserved;      /* Reserved (must be zero) */
  30528. USHORT           CodePageID;    /* CodePage Id */
  30529. HVIO             VioHandle;     /* Video handle */
  30530.  
  30531. USHORT           rc;            /* return code */
  30532.  
  30533.  
  30534. ΓòÉΓòÉΓòÉ <hidden> VioSetCurPos ΓòÉΓòÉΓòÉ
  30535.  
  30536. #define INCL_VIO
  30537.  
  30538. USHORT  rc = VioSetCurPos(Row, Column, VioHandle);
  30539.  
  30540. USHORT           Row;           /* Row data */
  30541. USHORT           Column;        /* Column data */
  30542. HVIO             VioHandle;     /* Video handle */
  30543.  
  30544. USHORT           rc;            /* return code */
  30545.  
  30546.  
  30547. ΓòÉΓòÉΓòÉ <hidden> VioSetCurType ΓòÉΓòÉΓòÉ
  30548.  
  30549. typedef struct _VIOCURSORINFO {  /* vioci */
  30550.   USHORT   yStart;               /*cursor start line */
  30551.   USHORT   cEnd;                 /* cursor end line */
  30552.   USHORT   cx;                   /* cursor width */
  30553.   USHORT   attr;                 /* -1=hidden cursor, any other=normal
  30554.                                        cursor */
  30555. } VIOCURSORINFO;
  30556.  
  30557. #define INCL_VIO
  30558.  
  30559. USHORT  rc = VioSetCurType(CursorData, VioHandle);
  30560.  
  30561. PVIOCURSORINFO   CursorData;    /* Cursor characteristics */
  30562. HVIO             VioHandle;     /* Video handle */
  30563.  
  30564. USHORT           rc;            /* return code */
  30565.  
  30566.  
  30567. ΓòÉΓòÉΓòÉ <hidden> VioSetFont ΓòÉΓòÉΓòÉ
  30568.  
  30569. typedef struct _VIOFONTINFO {   /* viofi */
  30570.   USHORT  cb;                 /* length of this structure */
  30571.   USHORT  type;               /* request type */
  30572.   USHORT  cxCell;             /* pel columns in character cell */
  30573.   USHORT  cyCell;             /* pel rows in character cell */
  30574.   PVOID   pbData;             /* requested font table (returned) */
  30575.   USHORT  cbData;             /* length of caller supplied data area
  30576.                                   (in bytes) */
  30577. } VIOFONTINFO;
  30578.  
  30579. #define INCL_VIO
  30580.  
  30581. USHORT  rc = VioSetFont(RequestBlock, VioHandle);
  30582.  
  30583. PVIOFONTINFO     RequestBlock;  /* Request block */
  30584. HVIO             VioHandle;     /* Video handle */
  30585.  
  30586. USHORT           rc;            /* return code */
  30587.  
  30588.  
  30589. ΓòÉΓòÉΓòÉ <hidden> VioSetMode ΓòÉΓòÉΓòÉ
  30590.  
  30591. typedef struct _VIOMODEINFO {
  30592.   USHORT cb;                    /* Length of the entire data structure  */
  30593.   UCHAR  fbType;                /* Bit mask of mode being set           */
  30594.   UCHAR  color;                 /* Number of colors (power of 2)        */
  30595.   USHORT col;                   /* Number of text columns               */
  30596.   USHORT row;                   /* Number of text rows                  */
  30597.   USHORT hres;                  /* Horizontal resolution                */
  30598.   USHORT vres;                  /* Vertical resolution                  */
  30599.   UCHAR  fmt_ID;                /* Attribute format                     */
  30600.   UCHAR  attrib;                /* Number of attributes                 */
  30601.   ULONG  buf_addr;
  30602.   ULONG  buf_length;
  30603.   ULONG  full_length;
  30604.   ULONG  partial_length;
  30605.   PCH    ext_data_addr;
  30606.   } VIOMODEINFO;
  30607. typedef VIOMODEINFO far *PVIOMODEINFO;
  30608.  
  30609. #define INCL_VIO
  30610.  
  30611. USHORT  rc = VioSetMode(ModeData, VioHandle);
  30612.  
  30613. PVIOMODEINFO     ModeData;      /* Mode characteristics */
  30614. HVIO             VioHandle;     /* Video handle */
  30615.  
  30616. USHORT           rc;            /* return code */
  30617.  
  30618.  
  30619. ΓòÉΓòÉΓòÉ <hidden> VioSetState ΓòÉΓòÉΓòÉ
  30620.  
  30621. typedef struct _VIOPALSTATE {
  30622.   USHORT  cb;                   /* Length of this structure in bytes */
  30623.   USHORT  type;                 /* Request type=0 get palette registers */
  30624.   USHORT  iFirst;               /* First palette register to return */
  30625.   USHORT  acolor[1];            /* Color value palette register */
  30626.   }VIOPALSTATE;
  30627. typedef VIOPALSTATE far *PVIOPALSTATE;
  30628.  
  30629. typedef struct _VIOOVERSCAN {
  30630.   USHORT  cb;                   /* Length of this structure */
  30631.   USHORT  type;                 /* Request type=1 get overscan
  30632.                                     (border) color */
  30633.   USHORT  color;                /* Color value */
  30634.   }VIOOVERSCAN;
  30635. typedef VIOOVERSCAN far *PVIOOVERSCAN;
  30636.  
  30637. typedef struct _VIOINTENSITY {
  30638.   USHORT  cb;                   /* Length of this structure */
  30639.   USHORT  type;                 /* Request type=2 get blink/background
  30640.                                     intensity switch */
  30641.   USHORT  fs;                   /* Value of blink/background switch */
  30642.   }VIOINTENSITY;
  30643. typedef VIOINTENSITY far *PVIOINTENSITY;
  30644.  
  30645. typedef struct _VIOCOLORREG {   /* viocreg */
  30646.   USHORT  cb;
  30647.   USHORT  type;
  30648.   USHORT  firstcolorreg;
  30649.   USHORT  numcolorregs;
  30650.   PCH     colorregaddr;
  30651.   }VIOCOLORREG;
  30652. typedef VIOCOLORREG far *PVIOCOLORREG;
  30653.  
  30654. typedef struct _VIOSETULINELOC { /* viouline */
  30655.   USHORT  cb;
  30656.   USHORT  type;
  30657.   USHORT  scanline;
  30658.   }VIOSETULINELOC;
  30659. typedef VIOSETULINELOC far *PVIOSETULINELOC;
  30660.  
  30661. typedef struct _VIOSETTARGET {  /* viosett */
  30662.   USHORT  cb;
  30663.   USHORT  type;
  30664.   USHORT  defaultalgorithm;
  30665.   }VIOSETTARGET;
  30666. typedef VIOSETTARGET far *PVIOSETTARGET;
  30667.  
  30668. #define INCL_VIO
  30669.  
  30670. USHORT  rc = VioSetState(RequestBlock, VioHandle);
  30671.  
  30672. PVOID            RequestBlock;  /* Request block */
  30673. HVIO             VioHandle;     /* Video handle */
  30674.  
  30675. USHORT           rc;            /* return code */
  30676.  
  30677.  
  30678. ΓòÉΓòÉΓòÉ <hidden> VioShowBuf ΓòÉΓòÉΓòÉ
  30679.  
  30680. #define INCL_VIO
  30681.  
  30682. USHORT  rc = VioShowBuf(Offset, Length, VioHandle);
  30683.  
  30684. USHORT           Offset;        /* Offset into LVB */
  30685. USHORT           Length;        /* Length */
  30686. HVIO             VioHandle;     /* Video handle */
  30687.  
  30688. USHORT           rc;            /* return code */
  30689.  
  30690.  
  30691. ΓòÉΓòÉΓòÉ <hidden> VioWrtCellStr ΓòÉΓòÉΓòÉ
  30692.  
  30693. #define INCL_VIO
  30694.  
  30695. USHORT  rc = VioWrtCellStr(CellStr, Length, Row, Column, VioHandle);
  30696.  
  30697. PCH              CellStr;       /* String to be written */
  30698. USHORT           Length;        /* Length of string */
  30699. USHORT           Row;           /* Starting row position for output */
  30700. USHORT           Column;        /* Starting column position for output */
  30701. HVIO             VioHandle;     /* Video handle */
  30702.  
  30703. USHORT           rc;            /* return code */
  30704.  
  30705.  
  30706. ΓòÉΓòÉΓòÉ <hidden> VioWrtCharStr ΓòÉΓòÉΓòÉ
  30707.  
  30708. #define INCL_VIO
  30709.  
  30710. USHORT  rc = VioWrtCharStr(CharStr, Length, Row, Column, VioHandle);
  30711.  
  30712. PCH              CharStr;       /* String to be written */
  30713. USHORT           Length;        /* Length of character string */
  30714. USHORT           Row;           /* Starting row position for output */
  30715. USHORT           Column;        /* Starting column position for output */
  30716. HVIO             VioHandle;     /* Video handle */
  30717.  
  30718. USHORT           rc;            /* return code */
  30719.  
  30720.  
  30721. ΓòÉΓòÉΓòÉ <hidden> VioWrtCharStrAtt ΓòÉΓòÉΓòÉ
  30722.  
  30723. #define INCL_VIO
  30724.  
  30725. USHORT  rc = VioWrtCharStrAtt(CharStr, Length, Row, Column, Attr,
  30726.                                VioHandle);
  30727.  
  30728. PCH              CharStr;       /* String to be written */
  30729. USHORT           Length;        /* Length of string */
  30730. USHORT           Row;           /* Starting row position for output */
  30731. USHORT           Column;        /* Starting column position for output */
  30732. PBYTE            Attr;          /* Attribute to be replicated */
  30733. HVIO             VioHandle;     /* Video handle */
  30734.  
  30735. USHORT           rc;            /* return code */
  30736.  
  30737.  
  30738. ΓòÉΓòÉΓòÉ <hidden> VioWrtNAttr ΓòÉΓòÉΓòÉ
  30739.  
  30740. #define INCL_VIO
  30741.  
  30742. USHORT  rc = VioWrtNAttr(Attr, Times, Row, Column, VioHandle);
  30743.  
  30744. PBYTE            Attr;          /* Attribute to be written */
  30745. USHORT           Times;         /* Repeat count */
  30746. USHORT           Row;           /* Starting row position for output */
  30747. USHORT           Column;        /* Starting column position for output */
  30748. HVIO             VioHandle;     /* Video handle */
  30749.  
  30750. USHORT           rc;            /* return code */
  30751.  
  30752.  
  30753. ΓòÉΓòÉΓòÉ <hidden> VioWrtNCell ΓòÉΓòÉΓòÉ
  30754.  
  30755. #define INCL_VIO
  30756.  
  30757. USHORT  rc = VioWrtNCell(Cell, Times, Row, Column, VioHandle);
  30758.  
  30759. PBYTE            Cell;          /* Cell to be written */
  30760. USHORT           Times;         /* Repeat count */
  30761. USHORT           Row;           /* Starting row position for output */
  30762. USHORT           Column;        /* Starting column position for output */
  30763. HVIO             VioHandle;     /* Video handle */
  30764.  
  30765. USHORT           rc;            /* return code */
  30766.  
  30767.  
  30768. ΓòÉΓòÉΓòÉ <hidden> VioWrtNChar ΓòÉΓòÉΓòÉ
  30769.  
  30770. #define INCL_VIO
  30771.  
  30772. USHORT  rc = VioWrtNChar(Char, Times, Row, Column, VioHandle);
  30773.  
  30774. PCH              Char;          /* Character to be written */
  30775. USHORT           Times;         /* Repeat count */
  30776. USHORT           Row;           /* Starting row position for output */
  30777. USHORT           Column;        /* Starting column position for output */
  30778. HVIO             VioHandle;     /* Video handle */
  30779.  
  30780. USHORT           rc;            /* return code */
  30781.  
  30782.  
  30783. ΓòÉΓòÉΓòÉ <hidden> VioWrtTTY ΓòÉΓòÉΓòÉ
  30784.  
  30785. #define INCL_VIO
  30786.  
  30787. USHORT  rc = VioWrtTTY(CharStr, Length, VioHandle);
  30788.  
  30789. PCH              CharStr;       /* String to be written */
  30790. USHORT           Length;        /* Length of string */
  30791. HVIO             VioHandle;     /* Video handle */
  30792.  
  30793. USHORT           rc;            /* return code */
  30794.  
  30795.  
  30796. ΓòÉΓòÉΓòÉ <hidden> VioDeRegister ΓòÉΓòÉΓòÉ
  30797.  
  30798. EXTRN  VioDeRegister:FAR
  30799. INCL_VIO            EQU 1
  30800.  
  30801. CALL   VioDeRegister
  30802.  
  30803. Returns WORD
  30804.  
  30805.  
  30806. ΓòÉΓòÉΓòÉ <hidden> VioEndPopUp ΓòÉΓòÉΓòÉ
  30807.  
  30808. EXTRN  VioEndPopUp:FAR
  30809. INCL_VIO            EQU 1
  30810.  
  30811. PUSH   WORD    VioHandle     ;Vio device handle
  30812. CALL   VioEndPopUp
  30813.  
  30814. Returns WORD
  30815.  
  30816.  
  30817. ΓòÉΓòÉΓòÉ <hidden> VioGetAnsi ΓòÉΓòÉΓòÉ
  30818.  
  30819. EXTRN  VioGetAnsi:FAR
  30820. INCL_VIO            EQU 1
  30821.  
  30822. PUSH@  WORD    Indicator     ;On/Off indicator (returned)
  30823. PUSH   WORD    VioHandle     ;Vio handle
  30824. CALL   VioGetAnsi
  30825.  
  30826. Returns WORD
  30827.  
  30828.  
  30829. ΓòÉΓòÉΓòÉ <hidden> VioGetBuf ΓòÉΓòÉΓòÉ
  30830.  
  30831. EXTRN  VioGetBuf:FAR
  30832. INCL_VIO            EQU 1
  30833.  
  30834. PUSH@  DWORD   LVBPtr        ;Points to LVB
  30835. PUSH@  WORD    Length        ;Length of buffer
  30836. PUSH   WORD    VioHandle     ;Vio handle
  30837. CALL   VioGetBuf
  30838.  
  30839. Returns WORD
  30840.  
  30841.  
  30842. ΓòÉΓòÉΓòÉ <hidden> VioGetConfig ΓòÉΓòÉΓòÉ
  30843.  
  30844. VIOCONFIGINFO struc
  30845.   vioin_cb            dw  ? ;Length of this data structure
  30846.   vioin_adapter       dw  ? ;Display adapter type
  30847.   vioin_display       dw  ? ;Display/monitor type
  30848.   vioin_cbMemory      dd  ? ;Amount of memory on the adapter in bytes
  30849.   vioin_Configuration dw  ? ;
  30850.   vioin_VDHVersion    dw  ? ;
  30851.   vioin_Flags         dw  ? ;
  30852.   vioin_HWBufferSize  dd  ? ;
  30853.   vioin_FullSaveSize  dd  ? ;
  30854.   vioin_PartSaveSize  dd  ? ;
  30855.   vioin_EMAdaptersOFF dw  ? ;Offset to emulated adapter types
  30856.   vioin_EMDisplaysOFF dw  ? ;Offset to emulated display types
  30857. VIOCONFIGINFO ends
  30858.  
  30859. EXTRN  VioGetConfig:FAR
  30860. INCL_VIO            EQU 1
  30861.  
  30862. PUSH   WORD    ConfigID      ;Configuration ID
  30863. PUSH@  OTHER   ConfigData    ;Configuration data
  30864. PUSH   WORD    VioHandle     ;Vio handle
  30865. CALL   VioGetConfig
  30866.  
  30867. Returns WORD
  30868.  
  30869.  
  30870. ΓòÉΓòÉΓòÉ <hidden> VioGetCp ΓòÉΓòÉΓòÉ
  30871.  
  30872. EXTRN  VioGetCp:FAR
  30873. INCL_VIO            EQU 1
  30874.  
  30875. PUSH   WORD    Reserved      ;Reserved (must be zero)
  30876. PUSH@  WORD    CodePageID    ;Code page ID
  30877. PUSH   WORD    VioHandle     ;Video handle
  30878. CALL   VioGetCp
  30879.  
  30880. Returns WORD
  30881.  
  30882.  
  30883. ΓòÉΓòÉΓòÉ <hidden> VioGetCurPos ΓòÉΓòÉΓòÉ
  30884.  
  30885. EXTRN  VioGetCurPos:FAR
  30886. INCL_VIO            EQU 1
  30887.  
  30888. PUSH@  WORD    Row           ;Row return data
  30889. PUSH@  WORD    Column        ;Column return data
  30890. PUSH   WORD    VioHandle     ;Vio handle
  30891. CALL   VioGetCurPos
  30892.  
  30893. Returns WORD
  30894.  
  30895.  
  30896. ΓòÉΓòÉΓòÉ <hidden> VioGetCurType ΓòÉΓòÉΓòÉ
  30897.  
  30898. VIOCURSORINFO struc
  30899.   vioci_yStart dw  ? ;cursor start line
  30900.   vioci_cEnd   dw  ? ;cursor end line
  30901.   vioci_cx     dw  ? ;cursor width
  30902.   vioci_attr   dw  ? ;-1=hidden cursor, any other=normal cursor
  30903. VIOCURSORINFO ends
  30904.  
  30905. EXTRN  VioGetCurType:FAR
  30906. INCL_VIO            EQU 1
  30907.  
  30908. PUSH@  OTHER   CursorData    ;Cursor characteristics
  30909. PUSH   WORD    VioHandle     ;Vio handle
  30910. CALL   VioGetCurType
  30911.  
  30912. Returns WORD
  30913.  
  30914.  
  30915. ΓòÉΓòÉΓòÉ <hidden> VioGetFont ΓòÉΓòÉΓòÉ
  30916.  
  30917. VIOFONTINFO struc
  30918.   viofi_cb      dw  ? ;length of this structure
  30919.   viofi_type    dw  ? ;request type
  30920.   viofi_cxCell  dw  ? ;pel columns in character cell
  30921.   viofi_cyCell  dw  ? ;pel rows in character cell
  30922.   viofi_pbData  dd  ? ;requested font table (returned)
  30923.   viofi_cbData  dw  ? ;length of caller supplied data area (in bytes)
  30924. VIOFONTINFO ends
  30925.  
  30926. EXTRN  VioGetFont:FAR
  30927. INCL_VIO            EQU 1
  30928.  
  30929. PUSH@  OTHER   RequestBlock  ;Request block
  30930. PUSH   WORD    VioHandle     ;Vio handle
  30931. CALL   VioGetFont
  30932.  
  30933. Returns WORD
  30934.  
  30935.  
  30936. ΓòÉΓòÉΓòÉ <hidden> VioGetMode ΓòÉΓòÉΓòÉ
  30937.  
  30938. VIOMODEINFO struc
  30939.   viomi_cb             dw ? ;Length of the entire data structure
  30940.   viomi_fbType         db ? ;Bit mask of mode being set
  30941.   viomi_color          db ? ;Number of colors (power of 2)
  30942.   viomi_col            dw ? ;Number of text columns
  30943.   viomi_row            dw ? ;Number of text rows
  30944.   viomi_hres           dw ? ;Horizontal resolution
  30945.   viomi_vres           dw ? ;Vertical resolution
  30946.   viomi_fmt_ID         db ? ;Attribute format
  30947.   viomi_attrib         db ? ;Number of attributes
  30948.   viomi_buf_addr       dd ? ;
  30949.   viomi_buf_length     dd ? ;
  30950.   viomi_full_length    dd ? ;
  30951.   viomi_partial_length dd ? ;
  30952.   viomi_ext_data_addr  dd ? ;
  30953. VIOMODEINFO ends
  30954.  
  30955. EXTRN  VioGetMode:FAR
  30956. INCL_VIO            EQU 1
  30957.  
  30958. PUSH@  OTHER   ModeData      ;Mode characteristics
  30959. PUSH   WORD    VioHandle     ;Vio handle
  30960. CALL   VioGetMode
  30961.  
  30962. Returns WORD
  30963.  
  30964.  
  30965. ΓòÉΓòÉΓòÉ <hidden> VioGetPhysBuf ΓòÉΓòÉΓòÉ
  30966.  
  30967. VIOPHYSBUF struc
  30968.   viopb_pBuf dd  ? ;Buffer start address
  30969.   viopb_cb   dd  ? ;buffer length
  30970.   viopb_asel dw  1 dup (?) ;selector list
  30971. VIOPHYSBUF ends
  30972.  
  30973. EXTRN  VioGetPhysBuf:FAR
  30974. INCL_VIO            EQU 1
  30975.  
  30976. PUSH@  OTHER   Structure     ;Data structure
  30977. PUSH   WORD    Reserved      ;Reserved (must be zero)
  30978. CALL   VioGetPhysBuf
  30979.  
  30980. Returns WORD
  30981.  
  30982.  
  30983. ΓòÉΓòÉΓòÉ <hidden> VioGetState ΓòÉΓòÉΓòÉ
  30984.  
  30985. VIOPALSTATE struc
  30986.   viopal_cb               dw ? ;Length of this structure in bytes
  30987.   viopal_type             dw ? ;Request type=0 get palette registers
  30988.   viopal_iFirst           dw ? ;First palette register to return
  30989.   viopal_acolor  dw 1  dup (?) ;Color value palette register
  30990. VIOPALSTATE ends
  30991.  
  30992. VIOOVERSCAN struc
  30993.   vioos_cb                dw ? ;Length of this structure
  30994.   vioos_type              dw ? ;Request type=1 get overscan (border) color
  30995.   vioos_color             dw ? ;Color value
  30996. VIOOVERSCAN ends
  30997.  
  30998. VIOINTENSITY struc
  30999.   vioint_cb               dw ? ;Length of this structure
  31000.   vioint_type             dw ? ;Request type=2 get blink/background
  31001.                               ; intensity switch
  31002.   vioint_fs               dw ? ;Value of blink/background switch
  31003. VIOINTENSITY ends
  31004.  
  31005. VIOCOLORREG struc
  31006.   viocreg_cb              dw ? ;
  31007.   viocreg_type            dw ? ;
  31008.   viocreg_firstcolorreg   dw ? ;
  31009.   viocreg_numcolorregs    dw ? ;
  31010.   viocreg_colorregaddr    dd ? ;
  31011. VIOCOLORREG ends
  31012.  
  31013. VIOSETULINELOC struc
  31014.   viouline_cb             dw ? ;
  31015.   viouline_type           dw ? ;
  31016.   viouline_scanline       dw ? ;
  31017. VIOSETULINELOC ends
  31018.  
  31019. VIOSETTARGET struc
  31020.   viosett_cb               dw ? ;
  31021.   viosett_type             dw ? ;
  31022.   viosett_defaultalgorithm dw ? ;
  31023. VIOSETTARGET    ends
  31024.  
  31025. EXTRN  VioGetState:FAR
  31026. INCL_VIO            EQU 1
  31027.  
  31028. PUSH@  OTHER   RequestBlock     ;Request block
  31029. PUSH   WORD    VioHandle        ;Vio handle
  31030. CALL   VioGetState
  31031.  
  31032. Returns WORD
  31033.  
  31034.  
  31035. ΓòÉΓòÉΓòÉ <hidden> VioGlobalReg ΓòÉΓòÉΓòÉ
  31036.  
  31037. EXTRN VioGlobalReg:FAR
  31038. INCL_VIO            EQU 1
  31039.  
  31040. PUSH@ ASCIIZ ModuleName      ;Module name
  31041. PUSH@ ASCIIZ EntryPoint      ;Entry point name
  31042. PUSH  DWORD  FunctionMask1   ;Function mask 1
  31043. PUSH  DWORD  FunctionMask2   ;Function mask 2
  31044. PUSH  DWORD  0               ;Reserved (must be zero)
  31045. CALL  VioGlobalReg
  31046.  
  31047. Returns WORD
  31048.  
  31049.  
  31050. ΓòÉΓòÉΓòÉ <hidden> VioModeUndo ΓòÉΓòÉΓòÉ
  31051.  
  31052. EXTRN  VioModeUndo:FAR
  31053. INCL_VIO            EQU 1
  31054.  
  31055. PUSH   WORD    OwnerIndic    ;Ownership indicator
  31056. PUSH   WORD    KillIndic     ;Terminate indicator
  31057. PUSH   WORD    Reserved      ;Reserved (must be zero)
  31058. CALL   VioModeUndo
  31059.  
  31060. Returns WORD
  31061.  
  31062.  
  31063. ΓòÉΓòÉΓòÉ <hidden> VioModeWait ΓòÉΓòÉΓòÉ
  31064.  
  31065. EXTRN  VioModeWait:FAR
  31066. INCL_VIO            EQU 1
  31067.  
  31068. PUSH   WORD    RequestType   ;Request type
  31069. PUSH@  WORD    NotifyType    ;Notify type (returned)
  31070. PUSH   WORD    Reserved      ;Reserved (must be zero)
  31071. CALL   VioModeWait
  31072.  
  31073. Returns WORD
  31074.  
  31075.  
  31076. ΓòÉΓòÉΓòÉ <hidden> VioPopUp ΓòÉΓòÉΓòÉ
  31077.  
  31078. EXTRN   VioPopUp:FAR
  31079. INCL_VIO            EQU 1
  31080.  
  31081. PUSH@  WORD    Options       ;Option Flags
  31082. PUSH   WORD    VioHandle     ;Vio handle
  31083. CALL   VioPopUp
  31084.  
  31085. Returns WORD
  31086.  
  31087.  
  31088. ΓòÉΓòÉΓòÉ <hidden> VioPrtSc ΓòÉΓòÉΓòÉ
  31089.  
  31090. EXTRN  VioPrtSc:FAR
  31091. INCL_VIO            EQU 1
  31092.  
  31093. PUSH   WORD    VioHandle     ;Vio handle
  31094. CALL   VioPrtSc
  31095.  
  31096. Returns WORD
  31097.  
  31098.  
  31099. ΓòÉΓòÉΓòÉ <hidden> VioPrtScToggle ΓòÉΓòÉΓòÉ
  31100.  
  31101. EXTRN  VioPrtScToggle:FAR
  31102. INCL_VIO            EQU 1
  31103.  
  31104. PUSH   WORD    VioHandle     ;Vio handle
  31105. CALL   VioPrtScToggle
  31106.  
  31107. Returns WORD
  31108.  
  31109.  
  31110. ΓòÉΓòÉΓòÉ <hidden> VioReadCellStr ΓòÉΓòÉΓòÉ
  31111.  
  31112. EXTRN  VioReadCellStr:FAR
  31113. INCL_VIO            EQU 1
  31114.  
  31115. PUSH@  OTHER   CellStr       ;Cell string buffer
  31116. PUSH@  WORD    Length        ;Length of cell string buffer
  31117. PUSH   WORD    Row           ;Starting row location
  31118. PUSH   WORD    Column        ;Starting column location
  31119. PUSH   WORD    VioHandle     ;Video handle
  31120. CALL   VioReadCellStr
  31121.  
  31122. Returns WORD
  31123.  
  31124.  
  31125. ΓòÉΓòÉΓòÉ <hidden> VioReadCharStr ΓòÉΓòÉΓòÉ
  31126.  
  31127. EXTRN  VioReadCharStr:FAR
  31128. INCL_VIO            EQU 1
  31129.  
  31130. PUSH@  OTHER   CharStr       ;Character buffer
  31131. PUSH@  WORD    Length        ;Length of buffer
  31132. PUSH   WORD    Row           ;Starting row location
  31133. PUSH   WORD    Column        ;Starting column location
  31134. PUSH   WORD    VioHandle     ;Video handle
  31135. CALL   VioReadCharStr
  31136.  
  31137. Returns WORD
  31138.  
  31139.  
  31140. ΓòÉΓòÉΓòÉ <hidden> VioRegister ΓòÉΓòÉΓòÉ
  31141.  
  31142. EXTRN  VioRegister:FAR
  31143. INCL_VIO            EQU 1
  31144.  
  31145. PUSH@  ASCIIZ  ModuleName    ;Module name
  31146. PUSH@  ASCIIZ  EntryPoint    ;Entry point name
  31147. PUSH   DWORD   FunctionMask1 ;Function mask 1
  31148. PUSH   DWORD   FunctionMask2 ;Function mask 2
  31149. CALL   VioRegister
  31150.  
  31151. Returns WORD
  31152.  
  31153.  
  31154. ΓòÉΓòÉΓòÉ <hidden> VioSavRedrawUndo ΓòÉΓòÉΓòÉ
  31155.  
  31156. EXTRN  VioSavRedrawUndo:FAR
  31157. INCL_VIO            EQU 1
  31158.  
  31159. PUSH   WORD    OwnerIndic    ;Ownership indicator
  31160. PUSH   WORD    KillIndic     ;Terminate indicator
  31161. PUSH   WORD    VioHandle     ;Video handle
  31162. CALL   VioSavRedrawUndo
  31163.  
  31164. Returns WORD
  31165.  
  31166.  
  31167. ΓòÉΓòÉΓòÉ <hidden> VioSavRedrawWait ΓòÉΓòÉΓòÉ
  31168.  
  31169. EXTRN  VioSavRedrawWait:FAR
  31170. INCL_VIO            EQU 1
  31171.  
  31172. PUSH   WORD    SavRedrawIndic ;Save/redraw indicator
  31173. PUSH@  WORD    NotifyType     ;Notify type (returned)
  31174. PUSH   WORD    VioHandle      ;Video handle
  31175. CALL   VioSavRedrawWait
  31176.  
  31177. Returns WORD
  31178.  
  31179.  
  31180. ΓòÉΓòÉΓòÉ <hidden> VioScrLock ΓòÉΓòÉΓòÉ
  31181.  
  31182. EXTRN  VioScrLock:FAR
  31183. INCL_VIO            EQU 1
  31184.  
  31185. PUSH   WORD    WaitFlag      ;Block or not
  31186. PUSH@  BYTE    Status        ;Lock status (returned)
  31187. PUSH   WORD    VioHandle     ;Video handle
  31188. CALL   VioScrLock
  31189.  
  31190. Returns WORD
  31191.  
  31192.  
  31193. ΓòÉΓòÉΓòÉ <hidden> VioScrollDn ΓòÉΓòÉΓòÉ
  31194.  
  31195. EXTRN  VioScrollDn:FAR
  31196. INCL_VIO            EQU 1
  31197.  
  31198. PUSH   WORD    TopRow        ;Top row
  31199. PUSH   WORD    LeftCol       ;Left column
  31200. PUSH   WORD    BotRow        ;Bottom row
  31201. PUSH   WORD    RightCol      ;Right column
  31202. PUSH   WORD    Lines         ;Number of lines
  31203. PUSH@  OTHER   Cell          ;Cell to be written
  31204. PUSH   WORD    VioHandle     ;Video handle
  31205. CALL   VioScrollDn
  31206.  
  31207. Returns WORD
  31208.  
  31209.  
  31210. ΓòÉΓòÉΓòÉ <hidden> VioScrollLf ΓòÉΓòÉΓòÉ
  31211.  
  31212. EXTRN  VioScrollLf:FAR
  31213. INCL_VIO            EQU 1
  31214.  
  31215. PUSH   WORD    TopRow        ;Top row
  31216. PUSH   WORD    LeftCol       ;Left column
  31217. PUSH   WORD    BotRow        ;Bottom row
  31218. PUSH   WORD    RightCol      ;Right column
  31219. PUSH   WORD    Lines         ;Number of lines
  31220. PUSH@  OTHER   Cell          ;Cell to be written
  31221. PUSH   WORD    VioHandle     ;Video Handle
  31222. CALL   VioScrollLf
  31223.  
  31224. Returns WORD
  31225.  
  31226.  
  31227. ΓòÉΓòÉΓòÉ <hidden> VioScrollRt ΓòÉΓòÉΓòÉ
  31228.  
  31229. EXTRN  VioScrollRt:FAR
  31230. INCL_VIO            EQU 1
  31231.  
  31232. PUSH   WORD    TopRow        ;Top row
  31233. PUSH   WORD    LeftCol       ;Left column
  31234. PUSH   WORD    BotRow        ;Bottom row
  31235. PUSH   WORD    RightCol      ;Right column
  31236. PUSH   WORD    Lines         ;Number of lines
  31237. PUSH@  OTHER   Cell          ;Cell to be written
  31238. PUSH   WORD    VioHandle     ;Video handle
  31239. CALL   VioScrollRt
  31240.  
  31241. Returns WORD
  31242.  
  31243.  
  31244. ΓòÉΓòÉΓòÉ <hidden> VioScrollUp ΓòÉΓòÉΓòÉ
  31245.  
  31246. EXTRN  VioScrollUp:FAR
  31247. INCL_VIO            EQU 1
  31248.  
  31249. PUSH   WORD    TopRow        ;Top row
  31250. PUSH   WORD    LeftCol       ;Left column
  31251. PUSH   WORD    BotRow        ;Bottom row
  31252. PUSH   WORD    RightCol      ;Right column
  31253. PUSH   WORD    Lines         ;Number of lines
  31254. PUSH@  OTHER   Cell          ;Fill character
  31255. PUSH   WORD    VioHandle     ;Video handle
  31256. CALL   VioScrollUp
  31257.  
  31258. Returns WORD
  31259.  
  31260.  
  31261. ΓòÉΓòÉΓòÉ <hidden> VioScrUnLock ΓòÉΓòÉΓòÉ
  31262.  
  31263. EXTRN  VioScrUnLock:FAR
  31264. INCL_VIO            EQU 1
  31265.  
  31266. PUSH   WORD    VioHandle     ;Video handle
  31267. CALL   VioScrUnLock
  31268.  
  31269. Returns WORD
  31270.  
  31271.  
  31272. ΓòÉΓòÉΓòÉ <hidden> VioSetAnsi ΓòÉΓòÉΓòÉ
  31273.  
  31274. EXTRN  VioSetAnsi:FAR
  31275. INCL_VIO            EQU 1
  31276.  
  31277. PUSH   WORD    Indicator     ;On/Off indicator
  31278. PUSH   WORD    VioHandle     ;Video handle
  31279. CALL   VioSetAnsi
  31280.  
  31281. Returns WORD
  31282.  
  31283.  
  31284. ΓòÉΓòÉΓòÉ <hidden> VioSetCp ΓòÉΓòÉΓòÉ
  31285.  
  31286. EXTRN   VioSetCp:FAR
  31287. INCL_VIO            EQU 1
  31288.  
  31289. PUSH   WORD    Reserved      ;Reserved (must be zero)
  31290. PUSH   WORD    CodePageID    ;CodePage Id
  31291. PUSH   WORD    VioHandle     ;Video handle
  31292. CALL   VioSetCp
  31293.  
  31294. Returns WORD
  31295.  
  31296.  
  31297. ΓòÉΓòÉΓòÉ <hidden> VioSetCurPos ΓòÉΓòÉΓòÉ
  31298.  
  31299. EXTRN  VioSetCurPos:FAR
  31300. INCL_VIO            EQU 1
  31301.  
  31302. PUSH   WORD    Row           ;Row data
  31303. PUSH   WORD    Column        ;Column data
  31304. PUSH   WORD    VioHandle     ;Video handle
  31305. CALL   VioSetCurPos
  31306.  
  31307. Returns WORD
  31308.  
  31309.  
  31310. ΓòÉΓòÉΓòÉ <hidden> VioSetCurType ΓòÉΓòÉΓòÉ
  31311.  
  31312. VIOCURSORINFO struc
  31313.   vioci_yStart dw  ? ;cursor start line
  31314.   vioci_cEnd   dw  ? ;cursor end line
  31315.   vioci_cx     dw  ? ;cursor width
  31316.   vioci_attr   dw  ? ;-1=hidden cursor, any other=normal cursor
  31317. VIOCURSORINFO ends
  31318.  
  31319. EXTRN  VioSetCurType:FAR
  31320. INCL_VIO            EQU 1
  31321.  
  31322. PUSH@  OTHER   CursorData    ;Cursor characteristics
  31323. PUSH   WORD    VioHandle     ;Video handle
  31324. CALL   VioSetCurType
  31325.  
  31326. Returns WORD
  31327.  
  31328.  
  31329. ΓòÉΓòÉΓòÉ <hidden> VioSetFont ΓòÉΓòÉΓòÉ
  31330.  
  31331. VIOFONTINFO struc
  31332.   viofi_cb      dw  ? ;length of this structure
  31333.   viofi_type    dw  ? ;request type
  31334.   viofi_cxCell  dw  ? ;pel columns in character cell
  31335.   viofi_cyCell  dw  ? ;pel rows in character cell
  31336.   viofi_pbData  dd  ? ;requested font table (returned)
  31337.   viofi_cbData  dw  ? ;length of caller supplied data area (in bytes)
  31338. VIOFONTINFO ends
  31339.  
  31340. EXTRN VioSetFont:FAR
  31341. INCL_VIO            EQU 1
  31342.  
  31343. PUSH@  OTHER   RequestBlock  ;Request block
  31344. PUSH   WORD    VioHandle     ;Video handle
  31345. CALL   VioSetFont
  31346.  
  31347. Returns WORD
  31348.  
  31349.  
  31350. ΓòÉΓòÉΓòÉ <hidden> VioSetMode ΓòÉΓòÉΓòÉ
  31351.  
  31352. VIOMODEINFO struc
  31353.   viomi_cb             dw ? ;Length of the entire data structure
  31354.   viomi_fbType         db ? ;Bit mask of mode being set
  31355.   viomi_color          db ? ;Number of colors (power of 2)
  31356.   viomi_col            dw ? ;Number of text columns
  31357.   viomi_row            dw ? ;Number of text rows
  31358.   viomi_hres           dw ? ;Horizontal resolution
  31359.   viomi_vres           dw ? ;Vertical resolution
  31360.   viomi_fmt_ID         db ? ;Attribute format
  31361.   viomi_attrib         db ? ;Number of attributes
  31362.   viomi_buf_addr       dd ? ;
  31363.   viomi_buf_length     dd ? ;
  31364.   viomi_full_length    dd ? ;
  31365.   viomi_partial_length dd ? ;
  31366.   viomi_ext_data_addr  dd ? ;
  31367. VIOMODEINFO ends
  31368.  
  31369. EXTRN  VioSetMode:FAR
  31370. INCL_VIO            EQU 1
  31371.  
  31372. PUSH@  OTHER   ModeData      ;Mode characteristics
  31373. PUSH   WORD    VioHandle     ;Video handle
  31374. CALL   VioSetMode
  31375.  
  31376. Returns WORD
  31377.  
  31378.  
  31379. ΓòÉΓòÉΓòÉ <hidden> VioSetState ΓòÉΓòÉΓòÉ
  31380.  
  31381. VIOPALSTATE struc
  31382.   viopal_cb               dw ? ;Length of this structure in bytes
  31383.   viopal_type             dw ? ;Request type=0 get palette registers
  31384.   viopal_iFirst           dw ? ;First palette register to return
  31385.   viopal_acolor  dw 1  dup (?) ;Color value palette register
  31386. VIOPALSTATE ends
  31387.  
  31388. VIOOVERSCAN struc
  31389.   vioos_cb                dw ? ;Length of this structure
  31390.   vioos_type              dw ? ;Request type=1 get overscan (border) color
  31391.   vioos_color             dw ? ;Color value
  31392. VIOOVERSCAN ends
  31393.  
  31394. VIOINTENSITY struc
  31395.   vioint_cb               dw ? ;Length of this structure
  31396.   vioint_type             dw ? ;Request type=2 get blink/background
  31397.                               ; intensity switch
  31398.   vioint_fs               dw ? ;Value of blink/background switch
  31399. VIOINTENSITY ends
  31400.  
  31401. VIOCOLORREG struc
  31402.   viocreg_cb              dw ? ;
  31403.   viocreg_type            dw ? ;
  31404.   viocreg_firstcolorreg   dw ? ;
  31405.   viocreg_numcolorregs    dw ? ;
  31406.   viocreg_colorregaddr    dd ? ;
  31407. VIOCOLORREG ends
  31408.  
  31409. VIOSETULINELOC struc
  31410.   viouline_cb             dw ? ;
  31411.   viouline_type           dw ? ;
  31412.   viouline_scanline       dw ? ;
  31413. VIOSETULINELOC ends
  31414.  
  31415. VIOSETTARGET struc
  31416.   viosett_cb               dw ? ;
  31417.   viosett_type             dw ? ;
  31418.   viosett_defaultalgorithm dw ? ;
  31419. VIOSETTARGET    ends
  31420.  
  31421. EXTRN VioSetState:FAR
  31422. INCL_VIO            EQU 1
  31423.  
  31424. PUSH@  OTHER   RequestBlock  ;Request block
  31425. PUSH   WORD    VioHandle     ;Video handle
  31426. CALL   VioSetState
  31427.  
  31428. Returns WORD
  31429.  
  31430.  
  31431. ΓòÉΓòÉΓòÉ <hidden> VioShowBuf ΓòÉΓòÉΓòÉ
  31432.  
  31433. EXTRN  VioShowBuf:FAR
  31434. INCL_VIO            EQU 1
  31435.  
  31436. PUSH   WORD    Offset        ;Offset into LVB
  31437. PUSH   WORD    Length        ;Length
  31438. PUSH   WORD    VioHandle     ;Video handle
  31439. CALL   VioShowBuf
  31440.  
  31441. Returns WORD
  31442.  
  31443.  
  31444. ΓòÉΓòÉΓòÉ <hidden> VioWrtCellStr ΓòÉΓòÉΓòÉ
  31445.  
  31446. EXTRN  VioWrtCellStr:FAR
  31447. INCL_VIO            EQU 1
  31448.  
  31449. PUSH@  OTHER   CellStr       ;String to be written
  31450. PUSH   WORD    Length        ;Length of string
  31451. PUSH   WORD    Row           ;Starting row position for output
  31452. PUSH   WORD    Column        ;Starting column position for output
  31453. PUSH   WORD    VioHandle     ;Video handle
  31454. CALL   VioWrtCellStr
  31455.  
  31456. Returns WORD
  31457.  
  31458.  
  31459. ΓòÉΓòÉΓòÉ <hidden> VioWrtCharStr ΓòÉΓòÉΓòÉ
  31460.  
  31461. EXTRN  VioWrtCharStr:FAR
  31462. INCL_VIO            EQU 1
  31463.  
  31464. PUSH@  OTHER   CharStr       ;String to be written
  31465. PUSH   WORD    Length        ;Length of character string
  31466. PUSH   WORD    Row           ;Starting row position for output
  31467. PUSH   WORD    Column        ;Starting column position for output
  31468. PUSH   WORD    VioHandle     ;Video handle
  31469. CALL   VioWrtCharStr
  31470.  
  31471. Returns WORD
  31472.  
  31473.  
  31474. ΓòÉΓòÉΓòÉ <hidden> VioWrtCharStrAtt ΓòÉΓòÉΓòÉ
  31475.  
  31476. EXTRN  VioWrtCharStrAtt:FAR
  31477. INCL_VIO            EQU 1
  31478.  
  31479. PUSH@  OTHER   CharStr       ;String to be written
  31480. PUSH   WORD    Length        ;Length of string
  31481. PUSH   WORD    Row           ;Starting row position for output
  31482. PUSH   WORD    Column        ;Starting column position for output
  31483. PUSH@  OTHER   Attr          ;Attribute to be replicated
  31484. PUSH   WORD    VioHandle     ;Video handle
  31485. CALL   VioWrtCharStrAtt
  31486.  
  31487. Returns WORD
  31488.  
  31489.  
  31490. ΓòÉΓòÉΓòÉ <hidden> VioWrtNAttr ΓòÉΓòÉΓòÉ
  31491.  
  31492. EXTRN  VioWrtNAttr:FAR
  31493. INCL_VIO            EQU 1
  31494.  
  31495. PUSH@  OTHER   Attr          ;Attribute to be written
  31496. PUSH   WORD    Times         ;Repeat count
  31497. PUSH   WORD    Row           ;Starting row position for output
  31498. PUSH   WORD    Column        ;Starting column position for output
  31499. PUSH   WORD    VioHandle     ;Video handle
  31500. CALL   VioWrtNAttr
  31501.  
  31502. Returns WORD
  31503.  
  31504.  
  31505. ΓòÉΓòÉΓòÉ <hidden> VioWrtNCell ΓòÉΓòÉΓòÉ
  31506.  
  31507. EXTRN  VioWrtNCell:FAR
  31508. INCL_VIO            EQU 1
  31509.  
  31510. PUSH@  OTHER   Cell          ;Cell to be written
  31511. PUSH   WORD    Times         ;Repeat count
  31512. PUSH   WORD    Row           ;Starting row position for output
  31513. PUSH   WORD    Column        ;Starting column position for output
  31514. PUSH   WORD    VioHandle     ;Video handle
  31515. CALL   VioWrtNCell
  31516.  
  31517. Returns WORD
  31518.  
  31519.  
  31520. ΓòÉΓòÉΓòÉ <hidden> VioWrtNChar ΓòÉΓòÉΓòÉ
  31521.  
  31522. EXTRN  VioWrtNChar:FAR
  31523. INCL_VIO            EQU 1
  31524.  
  31525. PUSH@  OTHER   Char          ;Character to be written
  31526. PUSH   WORD    Times         ;Repeat count
  31527. PUSH   WORD    Row           ;Starting row position for output
  31528. PUSH   WORD    Column        ;Starting column position for output
  31529. PUSH   WORD    VioHandle     ;Video handle
  31530. CALL   VioWrtNChar
  31531.  
  31532. Returns WORD
  31533.  
  31534.  
  31535. ΓòÉΓòÉΓòÉ <hidden> VioWrtTTY ΓòÉΓòÉΓòÉ
  31536.  
  31537. EXTRN  VioWrtTTY:FAR
  31538. INCL_VIO            EQU 1
  31539.  
  31540. PUSH@  OTHER   CharStr       ;String to be written
  31541. PUSH   WORD    Length        ;Length of string
  31542. PUSH   WORD    VioHandle     ;Video handle
  31543. CALL   VioWrtTTY
  31544.  
  31545. Returns WORD
  31546.  
  31547.  
  31548. ΓòÉΓòÉΓòÉ 5. Errors Returned from Base OS/2 Calls ΓòÉΓòÉΓòÉ
  31549.  
  31550. This section contains the error number, name, and description. 
  31551.  
  31552.  
  31553. ΓòÉΓòÉΓòÉ 5.1. Numeric Order ΓòÉΓòÉΓòÉ
  31554.  
  31555. Errors returned from Base OS/2 Calls: 
  31556.  
  31557.  0   NO_ERROR 
  31558.          No error occurred. 
  31559.  
  31560.  1   ERROR_INVALID_FUNCTION 
  31561.          Invalid function number. 
  31562.  
  31563.  2   ERROR_FILE_NOT_FOUND 
  31564.          File not found. 
  31565.  
  31566.  3   ERROR_PATH_NOT_FOUND 
  31567.          Path not found. 
  31568.  
  31569.  4   ERROR_TOO_MANY_OPEN_FILES 
  31570.          Too many open files (no handles left). 
  31571.  
  31572.  5   ERROR_ACCESS_DENIED 
  31573.          Access denied. 
  31574.  
  31575.  6   ERROR_INVALID_HANDLE 
  31576.          Invalid handle. 
  31577.  
  31578.  7   ERROR_ARENA_TRASHED 
  31579.          Memory control blocks destroyed. 
  31580.  
  31581.  8   ERROR_NOT_ENOUGH_MEMORY 
  31582.          Insufficient memory. 
  31583.  
  31584.  9   ERROR_INVALID_BLOCK 
  31585.          Invalid memory-block address. 
  31586.  
  31587.  10  ERROR_BAD_ENVIRONMENT 
  31588.          Invalid environment. 
  31589.  
  31590.  11  ERROR_BAD_FORMAT 
  31591.          Invalid format. 
  31592.  
  31593.  12  ERROR_INVALID_ACCESS 
  31594.          Invalid access code. 
  31595.  
  31596.  13  ERROR_INVALID_DATA 
  31597.          Invalid data. 
  31598.  
  31599.  14 
  31600.          Reserved. 
  31601.  
  31602.  15  ERROR_INVALID_DRIVE 
  31603.          Invalid drive specified. 
  31604.  
  31605.  16  ERROR_CURRENT_DIRECTORY 
  31606.          Attempting to remove current directory. 
  31607.  
  31608.  17  ERROR_NOT_SAME_DEVICE 
  31609.          Not same device. 
  31610.  
  31611.  18  ERROR_NO_MORE_FILES 
  31612.          No more files. 
  31613.  
  31614.  19  ERROR_WRITE_PROTECT 
  31615.          Attempt to write on write-protected diskette. 
  31616.  
  31617.  20  ERROR_BAD_UNIT 
  31618.          Unknown unit. 
  31619.  
  31620.  21  ERROR_NOT_READY 
  31621.          Drive not ready. 
  31622.  
  31623.  22  ERROR_BAD_COMMAND 
  31624.          Unknown command. 
  31625.  
  31626.  23  ERROR_CRC 
  31627.          Data error (CRC). 
  31628.  
  31629.  24  ERROR_BAD_LENGTH 
  31630.          Bad request structure length. 
  31631.  
  31632.  25  ERROR_SEEK 
  31633.          Seek error. 
  31634.  
  31635.  26  ERROR_NOT_DOS_DISK 
  31636.          Unknown media type. 
  31637.  
  31638.  27  ERROR_SECTOR_NOT_FOUND 
  31639.          Sector not found. 
  31640.  
  31641.  28  ERROR_OUT_OF_PAPER 
  31642.          Printer out of paper. 
  31643.  
  31644.  29  ERROR_WRITE_FAULT 
  31645.          Write fault. 
  31646.  
  31647.  30  ERROR_READ_FAULT 
  31648.          Read fault. 
  31649.  
  31650.  31  ERROR_GEN_FAILURE 
  31651.          General failure. 
  31652.  
  31653.  32  ERROR_SHARING_VIOLATION 
  31654.          Sharing violation. 
  31655.  
  31656.  33  ERROR_LOCK_VIOLATION 
  31657.          Lock violation. 
  31658.  
  31659.  34  ERROR_WRONG_DISK 
  31660.          Invalid disk change. 
  31661.  
  31662.  35  ERROR_FCB_UNAVAILABLE 
  31663.          FCB unavailable. 
  31664.  
  31665.  36  ERROR_SHARING_BUFFER_EXCEEDED 
  31666.          Sharing buffer overflow. 
  31667.  
  31668.  37-49 
  31669.          Reserved. 
  31670.  
  31671.  50  ERROR_NOT_SUPPORTED 
  31672.          Network request not supported. 
  31673.  
  31674.  65 
  31675.          Access denied. 
  31676.  
  31677.  73-79 
  31678.          Reserved. 
  31679.  
  31680.  80  ERROR_FILE_EXISTS 
  31681.          File exists. 
  31682.  
  31683.  81  ERROR_DUP_FCB 
  31684.          Reserved. 
  31685.  
  31686.  82  ERROR_CANNOT_MAKE 
  31687.          Cannot make directory entry. 
  31688.  
  31689.  83  ERROR_FAIL_I24 
  31690.          Fail on INT 24. 
  31691.  
  31692.  84  ERROR_OUT_OF_STRUCTURES 
  31693.          Too many redirections. 
  31694.  
  31695.  85  ERROR_ALREADY_ASSIGNED 
  31696.          Duplicate redirection. 
  31697.  
  31698.  86  ERROR_INVALID_PASSWORD 
  31699.          Invalid password. 
  31700.  
  31701.  87  ERROR_INVALID_PARAMETER 
  31702.          Invalid parameter. 
  31703.  
  31704.  88  ERROR_NET_WRITE_FAULT 
  31705.          Network device fault. 
  31706.  
  31707.  89  ERROR_NO_PROC_SLOTS 
  31708.          No process slots available. 
  31709.  
  31710.  90  ERROR_NOT_FROZEN 
  31711.          System error. 
  31712.  
  31713.  91  ERR_TSTOVFL 
  31714.          Timer service table overflow. 
  31715.  
  31716.  92       ERR_TSTDUP
  31717.          Timer service table duplicate. 
  31718.  
  31719.  93  ERROR_NO_ITEMS 
  31720.          No items to work on. 
  31721.  
  31722.  95  ERROR_INTERRUPT 
  31723.          Interrupted system call. 
  31724.  
  31725.  99  ERROR_DEVICE_IN_USE 
  31726.          Device in use. 
  31727.  
  31728.  100  ERROR_TOO_MANY_SEMAPHORES 
  31729.          User/system open semaphore limit exceeded. 
  31730.  
  31731.  101  ERROR_EXCL_SEM_ALREADY_OWNED 
  31732.          Exclusive semaphore already owned. 
  31733.  
  31734.  102  ERROR_SEM_IS_SET 
  31735.          DosCloseSem found semaphore set. 
  31736.  
  31737.  103  ERROR_TOO_MANY_SEM_REQUESTS 
  31738.          Too many exclusive semaphore requests. 
  31739.  
  31740.  104  ERROR_INVALID_AT_INTERRUPT_TIME 
  31741.          Operation invalid at interrupt time. 
  31742.  
  31743.  105  ERROR_SEM_OWNER_DIED 
  31744.          Previous semaphore owner terminated without freeing semaphore. 
  31745.  
  31746.  106  ERROR_SEM_USER_LIMIT 
  31747.          Semaphore limit exceeded. 
  31748.  
  31749.  107  ERROR_DISK_CHANGE 
  31750.          Insert drive B disk into drive A. 
  31751.  
  31752.  108  ERROR_DRIVE_LOCKED 
  31753.          Drive locked by another process. 
  31754.  
  31755.  109  ERROR_BROKEN_PIPE 
  31756.          Write on pipe with no reader. 
  31757.  
  31758.  110  ERROR_OPEN_FAILED 
  31759.          Open/create failed due to explicit fail command. 
  31760.  
  31761.  111  ERROR_BUFFER_OVERFLOW 
  31762.          Buffer passed to system call too small to hold return data. 
  31763.  
  31764.  112  ERROR_DISK_FULL 
  31765.          Not enough space on the disk. 
  31766.  
  31767.  113  ERROR_NO_MORE_SEARCH_HANDLES 
  31768.          Cannot allocate another search structure and handle. 
  31769.  
  31770.  114  ERROR_INVALID_TARGET_HANDLE 
  31771.          Target handle in DosDupHandle invalid. 
  31772.  
  31773.  115  ERROR_PROTECTION_VIOLATION 
  31774.          Bad user virtual address. 
  31775.  
  31776.  116  ERROR_VIOKBD_REQUEST 
  31777.          Error on display write or keyboard read. 
  31778.  
  31779.  117  ERROR_INVALID_CATEGORY 
  31780.          Category for DevIOCtl not defined. 
  31781.  
  31782.  118  ERROR_INVALID_VERIFY_SWITCH 
  31783.          Invalid value passed for verify flag. 
  31784.  
  31785.  119  ERROR_BAD_DRIVER_LEVEL 
  31786.          Level four driver not found. 
  31787.  
  31788.  120  ERROR_CALL_NOT_IMPLEMENTED 
  31789.          Invalid function called. 
  31790.  
  31791.  121  ERROR_SEM_TIMEOUT 
  31792.          Time out occurred from semaphore API function. 
  31793.  
  31794.  122  ERROR_INSUFFICIENT_BUFFER 
  31795.          Data buffer too small. 
  31796.  
  31797.  123  ERROR_INVALID_NAME 
  31798.          Illegal character or bad file-system name. 
  31799.  
  31800.  124  ERROR_INVALID_LEVEL 
  31801.          Non-implemented level for information retrieval or setting. 
  31802.  
  31803.  125  ERROR_NO_VOLUME_LABEL 
  31804.          No volume label found with DosQFsInfo command. 
  31805.  
  31806.  126  ERROR_MOD_NOT_FOUND 
  31807.          Module handle not found with getprocaddr, getmodhandle. 
  31808.  
  31809.  127  ERROR_PROC_NOT_FOUND 
  31810.          Procedure address not found with getprocaddr. 
  31811.  
  31812.  128  ERROR_WAIT_NO_CHILDREN 
  31813.          DosCwait finds no children. 
  31814.  
  31815.  129  ERROR_CHILD_NOT_COMPLETE 
  31816.          DosCwait children not terminated. 
  31817.  
  31818.  130  ERROR_DIRECT_ACCESS_HANDLE 
  31819.          Handle operation invalid for direct disk-access handles. 
  31820.  
  31821.  131  ERROR_NEGATIVE_SEEK 
  31822.          Attempting seek to negative offset. 
  31823.  
  31824.  132  ERROR_SEEK_ON_DEVICE 
  31825.          Application trying to seek on device or pipe. 
  31826.  
  31827.  133  ERROR_IS_JOIN_TARGET 
  31828.          Drive has previously joined drives. 
  31829.  
  31830.  134  ERROR_IS_JOINED 
  31831.          Drive is already joined. 
  31832.  
  31833.  135  ERROR_IS_SUBSTED 
  31834.          Drive is already substituted. 
  31835.  
  31836.  136  ERROR_NOT_JOINED 
  31837.          Cannot delete drive that is not joined. 
  31838.  
  31839.  137  ERROR_NOT_SUBSTED 
  31840.          Cannot delete drive that is not substituted. 
  31841.  
  31842.  138  ERROR_JOIN_TO_JOIN 
  31843.          Cannot join to a joined drive. 
  31844.  
  31845.  139  ERROR_SUBST_TO_SUBST 
  31846.          Cannot substitute to a substituted drive. 
  31847.  
  31848.  140  ERROR_JOIN_TO_SUBST 
  31849.          Cannot join to a substituted drive. 
  31850.  
  31851.  141  ERROR_SUBST_TO_JOIN 
  31852.          Cannot substitute to a joined drive. 
  31853.  
  31854.  142  ERROR_BUSY_DRIVE 
  31855.          Specified drive is busy. 
  31856.  
  31857.  143  ERROR_SAME_DRIVE 
  31858.          Cannot join or substitute a drive to a directory on the same drive. 
  31859.  
  31860.  144  ERROR_DIR_NOT_ROOT 
  31861.          Directory must be a subdirectory of the root. 
  31862.  
  31863.  145  ERROR_DIR_NOT_EMPTY 
  31864.          Directory must be empty to use join command. 
  31865.  
  31866.  146  ERROR_IS_SUBST_PATH 
  31867.          Path specified is being used in a substitute. 
  31868.  
  31869.  147  ERROR_IS_JOIN_PATH 
  31870.          Path specified is being used in join. 
  31871.  
  31872.  148  ERROR_PATH_BUSY 
  31873.          Path specified is being used by another process. 
  31874.  
  31875.  149  ERROR_IS_SUBST_TARGET 
  31876.          Cannot join or substitute drive having directory that is target of a 
  31877.          previous substitute. 
  31878.  
  31879.  150  ERROR_SYSTEM_TRACE 
  31880.          System trace error. 
  31881.  
  31882.  151  ERROR_INVALID_EVENT_COUNT 
  31883.          DosMuxSemWait errors. 
  31884.  
  31885.  152  ERROR_TOO_MANY_MUXWAITERS 
  31886.          System limit of 100 entries reached. 
  31887.  
  31888.  153  ERROR_INVALID_LIST_FORMAT 
  31889.          Invalid list format. 
  31890.  
  31891.  154  ERROR_LABEL_TOO_LONG 
  31892.          Volume label too big. 
  31893.  
  31894.  155  ERROR_TOO_MANY_TCBS 
  31895.          Cannot create another TCB. 
  31896.  
  31897.  156  ERROR_SIGNAL_REFUSED 
  31898.          Signal refused. 
  31899.  
  31900.  157  ERROR_DISCARDED 
  31901.          Segment is discarded. 
  31902.  
  31903.  158  ERROR_NOT_LOCKED 
  31904.          Segment not locked. 
  31905.  
  31906.  159  ERROR_BAD_THREADID_ADDR 
  31907.          Bad thread-identity address. 
  31908.  
  31909.  160  ERROR_BAD_ARGUMENTS 
  31910.          Bad environment pointer. 
  31911.  
  31912.  161  ERROR_BAD_PATHNAME 
  31913.          Bad path name passed to exec. 
  31914.  
  31915.  162  ERROR_SIGNAL_PENDING 
  31916.          Signal already pending. 
  31917.  
  31918.  163  ERROR_UNCERTAIN_MEDIA 
  31919.          ERROR_I24 mapping. 
  31920.  
  31921.  164  ERROR_MAX_THRDS_REACHED 
  31922.          No more process slots. 
  31923.  
  31924.  165  ERROR_MONITORS_NOT_SUPPORTED 
  31925.          ERROR_I24 mapping. 
  31926.  
  31927.  166  ERROR_UNC_DRIVER_NOT_INSTALLED 
  31928.          Default redir return code 
  31929.  
  31930.  167  ERROR_LOCK_FAILED 
  31931.          Locking failed. 
  31932.  
  31933.  168  ERROR_SWAPIO_FAILED 
  31934.          Swap IO failed. 
  31935.  
  31936.  169  ERROR_SWAPIN_FAILED 
  31937.          Swap in failed. 
  31938.  
  31939.  170  ERROR_BUSY 
  31940.          Busy. 
  31941.  
  31942.  180  ERROR_INVALID_SEGMENT_NUMBER 
  31943.          Invalid segment number. 
  31944.  
  31945.  181  ERROR_INVALID_CALLGATE 
  31946.          Invalid call gate. 
  31947.  
  31948.  182  ERROR_INVALID_ORDINAL 
  31949.          Invalid ordinal. 
  31950.  
  31951.  183  ERROR_ALREADY_EXISTS 
  31952.          Shared segment already exists. 
  31953.  
  31954.  184  ERROR_NO_CHILD_PROCESS 
  31955.          No child process to wait for. 
  31956.  
  31957.  185  ERROR_CHILD_ALIVE_NOWAIT 
  31958.          NoWait specified and child alive. 
  31959.  
  31960.  186  ERROR_INVALID_FLAG_NUMBER 
  31961.          Invalid flag number. 
  31962.  
  31963.  187  ERROR_SEM_NOT_FOUND 
  31964.          Semaphore does not exist. 
  31965.  
  31966.  188  ERROR_INVALID_STARTING_CODESEG 
  31967.          Invalid starting code segment, incorrect END (label) directive. 
  31968.  
  31969.  189  ERROR_INVALID_STACKSEG 
  31970.          Invalid stack segment. 
  31971.  
  31972.  190  ERROR_INVALID_MODULETYPE 
  31973.          Invalid module type - dynamic-link library file cannot be used as an 
  31974.          application.  Application cannot be used as a dynamic-link library. 
  31975.  
  31976.  191  ERROR_INVALID_EXE_SIGNATURE 
  31977.          Invalid EXE signature - file is DOS mode program or improper program. 
  31978.  
  31979.  192  ERROR_EXE_MARKED_INVALID 
  31980.          EXE marked invalid - link detected errors when application created. 
  31981.  
  31982.  193  ERROR_BAD_EXE_FORMAT 
  31983.          Bad EXE format - file is DOS mode program or improper program. 
  31984.  
  31985.  194  ERROR_ITERATED_DATA_EXCEEDS_64K 
  31986.          Iterated data exceeds 64KB - more than 64KB of data in one of the 
  31987.          segments of the file. 
  31988.  
  31989.  195  ERROR_INVALID_MINALLOCSIZE 
  31990.          Invalid minimum allocation size - size is specified to be less than 
  31991.          the size of the segment data in the file. 
  31992.  
  31993.  196  ERROR_DYNLINK_FROM_INVALID_RING 
  31994.          Dynamic link from invalid privilege level - privilege level 2 routine 
  31995.          cannot link to dynamic-link libraries. 
  31996.  
  31997.  197  ERROR_IOPL_NOT_ENABLED 
  31998.          IOPL not enabled - IOPL set to "NO" in CONFIG.SYS. 
  31999.  
  32000.  198  ERROR_INVALID_SEGDPL 
  32001.          Invalid segment descriptor privilege level - can only have privilege 
  32002.          levels of 2 and 3. 
  32003.  
  32004.  199  ERROR_AUTODATASEG_EXCEEDS_64k 
  32005.          Automatic data segment exceeds 64KB. 
  32006.  
  32007.  200  ERROR_RING2SEG_MUST_BE_MOVABLE 
  32008.          Privilege level 2 segment must be movable. 
  32009.  
  32010.  201  ERROR_RELOC_CHAIN_XEEDS_SEGLIM 
  32011.          Relocation chain exceeds segment limit. 
  32012.  
  32013.  202  ERROR_INFLOOP_IN_RELOC_CHAIN 
  32014.          Infinite loop in relocation chain segment. 
  32015.  
  32016.  203  ERROR_ENVVAR_NOT_FOUND 
  32017.          Environment variable not found. 
  32018.  
  32019.  204  ERROR_NOT_CURRENT_CTRY 
  32020.          Not current country. 
  32021.  
  32022.  205  ERROR_NO_SIGNAL_SENT 
  32023.          No signal sent - no process in the command subtree has a signal 
  32024.          handler. 
  32025.  
  32026.  206  ERROR_FILENAME_EXCED_RANGE 
  32027.          File name or extension greater than "8.3" characters. 
  32028.  
  32029.  207  ERROR_RING2_STACK_IN_USE 
  32030.          Privilege level 2 stack in use. 
  32031.  
  32032.  208  ERROR_META_EXPANSION_TOO_LONG 
  32033.          Meta (global) expansion is too long. 
  32034.  
  32035.  209  ERROR_INVALID_SIGNAL_NUMBER 
  32036.          Invalid signal number. 
  32037.  
  32038.  210  ERROR_THREAD_1_INACTIVE 
  32039.          Inactive thread. 
  32040.  
  32041.  211  ERROR_INFO_NOT_AVAIL 
  32042.          File system information not available for this file. 
  32043.  
  32044.  212  ERROR_LOCKED 
  32045.          Locked error. 
  32046.  
  32047.  213  ERROR_BAD_DYNALINK 
  32048.          Attempted to execute non-family API in DOS mode. 
  32049.  
  32050.  214  ERROR_TOO_MANY_MODULES 
  32051.          Too many modules. 
  32052.  
  32053.  215  ERROR_NESTING_NOT_ALLOWED 
  32054.          Nesting not allowed. 
  32055.  
  32056.  217  ERROR_ZOMBIE_PROCESS 
  32057.          Zombie process. 
  32058.  
  32059.  218  ERROR_STACK_IN_HIGH_MEMORY 
  32060.          Stack in high memory. 
  32061.  
  32062.  219  ERROR_INVALID_EXITROUTINE_RING 
  32063.          Invalid exit routine ring. 
  32064.  
  32065.  220  ERROR_GETBUF_FAILED 
  32066.          Get buffer failed. 
  32067.  
  32068.  221  ERROR_FLUSHBUF_FAILED 
  32069.          Flush buffer failed. 
  32070.  
  32071.  222  ERROR_TRANSFER_TOO_LONG 
  32072.          Transfer is too long. 
  32073.  
  32074.  228  ERROR_NO_CHILDREN 
  32075.          No child process. 
  32076.  
  32077.  229  ERROR_INVALID_SCREEN_GROUP 
  32078.          Invalid session. 
  32079.  
  32080.  230  ERROR_BAD_PIPE 
  32081.          Non-existent pipe or bad operation. 
  32082.  
  32083.  231  ERROR_PIPE_BUSY 
  32084.          Pipe is busy. 
  32085.  
  32086.  232  ERROR_NO_DATA 
  32087.          No data available on non-blocking read. 
  32088.  
  32089.  233  ERROR_PIPE_NOT_CONNECTED 
  32090.          Pipe was disconnected by server. 
  32091.  
  32092.  234  ERROR_MORE_DATA 
  32093.          More data is available. 
  32094.  
  32095.  240  ERROR_VC_DISCONNECTED 
  32096.          Session was dropped due to errors. 
  32097.  
  32098.  250  ERROR_CIRCULARITY_REQUESTED 
  32099.          Renaming a directory that would cause a circularity problem. 
  32100.  
  32101.  251  ERROR_DIRECTORY_IN_CDS 
  32102.          Renaming a directory that is in use. 
  32103.  
  32104.  252  ERROR_INVALID_FSD_NAME 
  32105.          Trying to access nonexistent FSD. 
  32106.  
  32107.  253  ERROR_INVALID_PATH 
  32108.          Bad pseudo device. 
  32109.  
  32110.  254  ERROR_INVALID_EA_NAME 
  32111.          Bad character in name, or bad cbName. 
  32112.  
  32113.  255  ERROR_EA_LIST_INCONSISTENT 
  32114.          List does not match its size, or bad EAs in list. 
  32115.  
  32116.  256  ERROR_EA_LIST_TOO_LONG 
  32117.          FEAList > 64K-1 bytes. 
  32118.  
  32119.  257  ERROR_NO_META_MATCH 
  32120.          String doesn't match expression. 
  32121.  
  32122.  259  ERROR_NO_MORE_ITEMS 
  32123.          DosQFSAttach ordinal query. 
  32124.  
  32125.  260  ERROR_SEARCH_STRUC_REUSED 
  32126.          DOS mode findfirst/next search structure reused. 
  32127.  
  32128.  261  ERROR_CHAR_NOT_FOUND 
  32129.          Character not found. 
  32130.  
  32131.  262  ERROR_TOO_MUCH_STACK 
  32132.          Stack request exceeds system limit. 
  32133.  
  32134.  263  ERROR_INVALID_ATTR 
  32135.          Invalid attribute. 
  32136.  
  32137.  264  ERROR_INVALID_STARTING_RING 
  32138.          Invalid starting ring. 
  32139.  
  32140.  265  ERROR_INVALID_DLL_INIT_RING 
  32141.          Invalid DLL INIT ring. 
  32142.  
  32143.  266  ERROR_CANNOT_COPY 
  32144.          Cannot copy. 
  32145.  
  32146.  267  ERROR_DIRECTORY 
  32147.          Used by DOSCOPY in doscall1. 
  32148.  
  32149.  268  ERROR_OPLOCKED_FILE 
  32150.          Oplocked file. 
  32151.  
  32152.  269  ERROR_OPLOCK_THREAD_EXISTS 
  32153.          Oplock thread exists. 
  32154.  
  32155.  270  ERROR_VOLUME_CHANGED 
  32156.          Volume changed. 
  32157.  
  32158.  271-273 
  32159.          Reserved. 
  32160.  
  32161.  274  ERROR_ALREADY_SHUTDOWN 
  32162.          System already shutdown. 
  32163.  
  32164.  275  ERROR_EAS_DIDNT_FIT 
  32165.          EAS didnt fit. 
  32166.  
  32167.  303  ERROR_INVALID_PROCID 
  32168.          Invalid process identity. 
  32169.  
  32170.  304  ERROR_INVALID_PDELTA 
  32171.          Invalid priority delta. 
  32172.  
  32173.  305  ERROR_NOT_DESCENDANT 
  32174.          Not descendant. 
  32175.  
  32176.  306  ERROR_NOT_SESSION_MANAGER 
  32177.          Requestor not session manager. 
  32178.  
  32179.  307  ERROR_INVALID_PCLASS 
  32180.          Invalid P class. 
  32181.  
  32182.  308  ERROR_INVALID_SCOPE 
  32183.          Invalid scope. 
  32184.  
  32185.  309  ERROR_INVALID_THREADID 
  32186.          Invalid thread identity. 
  32187.  
  32188.  310  ERROR_DOSSUB_SHRINK 
  32189.          Cannot shrink segment - DosSubSet. 
  32190.  
  32191.  311  ERROR_DOSSUB_NOMEM 
  32192.          No memory to satisfy request - DosSubAlloc . 
  32193.  
  32194.  312  ERROR_DOSSUB_OVERLAP 
  32195.          Overlap of specified block with an allocated memory - DosSubFree. 
  32196.  
  32197.  313  ERROR_DOSSUB_BADSIZE 
  32198.          Bad size parameter - DosSubAlloc or DosSubFree. 
  32199.  
  32200.  314  ERROR_DOSSUB_BADFLAG 
  32201.          Bad flag parameter - DosSubSet. 
  32202.  
  32203.  315  ERROR_DOSSUB_BADSELECTOR 
  32204.          Invalid segment selector. 
  32205.  
  32206.  316  ERROR_MR_MSG_TOO_LONG 
  32207.          Message too long for buffer. 
  32208.  
  32209.  317  ERROR_MR_MID_NOT_FOUND 
  32210.          Message identity number not found. 
  32211.  
  32212.  318  ERROR_MR_UN_ACC_MSGF 
  32213.          Unable to access message file. 
  32214.  
  32215.  319  ERROR_MR_INV_MSGF_FORMAT 
  32216.          Invalid message file format. 
  32217.  
  32218.  320  ERROR_MR_INV_IVCOUNT 
  32219.          Invalid insertion variable count. 
  32220.  
  32221.  321  ERROR_MR_UN_PERFORM 
  32222.          Unable to perform function. 
  32223.  
  32224.  322  ERROR_TS_WAKEUP 
  32225.          Unable to wake up. 
  32226.  
  32227.  323  ERROR_TS_SEMHANDLE 
  32228.          Invalid system semaphore. 
  32229.  
  32230.  324  ERROR_TS_NOTIMER 
  32231.          No timers available. 
  32232.  
  32233.  326  ERROR_TS_HANDLE 
  32234.          Invalid timer handle. 
  32235.  
  32236.  327  ERROR_TS_DATETIME 
  32237.          Date or time invalid. 
  32238.  
  32239.  328  ERROR_SYS_INTERNAL 
  32240.          Internal system error. 
  32241.  
  32242.  329  ERROR_QUE_CURRENT_NAME 
  32243.          Current queue name does not exist. 
  32244.  
  32245.  330  ERROR_QUE_PROC_NOT_OWNED 
  32246.          Current process does not own queue. 
  32247.  
  32248.  331  ERROR_QUE_PROC_OWNED 
  32249.          Current process owns queue. 
  32250.  
  32251.  332  ERROR_QUE_DUPLICATE 
  32252.          Duplicate queue name. 
  32253.  
  32254.  333  ERROR_QUE_ELEMENT_NOT_EXIST 
  32255.          Queue element does not exist. 
  32256.  
  32257.  334  ERROR_QUE_NO_MEMORY 
  32258.          Inadequate queue memory. 
  32259.  
  32260.  335  ERROR_QUE_INVALID_NAME 
  32261.          Invalid queue name. 
  32262.  
  32263.  336  ERROR_QUE_INVALID_PRIORITY 
  32264.          Invalid queue priority parameter. 
  32265.  
  32266.  337  ERROR_QUE_INVALID_HANDLE 
  32267.          Invalid queue handle. 
  32268.  
  32269.  338  ERROR_QUE_LINK_NOT_FOUND 
  32270.          Queue link not found. 
  32271.  
  32272.  339  ERROR_QUE_MEMORY_ERROR 
  32273.          Queue memory error. 
  32274.  
  32275.  340  ERROR_QUE_PREV_AT_END 
  32276.          Previous queue element was at end of queue. 
  32277.  
  32278.  341  ERROR_QUE_PROC_NO_ACCESS 
  32279.          Process does not have access to queues. 
  32280.  
  32281.  342  ERROR_QUE_EMPTY 
  32282.          Queue is empty. 
  32283.  
  32284.  343  ERROR_QUE_NAME_NOT_EXIST 
  32285.          Queue name does not exist. 
  32286.  
  32287.  344  ERROR_QUE_NOT_INITIALIZED 
  32288.          Queues not initialized. 
  32289.  
  32290.  345  ERROR_QUE_UNABLE_TO_ACCESS 
  32291.          Unable to access queues. 
  32292.  
  32293.  346  ERROR_QUE_UNABLE_TO_ADD 
  32294.          Unable to add new queue. 
  32295.  
  32296.  347  ERROR_QUE_UNABLE_TO_INIT 
  32297.          Unable to initialize queues. 
  32298.  
  32299.  349  ERROR_VIO_INVALID_MASK 
  32300.          Invalid function replaced. 
  32301.  
  32302.  350  ERROR_VIO_PTR 
  32303.          Invalid pointer to parameter. 
  32304.  
  32305.  351  ERROR_VIO_APTR 
  32306.          Invalid pointer to attribute. 
  32307.  
  32308.  352  ERROR_VIO_RPTR 
  32309.          Invalid pointer to row. 
  32310.  
  32311.  353  ERROR_VIO_CPTR 
  32312.          Invalid pointer to column. 
  32313.  
  32314.  354  ERROR_VIO_LPTR 
  32315.          Invalid pointer to length. 
  32316.  
  32317.  355  ERROR_VIO_MODE 
  32318.          Unsupported screen mode. 
  32319.  
  32320.  356  ERROR_VIO_WIDTH 
  32321.          Invalid cursor width value. 
  32322.  
  32323.  357  ERROR_VIO_ATTR 
  32324.          Invalid cursor attribute value. 
  32325.  
  32326.  358  ERROR_VIO_ROW 
  32327.          Invalid row value. 
  32328.  
  32329.  359  ERROR_VIO_COL 
  32330.          Invalid column value. 
  32331.  
  32332.  360  ERROR_VIO_TOPROW 
  32333.          Invalid TopRow value. 
  32334.  
  32335.  361  ERROR_VIO_BOTROW 
  32336.          Invalid BotRow value. 
  32337.  
  32338.  362  ERROR_VIO_RIGHTCOL 
  32339.          Invalid right column value. 
  32340.  
  32341.  363  ERROR_VIO_LEFTCOL 
  32342.          Invalid left column value. 
  32343.  
  32344.  364  ERROR_SCS_CALL 
  32345.          Call issued by other than sm 
  32346.  
  32347.  365  ERROR_SCS_VALUE 
  32348.          Value is not for save or restore. 
  32349.  
  32350.  366  ERROR_VIO_WAIT_FLAG 
  32351.          Invalid wait flag setting. 
  32352.  
  32353.  367  ERROR_VIO_UNLOCK 
  32354.          Screen not previously locked. 
  32355.  
  32356.  368      ERROR_SGS_NOT_SESSION_MGR
  32357.          Caller not session manager. 
  32358.  
  32359.  369  ERROR_SMG_INVALID_SGID 
  32360.          Invalid session identity. 
  32361.  
  32362.  369  ERROR_SMG_INVALID_SESSION_ID 
  32363.          Invalid session ID. 
  32364.  
  32365.  370  ERROR_SMG_NOSG 
  32366.          No sessions available. 
  32367.  
  32368.  370  ERROR_SMG_NO_SESSIONS 
  32369.          No sessions available. 
  32370.  
  32371.  371  ERROR_SMG_GRP_NOT_FOUND 
  32372.          Session not found. 
  32373.  
  32374.  371  ERROR_SMG_SESSION_NOT_FOUND 
  32375.          Session not found. 
  32376.  
  32377.  372  ERROR_SMG_SET_TITLE 
  32378.          Title sent by shell or parent cannot be changed. 
  32379.  
  32380.  373  ERROR_KBD_PARAMETER 
  32381.          Invalid parameter to keyboard. 
  32382.  
  32383.  374  ERROR_KBD_NO_DEVICE 
  32384.          No device. 
  32385.  
  32386.  375  ERROR_KBD_INVALID_IOWAIT 
  32387.          Invalid I/O wait specified. 
  32388.  
  32389.  376  ERROR_KBD_INVALID_LENGTH 
  32390.          Invalid length for keyboard. 
  32391.  
  32392.  377  ERROR_KBD_INVALID_ECHO_MASK 
  32393.          Invalid echo mode mask. 
  32394.  
  32395.  378  ERROR_KBD_INVALID_INPUT_MASK 
  32396.          Invalid input mode mask. 
  32397.  
  32398.  379  ERROR_MON_INVALID_PARMS 
  32399.          Invalid parameters to DosMon. 
  32400.  
  32401.  380  ERROR_MON_INVALID_DEVNAME 
  32402.          Invalid device name string. 
  32403.  
  32404.  381  ERROR_MON_INVALID_HANDLE 
  32405.          Invalid device handle. 
  32406.  
  32407.  382  ERROR_MON_BUFFER_TOO_SMALL 
  32408.          Buffer too small. 
  32409.  
  32410.  383  ERROR_MON_BUFFER_EMPTY 
  32411.          Buffer is empty. 
  32412.  
  32413.  384  ERROR_MON_DATA_TOO_LARGE 
  32414.          Data record too large. 
  32415.  
  32416.  385  ERROR_MOUSE_NO_DEVICE 
  32417.          Mouse device closed (invalid device handle). 
  32418.  
  32419.  386  ERROR_MOUSE_INV_HANDLE 
  32420.          Mouse device closed (invalid device handle). 
  32421.  
  32422.  387  ERROR_MOUSE_INV_PARMS 
  32423.          Parameters invalid for display mode. 
  32424.  
  32425.  388  ERROR_MOUSE_CANT_RESET 
  32426.          Function assigned and cannot be reset. 
  32427.  
  32428.  389  ERROR_MOUSE_DISPLAY_PARMS 
  32429.          Parameters invalid for display mode. 
  32430.  
  32431.  390  ERROR_MOUSE_INV_MODULE 
  32432.          Module not valid. 
  32433.  
  32434.  391  ERROR_MOUSE_INV_ENTRY_PT 
  32435.          Entry point not valid. 
  32436.  
  32437.  392  ERROR_MOUSE_INV_MASK 
  32438.          Function mask invalid. 
  32439.  
  32440.  393  NO_ERROR_MOUSE_NO_DATA 
  32441.          No valid data. 
  32442.  
  32443.  394  NO_ERROR_MOUSE_PTR_DRAWN 
  32444.          Pointer drawn. 
  32445.  
  32446.  395  ERROR_INVALID_FREQUENCY 
  32447.          Invalid frequency for beep. 
  32448.  
  32449.  396  ERROR_NLS_NO_COUNTRY_FILE 
  32450.          Cannot find COUNTRY.SYS file. 
  32451.  
  32452.  397  ERROR_NLS_OPEN_FAILED 
  32453.          Cannot open COUNTRY.SYS file. 
  32454.  
  32455.  398  ERROR_NLS_NO_CTRY_CODE 
  32456.          Country code not found. 
  32457.  
  32458.  398  ERROR_NO_COUNTRY_OR_CODEPAGE 
  32459.          Country code not found. 
  32460.  
  32461.  399  ERROR_NLS_TABLE_TRUNCATED 
  32462.          Table returned information truncated, buffer too small. 
  32463.  
  32464.  400  ERROR_NLS_BAD_TYPE 
  32465.          Selected type does not exist. 
  32466.  
  32467.  401  ERROR_NLS_TYPE_NOT_FOUND 
  32468.          Selected type not in file. 
  32469.  
  32470.  402  ERROR_VIO_SMG_ONLY 
  32471.          Valid from session manager only. 
  32472.  
  32473.  403  ERROR_VIO_INVALID_ASCIIZ 
  32474.          Invalid ASCIIZ length. 
  32475.  
  32476.  404  ERROR_VIO_DEREGISTER 
  32477.          VioDeRegister not allowed. 
  32478.  
  32479.  405  ERROR_VIO_NO_POPUP 
  32480.          Pop-up window not allocated. 
  32481.  
  32482.  406  ERROR_VIO_EXISTING_POPUP 
  32483.          Pop-up window on screen (NoWait). 
  32484.  
  32485.  407  ERROR_KBD_SMG_ONLY 
  32486.          Valid from session manager only. 
  32487.  
  32488.  408  ERROR_KBD_INVALID_ASCIIZ 
  32489.          Invalid ASCIIZ length. 
  32490.  
  32491.  409  ERROR_KBD_INVALID_MASK 
  32492.          Invalid replacement mask. 
  32493.  
  32494.  410  ERROR_KBD_REGISTER 
  32495.          KbdRegister not allowed. 
  32496.  
  32497.  411  ERROR_KBD_DEREGISTER 
  32498.          KbdDeRegister not allowed. 
  32499.  
  32500.  412  ERROR_MOUSE_SMG_ONLY 
  32501.          Valid from session manager only. 
  32502.  
  32503.  413  ERROR_MOUSE_INVALID_ASCIIZ 
  32504.          Invalid ASCIIZ length. 
  32505.  
  32506.  414  ERROR_MOUSE_INVALID_MASK 
  32507.          Invalid replacement mask. 
  32508.  
  32509.  415  ERROR_MOUSE_REGISTER 
  32510.          Mouse register not allowed. 
  32511.  
  32512.  416  ERROR_MOUSE_DEREGISTER 
  32513.          Mouse deregister not allowed. 
  32514.  
  32515.  417  ERROR_SMG_BAD_ACTION 
  32516.          Invalid action specified. 
  32517.  
  32518.  418  ERROR_SMG_INVALID_CALL 
  32519.          INIT called more than once or invalid session identity. 
  32520.  
  32521.  419  ERROR_SCS_SG_NOTFOUND 
  32522.          New session number. 
  32523.  
  32524.  420  ERROR_SCS_NOT_SHELL 
  32525.          Caller is not shell. 
  32526.  
  32527.  421  ERROR_VIO_INVALID_PARMS 
  32528.          Invalid parameters passed. 
  32529.  
  32530.  422  ERROR_VIO_FUNCTION_OWNED 
  32531.          Save/restore already owned. 
  32532.  
  32533.  423  ERROR_VIO_RETURN 
  32534.          Non-destruct return (undo). 
  32535.  
  32536.  424  ERROR_SCS_INVALID_FUNCTION 
  32537.          Caller invalid function. 
  32538.  
  32539.  425  ERROR_SCS_NOT_SESSION_MGR 
  32540.          Caller not session manager. 
  32541.  
  32542.  426  ERROR_VIO_REGISTER 
  32543.          Vio register not allowed. 
  32544.  
  32545.  427  ERROR_VIO_NO_MODE_THREAD 
  32546.          No mode restore thread in SG. 
  32547.  
  32548.  428  ERROR_VIO_NO_SAVE_RESTORE_THD 
  32549.          No save/rest thread in SG. 
  32550.  
  32551.  429  ERROR_VIO_IN_BG 
  32552.          Function invalid in background. 
  32553.  
  32554.  430  ERROR_VIO_ILLEGAL_DURING_POPUP 
  32555.          Function not allowed during pop-up window. 
  32556.  
  32557.  431  ERROR_SMG_NOT_BASESHELL 
  32558.          Caller is not the base shell. 
  32559.  
  32560.  432  ERROR_SMG_BAD_STATUSREQ 
  32561.          Invalid status requested. 
  32562.  
  32563.  433  ERROR_QUE_INVALID_WAIT 
  32564.          NoWait parameter out of bounds. 
  32565.  
  32566.  434  ERROR_VIO_LOCK 
  32567.          Error returned from Scroll Lock. 
  32568.  
  32569.  435  ERROR_MOUSE_INVALID_IOWAIT 
  32570.          Invalid parameters for IOWait. 
  32571.  
  32572.  436  ERROR_VIO_INVALID_HANDLE 
  32573.          Invalid VIO handle. 
  32574.  
  32575.  437  ERROR_VIO_ILLEGAL_DURING_LOCK 
  32576.          Function not allowed during screen lock. 
  32577.  
  32578.  438  ERROR_VIO_INVALID_LENGTH 
  32579.          Invalid VIO length. 
  32580.  
  32581.  439  ERROR_KBD_INVALID_HANDLE 
  32582.          Invalid KBD handle. 
  32583.  
  32584.  440  ERROR_KBD_NO_MORE_HANDLE 
  32585.          Ran out of handles. 
  32586.  
  32587.  441  ERROR_KBD_CANNOT_CREATE_KCB 
  32588.          Unable to create kcb. 
  32589.  
  32590.  442  ERROR_KBD_CODEPAGE_LOAD_INCOMPL 
  32591.          Unsuccessful code-page load. 
  32592.  
  32593.  443  ERROR_KBD_INVALID_CODEPAGE_ID 
  32594.          Invalid code-page identity. 
  32595.  
  32596.  444  ERROR_KBD_NO_CODEPAGE_SUPPORT 
  32597.          No code page support. 
  32598.  
  32599.  445  ERROR_KBD_FOCUS_REQUIRED 
  32600.          Keyboard focus required. 
  32601.  
  32602.  446  ERROR_KBD_FOCUS_ALREADY_ACTIVE 
  32603.          Calling thread has an outstanding focus. 
  32604.  
  32605.  447  ERROR_KBD_KEYBOARD_BUSY 
  32606.          Keyboard busy. 
  32607.  
  32608.  448  ERROR_KBD_INVALID_CODEPAGE 
  32609.          Invalid code page. 
  32610.  
  32611.  449  ERROR_KBD_UNABLE_TO_FOCUS 
  32612.          Focus attempt failed. 
  32613.  
  32614.  450  ERROR_SMG_SESSION_NON_SELECT 
  32615.          Session is not selectable. 
  32616.  
  32617.  451  ERROR_SMG_SESSION_NOT_FOREGRND 
  32618.          Parent/child session not foreground. 
  32619.  
  32620.  452  ERROR_SMG_SESSION_NOT_PARENT 
  32621.          Not parent of requested child. 
  32622.  
  32623.  453  ERROR_SMG_INVALID_START_MODE 
  32624.          Invalid session start mode. 
  32625.  
  32626.  454  ERROR_SMG_INVALID_RELATED_OPT 
  32627.          Invalid session start related option. 
  32628.  
  32629.  455  ERROR_SMG_INVALID_BOND_OPTION 
  32630.          Invalid session bond option. 
  32631.  
  32632.  456  ERROR_SMG_INVALID_SELECT_OPT 
  32633.          Invalid session select option. 
  32634.  
  32635.  457  ERROR_SMG_START_IN_BACKGROUND 
  32636.          Session started in background. 
  32637.  
  32638.  458  ERROR_SMG_INVALID_STOP_OPTION 
  32639.          Invalid session stop option. 
  32640.  
  32641.  459  ERROR_SMG_BAD_RESERVE 
  32642.          Reserved parameters not zero. 
  32643.  
  32644.  460  ERROR_SMG_PROCESS_NOT_PARENT 
  32645.          Session parent process already exists. 
  32646.  
  32647.  461  ERROR_SMG_INVALID_DATA_LENGTH 
  32648.          Invalid data length. 
  32649.  
  32650.  462  ERROR_SMG_NOT_BOUND 
  32651.          Parent not bound. 
  32652.  
  32653.  463  ERROR_SMG_RETRY_SUB_ALLOC 
  32654.          Retry request block allocation. 
  32655.  
  32656.  464  ERROR_KBD_DETACHED 
  32657.          This call not allowed for detached PID. 
  32658.  
  32659.  465  ERROR_VIO_DETACHED 
  32660.          This call disallowed for detached pid. 
  32661.  
  32662.  466  ERROR_MOU_DETACHED 
  32663.          This call disallowed for detached pid. 
  32664.  
  32665.  467  ERROR_VIO_FONT 
  32666.          No font available to support mode. 
  32667.  
  32668.  468  ERROR_VIO_USER_FONT 
  32669.          User font active. 
  32670.  
  32671.  469  ERROR_VIO_BAD_CP 
  32672.          Invalid code page specified. 
  32673.  
  32674.  470  ERROR_VIO_NO_CP 
  32675.          System displays do not support code page. 
  32676.  
  32677.  471  ERROR_VIO_NA_CP 
  32678.          Current display does not support code page. 
  32679.  
  32680.  472  ERROR_INVALID_CODE_PAGE 
  32681.          Invalid code page. 
  32682.  
  32683.  473  ERROR_CPLIST_TOO_SMALL 
  32684.          Code page list is too small. 
  32685.  
  32686.  474  ERROR_CP_NOT_MOVED 
  32687.          Code page not moved. 
  32688.  
  32689.  475  ERROR_MODE_SWITCH_INIT 
  32690.          Mode switch initialization error. 
  32691.  
  32692.  476  ERROR_CODE_PAGE_NOT_FOUND 
  32693.          Code page not found. 
  32694.  
  32695.  477  ERROR_UNEXPECTED_SLOT_RETURNED 
  32696.          Internal error. 
  32697.  
  32698.  478  ERROR_SMG_INVALID_TRACE_OPTION 
  32699.          Invalid start session trace indicator. 
  32700.  
  32701.  479  ERROR_VIO_INTERNAL_RESOURCE 
  32702.          VIO internal resource error. 
  32703.  
  32704.  480  ERROR_VIO_SHELL_INIT 
  32705.          VIO shell initialization error. 
  32706.  
  32707.  481  ERROR_SMG_NO_HARD_ERRORS 
  32708.          No session manager hard errors. 
  32709.  
  32710.  482  ERROR_CP_SWITCH_INCOMPLETE 
  32711.          DosSetCp unable to set KBD or VIO code page. 
  32712.  
  32713.  483  ERROR_VIO_TRANSPARENT_POPUP 
  32714.          Error during VIO pop-up window. 
  32715.  
  32716.  484  ERROR_CRITSEC_OVERFLOW 
  32717.          Critical section overflow. 
  32718.  
  32719.  485  ERROR_CRITSEC_UNDERFLOW 
  32720.          Critical section underflow. 
  32721.  
  32722.  486  ERROR_VIO_BAD_RESERVE 
  32723.          Reserved parameter is not zero. 
  32724.  
  32725.  487  ERROR_INVALID_ADDRESS 
  32726.          Bad physical address. 
  32727.  
  32728.  488  ERROR_ZERO_SELECTORS_REQUESTED 
  32729.          At least one selector must be requested. 
  32730.  
  32731.  489  ERROR_NOT_ENOUGH_SELECTORS_AVA 
  32732.          Not enough GDT selectors to satisfy request. 
  32733.  
  32734.  490  ERROR_INVALID_SELECTOR 
  32735.          Not a GDT selector. 
  32736.  
  32737.  491  ERROR_SMG_INVALID_PROGRAM_TYPE 
  32738.          Invalid program type. 
  32739.  
  32740.  492  ERROR_SMG_INVALID_PGM_CONTROL 
  32741.          Invalid program control. 
  32742.  
  32743.  493  ERROR_SMG_INVALID_INHERIT_OPT 
  32744.          Bad inherit option. 
  32745.  
  32746.  494  ERROR_VIO_EXTENDED_SG 
  32747.  
  32748.  495  ERROR_VIO_NOT_PRES_MGR_SG 
  32749.  
  32750.  496  ERROR_VIO_SHIELD_OWNED 
  32751.  
  32752.  497  ERROR_VIO_NO_MORE_HANDLES 
  32753.  
  32754.  498  ERROR_VIO_SEE_ERROR_LOG 
  32755.  
  32756.  499  ERROR_VIO_ASSOCIATED_DC 
  32757.  
  32758.  500  ERROR_KBD_NO_CONSOLE 
  32759.  
  32760.  501  ERROR_MOUSE_NO_CONSOLE 
  32761.  
  32762.  502  ERROR_MOUSE_INVALID_HANDLE 
  32763.  
  32764.  503  ERROR_SMG_INVALID_DEBUG_PARMS 
  32765.  
  32766.  504  ERROR_KBD_EXTENDED_SG 
  32767.  
  32768.  505  ERROR_MOU_EXTENDED_SG 
  32769.  
  32770.  506  ERROR_SMG_INVALID_ICON_FILE 
  32771.  
  32772.