home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ifsinf.zip / IFS.INF (.txt) < prev    next >
OS/2 Help File  |  1994-01-26  |  187KB  |  7,804 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Cover page ΓòÉΓòÉΓòÉ
  3.  
  4.  
  5. ΓòÉΓòÉΓòÉ <hidden> os2logo ΓòÉΓòÉΓòÉ
  6.  
  7.  
  8. ΓòÉΓòÉΓòÉ <hidden> titlep ΓòÉΓòÉΓòÉ
  9.  
  10.                             Installable File Systems
  11.  
  12.                               For OS/2 Version 2.0
  13.                           OS/2 File Systems Department
  14.  
  15.                             PSPC Boca Raton, Florida
  16.  
  17.  
  18.  
  19.                        Translated to IPF by Andre Asselin
  20.  
  21.                                    Version 0.1
  22.                                     July 1993
  23.  
  24.  
  25. ΓòÉΓòÉΓòÉ 2. Disclaimer ΓòÉΓòÉΓòÉ
  26.  
  27.  This document includes a written description of the Installable File System 
  28.  Driver Interface for IBM OS/2 Standard Edition Version 2.0. 
  29.  
  30.  INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS DOCUMENT "AS IS" 
  31.  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT 
  32.  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A 
  33.  PARTICULAR PURPOSE. 
  34.  
  35.  IN NO EVENT WILL IBM BE LIABLE FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO 
  36.  ANY LOST PROFITS, LOST SAVINGS OR ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES, 
  37.  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY YOU 
  38.  BASED ON A THIRD PARTY CLAIM. 
  39.  
  40.  Some or all of the interfaces described in this document are unpublished. IBM 
  41.  reserves the right to change or delete them in future versions of OS/2, at 
  42.  IBM's sole discretion, without notice to you. IBM does not guarantee that 
  43.  compatibility of your applications can or will be maintained with future 
  44.  versions of OS/2. 
  45.  
  46.  This document could include technical inaccuracies or typographical errors. It 
  47.  is possible that this document may contain reference to, or information about, 
  48.  IBM products, programming or services that are not announced in your country. 
  49.  Such references or information must not be construed to mean that IBM intends 
  50.  to announce such IBM products, programming or services in your country. IBM 
  51.  may have patents or pending patent applications covering subject matter in 
  52.  this document. The furnishing of this document does not give you any license 
  53.  to these patents. You can send license inquiries, in writing, to the IBM 
  54.  Director of Commercial Relations, IBM Corporation, Armonk NY 10504. 
  55.  
  56.  Copyright International Business Machines Corporation 1991. All rights 
  57.  reserved. Note to U.S. Government Users - Documentation related to restricted 
  58.  rights - Use, duplication or disclosure is subject to restrictions set forth 
  59.  in GSA ADP Schedule Contract with IBM Corp. 
  60.  
  61.  
  62. ΓòÉΓòÉΓòÉ 3. Changes ΓòÉΓòÉΓòÉ
  63.  
  64. This document is based on the February 17, 1992 version of the printed IFS 
  65. documentation. 
  66.  
  67. July, 1993 
  68.  
  69.  
  70. ΓòÉΓòÉΓòÉ 4. Installable File System Mechanism ΓòÉΓòÉΓòÉ
  71.  
  72. The OS/2 Installable File System (IFS) Mechanism supports the following: 
  73.  
  74.  o Coexistence of multiple, active file systems in a single PC 
  75.  o Multiple logical volumes (partitions) 
  76.  o Multiple and different storage devices 
  77.  o Redirection or connection to remote file systems 
  78.  o File system flexibility in managing its data and I/O for optimal performance 
  79.  o Transparency at both the user and application level 
  80.  o Standard set of File I/O API 
  81.  o Existing logical file and directory structure 
  82.  o Existing naming conventions 
  83.  o File system doing its own buffer management 
  84.  o File system doing file I/O without intermediate buffering 
  85.  o Extensions to the Standard File I/O API (FSCTL) 
  86.  o Extensions to the existing naming conventions 
  87.  o IOCTL type of communication between a file system and a device driver 
  88.  
  89.  
  90. ΓòÉΓòÉΓòÉ 4.1. Installable File System Overview ΓòÉΓòÉΓòÉ
  91.  
  92.  
  93. ΓòÉΓòÉΓòÉ 4.1.1. System Relationships ΓòÉΓòÉΓòÉ
  94.  
  95. Installable File System (IFS) Mechanism defines the relationships among the 
  96. operating system, the file systems, and the device drivers. The basic model of 
  97. the system is represented in Figure 1-1. 
  98.  
  99.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  100.   Γöé                                               Γöé
  101.   Γöé          File System Request Router           Γöé
  102.   Γöé                                               Γöé
  103.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ         Γöé
  104.                                         Γöé         Γöé
  105.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé         Γöé
  106.   Γöé  File  Γöé    Γöé  File  Γöé    Γöé  File  ΓöéΓöé         Γöé
  107.   Γöé System Γöé    Γöé System Γöé    Γöé System ΓöéΓöé         Γöé
  108.   Γöé        Γöé    Γöé        Γöé    Γöé        ΓöéΓöé         Γöé
  109.   Γöé LOCAL  Γöé    Γöé  NET   Γöé    Γöé  NET   ΓöéΓöé         Γöé
  110.   Γöé        Γöé    Γöé REDIR1 Γöé    Γöé REDIR2 ΓöéΓöé         Γöé
  111.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöé         Γöé
  112.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         Γöé
  113.   Γöé                                               Γöé
  114.   Γöé      FS Helper Routines/                      Γöé
  115.   Γöé      Device Driver Request Router             Γöé
  116.   Γöé                                               Γöé
  117.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ         Γöé
  118.                                         Γöé         Γöé
  119.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé         Γöé
  120.   Γöé        Γöé    Γöé        Γöé    Γöé        ΓöéΓöé         Γöé
  121.   Γöé Device Γöé    Γöé Device Γöé    Γöé Device ΓöéΓöé         Γöé
  122.   Γöé Driver Γöé    Γöé Driver Γöé    Γöé Driver ΓöéΓöé         Γöé
  123.   Γöé        Γöé    Γöé        Γöé    Γöé        ΓöéΓöé         Γöé
  124.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöé         Γöé
  125.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         Γöé
  126.   Γöé                                               Γöé
  127.   Γöé       Device Driver Helper Routines           Γöé
  128.   Γöé                                               Γöé
  129.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  130.  
  131. Figure 1-1. System relationships for Installable File Systems 
  132.  
  133. The file system request router directs file system function calls to the 
  134. appropriate file system for processing. 
  135.  
  136. The file systems manage file I/O and control the format of information on the 
  137. storage media. An installable file system (FS) will be referred to as a file 
  138. system driver (FSD). 
  139.  
  140. The FS Helper Routines provide a variety of services to the file systems. 
  141.  
  142. The device drivers manage physical I/O with devices. Device drivers do not 
  143. understand the format of information on the media. 
  144.  
  145.  
  146. ΓòÉΓòÉΓòÉ 4.1.2. File I/O API ΓòÉΓòÉΓòÉ
  147.  
  148. Standard file I/O is performed through the Standard File I/O API. The 
  149. application makes a function call and the file system request router passes the 
  150. request to the correct file system for processing. See Figure 1-2. 
  151.  
  152.                      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  153.                      Γöé application Γöé
  154.                      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  155.                             
  156.               ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Dynamic
  157.               Γöé Standard File I/O API   Γöé  Link
  158.               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Library
  159.                             
  160.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  161.   Γöé          File System Request Router          Γöé
  162.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        Γöé
  163.                                         Γöé        Γöé
  164.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé        Γöé
  165.   Γöé File   Γöé    Γöé  File  Γöé    Γöé  File  ΓöéΓöé        Γöé
  166.   Γöé System Γöé    Γöé System Γöé    Γöé System ΓöéΓöé        Γöé
  167.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöé        Γöé
  168.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        Γöé
  169.   Γöé                                              Γöé
  170.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        Γöé
  171.                                         Γöé        Γöé
  172.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé        Γöé
  173.   Γöé Device Γöé    Γöé Device Γöé    Γöé Device ΓöéΓöé        Γöé
  174.   Γöé Driver Γöé    Γöé Driver Γöé    Γöé Driver ΓöéΓöé        Γöé
  175.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöé        Γöé
  176.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        Γöé
  177.   Γöé                                              Γöé
  178.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  179.  
  180. Figure 1-2. Standard File I/O 
  181.  
  182. New API may be provided by a file system to implement functions specific to the 
  183. file system or not supplied through the standard file I/O interface. New API 
  184. are provided in a dynamic link library that uses the DosFSCtl standard function 
  185. call to communicate with the specific file system (FSD). See Figure 1-3. 
  186.  
  187.               ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  188.               Γöé application Γöé
  189.               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  190.                      Γöé
  191.                      
  192.          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  193.          Γöé Extended File I/O API   Γöé Dynamic Link Library
  194.          Γöé  for File System X      Γöé
  195.          ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  196.                      Γöé
  197.                      
  198.          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  199.          Γöé       DosFsCtl          Γöé  Standard File I/O API
  200.          ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  201.                      Γöé
  202.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  203.   Γöé                  Γöé                           Γöé
  204.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        Γöé
  205.                                        Γöé        Γöé
  206.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé        Γöé
  207.   Γöé  File  Γöé    Γöé  File  Γöé    Γöé  File  ΓöéΓöé        Γöé
  208.   Γöé System Γöé    Γöé System Γöé    Γöé System ΓöéΓöé        Γöé
  209.   Γöé        Γöé    Γöé    X   Γöé    Γöé        ΓöéΓöé        Γöé
  210.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöé        Γöé
  211.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        Γöé
  212.   Γöé                                              Γöé
  213.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        Γöé
  214.                                         Γöé        Γöé
  215.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé        Γöé
  216.   Γöé Device Γöé    Γöé Device Γöé    Γöé Device ΓöéΓöé        Γöé
  217.   Γöé Driver Γöé    Γöé Driver Γöé    Γöé Driver ΓöéΓöé        Γöé
  218.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöé        Γöé
  219.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        Γöé
  220.   Γöé                                              Γöé
  221.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  222.  
  223. Figure 1-3. Extended File I/O 
  224.  
  225.  
  226. ΓòÉΓòÉΓòÉ 4.1.3. Buffer Management ΓòÉΓòÉΓòÉ
  227.  
  228. In 2.0 the FAT buffer management helpers were removed because of lack of use by 
  229. any 1.x FSD. FSDs should handle all buffer/cache management themselves. 
  230.  
  231. The FSD moves all data requiring partial sector I/O between the application's 
  232. buffers and its cache buffers. The FS helper routines initiate the I/O for 
  233. local file systems. 
  234.  
  235.  
  236. ΓòÉΓòÉΓòÉ 4.1.4. Volume Management ΓòÉΓòÉΓòÉ
  237.  
  238. Volume management (that is, detecting when the wrong volume is mounted and 
  239. notifying the operator to take corrective action) is handled directly through 
  240. OS/2 and the device driver. Each FSD is responsible for generating a volume 
  241. label and 32-bit volume serial number. These are stored in a reserved location 
  242. in logical sector zero at format time. Because an FSD is the only system 
  243. component to touch this information, an FSD is not required to store it in a 
  244. particular format. OS/2 calls the FSD to perform operations that might involve 
  245. it. The FSD is required to update the volume parameter block (VPB) whenever the 
  246. volume label or serial number is changed. 
  247.  
  248. When the FSD passes an I/O request to an FS helper routine, the FSD passes the 
  249. 32-bit volume serial number and the user's volume label (through the VPB). When 
  250. the I/O is performed, OS/2 compares the requested volume serial number with the 
  251. current volume serial number it maintains for the device. This is an in-storage 
  252. test (no I/O required) performed by checking the drive parameter block's (DPB) 
  253. VPB of the volume mounted on the drive. If unequal, OS/2 signals the critical 
  254. error handler to prompt the user to insert the volume having the serial number 
  255. and label specified. 
  256.  
  257. When OS/2 detects a media change in a drive, or the first time a volume is 
  258. accessed, OS/2 determines which FSD is responsible for managing I/O to that 
  259. volume. OS/2 allocates a VPB and polls the installed FSDs (by calling the 
  260. FS_MOUNT entry point) until an FSD indicates that it does recognize the media. 
  261.  
  262. Note:  The FAT FSD is the last in the list of installed FSDs and acts as the 
  263. default FSD when no other FSD recognition takes place. 
  264.  
  265.  
  266. ΓòÉΓòÉΓòÉ 4.1.5. Connectivity ΓòÉΓòÉΓòÉ
  267.  
  268. There are two classes of file system drivers: 
  269.  
  270.  o FSDs that use a block device driver to do I/O to a local or remote device. 
  271.    These are called local file systems. 
  272.  o FSDs that access a remote system without a block device driver. These are 
  273.    called remote file systems. 
  274.  
  275.  The connection between a drive letter and a remote file system is achieved 
  276.  through a command interface provided with the FSD (FS_ATTACH). 
  277.  
  278.  When a local volume is first accessed, OS/2 sequentially asks each installed 
  279.  FSD to accept the media, by calling each FSD's FS_MOUNT entry point. If no FSD 
  280.  accepts the media, it is then assigned to the default FAT file system. Any 
  281.  further attempt that is made to access an unrecognized media, other than by 
  282.  FORMAT, results in an 'Invalid media format' message. 
  283.  
  284.  When a volume has been recognized, the relationship between drive, FSD, volume 
  285.  serial number, and volume label is remembered. The volume serial number and 
  286.  label are stored in the volume parameter block (VPB). The VPB is maintained by 
  287.  OS/2 for open files (I/O based on file-handles), searches, and buffer 
  288.  references. The VPB represents the media. 
  289.  
  290.  Subsequent requests for a volume that has been removed require polling the 
  291.  installed FSDs for volume recognition by calling FS_MOUNT. The volume serial 
  292.  number and volume label of the VPB returned by the recognizing FSD and the 
  293.  existing VPB are compared. If the test fails, OS/2 signals the critical error 
  294.  handler to prompt the user for the correct volume. 
  295.  
  296.  The connection between media and VPB is remembered until all open files on the 
  297.  volume are closed and search and cache buffer references are removed. Only 
  298.  volume changes cause a redetermination of the media at the time of next 
  299.  access. 
  300.  
  301.  
  302. ΓòÉΓòÉΓòÉ 4.1.6. IPL Mechanism ΓòÉΓòÉΓòÉ
  303.  
  304. A primary DOS disk partition (type 1, 4, or 6) may be used to boot the system. 
  305. The code for FSDs may reside in any partition readable by a previously 
  306. installed FSD. An IFS partition must be a type 7 partition. 
  307.  
  308. The OS/2 boot volume includes the following: Bootrecord and basic file system. 
  309. The root directory of this volume will contain a mini-file system in OS2BOOT, a 
  310. kernel loader in OS2LDR, the OS/2 kernel in OS2KRNL, and the CONFIG.SYS file. 
  311.  
  312. Device drivers and FSDs are loaded in the order they appear in CONFIG.SYS and 
  313. are considered elements of the same ordered set. Therefore, both device drivers 
  314. and FSDs may be loaded from installed file systems as long as they are started 
  315. in the proper order. For example: 
  316.  
  317. DEVICE = c:\diskdriv.sys
  318. REM Block device D: is now defined. (diskdriv.sys controls this.)
  319. IFS = c:\fsd\newfsl.fsd
  320. REM If we assume that D: contains a fixed newfsl type partition,
  321. REM then we're now ready to use D: to load the device driver and
  322. REM FSD for E:.
  323. DEVICE = d:\root\dev\special.dev
  324. REM Block device e: is now defined.
  325. IFS = d:\root\fsd\special.fsd
  326. REM E: can now be read.
  327. DEVICE = e:\music
  328.  
  329.  
  330. ΓòÉΓòÉΓòÉ 4.1.7. OS/2 Partition Access ΓòÉΓòÉΓòÉ
  331.  
  332. Access to the OS/2 partition on a bootable, logically partitioned media is 
  333. through the full OS/2 function set. See OS/2 Version 2.0 Physical Device Driver 
  334. Reference for a detailed description of the disk partitioning design. 
  335.  
  336.  
  337. ΓòÉΓòÉΓòÉ 4.1.8. Permissions ΓòÉΓòÉΓòÉ
  338.  
  339. There are no secure file system clients identified for OS/2 Version 2.0 
  340. incorporating the IFS architecture. 
  341.  
  342.  
  343. ΓòÉΓòÉΓòÉ 4.1.9. File Naming Conventions ΓòÉΓòÉΓòÉ
  344.  
  345. See OS/2 Version 2.0 Programming Guide for a detailed description of OS/2 
  346. Version 2.0 file naming conventions. 
  347.  
  348.  
  349. ΓòÉΓòÉΓòÉ 4.1.10. Meta Character Processing ΓòÉΓòÉΓòÉ
  350.  
  351. See OS/2 Version 2.0 Programming Guide for a detailed description of OS/2 
  352. Version 2.0 meta character processing. 
  353.  
  354.  
  355. ΓòÉΓòÉΓòÉ 4.1.11. FSD Pseudo-character Device Support ΓòÉΓòÉΓòÉ
  356.  
  357. A pseudo-character device (single file device) may be redirected to an FSD. The 
  358. behavior of this file is very similar to the behavior of a normal OS/2 
  359. character device. It may be read from (DosRead) and written to (DosWrite). The 
  360. difference is that the DosChgFilePtr and DosFileLocks functions can also be 
  361. applied to the file. The user would perceive this file as a device name for a 
  362. non-existing device. This file is seen as a character device because the 
  363. current drive and directory have no effect on the name. That is what happens in 
  364. OS/2 today for character devices. 
  365.  
  366. The format of an OS/2 pseudo-character device name is that of an ASCIIZ string 
  367. in the format of an OS/2 file name in a subdirectory called \DEV\. The pseudo 
  368. device name XXX is accessible at the API level (DosQFSAttach) through the path 
  369. name '\DEV\XXX'. 
  370.  
  371.  
  372. ΓòÉΓòÉΓòÉ 4.1.12. Family API Issues ΓòÉΓòÉΓòÉ
  373.  
  374. Since the IFS Mechanism is not present in any release of DOS, FAPI will not be 
  375. extended to support the new interfaces. 
  376.  
  377.  
  378. ΓòÉΓòÉΓòÉ 4.1.13. FSD Utilities ΓòÉΓòÉΓòÉ
  379.  
  380.  
  381. FSD Utility Support 
  382.  
  383. Each FSD is required to provide a single .DLL executable module that supports 
  384. the OS/2 FORMAT, CHKDSK, SYS, and RECOVER utilities. The FS-supported 
  385. executable will be invoked by these utilities when performing a FORMAT, CHKDSK, 
  386. SYS, or RECOVER function for that file system. The command line that was passed 
  387. to the utility will be passed unchanged to the FS-specific executable. 
  388.  
  389. The procedures that support these utilities reside in a file called 
  390. U<fsdname>.DLL, where <fsdname> is the name returned by DosQFSAttach. If the 
  391. file system utility support .DLL file is to reside on a FAT partition, then 
  392. <fsdname> should be up to 7 bytes long. 
  393. FSD Utility Guidelines 
  394.  
  395. The FSD utility procedures are expected to follow these guidelines: 
  396.  
  397.  o No preparation is done by the base utilities before they invoke the FSD 
  398.    utility procedure. Therefore, base utilities do not lock drives, parse 
  399.    names, open drives, etc. This allows maximum flexibility for the FSD. 
  400.  
  401.  o The FSD utility procedures are expected to follow the standard conventions 
  402.    for the operations that they are performing, for example, /F for CHKDSK 
  403.    implies "fix". 
  404.  
  405.  o The FSD procedures may use stdin, stdout, and stderr, but should be aware 
  406.    that they may have been redirected to a file or device. 
  407.  
  408.  o It is the responsibility of the FSD procedures to worry about volumes being 
  409.    changed while the operation is in progress. The normal action would be to 
  410.    stop the operation when such a situation is detected. 
  411.  
  412.  o When the FSD procedures are called, they will be passed argc, argv, and 
  413.    envp, that they can use to determine the operations. 
  414.  
  415.  o FSD procedures are responsible for displaying relevant prompts and messages. 
  416.  
  417.  o FSD utility procedures must follow the standard convention of entering the 
  418.    target drive as specified for each utility. 
  419.  
  420.  FSD Utility Interfaces 
  421.  
  422.  All FSD utility procedures are called with the same arguments: 
  423.  
  424.   int far pascal CHKDSK(int argc, char far * far *argv,
  425.   char far * far *envp);
  426.  
  427.   int far pascal FORMAT(int argc, char far * far *argv,
  428.   char far * far *envp);
  429.  
  430.   int far pascal RECOVER(int argc, char far * far *argv,
  431.   char far * far *envp);
  432.  
  433.   int far pascal SYS(int argc, char far * far *argv,
  434.   char far * far *envp);
  435.  
  436.  where argc, argv, and envp have the same semantics as the corresponding 
  437.  variables in C. 
  438.  
  439.  
  440. ΓòÉΓòÉΓòÉ 4.2. Extended Attributes ΓòÉΓòÉΓòÉ
  441.  
  442. Extended attributes (EAs) are a mechanism whereby an application can attach 
  443. information to a file system object (directories or files) describing the 
  444. object to another application, to the operating system, or to the FSD managing 
  445. that object. 
  446.  
  447. EAs associated with a file object are not part of a file object's data, but are 
  448. maintained separately and managed by the file system that manages that object. 
  449.  
  450. Each extended attribute consists of a name and a value. An EA name consists of 
  451. ASCII text, chosen by the application developer, that is used to identify a 
  452. particular EA. EA names are restricted to the same character set as a filename. 
  453. An EA value consists of arbitrary data, that is, data of any form. Because of 
  454. this OS/2 does not check data that is associated with an EA. 
  455.  
  456. So that EA data is understandable to other applications, conventions have been 
  457. established for: 
  458.  
  459.  o Naming EAs 
  460.  o Indicating the type of data contained in EAs 
  461.  
  462.  In addition, a set of standard EAs (SEAs) have been defined. SEAs define a 
  463.  common set of information that can be associated with most files (for example, 
  464.  file type and file purpose). Through SEAs, many applications can access the 
  465.  same, useful information associated with files. 
  466.  
  467.  Applications are not limited to using SEAs to associate information with 
  468.  files. They may define their own application-specific extended attributes. 
  469.  Applications define and associate extended attributes with a file object 
  470.  through file system function calls. 
  471.  
  472.  See the OS/2 Version 2.0 Programming Guide for a complete description of EA 
  473.  naming conventions and data types and standard extended attributes. See also 
  474.  the OS/2 Version 2.0 Control Program Programming Reference for a complete 
  475.  description of the file system function calls. 
  476.  
  477.  EAs may be viewed as a property list attached to file objects. The services 
  478.  for manipulating EAs are: add/replace a series of name/value pairs, return 
  479.  name/value pairs given a list of names, and return the total set of EAs. 
  480.  
  481.  There are two formats for EAs as passed to OS/2 Version 2.0 API: Full EAs 
  482.  (FEA) and Get EAs (GEA). 
  483.  
  484.  
  485. ΓòÉΓòÉΓòÉ 4.2.1. FEAs ΓòÉΓòÉΓòÉ
  486.  
  487. FEAs are complete name/value pairs. In order to simplify and speed up scanning 
  488. and processing of these names, they are represented as length-preceded data. 
  489. FEAs are defined as follows: 
  490.  
  491. struct FEA {
  492.     unsigned char fEA;        /* byte of flags      */
  493.     unsigned char cbName;     /* length of name     */
  494.     unsigned short cbValue;   /* length of value    */
  495.     unsigned char szName[];   /* ASCIIZ name        */
  496.     unsigned char aValue[];   /* free format value  */
  497. };
  498.  
  499. There is only one flag defined in fEA. That is 0x80 which is fNeedEA. Setting 
  500. the flag marks this EA as needed for the proper operation on the file to which 
  501. it is associated. Setting this bit has implications for access to this file by 
  502. old applications, so it should not be set arbitrarily. 
  503.  
  504. If a file has one or more NEED EAs, old applications are not allowed to open 
  505. the file. For DOS mode applications to access files with NEED EAs, they must 
  506. have the EA bit set in their exe header. For OS/2 mode, only applications with 
  507. the NEWFILES bit set in the exe header may open files with NEED EAs. 
  508.  
  509. Programs that change EAs should preserve the NEED bit in the EAs unless there 
  510. is a good reason to change it. 
  511.  
  512. The name length does not include the trailing NUL. The maximum EA name length 
  513. is 255 bytes. The minimum EA name length is 1 byte. The characters that form 
  514. the name are legal filename characters. Wildcard characters are not allowed. EA 
  515. names are case-insensitive and should be uppercased. The FSD should call 
  516. FSH_CHECKEANAME and FSH_UPPERCASE for each EA name it receives to check for 
  517. invalid characters and correct length, and to uppercase it. 
  518.  
  519. The FSD may not modify the flags. 
  520.  
  521. A list of FEAs is a packed set of FEA structures preceded by a length of the 
  522. list (including the length itself) as indicated in the following structure: 
  523.  
  524. struct FEAList {
  525.     unsigned long cbList;       /* length of list       */
  526.     struct FEA list[];          /* packed set of FEAs   */
  527. };
  528.  
  529. FEA lists are used for adding, deleting, or changing EAs. A particular FSD may 
  530. store the EAs in whatever format it desires. Certain EAs may be stored to 
  531. optimize retrieval. 
  532.  
  533.  
  534. ΓòÉΓòÉΓòÉ 4.2.2. GEAs ΓòÉΓòÉΓòÉ
  535.  
  536. A GEA is an attribute name. Its format is: 
  537.  
  538. struct GEA {
  539.     unsigned char cbName;       /* length of name    */
  540.     unsigned char szName[];     /* ASCIIZ name       */
  541. };
  542.  
  543. The name length does not include the trailing NUL. 
  544.  
  545. A list of GEAs is a packed set of GEA structures preceded by a length of the 
  546. list (including the length itself) as indicated in the following structure: 
  547.  
  548. struct GEAList {
  549.     unsigned long cbList;    /* length of list     */
  550.     struct GEA list[];       /* packed set of GEAs */
  551. };
  552.  
  553. GEA lists are used for retrieving the values for a particular set of 
  554. attributes. A GEA list is used as input only. 
  555.  
  556. Name lengths of 0 are illegal and are considered in error. A value length of 0 
  557. has special meaning. Setting an EA with a value length of 0 will cause that 
  558. attribute to be deleted (if possible). Upon retrieval, a value length of 0 
  559. indicates that the attribute is not present. 
  560.  
  561. Setting attributes contained in an FEA list does not treat the entire FEA list 
  562. as atomic. If an error occurs before the entire list of EAs has been set, all, 
  563. some, or none of them may actually remain set on the file. No program should 
  564. depend on an EA set being atomic to force EAs to be consistent with each other. 
  565. Programs must be careful not to depend on atomicity, since a given file system 
  566. may provide it. 
  567.  
  568. Manipulation of extended attributes is associated with access permission to the 
  569. associated file or directory. For querying and setting file EAs, read and 
  570. write/read permission, respectively, for the associated file is required. No 
  571. directory create or delete may occur while querying EAs for that directory. 
  572.  
  573. For handle-based operations on extended attributes, access permission is 
  574. controlled by the sharing/access mode of the associated file. If the file is 
  575. open for read, querying the extended attributes is allowed. If the file is open 
  576. for write, setting the extended attributes is allowed. These operations are 
  577. DosQFileInfo and DosSetFileInfo. 
  578.  
  579. For path-based manipulation of extended attributes, the associated file or 
  580. directory will be added to the sharing set for the duration of the call. The 
  581. requested access permission for setting EAs is write/deny-all and for querying 
  582. EAs is read/deny-write. The path-based API are DosQPathInfo, DosSetPathInfo, 
  583. and DosFindFirst2/DosFindNext. 
  584.  
  585. For create-only operations of extended attributes, the extended attributes are 
  586. set without examining the sharing/access mode of the associated file/directory. 
  587. These operations are DosOpen2 and DosMkDir2. 
  588.  
  589. The routing of EA requests is accomplished by the IFS routing mechanism. EA 
  590. requests that apply to names are routed to the FSD attached to the specified 
  591. drive. Those requests that apply to a handle (file or directory) are routed to 
  592. the FSD attached to the handle. No interpretation of either FEA lists nor GEA 
  593. lists is performed by the IFS router. 
  594.  
  595. Note:  It is the responsibility of each FSD to provide support for EAs. 
  596.  
  597. It is expected that some FSDs will be unable to store EAs; for example, UNIX 
  598. and MVS compatible file systems. 
  599.  
  600. Note:  The FAT FSD implementation will provide for the complete implementation 
  601. of EAs. There will be no special EAs for the FAT FSD. 
  602.  
  603. All EA manipulation is performed using the following structure: The relevance 
  604. of each field is described within each API. 
  605.  
  606. struct EAOP {
  607.     struct GEAList far * fpGEAList; /* GEA set           */
  608.     struct FEAList far * fpFEAList; /* FEA set           */
  609.     unsigned long offError;         /* offset of FEA err */
  610. };
  611.  
  612. See the descriptions of the file system function calls in OS/2 Version 2.0 
  613. Control Program Programming Reference for the relevance of each field. 
  614.  
  615. In OS/2 Version 2.0, values of cbList greater than (64K-1) are not allowed. 
  616. This is an implementation-defined limitation which may be raised in the future. 
  617. Because this limit may change, programs should avoid enumerating the list of 
  618. all EAs, but instead manipulate only EAs that they know about. For operations 
  619. such as copying, the DosCopy API should be used. If enumeration is necessary, 
  620. the DosEnumAttribute API should be used. 
  621.  
  622. A special category of attributes, called create-only attributes, is defined as 
  623. the set of extended attributes that a file system may only allow to be set at 
  624. creation time. (Such attributes may be used to control file allocation and 
  625. structure configuration.) File systems are expected to allow create-only 
  626. attributes to be set at any time from when the object is created to when it is 
  627. first modified, that is, data is written into a file or an entry added to a 
  628. directory. Programs that copy objects should copy all of the EAs for an object 
  629. before otherwise modifying it in order to assure that any create-only 
  630. attributes from the source are properly applied to the target. The DosCopy API 
  631. is the preferred method of copying files or directories. 
  632.  
  633.  
  634. ΓòÉΓòÉΓòÉ 4.3. FSD File Image ΓòÉΓòÉΓòÉ
  635.  
  636. An FSD loads from a file which is in the format of a standard OS/2 dynamic link 
  637. library file. Exactly one FSD resides in each file. The FSD exports information 
  638. to OS/2 using a set of predefined public names. 
  639.  
  640. The FSD is initialized by a call to the exported entry point FS_INIT. 
  641.  
  642. FS entry points for Mount, Read, Write, etc. are exported with known names as 
  643. standard far entry points. 
  644.  
  645. The FSD exports its name as a public ASCIIZ character string under the name 
  646. 'FS_NAME'. All comparisons with user-specified strings are done similar to file 
  647. names; case is ignored and embedded blanks are significant. FS_NAMEs, however, 
  648. may be input to applications by users. Embedded blanks should be avoided. The 
  649. name exported as FS_NAME need NOT be the same as the 1-8 FSD name in the boot 
  650. sector of formatted media, although it may be. The ONLY name the kernel pays 
  651. any attention to, and the only name accessible to user programs through the 
  652. API, is the name exported as FS_NAME. 
  653.  
  654. In addition to various entry points, the FSD must export a dword bit vector of 
  655. attributes. Attributes are exported under the name 'FS_ATTRIBUTE'. FS_ATTRIBUTE 
  656. specifies special properties of the FSD and is described in the next section. 
  657.  
  658.  
  659. ΓòÉΓòÉΓòÉ 4.3.1. FSD Attribute ΓòÉΓòÉΓòÉ
  660.  
  661. The format of the OS/2 FS_ATTRIBUTE is defined in Figure 1-4 and the definition 
  662. list that follows it. 
  663.  
  664.  31  30  29  28  27  26  25  24  23  22  21  20  19  18  17  16
  665. ΓöîΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÉ
  666. Γöé E Γöé V Γöé V Γöé V Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé
  667. Γöé x Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé
  668. Γöé A Γöé r Γöé r Γöé r Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé
  669. Γöé t Γöé s Γöé s Γöé s Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé
  670. Γö£ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöñ
  671. Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé R Γöé L Γöé F Γöé U Γöé R Γöé
  672. Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé v Γöé I Γöé N Γöé e Γöé
  673. Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé s Γöé l Γöé / Γöé C Γöé m Γöé
  674. Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé v Γöé 7 Γöé O Γöé   Γöé t Γöé
  675. ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  676.  15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  677.  
  678. Figure 1-4. OS/2 FSD Attribute 
  679.  
  680.  Bits      Description 
  681.  
  682.  31        FSD Additional attributes. If 1, FSD has additional attributes. If 
  683.            0, FS_ATTRIBUTE is the only FSD attribute information. 
  684.  
  685.  30-28     VERSION NUMBER - FSD version number. 
  686.  
  687.  27-4      RESERVED 
  688.  
  689.  3         LEVEL7 - QPathInfo Level 7 bit. Set if FSD is case-preserving. If 
  690.            this bit is set, the kernel will call the FS_PATHINFO entry point 
  691.            with a level equal to 7. The output buffer is to be filled with a 
  692.            case-preserved copy of the path that was passed in by the user. 
  693.  
  694.  2         FILEIO - File I/O bit. Set if FSD wants to see file 
  695.            locking/unlocking operations and compacted file I/O operations. If 
  696.            not set, the file I/O calls will be broken up into individual 
  697.            lock/unlock/read/write/seek calls and the FSD will not see the 
  698.            lock/unlock calls. FSDs that do not support file locking can set 
  699.            this bit to enable compacted file I/O operations. 
  700.  
  701.  1         UNC - Universal Naming Convention bit. Set if FSD supports the 
  702.            Universal Naming Convention. OS/2 Version 2.0 supports multiple 
  703.            loaded UNC redirectors. 
  704.  
  705.  0         REMOTE - Remote File System (Redirector). This bit tells the system 
  706.            whether the FSD uses static or dynamic media attachment. Local FSDs 
  707.            always use dynamic media attachment. Remote FSDs always use static 
  708.            media attachment. This bit is clear if it is a dynamic media 
  709.            attachment and set, if a static attachment. No FSD supports both 
  710.            static and dynamic media attachment. To support proper file locking, 
  711.            a remote FSD should also set the FILEIO bit. 
  712.  
  713.  
  714. ΓòÉΓòÉΓòÉ 4.4. FSD Initialization ΓòÉΓòÉΓòÉ
  715.  
  716. FSD initialization occurs at system initialization time. FSDs are loaded 
  717. through the IFS= configuration command in CONFIG.SYS. Once the FSD has been 
  718. loaded, the FSD's initialization entry point is called to initialize it. 
  719.  
  720. FSDs are structured the same as dynamic link library modules. Once an FSD is 
  721. loaded, the initialization routine FS_INIT is called. This gives the FSD the 
  722. ability to process any parameters that may appear on the CONFIG.SYS command 
  723. line, which are passed as a parameter to the FS_INIT routine. A LIBINIT routine 
  724. in an FSD will be ignored. 
  725.  
  726. OS/2 FSDs initialize in protect mode. Because of the special state of the 
  727. system, an FSD may make dynamic link system calls at init-time. 
  728.  
  729. The list of systems calls that an FSD may make are as follows: 
  730.  
  731.  o DosBeep 
  732.  o DosChgFilePtr 
  733.  o DosClose 
  734.  o DosDelete 
  735.  o DosDevConfig 
  736.  o DosDevIoCtl 
  737.  o DosFindClose 
  738.  o DosFindFirst 
  739.  o DosFindNext 
  740.  o DosGetEnv 
  741.  o DosGetInfoSeg 
  742.  o DosGetMessage 
  743.  o DosOpen 
  744.  o DosPutMessage 
  745.  o DosQCurDir 
  746.  o DosQCurDisk 
  747.  o DosQFileInfo 
  748.  o DosQFileMode 
  749.  o DosQSysInfo 
  750.  o DosRead 
  751.  o DosWrite 
  752.  
  753.  The FSD may not call ANY FS helper routines at initialization time. 
  754.  
  755.  Note that multiple code and data segments are not discarded by the loader as 
  756.  in the case of device drivers. 
  757.  
  758.  The FSD may call DosGetInfoSeg to obtain access to the global and process 
  759.  local information segments. The local segment may be used in the context of 
  760.  all processes without further effort to make it accessible and has the same 
  761.  selector. The local infoseg is not valid in real mode or at interrupt time. 
  762.  
  763.  
  764. ΓòÉΓòÉΓòÉ 4.4.1. OS/2 and DOS Extended Boot Structure and BIOS Parameter Block ΓòÉΓòÉΓòÉ
  765.  
  766. The Extended Boot structure is as follows: 
  767.  
  768. struct Extended_Boot {
  769.     unsigned char Boot_jmp[3];
  770.     unsigned char Boot_OEM[8];
  771.     struct Extended_BPB Boot_BPB;
  772.     unsigned char Boot_DriveNumber;
  773.     unsigned char Boot_CurrentHead;
  774.     unsigned char Boot_Sig = 41; /* Indicate Extended Boot */
  775.     unsigned char Boot_Serial[4];
  776.     unsigned char Boot_Vol_Label[11];
  777.     unsigned char Boot_System_ID[8];
  778. };
  779.  
  780.  Where 
  781.  
  782.  Boot_Serial         is the 32-bit binary volume serial number for the media. 
  783.  
  784.  Boot_System_ID      is an 8-byte name written when the media is formatted. It 
  785.                      is used by FSDs to identify their media but need not be 
  786.                      the same as the name the FSD exports via FS_NAME and is 
  787.                      NOT the name users employ to refer to the FSD. (They may, 
  788.                      however, be the same names). 
  789.  
  790.  Boot_Vol_Label      is the 11-byte ASCII label of the disk/diskette volume. 
  791.                      FAT file systems must ALWAYS use the volume label in the 
  792.                      root directory for compatibility reasons. An FSD may use 
  793.                      the one in the boot sector. 
  794.  
  795.  The extended BPB structure is a super-set of the conventional BPB structure, 
  796.  as follows: 
  797.  
  798.   struct Extended_BPB {
  799.       unsigned short BytePerSector;
  800.       unsigned char SectorPerCluster;
  801.       unsigned short ReservedSectors;
  802.       unsigned char NumberOfFats;
  803.       unsigned short RootEntries;
  804.       unsigned short TotalSectors;
  805.       unsigned char MediaDescriptor;
  806.       unsigned short SectorsPerFat;
  807.       unsigned short SectorsPerTrack;
  808.       unsigned short Heads;
  809.       unsigned long HiddenSectors;
  810.       unsigned long Ext_TotalSectors;
  811.   };
  812.  
  813.  
  814. ΓòÉΓòÉΓòÉ 4.5. IFS Commands ΓòÉΓòÉΓòÉ
  815.  
  816.  
  817. ΓòÉΓòÉΓòÉ 4.5.1. IFS = (CONFIG.SYS Command) ΓòÉΓòÉΓòÉ
  818.  
  819. An FSD is loaded and initialized at system start-up when an IFS= statement is 
  820. encountered in CONFIG.SYS. The syntax of this command is as follows: 
  821.  
  822. IFS=drive:path\name.ext parms
  823.  
  824.  where 
  825.  drive:path\name.ext      specifies the FSD to load and initialize. 
  826.  parms                    represents an FSD-defined string of initialization 
  827.                           parameters. 
  828.  
  829.  See the OS/2 Version 2.0 Online Command Reference for a detailed description 
  830.  of this command. 
  831.  
  832.  
  833. ΓòÉΓòÉΓòÉ 4.6. File System Function Calls ΓòÉΓòÉΓòÉ
  834.  
  835. The OS/2 Version 2.0 Control Program Programming Reference gives a detailed 
  836. description of the 32-bit file system calls new for OS/2 Version 2.0 See the 
  837. OS/2 Version 2.0 Programming Guide for a description of how to use these calls. 
  838. For detailed descriptions of the 16-bit file system calls see the OS/2 Version 
  839. 1.3 Control Program Programming Reference, and the OS/2 Version 1.3 Programming 
  840. Guide on how to use these calls. 
  841.  
  842. Note:  The data structures for some of the file system calls have changed in 
  843. their 32-bit implementations. For OS/2 Version 2.0 the kernel will handle all 
  844. remapping between the 32-bit structures and the 16-bit structures used by 
  845. individual FSDs. 
  846.  
  847.  
  848. ΓòÉΓòÉΓòÉ 4.6.1. Application File I/O Notes ΓòÉΓòÉΓòÉ
  849.  
  850. File handle values of 0xFFFF do not represent actual file handles but are used 
  851. throughout the file system interface to indicate specific actions to be taken 
  852. by the file system. Usage of this special file handle where it is not expected 
  853. by the file system will result in an error. 
  854.  
  855. Null pointers are defined to be 0x00000000 throughout this document. 
  856.  
  857. File systems that conform to the Standard Application Program Interface 
  858. (Standard API) may not necessarily support all the described information kept 
  859. on a file basis. When this is the case, FSDs are required to return to the 
  860. application a null (zero) value for the unsupported parameter. 
  861.  
  862. An FSD may support version levels of files. 
  863.  
  864.  
  865. Date/Time Stamps 
  866.  
  867. The format of OS/2 dates are show below in Figure 1-5. 
  868.  
  869. ΓöîΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÉ
  870. Γöé Y Γöé Y Γöé Y Γöé Y Γöé Y Γöé Y Γöé Y Γöé M Γöé M Γöé M Γöé M Γöé D Γöé D Γöé D Γöé D Γöé D Γöé
  871. Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé e Γöé o Γöé o Γöé o Γöé o Γöé a Γöé a Γöé a Γöé a Γöé a Γöé
  872. Γöé a Γöé a Γöé a Γöé a Γöé a Γöé a Γöé a Γöé n Γöé n Γöé n Γöé n Γöé y Γöé y Γöé y Γöé y Γöé y Γöé
  873. Γöé r Γöé r Γöé r Γöé r Γöé r Γöé r Γöé r Γöé t Γöé t Γöé t Γöé t Γöé   Γöé   Γöé   Γöé   Γöé   Γöé
  874. Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé h Γöé h Γöé h Γöé h Γöé   Γöé   Γöé   Γöé   Γöé   Γöé
  875. ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  876.  15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  877.  
  878. Figure 1-5. OS/2 Date Format 
  879.  
  880.  Bits      Description 
  881.  15-9      YEARS - Number of years since 1980. 
  882.  8-5       MONTH - is the month of the year (1-12) 
  883.  4-0       DAY - is the day of the month (1-31) 
  884.  
  885.  The format of OS/2 times are show below in Figure 1-6. 
  886.  
  887.   ΓöîΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÉ
  888.   Γöé H Γöé H Γöé H Γöé H Γöé H Γöé M Γöé M Γöé M Γöé M Γöé M Γöé M Γöé 2 Γöé 2 Γöé 2 Γöé 2 Γöé 2 Γöé
  889.   Γöé o Γöé o Γöé o Γöé o Γöé o Γöé i Γöé i Γöé i Γöé i Γöé i Γöé i Γöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé
  890.   Γöé u Γöé u Γöé u Γöé u Γöé u Γöé n Γöé n Γöé n Γöé n Γöé n Γöé n Γöé S Γöé S Γöé S Γöé S Γöé S Γöé
  891.   Γöé r Γöé r Γöé r Γöé r Γöé r Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé e Γöé e Γöé e Γöé e Γöé e Γöé
  892.   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé c Γöé c Γöé c Γöé c Γöé c Γöé
  893.   ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  894.    15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  895.  
  896.  Figure 1-6. OS/2 Time Format 
  897.  
  898.  Bits      Description 
  899.  15-9      HOUR - is the hour of the day (0-23) 
  900.  8-5       MINUTE - is the minute of the hour (0-59) 
  901.  4-0       2-SECOND - is the second of the minute(in increments of 2) (0-29) 
  902.  
  903.  I/O Error Codes 
  904.  
  905.  Some file system functions may return device-driver/device-manager generated 
  906.  errors. These include: 
  907.  
  908.  o ERROR_WRITE_PROTECT - the media in the drive has write-protection enabled. 
  909.  o ERROR_BAD_UNIT - there is a breakdown of internal consistency between OS/2's 
  910.    mapping between logical drive and device driver. Internal Error. 
  911.  o ERROR_NOT_READY - the device driver detected that the device is not ready. 
  912.  o ERROR_BAD_COMMAND - there is a breakdown of internal consistency between 
  913.    OS/2's idea of the capability of a device driver and that of the device 
  914.    driver. 
  915.  o ERROR_CRC - the device driver has detected a CRC error. 
  916.  o ERROR_BAD_LENGTH - there is a breakdown of internal consistency between 
  917.    OS/2's idea of the length of a request packet and the device driver's idea 
  918.    of that length. Internal Error. 
  919.  o ERROR_SEEK - the device driver detected an error during a seek operation. 
  920.  o ERROR_NOT_DOS_DISK - the disk is not recognized as being OS/2 manageable. 
  921.  o ERROR_SECTOR_NOT_FOUND - the device is unable to find the specific sector. 
  922.  o ERROR_OUT_OF_PAPER - the device driver has detected that the printer is out 
  923.    of paper. 
  924.  o ERROR_WRITE_FAULT - other write-specific error. 
  925.  o ERROR_READ_FAULT - other read-specific error. 
  926.  o ERROR_GEN_FAILURE - other error. 
  927.  
  928.  There are also errors defined by and specific to the device drivers. These are 
  929.  indicated by either 0xFF or 0xFE in the high byte of the error code. 
  930.  
  931.  Note:  Error codes listed in the function call descriptions in the OS/2 
  932.  Version 2.0 Control Program Programming Reference are not complete. They are 
  933.  errors most likely to be returned by the FS router and the FAT file system. 
  934.  Each FSD may generate errors based upon its own circumstances. 
  935.  
  936.  
  937. ΓòÉΓòÉΓòÉ 4.7. FSD System Interfaces ΓòÉΓòÉΓòÉ
  938.  
  939.  
  940. ΓòÉΓòÉΓòÉ 4.7.1. Overview ΓòÉΓòÉΓòÉ
  941.  
  942. Installable file system entry points are called by the kernel as a result of 
  943. action taken through the published standard file I/O application programming 
  944. interface in OS/2 Version 2.0. 
  945.  
  946. Installable file systems are installed as OS/2 dynamic link library modules. 
  947. Unlike device drivers, they may include any number of segments, all of which 
  948. will remain after initialization, unless the FSD itself takes some action to 
  949. free them. 
  950.  
  951. An FSD exports FS entries to the OS/2 kernel using standard PUBLIC 
  952. declarations. Each FS entry is called directly. The OS/2 kernel manages the 
  953. association between internal data structures and FSDs. 
  954.  
  955. When a file system service is required, OS/2 assembles an argument list, and 
  956. calls the appropriate FS entry for the relevant FSD. If a back-level FSD is 
  957. loaded, the OS/2 kernel assures that all arguments passed and all structures 
  958. passed are understood by the FSD. 
  959.  
  960. Application program interfaces that are unsupported by an FSD receive an 
  961. UNSUPPORTED FUNCTION error from the FSD. 
  962.  
  963. Certain routines, for example, FS_PROCESSNAME, may provide no processing, no 
  964. processing is needed, or processing does not make sense. These routines return 
  965. no error, not ERROR_NOT_SUPPORTED. 
  966.  
  967.  
  968. ΓòÉΓòÉΓòÉ 4.7.2. Data Structures ΓòÉΓòÉΓòÉ
  969.  
  970. OS/2 data structures that include a pointer to the file system driver, as well 
  971. as file system specific data areas are: 
  972.  
  973.  o the CDS (current directory structure) 
  974.  o the SFT (system file table entry), 
  975.  o the VPB (volume parameter block) 
  976.  o the file search structures. 
  977.  
  978.  File system service routines are generally passed pointers to two parameter 
  979.  areas, in addition to read-only parameters which are specific to each call. 
  980.  The FSD does not need to verify these pointers. The two parameter areas 
  981.  contain file-system-independent data which is maintained jointly by OS/2 and 
  982.  the file system driver and file-system-dependent data which is unused by OS/2 
  983.  and which may be used in any way by the file system driver. The file system 
  984.  driver is generally permitted to use the file-system-dependent information in 
  985.  any way. The file-system-dependent information may contain all the information 
  986.  needed to describe the current state of the file or directory, or it may 
  987.  contain a handle which will direct it to other information about the file 
  988.  maintained within the FSD. Handles must be GDT selectors because any SFT, CDS, 
  989.  or VPB may be seen by more than one process. File-system-dependent and 
  990.  file-system-independent parameter areas are defined by data structures 
  991.  described in the remainder of this section. 
  992.  
  993.  
  994. ΓòÉΓòÉΓòÉ 4.7.2.1. Disk media and file system layout ΓòÉΓòÉΓòÉ
  995.  
  996. are described by the following structures. The data which is provided to the 
  997. file system may depend on the level of file system support provided by the 
  998. device driver attached to the block device. These structures are relevant only 
  999. for local file systems. 
  1000.  
  1001. /* file system independent - volume parameters */
  1002.  
  1003. struct vpfsi {
  1004.     unsigned long  vpi_vid;        /* 32 bit volume ID */
  1005.     unsigned long  vpi_hDEV;       /* handle to device driver */
  1006.     unsigned short vpi_bsize;      /* sector size in bytes */
  1007.     unsigned long  vpi_totsec;     /* total number of sectors */
  1008.     unsigned short vpi_trksec;     /* sectors / track */
  1009.     unsigned short vpi_nhead;      /* number of heads */
  1010.     char           vpi_text[12];   /* ASCIIZ volume name */
  1011.     void far *     vpi_pDCS;       /* device capability structure */
  1012.     void far *     vpi_pVCS;       /* volume characteristics */
  1013.     unsigned char  vpi_drive;      /* drive (0=A) */
  1014.     unsigned char  vpi_unit;       /* unit code */
  1015. };
  1016.  
  1017. /* file system dependent - volume parameters */
  1018.  
  1019. struct vpfsd {
  1020.     char           vpd_work[36];   /* work area */
  1021. };
  1022.  
  1023.  
  1024. ΓòÉΓòÉΓòÉ 4.7.2.2. Per-disk current directories ΓòÉΓòÉΓòÉ
  1025.  
  1026. are described by the following structures. These structures can only be 
  1027. modified by the FSD during FS_ATTACH and FS_CHDIR operations. 
  1028.  
  1029. /* file system independent - current directories */
  1030.  
  1031. struct cdfsi {
  1032.     unsigned short cdi_hVPB;           /* VPB handle for associated device */
  1033.     unsigned short cdi_end;            /* offset to root of path */
  1034.     char           cdi_flags;          /* FS independent flags */
  1035.     char           cdi_curdir[260];    /* text of current directory */
  1036. };
  1037.  
  1038. /* file system dependent - current directories */
  1039.  
  1040. struct cdfsd {
  1041.     char           cdd_work[8];        /* work area */
  1042. };
  1043.  
  1044.  
  1045. ΓòÉΓòÉΓòÉ 4.7.2.3. Open files ΓòÉΓòÉΓòÉ
  1046.  
  1047. are described by data initialized at file open time and discarded at the time 
  1048. of last close of all file handles which had been associated with that open 
  1049. instance of that file. There may be multiple open file references to the same 
  1050. file at any one time. 
  1051.  
  1052. All time stamps on files are stamped and propagated to other SFTs by OS/2 when 
  1053. the file is closed or committed (flushed). For example, if a file is opened at 
  1054. time 1, written at time 2, and closed at time 3, the last write time is time 3. 
  1055. Subdirectories need only have creation time stamps because the last write and 
  1056. last read time stamps on subdirectories are either very difficult to implement 
  1057. (propagate up to parent subdirectories), or are not very useful. An FSD, 
  1058. however, may implement them. FSDs are required to support direct access opens. 
  1059. These are indicated by a bit set in the sffsi.sfi_mode field. 
  1060.  
  1061. /* file system independent - file instance */
  1062.  
  1063. struct sffsi {
  1064.     unsigned long   sfi_mode;       /* access/sharing mode */
  1065.     unsigned short  sfi_hVPB;       /* volume info. */
  1066.     unsigned short  sfi_ctime;      /* file creation time */
  1067.     unsigned short  sfi_cdate;      /* file creation date */
  1068.     unsigned short  sfi_atime;      /* file access time */
  1069.     unsigned short  sfi_adate;      /* file access date */
  1070.     unsigned short  sfi_mtime;      /* file modification time */
  1071.     unsigned short  sfi_mdate;      /* file modification date */
  1072.     unsigned long   sfi_size;       /* size of file */
  1073.     unsigned long   sfi_position;   /* read/write pointer */
  1074.  
  1075. /* the following may be of use in sharing checks */
  1076.  
  1077.     unsigned short  sfi_UID;        /* user ID of initial opener */
  1078.     unsigned short  sfi_PID;        /* process ID of initial opener */
  1079.     unsigned short  sfi_PDB;        /* PDB (in 3.x box) of initial opener */
  1080.     unsigned short  sfi_selfsfn;    /* system file number of file instance */
  1081.     unsigned char   sfi_tstamp;     /* time stamp flags */
  1082.     unsigned short  sfi_type;       /* type of object opened */
  1083.     unsigned long   sfi_pPVDBFil;   /* performance counter data block pointer */
  1084.     unsigned char   sfi_DOSattr;    /* DOS file attributes D/S/A/H/R */
  1085. };
  1086.  
  1087. /* file system dependent - file instance */
  1088.  
  1089. struct sffsd {
  1090.     char            sfd_work[30];   /* work area */
  1091. };
  1092.  
  1093. The Program Data Block, or PDB (sfi_pdb), is the unit of sharing for DOS mode 
  1094. processes. For OS/2 mode processes, the unit of sharing is the Process ID, PID 
  1095. (sfi_pid). FSDs should use the combination PDB, PID, UID as indicating a 
  1096. distinct process. 
  1097.  
  1098.  
  1099. ΓòÉΓòÉΓòÉ 4.7.2.4. File search records ΓòÉΓòÉΓòÉ
  1100.  
  1101. /* file system independent - file search parameters */
  1102.  
  1103. struct fsfsi {
  1104.         unsigned short  fsi_hVPB;       /* volume info. */
  1105. };
  1106.  
  1107. /* file system dependent - file search parameters */
  1108.  
  1109. struct fsfsd {
  1110.         char            fsd_work[24];   /* work area */
  1111. };
  1112.  
  1113. Existing file systems that conform to the Standard Application Program 
  1114. Interface (Standard API) described in this section, may not necessarily support 
  1115. all the described information kept on a file basis. When this is the case, file 
  1116. system drivers are required to return to the application a null (zero) value 
  1117. for the unsupported parameter (when the unsupported data are a subset of the 
  1118. data returned by the API) or to return a ERROR_NOT_SUPPORTED error (when all of 
  1119. the data returned by the API is unsupported). 
  1120.  
  1121.  
  1122. ΓòÉΓòÉΓòÉ 4.7.2.5. Time Stamping ΓòÉΓòÉΓòÉ
  1123.  
  1124. All time stamps on files are stamped and propagated to other SFTs when the file 
  1125. is closed or committed (flushed). If a file is opened at time 1, written to at 
  1126. time 2, and closed at time 3, the last write time will be time 3. 
  1127. Subdirectories only have creation time stamps. 
  1128.  
  1129. The sfi_tstamp field of the file instance structure sffsi contains six flags: 
  1130.  
  1131.  
  1132.  Name            Value   Description
  1133.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1134.  ST_SCREAT       1       stamp creation time
  1135.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1136.  ST_PCREAT       2       propagate creation time
  1137.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1138.  ST_SWRITE       4       stamp last write time
  1139.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1140.  ST_PWRITE       8       propagate last write time
  1141.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1142.  ST_SREAD        16      stamp last read time
  1143.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1144.  ST_PREAD        32      propagate last read time
  1145.  
  1146. These flags are cleared when an SFT is created, and some of them may eventually 
  1147. be set by a file system worker routine. They are examined when the file is 
  1148. closed or flushed. 
  1149.  
  1150. For each time stamp, there are three meaningful actions: 
  1151.  
  1152.  
  1153.  ST_Sxxx    ST_Pxxx    Action
  1154.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1155.  clear      clear      don't do anything
  1156.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1157.  set        set        stamp and propagate (to other SFTs and
  1158.                        disk)
  1159.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1160.  clear      set        don't stamp, but propagate existing
  1161.                        value
  1162.  
  1163.  
  1164. ΓòÉΓòÉΓòÉ 4.8. FSD Calling Conventions and Requirements ΓòÉΓòÉΓòÉ
  1165.  
  1166. Calling conventions between FS router, FSD, and FS helpers are: 
  1167.  
  1168.  o Arguments will be pushed in left-to-right order onto the stack. 
  1169.  
  1170.  o The callee is responsible for cleaning up the stack. 
  1171.  
  1172.  o Registers DS, SI, DI, BP, SS, SP are preserved. 
  1173.  
  1174.  o Return conditions appear in AX with the convention that AX == 0 indicates 
  1175.    successful completion. AX != 0 indicates an error with the value of AX being 
  1176.    the error code. 
  1177.  
  1178.  Interrupts must ALWAYS be enabled and the direction flag should be presumed to 
  1179.  be undefined. Calls to the FS helpers will change the direction flag at will. 
  1180.  
  1181.  In OS/2, file system drivers are always called in kernel protect mode. This 
  1182.  has the advantage of allowing the FSD to execute code without having to 
  1183.  account for preemption; no preemption occurs when in kernel mode. While this 
  1184.  greatly simplifies FSD structure, it forces the FSD to yield the CPU when 
  1185.  executing long segments of code. In particular, an FSD must not hold the CPU 
  1186.  for more than 2 milliseconds at a time. The FSD helper FSH_YIELD is provided 
  1187.  so that FSDs may relinquish the CPU. 
  1188.  
  1189.  File system drivers cannot have any interrupt-time activations. Because they 
  1190.  occupy high, movable, and swappable memory, there is no guarantee of 
  1191.  addressability of the memory at interrupt time. 
  1192.  
  1193.  Each FS service routine may block. 
  1194.  
  1195.  
  1196. ΓòÉΓòÉΓòÉ 4.8.1. Error Codes ΓòÉΓòÉΓòÉ
  1197.  
  1198. FSDs should use existing error codes when possible. New error codes must be in 
  1199. the range reserved for FSDs. The FS_FSCTL interface must support returning 
  1200. information about new error codes. 
  1201.  
  1202. The set of error codes for errors general to all FSDs is 0xEE00 - 0xEEFF. The 
  1203. following errors have been defined: 
  1204.  
  1205.  o ERROR_VOLUME_NOT_MOUNTED = 0xEE00 - the FSD did not recognize the volume. 
  1206.  
  1207.  The set of error codes which are defined by each FSD is 0xEF00 - 0xFEFF. 
  1208.  
  1209.  
  1210. ΓòÉΓòÉΓòÉ 5. FS Service Routines ΓòÉΓòÉΓòÉ
  1211.  
  1212. The following table summarizes the entry points that make up the interface 
  1213. between the kernel and the FSD. 
  1214.  
  1215. Note:  Names must be in all upper case, as required by OS/2 naming conventions. 
  1216.  
  1217.  
  1218.  FS Entry Point       Description                         FSDs Required
  1219.                                                           to export
  1220.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1221.  FS_ALLOCATEPAGESPACE Adjust the size of paging file      PAGE I/O
  1222.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1223.  FS_ATTACH            Attach to an FSD                    ALL
  1224.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1225.  FS_CANCELLOCKREQUEST Cancel file record lock request     FILE I/O
  1226.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1227.  FS_CHDIR             Change/Verify directory path        ALL
  1228.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1229.  FS_CHGFILEPTR        Move a file's position pointer      ALL
  1230.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1231.  FS_CLOSE             Release a file handle               ALL
  1232.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1233.  FS_COMMIT            Flush a file's buffer to disk       ALL
  1234.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1235.  FS_COPY              Copy a file                         ALL
  1236.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1237.  FS_DELETE            Delete a file                       ALL
  1238.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1239.  FS_DOPAGEIO          Perform paging I/O operations       PAGE I/O
  1240.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1241.  FS_EXIT              End of a process cleanup            ALL
  1242.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1243.  FS_FILEATTRIBUTE     Query/Set file's attributes         ALL
  1244.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1245.  FS_FILEINFO          Query/Set file's information        ALL
  1246.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1247.  FS_FILEIO            Multi-function file I/O             ALL
  1248.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1249.  FS_FILELOCKS         Request a file record lock/unlock   FILE I/O
  1250.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1251.  FS_FINDCLOSE         Directory search close              ALL
  1252.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1253.  FS_FINDFIRST         Find first matching filename        ALL
  1254.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1255.  FS_FINDFROMNAME      Find matching filename from name    ALL
  1256.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1257.  FS_FINDNEXT          Find next matching filename         ALL
  1258.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1259.  FS_FINDNOTIFYCLOSE   Close FindNotify handle             ALL
  1260.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1261.  FS_FINDNOTIFYFIRST   Monitor a directory for changes     ALL
  1262.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1263.  FS_FINDNOTIFYNEXT    Resume reporting directory changes  ALL
  1264.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1265.  FS_FLUSHBUF          Commit file buffers to disk         ALL
  1266.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1267.  FS_FSCTL             File system control                 ALL
  1268.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1269.  FS_FSINFO            Query/Set file system information   ALL
  1270.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1271.  FS_INIT              FSD initialization                  ALL
  1272.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1273.  FS_IOCTL             I/O device control                  ALL
  1274.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1275.  FS_MKDIR             Make a directory                    ALL
  1276.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1277.  FS_MOUNT             Mount/unmount volumes               ALL
  1278.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1279.  FS_MOVE              Move a file or subdirectory         ALL
  1280.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1281.  FS_NEWSIZE           Change a file's logical size        ALL
  1282.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1283.  FS_NMPIPE            Do a named pipe operation           ALL
  1284.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1285.  FS_OPENCREATE        Open/create/replace files           ALL
  1286.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1287.  FS_OPENPAGEFILE      Create paging file and handle       PAGE I/O
  1288.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1289.  FS_PATHINFO          Query/Set a file's information      ALL
  1290.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1291.  FS_PROCESSNAME       FSD unique name canonicalization    ALL
  1292.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1293.  FS_READ              Read data from a file               ALL
  1294.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1295.  FS_RMDIR             Remove a subdirectory               ALL
  1296.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1297.  FS_SETSWAP           Notification of swapfile ownership  ALL
  1298.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1299.  FS_SHUTDOWN          Shutdown file system                ALL
  1300.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1301.  FS_VERIFYUNCNAME     Verify UNC server ownership         UNC
  1302.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1303.  FS_WRITE             Write data to a file                ALL
  1304.  
  1305. Each FS entry point has a distinct parameter list composed of those parameters 
  1306. needed by that particular entry. Parameters include: 
  1307.  
  1308.  o File pathname 
  1309.  o Current disk/directory information 
  1310.  o Open file information 
  1311.  o Application data buffers 
  1312.  o Descriptions of file extended attributes 
  1313.  o Other parameters specific to an individual call 
  1314.  
  1315.  Most of the FS entry points have a level parameter for specifying the level of 
  1316.  information they are provided or have to supply. FSDs must provide for 
  1317.  additional levels which may be added in future versions of OS/2 by returning 
  1318.  ERROR_NOT_SUPPORTED for any level they do not recognize. 
  1319.  
  1320.  File system drivers which support hierarchical directory structures must use 
  1321.  '\' and '/' as path name component separators. File system drivers which do 
  1322.  not support hierarchical directory structures must reject as illegal any use 
  1323.  of '\' or '/' in path names. The file names '.' and '..' are reserved for use 
  1324.  in hierarchical directory structures for the current directory and the parent 
  1325.  of the current directory, respectively. 
  1326.  
  1327.  Unless otherwise specified in the descriptions below, data buffers may be 
  1328.  accessed without concern for the accessibility of the data. OS/2 will either 
  1329.  check buffers for accessibility and lock them, or transfer them into locally 
  1330.  accessible data areas. 
  1331.  
  1332.  Simple parameters will be verified by the IFS router before the FS service 
  1333.  routine is called. 
  1334.  
  1335.  Note:  New with 2.0, some entry points need only be exported and supported by 
  1336.  those FSDs which desire to service the pager (PAGE I/0), UNC servers (UNC) 
  1337.  and/or file locking (FILE I/O). With these new entry point groups, a FSD must 
  1338.  export all or none of the entry points within a particular group. 
  1339.  
  1340.  These optional entry points are: 
  1341.  
  1342.   FS_ALLOCATEPAGESPACE    (PAGE I/O)
  1343.   FS_CANCELLOCKREQUEST    (FILE I/O)
  1344.   FS_DOPAGEIO             (PAGE I/O)
  1345.   FS_FILELOCKS            (FILE I/O)
  1346.   FS_OPENPAGEFILE         (PAGE I/O)
  1347.   FS_VERIFYUNCNAME        (UNC)
  1348.  
  1349.  
  1350. ΓòÉΓòÉΓòÉ 5.1. FS_ALLOCATEPAGESPACE - Adjust the size of paging file ΓòÉΓòÉΓòÉ
  1351.  
  1352. Purpose 
  1353.  
  1354. Changes the size the paging file on disk. 
  1355.  
  1356. Calling Sequence 
  1357.  
  1358. int far pascal FS_ALLOCATEPAGESPACE(psffsi, psffsd, ulsize, ulWantContig)
  1359.  
  1360. struct sffsi far * psffsi;
  1361. struct sffsd far * psffsd;
  1362. unsigned long ulsize;
  1363. unsigned short ulWantContig;
  1364.  
  1365. Where 
  1366.  
  1367.  psffsi              is a pointer to the file-system-independent portion of an 
  1368.                      open file instance. 
  1369.  
  1370.  psffsd              is a pointer to the file-system-dependent portion of an 
  1371.                      open file instance. 
  1372.  
  1373.  ulsize              is the desired new size of the paging file. If the new 
  1374.                      size is smaller than the current size, the excess space is 
  1375.                      released. If the new size is larger than the current size, 
  1376.                      the requested size is allocated. 
  1377.  
  1378.  ulWantContig        indicates the minimum contiguity requirement (in bytes). 
  1379.  
  1380.  Remarks 
  1381.  
  1382.  ulWantContig is a demand for contiguity. If ulWantContig is non-zero(0), the 
  1383.  FSD must allocate any space in the swap file that is not contiguous in 
  1384.  ulWantContig chunks on ulWantContig boundaries. If it is not possible to grow 
  1385.  the file to ulSize bytes meeting the ulWantContig requirement, the operation 
  1386.  should fail. If the file is being shrunk ulWantContig is irrelevant and should 
  1387.  be ignored. 
  1388.  
  1389.  FSDs that support the paging I/O interface should be expected to be sensible 
  1390.  in allocating page space. In particular, they are expected to always attempt 
  1391.  to allocate space such that ulWantContig sized blocks on ulWantContig 
  1392.  boundaries are physically contiguous on disk, and to keep the page file as a 
  1393.  whole contiguous as possible. 
  1394.  
  1395.  
  1396. ΓòÉΓòÉΓòÉ 5.2. FS_ATTACH - Attach to an FSD ΓòÉΓòÉΓòÉ
  1397.  
  1398. Purpose 
  1399.  
  1400. Attach or detach a remote drive or pseudo-device to an FSD. 
  1401.  
  1402. Calling Sequence 
  1403.  
  1404. int far pascal FS_ATTACH(flag, pDev, pvpfsd, pcdfsd, pParm, pLen)
  1405.  
  1406. unsigned short flag;
  1407. char far * pDev;
  1408. struct vpfsd far * pvpfsd;
  1409. struct cdfsd far * pcdfsd;
  1410. char far * pParm;
  1411. unsigned short far * pLen;
  1412.  
  1413. Where 
  1414.  
  1415.  flag                indicates attach or detach: 
  1416.  
  1417.                      flag == 0 requests an attach. The FSD is being called to 
  1418.                      attach a specified driver or character device. 
  1419.                      flag == 1 requests a detach. 
  1420.                      flag == 2 requests the FSD to fill in the specified buffer 
  1421.                      with attachment information. 
  1422.  
  1423.  pDev                is a pointer to the ASCIIZ text of either the driver 
  1424.                      (driver letter followed by a colon) or to the character 
  1425.                      device (must be \DEV\device) that is being attached, 
  1426.                      detached, or queried. The FSD does not need to verify this 
  1427.                      pointer. 
  1428.  
  1429.  tpvpfsd             is a pointer to a data structure containing 
  1430.                      file-system-dependent volume parameter information. When 
  1431.                      an attach/detach/query of a character device is requested, 
  1432.                      this pointer is NULL. When attaching a drive, this 
  1433.                      structure contains no data and is available for the FSD to 
  1434.                      store information needed to manage the remote drive. All 
  1435.                      subsequent FSD calls have access to the hVPB in one of the 
  1436.                      structures passed in, so the FSD has access to this 
  1437.                      structure by using FSH_GETVOLPARMS. This structure will 
  1438.                      have its contents as the FSD had left them. When detaching 
  1439.                      or querying a drive, this structure contains the data as 
  1440.                      the FSD left them. 
  1441.  
  1442.  pcdfsd              is a pointer to a data structure containing file-system 
  1443.                      dependent working directory information for drives. When 
  1444.                      attaching a drive, this structure contains no data and is 
  1445.                      available for the FSD to store information needed to 
  1446.                      manage the working directory. All subsequent FSD calls 
  1447.                      generated by API calls that reference this drive are 
  1448.                      passed a pointer to this structure with contents left as 
  1449.                      the FSD left them. When detaching or querying a drive, 
  1450.                      this structure contains the data as the FSD left them. For 
  1451.                      character devices, pcdfsd points to a DWORD. When a device 
  1452.                      is attached, the DWORD contains no data, and can be used 
  1453.                      by the FSD to store a reference to identify the device 
  1454.                      later on during FS_OPENCREATE, when it is passed in to the 
  1455.                      FSD. When detaching or querying the device, this DWORD 
  1456.                      contains the data as the FSD left them. 
  1457.  
  1458.  pParm               is the address of the application parameter area. 
  1459.  
  1460.                      When an attach is requested, this will point to the 
  1461.                      API-specified user data block that contains information 
  1462.                      regarding the attach operation (for example, passwords). 
  1463.                      For a query, the OS/2 kernel will fill in part of the 
  1464.                      buffer, adjust the pointer, and call the FSD to fill in 
  1465.                      the rest (see the structures returned by DosQFSAttach; 
  1466.                      pParm will point to cbFSAData; the FSD should fill in 
  1467.                      cbFSAData and rgFSAData.) 
  1468.  
  1469.                      Addressing of this data area is not validated by the OS/2 
  1470.                      kernel. pParm must be verified, even in the query case. 
  1471.                      The FSD verifies this parameter by calling the FS helper 
  1472.                      routine FSH_PROBEBUF. 
  1473.  
  1474.  pLen                is the pointer to the length of the application parameter 
  1475.                      area. For attach, this points to the length of the 
  1476.                      application data buffer. For query, this is the length of 
  1477.                      the remaining space in the application data buffer. Upon 
  1478.                      filling in the buffer, the FSD will set this to the length 
  1479.                      of the data returned. If the data returned is longer than 
  1480.                      the data buffer length, the FSD sets this value to be the 
  1481.                      length of the data that query could return. In this case, 
  1482.                      the FSD also returns a BUFFER OVERFLOW error. 
  1483.  
  1484.                      The FSD does not need to verify this pointer. 
  1485.  
  1486.  Remarks 
  1487.  
  1488.  Local FSDs will never get called with attempts to attach or detach drives or 
  1489.  queries about drives. 
  1490.  
  1491.  For remote FSDs called to do a detach, the kernel does not do any checking to 
  1492.  see if there are any open references on the drive (for example, open or search 
  1493.  references). It is entirely up to the FSD to decide whether it should allow 
  1494.  the detach operation. 
  1495.  
  1496.  
  1497. ΓòÉΓòÉΓòÉ 5.3. FS_CANCELLOCKREQUEST - Cancel file record lock request ΓòÉΓòÉΓòÉ
  1498.  
  1499. Purpose 
  1500.  
  1501. Cancels an outstanding FS_FILELOCKS request on a file. 
  1502.  
  1503. Calling Sequence 
  1504.  
  1505. int far pascal FS_CANCELLOCKREQUEST(psffsi, psffsd, pLockRange)
  1506.  
  1507. struct sffsi far * psffsi;
  1508. struct sffsd far * psffsd;
  1509. struct filelock far * pLockRange;
  1510.  
  1511. Where 
  1512.  
  1513.  psffsi              is a pointer to the file-system-independent portion of an 
  1514.                      open file instance. 
  1515.  
  1516.  psffsd              is a pointer to the file-system-dependent portion of an 
  1517.                      open file instance. 
  1518.  
  1519.  pLockRange          is a pointer to a filelock structure. The filelock 
  1520.                      structure has the following format: 
  1521.  
  1522.                                           struct FileLock {
  1523.                                               unsigned long FileOffset;   /* offset where the lock/unlock begins  */
  1524.                                               unsigned long RangeLength;  /* length of region locked/unlocked     */
  1525.                                           }
  1526.  
  1527.  Remarks 
  1528.  
  1529.  This entry point was added to support the 32-bit DosCancelLockRequest API. 
  1530.  
  1531.  This function provides a simple mechanism for canceling the lock range request 
  1532.  of an outstanding FS_FILELOCKS call. If two threads in a process are blocked 
  1533.  on a lock range and a cancel request is issued by another thread, both blocked 
  1534.  threads will be released. 
  1535.  
  1536.  
  1537. ΓòÉΓòÉΓòÉ 5.4. FS_CHDIR - Change/Verify Directory Path ΓòÉΓòÉΓòÉ
  1538.  
  1539. Purpose 
  1540.  
  1541. Change or verify the directory path for the requesting process 
  1542.  
  1543. Calling Sequence 
  1544.  
  1545. int far pascal FS_CHDIR(flag, pcdfsi, pcdfsd, pDir, iCurDirEnd)
  1546.  
  1547. unsigned short flag;
  1548. struct cdsfi far * pcdfsi;
  1549. struct cdfsd far * pcdfsd;
  1550. char far * pDir;
  1551. unsigned short iCurDirEnd;
  1552.  
  1553. Where 
  1554.  
  1555.  flag                indicates what action is to be taken on the directory. 
  1556.  
  1557.                      flag == 0 indicates that an explicit directory-change 
  1558.                      request has been made. 
  1559.                      flag == 1 indicates that the working directory needs to be 
  1560.                      verified. 
  1561.                      flag == 2 indicates that this reference to a directory is 
  1562.                      being freed. 
  1563.  
  1564.                      The flag passed to the FSD will have a valid value. 
  1565.  
  1566.  pcdfsi              is a pointer to a file-system-independent working 
  1567.                      directory structure. 
  1568.  
  1569.                      For flag == 0, this pointer points to the previous current 
  1570.                      directory on the drive. 
  1571.                      For flag == 1, this pointer points to the most recent 
  1572.                      working directory on the drive. The cdi_curdir field 
  1573.                      contains the text of the directory that is to be verified. 
  1574.                      For flag == 2, this pointer is null. 
  1575.  
  1576.                      The FSD must never modify the cdfsi. The OS/2 kernel 
  1577.                      handles all updates. 
  1578.  
  1579.  pcdfsd              is a pointer to a file-system-dependent working directory 
  1580.                      structure. 
  1581.  
  1582.                      This is a place for the FSD to store information about the 
  1583.                      working directory. For flag == 0 or 1, this is the 
  1584.                      information left there by the FSD. The FSD is expected to 
  1585.                      update this information if the directory exists. For flag 
  1586.                      == 2, this is the information left there by the FSD. 
  1587.  
  1588.  pDir                is a pointer to directory text. 
  1589.  
  1590.                      For flag == 0, this is the pointer to the directory.  For 
  1591.                      flag == 1 or flag == 2, this pointer is null. The FSD does 
  1592.                      not need to verify this pointer. 
  1593.  
  1594.  iCurDirEnd          is the index of the end of the current directory in pDir. 
  1595.  
  1596.                      This is used to optimize FSD path processing. If 
  1597.                      iCurDirEnd == -1, there is no current directory relevant 
  1598.                      to the directory text, that is, a device. This parameter 
  1599.                      only has meaning for flag == 0. 
  1600.  
  1601.  Remarks 
  1602.  
  1603.  The FSD should cache no information when the directory is the root. Root 
  1604.  directories are a special case. They always exist, and never need validation. 
  1605.  The OS/2 kernel does not pass root directory requests to the FSD. An FSD is 
  1606.  not allowed to cache any information in the cdfsd data structure for a root 
  1607.  directory. Under normal conditions, the kernel does not save the CDS for a 
  1608.  root directory and builds one from scratch when it is needed. (One exception 
  1609.  is where a validate CDS fails, and the kernel sets it to the root, and zeroes 
  1610.  out the cdfsd data structure. This CDS is saved and is cleaned up later.) 
  1611.  
  1612.  The following is information about the exact state of the cdfsi and cdfsd data 
  1613.  structures passed to the FSD for each flag value and guidelines about what an 
  1614.  FSD should do upon receiving an FS_CHDIR call: 
  1615.  
  1616.   IF (flag == 0)     /* Set new Current Directory */
  1617.      pcdfsi, pcdfsd = copy of CDS we're starting from; may be useful as starting
  1618.                       point for verification.
  1619.  
  1620.              cdfsi contents:
  1621.  
  1622.                 hVPB - handle of Volume Parameter Block mapped to this drive
  1623.  
  1624.                 end - end of root portion of CurDir
  1625.  
  1626.                 flags - various flags (indicating state of cdfsd)
  1627.  
  1628.                 IsValid - cdfsd is unknown format (ignore contents)
  1629.                           IsValid == 0x80
  1630.  
  1631.                 IsRoot - cdfsd is meaningless if CurDir = root (not kept)
  1632.                           IsRoot == 0x40
  1633.  
  1634.                 IsCurrent - cdfsd is know format, but may not be current (medium
  1635.                             may have been changed).
  1636.                             IsCurrent == 0x20
  1637.  
  1638.                 text - Current Directory Text
  1639.  
  1640.      icurdir = if Current Directory is in the path of the new Current Directory,
  1641.                this is the index to the end of the Current Directory. If not,
  1642.                this is -1 (Current Directory does not apply).
  1643.  
  1644.      pDir = path to verify as legal directory
  1645.  
  1646.   THEN
  1647.  
  1648.      Validate path named in pDir.
  1649.          /* This means both that it exists AND that it is a directory.  pcdfsi,
  1650.             pcdfsd, icurdir give old CDS, which may allow optimization */
  1651.  
  1652.      IF (Validate succeeds)
  1653.         IF (pDir != ROOT)
  1654.            Store any cache information in area pointed to by pcdfsd.
  1655.         ELSE
  1656.            Do Nothing.
  1657.            /* Area pointed to by pcdfsd will be thrown away, so don't bother
  1658.               storing into it */
  1659.            Return success.
  1660.       ELSE
  1661.         Return failure.
  1662.         /* Kernel will create new CDS using pDir data and pcdfsd data. If the
  1663.            old CDS is valid, the kernel will take care of cleaning it up. The
  1664.            FSD must not edit any structure other than the *Pcdfsd area, with
  1665.            which it may do as it chooses. */
  1666.   /* flag == 0 */
  1667.   ELSE
  1668.   IF (flag == 1)       /* Validate current CDS structure */
  1669.  
  1670.      pcdfsi = pointer to copy of cdfsi of interest.
  1671.  
  1672.      pcdfsd = pointer to copy of cdfsd. Flags in cdfsi indicate the state of
  1673.               this cdfsd. It may be: (1) completely invalid (unknown
  1674.               format), (2) known format, but non-current information,
  1675.               (3) completely valid, or (4) all zero (root).
  1676.  
  1677.   THEN
  1678.  
  1679.       Validate that CDS still describes a legal directory (using cdi_text).
  1680.  
  1681.       IF (valid)
  1682.          Update cdfsd if necessary.
  1683.          Return success.
  1684.          /* kernel will copy cdfsd into real CDS */
  1685.       ELSE
  1686.          IF (cdi_isvalid)
  1687.             Release any resources associated with cdfsd.
  1688.             /* kernel will force Current Directory to root, and will zero out
  1689.                cdfsd in real CDS */
  1690.             Return failure.
  1691.       /* The FSD must not modify any structure other than the cdfsd pointed to by
  1692.          pcdfsd.  */
  1693.   ELSE
  1694.   IF (flag == 2)   /* previous CDS no longer in use; being freed */
  1695.  
  1696.      pcdfsd = pointer to copy of cdfsd of CDS being freed.
  1697.  
  1698.   THEN
  1699.  
  1700.      Release any resources associated with the CDS.
  1701.      /* For example, if cdfsd (where pcdfsd points) contains a pointer to
  1702.         some FSD private structure associated with the CDS, that structure
  1703.         should be freed. */
  1704.  
  1705.   /* kernel will not retain the cdfsd */
  1706.  
  1707.  
  1708. ΓòÉΓòÉΓòÉ 5.5. FS_CHGFILEPTR - Move a file's position pointer ΓòÉΓòÉΓòÉ
  1709.  
  1710. Purpose 
  1711.  
  1712. Move a file's logical read/write position pointer. 
  1713.  
  1714. Calling Sequence 
  1715.  
  1716. int far pascal FS_CHGFILEPTR(psffsi, psffsd, offset, type, IOflag)
  1717.  
  1718. struct sffsi far * psffsi;
  1719. struct sffsd far * psffsd;
  1720. long offset;
  1721. unsigned short type;
  1722. unsigned short IOflag;
  1723.  
  1724. Where 
  1725.  
  1726.  psffsi              is a pointer to the file-system-independent portion of an 
  1727.                      open file instance. 
  1728.  
  1729.                      The FSD uses the current file size or sfi_position along 
  1730.                      with offset and type to compute a new sfi_position. This 
  1731.                      is updated by the system. 
  1732.  
  1733.  psffsd              is a pointer to the file-system-dependent portion of an 
  1734.                      open file instance. The FSD may store or adjust data as 
  1735.                      appropriate in this structure. 
  1736.  
  1737.  offset              is the signed offset to be added to the current file size 
  1738.                      or position to form the new position within the file. 
  1739.  
  1740.  type                indicates the basis of a seek operation. 
  1741.  
  1742.                      type == 0 indicates seek relative to beginning of file. 
  1743.                      type == 1 indicates seek relative to current position 
  1744.                      within the file. 
  1745.                      type == 2 indicates seek relative to end of file. 
  1746.  
  1747.                      The value of type passed to the FSD will be valid. 
  1748.  
  1749.  IOflag              indicates information about the operation on the handle. 
  1750.  
  1751.                      IOflag == 0x0010 indicates write-through. 
  1752.                      IOflag == 0x0020 indicates no-cache. 
  1753.  
  1754.  Remarks 
  1755.  
  1756.  The file system may want to take the seek operation as a hint that an I/O 
  1757.  operation is about to take place at the new position and initiate a 
  1758.  positioning operation on sequential access media or read-ahead operation on 
  1759.  other media. 
  1760.  
  1761.  Some DOS mode programs expect to be able to do a negative seek. OS/2 passes 
  1762.  these requests on to the FSD and returns an error for OS/2 mode negative seek 
  1763.  requests. Because a seek to a negative position is, effectively, a seek to a 
  1764.  very large offset, it is suggested that the FSD return end-of-file for 
  1765.  subsequent read requests. 
  1766.  
  1767.  FSDs must allow seeks to positions beyond end-of-file. 
  1768.  
  1769.  The information passed in IOflag is what was set for the handle during a 
  1770.  DosOpen/DosOpen2 operation, or by a DosSetFHandState call. 
  1771.  
  1772.  
  1773. ΓòÉΓòÉΓòÉ 5.6. FS_CLOSE - Close a file. ΓòÉΓòÉΓòÉ
  1774.  
  1775. Purpose 
  1776.  
  1777. Closes the specified file handle. 
  1778.  
  1779. Calling Sequence 
  1780.  
  1781. int far pascal FS_CLOSE(type, IOflag, psffsi, psffsd)
  1782.  
  1783. unsigned short type;
  1784. unsigned short IOflag;
  1785. struct sffsi far * psffsi;
  1786. struct sffsd far * psffsd;
  1787.  
  1788. Where 
  1789.  
  1790.  type                indicates what type of a close operation this is. 
  1791.  
  1792.                      type == 0 indicates that this is not the final close of 
  1793.                      the file or device. 
  1794.                      type == 1 indicates that this is the final close of this 
  1795.                      file or device for this process. 
  1796.                      type == 2 indicates that this is the final close for this 
  1797.                      file or device for the system. 
  1798.  
  1799.  IOflag              indicates information about the operation on the handle. 
  1800.  
  1801.                      IOflag == 0x0010 indicates write-through. 
  1802.                      IOflag == 0x0020 indicates no-cache. 
  1803.  
  1804.  psffsi              is a pointer to the file-system-independent portion of an 
  1805.                      open file instance. 
  1806.  
  1807.  psffsd              is a pointer to the file-system-dependent portion of an 
  1808.                      open file instance. 
  1809.  
  1810.  Remarks 
  1811.  
  1812.  This entry point is called on the every close of a file or device. 
  1813.  
  1814.  Any reserved resources for this instance of the open file may be released It 
  1815.  may be assumed that all open files will be closed at process termination. That 
  1816.  is, this entry point will always be called at process termination for any 
  1817.  files or devices open for the process. 
  1818.  
  1819.  A close operation should be interpreted by the FSD as meaning that the file 
  1820.  should be committed to disk as appropriate. 
  1821.  
  1822.  Of the information passed in IOflag, the write-through bit is a mandatory bit 
  1823.  in that any data written to the block device must be put out on the medium 
  1824.  before the device driver returns. The no-cache bit, on the other hand, is an 
  1825.  advisory bit that says whether the data being transferred is worth caching or 
  1826.  not. 
  1827.  
  1828.  
  1829. ΓòÉΓòÉΓòÉ 5.7. FS_COMMIT - Commit a file's buffers to Disk ΓòÉΓòÉΓòÉ
  1830.  
  1831. Purpose 
  1832.  
  1833. Flush requesting process's cache buffers and update directory information for 
  1834. the file handle. 
  1835.  
  1836. Calling Sequence 
  1837.  
  1838. int far pascal FS_COMMIT(type, IOflag, psffsi, psffsd)
  1839.  
  1840. unsigned short type;
  1841. unsigned short IOflag;
  1842. struct sffsi far * psffsi;
  1843. struct sffsd far* psffsd;
  1844.  
  1845. Where 
  1846.  
  1847.  type                indicates what type of a commit operation this is. 
  1848.  
  1849.                      type == 1 indicates that this is a commit for a specific 
  1850.                      handle. This type is specified if FS_COMMIT is called for 
  1851.                      a DosBufReset of a specific handle. 
  1852.  
  1853.                      type == 2 indicates that this is a commit due to a 
  1854.                      DosBufReset (-1). 
  1855.  
  1856.  IOflag              indicates information about the operation on the handle. 
  1857.  
  1858.                      IOflag == 0x0010 indicates write-through. 
  1859.                      IOflag == 0x0020 indicates no-cache. 
  1860.  
  1861.  psffsi              is a pointer to the file-system-independent portion of an 
  1862.                      open file instance. 
  1863.  
  1864.  psffsd              is a pointer to the file-system-dependent portion of an 
  1865.                      open file instance. 
  1866.  
  1867.  Remarks 
  1868.  
  1869.  This entry point is called only as a result of a DosBufReset function call. 
  1870.  OS/2 reserves the right to call FS_COMMIT even if no changes have been made to 
  1871.  the file. 
  1872.  
  1873.  For DosBufReset (-1), FS_COMMIT will be called for each open handle on the 
  1874.  FSD. 
  1875.  
  1876.  The FSD should update access and modification times, if appropriate. 
  1877.  
  1878.  Any locally cached information about the file must be output to the media. The 
  1879.  directory entry for the file is to be updated from the sffsi and sffsd data 
  1880.  structures. 
  1881.  
  1882.  Since mini-FSDs used to boot IFSs are read-only file systems, they need not 
  1883.  support the FS_COMMIT call. 
  1884.  
  1885.  Of the information passed in IOflag, the write-through bit is a MANDATORY bit 
  1886.  in that any data written to the block device must be put out on the medium 
  1887.  before the device driver returns. The no-cache bit, on the other hand, is an 
  1888.  advisory bit that says whether the data being transferred is worth caching or 
  1889.  not. 
  1890.  
  1891.  The FSD should copy all supported time stamps from the SFT to the disk. Beware 
  1892.  that the last read time stamp may need to be written to the disk even though 
  1893.  the file is clean. After this is done, the FSD should clear the sfi_tstamp 
  1894.  field to avoid having to write to the disk again if the user calls commit 
  1895.  repeatedly without changing any of the time stamps. 
  1896.  
  1897.  If the disk is not writeable and only the last read time stamp has changed, 
  1898.  the FSD should either issue a warning or ignore the error. This relieves the 
  1899.  user from having to un-protect an FSD floppy disk in order to read the files 
  1900.  on it. 
  1901.  
  1902.  
  1903. ΓòÉΓòÉΓòÉ 5.8. FS_COPY - Copy a file ΓòÉΓòÉΓòÉ
  1904.  
  1905. Purpose 
  1906.  
  1907. Copy a specified file or subdirectory to a specified target. 
  1908.  
  1909. Calling Sequence 
  1910.  
  1911. int far pascal FS_COPY(flag, pcdfsi, pcdfsd, pSrc, iSrcCurDirEnd, pDst,
  1912.                        iDstCurDirEnd, nameType)
  1913.  
  1914. unsigned short flag;
  1915. struct cdfsi far * pcdfsi;
  1916. struct cdfsd far * pcdfsd;
  1917. char far * pSrc;
  1918. unsigned short iSrcCurDirEnd;
  1919. char far * pDst; unsigned short iDstCurDirEnd;
  1920. unsigned short nameType;
  1921.  
  1922. Where 
  1923.  
  1924.  flag                is a bit mask controlling copy 
  1925.  
  1926.                      0x0001 specifies that an existing target file/directory 
  1927.                      should be replaced 
  1928.                      0x0002 specifies that a source file will be appended to 
  1929.                      the destination file. 
  1930.                      All other bits are reserved. 
  1931.  
  1932.                      (See the description of the DosCopy function call in the 
  1933.                      OS/2 Version 2.0 Control Program Programming Reference.) 
  1934.  
  1935.  pcdfsi              is a pointer to the file-system-independent working 
  1936.                      directory structure. 
  1937.  
  1938.  pcdfsd              is a pointer to the file-system-dependent working 
  1939.                      directory structure. 
  1940.  
  1941.  pSrc                is a pointer to the ASCIIZ name of the source 
  1942.                      file/directory. 
  1943.  
  1944.  iSrcCurDirEnd       is the index of the end of the current directory in pSrc. 
  1945.                      If = -1, there is no current directory relevant to the 
  1946.                      source name. 
  1947.  
  1948.  pDst                is a pointer to the ASCIIZ name of the destination 
  1949.                      file/directory. 
  1950.  
  1951.  iDstCurDirEnd       is the index of the end of the current directory in pDst. 
  1952.                      If = -1, there is no current directory relevant to the 
  1953.                      destination name. 
  1954.  
  1955.  nameType            indicates the destination name type. 
  1956.  
  1957.                      NameType == 0x0040 indicates non-8.3 filename format. All 
  1958.                      other values are reserved. 
  1959.  
  1960.  Remarks 
  1961.  
  1962.  The file specified in the source file name should be copied to the target file 
  1963.  if possible. 
  1964.  
  1965.  The files specified may not be currently open. File system drivers must assure 
  1966.  consistency of file allocation information and directory entries. 
  1967.  
  1968.  The file system driver returns the special CANNOT COPY error if it cannot 
  1969.  perform the copy because: 
  1970.  
  1971.  o it does not know how 
  1972.  o the source and target are on different volumes 
  1973.  o of any other reason for which it would make sense for its caller to perform 
  1974.    the copy operation manually. 
  1975.  
  1976.  Returning ERROR_CANNOT_COPY indicates to its caller that it should attempt to 
  1977.  perform the copy operation manually. Any other error will be returned directly 
  1978.  to the caller of DosCopy. See the description of the DosCopy function call in 
  1979.  the OS/2 Version 2.0 Control Program Programming Reference for other error 
  1980.  codes that can be returned. 
  1981.  
  1982.  FS_COPY needs to check that certain types of illegal copying operations are 
  1983.  not performed. A directory cannot be copied to itself or to one of its 
  1984.  subdirectories. This is especially critical in situations where two different 
  1985.  fully-qualified pathnames can refer to the same file or directory. For 
  1986.  example, if X: is redirected to \\SERVER\SHARE, the X:\PATH and 
  1987.  \\SERVER\SHARE\PATH refer to the same object. 
  1988.  
  1989.  The behavior of FS_COPY should match the behavior of the generic DosCopy 
  1990.  routine. 
  1991.  
  1992.  The non-8.3 filename format attribute in the directory entry for the 
  1993.  destination name should be set according to the value in nameType. 
  1994.  
  1995.  
  1996. ΓòÉΓòÉΓòÉ 5.9. FS_DELETE - Delete a file ΓòÉΓòÉΓòÉ
  1997.  
  1998. Purpose 
  1999.  
  2000. Removes a directory entry associated with a filename. 
  2001.  
  2002. Calling Sequence 
  2003.  
  2004. int far pascal FS_DELETE(pcdfsi, pcdfsd, pFile, iCurDirEnd)
  2005.  
  2006. struct cdfsi far * pcdfsi;
  2007. struct cdfsd far * pcdfsd;
  2008. char far * pFile;
  2009. unsigned short iCurDirEnd;
  2010.  
  2011. Where 
  2012.  
  2013.  pcdfsi              is a pointer to the file-system-independent working 
  2014.                      directory structure. 
  2015.  
  2016.  pcdfsd              is a pointer to the file-system-dependent working 
  2017.                      directory structure. 
  2018.  
  2019.  pFile               is a pointer to the ASCIIZ name of the file or directory. 
  2020.                      The FSD does not need to validate this pointer. 
  2021.  
  2022.  iCurDirEnd          is the index of the end of the current directory in pFile. 
  2023.  
  2024.                      This is used to optimize FSD path processing. If 
  2025.                      iCurDirEnd == -1, there is no current directory relevant 
  2026.                      to the name text, that is, a device. 
  2027.  
  2028.  Remarks 
  2029.  
  2030.  The files specified are deleted. 
  2031.  
  2032.  The deletion of a file opened in DOS mode by the same process requesting the 
  2033.  delete is supported. OS/2 calls FS_CLOSE for the file before calling 
  2034.  FS_DELETE. 
  2035.  
  2036.  The file name may not contain wildcard characters. 
  2037.  
  2038.  
  2039. ΓòÉΓòÉΓòÉ 5.10. FS_DOPAGEIO - Perform paging I/O operations ΓòÉΓòÉΓòÉ
  2040.  
  2041. Purpose 
  2042.  
  2043. Performs all the I/O operations in a PageCmdList. 
  2044.  
  2045. Calling Sequence 
  2046.  
  2047. int far pascal FS_DOPAGEIO(psffsi, psffsd, pList)
  2048.  
  2049. struct sffsi far * psffsi;
  2050. struct sffsd far * psffsd;
  2051. struct PageCmdHeader far * pList;
  2052.  
  2053. Where 
  2054.  
  2055.  psffsi              is a pointer to the file-system-independent portion of an 
  2056.                      open file instance. 
  2057.  
  2058.  psffsd              is a pointer to the file-system-dependent portion of an 
  2059.                      open file instance. 
  2060.  
  2061.  pList               is a pointer to a PageCmdHeader structure. 
  2062.  
  2063.                      The PageCmdHeader structure has the following format: 
  2064.  
  2065.                                           struct PageCmdHeader {
  2066.                                               unsigned char  InFlags;      /* Input Flags                        */
  2067.                                               unsigned char  OutFlags;     /* Output Flags - must be 0 on entry  */
  2068.                                               unsigned char  OpCount;      /* Number of operations               */
  2069.                                               unsigned char  Pad;          /* Pad for DWORD alignment            */
  2070.                                               unsigned long  Reserved1;    /* Currently Unused                   */
  2071.                                               unsigned long  Reserved2;    /* Currently Unused                   */
  2072.                                               unsigned long  Reserved3;    /* Currently Unused                   */
  2073.                                               struct PageCmd PageCmdList;  /* Currently Unused                   */
  2074.                                           }
  2075.  
  2076.                      The PageCmd structure has the following format: 
  2077.  
  2078.                                           struct PageCmd {
  2079.                                               unsigned char Cmd;           /* Cmd Code (Read,Write,Verify)       */
  2080.                                               unsigned char Priority;      /* Same values as for req packets     */
  2081.                                               unsigned char Status;        /* Status byte                        */
  2082.                                               unsigned char Error;         /* I24 error code                     */
  2083.                                               unsigned long Addr;          /* Physical(0:32) or Virtual(16:16)   */
  2084.                                               unsigned long FileOffset;    /* Byte Offset in page file  */
  2085.                                           }
  2086.  
  2087.  Remarks 
  2088.  
  2089.  FS_DOPAGEIO performs all the I/O operations specified in the PageCmdList. 
  2090.  
  2091.  If the disk driver Extended Strategy requests, a request list will be built 
  2092.  from the PageCmdList and issued to the driver. 
  2093.  
  2094.  If the disk driver does not support Extended Strategy requests, the FSD can 
  2095.  either let the kernel do the emulation (See FS_OPENPAGEFILE to set this state) 
  2096.  or has the option to do the emulation itself. 
  2097.  
  2098.  For a detailed description of the Extended Strategy request interface please 
  2099.  see the OS/2 Version 2.0 Physical Device Driver Reference. 
  2100.  
  2101.  
  2102. ΓòÉΓòÉΓòÉ 5.11. FS_EXIT - End of process ΓòÉΓòÉΓòÉ
  2103.  
  2104. Purpose 
  2105.  
  2106. Release FSD resources still held after process termination. 
  2107.  
  2108. Calling Sequence 
  2109.  
  2110. void far pascal FS_EXIT(uid, pid, pdb);
  2111.  
  2112. unsigned short uid;
  2113. unsigned short pid;
  2114. unsigned short pdb;
  2115.  
  2116. Where 
  2117.  
  2118.  uid                 is the user ID of the process. This will be a valid value. 
  2119.  
  2120.  pid                 is the process ID of the process. This will be a valid 
  2121.                      value. 
  2122.  
  2123.  pdb                 is the DOS mode process ID of the process. This will be a 
  2124.                      valid value. 
  2125.  
  2126.  Remarks 
  2127.  
  2128.  Because all files are closed when a process terminates, this call is not 
  2129.  needed to release file resources. It is, however, useful if resources are 
  2130.  being held due to unterminated searches (as in searches initiated from the DOS 
  2131.  mode). 
  2132.  
  2133.  
  2134. ΓòÉΓòÉΓòÉ 5.12. FS_FILEATTRIBUTE - Query/Set File Attribute ΓòÉΓòÉΓòÉ
  2135.  
  2136. Purpose 
  2137.  
  2138. Query/Set the attribute of the specified file. 
  2139.  
  2140. Calling Sequence 
  2141.  
  2142. int far pascal FS_FILEATTRIBUTE(flag, pcdfsi, pcdfsd, pName, iCurDirEnd,
  2143.                                 pAttr)
  2144.  
  2145. unsigned short flag;
  2146. struct cdfsi far * pcdfsi;
  2147. struct cdfsd far * pcdfsd;
  2148. char far * pName;
  2149. unsigned short iCurDirEnd;
  2150. unsigned short far * pAttr;
  2151.  
  2152. Where 
  2153.  
  2154.  flag                indicates retrieval or setting of attributes, with: 
  2155.  
  2156.                      flag == 0 indicates retrieving the attribute. 
  2157.                      flag == 1 indicates setting the attribute. 
  2158.                      flag == all other values, reserved. 
  2159.  
  2160.                      The value of flag passed to the FSD will be valid. 
  2161.  
  2162.  pcdfsi              is a pointer to the file-system independent portion of an 
  2163.                      open file instance. 
  2164.  
  2165.  pcdfsd              is a pointer to the file-system dependent portion of an 
  2166.                      open file instance. 
  2167.  
  2168.  pName               is a pointer to the ASCIIZ name of the file or directory. 
  2169.  
  2170.                      The FSD does not need to validate this pointer. 
  2171.  
  2172.  iCurDirEnd          is the index of the end of the current directory in pName. 
  2173.  
  2174.                      This is used to optimize FSD path processing. If 
  2175.                      iCurDirEnd == -1, there is no current directory relevant 
  2176.                      to the name text, that is, a device. 
  2177.  
  2178.  pAttr               is a pointer to the attribute. 
  2179.  
  2180.                      For flag == 0, the FSD should store the attribute in the 
  2181.                      indicated location. 
  2182.                      For flag == 1, the FSD should retrieve the attribute from 
  2183.                      this location and set it in the file or directory. 
  2184.  
  2185.                      The FSD does not need to validate this pointer. 
  2186.  
  2187.  Remarks 
  2188.  
  2189.  None 
  2190.  
  2191.  
  2192. ΓòÉΓòÉΓòÉ 5.13. FS_FILEINFO - Query/Set a File's Information ΓòÉΓòÉΓòÉ
  2193.  
  2194. Purpose 
  2195.  
  2196. Returns information for a specific file. 
  2197.  
  2198. Calling Sequence 
  2199.  
  2200. int far pascal FS_FILEINFO(flag, psffsi, psffsd, level, pData, cbData,
  2201.                            IOflag)
  2202.  
  2203. unsigned short flag;
  2204. struct sffsi far * psffsi;
  2205. struct sffsd far * psffsd;
  2206. unsigned short level;
  2207. char far * pData;
  2208. unsigned short cbData;
  2209. unsigned short IOflag;
  2210.  
  2211. Where 
  2212.  
  2213.  flag                indicates retrieval or setting of information. 
  2214.  
  2215.                      flag == 0 indicates retrieving information. 
  2216.                      flag == 1 indicates setting information. 
  2217.                      All other values are reserved. 
  2218.  
  2219.                      The value of flag passed to the FSD will be valid. 
  2220.  
  2221.  psffsi              is a pointer to the file-system-independent portion of an 
  2222.                      open file instance. 
  2223.  
  2224.  psffsd              is a pointer to the file-system-dependent portion of an 
  2225.                      open file instance. 
  2226.  
  2227.  level               is the information level to be returned. 
  2228.  
  2229.                      Level selects among a series of data structures to be 
  2230.                      returned. 
  2231.  
  2232.  pData               is the address of the application data area. 
  2233.  
  2234.                      Addressing of this data area is validated by the kernel 
  2235.                      (see FSH_PROBEBUF). 
  2236.  
  2237.                      When retrieval (flag == 0) is specified, the FSD will 
  2238.                      place the information into the buffer. 
  2239.  
  2240.                      When outputting information to a file (flag == 1), the FSD 
  2241.                      will retrieve that data from the application buffer. 
  2242.  
  2243.  cbData              is the length of the application data area. 
  2244.  
  2245.                      For flag == 0, this is the length of the data the 
  2246.                      application wishes to retrieve. If there is not enough 
  2247.                      room for the entire level of data to be returned, the FSD 
  2248.                      will return a BUFFER OVERFLOW error. 
  2249.  
  2250.                      For flag == 1, this is the length of data to be applied to 
  2251.                      the file. 
  2252.  
  2253.  IOflag              indicates information about the operation on the handle. 
  2254.  
  2255.                      IOflag == 0x0010 indicates write-through. 
  2256.                      IOflag == 0x0020 indicates no-cache. 
  2257.  
  2258.  Remarks 
  2259.  
  2260.  If setting the time/date/DOS attributes on a file: 
  2261.  
  2262.  o Copy the new time/date/DOS attributes into the SFT 
  2263.  o Set ST_PCREAT, ST_PWRITE, and ST_PREAD 
  2264.  o Clear ST_SCREAT, ST_SWRITE, and ST_SREAD 
  2265.  
  2266.  Note:  ALSO NEW FOR 2.0, it is suggested that the FSD copy the DOS file 
  2267.  attributes from the directory entry into the SFT. This allows the FSD and the 
  2268.  OS2 kernel to handle FCB opens more efficiently. 
  2269.  
  2270.  If querying the date/time/DOS attributes on a file, simply copy the 
  2271.  date/time/DOS attributes from the directory entry into the SFT. 
  2272.  
  2273.  Of the information passed in IOflag, the write-through bit is a mandatory bit 
  2274.  in that any data written to the block device must be put out on the medium 
  2275.  before the device driver returns. The no-cache bit, on the other hand, is an 
  2276.  advisory bit that says whether the data being transferred is worth caching or 
  2277.  not. 
  2278.  
  2279.  Supported information levels are described in the OS/2 Version 2.0 Control 
  2280.  Program Programming Reference. 
  2281.  
  2282.  
  2283. ΓòÉΓòÉΓòÉ 5.14. FS_FILEIO - Multi-function file I/O ΓòÉΓòÉΓòÉ
  2284.  
  2285. Purpose 
  2286.  
  2287. Perform multiple lock, unlock, seek, read, and write I/O. 
  2288.  
  2289. Calling Sequence 
  2290.  
  2291. int far pascal FS_FILEIO (psffsi, psffsd, pCmdList, cbCmdList, poError,
  2292.                           IOflag)
  2293.  
  2294. struct sffsi far * psffsi;
  2295. struct sffsd far * psffsd;
  2296. char far * pCmdList;
  2297. unsigned short cbCmdList;
  2298. unsigned short far * poError;
  2299. unsigned short IOflag;
  2300.  
  2301. Where 
  2302.  
  2303.  psffsi              is a pointer to the file-system-independent portion of an 
  2304.                      open file instance. 
  2305.  
  2306.  psffsd              is a pointer to the file-system-dependent portion of an 
  2307.                      open file instance. 
  2308.  
  2309.  pCmdList            is a pointer to a command list that contains entries 
  2310.                      indicating what commands will be performed. 
  2311.  
  2312.                      Each individual operation (CmdLock, CmdUnlock, CmdSeek, 
  2313.                      CmdIO) is performed as atomic operations until all are 
  2314.                      complete or until one fails. CmdLock executes a multiple 
  2315.                      range lock as an atomic operation. CmdUnlock executes a 
  2316.                      multiple range unlock as an atomic operation. Unlike 
  2317.                      CmdLock, CmdUnlock cannot fail as long as the parameters 
  2318.                      to it are correct, and the calling application had done a 
  2319.                      Lock earlier, so it can be viewed as atomic. 
  2320.  
  2321.                      The validity of the user address is not verified (see 
  2322.                      FSH_PROBEBUF). 
  2323.  
  2324.                      For CmdLock, the command format is: 
  2325.  
  2326.                                           struct CmdLock {
  2327.                                               unsigned short Cmd = 0;   /* 0 for lock operations         */
  2328.                                               unsigned short LockCnt;   /* number of locks that follow   */
  2329.                                               unsigned long  TimeOut;   /* ms time-out for lock success  */
  2330.                                           }
  2331.  
  2332.                      which is followed by a series of records of the following 
  2333.                      format: 
  2334.  
  2335.                                           struct Lock {
  2336.                                               unsigned short Share = 0;   /* 0 for exclusive, 1 for read-only  */
  2337.                                               long           Start;       /* start of lock region              */
  2338.                                               long           Length;      /* length of lock region             */
  2339.                                           }
  2340.  
  2341.                      If a lock within a CmdLock causes a time-out, none of the 
  2342.                      other locks within the scope of CmdLock are in force, 
  2343.                      because the lock operation is viewed as atomic. 
  2344.  
  2345.                      CmdLock.TimeOut is the count in milliseconds, until the 
  2346.                      requesting process is to resume execution if the requested 
  2347.                      locks are not available. If CmdLock.TimeOut == 0, there 
  2348.                      will be no wait. If CmdLock.TimeOut < 0xFFFFFFFF it is the 
  2349.                      number of milliseconds to wait until the requested locks 
  2350.                      become available. If CmdLock.TimeOut == 0xFFFFFFFF then 
  2351.                      the thread will wait indefinitely until the requested 
  2352.                      locks become available. 
  2353.  
  2354.                      Lock.Share defines the type of access other processes may 
  2355.                      have to the file-range being locked. If its value == 0, 
  2356.                      other processes have No-Access to the locked range.  If 
  2357.                      its value == 1, other process have Read-Only access to the 
  2358.                      locked range. 
  2359.  
  2360.                      For CmdUnlock, the command format is: 
  2361.  
  2362.                                           struct CmdUnlock {
  2363.                                               unsigned short Cmd = 1;     /* 1 for unlock operations        */
  2364.                                               unsigned short UnlockCnt;   /* Number of unlocks that follow  */
  2365.                                           }
  2366.  
  2367.                      which is followed by a series of records of the following 
  2368.                      format: 
  2369.  
  2370.                                           struct UnLock {
  2371.                                               long Start;                 /* start of locked region         */
  2372.                                               long Length;                /* length of locked region        */
  2373.                                           }
  2374.  
  2375.                      For CmdSeek, the command format is: 
  2376.  
  2377.                                           struct CmdSeek {
  2378.                                               unsigned short Cmd = 2;   /* 2 for seek operation         */
  2379.                                               unsigned short Method;    /* 0 for absolute               */
  2380.                                                                         /* 1 for relative to current    */
  2381.                                                                         /* 2 for relative to EOF        */
  2382.                                               long           Position;  /* file seek position or delta  */
  2383.                                               long           Actual;    /* actual position seeked to    */
  2384.                                           }
  2385.  
  2386.                      For CmdIO, the command format is: 
  2387.  
  2388.                                           struct CmdIO {
  2389.                                               unsigned short Cmd;        /* 3 for read, 4 for write      */
  2390.                                               void far * Buffer;         /* pointer to the data buffer   */
  2391.                                               unsigned short BufferLen;  /* number of bytes requested    */
  2392.                                               unsigned short Actual;     /* number of bytes transferred  */
  2393.                                           }
  2394.  
  2395.  cbCmdList           is the length in bytes of the command list. 
  2396.  
  2397.  poError             is the offset within the command list of the command that 
  2398.                      caused the error. 
  2399.  
  2400.                      This field has a value only when an error occurs. 
  2401.  
  2402.                      The validity of the user address has not been verified 
  2403.                      (see FSH_PROBEBUF). 
  2404.  
  2405.  IOflag              indicates information about the operation on the handle. 
  2406.  
  2407.                      IOflag == 0x0010 indicates write-through. 
  2408.                      IOflag == 0x0020 indicates no-cache. 
  2409.  
  2410.  Remarks 
  2411.  
  2412.  This function provides a simple mechanism for combining the file I/O 
  2413.  operations into a single request and providing improved performance, 
  2414.  particularly in a networking environment. 
  2415.  
  2416.  File systems that do not have the FileIO bit in their attribute field do not 
  2417.  see this call: The command list is parsed by the IFS router. The FSD sees only 
  2418.  FS_CHGFILEPTR, FS_READ, FS_WRITE calls. 
  2419.  
  2420.  File systems that have the FileIO bit in their attribute field see this call 
  2421.  in its entirety. The atomicity guarantee applies only to the commands 
  2422.  themselves and not to the list as a whole. 
  2423.  
  2424.  Of the information passed in IOflag, the write-through bit is a mandatory bit 
  2425.  in that any data written to the block device must be put out on the medium 
  2426.  before the device driver returns. The no-cache bit, on the other hand, is an 
  2427.  advisory bit that says whether the data being transferred is worth caching or 
  2428.  not. 
  2429.  
  2430.  
  2431. ΓòÉΓòÉΓòÉ 5.15. FS_FILELOCKS - Request a file record lock/unlock ΓòÉΓòÉΓòÉ
  2432.  
  2433. Purpose 
  2434.  
  2435. Locks and/or unlocks a range (record)  in a opened file. 
  2436.  
  2437. Calling Sequence 
  2438.  
  2439. int far pascal FS_FILELOCKS(psffsi, psffsd, pUnLockRange, pLockRange, timeout,
  2440.                             flags)
  2441.  
  2442. struct sffsi far * psffsi;
  2443. struct sffsd far * psffsd;
  2444. struct filelock far * pUnLockRange;
  2445. struct filelock far * pLockRange;
  2446. unsigned long timeout;
  2447. unsigned long flags;
  2448.  
  2449. Where 
  2450.  
  2451.  psffsi              is a pointer to the file-system-independent portion of an 
  2452.                      open file instance. 
  2453.  
  2454.  psffsd              is a pointer to the file-system-dependent portion of an 
  2455.                      open file instance. 
  2456.  
  2457.  pUnLockRange        is a pointer to a filelock structure, identifying the 
  2458.                      range of the file to be unlocked. The filelock structure 
  2459.                      has the following format: 
  2460.  
  2461.                                           struct filelock {
  2462.                                               unsigned long FileOffset;   /* offset where the lock/unlock begins  */
  2463.                                               unsigned long RangeLength;  /* length of region locked/unlocked     */
  2464.                                           }
  2465.  
  2466.                      If RangeLength is zero, no unlocking is required. 
  2467.  
  2468.  pLockRange          is a pointer to a filelock structure, identifying the 
  2469.                      range of the file to be locked. If RangeLength is zero, no 
  2470.                      locking is required. 
  2471.  
  2472.  timeout             is the maximum time in milliseconds that the requester 
  2473.                      wants to wait for the requested ranges, if they are not 
  2474.                      immediately available. 
  2475.  
  2476.  flags               is the bit mask which specifies what actions are to taken: 
  2477.  
  2478.                      SHARE Bit 0 on indicates other processes can share access 
  2479.                      to this locked range. Ranges with SHARE bit on can 
  2480.                      overlap. 
  2481.  
  2482.                      SHARE Bit 0 off indicates the current process has 
  2483.                      exclusive access to the locked range. A range with the 
  2484.                      SHARE bit off CANNOT overlap with any other lock range. 
  2485.  
  2486.                      ATOMIC Bit 1 on indicates an atomic lock request. If the 
  2487.                      lock range equals the unlock range, an atomic lock will 
  2488.                      occur. If the ranges are not equal, an error will be 
  2489.                      returned. 
  2490.  
  2491.                      All other bits (2-31) are reserved and must be zero. 
  2492.  
  2493.  Remarks 
  2494.  
  2495.  This entry point was added to support the 32-bit DosSetFileLocks API. 
  2496.  
  2497.  If the lock and unlock range lengths are both zero, an error, 
  2498.  ERROR_LOCK_VIOLATION will be returned to the caller. If only a lock is 
  2499.  desired, pUnLockRange can be NULL or both FileOffset and RangeLength should be 
  2500.  set to zero when the call is made. The opposite is true for an unlock. 
  2501.  
  2502.  When the atomic bit is not set, the unlock occurs first then the lock is 
  2503.  performed. If an error occurs on the unlock, an error is returned and the lock 
  2504.  is not performed. If an error occurs on the lock, an error is returned and the 
  2505.  unlock remains in effect if one was requested. If the atomic bit is set and 
  2506.  the unlock range equals the lock range and the unlock range has shared access 
  2507.  but wants to change the access to exclusive access, the function is atomic. 
  2508.  FSDs may not support atomic lock functions. If error 
  2509.  ERROR_ATOMIC_LOCK_NOT_SUPPORTED is returned, the application should do an 
  2510.  unlock and lock the range using nonatomic operations. The application should 
  2511.  also be sure to refresh its internal buffers prior to making any 
  2512.  modifications. 
  2513.  
  2514.  Closing a file with locks still in force causes the locks to be released in no 
  2515.  defined order. 
  2516.  
  2517.  Terminating a process with a file open and having issued locks on that file 
  2518.  causes the file to be closed and the locks to be released in no defined order. 
  2519.  
  2520.  The figure below describes the level of access granted when the accessed 
  2521.  region is locked. The locked regions can be anywhere in the logical file. 
  2522.  Locking beyond end-of-file is not an error. It is expected that the time in 
  2523.  which regions are locked will be short. Duplicating the handle duplicates 
  2524.  access to the locked regions. Access to the locked regions is not duplicated 
  2525.  across the DosExecPgm system call. The proper method for using locks is not to 
  2526.  rely on being denied read or write access, but attempting to lock the region 
  2527.  desired and examining the error code. 
  2528.  
  2529.  Locked Access Table 
  2530.  
  2531.  
  2532.    Action               Exclusive Lock                 Shared Lock
  2533.    ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2534.    Owner read           Success                        Success
  2535.    ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2536.    Non-owner read       Return code, not block         Success
  2537.    ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2538.    Owner write          Success                        Return code, not block
  2539.    ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2540.    Non-owner write      Return code, not block         Return code, not block
  2541.  
  2542.  The locked access table has the actions on the left as to whether owners or 
  2543.  non-owners of a file do either reads or writes of files that have exclusive or 
  2544.  shared locks set. A range to be locked for exclusive access must first be 
  2545.  cleared of any locked subranges or locked any locked subranges or locked 
  2546.  overlapping ranges. 
  2547.  
  2548.  
  2549. ΓòÉΓòÉΓòÉ 5.16. FS_FINDCLOSE - Directory Read (Search) Close ΓòÉΓòÉΓòÉ
  2550.  
  2551. Purpose 
  2552.  
  2553. Provides the mechanism for an FSD to release resources allocated on behalf of 
  2554. FS_FINDFIRST and FS_FINDNEXT. 
  2555.  
  2556. Calling Sequence 
  2557.  
  2558. int far pascal FS_FINDCLOSE(pfsfsi, pfsfsd)
  2559.  
  2560. struct fsfsi far * pfsfsi;
  2561. struct fsfsd far * pfsfsd;
  2562.  
  2563. Where 
  2564.  
  2565.  pfsfsi              is a pointer to the file-system-independent file search 
  2566.                      structure. 
  2567.  
  2568.                      The FSD should not update this structure. 
  2569.  
  2570.  pfsfsd              is a pointer to the file-system-dependent file search 
  2571.                      structure. 
  2572.  
  2573.                      The FSD may use this to store information about 
  2574.                      continuation of its search. 
  2575.  
  2576.  Remarks 
  2577.  
  2578.  DosFindClose has been called on the handle associated with the search buffer. 
  2579.  Any file system related information may be released. 
  2580.  
  2581.  If FS_FINDFIRST for a particular search returns an error, an FS_FINDCLOSE for 
  2582.  that search will not be issued. 
  2583.  
  2584.  
  2585. ΓòÉΓòÉΓòÉ 5.17. FS_FINDFIRST - Find First Matching File Name ΓòÉΓòÉΓòÉ
  2586.  
  2587. Purpose 
  2588.  
  2589. Find first occurrence of a file name in a directory. 
  2590.  
  2591. Calling Sequence 
  2592.  
  2593. int far pascal FS_FINDFIRST(pcdfsi, pcdfsd, pName, iCurDirEnd, attr, pfsfsi,
  2594.                             pfsfsd, pData, cbData, pcMatch, level, flags)
  2595.  
  2596. struct cdfsi far * pcdfsi;
  2597. struct cdfsd far * pcdfsd;
  2598. char far * pName;
  2599. unsigned short iCurDirEnd;
  2600. unsigned short attr;
  2601. struct fsfsi far * pfsfsi;
  2602. struct fsfsd far * pfsfsd;
  2603. char far * pData;
  2604. unsigned short cbData;
  2605. unsigned short far * pcMatch;
  2606. unsigned short level;
  2607. unsigned short flags;
  2608.  
  2609. Where 
  2610.  
  2611.  pcdfsi              is a pointer to the file-system-independent working 
  2612.                      directory structure. 
  2613.  
  2614.  pcdfsd              is a pointer to the file-system-dependent working 
  2615.                      directory structure. 
  2616.  
  2617.  pName               is a pointer to the ASCIIZ name of the file or directory. 
  2618.  
  2619.                      Wildcard characters are allowed only in the last 
  2620.                      component. The FSD does not need to validate this pointer. 
  2621.  
  2622.  iCurDirEnd          is the index of the end of the current directory in pName. 
  2623.  
  2624.                      This is used to optimize FSD path processing. If 
  2625.                      iCurDirEnd == -1 there is no current directory relevant to 
  2626.                      the name text, that is, a device. 
  2627.  
  2628.  attr                is a bit field that governs the match. 
  2629.  
  2630.                      Any directory entry whose attribute bit mask is a subset 
  2631.                      of attr and whose name matches that in pName should be 
  2632.                      returned. For example, an attribute of system and hidden 
  2633.                      is passed in. A file with the same name and an attribute 
  2634.                      of system is found. This file is returned. A file with the 
  2635.                      same name and no attributes (a regular file) is also 
  2636.                      returned. The attributes read-only and file-archive will 
  2637.                      not be passed in and should be ignored when comparing 
  2638.                      directory attributes. 
  2639.  
  2640.                      The value of attr passed to the FSD will be valid. The bit 
  2641.                      0x0040 indicates a non-8.3 filename format. It should be 
  2642.                      treated the same way as system and hidden attributes are. 
  2643.  
  2644.  pfsfsi              is a pointer to the file-system-independent file-search 
  2645.                      structure. 
  2646.  
  2647.                      The FSD should not update this structure. 
  2648.  
  2649.  pfsfsd              is a pointer to the file-system-dependent file-search 
  2650.                      structure. 
  2651.  
  2652.                      The FSD may use this to store information about 
  2653.                      continuation of the search. 
  2654.  
  2655.  pData               is the address of the application data area. 
  2656.  
  2657.                      Addressing of this data area is not validated by the 
  2658.                      kernel (see FSH_PROBEBUF). The FSD will fill in this area 
  2659.                      with a set of packed, variable- length structures that 
  2660.                      contain the requested data and matching file name. 
  2661.  
  2662.  cbData              is the length of the application data area in bytes. 
  2663.  
  2664.  pcMatch             is a pointer to the number of matching entries. 
  2665.  
  2666.                      The FSD returns, at most, this number of entries; the FSD 
  2667.                      returns in this parameter the number of entries actually 
  2668.                      placed in the data area. 
  2669.  
  2670.                      The FSD does not need to validate this pointer. 
  2671.  
  2672.  level               is the information level to be returned. 
  2673.  
  2674.                      Level selects among a series of data structures to be 
  2675.                      returned. The level passed to the FSD is valid. 
  2676.  
  2677.  flags               indicates whether to return file-position information. 
  2678.  
  2679.                      flags == 0 indicates that file-position information should 
  2680.                      not be returned and the information format described under 
  2681.                      DosFindFirst should be used. 
  2682.                      flags == 1 indicates that file-position information should 
  2683.                      be returned and the information format described below 
  2684.                      should be used. 
  2685.  
  2686.                      The flag passed to the FSD has a valid value. 
  2687.  
  2688.  Remarks 
  2689.  
  2690.  For flags == 1, the FSD must store in the first DWORD of the per-file 
  2691.  attributes structure adequate information to allow the search to be resumed 
  2692.  from the file by calling FS_FINDFROMNAME. For example, an ordinal representing 
  2693.  the file's position in the directory could be stored. If the filename must be 
  2694.  used to restart the search, the DWORD may be left blank. 
  2695.  
  2696.  For level 0x0001 and flags == 0, directory information for FS_FINDFIRST is 
  2697.  returned in the following format: 
  2698.  
  2699.   struct FileFindBuf {
  2700.       unsigned short dateCreate;
  2701.       unsigned short timeCreate;
  2702.       unsigned short dateAccess;
  2703.       unsigned short timeAccess;
  2704.       unsigned short dateWrite;
  2705.       unsigned short timeWrite;
  2706.       long           cbEOF;
  2707.       long           cbAlloc;
  2708.       unsigned short attr;
  2709.       unsigned char  cbName;
  2710.       unsigned char  szName[];
  2711.   }
  2712.  
  2713.  For level 0x0001 and flags == 1, directory information for FS_FINDFIRST is 
  2714.  returned in the following format: 
  2715.  
  2716.   struct FileFromFindBuf {
  2717.       long           position;    /* position given to FSD on following */
  2718.                                   /* FS_FINDFROMNAME call               */
  2719.       unsigned short dateCreate;
  2720.       unsigned short timeCreate;
  2721.       unsigned short dateAccess;
  2722.       unsigned short timeAccess;
  2723.       unsigned short dateWrite;
  2724.       unsigned short timeWrite;
  2725.       long           cbEOF;
  2726.       long           cbAlloc;
  2727.       unsigned short attr;
  2728.       unsigned char  cbName;
  2729.       unsigned char  szName[];
  2730.   }
  2731.  
  2732.  The other information levels have similar format, with the position the first 
  2733.  field in the structure for flags == 1. 
  2734.  
  2735.  If the non-8.3 filename format bit is set in the attributes of a file found by 
  2736.  FS_FINDFIRST/NEXT/FROMNAME, it must be turned off in the copy of the 
  2737.  attributes returned in pData. 
  2738.  
  2739.  If FS_FINDFIRST for a particular search returns an error, an FS_FINDCLOSE for 
  2740.  that search will not be issued. 
  2741.  
  2742.  Sufficient information to find the next matching directory entry must be saved 
  2743.  in the fsfsd data structure. 
  2744.  
  2745.  In the case where directory entry information overflows the pData area, the 
  2746.  FSD should be able to continue the search from the entry which caused the 
  2747.  overflow on the next FS_FINDNEXT or FS_FINDFROMNAME. 
  2748.  
  2749.  In the case of a global search in a directory, the first two entries in that 
  2750.  directory as reported by the FSD should be '.' and '..' (current and the 
  2751.  parent directories. 
  2752.  
  2753.  The example above just shows the effect of flags == 1 on a level 1 filefind 
  2754.  record; level 2 and level 3 filefind records are similarly affected. 
  2755.  
  2756.  Note:  The FSD will be called with the FINDFIRST/FINDFROMNAME interface when 
  2757.  the 32-bit DosFindFirst/DosFindNext APIs are called. THIS IS A CHANGE FROM 1.X 
  2758.  IFS interface for redirector FSDs. The kernel will also be massaging the find 
  2759.  records so that they appear the way the caller expects. Redirectors who have 
  2760.  to resume searches should take this information into account. (i.e. You might 
  2761.  want to reduce the size of the buffer sent to the server, so that the position 
  2762.  fields can be added to the beginning of all the find records). 
  2763.  
  2764.  
  2765. ΓòÉΓòÉΓòÉ 5.18. FS_FINDFROMNAME - Find matching file name starting from name ΓòÉΓòÉΓòÉ
  2766.  
  2767. Purpose 
  2768.  
  2769. Find occurrence of a file name in a directory starting from a position or name. 
  2770.  
  2771. Calling Sequence 
  2772.  
  2773. int far pascal FS_FINDFROMNAME(pfsfsi, pfsfsd, pData, cbData, pcMatch, level,
  2774.                                position, pName, flags)
  2775.  
  2776. struct fsfsi far * pfsfsi;
  2777. struct fsfsd far * pfsfsd;
  2778. char far * pData;
  2779. unsigned short cbData;
  2780. unsigned short far * pcMatch;
  2781. unsigned short level;
  2782. unsigned long position;
  2783. char far * pName;
  2784. unsigned short flags;
  2785.  
  2786. Where 
  2787.  
  2788.  pfsfsi              is a pointer to the file-system-independent file search 
  2789.                      structure. The FSD should not update this structure. 
  2790.  
  2791.  pfsfsd              is a pointer to the file-system-dependent file search 
  2792.                      structure. The FSD may use this to store information about 
  2793.                      continuation of the search. 
  2794.  
  2795.  pData               is the address of the application data area. 
  2796.  
  2797.                      Addressing of this data area has not been validated by the 
  2798.                      kernel (see FSH_PROBEBUF). The FSD will fill in this area 
  2799.                      with a set of packed, variable- length structures that 
  2800.                      contain the requested data and matching file names in the 
  2801.                      format required for DosFindFirst/DosFindNext. 
  2802.  
  2803.  cbData              is the length of the application data area in bytes. 
  2804.  
  2805.  pcMatch             is a pointer to the number of matching entries. The FSD 
  2806.                      will return at most this number of entries. The FSD will 
  2807.                      store into it the number of entries actually placed in the 
  2808.                      data area. The FSD does not need to validate this pointer. 
  2809.  
  2810.  level               is the information level to be returned. Level selects 
  2811.                      among a series of structures of data to be returned. The 
  2812.                      level passed to the FSD is valid. 
  2813.  
  2814.  position            is the file-system-specific information about where to 
  2815.                      restart the search from. This information was returned by 
  2816.                      the FSD in the ResultBuf for an 
  2817.                      FS_FINDFIRST/FS_FINDNEXT/FS_FINDFROMNAME call. 
  2818.  
  2819.  pName               is the filename from which to continue the search. The FSD 
  2820.                      does not need to validate this pointer. 
  2821.  
  2822.  flags               indicates whether to return file position information. The 
  2823.                      flag passed to the FSD has a valid value. 
  2824.  
  2825.  Remarks 
  2826.  
  2827.  The FSD may use the position or filename to determine the position > from 
  2828.  which to resume the directory search. The FSD need not return position if it 
  2829.  uses name and vice versa. 
  2830.  
  2831.  For flags == 1, the FSD must store in the position field adequate information 
  2832.  to allow the search to be resumed from the file by calling FS_FINDFROMNAME. 
  2833.  See FS_FINDFIRST for a description of the data format. 
  2834.  
  2835.  The FSD must ensure that enough information is stored in the fsfsd data 
  2836.  structure to enable it to continue the search. 
  2837.  
  2838.  Note:  The FSD will be called with the FINDFIRST/FINDFROMNAME interface when 
  2839.  the 32-bit DosFindFirst/DosFindNext APIs are called. THIS IS A CHANGE FROM 1.X 
  2840.  IFS interface for redirector FSDs. The kernel will also be massaging the find 
  2841.  records so that they appear the way the caller expects. Redirectors who have 
  2842.  to resume searches should take this information into account. (i.e.  You might 
  2843.  want to reduce the size of the buffer sent to the server, so that the position 
  2844.  fields can be added to the beginning of all the find records). 
  2845.  
  2846.  
  2847. ΓòÉΓòÉΓòÉ 5.19. FS_FINDNEXT - Find next matching file name. ΓòÉΓòÉΓòÉ
  2848.  
  2849. Purpose 
  2850.  
  2851. Find the next occurrence of a file name in a directory. 
  2852.  
  2853. Calling Sequence 
  2854.  
  2855. int far pascal FS_FINDNEXT(pfsfsi, pfsfsd, pData, cbData, pcMatch, level,
  2856.                            flags)
  2857.  
  2858. struct fsfsi far * pfsfsi;
  2859. struct fsfsd far * pfsfsd;
  2860. char far * pData;
  2861. unsigned short cbData;
  2862. unsigned short far * pcMatch;
  2863. unsigned short level;
  2864. unsigned short flags;
  2865.  
  2866. Where 
  2867.  
  2868.  pfsfsi              is a pointer to the file-system-independent file-search 
  2869.                      structure. The FSD should not update this structure. 
  2870.  
  2871.  pfsfsd              is a pointer to the file-system-dependent file-search 
  2872.                      structure. The FSD may use this to store information about 
  2873.                      continuation of the search. 
  2874.  
  2875.  pData               is the address of the application area. 
  2876.  
  2877.                      Addressing of this data area is not validated by the 
  2878.                      kernel (see FSH_PROBEBUF). The FSD fills in this area with 
  2879.                      a set of packed, variable- length structures that contain 
  2880.                      the requested data and matching file names. 
  2881.  
  2882.  cbData              is the length of the application data area in bytes. 
  2883.  
  2884.  pcMatch             is a pointer to the number of matching entries. 
  2885.  
  2886.                      The FSD returns, at most, this number of entries. The FSD 
  2887.                      returns the the number of entries actually placed in the 
  2888.                      data area in this parameter. 
  2889.  
  2890.                      The FSD does not need to validate this pointer. 
  2891.  
  2892.  level               is the information level to be returned.  Level selects 
  2893.                      among a series of structures of data to be returned. The 
  2894.                      level passed to the FSD is valid. 
  2895.  
  2896.  flags               indicates whether to return file-position information. 
  2897.  
  2898.  Remarks 
  2899.  
  2900.  For flags == -1, the FSD must store in the position field adequate information 
  2901.  to allow the search to be resumed from the file by calling FS_FINDFROMNAME. 
  2902.  See FS_FINDFIRST for a description of the data format. 
  2903.  
  2904.  The level passed to FS_FINDNEXT is the same level as that passed to 
  2905.  FS_FINDFIRST to initiate the search. 
  2906.  
  2907.  Sufficient information to find the next matching directory entry must be saved 
  2908.  in the fsfsd data structure. 
  2909.  
  2910.  The FSD should take care of the case where the pData area overflow may occur. 
  2911.  FSDs should be able to start the search from the same entry for the next 
  2912.  FS_FINDNEXT as the one for which the overflow occurred. 
  2913.  
  2914.  In the case of a global search in a directory, the first two entries in that 
  2915.  directory as reported by the FSD should be '.' and '..' (current and parent 
  2916.  directories). 
  2917.  
  2918.  
  2919. ΓòÉΓòÉΓòÉ 5.20. FS_FINDNOTIFYCLOSE - Close Find-Notify Handle ΓòÉΓòÉΓòÉ
  2920.  
  2921. Purpose 
  2922.  
  2923. Closes the association between a Find-Notify handle and a DosFindNotifyFirst or 
  2924. DosFindNotifyNext function. 
  2925.  
  2926. Calling Sequence 
  2927.  
  2928. int far pascal FS_FINDNOTIFYCLOSE(handle)
  2929.  
  2930. unsigned short handle;
  2931.  
  2932. Where 
  2933.  
  2934.  handle              is the directory handle. 
  2935.  
  2936.                      This handle was returned by the FSD on a previous 
  2937.                      FS_FINDNOTIFYFIRST or FS_FINDNOTIFYNEXT call. 
  2938.  
  2939.  Remarks 
  2940.  
  2941.  Provides the mechanism for an FSD to release resources allocated on behalf of 
  2942.  FS_FINDNOTIFYFIRST and FS_FINDNOTIFYNEXT. 
  2943.  
  2944.  FS_FINDNOTIFYFIRST returns a handle to the find-notify request. 
  2945.  FS_FINDNOTIFYCLOSE closes the handle associated with that find-notify request 
  2946.  and releases file system information related to that handle. 
  2947.  
  2948.  
  2949. ΓòÉΓòÉΓòÉ 5.21. FS_FINDNOTIFYFIRST - Monitor a directory for changes. ΓòÉΓòÉΓòÉ
  2950.  
  2951. Purpose 
  2952.  
  2953. Start monitoring a directory for changes. 
  2954.  
  2955. Calling Sequence 
  2956.  
  2957. int far pascal FS_FINDNOTIFYFIRST(pcdfsi, pcdfsd, pName, iCurDirEnd, attr,
  2958.                                   pHandle, pData, cbData, pcMatch, level,
  2959.                                   timeout)
  2960.  
  2961. struct cdfsi far * pcdfsi;
  2962. struct cdfsd far * pcdfsd;
  2963. char far * pName;
  2964. unsigned short iCurDirEnd;
  2965. unsigned short attr;
  2966. unsigned short far * pHandle; char far * pData;
  2967. unsigned short cbData;
  2968. unsigned short far * pMatch;
  2969. unsigned short level;
  2970. unsigned long timeout;
  2971.  
  2972. Where 
  2973.  
  2974.  pcdfsi              is a pointer to the file-system-independent working 
  2975.                      directory structure. 
  2976.  
  2977.  pcdfsd              is a pointer to the file-system-dependent working 
  2978.                      directory structure. 
  2979.  
  2980.  pName               is a pointer to the ASCIIZ name of the file or directory. 
  2981.  
  2982.                      Wildcard characters are allowed only in the last 
  2983.                      component. The FSD does not need to verify this pointer. 
  2984.  
  2985.  iCurDirEnd          is the index of the end of the current directory in pName. 
  2986.  
  2987.                      This is used to optimize FSD path processing. If 
  2988.                      iCurDirEnd == -1 there is no current directory relevant to 
  2989.                      the name text, that is, a device. 
  2990.  
  2991.  attr                is the bit field that governs the match. 
  2992.  
  2993.                      Any directory entry whose attribute bit mask is a subset 
  2994.                      of attr and whose name matches that in pName should be 
  2995.                      returned. See FS_FINDFIRST for an explanation. 
  2996.  
  2997.  pHandle             is a pointer to the handle for the find-notify request. 
  2998.  
  2999.                      The FSD allocates a handle for the find-notify request, 
  3000.                      that is, a handle to the directory monitoring continuation 
  3001.                      information, and stores it here. This handle is passed to 
  3002.                      FS_FINDNOTIFYNEXT to continue directory monitoring. 
  3003.  
  3004.                      The FSD does not need to verify this pointer. 
  3005.  
  3006.  pData               is the address of the application data area. 
  3007.  
  3008.                      Addressing of this data area is not validated by the 
  3009.                      kernel (see FSH_PROBEBUF). The FSD fills in this area with 
  3010.                      a set of packed, variable- length structures that contain 
  3011.                      the requested data and matching file names. 
  3012.  
  3013.  cbData              is the length of the application data area in bytes. 
  3014.  
  3015.  pcMatch             is a pointer to the number of matching entries. 
  3016.  
  3017.                      The FSD returns, at most, this number of entries. The FSD 
  3018.                      returns in this parameter the number of entries actually 
  3019.                      placed in the data area. 
  3020.  
  3021.                      The FSD does not need to verify this pointer. 
  3022.  
  3023.  level               is the information level to be returned. 
  3024.  
  3025.                      Level selects among a series of data structures to be 
  3026.                      returned. See the description of DosFindNotifyFirst in the 
  3027.                      OS/2 Version 2.0 Control Program Programming Reference for 
  3028.                      more information. 
  3029.  
  3030.                      The level passed to the FSD is valid. 
  3031.  
  3032.  timeout             is the time-out in milliseconds. 
  3033.  
  3034.                      The FSD waits until either the time-out has expired, the 
  3035.                      buffer is full, or the specified number of entries has 
  3036.                      been returned before returning to the caller. 
  3037.  
  3038.  Remarks 
  3039.  
  3040.  None. 
  3041.  
  3042.  
  3043. ΓòÉΓòÉΓòÉ 5.22. FS_FINDNOTIFYNEXT - Resume reporting directory changes ΓòÉΓòÉΓòÉ
  3044.  
  3045. Purpose 
  3046.  
  3047. Resume reporting of changes to a file or directory. 
  3048.  
  3049. Calling Sequence 
  3050.  
  3051. int far pascal FS_FINDNOTIFYNEXT(handle, pData, cbData, pcMatch, level,
  3052.                                  timeout)
  3053.  
  3054. unsigned short handle;
  3055. char far * pData;
  3056. unsigned short cbData;
  3057. unsigned short far * pcMatch;
  3058. unsigned short level;
  3059. unsigned long timeout;
  3060.  
  3061. Where 
  3062.  
  3063.  handle              is the handle to the find-notify request. 
  3064.  
  3065.                      This handle was returned by the FSD and is associated with 
  3066.                      a previous FS_FINDNOTIFYFIRST or FS_FINDNOTIFYNEXT call. 
  3067.  
  3068.  pData               is the address of the application data area. 
  3069.  
  3070.                      Addressing of this data area is not validated by the 
  3071.                      kernel (see FSH_PROBEBUF). The FSD fills in this area with 
  3072.                      a set of packed, variable- length structures that contain 
  3073.                      the requested data and matching file names. 
  3074.  
  3075.  cbData              is the length of the application data area in bytes. 
  3076.  
  3077.  pcMatch             is a pointer to the number of matching entries. 
  3078.  
  3079.                      The FSD returns, at most, this number of entries. The FSD 
  3080.                      returns in this parameter the number of entries actually 
  3081.                      placed in the data area. 
  3082.  
  3083.                      The FSD does not need to verify this pointer. 
  3084.  
  3085.  level               is the information level to be returned. 
  3086.  
  3087.                      Level selects among a series of data structures to be 
  3088.                      returned. See the description of DosFindNotifyFirst in the 
  3089.                      OS/2 Version 2.0 Control Program Programming Reference for 
  3090.                      more information. 
  3091.  
  3092.                      The level passed to the FSD is valid. 
  3093.  
  3094.  timeout             is the time-out in milliseconds. 
  3095.  
  3096.                      The FSD waits until either the time-out has expired, the 
  3097.                      buffer is full, or the specified number of entries has 
  3098.                      been returned before returning to the caller. 
  3099.  
  3100.  Remarks 
  3101.  
  3102.  pcMatch is the number of changes required to directories or files that match 
  3103.  the pName target and attr specified during a related, previous 
  3104.  FS_FINDNOTIFYFIRST. The file system uses this field to return the number of 
  3105.  changes that actually occurred since the issue of the present 
  3106.  FS_FINDNOTIFYNEXT. 
  3107.  
  3108.  The level passed to FS_FINDNOTIFYNEXT is the same level as that passed to 
  3109.  FS_FINDNOTIFYFIRST to initiate the search. 
  3110.  
  3111.  
  3112. ΓòÉΓòÉΓòÉ 5.23. FS_FLUSHBUF - Commit file buffers ΓòÉΓòÉΓòÉ
  3113.  
  3114. Purpose 
  3115.  
  3116. Flushes cache buffers for a specific volume. 
  3117.  
  3118. Calling Sequence 
  3119.  
  3120. int far pascal FS_FLUSHBUF(hVPB, flag)
  3121.  
  3122. unsigned short hVPB;
  3123. unsigned short flag;
  3124.  
  3125. Where 
  3126.  
  3127.  hVPB                is the handle to the volume for flush. 
  3128.  
  3129.  flag                is used to indicate discarding of cached data. 
  3130.  
  3131.                      flag == 0 indicates cached data may be retained. 
  3132.                      flag == 1 indicates the FSD will discard any cached data 
  3133.                      after flushing it to the specified volume. 
  3134.  
  3135.                      All other values are reserved. 
  3136.  
  3137.  Remarks 
  3138.  
  3139.  None. 
  3140.  
  3141.  
  3142. ΓòÉΓòÉΓòÉ 5.24. FS_FSCTL - File System Control ΓòÉΓòÉΓòÉ
  3143.  
  3144. Purpose 
  3145.  
  3146. Allow an extended standard interface between an application and a file system 
  3147. driver. 
  3148.  
  3149. Calling Sequence 
  3150.  
  3151. int far pascal FS_FSCTL(pArgdat, iArgType, func, pParm, lenParm, plenParmIO,
  3152.                         pData, lenData, plenDataIO)
  3153.  
  3154. union argdat far * pArgDat;
  3155. unsigned short iArgType;
  3156. unsigned short func;
  3157. char far * pParm;
  3158. unsigned short lenParm;
  3159. unsigned short far * plenParmIO;
  3160. char far * pData;
  3161. unsigned short lenData;
  3162. unsigned short far * plenDataIO;
  3163.  
  3164. Where 
  3165.  
  3166.  pArgDat             is a pointer to the union whose contents depend on 
  3167.                      iArgType. The union is defined as follows: 
  3168.  
  3169.                                           union argdat {
  3170.  
  3171.                                               /* pArgType = 1, FileHandle directed case */
  3172.  
  3173.                                               struct sf {
  3174.                                                   struct sffsi far * psffsi;
  3175.                                                   struct sffsd far * psffsd;
  3176.                                               };
  3177.  
  3178.                                               /* pArgType = 2, Pathname directed case */
  3179.  
  3180.                                               struct cd {
  3181.                                                   struct cdfsi far * pcdfsi;
  3182.                                                   struct cdfsd far * pcdfsd;
  3183.                                                   char far *         pPath;
  3184.                                                   unsigned short     iCurDirEnd;
  3185.                                               };
  3186.  
  3187.                                               /* pArgType = 3, FSD Name directed case */
  3188.                                               /* pArgDat is Null                      */
  3189.                                           };
  3190.  
  3191.  iArgType            indicates the argument type. 
  3192.  
  3193.                      iArgType = 1 
  3194.                      means that pArgDat->sf.psffsi and pArgDat->sf.psffsd point 
  3195.                      to an sffsi and sffsd, respectively. 
  3196.  
  3197.                      iArgType = 2 
  3198.                      means that pArgDat->cd.pcdfsi and pArgDat->cd.pcdfsd point 
  3199.                      to a cdfsi and cdfsd, pArgDat->cd.pPath points to a 
  3200.                      canonical pathname, and pArgDat->cd.iCurDirEnd gives the 
  3201.                      index of the end of the current directory in pPath. The 
  3202.                      FSD does not need to verify the pPath pointer. 
  3203.  
  3204.                      iArgType = 3 
  3205.                      means that the call was FSD name routed, and pArgDat is a 
  3206.                      NULL pointer. 
  3207.  
  3208.  func                indicates the function to perform. 
  3209.  
  3210.                      func == 1 indicates a request for new error code 
  3211.                      information. 
  3212.                      func == 2 indicates a request for the maximum EA size and 
  3213.                      EA list size supported by the FSD. 
  3214.  
  3215.  pParm               is the address of the application input parameter area. 
  3216.  
  3217.                      Addressing of this data area has not been validated by the 
  3218.                      kernel (see FSH_PROBEBUF). 
  3219.  
  3220.  lenParm             is the maximum length of the application parameter area 
  3221.                      (pParm). 
  3222.  
  3223.  plenParmIO          On input, contains the length in bytes of the parameters 
  3224.                      being passed in to the FSD in pParm. On return, contains 
  3225.                      the length in bytes of data returned in pParm by the FSD. 
  3226.                      The length of the data returned by the FSD in pParm must 
  3227.                      not exceed the length in lenParm. Addressing of this area 
  3228.                      is not validated by the kernel (see FSH_PROBEBUF). 
  3229.  
  3230.  pData               is the address of the application output data area. 
  3231.  
  3232.                      Addressing of this data area is not validated by the 
  3233.                      kernel (see FSH_PROBEBUF). 
  3234.  
  3235.  lenData             is the maximum length of the application output data area 
  3236.                      (pData). 
  3237.  
  3238.  plenDataIO          On input, contains the length in bytes of the data being 
  3239.                      passed in to the FSD in pData. On return, contains the 
  3240.                      length in bytes of data returned in pData by the FSD. The 
  3241.                      length of the data returned by the FSD in pData must not 
  3242.                      exceed the length in lenData. Addressing of this area is 
  3243.                      not validated by the kernel (see FSH_PROBEBUF). 
  3244.  
  3245.  Remarks 
  3246.  
  3247.  The accessibility of the parameter and data buffers has not been validated by 
  3248.  the kernel. FS_PROBEBUF must be used. 
  3249.  
  3250.  All FSDs must support func == 1 to return new error code information and func 
  3251.  == 2 to return the limits of the EA sizes. 
  3252.  
  3253.  For func == 1, the error code is passed to the FSD in the first WORD of the 
  3254.  parameter area. On return, the first word of the data area contains the length 
  3255.  of the ASCIIZ string containing an explanation of the error code. The data 
  3256.  area contains the ASCIIZ string beginning at the second WORD. 
  3257.  
  3258.  For func == 2, the maximum EA and EA list sizes supported by the FSD are 
  3259.  returned in the buffer pointed to by pData in the following format: 
  3260.  
  3261.   struct EASizeBufStruc {
  3262.       unsigned short easb_MaxEASize;     /* Max size of an individual EA */
  3263.       unsigned long easb_MaxEAListSize;  /* Max full EA list size        */
  3264.   }
  3265.  
  3266.  
  3267. ΓòÉΓòÉΓòÉ 5.25. FS_FSINFO - File System Information ΓòÉΓòÉΓòÉ
  3268.  
  3269. Purpose 
  3270.  
  3271. Returns or sets information for a file system device. 
  3272.  
  3273. Calling Sequence 
  3274.  
  3275. int far pascal FS_FSINFO(flag, hVPB, pData, cbData, level)
  3276.  
  3277. unsigned short flag;
  3278. unsigned short hVPB;
  3279. char far * pData;
  3280. unsigned short cbData;
  3281. unsigned short level;
  3282.  
  3283. Where 
  3284.  
  3285.  flag                indicates retrieval or setting of information. 
  3286.  
  3287.                      flag == 0 indicates retrieving information. 
  3288.                      flag == 1 indicates setting information on the media. 
  3289.                      All other values are reserved. 
  3290.  
  3291.  hVPB                is the handle to the volume of interest. 
  3292.  
  3293.  pData               is the address of the application output data area. 
  3294.  
  3295.                      Addressing of this data area has not been validated by the 
  3296.                      kernel (see (FSH_PROBEBUF). 
  3297.  
  3298.  cbData              is the length of the application data area. 
  3299.  
  3300.                      For flag == 0, this is the length of the data the 
  3301.                      application wishes to retrieve. If there is not enough 
  3302.                      room for the entire level of data to be returned, the FSD 
  3303.                      will return a BUFFER OVERFLOW error. For flag == 1, this 
  3304.                      is the length of the data to be sent to the file system. 
  3305.  
  3306.  level               is the information level to be returned. 
  3307.  
  3308.                      Level selects among a series of structures of data to be 
  3309.                      returned or set. See DosQFSInfo and DosSetFSInfo for 
  3310.                      information. 
  3311.  
  3312.  Remarks 
  3313.  
  3314.  None. 
  3315.  
  3316.  
  3317. ΓòÉΓòÉΓòÉ 5.26. FS_INIT - File system driver initialization ΓòÉΓòÉΓòÉ
  3318.  
  3319. Purpose 
  3320.  
  3321. Request file system driver initialization. 
  3322.  
  3323. Calling Sequence 
  3324.  
  3325. int far pascal FS_INIT(szParm, DevHelp, pMiniFSD)
  3326.  
  3327. char far * szParm;
  3328. unsigned long DevHelp;
  3329. unsigned long far * pMiniFSD;
  3330.  
  3331. Where 
  3332.  
  3333.  szParm              is a pointer to the ASCIIZ parameters following the 
  3334.                      CONFIG.SYS IFS= command that loaded the FSD. The FSD does 
  3335.                      not need to verify this pointer. 
  3336.  
  3337.  DevHelp             is the address of the kernel entry point for the DevHelp 
  3338.                      routines. 
  3339.  
  3340.                      This is used exactly as the device driver DevHelp address, 
  3341.                      and can be used by an FSD that needs access to some of the 
  3342.                      device helper services. 
  3343.  
  3344.  pMiniFSD            is a pointer to data passed between the mini-FSD and the 
  3345.                      FSD, or null. 
  3346.  
  3347.  Remarks 
  3348.  
  3349.  This call is made during system initialization to allow the FSD to perform 
  3350.  actions necessary for beginning operation. The FSD may successfully initialize 
  3351.  by returning 0 or may reject installation (invalid parameters, incompatible 
  3352.  hardware, etc.) by returning the appropriate error code. If rejection is 
  3353.  selected, all FSD selectors and segments are released. 
  3354.  
  3355.  pMiniFSD will be null, except when booting from a volume managed by an FSD and 
  3356.  the exported name of the FSD matches the exported name of the mini-FSD. In 
  3357.  this case, pMiniFSD will point to data established by the mini-FSD (See 
  3358.  MFS_INIT). 
  3359.  
  3360.  
  3361. ΓòÉΓòÉΓòÉ 5.27. FS_IOCTL - I/O Control for Devices ΓòÉΓòÉΓòÉ
  3362.  
  3363. Purpose 
  3364.  
  3365. Perform control function on the device specified by the opened device handle. 
  3366.  
  3367. Calling Sequence 
  3368.  
  3369. int far pascal FS_IOCTL(psffsi, psffsd, cat, func, pParm, lenMaxParm,
  3370.                         plenInOutParm, pData, lenMaxData, plenInOutData)
  3371.  
  3372. struct sffsi far * psffsi;
  3373. struct sffsd far * psffsd;
  3374. unsigned short cat;
  3375. unsigned short func;
  3376. char far * pParm;
  3377. unsigned short lenMaxParm;
  3378. unsigned short * plenInOutParm;
  3379. char far * pData;
  3380. unsigned short lenMaxData;
  3381. unsigned short * plenInOutData;
  3382.  
  3383. Where 
  3384.  
  3385.  psffsi              is a pointer to the file-system-independent portion of an 
  3386.                      open file instance. 
  3387.  
  3388.  psffsd              is a pointer to the file-system-dependent portion of an 
  3389.                      open file instance. 
  3390.  
  3391.  cat                 is the category of the function to be performed. 
  3392.  
  3393.  func                is the function within the category to be performed. 
  3394.  
  3395.  pParm               is the address of the application input parameter area. 
  3396.  
  3397.                      Addressing of this data area is not validated by the 
  3398.                      kernel (see FSH_PROBEBUF). A null value indicates that the 
  3399.                      parameter is unspecified for this function. lenMaxParm is 
  3400.                      the byte length of the application input parameter area. 
  3401.  
  3402.                      If lenMaxParm is 0, *plenInOutParm is 0, and pParm is not 
  3403.                      null, it means that the data buffer length is unknown due 
  3404.                      to the request being submitted via an old IOCTL or 
  3405.                      DosDevIOCtl interface. 
  3406.  
  3407.  plenInOutParm       is the pointer to an unsigned short that contains the 
  3408.                      length of the parameter area in use on input and is set by 
  3409.                      the FSD to be the length of the parameter area in use on 
  3410.                      output. 
  3411.  
  3412.                      Addressing of this data area is not validated by the 
  3413.                      kernel (see FSH_PROBEBUF). A null value indicates that the 
  3414.                      parameter is unspecified for this function. 
  3415.  
  3416.  pData               is the address of the application output data area. 
  3417.  
  3418.                      Addressing of this data area has not been validated by the 
  3419.                      kernel (see FSH_PROBEBUF). A null value indicates that the 
  3420.                      parameter is unspecified for this function. 
  3421.  
  3422.  lenMaxData          is the byte length of the application output data area. 
  3423.  
  3424.                      If lenMaxData is 0, *plenInOutData is 0, and pData is not 
  3425.                      null, it means that the data buffer length is unknown due 
  3426.                      to the request being submitted via an old IOCTL or 
  3427.                      DosDevIOCtl interface. 
  3428.  
  3429.  plenInOutData       is the pointer to an unsigned short that contains the 
  3430.                      length of the data area in use on input and is set by the 
  3431.                      FSD to be the length of the data area in use on output. 
  3432.  
  3433.                      Addressing of this data area is not validated by the 
  3434.                      kernel (see FSH_PROBEBUF). A null value indicates that the 
  3435.                      parameter is unspecified for this function. 
  3436.  
  3437.  Remarks 
  3438.  
  3439.  Note:  This entry point's parameter list definition has changed from the 1.x 
  3440.  IFS document. If the parameters plenInOutParm and plenInOutData are null, use 
  3441.  the lenMax parameters as the buffer sizes sent to any file system helper. 
  3442.  
  3443.  
  3444. ΓòÉΓòÉΓòÉ 5.28. FS_MKDIR - Make Subdirectory ΓòÉΓòÉΓòÉ
  3445.  
  3446. Purpose 
  3447.  
  3448. Create the specified directory. 
  3449.  
  3450. Calling Sequence 
  3451.  
  3452. int far pascal FS_MKDIR(pcdfsi, pcdfsd, pName, iCurDirEnd, pEABuf, flags)
  3453.  
  3454. struct cdfsi far * pcdfsi;
  3455. struct cdfsd far * pcdfsd;
  3456. char far * pName;
  3457. unsigned short iCurDirEnd;
  3458. char far * pEABuf;
  3459. unsigned short flags;
  3460.  
  3461. Where 
  3462.  
  3463.  pcdfsi              is a pointer to the file-system-independent working 
  3464.                      directory structure. 
  3465.  
  3466.  pcdfsd              is a pointer to the file-system-dependent working 
  3467.                      directory structure. 
  3468.  
  3469.  pName               is a pointer to the ASCIIZ name of the directory to be 
  3470.                      created. 
  3471.  
  3472.                      The FSD does not need to verify this pointer. 
  3473.  
  3474.  iCurDirEnd          is the index of the end of the current directory in pName. 
  3475.  
  3476.                      This is used to optimize FSD path processing. If 
  3477.                      iCurDirEnd == -1, there is no current directory relevant 
  3478.                      to the name text, that is, a device. 
  3479.  
  3480.  pEABuf              is a pointer to the extended attribute buffer. 
  3481.  
  3482.                      This buffer contains attributes that will be set upon 
  3483.                      creation of the new directory. If NULL, no extended 
  3484.                      attributes are to be set. Addressing of this data area has 
  3485.                      not been validated by the kernel (see FSH_PROBEBUF). 
  3486.  
  3487.  flags               indicates the name type. 
  3488.  
  3489.                      Flags == 0x0040 indicates a non-8.3 filename format. All 
  3490.                      other values are reserved. 
  3491.  
  3492.  Remarks 
  3493.  
  3494.  The FSD needs to do the time stamping itself. There is no aid in the kernel 
  3495.  for time stamping sub-directories. FAT only supports creation time stamp and 
  3496.  sets the other two fields to zeroes. An FSD should do the same. The FSD can 
  3497.  obtain the current time/date from the infoseg. 
  3498.  
  3499.  A new directory called pName should be created if possible. The standard 
  3500.  directory entries '.' and '..' should be put into the directory. 
  3501.  
  3502.  The non-8.3 filename format attribute in the directory entry should be set 
  3503.  according to the value in flags. 
  3504.  
  3505.  
  3506. ΓòÉΓòÉΓòÉ 5.29. FS_MOUNT - Mount/unmount volumes ΓòÉΓòÉΓòÉ
  3507.  
  3508. Purpose 
  3509.  
  3510. Examination of a volume by an FSD to see if it recognizes the file system 
  3511. format. 
  3512.  
  3513. Calling Sequence 
  3514.  
  3515. int far pascal FS_MOUNT(flag, pvpfsi, pvpfsd, hVPB, pBoot)
  3516.  
  3517. unsigned short flag;
  3518. struct vpfsi far * pvpfsi;
  3519. struct vpfsd far * pvpfsd;
  3520. unsigned short hVPB;
  3521. char far * pBoot;
  3522.  
  3523. Where 
  3524.  
  3525.  flag                indicates operation requested. 
  3526.  
  3527.                      flag == 0 indicates that the FSD is requested to mount or 
  3528.                      accept a volume. 
  3529.  
  3530.                      flag == 1 indicates that the FSD is being advised that the 
  3531.                      specified volume has been removed. 
  3532.  
  3533.                      flag == 2 indicates that the FSD is requested to release 
  3534.                      all internal storage assigned to that volume as it has 
  3535.                      been removed from its driver and the last kernel-managed 
  3536.                      reference to that volume has been removed. 
  3537.  
  3538.                      flag == 3 indicates that the FSD is requested to accept 
  3539.                      the volume regardless of recognition in preparation for 
  3540.                      formatting for use with the FSD. 
  3541.  
  3542.                      All other values are reserved. 
  3543.  
  3544.                      The value passed to the FSD will be valid. 
  3545.  
  3546.  pvpfsi              is a pointer to the file-system-independent portion of 
  3547.                      VPB. 
  3548.  
  3549.                      If the media contains an OS/2-recognizable boot sector, 
  3550.                      then the vpi_vid field contains the 32-bit identifier for 
  3551.                      that volume. If the media does not contain such a boot 
  3552.                      sector, the FSD must generate a unique label for the media 
  3553.                      and place it into the vpi_vid field. 
  3554.  
  3555.  pvpfsd              is a pointer to the file-system-dependent portion of VPB. 
  3556.  
  3557.                      The FSD may store information as necessary into this area. 
  3558.  
  3559.  hVPB                is the handle to the volume 
  3560.  
  3561.  pBoot               is a pointer to sector 0 read from the media. 
  3562.  
  3563.                      This pointer is only valid when flag == 0.The buffer the 
  3564.                      pointer refers to must not be modified. The pointer is 
  3565.                      always valid and does not need to be verified when flag == 
  3566.                      0. If a read error occurred, the buffer will contain 
  3567.                      zeroes. 
  3568.  
  3569.  Remarks 
  3570.  
  3571.  The FSD examines the volume presented and determine whether it recognizes the 
  3572.  file system. If it does, it returns zero, after having filled in appropriate 
  3573.  parts of the vpfsi and vpfsd data structures. The vpi_vid and vpi_text fields 
  3574.  must be filled in by the FSD. If the FSD has an OS/2 format boot sector, it 
  3575.  must convert the label from the media into ASCIIZ form.  The vpi_hDev field is 
  3576.  filled in by OS/2. If the volume is unrecognized, the driver returns non-zero. 
  3577.  
  3578.  The vpi_text and vpi_vid must be updated by the FSD each time these values 
  3579.  change. 
  3580.  
  3581.  The contents of the vpfsd data structure are as follows: 
  3582.  
  3583.  FLAG = 0            The FSD is expected to issue an FSD_FINDDUPHVPB to see if 
  3584.                      a duplicate VPB exists. If one does exist, the VPB fs 
  3585.                      dependent area of the new VPB is invalid and the new VPB 
  3586.                      will be unmounted after the FSD returns from the MOUNT. 
  3587.                      The FSD is expected to update the FS dependent area of the 
  3588.                      old duplicate VPB. If no duplicate VPB exists, the FSD 
  3589.                      should initialize the FS dependent area. 
  3590.  
  3591.  FLAG = 1            VPB FS dependent part is same as when FSD last modified 
  3592.                      it. 
  3593.  
  3594.  FLAG = 2            VPB FS dependent part is same as when FSD last modified 
  3595.                      it. 
  3596.  
  3597.  After media recognition time, the volume parameters may be examined using the 
  3598.  FSH_GETVOLPARM call. The volume parameters should not be changed after media 
  3599.  recognition time. 
  3600.  
  3601.  During a mount request, the FSD may examine other sectors on the media by 
  3602.  using FSH_DOVOLIO to perform the I/O. If an uncertain-media return is 
  3603.  detected, the FSD is expected to clean up and return an UNCERTAIN MEDIA error 
  3604.  in order to allow the volume mount logic to restart on the newly-inserted 
  3605.  media. The FSD must provide the buffer to use for additional I/O. 
  3606.  
  3607.  The OS/2 kernel manages the VPB through a reference count. All volume- 
  3608.  specific objects are labeled with the appropriate volume handle and represent 
  3609.  references to the VPB. When all kernel references to a volume disappear, 
  3610.  FS_MOUNT is called with flag == 2, indicating a dismount request. 
  3611.  
  3612.  When the kernel detects that a volume has been removed from its driver, but 
  3613.  there are still outstanding references to the volume, FS_MOUNT is called with 
  3614.  flag == 1 to allow the FSD to drop clean (or other regenerable) data for the 
  3615.  volume. Data which is dirty and cannot be regenerated should be kept so that 
  3616.  it may be written to the volume when it is remounted in the drive. 
  3617.  
  3618.  When a volume is to be formatted for use with an FSD, the kernel calls the 
  3619.  FSD's FS_MOUNT entry point with flag == 3 to allow the FSD to prepare for the 
  3620.  format operation. The FSD should accept the volume even if it is not a volume 
  3621.  of the type that FSD recognizes, since the point of format is to change the 
  3622.  file system on the volume. The operation may fail if formatting does not make 
  3623.  sense. (For example, an FSD which supports only CD-ROM.) 
  3624.  
  3625.  Since the hardware does not allow for kernel-mediated removal of media, it is 
  3626.  certain that the unmount request is issued when the volume is not present in 
  3627.  any drive. 
  3628.  
  3629.  
  3630. ΓòÉΓòÉΓòÉ 5.30. FS_MOVE - Move a file or subdirectory ΓòÉΓòÉΓòÉ
  3631.  
  3632. Purpose 
  3633.  
  3634. Moves (renames) the specified file or subdirectory. 
  3635.  
  3636. Calling Sequence 
  3637.  
  3638. int far pascal FS_MOVE(pcdfsi, pcdfsd, pSrc, iSrcCurDirEnd, pDst,
  3639.                        iDstCurDirEnd, flags)
  3640.  
  3641. struct cdfsi far * pcdfsi;
  3642. struct cdfsd far * pcdfsd;
  3643. char far * pSrc;
  3644. unsigned short iSrcCurDirEnd;
  3645. char far * pDst;
  3646. unsigned short iDstCurDirEnd;
  3647. unsigned short flags;
  3648.  
  3649. Where 
  3650.  
  3651.  pcdfsi              is a pointer to the file-system-independent working 
  3652.                      directory structure. 
  3653.  
  3654.  pcdfsd              is a pointer to the file-system-dependent working 
  3655.                      directory structure. 
  3656.  
  3657.  pSrc                is a pointer to the ASCIIZ name of the source file or 
  3658.                      directory. 
  3659.  
  3660.                      The FSD does not need to verify this pointer. 
  3661.  
  3662.  iSrcCurDirEnd       is the index of the end of the current directory in pSrc. 
  3663.  
  3664.                      This is used to optimize FSD path processing. If 
  3665.                      iSrcCurDirEnd == -1 there is no current directory relevant 
  3666.                      to the source name text. 
  3667.  
  3668.  pDst                is a pointer to the ASCIIZ name of the destination file or 
  3669.                      directory. 
  3670.  
  3671.                      The FSD does not need to verify this pointer. 
  3672.  
  3673.  iDstCurDirEnd       is the index of the end of the current directory in pDst. 
  3674.  
  3675.                      This is used to optimize FSD path processing. If 
  3676.                      iDstCurDirEnd == -1 there is no current directory relevant 
  3677.                      to the destination name text. 
  3678.  
  3679.  flags               indicates destination name type. 
  3680.  
  3681.                      Flags == 0x0040 indicates non-8.3 filename format. All 
  3682.                      other values are reserved. 
  3683.  
  3684.  Remarks 
  3685.  
  3686.  The file specified in filename should be moved to or renamed as the 
  3687.  destination filename, if possible. 
  3688.  
  3689.  Neither the source nor the destination filename may contain wildcard 
  3690.  characters. 
  3691.  
  3692.  FS_MOVE may be used to change the case in filenames. 
  3693.  
  3694.  The non-8.3 filename format attribute in the directory entry for the 
  3695.  destination name should be set according to the value in flags. 
  3696.  
  3697.  In the case of a subdirectory move, the system does the following checking: 
  3698.  
  3699.  o No files in this directory or its subdirectories are open. 
  3700.  o This directory or any of its subdirectories is not the current directory for 
  3701.    any process in the system. 
  3702.  
  3703.  In addition, the system also checks for circularity in source and target 
  3704.  directory names; that is, the source directory is not a prefix of the target 
  3705.  directory. 
  3706.  
  3707.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  3708.  FSH_PROBEBUF where appropriate. 
  3709.  
  3710.  
  3711. ΓòÉΓòÉΓòÉ 5.31. FS_NEWSIZE - Change File's Logical Size ΓòÉΓòÉΓòÉ
  3712.  
  3713. Purpose 
  3714.  
  3715. Changes a file's logical (EOD) size. 
  3716.  
  3717. Calling Sequence 
  3718.  
  3719. int far pascal FS_NEWSIZE(psffsi, psffsd, len, IOflag)
  3720.  
  3721. struct sffsi far * psffsi;
  3722. struct sffsd far * psffsd;
  3723. unsigned long len;
  3724. unsigned short IOflag;
  3725.  
  3726. Where 
  3727.  
  3728.  psffsi              is a pointer to the file-system-independent portion of an 
  3729.                      open file instance. 
  3730.  
  3731.  psffsd              is a pointer to the file-system-dependent portion of an 
  3732.                      open file instance. 
  3733.  
  3734.  len                 is the desired new length of the file. 
  3735.  
  3736.  IOflag              indicates information about the operation on the handle. 
  3737.  
  3738.                      IOflag == 0x0010 indicates write-through. 
  3739.                      IOflag == 0x0020 indicates no-cache. 
  3740.  
  3741.  Remarks 
  3742.  
  3743.  The FSD should return an error if an attempt is made to write beyond the end 
  3744.  with a direct access device handle. 
  3745.  
  3746.  The file system driver attempts to set the size (EOD) of the file to newsize 
  3747.  and update sfi_size, if successful. If the new size is larger than the 
  3748.  currently allocated size, the file system driver arranges for for efficient 
  3749.  access to the newly-allocated storage. 
  3750.  
  3751.  Of the information passed in IOflag, the write-through bit is a mandatory bit 
  3752.  in that any data written to the block device must be put out on the medium 
  3753.  before the device driver returns. The no-cache bit, on the other hand, is an 
  3754.  advisory bit that says whether the data being transferred is worth caching or 
  3755.  not. 
  3756.  
  3757.  
  3758. ΓòÉΓòÉΓòÉ 5.32. FS_NMPIPE - Do a remote named pipe operation. ΓòÉΓòÉΓòÉ
  3759.  
  3760. Purpose 
  3761.  
  3762. Perform a special purpose named pipe operation remotely. 
  3763.  
  3764. Calling Sequence 
  3765.  
  3766. int far pascal FS_NMPIPE(psffsi, psffsd, OpType, pOpRec, pData, pName)
  3767.  
  3768. struct sffsi far * psffsi;
  3769. struct sffsd far * psffsd;
  3770. unsigned short OpType;
  3771. union npoper far * pOpRec;
  3772. char far * pData;
  3773. char far * pName;
  3774.  
  3775. Where 
  3776.  
  3777.  psffsi              is a pointer to the file-system-independent portion of an 
  3778.                      open file instance. 
  3779.  
  3780.  psffsd              is a pointer to the file-system-dependent portion of an 
  3781.                      open file instance. 
  3782.  
  3783.  OpType              is the operation to be performed. This parameter has the 
  3784.                      following values: 
  3785.  
  3786.                                           NMP_GetPHandState    0x21
  3787.                                           NMP_SetPHandState    0x01
  3788.                                           NMP_PipeQInfo        0x22
  3789.                                           NMP_PeekPipe         0x23
  3790.                                           NMP_ConnectPipe      0x24
  3791.                                           NMP_DisconnectPipe   0x25
  3792.                                           NMP_TransactPipe     0x26
  3793.                                           NMP_ReadRaw          0x11
  3794.                                           NMP_WriteRaw         0x31
  3795.                                           NMP_WaitPipe         0x53
  3796.                                           NMP_CallPipe         0x54
  3797.                                           NMP_QNmPipeSemState  0x58
  3798.  
  3799.  pOpRec              is the data record which varies depending on the value of 
  3800.                      OpType. The first parameter in each structure encodes the 
  3801.                      length of the parameter block. The second parameter, if 
  3802.                      non-zero, indicates that the pData parameter is supplied 
  3803.                      and gives its length. The following record formats are 
  3804.                      used: 
  3805.  
  3806.                                           union npoper {
  3807.                                               struct phs_param phs;
  3808.                                               struct npi_param npi;
  3809.                                               struct npr_param npr;
  3810.                                               struct npw_param npw;
  3811.                                               struct npq_param npq;
  3812.                                               struct npx_param npx;
  3813.                                               struct npp_param npp;
  3814.                                               struct npt_param npt;
  3815.                                               struct qnps_param qnps;
  3816.                                               struct npc_param npc;
  3817.                                               struct npd_param npd;
  3818.                                           };
  3819.  
  3820.                                           /* Get/SetPhandState parameter block */
  3821.  
  3822.                                           struct phs_param {
  3823.                                               short phs_len;
  3824.                                               short phs_dlen;
  3825.                                               short phs_pmode; /* pipe mode set or returned */
  3826.                                           };
  3827.  
  3828.                                           /* DosQNmPipeInfo parameter block */
  3829.                                           struct npi_param {
  3830.                                               short npi_len;
  3831.                                               short npi_dlen;
  3832.                                               short npi_level; /* information level desired */
  3833.                                           };
  3834.  
  3835.                                           /* DosRawReadNmPipe parameters */
  3836.                                           /* data is buffer addr         */
  3837.  
  3838.                                           struct npr_param {
  3839.                                               short npr_len;
  3840.                                               short npr_dlen;
  3841.                                               short npr_nbyt; /* number of bytes read */
  3842.                                           };
  3843.  
  3844.  
  3845.                                           /* DosRawWriteNmPipe parameters */
  3846.                                           /* data is buffer addr          */
  3847.  
  3848.                                           struct npw_param {
  3849.                                               short npw_len;
  3850.                                               short npw_dlen;
  3851.                                               short npw_nbyt; /* number of bytes written */
  3852.                                           };
  3853.  
  3854.                                           /* NPipeWait parameters */
  3855.  
  3856.                                           struct npq_param {
  3857.                                               short npq_len;
  3858.                                               short npq_dlen;
  3859.                                               long npq_timeo;  /* time-out in milliseconds */
  3860.                                               short npq_prio;  /* priority of caller       */
  3861.                                           };
  3862.  
  3863.                                           /* DosCallNmPipe parameters */
  3864.                                           /* data is in-buffer addr   */
  3865.  
  3866.                                           struct npx_param {
  3867.                                               short npx_len;
  3868.                                               unsigned short npx_ilen;  /* length of in-buffer      */
  3869.                                               char far * npx_obuf;      /* pointer to out-buffer    */
  3870.                                               unsigned short npx_ilen;  /* length of out-buffer     */
  3871.                                               unsigned short npx_nbyt;  /* number of bytes read     */
  3872.                                               long npx_timeo;           /* time-out in milliseconds */
  3873.                                           };
  3874.  
  3875.                                           /* PeekPipe parameters, data is buffer addr */
  3876.  
  3877.                                           struct npp_param {
  3878.                                               short npp_len;
  3879.                                               unsigned short npp_dlen;
  3880.                                               unsigned short npp_nbyt;   /* number of bytes read      */
  3881.                                               unsigned short npp_av10;   /* bytes left in pipe        */
  3882.                                               unsigned short npp_av11;   /* bytes left in current msg */
  3883.                                               unsigned short npp_state;  /* pipe state                */
  3884.                                           };
  3885.  
  3886.                                           /* DosTransactNmPipe parameters */
  3887.                                           /* data is in-buffer addr       */
  3888.  
  3889.                                           struct npt_param {
  3890.                                               short npt_len;
  3891.                                               unsigned short npt_ilen;  /* length of in-buffer   */
  3892.                                               char far * npt_obuf;      /* pointer to out-buffer */
  3893.                                               unsigned short npt_olen;  /* length of out-buffer  */
  3894.                                               unsigned short npt_nbyt;  /* number of bytes read  */
  3895.                                           };
  3896.  
  3897.                                           /* QNmPipeSemState parameter block */ /* data is user data buffer */
  3898.  
  3899.                                           struct qnps_param {
  3900.                                               unsigned short qnps_len;  /* length of parameter block      */
  3901.                                               unsigned short qnps_dlen;  /* length of supplied data block */
  3902.                                               long qnps_semh;            /* system semaphore handle       */
  3903.                                               unsigned short qnps_nbyt;  /* number of bytes returned      */
  3904.                                           };
  3905.  
  3906.                                           /* ConnectPipe parameter block, no data block */
  3907.  
  3908.                                           struct npc_param {
  3909.                                               unsigned short npc_len;   /* length of parameter block */
  3910.                                               unsigned short npc_dlen;  /* length of data block      */
  3911.                                           };
  3912.  
  3913.                                           /* DisconnectPipe parameter block, no data block */
  3914.  
  3915.                                           struct npd_param {
  3916.                                               unsigned short npd_len;   /* length of parameter block */
  3917.                                               unsigned short npd_dlen;  /* length of data block      */
  3918.                                           };
  3919.  
  3920.  pData               is a pointer to a user data for operations which require 
  3921.                      it. When the pointer is supplied, its length will be given 
  3922.                      by the second element of the pOpRec structure. 
  3923.  
  3924.  pName               is a pointer to a remote pipe name. Supplied only for 
  3925.                      NMP_WAITPIPE and NMP_CALLPIPE operations. For these two 
  3926.                      operations only, the psffsi and psffsd parameters have no 
  3927.                      significance. 
  3928.  
  3929.  Remarks 
  3930.  
  3931.  This entry point is for support of special remote named pipe operations. Not 
  3932.  all pointer parameters are used for all operations. In cases where a 
  3933.  particular pointer has no significance, it will be NULL. 
  3934.  
  3935.  This entry point will be called only for the UNC FSD. Non-UNC FSDs are 
  3936.  required to have this entry point, but should return NOT SUPPORTED if called. 
  3937.  
  3938.  
  3939. ΓòÉΓòÉΓòÉ 5.33. FS_OPENCREATE - Open a file ΓòÉΓòÉΓòÉ
  3940.  
  3941. Purpose 
  3942.  
  3943. Opens (or creates) the specified file. 
  3944.  
  3945. Calling Sequence 
  3946.  
  3947. int far pascal FS_OPENCREATE(pcdfsi, pcdfsd, pName, iCurDirEnd, psffsi,
  3948.                              psffsd, ulOpenMode, usOpenFlag, pusAction,
  3949.                              usAttr, pcEABuf, pfgenflag)
  3950.  
  3951. struct cdfsi far * pcdfsi;
  3952. struct cdfsd far * pcdfsd;
  3953. char far * pName;
  3954. unsigned short iCurDirEnd;
  3955. struct sffsi far * psffsi;
  3956. struct sffsd far * psffsd;
  3957. unsigned long ulOpenMode;
  3958. unsigned short usOpenFlag;
  3959. unsigned short far * pusAction;
  3960. unsigned short usAttr;
  3961. char far * pcEABuf;
  3962. unsigned short far * pfgenflag;
  3963.  
  3964. Where 
  3965.  
  3966.  pcdfsi              is a pointer to the file-system-independent working 
  3967.                      directory structure. 
  3968.  
  3969.                      The contents of this structure are invalid for direct 
  3970.                      access opens. 
  3971.  
  3972.  pcdfsd              is a pointer to the file-system-dependent working 
  3973.                      directory structure. The contents of this structure are 
  3974.                      invalid for direct access opens. For remote character 
  3975.                      devices, this field contains a pointer to a DWORD that was 
  3976.                      obtained from the remote FSD when the remote device was 
  3977.                      attached to this FSD. The FSD can use this DWORD to 
  3978.                      identify the remote device. 
  3979.  
  3980.  pName               is a pointer to the ASCIIZ name of the file to be opened. 
  3981.  
  3982.                      The FSD does not need to verify this pointer. 
  3983.  
  3984.  iCurDirEnd          is the index of the end of the current directory in pName. 
  3985.  
  3986.                      This is used to optimize FSD path processing. If 
  3987.                      iCurDirEnd == -1, there is no current directory relevant 
  3988.                      to the name text, that is a device. This value is invalid 
  3989.                      for direct access opens. 
  3990.  
  3991.  psffsi              is a pointer to the file-system-independent portion of an 
  3992.                      open file instance. 
  3993.  
  3994.  psffsd              is a pointer to the file-system-dependent portion of an 
  3995.                      open file instance. 
  3996.  
  3997.  ulOpenMode          indicates the desired sharing mode and access mode for the 
  3998.                      file handle. 
  3999.  
  4000.                      See OS/2 Version 2.0 Control Program Programming Reference 
  4001.                      for a description of the OpenMode parameter for DosOpen. 
  4002.  
  4003.                      An additional access mode 3 is defined when the file is 
  4004.                      being opened on behalf of OS/2, loaded for purposes of 
  4005.                      executing a file or loading a module. If the file system 
  4006.                      does not support an executable attribute, it should treat 
  4007.                      this access mode as open for reading. The value of 
  4008.                      ulOpenMode passed to the FSD will be valid. 
  4009.  
  4010.  usOpenFlag          indicates the action taken when the file is present or 
  4011.                      absent. 
  4012.  
  4013.                      See OS/2 Version 2.0 Control Program Programming Reference 
  4014.                      for a description of the usOpenFlag parameter for DosOpen. 
  4015.  
  4016.                      The value of openflag passed to the FSD is valid. This 
  4017.                      value is invalid for direct access opens. 
  4018.  
  4019.  pusAction           is the location where the FSD returns a description of the 
  4020.                      action taken as governed by openflag. 
  4021.  
  4022.                      The FSD does not need to verify this pointer.  The 
  4023.                      contents of Action are invalid on return for direct access 
  4024.                      opens. 
  4025.  
  4026.  usAttr              are the OS/2 file attributes. 
  4027.  
  4028.                      This value is invalid for direct access opens. 
  4029.  
  4030.  pcEABuf             is a pointer to the extended attribute buffer. 
  4031.  
  4032.                      This buffer contains attributes that will be set upon 
  4033.                      creation of a new file or upon replacement of an existing 
  4034.                      file. If NULL, no extended attributes are to be set. 
  4035.                      Addressing of this data area has not been validated by the 
  4036.                      OS/2 kernel (see FSH_PROBEBUF). The contents of EABuf are 
  4037.                      invalid on return for direct access opens. 
  4038.  
  4039.  pfgenflag           is a pointer to an unsigned short of flags returned by the 
  4040.                      FSD. The only flag currently defined is 0x0001 fGenNeedEA, 
  4041.                      which indicates that there are critical EAs associated 
  4042.                      with the file. The FSD does not need to verify this 
  4043.                      pointer. 
  4044.  
  4045.  Remarks 
  4046.  
  4047.  For the file create operation, if successful, ST_CREAT and ST_PCREAT are set. 
  4048.  This causes the file to have zero as last read and last write time. If the 
  4049.  last read/write time stamps are to be the same as the create time, simply set 
  4050.  ST_SWRITE, ST_PWRITE, ST_SREAD, and ST_PREAD as well. 
  4051.  
  4052.  For the file open operation, the FSD copies all supported time stamps from the 
  4053.  directory entry into the SFT. 
  4054.  
  4055.  Note:  ALSO NEW FOR 2.0, it is suggested that the FSD copy the DOS file 
  4056.  attributes from the directory entry into the SFT. This allows the FSD and the 
  4057.  OS2 kernel to handle FCB opens more efficiently. 
  4058.  
  4059.  The sharing mode may be zero if this is a request to open a file from the DOS 
  4060.  mode or for an FCB request. 
  4061.  
  4062.  FCB requests for read-write access to a read-only file are mapped to read-only 
  4063.  access and reflected in the sfi_mode field by the FSD.  An FCB request is 
  4064.  indicated by the third bit set in the sfi_type field. 
  4065.  
  4066.  The flags defined for the sfi_type field are: 
  4067.  
  4068.  o type == 0x0000 indicates file. 
  4069.  o type == 0x0001 indicates device. 
  4070.  o type == 0x0002 indicates named pipe. 
  4071.  o type == 0x0004 indicates FCB open. 
  4072.  o All other values are reserved. 
  4073.  
  4074.  FSDs are required to initialize the sfi_type field, preserving the FCB bit. 
  4075.  
  4076.  On entry, the sfi_hvpb field is filled in. If the file's logical size (EOD) is 
  4077.  specified, it is passed in the sfi_size field. To the extent possible, the 
  4078.  file system tries to allocate this much storage for efficient access. 
  4079.  
  4080.  Extended attributes are set for: 
  4081.  
  4082.  o the creation ofa new file 
  4083.  o the truncation of an existing file 
  4084.  o the replacement of an existing file. 
  4085.  
  4086.  They are not set for a normal open. 
  4087.  
  4088.  If the standard OS/2 file creation attributes are specified, they are passed 
  4089.  in the attr field. To the extent possible, the file system interprets the 
  4090.  extended attributes and applies them to the newly-created or existing file. 
  4091.  Extended attributes (EAs) that the file system does not itself use are 
  4092.  retained with the file and not discarded or rejected. 
  4093.  
  4094.  When replacing an existing file, the FSD should not change the case of the 
  4095.  existing file. 
  4096.  
  4097.  FSDs are required to support direct access opens. These are indicated by a bit 
  4098.  set in the sffsi.sfi_mode field. See OS/2 Version 2.0 Control Program 
  4099.  Programming Reference for more information on DosOpen. Some of the parameters 
  4100.  passed to the FSD for direct access opens are invalid, as described above. 
  4101.  
  4102.  On a successful return, the following fields in the sffsi structure must be 
  4103.  filled in by the file system driver: sfi_size and all the time and date 
  4104.  fields. 
  4105.  
  4106.  The file-system-dependent portion of an open file instance passed to the FSD 
  4107.  for FS_OPENCREATE is never initialized. 
  4108.  
  4109.  Infinite FCB opens of the same file by the same DOS mode process is supported. 
  4110.  The first open is passed through to the FSD. Subsequent opens are not seen by 
  4111.  the FSD. 
  4112.  
  4113.  Any non-zero value returned by the FSD indicates that the open failed and the 
  4114.  file is not open. 
  4115.  
  4116.  Note:  This entry point's parameter list definition has changed from the 1.x 
  4117.  IFS document. The OpenMode parameter has been widened from a unsigned short to 
  4118.  a unsigned long. The upper word of the long is relevant only to a special 
  4119.  SPOOLER FSD. For information about the upper word please contact the OS/2 
  4120.  Techinal Interface group for the OEMI document for the 2.0 API 
  4121.  
  4122.  
  4123. ΓòÉΓòÉΓòÉ 5.34. FS_OPENPAGEFILE - Create paging file and handle ΓòÉΓòÉΓòÉ
  4124.  
  4125. Purpose 
  4126.  
  4127. Creates/opens the paging file for the Pager. 
  4128.  
  4129. Calling Sequence 
  4130.  
  4131. int far pascal FS_OPENPAGEFILE(pFlags, pcMaxReq, pName, psffsi, psffsd,
  4132.                                usOpenMode, usOpenFlag, usAttr, Reserved)
  4133.  
  4134. unsigned long far * pFlag;
  4135. unsigned long far * pcMaxReq;
  4136. char far * pName;
  4137. struct sffsi far * psffsi;
  4138. struct sffsd far * psffsi;
  4139. unsigned short usOpenMode;
  4140. unsigned short usOpenFlag;
  4141. unsigned short usAttr;
  4142. unsigned long Reserved;
  4143.  
  4144. Where 
  4145.  
  4146.  pFlag               is a pointer to a flag double word for passing of 
  4147.                      information between the pager and the file system. 
  4148.  
  4149.                      pFlag == 0x00000001 indicates first open of the page file. 
  4150.                      pFlag == 0x00004000 indicates physical addresses are 
  4151.                      required in the page list. 
  4152.                      pFlag == 0x00008000 indicates 16:16 virtual addresses are 
  4153.                      required in the page list. 
  4154.  
  4155.                      All other values are reserved. 
  4156.  
  4157.  pcMaxReq            is a pointer to a unsigned long where the FSD places the 
  4158.                      maximum request list length that can be managed by an 
  4159.                      enhanced strategy device driver. 
  4160.  
  4161.  pName               is a pointer to the ASCIIZ path and filename of the paging 
  4162.                      file. 
  4163.  
  4164.  psffsi              is a pointer to the file-system-independent portion of an 
  4165.                      open file instance. 
  4166.  
  4167.  psffsd              is a pointer to the file-system-dependent portion of an 
  4168.                      open file instance. 
  4169.  
  4170.  usOpenMode          indicates the desired sharing mode and access mode for the 
  4171.                      file handle. 
  4172.  
  4173.                      See OS/2 Version 2.0 Control Program Programming Reference 
  4174.                      for a description of the OpenMode parameter for DosOpen. 
  4175.  
  4176.  usOpenFlag          indicates the action taken when the file is present or 
  4177.                      absent. 
  4178.  
  4179.                      See OS/2 Version 2.0 Control Program Programming Reference 
  4180.                      for a description of the usOpenFlag parameter for DosOpen. 
  4181.  
  4182.  usAttr              are the OS/2 file attributes. 
  4183.  
  4184.  Reserved            is a double word parameter reserved for use in the future. 
  4185.  
  4186.  Remarks 
  4187.  
  4188.  Enough information is provided for the FSD to perform a "normal" open/create 
  4189.  call. 
  4190.  
  4191.  Since a page file has special requirements about contiguity of its 
  4192.  allocations, FS_OPENPAGEFILE must assure that any data sectors allocated are 
  4193.  returned (Create call only). FS_ALLOCATEPAGESPACE will be called to handle 
  4194.  file allocation. 
  4195.  
  4196.  If the FSD cannot support the FS_DOPAGEIO (usually due to an disk device 
  4197.  driver which does not support the Extended strategy entry point), the FSD can 
  4198.  return zero (0) for *pcMaxReq. This tells the kernel file system that it must 
  4199.  emulate FS_DOPAGEIO. 
  4200.  
  4201.  The FSD can require either physical or virtual (16:16) addresses for 
  4202.  subsequent calls to FS_DOPAGEIO. This allows an FSD to emulate FS_DOPAGEIO 
  4203.  without having to worry about dealing with physical addresses. 
  4204.  
  4205.  For a detailed description of the Extended Strategy request interface please 
  4206.  see the OS/2 Version 2.0 Physical Device Driver Reference. 
  4207.  
  4208.  
  4209. ΓòÉΓòÉΓòÉ 5.35. FS_PATHINFO - Query/Set a File's Information ΓòÉΓòÉΓòÉ
  4210.  
  4211. Purpose 
  4212.  
  4213. Returns information for a specific path or file. 
  4214.  
  4215. Calling Sequence 
  4216.  
  4217. int far pascal FS_PATHINFO(flag, pcdfsi, pcdfsd, pName, iCurDirEnd, level,
  4218.                            pData, cbData)
  4219.  
  4220. unsigned short flag;
  4221. struct cdfsi far * pcdfsi;
  4222. struct cdfsd far * pcdfsd;
  4223. char far * pName;
  4224. unsigned short iCurDirEnd;
  4225. unsigned short level;
  4226. char far * pData;
  4227. unsigned short cbData;
  4228.  
  4229. Where 
  4230.  
  4231.  flag                indicates retrieval or setting of information. 
  4232.  
  4233.                      flag == 0x0000 indicates retrieving information 
  4234.                      flag == 0x0001 indicates setting information on the media 
  4235.                      flag == 0x0010 indicates that the information being set 
  4236.                      must be written-through onto the disk before returning. 
  4237.                      This bit is never set when retrieving information. 
  4238.  
  4239.                      All other values are reserved. 
  4240.  
  4241.  pcdfsi              is a pointer the file-system-independent working directory 
  4242.                      structure. 
  4243.  
  4244.  pcdfsd              is a pointer to the file-system-dependent working 
  4245.                      directory structure. 
  4246.  
  4247.  pName               is a pointer to the ASCIIZ name of the file or directory 
  4248.                      for which information is to be retrieved or set. 
  4249.  
  4250.                      The FSD does not need to verify this pointer. 
  4251.  
  4252.  iCurDirEnd          is the index of the end of the current directory in pName. 
  4253.  
  4254.                      This is used to optimize FSD path processing. If 
  4255.                      iCurDirEnd == -1, there is no current directory relevant 
  4256.                      to the name text, that is a device. 
  4257.  
  4258.  level               is the information level to be returned. 
  4259.  
  4260.                      Level selects among a series of data structures to be 
  4261.                      returned or set. 
  4262.  
  4263.  pData               is the address of the application data area. 
  4264.  
  4265.                      Addressing of this data area is not validated by the 
  4266.                      kernel (see FSH_PROBEBUF). When retrieval (flag == 0) is 
  4267.                      specified, the FSD places the information into the buffer. 
  4268.                      When outputting information to a file (flag == 1), the FSD 
  4269.                      retrieves that data from the application buffer. 
  4270.  
  4271.  cbData              is the length of the application data area. 
  4272.  
  4273.                      For flag == 0, this is the length of the data the 
  4274.                      application wishes to retrieve. If there is not enough 
  4275.                      room for the entire level of data to be returned, the FSD 
  4276.                      returns a BUFFER OVERFLOW error. For flag == 1, this is 
  4277.                      the length of data to be applied to the file. 
  4278.  
  4279.  Remarks 
  4280.  
  4281.  See the descriptions of DosQPathInfo and DosSetPathInfo in the OS/2 Version 
  4282.  2.0 Control Program Programming Reference for details on information levels. 
  4283.  
  4284.  The FSD will not be called for DosQPathInfo level 5. 
  4285.  
  4286.  FSDs that are case-preserving (like HPFS) can decide to accept level 7 
  4287.  requests. A level 7 DosQueryPathInfo request asks the FSD to fill the pData 
  4288.  buffer with the case-preserved path and filename of the path/filename passed 
  4289.  in pName. Routing of level 7 requests will be determined by the kernel by 
  4290.  checking the LV7 bit in a FSD's attribute double word. 
  4291.  
  4292.  
  4293. ΓòÉΓòÉΓòÉ 5.36. FS_PROCESSNAME - Allow FSD to modify name after OS/2 canonicalization ΓòÉΓòÉΓòÉ
  4294.  
  4295. Purpose 
  4296.  
  4297. Allow an FSD to modify filename to its own specification after the OS/2 
  4298. canonicalization process has completed. 
  4299.  
  4300. Calling Sequence 
  4301.  
  4302. int far pascal FS_PROCESSNAME(pNameBuf)
  4303.  
  4304. char far * pNameBuf;
  4305.  
  4306. Where 
  4307.  
  4308.  pNameBuf            is a pointer to the ASCIIZ pathname. 
  4309.  
  4310.                      The FSD should modify the pathname in place. The buffer is 
  4311.                      guaranteed to be the length of the maximum path. The FSD 
  4312.                      does not need to verify this pointer. 
  4313.  
  4314.  Remarks 
  4315.  
  4316.  The resulting name must be within the maximum path length returned by 
  4317.  DosQSysInfo. 
  4318.  
  4319.  This routine allows the FSD to enforce a different naming convention than 
  4320.  OS/2. For example, an FSD could remove blanks embedded in component names or 
  4321.  return an error if it found such blanks. It is called after the OS/2 
  4322.  canonicalization process has succeeded. It is not called for FSH_CANONICALIZE. 
  4323.  
  4324.  This routine is called for all APIs that use pathnames. 
  4325.  
  4326.  This routine must return no error if the function is not supported. 
  4327.  
  4328.  
  4329. ΓòÉΓòÉΓòÉ 5.37. FS_READ - Read from a File ΓòÉΓòÉΓòÉ
  4330.  
  4331. Purpose 
  4332.  
  4333. Read the specified number of bytes from a file to a buffer location. 
  4334.  
  4335. Calling Sequence 
  4336.  
  4337. int far pascal FS_READ(psffsi, psffsd, pData, pLen, IOflag)
  4338.  
  4339. struct sffsi far * psffsi;
  4340. struct sffsd far * psffsd;
  4341. char far * pData;
  4342. unsigned short far * pLen;
  4343. unsigned short IOflag;
  4344.  
  4345. Where 
  4346.  
  4347.  psffsi              is a pointer to the file-system-independent portion of an 
  4348.                      open file instance. 
  4349.  
  4350.                      sfi_position is the location within the file where the 
  4351.                      data is to be read from. The FSD should update the 
  4352.                      sfi_position field. 
  4353.  
  4354.  psffsd              is a pointer to the file-system-dependent portion of an 
  4355.                      open file instance. 
  4356.  
  4357.  pData               is the address of the application data area. 
  4358.  
  4359.                      Addressing of this data area has not been validated by the 
  4360.                      kernel (see FSH_PROBEBUF). 
  4361.  
  4362.  pLen                is a pointer to the length of the application data area. 
  4363.  
  4364.                      On input, this is the number of bytes to be read. On 
  4365.                      output, this is the number of bytes successfully read. If 
  4366.                      the application data area is smaller than the length, no 
  4367.                      transfer is to take place. The FSD will not be called for 
  4368.                      zero length reads. The FSD does not need to verify this 
  4369.                      pointer. 
  4370.  
  4371.  IOflag              indicates information about the operation on the handle. 
  4372.  
  4373.                      IOflag == 0x0010 indicates write-through 
  4374.                      IOflag == 0x0020 indicates no-cache 
  4375.  
  4376.  Remarks 
  4377.  
  4378.  If read is successful and is a file, the FSD should set ST_SREAD and ST_PREAD 
  4379.  to make the kernel time stamp the last modification time in the SFT. 
  4380.  
  4381.  Of the information passed in IOflag, the write-through bit is a mandatory bit 
  4382.  in that any data written to the block device must be put out on the medium 
  4383.  before the device driver returns. The no-cache bit, on the other hand, is an 
  4384.  advisory bit that says whether the data being transferred is worth caching or 
  4385.  not. 
  4386.  
  4387.  
  4388. ΓòÉΓòÉΓòÉ 5.38. FS_RMDIR - Remove Subdirectory ΓòÉΓòÉΓòÉ
  4389.  
  4390. Purpose 
  4391.  
  4392. Removes a subdirectory from the specified disk. 
  4393.  
  4394. Calling Sequence 
  4395.  
  4396. int far pascal FS_RMDIR(pcdfsi, pcdfsd, pName, iCurDirEnd)
  4397.  
  4398. struct cdfsi far * pcdfsi;
  4399. struct cdfsd far * pcdfsd;
  4400. char far * pName;
  4401. unsigned short iCurDirEnd;
  4402.  
  4403. Where 
  4404.  
  4405.  pcdfsi              is a pointer to the file-system-independent working 
  4406.                      directory structure. 
  4407.  
  4408.  pcdfsd              is a pointer to the file-system-dependent working 
  4409.                      directory structure. 
  4410.  
  4411.  pName               is a pointer to the ASCIIZ name of the directory to be 
  4412.                      removed. 
  4413.  
  4414.                      The FSD does not need to verify this pointer. 
  4415.  
  4416.  iCurDirEnd          is the index of the end of the current directory in pName. 
  4417.  
  4418.                      This is used to optimize FSD path processing. If 
  4419.                      iCurDirEnd == -1, there is no directory relevant to the 
  4420.                      name text, that is a device. 
  4421.  
  4422.  Remarks 
  4423.  
  4424.  OS/2 assures that the directory being removed is not the current directory nor 
  4425.  the parent of any current directory of any process. 
  4426.  
  4427.  The FSD should not remove any directory that has entries other than '.' and 
  4428.  '..' in it. 
  4429.  
  4430.  
  4431. ΓòÉΓòÉΓòÉ 5.39. FS_SETSWAP - Notification of swap-file ownership ΓòÉΓòÉΓòÉ
  4432.  
  4433. Purpose 
  4434.  
  4435. Perform whatever actions are necessary to support the swapper. 
  4436.  
  4437. Calling Sequence 
  4438.  
  4439. int far pascal FS_SETSWAP(psffsi, psffsd)
  4440.  
  4441. struct sffsi far * psffsi;
  4442. struct sffsd far * psffsd;
  4443.  
  4444. Where 
  4445.  
  4446.  psffsi              is a pointer to the file-system-independent portion of an 
  4447.                      open file instance of the swapper file. 
  4448.  
  4449.  psffsd              is a pointer to the file-system-dependent portion of an 
  4450.                      open file instance. 
  4451.  
  4452.  Remarks 
  4453.  
  4454.  Swapping does not begin until this call returns successfully. This call is 
  4455.  made during system initialization. 
  4456.  
  4457.  The FSD makes all segments that are relevant to swap-file I/O non-swappable 
  4458.  (see FSH_FORCENOSWAP). This includes any data and code segments accessed 
  4459.  during a read or write. 
  4460.  
  4461.  Any FSD that manages writeable media may be the swapper file system. 
  4462.  
  4463.  FS_SETSWAP may be called more than once for the same or different volumes or 
  4464.  FSDs. 
  4465.  
  4466.  
  4467. ΓòÉΓòÉΓòÉ 5.40. FS_SHUTDOWN - Shutdown file system ΓòÉΓòÉΓòÉ
  4468.  
  4469. Purpose 
  4470.  
  4471. Used to shutdown an FSD in preparation for power-off or IPL. 
  4472.  
  4473. Calling Sequence 
  4474.  
  4475. int far pascal FS_SHUTDOWN(type, reserved)
  4476.  
  4477. unsigned short type;
  4478. unsigned long reserved;
  4479.  
  4480. Where 
  4481.  
  4482.  type                indicates what type of a shutdown operation to perform. 
  4483.  
  4484.                      type == 0 indicates that the shutdown sequence is 
  4485.                      beginning. The kernel will not allow any new I/O calls to 
  4486.                      reach the FSD. The only exception will be I/O to the swap 
  4487.                      file by the swap thread through the FS_READ and FS_WRITE 
  4488.                      entry points. The kernel will still allow any thread to 
  4489.                      call FS_COMMIT, FS_FLUSHBUF and FS_SHUTDOWN. The FSD 
  4490.                      should complete all pending calls that might generate disk 
  4491.                      corruption. 
  4492.  
  4493.                      type == 1 indicates that the shutdown sequence is ending. 
  4494.                      An FS_COMMIT has been called on every SFT open on the FSD 
  4495.                      and following that an FS_FLUSHBUF on all volumes has been 
  4496.                      called. All final clean up activity must be completed 
  4497.                      before this call returns. 
  4498.  
  4499.  reserved            reserved for future expansion. 
  4500.  
  4501.  Remarks 
  4502.  
  4503.  From the perspective of an FSD, the shutdown sequence looks like this: 
  4504.  
  4505.  First, the system will call the FSD's FS_SHUTDOWN entry with type == 0. This 
  4506.  notifies the FSD that the system will begin committing SFTs in preparation for 
  4507.  system power off. The kernel will not allow any new IO calls to the FSD once 
  4508.  it receives this first call, except from the swapper thread. The swapper 
  4509.  thread will continue to call the FS_READ and FS_WRITE entry points to read and 
  4510.  write the swap file. The swapper thread will not attempt to grow or shrink the 
  4511.  swap file nor should the FSD reallocate it. The kernel will continue to allow 
  4512.  FS_COMMIT and FS_FLUSHBUF calls from any thread. This call should not return 
  4513.  from the FSD until disk data modifying calls have completed to insure that a 
  4514.  thread already inside the FSD does not wake and change disk data. 
  4515.  
  4516.  After the first FS_SHUTDOWN call returns, the kernel will start committing 
  4517.  SFTs. The FSD will see a commit for every SFT associated with it. During these 
  4518.  FS_COMMIT calls, the FSD must flush any data associated with these SFTs to 
  4519.  disk. The FSD must not allow any FS_COMMIT or FS_FLUSHBUF call to block 
  4520.  permanently. 
  4521.  
  4522.  Once all of the SFTs associated with the FSD have been committed, FS_SHUTDOWN 
  4523.  will be called with type == 1. This will tell the FSD to flush all buffers to 
  4524.  disk. From this point, the FSD must not buffer any data destined for disk. 
  4525.  Reads and writes to the swap file will continue, but the allocation of the 
  4526.  swap file will not change. Once this call has completed, no file system 
  4527.  corruption should occur if power is shut off. 
  4528.  
  4529.  
  4530. ΓòÉΓòÉΓòÉ 5.41. FS_VERIFYUNCNAME - Verify UNC server ownership ΓòÉΓòÉΓòÉ
  4531.  
  4532. Purpose 
  4533.  
  4534. Used to poll installed UNC FSDs to determine server ownership. 
  4535.  
  4536. Calling Sequence 
  4537.  
  4538. int far pascal FS_VERIFYUNCNAME(flag, pName)
  4539.  
  4540. unsigned short flag;
  4541. char far * pName;
  4542.  
  4543. Where 
  4544.  
  4545.  flag                indicates which "pass" of the poll the FSD is being 
  4546.                      called. 
  4547.  
  4548.                      flag == 0x0000 indicates that this is a pass 1 poll. 
  4549.                      flag == 0x0001 indicates that this is a pass 2 poll. 
  4550.  
  4551.  pName               is a pointer to the ASCIIZ name of the server in UNC 
  4552.                      format. 
  4553.  
  4554.                      The FSD does not need to verify this pointer. 
  4555.  
  4556.  Remarks 
  4557.  
  4558.  What the kernel expects from UNC FSDs for this entry point: 
  4559.  
  4560.  For pass 1, the FSD will be called and passed a pointer to the UNC server 
  4561.  name. It is to respond immediately if it recognizes (manages) the server with 
  4562.  a NO_ERROR return code. This pass expects the that the FSD will be keeping 
  4563.  tables in memory that contain the UNC names of the servers it is currently 
  4564.  servicing. If the UNC name cannot be validated immediately, the FSD should 
  4565.  respond with an error (non-zero) return code. The FSD SHOULD NOT send messages 
  4566.  in an attempt to validate the server name. 
  4567.  
  4568.  For pass 2, the FSD is permitted to do whatever is reasonable, including 
  4569.  sending LAN "are you there" messages, to determine if they are able to service 
  4570.  the request for UNC server. 
  4571.  
  4572.  
  4573. ΓòÉΓòÉΓòÉ 5.42. FS_WRITE - Write to a file ΓòÉΓòÉΓòÉ
  4574.  
  4575. Purpose 
  4576.  
  4577. Write the specified number of bytes to a file from a buffer location. 
  4578.  
  4579. Calling Sequence 
  4580.  
  4581. int far pascal FS_WRITE(psffsi, psffsd, pDat, pLen, IOflag)
  4582.  
  4583. struct sffsi far * psffsi;
  4584. struct sffsd far * psffsd;
  4585. char far * pData;
  4586. unsigned short far * pLen;
  4587. unsigned short IOflag;
  4588.  
  4589. Where 
  4590.  
  4591.  psffsi              is a pointer to the file-system-independent portion of an 
  4592.                      open file instance. 
  4593.  
  4594.                      sfi_position is the location within the file where the 
  4595.                      data is to be written to. The FSD should update the 
  4596.                      sfi_position and sfi_size fields. 
  4597.  
  4598.  psffsd              is a pointer to the file-system-dependent portion of an 
  4599.                      open file instance. 
  4600.  
  4601.  pData               is the address of the application data area. 
  4602.  
  4603.                      Addressing of this data area is not validated by the 
  4604.                      kernel (see FSH_PROBEBUF). 
  4605.  
  4606.  pLen                is a pointer to the length of the application data area. 
  4607.  
  4608.                      On input, this is the number of bytes that are to be 
  4609.                      written. On output, this is the number of bytes 
  4610.                      successfully written. If the application data area is 
  4611.                      smaller than the length, no transfer is to take place. The 
  4612.                      FSD does not need to verify this pointer. 
  4613.  
  4614.  IOflag              indicates information about the operation on the handle. 
  4615.  
  4616.                      IOflag == 0x0010 indicates write-through 
  4617.                      IOflag == 0x0020 indicates no-cache 
  4618.  
  4619.  Remarks 
  4620.  
  4621.  If write is successful and is a file, the FSD should set ST_SWRITE and 
  4622.  ST_PWRITE to make the kernel time stamp the last modification time in the SFT. 
  4623.  
  4624.  The FSD should return an error if an attempt is made to write beyond the end 
  4625.  with a direct access device handle. 
  4626.  
  4627.  Of the information passed in IOflag, the write-through bit is a mandatory bit 
  4628.  in that any data written to the block device must be put out on the medium 
  4629.  before the device driver returns. The no-cache bit, on the other hand, is an 
  4630.  advisory bit that says whether the data being transferred is worth caching or 
  4631.  not. 
  4632.  
  4633.  
  4634. ΓòÉΓòÉΓòÉ 6. FS Helper Functions ΓòÉΓòÉΓòÉ
  4635.  
  4636. The following table summarizes the routines that make up the File System Helper 
  4637. interface between FSDs and the kernel. 
  4638.  
  4639.  
  4640.  FS Helper Routine    Description
  4641.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4642.  FSH_ADDSHARE         Add a name to the sharing set
  4643.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4644.  FSH_BUFSTATE         REMOVED in OS/2 Version 2.0
  4645.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4646.  FSH_CALLDRIVER       Call Device Driver's Extended
  4647.                       Strategy entry point
  4648.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4649.  FSH_CANONICALIZE     Convert pathname to canonical form
  4650.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4651.  FSH_CHECKEANAME      Check EA name validity
  4652.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4653.  FSH_CRITERROR        Signal a hard error to the daemon
  4654.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4655.  FSH_DEVIOCTL         Send IOCTL request to device driver
  4656.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4657.  FSH_DOVOLIO          Volume-based sector-oriented
  4658.                       transfer
  4659.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4660.  FSH_DOVOLIO2         Send volume-based IOCTL request to
  4661.                       device driver.
  4662.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4663.  FSH_FINDCHAR         Find first occurrence of char in
  4664.                       string
  4665.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4666.  FSH_FINDDUPHVPB      Locates equivalent hVPBs
  4667.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4668.  FSH_FLUSHBUF         REMOVED in OS/2 Version 2.0
  4669.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4670.  FSH_FORCENOSWAP      Force segments permanently into
  4671.                       memory
  4672.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4673.  FSH_GETBUF           REMOVED in OS/2 Version 2.0
  4674.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4675.  FSH_GETFIRSTOVERLAPB REMOVED in OS/2 Version 2.0
  4676.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4677.  FSH_GETPRIORITY      Get current thread's I/O priority
  4678.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4679.  FSH_GETVOLPARM       Get VPB data from VPB handle
  4680.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4681.  FSH_INTERR           Signal an internal error
  4682.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4683.  FSH_IOBOOST          Gives the current thread an I/O
  4684.                       priority boost
  4685.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4686.  FSH_IOSEMCLEAR       Clear an I/O-event semaphore
  4687.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4688.  FSH_ISCURDIRPREFIX   Test for a prefix of a current
  4689.                       directory
  4690.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4691.  FSH_LOADCHAR         Load character from a string
  4692.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4693.  FSH_NAMEFROMSFN      Get the full path name from an SFN
  4694.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4695.  FSH_PREVCHAR         Move backward in string
  4696.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4697.  FSH_PROBEBUF         User address validity check
  4698.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4699.  FSH_QSYSINFO         Query system information
  4700.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4701.  FSH_REGISTERPERFCTRS Register a FSD with PERFVIEW
  4702.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4703.  FSH_RELEASEBUF       REMOVED in OS/2 Version 2.0
  4704.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4705.  FSH_REMOVESHARE      Remove a name from the sharing set
  4706.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4707.  FSH_SEGALLOC         Allocate a GDT or LDT segment
  4708.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4709.  FSH_SEGFREE          Release a GDT or LDT segment
  4710.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4711.  FSH_SEGREALLOC       Change segment size
  4712.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4713.  FSH_SEMCLEAR         Clear a semaphore
  4714.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4715.  FSH_SEMREQUEST       Request a semaphore
  4716.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4717.  FSH_SEMSET           Set a semaphore
  4718.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4719.  FSH_SEMSETWAIT       Set a semaphore and wait for clear
  4720.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4721.  FSH_SEMWAIT          Wait for clear
  4722.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4723.  FSH_SETVOLUME        force a volume to be mounted on the
  4724.                       drive
  4725.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4726.  FSH_STORECHAR        Store character into string
  4727.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4728.  FSH_UPPERCASE        Uppercase ASCIIZ string
  4729.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4730.  FSH_WILDMATCH        Match using OS/2 wildcards
  4731.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4732.  FSH_YIELD            Yield CPU to higher priority
  4733.                       threads
  4734.  
  4735. FSDs are loaded as dynamic link libraries and may import services provided by 
  4736. the kernel. These services can be called directly by the file system, passing 
  4737. the relevant parameters. 
  4738.  
  4739. No validation of input parameters is done unless otherwise specified. The FSD 
  4740. calls FSH_PROBEBUF, where appropriate, before calling the FS help routine. 
  4741.  
  4742. When any service returns an error code, the FSD must return to the caller as 
  4743. soon as possible and return the specific error code from the helper to the FS 
  4744. router. 
  4745.  
  4746. There are many deadlocks that may occur as a result of operations issued by 
  4747. FSDs. OS/2 provides no means whereby deadlocks between file systems and 
  4748. applications can be detected. 
  4749.  
  4750.  
  4751. ΓòÉΓòÉΓòÉ 6.1. FSH_ADDSHARE - Add a name to the share set ΓòÉΓòÉΓòÉ
  4752.  
  4753. Purpose 
  4754.  
  4755. This function adds a name to the currently active sharing set. 
  4756.  
  4757. Calling Sequence 
  4758.  
  4759. int far pascal FSH_ADDSHARE(pName, mode, hVPB, phShare)
  4760.  
  4761. char far * pName;
  4762. unsigned short mode;
  4763. unsigned short hVPB;
  4764. unsigned long far * phShare;
  4765.  
  4766. Where 
  4767.  
  4768.  pName 
  4769.     is a pointer to the ASCIIZ name to be added into the share set. 
  4770.  
  4771.     The name must be in canonical form: no '.' or '..' components, uppercase, 
  4772.     no meta characters, and full path name specified. 
  4773.  
  4774.  mode 
  4775.     is the sharing mode and access mode as defined in the DosOpen API. All 
  4776.     other bits (direct open, write-through, etc.) must be zero. 
  4777.  
  4778.  hVPB 
  4779.     is the handle to the volume where the named object is presumed to exist. 
  4780.  
  4781.  phShare 
  4782.     is the pointer to the location where a share handle is stored. This handle 
  4783.     may be passed to FSH_REMOVESHARE. 
  4784.  
  4785.  pName               is a pointer to the ASCIIZ name to be added into the share 
  4786.                      set. 
  4787.  
  4788.                      The name must be in canonical form: no '.' or '..' 
  4789.                      components, uppercase, no meta characters, and full path 
  4790.                      name specified. 
  4791.  
  4792.  mode                is the sharing mode and access mode as defined in the 
  4793.                      DosOpen API. All other bits (direct open, write-through, 
  4794.                      etc.) must be zero. 
  4795.  
  4796.  hVPB                is the handle to the volume where the named object is 
  4797.                      presumed to exist. 
  4798.  
  4799.  phShare             is the pointer to the location where a share handle is 
  4800.                      stored. This handle may be passed to FSH_REMOVESHARE. 
  4801.  
  4802.  Returns 
  4803.  
  4804.  If no error is detected, a zero error code is returned. If an error is 
  4805.  detected, one of the following error codes is returned: 
  4806.  
  4807.  o ERROR_SHARING_VIOLATION 
  4808.    the file is open with a conflicting sharing/access mode. 
  4809.  
  4810.  o ERROR_TOO_MANY_OPEN_FILES 
  4811.    there are too many files open at the present time. 
  4812.  
  4813.  o ERROR_SHARING_BUFFER_EXCEEDED 
  4814.    there is not enough memory to hold sharing information. 
  4815.  
  4816.  o ERROR_INVALID_PARAMETER 
  4817.    invalid bits in mode. 
  4818.  
  4819.  o ERROR_FILENAME_EXCED_RANGE 
  4820.    path name is too long. 
  4821.  
  4822.  Remarks 
  4823.  
  4824.  Do not call FSH_ADDSHARE for character devices. 
  4825.  
  4826.  FSH_ADDSHARE may block. 
  4827.  
  4828.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  4829.  FSH_PROBEBUF where appropriate. 
  4830.  
  4831.  
  4832. ΓòÉΓòÉΓòÉ 6.2. FSH_CALLDRIVER - Call Device Driver's Extended Strategy entry point ΓòÉΓòÉΓòÉ
  4833.  
  4834. Purpose 
  4835.  
  4836. This routine allows FSDs to call a device driver's Extended Strategy entry 
  4837. point. 
  4838.  
  4839. Calling Sequence 
  4840.  
  4841. int far pascal FSH_CALLDRIVER(pPkt, hVPB, fControl)
  4842.  
  4843. void far * pPkt;
  4844. unsigned short hVPB;
  4845. unsigned short fControl;
  4846.  
  4847. Where 
  4848.  
  4849.  pPkt                is a pointer to device driver Extended strategy request 
  4850.                      packet. 
  4851.  
  4852.  hVPB                is the volume handle for the source of I/O. 
  4853.  
  4854.  fControl            is the bit mask of pop-up control actions: 
  4855.  
  4856.                      Bit 0 off indicates volume change pop-up desired 
  4857.                      Bit 0 on indicates no volume change pop-up 
  4858.  
  4859.                      All other bits are reserved and must be zero. 
  4860.  
  4861.  Returns 
  4862.  
  4863.  If no error is detected, a zero error code is returned. If an error is 
  4864.  detected, one of the following error codes is returned: 
  4865.  
  4866.  o ERROR_VOLUME_CHANGED 
  4867.    is an indication that removable media volume change has occurred. 
  4868.  
  4869.  o ERROR_INVALID_PARAMETER 
  4870.    the fControl flag word has reserved bits on. 
  4871.  
  4872.  Remarks 
  4873.  
  4874.  This routine should be called for any Extended strategy requests going to a 
  4875.  drive that has removable media. 
  4876.  
  4877.  For a detailed description of the Extended Strategy request interface please 
  4878.  see the OS/2 Version 2.0 Physical Device Driver Reference 
  4879.  
  4880.  FSH_CALLDRIVER may block. 
  4881.  
  4882.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  4883.  FSH_PROBEBUF where appropriate. 
  4884.  
  4885.  
  4886. ΓòÉΓòÉΓòÉ 6.3. FSH_CANONICALIZE - Convert a path name to a canonical form ΓòÉΓòÉΓòÉ
  4887.  
  4888. Purpose 
  4889.  
  4890. This function converts a path name to a canonical form by processing '.'s and 
  4891. '..'s, uppercasing, and prepending the current directory to non-absolute paths. 
  4892.  
  4893. Calling Sequence 
  4894.  
  4895. int far pascal FSH_CANONICALIZE(pPathName, cbPathBuf, pPathBuf, pFlags)
  4896.  
  4897. char far * pPathName;
  4898. unsigned short cbPathBuf;
  4899. char far * pPathBuf;
  4900. unsigned short far * pFlags;
  4901.  
  4902. Where 
  4903.  
  4904.  pPathName           is a pointer to the ASCIIZ path name to be canonicalized. 
  4905.  
  4906.  cbPathBuf           is the length of path name buffer. 
  4907.  
  4908.  pPathBuf            is the pointer to the buffer into which to copy the 
  4909.                      canonicalized path. 
  4910.  
  4911.  pFlags              is the pointer to flags returned to the FSD. 
  4912.  
  4913.                      Flags == 0x0040 indicates a non-8.3 filename format. All 
  4914.                      other values are reserved. 
  4915.  
  4916.  Returns 
  4917.  
  4918.  If no error is detected, a zero error code is returned. If an error is 
  4919.  detected, one of the following error codes is returned: 
  4920.  
  4921.  o ERROR_PATH_NOT_FOUND 
  4922.    is an invalid path name-too many '..'s 
  4923.  
  4924.  o ERROR_BUFFER_OVERFLOW 
  4925.    the path name is too long. 
  4926.  
  4927.  Remarks 
  4928.  
  4929.  This routine processes DBCS characters properly. 
  4930.  
  4931.  The FSD is responsible for verifying the string pointers and checking for 
  4932.  segment boundaries. 
  4933.  
  4934.  FSH_CANONICALIZE should be called for names passed into the FSD raw data 
  4935.  packets. For example, names passed to FS_FSCTL in the parameter area should be 
  4936.  passed to FSH_CANONICALIZE. This routine does not need to be called for 
  4937.  explicit names passed to the FSD, that is, the name passed to FS_OPENCREATE. 
  4938.  
  4939.  If the canonicalized name is being created as a file or directory, the non-8.3 
  4940.  attribute in the directory entry should be set according to the value returned 
  4941.  in pFlags. 
  4942.  
  4943.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  4944.  FSH_PROBEBUF where appropriate. 
  4945.  
  4946.  
  4947. ΓòÉΓòÉΓòÉ 6.4. FSH_CHECKEANAME - Check for valid EA name ΓòÉΓòÉΓòÉ
  4948.  
  4949. Purpose 
  4950.  
  4951. Check extended attribute name validity. 
  4952.  
  4953. Calling Sequence 
  4954.  
  4955. int far pascal FSH_CHECKEANAME(iLevel, cbEAName, szEAName)
  4956.  
  4957. unsigned short iLevel;
  4958. unsigned long cbEAName;
  4959. char far * szEAName;
  4960.  
  4961. Where 
  4962.  
  4963.  iLevel              is the extended attributes name checking level. 
  4964.  
  4965.                      iLevel = 0x0001 indicates OS/2 Version 2.0 name checking. 
  4966.  
  4967.  cbEAName            is the length of the extended attribute name, not 
  4968.                      including terminating NUL. 
  4969.  
  4970.  szEAName            is the extended attribute name to check for validity. 
  4971.  
  4972.  Returns 
  4973.  
  4974.  If no error is detected, a zero error code is returned. If an error is 
  4975.  detected, one of the following error codes is returned: 
  4976.  
  4977.  o ERROR_INVALID_NAME 
  4978.    pathname contains invalid or wildcard characters, or is too long. 
  4979.  
  4980.  o ERROR_INVALID_PARAMETER 
  4981.    invalid level. 
  4982.  
  4983.  Remarks 
  4984.  
  4985.  This routine processes DBCS characters properly. 
  4986.  
  4987.  The set of invalid characters for EA names is the same as that for filenames. 
  4988.  In OS/2 Version 2.0, the maximum length of an EA name, not including the 
  4989.  terminating NUL, is 255 bytes. The minimum length is 1 byte. 
  4990.  
  4991.  The FSD is responsible for verifying the string pointers and checking for 
  4992.  segment boundaries. 
  4993.  
  4994.  FSH_CHECKEANAME should be called for extended attribute names passed to the 
  4995.  FSD. 
  4996.  
  4997.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  4998.  FSH_PROBEBUF where appropriate. 
  4999.  
  5000.  
  5001. ΓòÉΓòÉΓòÉ 6.5. FSH_CRITERROR - Signal hard error to daemon ΓòÉΓòÉΓòÉ
  5002.  
  5003. Purpose 
  5004.  
  5005. This function signals a hard error to the daemon. 
  5006.  
  5007. Calling Sequence 
  5008.  
  5009. int far pascal FSH_CRITERROR(cbMessage, pMessage, nSubs, pSubs, fAllowed)
  5010.  
  5011. unsigned short cbMessage;
  5012. char far * pMessage;
  5013. unsigned short nSubs;
  5014. char far * pSubs;
  5015. unsigned short fAllowed;
  5016.  
  5017. Where 
  5018.  
  5019.  cbMessage           is the length of the message template. 
  5020.  
  5021.  pMessage            is the pointer to the message template. 
  5022.  
  5023.                      This may contain replaceable parameters in the format used 
  5024.                      by the message retriever. 
  5025.  
  5026.  nSubs               is the number of replaceable parameters. 
  5027.  
  5028.  pSubs               is the pointer to the replacement text. 
  5029.  
  5030.                      The replacement text is a packed set of ASCIIZ strings. 
  5031.  
  5032.  fAllowed            is the bit mask of allowed actions: 
  5033.  
  5034.                      Bit 0x0001 on indicates FAIL allowed 
  5035.                      Bit 0x0002 on indicates ABORT allowed 
  5036.                      Bit 0x0004 on indicates RETRY allowed 
  5037.                      Bit 0x0008 on indicates IGNORE allowed 
  5038.                      Bit 0x0010 on indicates ACKNOWLEDGE only allowed. 
  5039.  
  5040.                      All other bits are reserved and must be zero. If bit 
  5041.                      0x0010 is set, and any or some of bits 0x0001 to 0x0008 
  5042.                      are also set, bit 0x0010 will be ignored. 
  5043.  
  5044.  Returns 
  5045.  
  5046.  This function returns the action to be taken: 
  5047.  
  5048.  0x0000 - ignore 
  5049.  0x0001 - retry 
  5050.  0x0003 - fail 
  5051.  0x0004 - continue 
  5052.  
  5053.  Remarks 
  5054.  
  5055.  If the user responds with an action that is not allowed, it is treated as 
  5056.  FAIL. If FAIL is not allowed, it is treated as ABORT. ABORT is always allowed. 
  5057.  
  5058.  When ABORT is the final action, OS/2 does not return this as an indicator; it 
  5059.  returns a FAIL. The actual ABORT operation is generated when this thread of 
  5060.  execution is about to return to user code. 
  5061.  
  5062.  The maximum length of the template is 128 bytes, including the NUL. The 
  5063.  maximum length of the message with text substitutions is 512 bytes. The 
  5064.  maximum number of substitutions is 9. 
  5065.  
  5066.  If any action other than retry is selected for a given hard error popup, then 
  5067.  any subsequent popups (within the same API call) will be automatically failed; 
  5068.  a popup will not be done. This means that (except for retries) there can be at 
  5069.  most one hard error popup per call to the FSD. And, if the kernel generates a 
  5070.  popup, then the FSD cannot create one. 
  5071.  
  5072.  FSH_CRITERROR will fail automatically if the user application has set 
  5073.  autofail, or if a previous hard error has occurred. 
  5074.  
  5075.  FSH_CRITERROR may block. 
  5076.  
  5077.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  5078.  FSH_PROBEBUF where appropriate. 
  5079.  
  5080.  
  5081. ΓòÉΓòÉΓòÉ 6.6. FSH_DEVIOCTL - Send IOCTL request to device driver ΓòÉΓòÉΓòÉ
  5082.  
  5083. Purpose 
  5084.  
  5085. This function sends an IOCTL request to a device driver. 
  5086.  
  5087. Calling Sequence 
  5088.  
  5089. int far pascal FSH_DEVIOCTL(flag, hDev, sfn, cat, func, pParm, cbParm, pData,
  5090.                             cbData)
  5091.  
  5092. unsigned short flag;
  5093. unsigned long hDev;
  5094. unsigned short sfn;
  5095. unsigned short cat;
  5096. unsigned short func;
  5097. char far * pParm;
  5098. unsigned short cbParm;
  5099. char far * pData;
  5100. unsigned short cbData;
  5101.  
  5102. Where 
  5103.  
  5104.  flag                indicates whether the FSD initiated the call or not. 
  5105.  
  5106.                      IOflag == 0x0000 indicates that the FSD is just passing 
  5107.                      user pointers on to the helper. 
  5108.                      IOflag == 0x0001 indicates that the FSD initiated the 
  5109.                      DevIOCtl call as opposed to passing a DevIOCtl that it had 
  5110.                      received. 
  5111.  
  5112.                      All other bits are reserved. 
  5113.  
  5114.  hDev                is the device handle obtained from VPB 
  5115.  
  5116.  sfn                 is the system file number from open instance that caused 
  5117.                      the FSH_DEVIOCTL call. 
  5118.  
  5119.                      This field should be passed unchanged from the sfi_selfsfn 
  5120.                      field. If no open instance corresponds to this call, this 
  5121.                      field should be set to 0xFFFF. 
  5122.  
  5123.  cat                 is the category of IOCTL to perform. 
  5124.  
  5125.  func                is the function within the category of IOCTL. 
  5126.  
  5127.  pParm               is the long address to the parameter area. 
  5128.  
  5129.  cbParm              is the length of the parameter area. 
  5130.  
  5131.  pData               is the long address to the data area. 
  5132.  
  5133.  cbData              is the length of the data area. 
  5134.  
  5135.  Returns 
  5136.  
  5137.  If no error is detected, a zero error code is returned. If an error is 
  5138.  detected, one of the following error codes is returned: 
  5139.  
  5140.  o ERROR_INVALID_FUNCTION 
  5141.    indicates the function supplied is incompatible with the category and device 
  5142.    handle supplied. 
  5143.  
  5144.  o ERROR_INVALID_CATEGORY 
  5145.    indicates the category supplied is incompatible with the function and device 
  5146.    handle supplied. 
  5147.  
  5148.  o Device driver error code 
  5149.  
  5150.  Remarks 
  5151.  
  5152.  The only category currently supported for this call is 8, which is for the 
  5153.  logical disk. FSDs call FSH_DEVIOCTL to control device driver operation 
  5154.  independently from I/O operations. This is typically in filtering DosDevIOCtl 
  5155.  requests when passing the request on to the device driver. 
  5156.  
  5157.  An FSD needs to be careful of pointers to buffers that are passed to it from 
  5158.  FS_IOCTL, and what it passes to FSH_DEVIOCTL. It is possible that such 
  5159.  pointers may be real mode pointers if the call was made from the DOS mode. In 
  5160.  any case, the FSD must indicate whether it initiated the DevIOCtl call, in 
  5161.  which case the kernel can assume that the pointers are all protect mode 
  5162.  pointers, or if it is passing user pointers on to the FSH_DEVIOCTL call, in 
  5163.  which case the mode of the pointers will depend on whether this is the DOS 
  5164.  mode or not. An important thing to note is that the FSD must not mix user 
  5165.  pointers with its own pointers when using this helper. 
  5166.  
  5167.  FSH_DEVIOCTL may block. 
  5168.  
  5169.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  5170.  FSH_PROBEBUF where appropriate. 
  5171.  
  5172.  
  5173. ΓòÉΓòÉΓòÉ 6.7. FSH_DOVOLIO - Transfer volume-based sector-oriented I/O ΓòÉΓòÉΓòÉ
  5174.  
  5175. Purpose 
  5176.  
  5177. This function performs I/O to the specified volume. 
  5178.  
  5179. Calling Sequence 
  5180.  
  5181. int far pascal FSH_DOVOLIO(operation, fAllowed, hVPB, pData, pcSec, iSec)
  5182.  
  5183. unsigned short operation;
  5184. unsigned short fAllowed;
  5185. unsigned short hVPB;
  5186. char far * pData;
  5187. unsigned short far * pcSec;
  5188. unsigned long iSec;
  5189.  
  5190. Where 
  5191.  
  5192.  operation           is the bit mask indicating 
  5193.                      read/read-bypass/write/write-bypass, and verify- 
  5194.                      after-write/write-through and no-cache operation to be 
  5195.                      performed. 
  5196.  
  5197.                      Bit 0x0001 off indicates read. 
  5198.                      Bit 0x0001 on indicates write. 
  5199.                      Bit 0x0002 off indicates no cache bypass. 
  5200.                      Bit 0x0002 on indicates cache bypass. 
  5201.                      Bit 0x0004 off indicates no verify-after-write operation. 
  5202.                      Bit 0x0004 on indicates verify-after-write operation. 
  5203.                      Bit 0x0008 off indicates errors signaled to the hard error 
  5204.                      daemon. 
  5205.                      Bit 0x0008 on indicates hard errors will be returned 
  5206.                      directly. 
  5207.                      Bit 0x0010 off indicates I/O is not write-through. 
  5208.                      Bit 0x0010 on indicates I/O is write-through. 
  5209.                      Bit 0x0020 off indicates data for this I/O should probably 
  5210.                      be cached. 
  5211.                      Bit 0x0020 on indicates data for this I/O should probably 
  5212.                      not be cached. 
  5213.                      All other bits are reserved and must be zero. 
  5214.  
  5215.                      The difference between the cache bypass and the no cache 
  5216.                      bits is in the type of request packet that the device 
  5217.                      driver will see. With cache bypass, it will get a packet 
  5218.                      with command code 24, 25, or 26. With no cache, it will 
  5219.                      get the extended packets for command codes 4, 8, or 9. The 
  5220.                      advantage of the latter is that the write-through bit can 
  5221.                      also be sent to the device driver in the same packet, 
  5222.                      improving the functionality at the level of the device 
  5223.                      driver. 
  5224.  
  5225.  fAllowed            is a bit mask indicating allowed actions: 
  5226.  
  5227.                      Bit 0x0001 on indicates FAIL allowed 
  5228.                      Bit 0x0002 on indicates ABORT allowed 
  5229.                      Bit 0x0004 on indicates RETRY allowed 
  5230.                      Bit 0x0008 on indicates IGNORE allowed 
  5231.                      Bit 0x0010 on indicates ACKNOWLEDGE only allowed 
  5232.                      If this bit is set, none of the other bits may be set. 
  5233.  
  5234.                      All other bits are reserved and must be set to zero. 
  5235.  
  5236.  hVPB                is the volume handle for the source of I/O. 
  5237.  
  5238.  pData               is the long address of the user transfer area. 
  5239.  
  5240.  pcSec               is the pointer to the number of sectors to be transferred. 
  5241.  
  5242.                      On return, this is the number of sectors successfully 
  5243.                      transferred. 
  5244.  
  5245.  iSec                is the sector number of the first sector of the transfer. 
  5246.  
  5247.  Returns 
  5248.  
  5249.  If no error is detected, a zero error code is returned. If an error is 
  5250.  detected, one of the following error codes is returned: 
  5251.  
  5252.  o ERROR_PROTECTION_VIOLATION 
  5253.    indicates the supplied address/length is invalid. 
  5254.  
  5255.  o ERROR_UNCERTAIN_MEDIA 
  5256.    indicates the device driver can no longer reliably tell if the media has 
  5257.    been changed. 
  5258.  
  5259.    This occurs only within the context of an FS_MOUNT call. 
  5260.  
  5261.  o ERROR_TRANSFER_TOO_LONG 
  5262.    indicates the transfer is too long for the device. 
  5263.  
  5264.  o Device-driver/device-manager errors listed /DDERR/ 
  5265.  
  5266.  Remarks 
  5267.  
  5268.  This function formats a device driver request packet for the requested I/O, 
  5269.  locks the data transfer region, calls the device driver, and reports any 
  5270.  errors to the hard error daemon before returning to the FSD. Any retries 
  5271.  indicated by the hard error daemon or actions indicated by DosError are done 
  5272.  within the call to FSH_DOVOLIO. 
  5273.  
  5274.  FSH_DOVOLIO may be used at all times within the FSD. When called within the 
  5275.  scope of a FS_MOUNT call, it applies to the volume in the drive without regard 
  5276.  to which volume it may be. However, since volume recognition is not complete 
  5277.  until the FSD returns to the FS_MOUNT call, the FSD must be careful when an 
  5278.  ERROR_UNCERTAIN_MEDIA is returned. This indicates the media has gone uncertain 
  5279.  while we are trying to identify the media in the drive. This may indicate the 
  5280.  volume that the FSD was trying to recognize was removed. In that case, the FSD 
  5281.  must release any resources attached to the hVPB passed in the FS_MOUNT call 
  5282.  and return ERROR_UNCERTAIN_MEDIA to the FS_MOUNT call. This will direct the 
  5283.  volume tracking logic to restart the mount process. 
  5284.  
  5285.  OS/2 will validate the user transfer area for proper access and size and will 
  5286.  lock the segment. 
  5287.  
  5288.  Verify-after-write specified on a read is ignored. 
  5289.  
  5290.  On 80386 processors, FSH_DOVOLIO will take care of memory contiguity 
  5291.  requirements of device drivers. It is advisable, therefore, that FSDs use 
  5292.  FSH_DOVOLIO instead of calling device drivers directly. This will improve 
  5293.  performance of FSDs running on 80386 processors. 
  5294.  
  5295.  FSH_DOVOLIO may block. 
  5296.  
  5297.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5298.  FSH_PROBEBUF where appropriate. 
  5299.  
  5300.  
  5301. ΓòÉΓòÉΓòÉ 6.8. FSH_DOVOLIO2 - Send volume-based IOCTL request to device driver ΓòÉΓòÉΓòÉ
  5302.  
  5303. Purpose 
  5304.  
  5305. This function is an FSD call that controls device driver operation 
  5306. independently from I/O operations. 
  5307.  
  5308. Calling Sequence 
  5309.  
  5310. int far pascal FSH_DOVOLIO2(hDev, sfn, cat, func, pParm, cbParm, pData,
  5311.                             cbData)
  5312.  
  5313. unsigned long hDev;
  5314. unsigned short sfn;
  5315. unsigned short cat;
  5316. unsigned short func;
  5317. char far * pParm;
  5318. unsigned short cbParm;
  5319. char far * pData;
  5320. unsigned short cbData;
  5321.  
  5322. Where 
  5323.  
  5324.  hDev                is the device handle obtained from VPB 
  5325.  
  5326.  sfn                 is the system file number from the open instance that 
  5327.                      caused the FSH_DOVOLIO2 call. 
  5328.  
  5329.                      This field should be passed unchanged from the sfi-selfsfn 
  5330.                      field. It no open instance corresponds to this call, this 
  5331.                      field should be set to 0xFFFF. 
  5332.  
  5333.  cat                 is the category of IOCTL to perform. 
  5334.  
  5335.  func                is the function within the category of IOCTL. 
  5336.  
  5337.  pParm               is the long address to the parameter area. 
  5338.  
  5339.  cbParm              is the length of the parameter area. 
  5340.  
  5341.  pData               is the long address to the data area. 
  5342.  
  5343.  cbData              is the length of the data area. 
  5344.  
  5345.  Returns 
  5346.  
  5347.  If no error is detected, a zero error code is returned. If an error is 
  5348.  detected, one of the following error codes is returned: 
  5349.  
  5350.  o ERROR_INVALID_FUNCTION 
  5351.    indicates the function supplied is incompatible with the category and the 
  5352.    device handle supplied. 
  5353.  
  5354.  o ERROR_INVALID_CATEGORY 
  5355.    indicates the category supplied is incompatible with the function and the 
  5356.    device handle supplied. 
  5357.  
  5358.  o Device-driver/device-manager errors listed /DDERR/ 
  5359.  
  5360.  Remarks 
  5361.  
  5362.  This routine supports volume management for IOCTL operations. Any errors are 
  5363.  reported to the hard error daemon before returning to the FSD. Any retries 
  5364.  indicated by the hard error daemon or actions indicated by DosError are done 
  5365.  within the call to FSH_DOVOLIO2. 
  5366.  
  5367.  The purpose of this routine is to enable volume tracking with IOCTLs. It is 
  5368.  not available at the API level. 
  5369.  
  5370.  FSH_DOVOLIO2 may block. 
  5371.  
  5372.  System does normal volume checking for this request. 
  5373.  
  5374.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5375.  FSH_PROBEBUF where appropriate. 
  5376.  
  5377.  
  5378. ΓòÉΓòÉΓòÉ 6.9. FSH_FINDCHAR - Find first occurrence of character in string ΓòÉΓòÉΓòÉ
  5379.  
  5380. Purpose 
  5381.  
  5382. This function provides the mechanism to find the first occurrence of any one of 
  5383. a set of characters in an ASCIIZ string, taking into account DBCS 
  5384. considerations. 
  5385.  
  5386. Calling Sequence 
  5387.  
  5388. int far pascal FSH_FINDCHAR(nChars, pChars, ppStr)
  5389.  
  5390. unsigned short nChars;
  5391. char far * pChars;
  5392. char far * far * ppStr;
  5393.  
  5394. Where 
  5395.  
  5396.  nChars              is the number of characters in the search list. 
  5397.  
  5398.  pChars              is the array of characters to search for. These cannot be 
  5399.                      DBCS characters. 
  5400.  
  5401.                      The NUL character cannot be searched for. 
  5402.  
  5403.  ppSTR               is the pointer to the character pointer where the search 
  5404.                      is to begin. This pointer is updated upon return to point 
  5405.                      to the character found. This must be an ASCIIZ string. 
  5406.  
  5407.  Returns 
  5408.  
  5409.  If no error is detected, a zero error code is returned. If an error is 
  5410.  detected, one of the following error codes is returned: 
  5411.  
  5412.  o ERROR_CHAR_NOT_FOUND 
  5413.    indicates none of the characters were found. 
  5414.  
  5415.  Remarks 
  5416.  
  5417.  The search will continue until a matching character is found or the end of the 
  5418.  string is found. 
  5419.  
  5420.  The FSD is responsible for verifying the string pointers and checking for 
  5421.  segment boundaries. 
  5422.  
  5423.  Note:   OS/2 does not validate input parameters. An FSD, therefore, should 
  5424.  call FSH_PROBEBUF where appropriate. 
  5425.  
  5426.  
  5427. ΓòÉΓòÉΓòÉ 6.10. FSH_FINDDUPHVPB - Locate equivalent hVPB ΓòÉΓòÉΓòÉ
  5428.  
  5429. Purpose 
  5430.  
  5431. This function provides the mechanism to identify a previous instance of a 
  5432. volume during the FS_MOUNT process. 
  5433.  
  5434. Calling Sequence 
  5435.  
  5436. int far pascal FSH_FINDDUPHVPB(hVPB, phVPB)
  5437.  
  5438. unsigned short hVPB;
  5439. unsigned short far * phVPB;
  5440.  
  5441. Where 
  5442.  
  5443.  hVPB                is the handle to the volume to be found. 
  5444.  
  5445.  phVPB               is the pointer to where the handle of matching volume will 
  5446.                      be stored. 
  5447.  
  5448.  Returns 
  5449.  
  5450.  If no error is detected, a zero error code is returned. If an error is 
  5451.  detected, one of the following error codes is returned: 
  5452.  
  5453.  o ERROR_NO_ITEMS 
  5454.    indicates there is no matching hVPB. 
  5455.  
  5456.  Remarks 
  5457.  
  5458.  When OS/2 is recognizing a volume, it calls the FSD to mount the volume. At 
  5459.  this point, the FSD may elect to allocate storage and buffer data for that 
  5460.  volume. The mount process will allocate a new VPB whenever the media becomes 
  5461.  uncertain, that is, when the device driver recognizes it can no longer be 
  5462.  certain the media is unchanged. This VPB cannot be collapsed with a previously 
  5463.  allocated VPB, because of a reinsertion of media, until the FS_MOUNT call 
  5464.  returns. The previous VPB, however, may have some cached data that must be 
  5465.  updated from the media (the media may have been written while it was removed) 
  5466.  FSH_FINDDUPHVPB allows the FSD to find this previous occurrence of the volume 
  5467.  in order to update the cached information for the old VPB. Remember the newly 
  5468.  created VPB will be unmounted if there is another, older VPB for that volume. 
  5469.  
  5470.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5471.  FSH_PROBEBUF where appropriate. 
  5472.  
  5473.  
  5474. ΓòÉΓòÉΓòÉ 6.11. FSH_FORCENOSWAP - Force segments permanently into memory ΓòÉΓòÉΓòÉ
  5475.  
  5476. Purpose 
  5477.  
  5478. This function permanently forces segments into memory. 
  5479.  
  5480. Calling Sequence 
  5481.  
  5482. int far pascal FSH_FORCENOSWAP(sel)
  5483.  
  5484. unsigned short sel;
  5485.  
  5486. Where 
  5487.  
  5488.  sel                 is the selector that is to be made non-swappable. 
  5489.  
  5490.  Returns 
  5491.  
  5492.  If no error is detected, a zero error code is returned. If an error is 
  5493.  detected, one of the following error codes is returned: 
  5494.  
  5495.  o ERROR_INVALID_ACCESS 
  5496.    indicates the selector is invalid. 
  5497.  
  5498.  o ERROR_INVALID_DENIED 
  5499.    indicates the selector is invalid or the sector belongs to another process. 
  5500.  
  5501.  o ERROR_DIRECT_ACCESS_HANDLE 
  5502.    indicates the handle does not refer to a segment. 
  5503.  
  5504.  o ERROR_NOT_ENOUGH_MEMORY 
  5505.    indicates there is not enough physical memory to make a segment 
  5506.    nonswappable. 
  5507.  
  5508.  o ERROR_SWAP_TABLE_FULL 
  5509.    indicates the attempt to grow the swap file failed. 
  5510.  
  5511.  o ERROR_SWAP_FILE_FULL 
  5512.    indicates the attempt to grow the swap file failed. 
  5513.  
  5514.  o ERROR_PMM_INSUFFICIENT_MEMORY 
  5515.    indicates the attempt to grow the swap file failed. 
  5516.  
  5517.  Remarks 
  5518.  
  5519.  An FSD may call FSH_FORCENOSWAP to force segments to be loaded into memory and 
  5520.  marked non-swappable. All segments both in the load image of the FSD and those 
  5521.  allocated via FSH_SEGALLOC are eligible to be marked. There is no way to undo 
  5522.  the effect of FSH_FORCENOSWAP. 
  5523.  
  5524.  If an FSD is notified it is managing the swapping media, it should make this 
  5525.  call for the necessary segments. 
  5526.  
  5527.  An FSD should be prepared to see multiple swapping files on more than one 
  5528.  volume in 80386 processors and in future releases of OS/2. 
  5529.  
  5530.  FSH_FORCENOSWAP may block. 
  5531.  
  5532.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5533.  FSH_PROBEBUF where appropriate. 
  5534.  
  5535.  
  5536. ΓòÉΓòÉΓòÉ 6.12. FSH_GETPRIORITY - Get current thread's I/O priority ΓòÉΓòÉΓòÉ
  5537.  
  5538. Purpose 
  5539.  
  5540. This function allows an FSD to retrieve the I/O priority of the current thread. 
  5541.  
  5542. Calling Sequence 
  5543.  
  5544. int far pascal FSH_GETPRIORITY(void)
  5545.  
  5546. Returns 
  5547.  
  5548. This function returns the I/O of the current thread: 
  5549.  
  5550. 0x0000 - background 
  5551. 0x1111 - foreground 
  5552.  
  5553. Remarks 
  5554.  
  5555. FSH_GETPRIORITY will not block. 
  5556.  
  5557.  
  5558. ΓòÉΓòÉΓòÉ 6.13. FSH_GETVOLPARM - Get VPB data from VPB handle ΓòÉΓòÉΓòÉ
  5559.  
  5560. Purpose 
  5561.  
  5562. This function allows an FSD to retrieve file-system-independent and 
  5563. file-system-dependent data from a VPB. Since the FS router passes in a VPB 
  5564. handle, individual FSDs need to map the handle into pointers to the relevant 
  5565. portions. 
  5566.  
  5567. Calling Sequence 
  5568.  
  5569. void far pascal FSH_GETVOLPARM(hVPB, ppVPBfsi, ppVPBfsd)
  5570.  
  5571. unsigned short hVPB;
  5572. struc vpfsi far * far * ppVPBfsi;
  5573. struc vpfsd far * far * ppVPBfsd;
  5574.  
  5575. Where 
  5576.  
  5577.  hVPB                is the volume handle of interest. 
  5578.  
  5579.  ppVPBfsi            indicates the location where the pointer to 
  5580.                      file-system-independent data is stored. 
  5581.  
  5582.  ppVPBfsd            indicates the location where the pointer to 
  5583.                      file-system-dependent data is stored. 
  5584.  
  5585.  Returns 
  5586.  
  5587.  There are no error returns. 
  5588.  
  5589.  Remarks 
  5590.  
  5591.  FSH_GETVOLPARM will not block. 
  5592.  
  5593.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5594.  FSH_PROBEBUF where appropriate. 
  5595.  
  5596.  
  5597. ΓòÉΓòÉΓòÉ 6.14. FSH_INTERR - Signal an internal error ΓòÉΓòÉΓòÉ
  5598.  
  5599. Purpose 
  5600.  
  5601. This function signals an internal error. 
  5602.  
  5603. Calling Sequence 
  5604.  
  5605. void far pascal FSH_INTERR(pMsg, cbMsg)
  5606.  
  5607. char far * pMsg;
  5608. unsigned short cbMsg;
  5609.  
  5610. Where 
  5611.  
  5612.  pMsg                is a pointer to the message text. 
  5613.  
  5614.  cbMsg               is the length of the message text. 
  5615.  
  5616.  Returns 
  5617.  
  5618.  There are no error returns. 
  5619.  
  5620.  Remarks 
  5621.  
  5622.  For reliability, if an FSD detects an internal inconsistency during normal 
  5623.  operation, the FSD shuts down the system as a whole. This is the safest thing 
  5624.  to do since it is not clear if the system as a whole is in a state that allows 
  5625.  normal execution to continue. 
  5626.  
  5627.  When an FSD calls FSH_INTERR, the address of the caller and the supplied 
  5628.  message is displayed on the console. The system then halts. 
  5629.  
  5630.  The code used to display the message is primitive. The message should contain 
  5631.  ASCII characters in the range 0x20-0x7E, optionally with 0x0D and 0x0A to 
  5632.  break the text into multiple lines. 
  5633.  
  5634.  The FSD must preface all such messages with the name of the file system. 
  5635.  
  5636.  The maximum message length is 512 characters. Messages longer than this are 
  5637.  truncated. 
  5638.  
  5639.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5640.  FSH_PROBEBUF where appropriate. 
  5641.  
  5642.  
  5643. ΓòÉΓòÉΓòÉ 6.15. FSH_IOBOOST - Gives the current thread an I/O priority boost ΓòÉΓòÉΓòÉ
  5644.  
  5645. Purpose 
  5646.  
  5647. This function allows an FSD to boost the current thread's I/O priority after a 
  5648. I/O request. 
  5649.  
  5650. Calling Sequence 
  5651.  
  5652. void far pascal FSH_IOBOOST(void)
  5653.  
  5654. Returns 
  5655.  
  5656. There are no error returns. 
  5657.  
  5658. Remarks 
  5659.  
  5660. FSH_IOBOOST will not block. 
  5661.  
  5662.  
  5663. ΓòÉΓòÉΓòÉ 6.16. FSH_IOSEMCLEAR - Clear an I/O event semaphore ΓòÉΓòÉΓòÉ
  5664.  
  5665. Purpose 
  5666.  
  5667. This function allows an FSD to clear the I/O event semaphore that is a part of 
  5668. the Extended Strategy request packet. 
  5669.  
  5670. Calling Sequence 
  5671.  
  5672. int far pascal FSH_IOSEMCLEAR(pSem)
  5673.  
  5674. Where 
  5675.  
  5676.  pSem                is the handle to the I/O event semaphore. 
  5677.  
  5678.  Returns 
  5679.  
  5680.  If no error is detected, a zero error code is returned. If an error is 
  5681.  detected, one of the following error codes is returned: 
  5682.  
  5683.  o ERROR_EXCL_ALREADY_OWNED 
  5684.    the exclusive semaphore is already owned. 
  5685.  
  5686.  o ERROR_PROTECTION_VIOLATION 
  5687.    the semaphore is inaccessible. 
  5688.  
  5689.  Remarks 
  5690.  
  5691.  FSH_IOSEMCLEAR may block. 
  5692.  
  5693.  For a detailed description of the Extended Strategy request interface, please 
  5694.  see the OS/2 Version 2.0 Physical Device Driver Reference 
  5695.  
  5696.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5697.  FSH_PROBEBUF where appropriate. 
  5698.  
  5699.  
  5700. ΓòÉΓòÉΓòÉ 6.17. FSH_ISCURDIRPREFIX - Test for a prefix of a current directory ΓòÉΓòÉΓòÉ
  5701.  
  5702. Purpose 
  5703.  
  5704. This function allows FSDs to disallow any modification of any directory that is 
  5705. either a current directory of some process or the parent of any current 
  5706. directory of some process. This is necessary because the kernel manages the 
  5707. text of each current directory for each process. 
  5708.  
  5709. Calling Sequence 
  5710.  
  5711. int far pascal FSH_ISCURDIRPREFIX(pName)
  5712.  
  5713. char far * pMsg;
  5714.  
  5715. Where 
  5716.  
  5717.  pName               is a pointer to the path name. 
  5718.  
  5719.                      The name must be in canonical form, that is, no '.' or 
  5720.                      '..' components, uppercase, no meta characters, and full 
  5721.                      path name specified. 
  5722.  
  5723.  Returns 
  5724.  
  5725.  If no error is detected, a zero error code is returned. If an error is 
  5726.  detected, one of the following error codes is returned: 
  5727.  
  5728.  o ERROR_CURRENT_DIRECTORY 
  5729.    the specified path is a prefix of or is equal to the current directory of 
  5730.    some process. 
  5731.  
  5732.    If the current directory is the root and the path name is "d:\", 
  5733.    ERROR_CURRENT_DIRECTORY will be returned. 
  5734.  
  5735.  Remarks 
  5736.  
  5737.  FSH_ISCURDIRPREFIX takes the supplied path name, enumerates all current 
  5738.  directories in use, and tests to see if the specified path name is a prefix or 
  5739.  is equal to some current directory. 
  5740.  
  5741.  FSH_ISCURDIRPREFIX may block. 
  5742.  
  5743.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5744.  FSH_PROBEBUF where appropriate. 
  5745.  
  5746.  
  5747. ΓòÉΓòÉΓòÉ 6.18. FSH_LOADCHAR - Load a character from a string ΓòÉΓòÉΓòÉ
  5748.  
  5749. Purpose 
  5750.  
  5751. This function provides the mechanism for loading a character from a string, 
  5752. taking into account DBCS considerations. 
  5753.  
  5754. Calling Sequence 
  5755.  
  5756. void far pascal FSH_LOADCHAR(ppStr, pChar)
  5757.  
  5758. char far * far * ppStr;
  5759. unsigned short far * pChar;
  5760.  
  5761. Where 
  5762.  
  5763.  ppStr               is a pointer to the character pointer of a string. 
  5764.  
  5765.                      The character at this location will be retrieved and this 
  5766.                      pointer will be updated. 
  5767.  
  5768.  pChar               is a pointer to the character returned. 
  5769.  
  5770.                      If character is non-DBCS, the first byte will be the 
  5771.                      character and the second byte will be zero. 
  5772.  
  5773.  Returns 
  5774.  
  5775.  There are no error returns. 
  5776.  
  5777.  Remarks 
  5778.  
  5779.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5780.  FSH_PROBEBUF where appropriate. 
  5781.  
  5782.  
  5783. ΓòÉΓòÉΓòÉ 6.19. FSH_NAMEFROMSFN - Get the full path name from an SFN. ΓòÉΓòÉΓòÉ
  5784.  
  5785. Purpose 
  5786.  
  5787. This call allows an FSD to retrieve the full path name for an object to which 
  5788. an SFN refers. 
  5789.  
  5790. Calling Sequence 
  5791.  
  5792. int far pascal FSH_NAMEFROMSFN(sfn, pName, pcbName)
  5793.  
  5794. unsigned short sfn;
  5795. char far * pName;
  5796. unsigned short far * pcbName;
  5797.  
  5798. Where 
  5799.  
  5800.  sfn                 is the system file number of a file instance, obtained 
  5801.                      from the sfi_selfsfn field of the file-system-independent 
  5802.                      part of the SFT for the object. 
  5803.  
  5804.  pName               is the location of where the returned full path name is to 
  5805.                      be stored. 
  5806.  
  5807.  pcbName             is the location of where the FSD places the size of the 
  5808.                      buffer pointed to by pName. On return, the kernel will 
  5809.                      fill this in with the length of the path name. This length 
  5810.                      does not include the terminating null character. The size 
  5811.                      of the buffer should be long enough to hold the full path 
  5812.                      name, or else an error will be returned. 
  5813.  
  5814.  Returns 
  5815.  
  5816.  If no error is detected, a zero error code is returned. If an error is 
  5817.  detected, one of the following error codes is returned: 
  5818.  
  5819.  o ERROR_INVALID_HANDLE 
  5820.    the SFN is invalid. 
  5821.  
  5822.  o ERROR_BUFFER_OVERFLOW 
  5823.    the buffer is too short for the returned path. 
  5824.  
  5825.  Remarks 
  5826.  
  5827.  FSH_NAMEFROMSFN will not block. 
  5828.  
  5829.  Note:  OS/2 does not validate input parameters; the FSD should call 
  5830.  FSH_PROBEBUF where appropriate. 
  5831.  
  5832.  
  5833. ΓòÉΓòÉΓòÉ 6.20. FSH_PREVCHAR - Decrement a character pointer ΓòÉΓòÉΓòÉ
  5834.  
  5835. Purpose 
  5836.  
  5837. This function provides the mechanism for decrementing a character point, taking 
  5838. into account DBCS considerations. 
  5839.  
  5840. Calling Sequence 
  5841.  
  5842. void far pascal FSH_PREVCHAR(pBeg, ppStr)
  5843.  
  5844. char far * pBeg;
  5845. char far * far * ppStr;
  5846.  
  5847. Where 
  5848.  
  5849.  pBeg                is a pointer to the beginning of a string. 
  5850.  
  5851.  ppStr               is a pointer to the character pointer of a string. 
  5852.  
  5853.                      The value is decremented appropriately upon return. If it 
  5854.                      is at the beginning of a string, the pointer is not 
  5855.                      decremented. If it points to the second byte of a DBCS 
  5856.                      character, it will be decremented to point to the first 
  5857.                      byte of the character. 
  5858.  
  5859.  Returns 
  5860.  
  5861.  There are no error returns. 
  5862.  
  5863.  Remarks 
  5864.  
  5865.  The FSD is responsible for verifying the string pointer and checking for 
  5866.  segment boundaries. 
  5867.  
  5868.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5869.  FSH_PROBEBUF where appropriate. 
  5870.  
  5871.  
  5872. ΓòÉΓòÉΓòÉ 6.21. FSH_PROBEBUF - Check user address validity ΓòÉΓòÉΓòÉ
  5873.  
  5874. Purpose 
  5875.  
  5876. This function provides the mechanism for performing validity checks on 
  5877. arbitrary pointers to data that users may pass in. 
  5878.  
  5879. Note:  FSDs must check on these pointers before using them. 
  5880.  
  5881. Calling Sequence 
  5882.  
  5883. int far pascal FSH_PROBEBUF(operation, pdata, cbData)
  5884.  
  5885. unsigned short operation;
  5886. char far * pData;
  5887. unsigned short cbData;
  5888.  
  5889. Where 
  5890.  
  5891.  operation           indicates whether read or write access is desired. 
  5892.  
  5893.                      operation ==  0 indicates read access is to be checked. 
  5894.                      operation ==  1 indicates write access is to be checked. 
  5895.  
  5896.                      All other values are reserved. 
  5897.  
  5898.  pData               is the starting address of user data. 
  5899.  
  5900.  cbData              is the length of user data. If cbData is 0, a length of 
  5901.                      64K is indicated. 
  5902.  
  5903.  Returns 
  5904.  
  5905.  If no error is detected, a zero error code is returned. If an error is 
  5906.  detected, one of the following error codes is returned: 
  5907.  
  5908.  o ERROR_PROTECTION_VIOLATION 
  5909.    indicates access to the indicated memory region is illegal (access to the 
  5910.    data is inappropriate or the user transfer region is partially or completely 
  5911.    inaccessible). 
  5912.  
  5913.  Remarks 
  5914.  
  5915.  Because users may pass in arbitrary pointers to data, FSDs must perform 
  5916.  validity checks on these pointers before using them. Because OS/2 is 
  5917.  multi-threaded, the addressability of data returned by FSH_PROBEBUF is only 
  5918.  valid until the FSD blocks. Blocking, either explicitly or implicitly allows 
  5919.  other threads to run, possibly invalidating a user segment. FSH_PROBEBUF must, 
  5920.  therefore, be reapplied after every block. 
  5921.  
  5922.  FSH_PROBEBUF provides a convenient method to assure a user transfer address is 
  5923.  valid and present in memory. Upon successful return, the user address may be 
  5924.  treated as a far pointer and accessed up to the specified length without 
  5925.  either blocking or faulting. This is guaranteed until the FSD returns or until 
  5926.  the next block. 
  5927.  
  5928.  If FSH_PROBEBUF detects a protection violation, the process is terminated as 
  5929.  soon as possible. The OS/2 kernel kills the process once it has exited from 
  5930.  the FSD. 
  5931.  
  5932.  On 80386 processors, FSH_PROBEBUF ensures all touched pages are physically 
  5933.  present in memory so the FSD will not suffer an implicit block due to a page 
  5934.  fault. However, FSH_PROBEBUF does NOT guarantee the pages will be physically 
  5935.  contiguous in memory because FSDs are not expected to do DMA. 
  5936.  
  5937.  FSH_PROBEBUF may block. 
  5938.  
  5939.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5940.  FSH_PROBEBUF where appropriate. 
  5941.  
  5942.  
  5943. ΓòÉΓòÉΓòÉ 6.22. FSH_QSYSINFO - Query system information ΓòÉΓòÉΓòÉ
  5944.  
  5945. Purpose 
  5946.  
  5947. This function queries the system about dynamic system variables and static 
  5948. system variables not returned by DosQSysInfo. 
  5949.  
  5950. Calling Sequence 
  5951.  
  5952. int far pascal FSH_QSYSINFO(index, pData, cbData)
  5953.  
  5954. unsigned short index;
  5955. char far * pData;
  5956. unsigned short cbData;
  5957.  
  5958. Where 
  5959.  
  5960.  index               is the variable to return. 
  5961.  
  5962.                      index == 1 indicates maximum sector size. 
  5963.  
  5964.                      index == 2 indicates process identity. The data returned 
  5965.                      will be as follows: 
  5966.  
  5967.                                           struct {
  5968.                                               unsigned short PID;
  5969.                                               unsigned short UID;
  5970.                                               unsigned short PDB;
  5971.                                           }
  5972.  
  5973.                      index == 3 indicates absolute thread number for the 
  5974.                      current thread. This will be returned in an unsigned short 
  5975.                      field. 
  5976.  
  5977.                      index == 4 indicates verify on write flag for the process. 
  5978.                      This will be returned in an unsigned char (byte) field. 
  5979.                      Zero means verify is off, non-zero means it is on. 
  5980.  
  5981.  pData               is the long address to the data area. 
  5982.  
  5983.  cbData              is the length of the data area. 
  5984.  
  5985.  Returns 
  5986.  
  5987.  If no error is detected, a zero error code is returned. If an error is 
  5988.  detected, one of the following error codes is returned: 
  5989.  
  5990.  o ERROR_INVALID_PARAMETER 
  5991.    the index is invalid. 
  5992.  
  5993.  o ERROR_BUFFER_OVERFLOW 
  5994.    the specified buffer is too short for the returned data. 
  5995.  
  5996.  Remarks 
  5997.  
  5998.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  5999.  FSH_PROBEBUF where appropriate. 
  6000.  
  6001.  
  6002. ΓòÉΓòÉΓòÉ 6.23. FSH_REGISTERPERFCTRS - Register a FSD with PERFVIEW ΓòÉΓòÉΓòÉ
  6003.  
  6004. Purpose 
  6005.  
  6006. This function allows the FSD to register with the PERFVIEW product. The FSD 
  6007. passes pointers to its counter data and text blocks. 
  6008.  
  6009. Calling Sequence 
  6010.  
  6011. int far pascal FSH_REGISTERPERFCTRS(pDataBlk, pTextBlk, fsFlags)
  6012.  
  6013. void far * pDataBlk;
  6014. void far * pTextBlk;
  6015. unsigned short fsFlags;
  6016.  
  6017. Where 
  6018.  
  6019.  pDataBlk            is a pointer to the data block where the actual counters 
  6020.                      reside. 
  6021.  
  6022.  pTextBlk            is a pointer to the block that contains instance and name 
  6023.                      information about counters in the associated DataBlk. 
  6024.  
  6025.  fsFlags             indicates what type of addressing is going to be used. 
  6026.  
  6027.                      Bit 0 off indicates 16:16 pointers 
  6028.                      Bit 0 on indicates 0:32 pointers 
  6029.  
  6030.                      All other bits are reserved and must be zero. 
  6031.  
  6032.  Returns 
  6033.  
  6034.  If no error is detected, a zero error code is returned. If an error is 
  6035.  detected, one of the following error codes is returned: 
  6036.  
  6037.  o ERROR_INVALID_PARAMETER 
  6038.    the flag word is invalid. 
  6039.  
  6040.  o ERROR_PVW_INVALID_COUNTER_BLK 
  6041.    the specified buffer is not in the correct PERFVIEW data block format 
  6042.  
  6043.  o ERROR_PVW_INVALID_TEXT_BLK 
  6044.    the specified buffer is not in the correct PERFVIEW text block format 
  6045.  
  6046.  Remarks 
  6047.  
  6048.  For a detailed description of the PERFVIEW interface and its associated data 
  6049.  structures please see the OS/2 Version 2.0 PERFVIEW OEMI Document. 
  6050.  
  6051.  FSH_REGISTERPERFCTRS may block. 
  6052.  
  6053.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6054.  FSH_PROBEBUF where appropriate. 
  6055.  
  6056.  
  6057. ΓòÉΓòÉΓòÉ 6.24. FSH_REMOVESHARE - Remove a shared entry ΓòÉΓòÉΓòÉ
  6058.  
  6059. Purpose 
  6060.  
  6061. This function removes a previously-entered name from the sharing set. 
  6062.  
  6063. Calling Sequence 
  6064.  
  6065. void far pascal FSH_REMOVESHARE(hShare)
  6066.  
  6067. unsigned long hShare;
  6068.  
  6069. Where 
  6070.  
  6071.  hShare              is a share handle returned by a prior call to 
  6072.                      FSH_ADDSHARE. 
  6073.  
  6074.  Returns 
  6075.  
  6076.  There are no error returns. 
  6077.  
  6078.  Remarks 
  6079.  
  6080.  When a call to FSH_REMOVESHARE has been issued, the share handle is no longer 
  6081.  valid. 
  6082.  
  6083.  FSH_REMOVESHARE may block. 
  6084.  
  6085.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6086.  FSH_PROBEBUF where appropriate. 
  6087.  
  6088.  
  6089. ΓòÉΓòÉΓòÉ 6.25. FSH_SEGALLOC - Allocate a GDT or LDT segment ΓòÉΓòÉΓòÉ
  6090.  
  6091. Purpose 
  6092.  
  6093. This function allocates a GDT or LDT selector. The selector will have 
  6094. read/write access. An FSD may call this function. 
  6095.  
  6096. Calling Sequence 
  6097.  
  6098. int far pascal FSH_SEGALLOC(flags, cbSeg, pSel)
  6099.  
  6100. unsigned short flags;
  6101. unsigned long cbSeg;
  6102. unsigned short far * pSel;
  6103.  
  6104. Where 
  6105.  
  6106.  flags               indicate GDT/LDT, protection ring, 
  6107.                      swappable/non-swappable. 
  6108.  
  6109.                      Bit 0x0001 off indicates GDT selector returned. 
  6110.                      Bit 0x0001 on indicates LDT selector returned. 
  6111.                      Bit 0x0002 off indicates non-swappable memory. 
  6112.                      Bit 0x0002 on indicates swappable memory. 
  6113.                      Bits 13 and 14 are the desired ring number. 
  6114.  
  6115.                      All other bits are reserved and must be zero. 
  6116.  
  6117.  cbSeg               is the length of the segment. 
  6118.  
  6119.  pSel                is the far address of the location where the allocated 
  6120.                      selector will be stored. 
  6121.  
  6122.  Returns 
  6123.  
  6124.  If no error is detected, a zero error code is returned. If an error is 
  6125.  detected, one of the following error codes is returned: 
  6126.  
  6127.  o ERROR_INTERRUPT 
  6128.    the current thread received a signal. 
  6129.  
  6130.  o ERROR_INVALID_PARAMETER 
  6131.    the reserved bits in flags are set or requested size is too large. 
  6132.  
  6133.  o ERROR_NOT_ENOUGH_MEMORY 
  6134.    too much memory is allocated. 
  6135.  
  6136.  Remarks 
  6137.  
  6138.  It is strongly suggested that FSDs allocate all their data at protection level 
  6139.  0 for maximum protection from user programs. 
  6140.  
  6141.  GDT selectors are a scarce resource; the FSD must be prepared to expect an 
  6142.  error for allocation of a GDT segment. The FSD should limit itself to a 
  6143.  maximum of 10 GDT segments. It is suggested that a large segment be allocated 
  6144.  for each type of data and divided into per-process records. 
  6145.  
  6146.  FSH_SEGALLOC may block. 
  6147.  
  6148.  Take care to avoid deadlocks between swappable segments and swapper requests. 
  6149.  
  6150.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6151.  FSH_PROBEBUF where appropriate. 
  6152.  
  6153.  
  6154. ΓòÉΓòÉΓòÉ 6.26. FSH_SEGFREE - Release a GDT or LDT segment ΓòÉΓòÉΓòÉ
  6155.  
  6156. Purpose 
  6157.  
  6158. This function releases a GDT or LDT segment previously allocated with 
  6159. FSH_SEGALLOC or loaded as part of the FSD image. 
  6160.  
  6161. Calling Sequence 
  6162.  
  6163. int far pascal FSH_SEGFREE(sel)
  6164.  
  6165. unsigned short sel;
  6166.  
  6167. Where 
  6168.  
  6169.  sel                 is the selector to be freed. 
  6170.  
  6171.  Returns 
  6172.  
  6173.  If no error is detected, a zero error code is returned. If an error is 
  6174.  detected, one of the following error codes is returned: 
  6175.  
  6176.  o ERROR_INVALID_ACCESS 
  6177.    the selector is invalid. 
  6178.  
  6179.  Remarks 
  6180.  
  6181.  FSH_SEGFREE may block. 
  6182.  
  6183.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6184.  FSH_PROBEBUF where appropriate. 
  6185.  
  6186.  
  6187. ΓòÉΓòÉΓòÉ 6.27. FSH_SEGREALLOC - Change segment size ΓòÉΓòÉΓòÉ
  6188.  
  6189. Purpose 
  6190.  
  6191. This function changes the size of a segment previously allocated with 
  6192. FSH_SEGALLOC or loaded as part of the FSD image. 
  6193.  
  6194. Calling Sequence 
  6195.  
  6196. int far pascal FSH_SEGREALLOC(sel, cbSeg)
  6197.  
  6198. unsigned short sel;
  6199. unsigned long cbSeg;
  6200.  
  6201. Where 
  6202.  
  6203.  sel                 is the selector to be changed. 
  6204.  
  6205.  cbSeg               is the new size to set for the segment. 
  6206.  
  6207.  Returns 
  6208.  
  6209.  If no error is detected, a zero error code is returned. If an error is 
  6210.  detected, one of the following error codes is returned: 
  6211.  
  6212.  o ERROR_NOT_ENOUGH_MEMORY 
  6213.    too much memory is allocated. 
  6214.  
  6215.  o ERROR_INVALID_ACCESS 
  6216.    the selector is invalid 
  6217.  
  6218.  Remarks 
  6219.  
  6220.  The segment may be grown or shrunk. The segment may be moved in the process. 
  6221.  When grown, the extra space is uninitialized. 
  6222.  
  6223.  FSH_SEGREALLOC may block. 
  6224.  
  6225.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6226.  FSH_PROBEBUF where appropriate. 
  6227.  
  6228.  
  6229. ΓòÉΓòÉΓòÉ 6.28. FSH_SEMCLEAR - Clear a semaphore ΓòÉΓòÉΓòÉ
  6230.  
  6231. Purpose 
  6232.  
  6233. This function allows an FSD to release a semaphore that was previously obtained 
  6234. on a call to FSH_SEMREQUEST. 
  6235.  
  6236. Calling Sequence 
  6237.  
  6238. int far pascal FSH_SEMCLEAR(pSem)
  6239.  
  6240. void far * pSem;
  6241.  
  6242. Where 
  6243.  
  6244.  pSem                is the handle to the system semaphore or the long address 
  6245.                      of the ram semaphore. 
  6246.  
  6247.  Returns 
  6248.  
  6249.  If no error is detected, a zero error code is returned. If an error is 
  6250.  detected, one of the following error codes is returned: 
  6251.  
  6252.  o ERROR_EXCL_ALREADY_OWNED 
  6253.    the exclusive semaphore is already owned. 
  6254.  
  6255.  o ERROR_PROTECTION_VIOLATION 
  6256.    the semaphore is inaccessible. 
  6257.  
  6258.  Remarks 
  6259.  
  6260.  FSH_SEMCLEAR may block. 
  6261.  
  6262.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6263.  FSH_PROBEBUF where appropriate. 
  6264.  
  6265.  
  6266. ΓòÉΓòÉΓòÉ 6.29. FSH_SEMREQUEST - Request a semaphore ΓòÉΓòÉΓòÉ
  6267.  
  6268. Purpose 
  6269.  
  6270. This function allows an FSD to obtain exclusive access to a semaphore. 
  6271.  
  6272. Calling Sequence 
  6273.  
  6274. int far pascal FSH_SEMREQUEST(pSem, cmsTimeout)
  6275.  
  6276. void far * pSem;
  6277. unsigned long cmsTimeout;
  6278.  
  6279. Where 
  6280.  
  6281.  pSem                is the handle to the system semaphore or the long address 
  6282.                      of the ram semaphore. 
  6283.  
  6284.  cmsTimeout          is the number of milliseconds to wait. 
  6285.  
  6286.  Returns 
  6287.  
  6288.  If no error is detected, a zero error code is returned. If an error is 
  6289.  detected, one of the following error codes is returned: 
  6290.  
  6291.  o ERROR_INTERRUPT 
  6292.    the current thread received a signal. 
  6293.  
  6294.  o ERROR_SEM_TIMEOUT 
  6295.    the time-out expired without gaining access to the semaphore. 
  6296.  
  6297.  o ERROR_SEM_OWNER_DIED 
  6298.    the owner of the semaphore died. 
  6299.  
  6300.  o ERROR_TOO_MANY_SEM_REQUESTS 
  6301.    there are too many semaphore requests in progress. 
  6302.  
  6303.  o ERROR_PROTECTION_VIOLATION 
  6304.    the semaphore is inaccessible. 
  6305.  
  6306.  Remarks 
  6307.  
  6308.  The time-out value of 0xFFFFFFFF indicates an indefinite time-out. 
  6309.  
  6310.  The caller may receive access to the semaphore after the time-out period has 
  6311.  expired without receiving an ERROR_SEM_TIMEOUT. Semaphore time-out values, 
  6312.  therefore, should not be used for exact timing and sequencing. 
  6313.  
  6314.  FSH_SEMREQUEST may block. 
  6315.  
  6316.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6317.  FSH_PROBEBUF where appropriate. 
  6318.  
  6319.  
  6320. ΓòÉΓòÉΓòÉ 6.30. FSH_SEMSET - Set a semaphore ΓòÉΓòÉΓòÉ
  6321.  
  6322. Purpose 
  6323.  
  6324. This function allows an FSD to set a semaphore unconditionally. 
  6325.  
  6326. Calling Sequence 
  6327.  
  6328. int far pascal FSH_SEMSET(pSem)
  6329.  
  6330. void far * pSem;
  6331.  
  6332. Where 
  6333.  
  6334.  pSem                is the handle to the system semaphore or the long address 
  6335.                      of the ram semaphore. 
  6336.  
  6337.  Returns 
  6338.  
  6339.  If no error is detected, a zero error code is returned. If an error is 
  6340.  detected, one of the following error codes is returned: 
  6341.  
  6342.  o ERROR_INTERRUPT 
  6343.    the current thread received a signal. 
  6344.  
  6345.  o ERROR_EXCL_SEM_ALREADY_OWNED 
  6346.    the exclusive semaphore is already owned. 
  6347.  
  6348.  o ERROR_TOO_MANY_SEM_REQUESTS 
  6349.    there are too many semaphore requests in progress. 
  6350.  
  6351.  o ERROR_PROTECTION_VIOLATION 
  6352.    the semaphore is inaccessible. 
  6353.  
  6354.  Remarks 
  6355.  
  6356.  FSH_SEMSET may block. 
  6357.  
  6358.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6359.  FSH_PROBEBUF where appropriate. 
  6360.  
  6361.  
  6362. ΓòÉΓòÉΓòÉ 6.31. FSH_SEMSETWAIT - Set a semaphore and wait for clear ΓòÉΓòÉΓòÉ
  6363.  
  6364. Purpose 
  6365.  
  6366. This function allows an FSD to wait for an event. The event is signaled by a 
  6367. call to FSH_SEMCLEAR. 
  6368.  
  6369. Calling Sequence 
  6370.  
  6371. int far pascal FSH_SEMSETWAIT(pSem, cmsTimeout)
  6372.  
  6373. void far * pSem;
  6374. unsigned long cmsTimeout;
  6375.  
  6376. Where 
  6377.  
  6378.  pSem                is the handle to the system semaphore or the long address 
  6379.                      of the ram semaphore. 
  6380.  
  6381.  cmsTimeout          is the number of milliseconds to wait. 
  6382.  
  6383.  Returns 
  6384.  
  6385.  If no error is detected, a zero error code is returned. If an error is 
  6386.  detected, one of the following error codes is returned: 
  6387.  
  6388.  o ERROR_SEM_TIMEOUT 
  6389.    the time-out expired without gaining access to the semaphore. 
  6390.  
  6391.  o ERROR_INTERRUPT 
  6392.    the current thread received a signal. 
  6393.  
  6394.  o ERROR_EXCL_SEM_ALREADY_OWNED 
  6395.    the exclusive semaphore is already owned. 
  6396.  
  6397.  o ERROR_PROTECTION_VIOLATION 
  6398.    the semaphore is inaccessible. 
  6399.  
  6400.  Remarks 
  6401.  
  6402.  The caller may return after the time-out period has expired without receiving 
  6403.  an ERROR_SEM_TIMEOUT. Semaphore time-out values, therefore, should not be used 
  6404.  for exact timing and sequence. 
  6405.  
  6406.  FSH_SEMSETWAIT may block. 
  6407.  
  6408.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6409.  FSH_PROBEBUF where appropriate. 
  6410.  
  6411.  
  6412. ΓòÉΓòÉΓòÉ 6.32. FSH_SEMWAIT - Wait for clear ΓòÉΓòÉΓòÉ
  6413.  
  6414. Purpose 
  6415.  
  6416. This function allows an FSD to wait for an event. The event is signaled by a 
  6417. call to FSH_SEMCLEAR. 
  6418.  
  6419. Calling Sequence 
  6420.  
  6421. int far pascal FSH_SEMWAIT(pSem, cmsTimeout)
  6422.  
  6423. void far * pSem;
  6424. unsigned long cmsTimeout;
  6425.  
  6426. Where 
  6427.  
  6428.  pSem                is the handle to the system semaphore or the long address 
  6429.                      of the ram semaphore. 
  6430.  
  6431.  cmsTimeout          is the number of milliseconds to wait. 
  6432.  
  6433.  Returns 
  6434.  
  6435.  If no error is detected, a zero error code is returned.  If an error is 
  6436.  detected, one of the following error codes is returned: 
  6437.  
  6438.  o ERROR_SEM_TIMEOUT 
  6439.    the time-out expired without gaining access to the semaphore. 
  6440.  
  6441.  o ERROR_INTERRUPT 
  6442.    the current thread received a signal. 
  6443.  
  6444.  o ERROR_PROTECTION_VIOLATION 
  6445.    the semaphore is inaccessible. 
  6446.  
  6447.  Remarks 
  6448.  
  6449.  The caller may return after the time-out period has expired without receiving 
  6450.  an ERROR_SEM_TIMEOUT. Semaphore time-out values, therefore, should not be used 
  6451.  for exact timing and sequence. 
  6452.  
  6453.  FSH_SEMWAIT may block. 
  6454.  
  6455.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6456.  FSH_PROBEBUF where appropriate. 
  6457.  
  6458.  
  6459. ΓòÉΓòÉΓòÉ 6.33. FSH_SETVOLUME - Force a volume to be mounted on the drive ΓòÉΓòÉΓòÉ
  6460.  
  6461. Purpose 
  6462.  
  6463. This function provides the mechanism for assuring that a desired volume is in a 
  6464. removable media drive before I/O is done to the drive. 
  6465.  
  6466. Calling Sequence 
  6467.  
  6468. int far pascal FSH_SETVOLUME(hVPB , fControl)
  6469.  
  6470. unsigned short hVPB;
  6471. unsigned short fControl;
  6472.  
  6473. Where 
  6474.  
  6475.  hVPB                is the volume handle for the source of I/O. 
  6476.  
  6477.  fControl            is the bit mask of pop-up control actions: 
  6478.  
  6479.                      Bit 0 off indicates volume change pop-up desired 
  6480.                      Bit 0 on indicates no volume change pop-up 
  6481.  
  6482.                      All other bits are reserved and must be zero. 
  6483.  
  6484.  Returns 
  6485.  
  6486.  If no error is detected, a zero error code is returned. If an error is 
  6487.  detected, one of the following error codes is returned: 
  6488.  
  6489.  o ERROR_VOLUME_CHANGED 
  6490.    is an indication that removable media volume change has occurred. 
  6491.  
  6492.  o ERROR_INVALID_PARAMETER 
  6493.    the fControl flag word has reserved bits on. 
  6494.  
  6495.  Remarks 
  6496.  
  6497.  This routine is used by the FSH_CALLDRIVER routine to insure that the desired 
  6498.  volume is in a removable media drive. FSDs can use it for the same purpose. 
  6499.  
  6500.  FSH_SETVOLUME may block. 
  6501.  
  6502.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6503.  FSH_PROBEBUF where appropriate. 
  6504.  
  6505.  
  6506. ΓòÉΓòÉΓòÉ 6.34. FSH_STORECHAR - Store a character in a string ΓòÉΓòÉΓòÉ
  6507.  
  6508. Purpose 
  6509.  
  6510. This function provides the mechanism for storing a character into a string, 
  6511. taking into account DBCS considerations. 
  6512.  
  6513. Calling Sequence 
  6514.  
  6515. int far pascal FSH_STORECHAR(chDBCS, ppStr)
  6516.  
  6517. unsigned short chDBCS;
  6518. char far * far * ppStr;
  6519.  
  6520. Where 
  6521.  
  6522.  chDBCS              is the character to be stored. This may be either a 
  6523.                      single-byte character or a double-byte character with the 
  6524.                      first byte occupying the low-order position. 
  6525.  
  6526.  ppStr               is the pointer to the character pointer where the 
  6527.                      character will be stored. This pointer is updated upon 
  6528.                      return. 
  6529.  
  6530.  Returns 
  6531.  
  6532.  There are no error returns. 
  6533.  
  6534.  Remarks 
  6535.  
  6536.  The FSD is responsible for verifying the string pointer and checking for 
  6537.  segment boundaries. 
  6538.  
  6539.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6540.  FSH_PROBEBUF where appropriate. 
  6541.  
  6542.  
  6543. ΓòÉΓòÉΓòÉ 6.35. FSH_UPPERCASE - Uppercase ASCIIZ string ΓòÉΓòÉΓòÉ
  6544.  
  6545. Purpose 
  6546.  
  6547. This function is used to uppercase an ASCIIZ string. 
  6548.  
  6549. Calling Sequence 
  6550.  
  6551. int far pascal FSH_UPPERCASE(szPathName, cbPathBuf, pPathBuf)
  6552.  
  6553. char far * szPathName;
  6554. unsigned short cbPathBuf;
  6555. char far * pPathBuf;
  6556.  
  6557. Where 
  6558.  
  6559.  szPathName          is a pointer to the ASCIIZ pathname to be uppercased. 
  6560.  
  6561.  cbPathBuf           is the length of the pathname buffer. 
  6562.  
  6563.  pPathBuf            is a pointer to the buffer to copy the uppercased path 
  6564.                      into 
  6565.  
  6566.  Returns 
  6567.  
  6568.  If no error is detected, a zero error code is returned. If an error is 
  6569.  detected, the following error code is returned: 
  6570.  
  6571.  o ERROR_BUFFER_OVERFLOW 
  6572.    uppercased pathname is too long to fit into buffer. 
  6573.  
  6574.  Remarks 
  6575.  
  6576.  This routine processes DBCS characters properly. 
  6577.  
  6578.  The FSD is responsible for verifying the string pointers and checking for 
  6579.  segment boundaries. 
  6580.  
  6581.  szPathName and pPathBuf may point to the same place in memory. 
  6582.  
  6583.  FSH_UPPERCASE should be called for names passed into the FSD in raw data 
  6584.  packets which are not passed to FSH_CANONICALIZE and should be uppercased, 
  6585.  that is, extended attribute names. 
  6586.  
  6587.  Note:  OS/2 does not validate input parameters. Therefore, an FSD should call 
  6588.  FSH_PROBEBUF where appropriate. 
  6589.  
  6590.  
  6591. ΓòÉΓòÉΓòÉ 6.36. FSH_WILDMATCH - Match using OS/2 wildcards ΓòÉΓòÉΓòÉ
  6592.  
  6593. Purpose 
  6594.  
  6595. This function provides the mechanism for using OS/2 wildcard semantics to form 
  6596. a match between an input string and a pattern, taking into account DBCS 
  6597. considerations. 
  6598.  
  6599. Calling Sequence 
  6600.  
  6601. int far pascal FSH_WILDMATCH(pPat, pStr)
  6602.  
  6603. char far * pPat;
  6604. char far * pStr;
  6605.  
  6606. Where 
  6607.  
  6608.  pPat                is the pointer to an ASCIIZ pattern string. Wildcards are 
  6609.                      present and are interpreted as described below. 
  6610.  
  6611.  ppStr               is the pointer to the test string. 
  6612.  
  6613.  Returns 
  6614.  
  6615.  If no error is detected, a zero error code is returned. If an error is 
  6616.  detected, the following error code is returned: 
  6617.  
  6618.  o ERROR_NO_META_MATCH 
  6619.    the wildcard match failed. 
  6620.  
  6621.  Remarks 
  6622.  
  6623.  Wildcards provide a general mechanism for pattern matching file names. There 
  6624.  are two distinguished characters that are relevant to this matching. The '?' 
  6625.  character matches one character (not bytes) except at a '.' or at the end of a 
  6626.  string, where it matches zero characters. The '*' matches zero or more 
  6627.  characters (not bytes) with no implied boundaries except the end-of-string. 
  6628.  
  6629.  For example, "a*b" matches "ab" and "aCCCCCCCCC" while "a?b" matches "aCb" but 
  6630.  does not match "aCCCCCCCCCb" 
  6631.  
  6632.  See the section on meta characters in this document for additional 
  6633.  information. 
  6634.  
  6635.  The FSD should uppercase the pattern and string before calling FSH_WILDMATCH 
  6636.  to achieve a case-insensitive compare. 
  6637.  
  6638.  Note:  OS/2 does not validate input parameters. An FSD, therefore, should call 
  6639.  FSH_PROBEBUF where appropriate. 
  6640.  
  6641.  
  6642. ΓòÉΓòÉΓòÉ 6.37. FSH_YIELD - Yield processor to higher-priority thread ΓòÉΓòÉΓòÉ
  6643.  
  6644. Purpose 
  6645.  
  6646. This function provides the mechanism for relinquishing the processor to higher 
  6647. priority threads. 
  6648.  
  6649. Calling Sequence 
  6650.  
  6651. void far pascal FSH_YIELD(void)
  6652.  
  6653. Returns 
  6654.  
  6655. There are no error returns. 
  6656.  
  6657. Remarks 
  6658.  
  6659. FSDs run under the 2 mS dispatch latency imposed on the OS/2 kernel, meaning 
  6660. that no more than 2 mS can be spent in an FSD without an explicit block or 
  6661. yield. FSH_YIELD will test to see if another thread is runable at the current 
  6662. thread's priority or at a higher priority. If one exists, that thread will be 
  6663. given a chance to run. 
  6664.  
  6665.  
  6666. ΓòÉΓòÉΓòÉ 7. Remote IPL / Bootable IFS ΓòÉΓòÉΓòÉ
  6667.  
  6668. This chapter describes the OS/2 Version 2.0 boot architecture and extensions to 
  6669. the installable file system mechanism (IFSM) to enable booting from an 
  6670. FSD-managed volume, referred to as Bootable IFS (BIFS). If the volume is on a 
  6671. remote system, it is referred to as Remote IPL (RIPL). 
  6672.  
  6673. The mini-FSD is similar to the FSD defined in this document. However, it has 
  6674. additional requirements for to allow reading of the boot drive before the base 
  6675. device drivers are loaded.  These requirements are fully defined in the two 
  6676. interface sections of this chapter. 
  6677.  
  6678. To satisfy its I/O requests, the mini-FSD may call the disk device device 
  6679. driver imbedded in OS2KRNL (BIFS case) or it may provide its own driver (RIPL 
  6680. case). 
  6681.  
  6682. Along with the mini-FSD, the IFS SYS Utility is required to initialize an 
  6683. FSD-managed volume with whatever is required to satisfy the requirements of the 
  6684. mini-FSD and this document. 
  6685.  
  6686. The IFS mechanism includes some additional calls which the mini-FSD may need 
  6687. while it is linked into the IFS chain. 
  6688.  
  6689.  
  6690. ΓòÉΓòÉΓòÉ 7.1. Operational Description ΓòÉΓòÉΓòÉ
  6691.  
  6692.  
  6693. ΓòÉΓòÉΓòÉ 7.1.1. FAT Boot Procedure ΓòÉΓòÉΓòÉ
  6694.  
  6695. The following figure represents the major stages of the OS/2 Version 2.0 FAT 
  6696. boot procedure. 
  6697.  
  6698. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ time
  6699.     POST       BOOT      OS2BOOT    OS2LDR     stage1     stage2     stage3
  6700.               SECTOR     (OS2LDR               OS2KRNL
  6701.                           loader)
  6702.  
  6703. Figure 4-1. OS/2 Version 2.0 FAT boot procedure 
  6704.  
  6705. Powering-on the machine or pressing CTRL-ALT-DEL causes control to get 
  6706. transferred to the power-on-self-test (POST) code. This code initializes the 
  6707. interrupt vectors to get to the BIOS routines. It then scans the I/O adapters 
  6708. looking for and linking in any code which exists on them. It then executes an 
  6709. interrupt 19h (INT 19) which causes control to be transferred to the disk or 
  6710. diskette boot code. 
  6711.  
  6712. The INT 19h code reads the boot sector from disk or diskette into memory at 
  6713. 7C00H. Along with code, the boot sector contains a structure called the BIOS 
  6714. Parameter Block(BPB). The BPB contains information which describes how the disk 
  6715. is formatted. The boot code uses this information to load in the root directory 
  6716. and the FAT micro-IFS, which is kept inside the OS2BOOT file. After the 
  6717. micro-IFS is loaded the boot sector transfer control it via a far jump. 
  6718.  
  6719. OS2BOOT receives pointers to the RAM copies of the root directory and the BPB. 
  6720. Using the BPB information, OS2BOOT loads in the FAT table from the disk. Then 
  6721. using the root directory and the FAT table, the OS2LDR file is loaded into 
  6722. memory from disk. The inclusion of this micro-IFS in the FAT boot process has 
  6723. removed the requirement that the OS2LDR file be logically contiguous on the FAT 
  6724. drive. 
  6725.  
  6726. OS2LDR contains the OS/2 loader. It relocates itself to the top of low memory, 
  6727. then scans the root directory for OS2KRNL and reads it into memory. After the 
  6728. required fixups are applied, control is transferred to OS2KRNL, along with a 
  6729. pointer to the BPB and the drive number. 
  6730.  
  6731. OS2KRNL contains the OS/2 kernel and initialization code. It switches to 
  6732. protected mode, relocates parts of itself to high memory, then scans the root 
  6733. directory for and reads in the base device drivers (stage 1). Once again, the 
  6734. BIOS interrupt 13h is used to read the disk, but mode switching must be done. 
  6735.  
  6736. OS2KRNL then switches to protection level 3 and loads some of the required 
  6737. dynamic link libraries (stage 2) followed by the device drivers and FSDs 
  6738. specified in CONFIG.SYS (stage 3). This is done with standard DOS calls and, 
  6739. therefore, goes through the regular file system and device drivers. 
  6740.  
  6741.  
  6742. ΓòÉΓòÉΓòÉ 7.1.2. BIFS Boot Procedure ΓòÉΓòÉΓòÉ
  6743.  
  6744. The following figure represents the major stages of the OS/2 Version 2.0 BIFS 
  6745. boot procedure. 
  6746.  
  6747. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ time
  6748.     POST     BlackBox    OS2LDR     stage1     stage2      stage3
  6749.              (Micro                 OS2KRNL
  6750.                  FSD)
  6751.  
  6752. Figure 4-2. OS/2 Version 2.0 BIFS boot procedure 
  6753.  
  6754. The major difference between this boot procedure and the FAT boot procedure is 
  6755. that there is no assumption of booting off of disk. OS/2 Version 2.0 does not 
  6756. define what should happen between when the POST code is run and when the OS2LDR 
  6757. program gains control. 
  6758.  
  6759. When OS2LDR receives control, it must be passed information about the current 
  6760. state of memory and pointers to the Open, Read, Close, and Terminate entry 
  6761. points of the micro-FSD. Included in the memory map information is the 
  6762. positions of the micro-FSD, mini-FSD, RIPL data, and the OS2LDR file itself. 
  6763.  
  6764. Note:  This interface is defined in a next section of this chapter. 
  6765.  
  6766. As with the FAT boot procedure, the OS/2 loader relocates itself to the top of 
  6767. low memory, and with the help of the micro-FSD, scans the root directory for 
  6768. the OS2KRNL file. After reading OS2KRNL into memory and applying the required 
  6769. fixups, control is transferred to the kernel. 
  6770.  
  6771. When OS2KRNL receives control, it goes through the same initialization as 
  6772. before (stage 1) with a couple of exceptions. The module loader is called to 
  6773. load the mini-FSD from its memory image stored by OS2LDR in high memory to its 
  6774. final location at the top of low memory. Also, the mini-FSD is called to read 
  6775. the base device drivers (one at a time) through the stage 1 interfaces. 
  6776.  
  6777. Before any of the dynalinks are loaded, the mini-FSD will be linked into the 
  6778. IFS chain (it will be the only link in the chain) and asked to initialize 
  6779. through FS_INIT. The FS_INIT call marks the transition from stage 1 to stage 2. 
  6780.  
  6781. The dynalinks are then loaded using the stage 2 interfaces, followed by the 
  6782. device drivers and FSDs. 
  6783.  
  6784. The mini-FSD is required to support only a small number of the FSD system 
  6785. interfaces (the FS_xxxx calls). Therefore, the first FSD loaded must be the 
  6786. replacement for the mini-FSD. 
  6787.  
  6788. After the replacement FSD has been loaded, it is called at FS_INIT to 
  6789. initialize itself and take whatever action it needs to effect a smooth 
  6790. transition from the mini-FSD to the FSD. It then replaces the mini-FSD in the 
  6791. IFS chain, as well as in any kernel data structures which keep a handle to the 
  6792. FSD (for example, the SFT, VPB). This replacement marks the transition from 
  6793. stage 2 to stage 3. 
  6794.  
  6795. From this point on, the system continues normally. 
  6796.  
  6797.  
  6798. ΓòÉΓòÉΓòÉ 7.2. Interfaces ΓòÉΓòÉΓòÉ
  6799.  
  6800.  
  6801. ΓòÉΓòÉΓòÉ 7.2.1. BlackBox/OS2LDR interface ΓòÉΓòÉΓòÉ
  6802.  
  6803. When initially transferring control to OS2LDR from a "black box", the following 
  6804. interface is defined: 
  6805.  
  6806.  DH 
  6807.            boot mode flags: 
  6808.  
  6809.            bit 0 (NOVOLIO) on indicates that the mini-FSD does not use 
  6810.            MFSH_DOVOLIO. 
  6811.            bit 1 (RIPL) on indicates that boot volume is not local (RIPL boot) 
  6812.            bit 2 (MINIFSD) on indicates that a mini-FSD is present. 
  6813.            bit 3 (RESERVED) 
  6814.            bit 4 (MICROFSD) on indicates that a micro-FSD is present. 
  6815.            bits 5-7 are reserved and MUST be zero. 
  6816.  
  6817.  DL 
  6818.            drive number for the boot disk. This parameter is ignored if either 
  6819.            the NOVOLIO or MINIFSD bits are zero. 
  6820.  
  6821.  DS:SI 
  6822.            is a pointer to the BOOT Media's BPB. This parameter is ignored if 
  6823.            either the NOVOLIO or MINIFSD bits are zero. 
  6824.  
  6825.  ES:DI 
  6826.            is a pointer to a filetable structure. The filetable structure has 
  6827.            the following format: 
  6828.  
  6829.                       struct FileTable {
  6830.                           unsigned short ft_cfiles; /* # of entries in this table             */
  6831.                           unsigned short ft_ldrseg; /* paragraph # where OS2LDR is loaded     */
  6832.                           unsigned long  ft_ldrlen; /* length of OS2LDR in bytes              */
  6833.                           unsigned short ft_museg;  /* paragraph # where microFSD is loaded   */
  6834.                           unsigned long  ft_mulen;  /* length of microFSD in bytes            */
  6835.                           unsigned short ft_mfsseg; /* paragraph # where miniFSD is loaded    */
  6836.                           unsigned long  ft_mfslen; /* length of miniFSD in bytes             */
  6837.                           unsigned short ft_ripseg; /* paragraph # where RIPL data is loaded  */
  6838.                           unsigned long  ft_riplen; /* length of RIPL data in bytes           */
  6839.  
  6840.                           /* The next four elements are pointers to microFSD entry points     */
  6841.  
  6842.                           unsigned short (far *ft_muOpen)
  6843.                                            (char far *pName, unsigned long far *pulFileSize);
  6844.                           unsigned long (far *ft_muRead)
  6845.                                            (long loffseek, char far *pBuf, unsigned long cbBuf);
  6846.                           unsigned long (far *ft_muClose)(void);
  6847.                           unsigned long (far *ft_muTerminate)(void);
  6848.                       }
  6849.  
  6850.            The microFSD entry points interface is defined as follows: 
  6851.  
  6852.            mu_Open - is passed a far pointer to name of file to be opened and a 
  6853.            far pointer to a ULONG to return the file's size. The returned value 
  6854.            (in AX) indicates success(0) or failure(non-0). 
  6855.  
  6856.            mu_Read - is passed a seek offset, a far pointer to a data buffer, 
  6857.            and the size of the data buffer. The returned value(in DX:AX) 
  6858.            indicates the number of bytes actually read. 
  6859.  
  6860.            mu_Close - has no parameters and expects no return value. It is a 
  6861.            signal to the micro-FSD that the loader is done reading the current 
  6862.            file. 
  6863.  
  6864.            mu_Terminate - has no parameters and expects no return value. It is 
  6865.            a signal to the micro-FSD that the loader has finished reading the 
  6866.            boot drive. 
  6867.  
  6868.  The loader will call the micro-FSD in a Open-Read-Read-....-Read-Close 
  6869.  sequence with each file read in from the boot drive. 
  6870.  
  6871.  
  6872. ΓòÉΓòÉΓòÉ 7.2.2. miniFSD/OS2KRNL interface ΓòÉΓòÉΓòÉ
  6873.  
  6874. When called from OS2KRNL after being linked into the IFS chain, the interface 
  6875. will be as described in previous chapters of this document. Note that the 
  6876. FS_INIT interface for a mini-FSD has an additional parameter, as compared to 
  6877. the FS_INIT interface for an FSD. 
  6878.  
  6879. When called from OS2KRNL, before being linked into the IFS chain, the interface 
  6880. will be through the MFS_xxxx and MFSH_xxxx entry points. These interfaces are 
  6881. described in this chapter. Many of these interfaces parallel the interfaces 
  6882. defined for FSDs, while others are unique to the mini-FSD. 
  6883.  
  6884. The mini-FSD is built as a dynamic link library. Supplied functions are 
  6885. exported by making the function names public. Helper functions are imported by 
  6886. declaring the helper names external:far. It is required only to support reading 
  6887. files and will be called only in protect mode. The mini-FSD may NOT make 
  6888. dynamic link system calls at initialization time. 
  6889.  
  6890. Due to the special state of the system as it boots, the programming model for 
  6891. the mini-FSD during the state 1 time frame is somewhat different than the model 
  6892. for stage 2. This difference necessitates 2 different interfaces between OS/2 
  6893. and the mini-FSD. 
  6894.  
  6895. During stage 1, all calls to the mini-FSD are to the MFS_xxxx functions. Only 
  6896. the MFSH_xxxx helper functions are available. These are the interfaces which 
  6897. are addressed in this document. Many of these interfaces parallel the 
  6898. interfaces defined for FSDs while others are unique to the mini-FSD. 
  6899.  
  6900. During stage 2, the mini-FSD is treated as a normal FSD. Calls are made to the 
  6901. FS_xxxx functions and all FSH_xxxx helper functions are available. 
  6902.  
  6903. During stage 3, the mini-FSD is given a chance to release resources (through a 
  6904. call to MFS_TERM) before being terminated. 
  6905.  
  6906. Transition from stage 1 to stage 2 is marked by calling the FS_INIT function in 
  6907. the mini-FSD. Transition from stage 2 to stage 3 is marked by calling FS_INIT 
  6908. in the FSD. 
  6909.  
  6910. Figure 4-3 on page 4-6 shows the functions called during a typical boot 
  6911. sequence: 
  6912.  
  6913. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ time
  6914.       stage1               stage2               stage3
  6915.  
  6916.   MFS_INIT
  6917.   MFS_OPEN
  6918.   MFS_READ
  6919.   MFS_CHGFILEPTR
  6920.   MFS_CLOSE
  6921.  
  6922.                        FS_INIT
  6923.                        FS_MOUNT/ATTACH
  6924.                        FS_OPEN
  6925.                        FS_READ
  6926.                        FS_CHGFILEPTR
  6927.  
  6928.                                                MFS_TERM
  6929.  
  6930. Figure 4-3. Typical boot sequence 
  6931.  
  6932. No files are open at the transition from stage 1 to stage 2. Also, only a 
  6933. single file at a time is open during stage 1. Files and volumes are open during 
  6934. the transition from stage 2 to stage 3 (the mini-FSD to the FSD). The FSD must 
  6935. do whatever is necessary for it to inherit them. The FSD will not receive 
  6936. mounts/attaches or opens for volumes and files which were mounted/attached and 
  6937. opened by the mini-FSD. Also, multiple files may be open simultaneously during 
  6938. stages 2 and 3. 
  6939.  
  6940. A special set of helper functions are available to the mini-FSD to support an 
  6941. imbedded device driver. This might be required for situations such as remote 
  6942. IPL where the boot volume is not readable through DOVOLIO. These special helper 
  6943. functions (referred to as imbedded device driver helpers) are available during 
  6944. all stages of the mini-FSD's life. Note that the list of error return codes for 
  6945. the helper functions is not exhaustive, but rather represents the most common 
  6946. errors returned. 
  6947.  
  6948. Because the mini-FSD is a new component added to the boot sequence, a new 
  6949. interface to OS2LDR is required. 
  6950.  
  6951. The name and attributes of the mini-FSD must match EXACTLY the name and 
  6952. attributes of the replacement FSD. 
  6953.  
  6954. Due to the instability of the system during initialization, any non-zero return 
  6955. code indicates an error has been encountered. The actual return code may not 
  6956. bake any sense in the context of the function called (for example, having 
  6957. ERROR_ACCESS_DENIED returned from a call to MFSH_LOCK when in fact an invalid 
  6958. selector was passed to the helper). It is also possible for the system to hang 
  6959. or reboot itself as a result of invalid parameters being passed to a helper 
  6960. function. 
  6961.  
  6962.  
  6963. ΓòÉΓòÉΓòÉ 7.2.3. Stage 1 Interfaces ΓòÉΓòÉΓòÉ
  6964.  
  6965. The following functions must be made available by the mini-FSD. These functions 
  6966. will be called only during stage 1. 
  6967.  
  6968.  o MFS_CHGFILEPTR 
  6969.  o MFS_CLOSE 
  6970.  o MFS_INIT 
  6971.  o MFS_OPEN 
  6972.  o MFS_READ 
  6973.  o MFS_TERM 
  6974.  
  6975.  The following helper functions are available to the mini-FSD. These functions 
  6976.  may be called only during stage 1. 
  6977.  
  6978.  o MFSH_DOVOLIO 
  6979.  o MFSH_INTERR 
  6980.  o MFSH_SEGALLOC 
  6981.  o MFSH_SEGFREE 
  6982.  o MFSH_SEGREALLOC 
  6983.  
  6984.  
  6985. ΓòÉΓòÉΓòÉ 7.2.4. Stage 2 Interfaces ΓòÉΓòÉΓòÉ
  6986.  
  6987. The intent of stage 2 is to use the mini-FSD as an FSD. Therefore, all the 
  6988. guidelines and interfaces specified in this document apply with the following 
  6989. exceptions. 
  6990.  
  6991. The following functions must be fully supported by the mini-FSD: 
  6992.  
  6993.  o FS_ATTACH (remote mini-FSD only) 
  6994.  o FS_ATTRIBUTE 
  6995.  o FS_CHGFILEPTR 
  6996.  o FS_CLOSE 
  6997.  o FS_COMMIT 
  6998.  o FS_INIT 
  6999.  o FS_IOCTL 
  7000.  o FS_MOUNT (local mini-FSD only) 
  7001.  o FS_NAME 
  7002.  o FS_OPENCREATE (existing file only) 
  7003.  o FS_PROCESSNAME 
  7004.  o FS_READ 
  7005.  
  7006.  Note that since the mini-FSD is only required to support reading, 
  7007.  FS_OPENCREATE need only support opening an existing file (not the create or 
  7008.  replace options). 
  7009.  
  7010.  None of the other functions required for FSDs are required for the mini-FSD 
  7011.  but must be defined and should return the ERROR_UNSUPPORTED_FUNCTION return 
  7012.  code. 
  7013.  
  7014.  The full complement of helper functions specified in this document is 
  7015.  available to the mini-FSD. However, the mini-FSD may NOT use any other dynamic 
  7016.  link calls. 
  7017.  
  7018.  
  7019. ΓòÉΓòÉΓòÉ 7.2.5. Stage 3 Interfaces ΓòÉΓòÉΓòÉ
  7020.  
  7021. The intent of stage 3 is to throw away the mini-FSD and use only the FSD. 
  7022.  
  7023. The following functions must be supported by the mini-FSD: 
  7024.  
  7025.  o MFS_TERM 
  7026.  
  7027.  
  7028. ΓòÉΓòÉΓòÉ 7.2.6. Imbedded Device Driver Helpers ΓòÉΓòÉΓòÉ
  7029.  
  7030. The following helper functions are available to the mini-FSD and may be called 
  7031. during stage 1, 2, or 3. These helpers are counterparts for some of the device 
  7032. help functions and are intended for use by a device driver imbedded within the 
  7033. mini-FSD. 
  7034.  
  7035.  o MFSH_CALLRM 
  7036.  o MFSH_LOCK 
  7037.  o MFSH_PHYSTOVIRT 
  7038.  o MFSH_UNLOCK 
  7039.  o MFSH_UNPHYSTOVIRT 
  7040.  o MFSH_VIRTTOPHYS 
  7041.  
  7042.  
  7043. ΓòÉΓòÉΓòÉ 7.3. Special Considerations ΓòÉΓòÉΓòÉ
  7044.  
  7045. The size of the mini-FSD file image plus the RIPL data area may not exceed 62K. 
  7046. In addition, the memory requirements of the mini-FSD may not exceed 64K. 
  7047.  
  7048. The mini-FSD is only required to support reading of a file. Therefore, any call 
  7049. to DosWrite (or other non-supported functions) which becomes redirected to the 
  7050. mini-FSD may be rejected. For this reason, it is required that the IFS= command 
  7051. which loads the FSD which will replace the mini-FSD be the first IFS= command 
  7052. in CONFIG.SYS. Also, only DEVICE= commands which load device drivers required 
  7053. by that FSD should appear before the first IFS= command. 
  7054.  
  7055. If the mini-FSD needs to switch to real mode, it must use the MFSH_CALLRM 
  7056. function. This is required to keep OS/2 informed of the mode switching. 
  7057.  
  7058. Each FSD which is bootable is required to provide their "black box" to load 
  7059. OS2LDR and the mini-FSD into memory before OS2LDR is given control. 
  7060.  
  7061. Additionally, these FSDs are required to provide a single executable module in 
  7062. order to support the OS/2 SYS utility. The executable provided will be invoked 
  7063. by this utility when performing a SYS for that file system. The command line 
  7064. that was passed to the utility will be passed unchanged to the executable. 
  7065.  
  7066. The supplied executable must do whatever is required to make the partition 
  7067. bootable. At the very least, it must install a boot sector. It also needs to 
  7068. install the "black box", mini-FSD, OS2LDR and OS2KRNL. 
  7069.  
  7070.  
  7071. ΓòÉΓòÉΓòÉ 8. mini-FSD Entry Points ΓòÉΓòÉΓòÉ
  7072.  
  7073. The following table is a summary of mini-FSD entry points: 
  7074.  
  7075.  
  7076.  Entry Point          Description
  7077.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7078.  MFS_CHGFILEPTR       Move a file's position pointer
  7079.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7080.  MFS_CLOSE            Close a file.
  7081.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7082.  MFS_INIT             mini-FSD initialization
  7083.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7084.  MFS_OPEN             Open a file
  7085.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7086.  MFS_READ             Read from a file
  7087.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7088.  MFS_TERM             Terminate the mini-FSD
  7089.  
  7090. Table 4-1. Summary of mini-FSD entry points 
  7091.  
  7092.  
  7093. ΓòÉΓòÉΓòÉ 8.1. MFS_CHGFILEPTR - Move a file's position pointer ΓòÉΓòÉΓòÉ
  7094.  
  7095. Purpose 
  7096.  
  7097. Move the file's logical read position pointer. 
  7098.  
  7099. Calling Sequence 
  7100.  
  7101. int far pascal MFS_CHGFILEPTR(offset, type)
  7102.  
  7103. long offset;
  7104. unsigned short type;
  7105.  
  7106. Where 
  7107.  
  7108.  offset              is the signed offset which depending on the type parameter 
  7109.                      is used to determine the new position within the file. 
  7110.  
  7111.  type                indicates the basis of a seek operation. 
  7112.  
  7113.                      type == 0 indicates seek relative to beginning of file. 
  7114.                      type == 1 indicates seek relative to current position 
  7115.                      within the file. 
  7116.                      type == 2 indicates seek relative to end of file. 
  7117.  
  7118.  Returns 
  7119.  
  7120.  If no error is detected, a zero error code is returned. If an error is 
  7121.  detected, a non-zero error code is returned. 
  7122.  
  7123.  Remarks 
  7124.  
  7125.  The file system may want to take the seek operation as a hint that an I/O 
  7126.  operation is about to take place at the new position and initiate a 
  7127.  positioning operation on sequential access media or read-ahead operation on 
  7128.  other media. 
  7129.  
  7130.  
  7131. ΓòÉΓòÉΓòÉ 8.2. MFS_CLOSE - Close a file ΓòÉΓòÉΓòÉ
  7132.  
  7133. Purpose 
  7134.  
  7135. Close a file. 
  7136.  
  7137. Calling Sequence 
  7138.  
  7139. int far pascal MFS_CLOSE(void)
  7140.  
  7141. Returns 
  7142.  
  7143. If no error is detected, a zero error code is returned. If an error is 
  7144. detected, a non-zero error code is returned. 
  7145.  
  7146. Remarks 
  7147.  
  7148. None 
  7149.  
  7150.  
  7151. ΓòÉΓòÉΓòÉ 8.3. MFS_INIT - mini-FSD Initialization ΓòÉΓòÉΓòÉ
  7152.  
  7153. Purpose 
  7154.  
  7155. Inform the mini-FSD that it should prepare itself for use. 
  7156.  
  7157. Calling Sequence 
  7158.  
  7159. int far pascal MFS_INIT(pBootData, pucResDrives, pulVectorIPL, pBPB, pMiniFSD,
  7160.                         pDumpAddr)
  7161.  
  7162. void far * pBootData;
  7163. char far * pucResDrives;
  7164. long far * pulVectorIPL;
  7165. void far * pBPB;
  7166. unsigned long far * pMiniFSD;
  7167. unsigned long far * pDumpAddr;
  7168.  
  7169. Where 
  7170.  
  7171.  pBootData           is a pointer to the data passed from the black box to the 
  7172.                      mini-FSD (null if not passed). 
  7173.  
  7174.  pucResDrives        is a pointer to a byte which may be filled in by the 
  7175.                      mini-FSD with the number of drive letters (beginning with 
  7176.                      'C') to skip over before assigning drive letters to local 
  7177.                      fixed disk drivers (ignored if not remote IPL). The system 
  7178.                      will attach the reserved drives to the mini-FSD through a 
  7179.                      call to FS_ATTACH just after the call to FS_INIT. 
  7180.  
  7181.  pulVectorIPL        is a pointer to a double word which may be filled in by 
  7182.                      the mini-FSD with a pointer to a data structure which will 
  7183.                      be available to installable device drivers through the 
  7184.                      standard device helper function GetDosVar (variable number 
  7185.                      12). The first eight bytes of the structure MUST be a 
  7186.                      signature which would allow unique identification of the 
  7187.                      data by cooperating device drivers (for example, 
  7188.                      IBMPCNET). 
  7189.  
  7190.  BPB                 is a pointer to the BPB data structure (see OS2LDR 
  7191.                      interface). 
  7192.  
  7193.  pMiniFSD            is a pointer to a double word which is filled in by the 
  7194.                      mini-FSD with data to be passed on to the FSD. 
  7195.  
  7196.  DumpRoutine         is a pointer to a double word which is filled in by the 
  7197.                      mini-FSD with the address of an alternative stand-alone 
  7198.                      dump procedure. 
  7199.  
  7200.  Returns 
  7201.  
  7202.  If no error is detected, a zero error code is returned. If an error is 
  7203.  detected, a non-zero error code is returned. 
  7204.  
  7205.  Remarks 
  7206.  
  7207.  The mini-FSD should fill in the data pointed to by pMiniFSD with any 32-bit 
  7208.  value it wishes to pass on to the FSD (see FS_INIT). OS/2 makes no assumptions 
  7209.  about the type of data passed. Typically, this will be a pointer to important 
  7210.  data structures within the mini-FSD which the FSD needs to know about. 
  7211.  
  7212.  OS/2 will not free the segment containing BootData. It should be freed by the 
  7213.  mini-FSD if appropriate. 
  7214.  
  7215.  The DumpProcedure is a routine provided by the mini-FSD which replaces the 
  7216.  diskette-based OS/2 stand-alone dump procedure. This routine is given control 
  7217.  after the OS/2 kernel receives a stand-alone dump request. The OS/2 kernel 
  7218.  places the machine in a stable, real mode state in which most interrupt 
  7219.  vectors contain their original power-up value. If this address is left at 
  7220.  zero, the OS/2 kernel will attempt to initiate a storage dump to diskette, if 
  7221.  a diskette drive exists. The provided routine must handle the dumping of 
  7222.  storage to an acceptable media. 
  7223.  
  7224.  
  7225. ΓòÉΓòÉΓòÉ 8.4. MFS_OPEN - Open a file ΓòÉΓòÉΓòÉ
  7226.  
  7227. Purpose 
  7228.  
  7229. Open the specified file. 
  7230.  
  7231. Calling Sequence 
  7232.  
  7233. int far pascal MFS_OPEN(pszName, pulSize)
  7234.  
  7235. char far * pszName;
  7236. unsigned long far * pulSize;
  7237.  
  7238. Where 
  7239.  
  7240.  pszName             is a pointer to the ASCIIZ name of the file to be opened. 
  7241.                      It may include a path but will not include a drive. 
  7242.  
  7243.  pulSize             is a pointer to a double word which is filled in by the 
  7244.                      mini-FSD with the size of the file in bytes. 
  7245.  
  7246.  Returns 
  7247.  
  7248.  If no error is detected, a zero error code is returned. If an error is 
  7249.  detected, a non-zero error code is returned. 
  7250.  
  7251.  Remarks 
  7252.  
  7253.  Only one file at a time will be opened by this call. The drive will always be 
  7254.  the boot drive. 
  7255.  
  7256.  The current file position is set to the beginning of the file. 
  7257.  
  7258.  
  7259. ΓòÉΓòÉΓòÉ 8.5. MFS_READ - Read from a file ΓòÉΓòÉΓòÉ
  7260.  
  7261. Purpose 
  7262.  
  7263. Read the specified number of bytes from the file to a buffer location. 
  7264.  
  7265. Calling Sequence 
  7266.  
  7267. int far pascal MFS_READ(pcData, pusLength)
  7268.  
  7269. char far * pcData;
  7270. unsigned long far * pusLength;
  7271.  
  7272. Where 
  7273.  
  7274.  pcData              is a pointer to the data area to be read into. The data 
  7275.                      area is guaranteed to be below the 1-Meg boundary. 
  7276.  
  7277.  pusLength           is a pointer to a word which on entry specifies the number 
  7278.                      of bytes to be read. On return, it is filled in by the 
  7279.                      mini-FSD with the number of bytes successfully read. 
  7280.  
  7281.  Returns 
  7282.  
  7283.  If no error is detected, a zero error code is returned. If an error is 
  7284.  detected, a non-zero error code is returned. 
  7285.  
  7286.  Remarks 
  7287.  
  7288.  The current file position is advanced by the number of bytes read. 
  7289.  
  7290.  
  7291. ΓòÉΓòÉΓòÉ 8.6. MFS_TERM - Terminate the mini-FSD ΓòÉΓòÉΓòÉ
  7292.  
  7293. Purpose 
  7294.  
  7295. Inform the mini-FSD that it should prepare itself for termination. 
  7296.  
  7297. Calling Sequence 
  7298.  
  7299. int far pascal MFS_TERM(void)
  7300.  
  7301. Returns 
  7302.  
  7303. If no error is detected, a zero error code is returned. If an error is 
  7304. detected, a non-zero error code is returned. 
  7305.  
  7306. Remarks 
  7307.  
  7308. The system will NOT free any memory explicitly allocated by the mini-FSD 
  7309. through MFSH_SEGALLOC or FSH_SEGALLOC. It must be explicitly freed by the 
  7310. mini-FSD. (Memory allocated by the mini-FSD and 'given' to the FSD need not be 
  7311. freed.) The system will free all of the segments loaded as part of the mini-FSD 
  7312. image immediately after this call. 
  7313.  
  7314.  
  7315. ΓòÉΓòÉΓòÉ 9. mini-FSD Helper Routines ΓòÉΓòÉΓòÉ
  7316.  
  7317. The following table summaries the mini-FSD Helper Routines: 
  7318.  
  7319.  
  7320.  FSD Helper           Description
  7321.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7322.  MFSH_CALLRM          Put machine in real mode
  7323.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7324.  MFSH_DOVOLIO         Read sectors
  7325.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7326.  MFSH_INTERR          Internal error
  7327.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7328.  MFSH_LOCK            Lock segment
  7329.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7330.  MFSH_PHYSTOVIRT      Convert physical to virtual address
  7331.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7332.  MFSH_SEGALLOC        Allocate a segment
  7333.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7334.  MFSH_SEGFREE         Free a segment
  7335.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7336.  MFSH_SEGREALLOC      Change segment size
  7337.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7338.  MFSH_SETBOOTDRIVE    Change boot drive number kept by the OS/2 kernel
  7339.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7340.  MFSH_UNLOCK          Unlock a segment
  7341.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7342.  MFSH_UNPHYSTOVIRT    Mark completion of use of virtual address
  7343.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7344.  MFSH_VIRT2PHYS       Convert virtual to physical address
  7345.  
  7346. Table 4-2. Summary of mini-FSD Helpers 
  7347.  
  7348.  
  7349. ΓòÉΓòÉΓòÉ 9.1. MFSH_CALLRM - Put machine in real mode ΓòÉΓòÉΓòÉ
  7350.  
  7351. Purpose 
  7352.  
  7353. Put the machine into real mode, call the specified routine, put the machine 
  7354. back into protect mode, and return. 
  7355.  
  7356. Calling Sequence 
  7357.  
  7358. int far pascal MFSH_CALLRM(plRoutine)
  7359.  
  7360. unsigned long far * plRoutine;
  7361.  
  7362. Where 
  7363.  
  7364.  plRoutine           is a pointer to a double word which contains the VIRTUAL 
  7365.                      address of the routine to call. 
  7366.  
  7367.  Returns 
  7368.  
  7369.  There are no error returns. 
  7370.  
  7371.  Remarks 
  7372.  
  7373.  Only registers DS and SI will be preserved between the caller and the target 
  7374.  routine. The selector in DS will be converted to a segment before calling the 
  7375.  target routine. Arguments may not be passed on the stack since a stack switch 
  7376.  may occur. 
  7377.  
  7378.  This helper allows the mini-FSD to access the ROM BIOS functions which 
  7379.  typically run in real mode only. Great care must be taken in using this 
  7380.  function since selectors used throughout the system are meaningless in real 
  7381.  mode. While in real mode, no calls to any helpers may be made. 
  7382.  
  7383.  
  7384. ΓòÉΓòÉΓòÉ 9.2. MFSH_DOVOLIO - Read sectors ΓòÉΓòÉΓòÉ
  7385.  
  7386. Purpose 
  7387.  
  7388. Read the specified sectors. 
  7389.  
  7390. Calling Sequence 
  7391.  
  7392. int far pascal MFSH_DOVOLIO(pcData, pcSec, ulSec)
  7393.  
  7394. char far * pcData;
  7395. unsigned short far * pcSec;
  7396. unsigned long ulSec;
  7397.  
  7398. Where 
  7399.  
  7400.  pcData              is a pointer to the data area. The data area must be below 
  7401.                      the 1-Meg boundary. 
  7402.  
  7403.  pcSec               is a pointer to the word which specifies the number of 
  7404.                      sectors to be read. On return, it is filled in by the 
  7405.                      helper with the number of sectors successfully read. 
  7406.  
  7407.  ulSec               is the sector number for the beginning of the sector run. 
  7408.  
  7409.  Returns 
  7410.  
  7411.  If no error is detected, a zero error code is returned. If an error is 
  7412.  detected, one of the following error codes is returned: 
  7413.  
  7414.  o ERROR_PROTECTION_VIOLATION 
  7415.  
  7416.    the supplied address or length is invalid. 
  7417.  
  7418.  o ERROR_INVALID_FUNCTION 
  7419.  
  7420.    either bit 0 of the boot mode flags was set on entry to OS2LDR or the system 
  7421.    is not in stage 1. 
  7422.  
  7423.  Remarks 
  7424.  
  7425.  The only media which can be read by this call is the boot volume. The 
  7426.  machine's interrupt 13H BIOS function is used to actually do the disk reads. 
  7427.  The data area will be locked and unlocked by this helper. Soft errors are 
  7428.  retried automatically. Hard errors are reported to the user through a message 
  7429.  and the system is stopped. 
  7430.  
  7431.  
  7432. ΓòÉΓòÉΓòÉ 9.3. MFSH_INTERR - Internal Error ΓòÉΓòÉΓòÉ
  7433.  
  7434. Purpose 
  7435.  
  7436. Declare an internal error and halt the system. 
  7437.  
  7438. Calling Sequence 
  7439.  
  7440. int far pascal MFSH_INTERR(pcMsg, cbMsg)
  7441.  
  7442. char far * pcMsg;
  7443. unsigned short cbMsg;
  7444.  
  7445. Where 
  7446.  
  7447.  pcMsg               is a pointer to the message text. 
  7448.  
  7449.  cbMsg               is the length of the message text. 
  7450.  
  7451.  Returns 
  7452.  
  7453.  There are no error returns. 
  7454.  
  7455.  Remarks 
  7456.  
  7457.  This call should be used when an inconsistency is detected within the 
  7458.  mini-FSD. This call does not return. An error message will be displayed and 
  7459.  the system will be stopped. See the description of FSH_INTERR. 
  7460.  
  7461.  
  7462. ΓòÉΓòÉΓòÉ 9.4. MFSH_LOCK - Lock a segment ΓòÉΓòÉΓòÉ
  7463.  
  7464. Purpose 
  7465.  
  7466. Lock a segment in place in physical memory. 
  7467.  
  7468. Calling Sequence 
  7469.  
  7470. int far pascal MFSH_LOCK(usSel, pulHandle)
  7471.  
  7472. unsigned short usSel;
  7473. unsigned long far * pulHandle;
  7474.  
  7475. Where 
  7476.  
  7477.  usSel               is the selector of the segment to be locked. 
  7478.  
  7479.  pulHandle           is a pointer to a double word which is filled in by the 
  7480.                      helper with the lock handle. 
  7481.  
  7482.  Returns 
  7483.  
  7484.  If no error is detected, a zero error code is returned. If an error is 
  7485.  detected, one of the following error codes is returned: 
  7486.  
  7487.  o ERROR_PROTECTION_VIOLATION 
  7488.  
  7489.    the supplied address or selector is invalid. 
  7490.  
  7491.  Remarks 
  7492.  
  7493.  This helper is for use by a mini-FSD with an imbedded device driver. It is the 
  7494.  same as the standard device driver LOCK helper with the following assumptions: 
  7495.  The lock is defined to be short term and will block until the segment is 
  7496.  loaded. 
  7497.  
  7498.  
  7499. ΓòÉΓòÉΓòÉ 9.5. MFSH_PHYSTOVIRT - Convert physical to virtual address ΓòÉΓòÉΓòÉ
  7500.  
  7501. Purpose 
  7502.  
  7503. Translate the physical address of a data buffer into a virtual address. 
  7504.  
  7505. Calling Sequence 
  7506.  
  7507. int far pascal MFSH_PHYSTOVIRT(ulAddr, usLen, pusSel)
  7508.  
  7509. unsigned long ulAddr;
  7510. unsigned short usLen;
  7511. unsigned short far * pusSel;
  7512.  
  7513. Where 
  7514.  
  7515.  ulAddr              is the physical address to be translated. 
  7516.  
  7517.  usLen               is the length of the segment for the physical address. 
  7518.  
  7519.  pusSel              is a pointer to the word in which the selector or segment 
  7520.                      is returned. 
  7521.  
  7522.  Returns 
  7523.  
  7524.  If an error is not detected, a zero error code is returned. If an error is 
  7525.  detected, the following error is returned: 
  7526.  
  7527.  o ERROR_PROTECTION_VIOLATION 
  7528.  
  7529.    the supplied address is invalid. 
  7530.  
  7531.  Remarks 
  7532.  
  7533.  This helper is for use by a mini-FSD with an imbedded device driver. It is the 
  7534.  same as the standard device driver helper PHYSTOVIRT. A segment/offset pair is 
  7535.  returned in real mode for addresses below the 1-Meg boundary. Else a 
  7536.  selector/offset pair is returned. 
  7537.  
  7538.  A caller must issue a corresponding UNPHYSTOVIRT before returning to its 
  7539.  caller or using any other helpers. 
  7540.  
  7541.  
  7542. ΓòÉΓòÉΓòÉ 9.6. MFSH_SEGALLOC - Allocate a segment ΓòÉΓòÉΓòÉ
  7543.  
  7544. Purpose 
  7545.  
  7546. Allocate memory. 
  7547.  
  7548. Calling Sequence 
  7549.  
  7550. int far pascal MFSH_SEGALLOC(usFlag, cbSeg, pusSel)
  7551.  
  7552. unsigned short usFlag;
  7553. unsigned long cbSeg;
  7554. unsigned short far * pusSel;
  7555.  
  7556. Where 
  7557.  
  7558.  usFlag              is set to 1 if the memory must be below the 1-meg boundary 
  7559.                      or 0 if its location does not matter. 
  7560.  
  7561.  cbSeg               contains the length of the segment. 
  7562.  
  7563.  pusSel              is a pointer to a word in which the helper returns the 
  7564.                      selector of the segment. 
  7565.  
  7566.  Returns 
  7567.  
  7568.  If no error is detected, a zero error code is returned. If an error is 
  7569.  detected, one of the following error codes is returned: 
  7570.  
  7571.  o ERROR_NOT_ENOUGH_MEMORY 
  7572.  
  7573.    too much memory is allocated. 
  7574.  
  7575.  o ERROR_PROTECTION_VIOLATION 
  7576.  
  7577.    the supplied address is invalid. 
  7578.  
  7579.  o ERROR_INVALID_PARAMETER 
  7580.  
  7581.    either the supplied flag or length is invalid. 
  7582.  
  7583.  Remarks 
  7584.  
  7585.  This function allocates memory with the following attributes: 
  7586.  
  7587.  o Allocated from the GDT 
  7588.  
  7589.  o Non-swappable 
  7590.  
  7591.  Memory not allocated specifically below the 1-Meg boundary may be given to the 
  7592.  FSD by passing the selectors through pMiniFSD (see MFS_INIT and FS_INIT). 
  7593.  
  7594.  
  7595. ΓòÉΓòÉΓòÉ 9.7. MFSH_SEGFREE - Free a segment ΓòÉΓòÉΓòÉ
  7596.  
  7597. Purpose 
  7598.  
  7599. Free a memory segment. 
  7600.  
  7601. Calling Sequence 
  7602.  
  7603. int far pascal MFSH_SEGFREE(usSel)
  7604.  
  7605. unsigned short usSel;
  7606.  
  7607. Where 
  7608.  
  7609.  usSel               contains the selector of the segment to be freed. 
  7610.  
  7611.  Returns 
  7612.  
  7613.  If no error is detected, a zero error error code is returned. If an error is 
  7614.  detected, the following error code is returned: 
  7615.  
  7616.  o ERROR_PROTECTION_VIOLATION 
  7617.  
  7618.    the selector is invalid. 
  7619.  
  7620.  Remarks 
  7621.  
  7622.  This function releases a segment previously allocated with MFSH_SEGALLOC, or 
  7623.  loaded as part of the mini-FSD image. 
  7624.  
  7625.  
  7626. ΓòÉΓòÉΓòÉ 9.8. MFSH_SEGREALLOC - Change segment size ΓòÉΓòÉΓòÉ
  7627.  
  7628. Purpose 
  7629.  
  7630. Change the size of memory. 
  7631.  
  7632. Calling Sequence 
  7633.  
  7634. int far pascal MFSH_SEGREALLOC(usSel, cbSeg)
  7635.  
  7636. unsigned short usSel;
  7637. unsigned long cbSeg;
  7638.  
  7639. Where 
  7640.  
  7641.  usSel               contains the selector of the segment to be resized. 
  7642.  
  7643.  cbSeg               contains the new length of the segment. 
  7644.  
  7645.  Returns 
  7646.  
  7647.  If no error is detected, a zero error code is returned. If an error is 
  7648.  detected, on of the following error codes is returned: 
  7649.  
  7650.  o ERROR_NOT_MEMORY 
  7651.  
  7652.    too much memory is allocated. 
  7653.  
  7654.  o ERROR_PROTECTION_VIOLATION 
  7655.  
  7656.    the supplied selector is invalid. 
  7657.  
  7658.  o ERROR_INVALID_PARAMETER 
  7659.  
  7660.    the supplied length is invalid. 
  7661.  
  7662.  Remarks 
  7663.  
  7664.  This call changes the size of a segment previously allocated with 
  7665.  MFSH_SEGALLOC, or loaded as part of the mini-FSD image. 
  7666.  
  7667.  The segment may be grown or shrunk. When grown, the extra space is 
  7668.  uninitialized. The segment may be moved in the process. 
  7669.  
  7670.  
  7671. ΓòÉΓòÉΓòÉ 9.9. MFSH_SETBOOTDRIVE - Change boot drive number kept by the OS/2 kernel ΓòÉΓòÉΓòÉ
  7672.  
  7673. Purpose 
  7674.  
  7675. Change boot drive number kept by the kernel to allow a change in the assignment 
  7676. of boot drive as seen by later processes. 
  7677.  
  7678. Calling Sequence 
  7679.  
  7680. int far pascal MFSH_SETBOOTDRIVE(usDrive)
  7681.  
  7682. unsigned short usDrive;
  7683.  
  7684. Where 
  7685.  
  7686.  usDrive             contains the 0-based drive number that the mini-FSD wants 
  7687.                      the system to consider as the boot drive. 
  7688.  
  7689.  Returns 
  7690.  
  7691.  If no error is detected, a zero error code is returned. If an error is 
  7692.  detected, on of the following error codes is returned: 
  7693.  
  7694.  o ERROR_INVALID_PARAMETER 
  7695.  
  7696.    the supplied drive number is invalid. 
  7697.  
  7698.  Remarks 
  7699.  
  7700.  This call changes the boot drive number that is kept in the global info 
  7701.  segment of the system. Valid values range from 2 (=C) to 25 (=Z). This 
  7702.  function must be called during the call to MFS_INIT to update the info segment 
  7703.  correctly. This is routine should be used by RIPL mini-FSDs. 
  7704.  
  7705.  
  7706. ΓòÉΓòÉΓòÉ 9.10. MFSH_UNLOCK - Unlock a segment ΓòÉΓòÉΓòÉ
  7707.  
  7708. Purpose 
  7709.  
  7710. Unlock a segment which was previous locked by calling MFSH_LOCK. 
  7711.  
  7712. Calling Sequence 
  7713.  
  7714. int far pascal MFSH_SEGREALLOC(ulHandle)
  7715.  
  7716. unsigned long ulHandle;
  7717.  
  7718. Where 
  7719.  
  7720.  ulHandle            contains the handle returned from MFSH_LOCK of the segment 
  7721.                      to unlock. 
  7722.  
  7723.  Returns 
  7724.  
  7725.  If no error is detected, a zero error code is returned. If an error is 
  7726.  detected, the following error code is returned: 
  7727.  
  7728.  o ERROR_PROTECTION_VIOLATION 
  7729.  
  7730.    the supplied address is invalid. 
  7731.  
  7732.  Remarks 
  7733.  
  7734.  This helper is for use by a mini-FSD with an imbedded device driver. It is the 
  7735.  same as the standard device driver helper UNLOCK. 
  7736.  
  7737.  
  7738. ΓòÉΓòÉΓòÉ 9.11. MFSH_UNPHYSTOVIRT - Mark completion of use of virtual address ΓòÉΓòÉΓòÉ
  7739.  
  7740. Purpose 
  7741.  
  7742. Release the selector allocated previously by calling MFSH_PHYSTOVIRT. 
  7743.  
  7744. Calling Sequence 
  7745.  
  7746. int far pascal MFSH_UNPHYSTOVIRT(usSel)
  7747.  
  7748. unsigned short usSel;
  7749.  
  7750. Where 
  7751.  
  7752.  usSel               contains the selector to released. 
  7753.  
  7754.  Returns 
  7755.  
  7756.  If no error is detected, a zero error code is returned. If an error is 
  7757.  detected, the following error code is returned: 
  7758.  
  7759.  o ERROR_PROTECTION_VIOLATION 
  7760.  
  7761.    the supplied selector is invalid. 
  7762.  
  7763.  Remarks 
  7764.  
  7765.  This helper is for use by a mini-FSD with an imbedded device driver. It is the 
  7766.  same as the standard device driver UNPHYSTOVIRT helper. 
  7767.  
  7768.  A caller must issue a corresponding UNPHYSTOVIRT after calling PHYSTOVIRT, 
  7769.  before returning to its caller or using any other helpers. 
  7770.  
  7771.  
  7772. ΓòÉΓòÉΓòÉ 9.12. MFSH_VIRT2PHYS - Convert virtual to physical address ΓòÉΓòÉΓòÉ
  7773.  
  7774. Purpose 
  7775.  
  7776. Translate the address of a data buffer into a physical address. 
  7777.  
  7778. Calling Sequence 
  7779.  
  7780. int far pascal MFSH_VIRT2PHYS(ulVirtAddr, pulPhysAddr)
  7781.  
  7782. unsigned long ulVirtAddr;
  7783. unsigned long far * pulPhysAddr;
  7784.  
  7785. Where 
  7786.  
  7787.  ulVirtAddr          contains the virtual address of the data area. 
  7788.  
  7789.  PhysAddr            is a pointer to a double word in which the helper returns 
  7790.                      the physical address of the data area. 
  7791.  
  7792.  Returns 
  7793.  
  7794.  If no error is detected, a zero error code is returned. If an error is 
  7795.  detected, the following error is returned: 
  7796.  
  7797.  o ERROR_PROTECTION_VIOLATION 
  7798.  
  7799.    the supplied address is invalid. 
  7800.  
  7801.  Remarks 
  7802.  
  7803.  This helper is for use by a mini-FSD with an imbedded device driver. It is the 
  7804.  same as the standard device driver helper VIRTTOPHYS.