home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / smart21b.zip / APIREF.INF (.txt) next >
OS/2 Help File  |  1998-10-14  |  178KB  |  9,188 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Edition Notice ΓòÉΓòÉΓòÉ
  3.  
  4. Note  Before using this information and the product it supports, be sure to 
  5.       read the general information under Notices. 
  6.  
  7. First Edition 
  8.  
  9. This edition applies to OS/2 Warp Server for e-business and to all subsequent 
  10. releases and modifications until otherwise indicated in new editions. 
  11.  
  12.  
  13. ΓòÉΓòÉΓòÉ 2. Control Program Functions ΓòÉΓòÉΓòÉ
  14.  
  15. This chapter contains an alphabetic list of the following Control Program 
  16. functions. 
  17.  
  18.      DosCancelLockRequestL 
  19.  
  20.      DosFindFirst 
  21.  
  22.      DosFindNext 
  23.  
  24.      DosListIOL 
  25.  
  26.      DosOpenL 
  27.  
  28.      DosProtectOpenL 
  29.  
  30.      DosProtectQueryFileInfo 
  31.  
  32.      DosProtectSetFileInfo 
  33.  
  34.      DosProtectSetFileLocksL 
  35.  
  36.      DosProtectSetFilePrtL 
  37.  
  38.      DosProtectSetFileSizeL 
  39.  
  40.      DosQueryFileInfo 
  41.  
  42.      DosQueryPathInfo 
  43.  
  44.      DosQuerySysInfo 
  45.  
  46.      DosQueryThreadAffinity 
  47.  
  48.      DosSetFileInfo 
  49.  
  50.      DosSetFileLocksL 
  51.  
  52.      DosSetFilePtrL 
  53.  
  54.      DosSetFileSizeL 
  55.  
  56.      DosSetPathInfo 
  57.  
  58.      DosSetThreadAffinity 
  59.  
  60.  
  61. ΓòÉΓòÉΓòÉ 2.1. DosCancelLockRequestL ΓòÉΓòÉΓòÉ
  62.  
  63. Purpose 
  64.  
  65. DosCancelLockRequestL cancels an outstanding DosSetFileLocksL request. 
  66.  
  67. Syntax 
  68.  
  69. #define INCL_DOSFILEMGR
  70. #include <os2.h>
  71.  
  72.  APIRET DosCancelLockRequestL (HFILE hFile, PFILELOCKL pflLock) 
  73.  
  74.  Parameters 
  75.  
  76.  hFile (HFILE) - input 
  77.            File handle used in the DosSetFileLocksL function that is to be 
  78.            cancelled. 
  79.  
  80.  pflLockL (PFILELOCKL) - input 
  81.            Address of the structure describing the lock request to cancel. 
  82.  
  83.  Returns 
  84.  
  85.  ulrc (APIRET) - returns 
  86.            Return Code. 
  87.  
  88.            DosCancelLockRequestL returns one of the following values: 
  89.  
  90.            0              NO_ERROR 
  91.  
  92.            6              ERROR_INVALID_HANDLE 
  93.  
  94.            87             ERROR_INVALID_PARAMETER 
  95.  
  96.            173            ERROR_CANCEL_VIOLATION 
  97.  
  98.  Remarks 
  99.  
  100.  DosCancelLockRequestL allows a process to cancel the lock range request of an 
  101.  outstanding DosSetFileLocksL function. 
  102.  
  103.  If two threads in a process are waiting on a lock file range, and another 
  104.  thread issues DosCancelLockRequestL for that lock file range, then both 
  105.  waiting threads are released. 
  106.  
  107.  Not all file-system drivers (FSDs) can cancel an outstanding lock request. 
  108.  
  109.  Local Area Network (LAN) servers cannot cancel an outstanding lock request if 
  110.  they use a version of the operating system prior to OS/2 Version 2.00. 
  111.  
  112.  Related Functions 
  113.  
  114.      DosSetFileLocksL 
  115.  
  116.  Example Code 
  117.  
  118.  This example opens a file named "CANLOCK.DAT", locks a block of the data, 
  119.  writes some data to it, and then cancels the lock request. 
  120.  
  121.   #define INCL_DOSFILEMGR       /* File Manager values */
  122.   #define INCL_DOSERRORS        /* DOS Error values    */
  123.   #include <os2.h>
  124.   #include <stdio.h>
  125.   #include <string.h>
  126.  
  127.   int main(VOID) {
  128.  
  129.   HFILE     FileHandle   = NULLHANDLE;  /* File handle */
  130.   ULONG     Action       = 0,           /* Action taken by DosOpenL */
  131.   Wrote        = 0;           /* Number of bytes written by DosWrite */
  132.   CHAR      FileData[40] = "Forty bytes of demonstration text data\r\n";
  133.   APIRET    rc           = NO_ERROR;    /* Return code */
  134.  
  135.   FILELOCKL  LockArea     = {0},         /* Area of file to lock */
  136.   UnlockArea   = {0};         /* Area of file to unlock */
  137.  
  138.   rc = DosOpenL("canlock.dat",                 /* File to open */
  139.   &FileHandle,                   /* File handle */
  140.   &Action,                       /* Action taken */
  141.   256,                           /* File primary allocation */
  142.   FILE_ARCHIVED,                 /* File attributes */
  143.   FILE_OPEN | FILE_CREATE,       /* Open function type */
  144.   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE,
  145.   0L);                           /* No extended attributes */
  146.   if (rc != NO_ERROR) {                       /* If open failed */
  147.   printf("DosOpenL error: return code = %u\n", rc);
  148.   return 1; }
  149.  
  150.   LockArea.lOffset = 0;               /* Start locking at beginning of file */
  151.   LockArea.lRange =  40;              /* Use a lock range of 40 bytes       */
  152.   UnLockArea.lOffset = 0;             /* Start unlocking at beginning of file */
  153.   UnLockArea.lRange =  0;             /* Use a unlock range of 0 bytes       */
  154.  
  155.   rc = DosSetFileLocksL(FileHandle,        /* File handle   */
  156.   &UnlockArea,       /* No unlock area */
  157.   &LockArea,         /* Lock current record */
  158.   2000L,             /* Lock time-out value of 2 seconds */
  159.   0L);               /* Exclusive lock, not atomic */
  160.   if (rc != NO_ERROR) {
  161.   printf("DosSetFileLocks error: return code = %u\n", rc);
  162.   return 1;
  163.   }
  164.  
  165.   rc = DosWrite(FileHandle, FileData, sizeof(FileData), &Wrote);
  166.   if (rc != NO_ERROR) {
  167.   printf("DosWrite error: return code = %u\n", rc);
  168.   return 1;
  169.   }
  170.   /* Should check if (rc != NO_ERROR) here... */
  171.  
  172.   LockArea.lOffset = 0;               /* Start locking at beginning of file */
  173.   LockArea.lRange =  0;               /* Use a lock range of 40 bytes       */
  174.   UnLockArea.lOffset = 0;             /* Start locking at beginning of file */
  175.   UnLockArea.lRange = 40;             /* Use a lock range of 40 bytes       */
  176.  
  177.   rc = DosSetFileLocksL(FileHandle,        /* File handle   */
  178.   &UnlockArea,       /* Unlock area */
  179.   &LockArea,         /* No Lock */
  180.   2000L,             /* Lock time-out value of 2 seconds */
  181.   0L);               /* Exclusive lock, not atomic */
  182.   if (rc != NO_ERROR) {
  183.   printf("DosSetFileLocksL error: return code = %u\n", rc);
  184.   return 1;
  185.   }rc = DosClose(FileHandle);
  186.   /* Should check if (rc != NO_ERROR) here... */
  187.  
  188.   return NO_ERROR;
  189.   }rc = DosClose(FileHandle);
  190.   /* Should check if (rc != NO_ERROR) here... */
  191.  
  192.   return NO_ERROR;
  193.   }
  194.  
  195.  
  196. ΓòÉΓòÉΓòÉ 2.2. DosFindFirst ΓòÉΓòÉΓòÉ
  197.  
  198. Purpose 
  199.  
  200. DosFindFirst finds the first file object or group of file objects whose names 
  201. match the specification. The specification can include extended attributes (EA) 
  202. associated with a file or directory. 
  203.  
  204. Syntax 
  205.  
  206. #define INCL_DOSFILEMGR
  207. #include <os2.h>
  208.  
  209.  APIRET DosFindFirst (PSZ pszFileSpec, PHDIR phdir, ULONG flAttribute, 
  210.            PVOID pfindbuf, ULONG cbBuf, PULONG pcFileNames, ULONG ulInfoLevel) 
  211.  
  212.  Parameters 
  213.  
  214.  pszFileSpec (PSZ) - input 
  215.            Address of the ASCIIZ path name of the file or subdirectory to be 
  216.            found. 
  217.  
  218.            The name component can contain global file name characters. 
  219.  
  220.  phdir (PHDIR) - in/out 
  221.            Address of the handle associated with this DosFindFirst request. 
  222.  
  223.            The values that can be specified for the handle are: 
  224.  
  225.            HDIR_SYSTEM (0x00000001) 
  226.                     The system assigns the handle for standard output, which is 
  227.                     always available to a process. 
  228.  
  229.            HDIR_CREATE (0xFFFFFFFF) 
  230.                     The system allocates and returns a handle. Upon return to 
  231.                     the caller, phdir contains the handle allocated by the 
  232.                     system. 
  233.  
  234.            The DosFindFirst handle is used with subsequent DosFindNext 
  235.            requests. Reuse of this handle in another DosFindFirst request 
  236.            closes the association with the previous DosFindFirst request, and 
  237.            opens a new association with the current DosFindFirst request. 
  238.  
  239.  flAttribute (ULONG) - input 
  240.            Attribute value that determines the file objects to be searched for. 
  241.  
  242.            The bit values are shown in the following list: 
  243.  
  244.            Bits           Description 
  245.  
  246.            31-14          Reserved; must be 0. 
  247.  
  248.            13             MUST_HAVE_ARCHIVED (0x00002000) 
  249.  
  250.                           Must-Have Archive bit; excludes files without the 
  251.                           archive bit set if bit 13 is set to 1. Files may have 
  252.                           the Archive bit set if bit 13 is set to 0. 
  253.  
  254.            12             MUST_HAVE_DIRECTORY (0x00001000) 
  255.  
  256.                           Must-Have Subdirectory bit; excludes files that are 
  257.                           not subdirectories if bit 12 is set to 1. Files may 
  258.                           have the Subdirectory bit set if bit 12 is set to 0. 
  259.  
  260.            11             Reserved; must be 0. 
  261.  
  262.            10             MUST_HAVE_SYSTEM (0x00000400) 
  263.  
  264.                           Must-Have System File bit; excludes nonsystem files 
  265.                           if bit 10 is set to 1. Files may be system files if 
  266.                           bit 10 is set to 0. 
  267.  
  268.            9              MUST_HAVE_HIDDEN (0x00000200) 
  269.  
  270.                           Must-Have Hidden File bit; excludes nonhidden files 
  271.                           if bit 9 is set to 1. Files may be nonhidden if bit 9 
  272.                           is set to 0. 
  273.  
  274.            8              MUST_HAVE_READONLY (0x00000100) 
  275.  
  276.                           Must-Have Read-Only File bit; excludes writeable 
  277.                           files if bit 8 is set to 1. Files may be read-only if 
  278.                           bit 8 is set to 0. 
  279.  
  280.            7-6            Reserved; must be 0. 
  281.  
  282.            5              FILE_ARCHIVED (0x00000020) 
  283.  
  284.                           May-Have Archive bit; includes files with the Archive 
  285.                           bit set if bit 5 is set to 1. Excludes files with the 
  286.                           Archive bit set if bit 5 is set to 0. 
  287.  
  288.            4              FILE_DIRECTORY (0x00000010) 
  289.  
  290.                           May-Have Subdirectory bit; includes files that are 
  291.                           subdirectories if bit 4 is set to 1. Excludes files 
  292.                           that are subdirectories if bit 4 is set to 0. 
  293.  
  294.            3              Reserved; must be 0. 
  295.  
  296.            2              FILE_SYSTEM (0x00000004) 
  297.  
  298.                           May-Have System File bit; includes system files if 
  299.                           bit 2 is set to 1. Excludes system files if bit 2 is 
  300.                           set to 0. 
  301.  
  302.            1              FILE_HIDDEN (0x00000002) 
  303.  
  304.                           May-Have Hidden File bit; includes hidden files if 
  305.                           bit 1 is set to 1. Excludes hidden files if bit 1 is 
  306.                           set to 0. 
  307.  
  308.            0              FILE_READONLY (0x00000001) 
  309.  
  310.                           May-Have Read-Only File bit; includes read-only files 
  311.                           if bit 0 is set to 1. Excludes read-only files if bit 
  312.                           0 is set to 0. 
  313.  
  314.            These bits may be set individually or in combination. For example, 
  315.            an attribute value of 0x00000021 (bits 5 and 0 set to 1) indicates 
  316.            searching for read-only files that have been archived. 
  317.  
  318.            Bits 8 through 13 are "Must-Have" flags. These allow you to obtain 
  319.            files that definitely have the given attributes. For example, if the 
  320.            Must-Have Subdirectory bit is set to 1, then all returned items are 
  321.            subdirectories. 
  322.  
  323.            If a Must-Have bit is set to 1, and the corresponding May-Have bit 
  324.            is set to 0, no items are returned for that attribute. 
  325.  
  326.            The attribute FILE_NORMAL (0x00000000) can be used to include files 
  327.            with any of the above bits set. 
  328.  
  329.            flAttribute cannot specify the volume label. Volume labels are 
  330.            queried using DosQueryFSInfo. 
  331.  
  332.  pfindbuf (PVOID) - in/out 
  333.            Result buffer. 
  334.  
  335.            The result buffer from DosFindFirst should be less than 64 KB. 
  336.  
  337.            Address of the directory search structures for file object 
  338.            information Levels 1 through 3 and 13. The structure required for 
  339.            pfindbuf is dependent on the value specified for ulInfoLevel. The 
  340.            information returned reflects the most recent call to DosClose or 
  341.            DosResetBuffer. 
  342.  
  343.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) : 
  344.                    On output, pfindbuf contains the FILEFINDBUF3 data structure 
  345.                    without the last two fields: cchName and achName. This is 
  346.                    used without EAs. 
  347.  
  348.                    The oNextEntryOffset field indicates the number of bytes 
  349.                    from the beginning of the current structure to the beginning 
  350.                    of the next structure. When this field is 0, the last 
  351.                    structure has been reached. 
  352.  
  353.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  354.                    pInfo contains the FILESTATUS3L data structure, to which 
  355.                    file information is returned. 
  356.  
  357.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) : 
  358.                    On output, pfindbuf contains the FILEFINDBUF4 data structure 
  359.                    without the last two fields: cchName and achName. This is 
  360.                    used with EAs. 
  361.  
  362.                    The cbList field contains the size, in bytes, of the file's 
  363.                    entire EA set on disk. You can use this field to calculate 
  364.                    the maximum size of the buffer needed for Level 3 file 
  365.                    information. The size of the buffer required to hold the 
  366.                    entire EA set is less than or equal to twice the size of the 
  367.                    EA set on disk. 
  368.  
  369.            Level 12 File Information (ulInfoLevel == FIL_QUERYEASIZEL) 
  370.                    pInfo contains the FILESTATUS4L data structure. This is 
  371.                    similar to the Level 11 structure, with the addition of the 
  372.                    cbList field after the attrFile field. 
  373.  
  374.                    The cbList field is a ULONG. On output, this field contains 
  375.                    the size, in bytes, of the file's entire extended attribute 
  376.                    (EA) set on disk. You can use this value to calculate the 
  377.                    size of the buffer required to hold the EA information 
  378.                    returned when a value of 3 is specified for ulInfoLevel. The 
  379.                    buffer size is less than or equal to twice the size of the 
  380.                    file's entire EA set on disk. 
  381.  
  382.            Level 3 File Information (ulInfoLevel == FIL_QUERYEASFROMLIST) : 
  383.                    On input, pfindbuf contains an EAOP2 data structure. 
  384.                    fpGEA2List contains a pointer to a GEA2 list, which defines 
  385.                    the attribute names whose values are to be returned. Entries 
  386.                    in the GEA2 list must be aligned on a doubleword boundary. 
  387.                    Each oNextEntryOffset field must contain the number of bytes 
  388.                    from the beginning of the current entry to the beginning of 
  389.                    the next entry. 
  390.  
  391.                    On output, pfindbuf contains a structure with a set of 
  392.                    records, each aligned on a doubleword boundary. These 
  393.                    records represent the directory entry and associated EAs for 
  394.                    the matched file object. pfindbuf has the following format: 
  395.  
  396.                        The EAOP2 data structure, with the fpFEA2List pointer 
  397.                         incorrect. 
  398.  
  399.                         The EAOP2 data structure occurs only once in the 
  400.                         pfindbuf buffer. The rest of these records are repeated 
  401.                         for the remainder of the file objects found. 
  402.  
  403.                        A FILEFINDBUF3 data structure without the last two 
  404.                         fields: cchName and achName. 
  405.  
  406.                        A FEA2LIST data structure contained in and related to 
  407.                         the FILEFINDBUF3 returned. 
  408.  
  409.                        Length of the name string of the file object (cbName) 
  410.  
  411.                        Name of the file object matched by the input pattern 
  412.                         (achName) 
  413.  
  414.                    Even if there is not enough room to hold all of the 
  415.                    requested information, as for return code 
  416.                    ERROR_BUFFER_OVERFLOW, the cbList field of the FEA2LIST data 
  417.                    structure is valid if there is at least enough space to hold 
  418.                    it. 
  419.  
  420.                    When buffer overflow occurs, cbList contains the size on 
  421.                    disk of the entire EA set for the file, even if only a 
  422.                    subset of its attributes was requested. The size of the 
  423.                    buffer required to hold the EA set is less than or equal to 
  424.                    twice the size of the EA set on disk. If no error occurs, 
  425.                    cbList includes the pad bytes (for doubleword alignment) 
  426.                    between FEA2 structures in the list. 
  427.  
  428.                    If a particular attribute is not attached to the object, 
  429.                    pfindbuf has an FEA2 structure containing the name of the 
  430.                    attribute, and the length value is 0. 
  431.  
  432.                    The GEA2 list contained inside pfindbuf during a Level 3 
  433.                    DosFindFirst and DosFindNext call is not "read-only"; it is 
  434.                    used by the operating system. When the function returns, the 
  435.                    list is restored to its original state, but inside the 
  436.                    function, the list is manipulated by the operating system. 
  437.                    This is of concern to a multithreaded application, where two 
  438.                    different threads might use the same GEA2 list as input. If 
  439.                    one thread calls DosFindFirst or DosFindNext while another 
  440.                    thread is inside DosFindFirst or DosFindNext, the second 
  441.                    thread will fail with a return code of ERROR_BAD_FORMAT. 
  442.  
  443.            For Level 13 File Information (ulInfoLevel == FIL_QUERYEASFROMLISTL) 
  444.            : 
  445.                    On input, pfindbuf contains an EAOP2 data structure. 
  446.                    fpGEA2List contains a pointer to a GEA2 list, which defines 
  447.                    the attribute names whose values are to be returned. Entries 
  448.                    in the GEA2 list must be aligned on a doubleword boundary. 
  449.                    Each oNextEntryOffset field must contain the number of bytes 
  450.                    from the beginning of the current entry to the beginning of 
  451.                    the next entry. 
  452.  
  453.                    On output, pfindbuf contains a structure with a set of 
  454.                    records, each aligned on a doubleword boundary. These 
  455.                    records represent the directory entry and associated EAs for 
  456.                    the matched file object. pfindbuf has the following format: 
  457.  
  458.                        The EAOP2 data structure, with the fpFEA2List pointer 
  459.                         incorrect. 
  460.  
  461.                         The EAOP2 data structure occurs only once in the 
  462.                         pfindbuf buffer. The rest of these records are repeated 
  463.                         for the remainder of the file objects found. 
  464.  
  465.                        A FILEFINDBUF3L data structure without the last two 
  466.                         fields: cchName and achName. 
  467.  
  468.                        A FEA2LIST data structure contained in and related to 
  469.                         the FILEFINDBUF3L returned. 
  470.  
  471.                        Length of the name string of the file object (cbName) 
  472.  
  473.                        Name of the file object matched by the input pattern 
  474.                         (achName) 
  475.  
  476.                    Even if there is not enough room to hold all of the 
  477.                    requested information, as for return code 
  478.                    ERROR_BUFFER_OVERFLOW, the cbList field of the FEA2LIST data 
  479.                    structure is valid if there is at least enough space to hold 
  480.                    it. 
  481.  
  482.                    When buffer overflow occurs, cbList contains the size on 
  483.                    disk of the entire EA set for the file, even if only a 
  484.                    subset of its attributes was requested. The size of the 
  485.                    buffer required to hold the EA set is less than or equal to 
  486.                    twice the size of the EA set on disk. If no error occurs, 
  487.                    cbList includes the pad bytes (for doubleword alignment) 
  488.                    between FEA2 structures in the list. 
  489.  
  490.                    If a particular attribute is not attached to the object, 
  491.                    pfindbuf has an FEA2 structure containing the name of the 
  492.                    attribute, and the length value is 0. 
  493.  
  494.                    The GEA2 list contained inside pfindbuf during a Level 13 
  495.                    DosFindFirst and DosFindNext call is not "read-only"; it is 
  496.                    used by the operating system. When the function returns, the 
  497.                    list is restored to its original state, but inside the 
  498.                    function, the list is manipulated by the operating system. 
  499.                    This is of concern to a multithreaded application, where two 
  500.                    different threads might use the same GEA2 list as input. If 
  501.                    one thread calls DosFindFirst or DosFindNext while another 
  502.                    thread is inside DosFindFirst or DosFindNext, the second 
  503.                    thread will fail with a return code of ERROR_BAD_FORMAT. 
  504.  
  505.  cbBuf (ULONG) - input 
  506.            The length, in bytes, of pfindbuf. 
  507.  
  508.  pcFileNames (PULONG) - in /out 
  509.            Pointer to the number of entries: 
  510.  
  511.            Input        The address of the number of matching entries requested 
  512.                         in pfindbuf. 
  513.  
  514.            Output       The number of entries placed into pfindbuf. 
  515.  
  516.  ulInfoLevel (ULONG) - input 
  517.            The level of file information required. 
  518.  
  519.            Possible values are: 
  520.  
  521.            1        FIL_STANDARD Level 1 file information (return standard file 
  522.                     information). 
  523.  
  524.            11       FIL_STANDARDL 
  525.  
  526.                     Level 11 file information 
  527.  
  528.            2        FIL_QUERYEASIZE 
  529.  
  530.                     Level 2 file information 
  531.  
  532.            12       FIL_QUERYEASIZEL 
  533.  
  534.                     Level 12 file information 
  535.  
  536.            3        FIL_QUERYEASFROMLIST Level 3 file information (return 
  537.                     requested EA). 
  538.  
  539.            13       FIL_QUERYEASFROMLISTL Level 13 file information (return 
  540.                     requested EA). 
  541.  
  542.            The structures described in pfindbuf indicate the information 
  543.            returned for each of these levels. 
  544.  
  545.            Regardless of the level specified, a DosFindFirst request (and an 
  546.            associated DosFindNext request on a handle returned by DosFindFirst) 
  547.            always includes Level 1 information as part of the information that 
  548.            is returned; however, when Level 1 information is specifically 
  549.            requested, and flAttribute specifies hidden files, system files, or 
  550.            subdirectory files, an inclusive search is made. That is, all normal 
  551.            file entries plus all entries matching any specified attributes are 
  552.            returned. Normal files are files without any mode bits set. They may 
  553.            be read from or written to. 
  554.  
  555.  Returns 
  556.  
  557.  ulrc (APIRET) - returns 
  558.            Return Code. 
  559.  
  560.            DosFindFirst returns one of the following values: 
  561.  
  562.            0              NO_ERROR 
  563.  
  564.            2              ERROR_FILE_NOT_FOUND 
  565.  
  566.            3              ERROR_PATH_NOT_FOUND 
  567.  
  568.            6              ERROR_INVALID_HANDLE 
  569.  
  570.            18             ERROR_NO_MORE_FILES 
  571.  
  572.            26             ERROR_NOT_DOS_DISK 
  573.  
  574.            87             ERROR_INVALID_PARAMETER 
  575.  
  576.            108            ERROR_DRIVE_LOCKED 
  577.  
  578.            111            ERROR_BUFFER_OVERFLOW 
  579.  
  580.            113            ERROR_NO_MORE_SEARCH_HANDLES 
  581.  
  582.            206            ERROR_FILENAME_EXCED_RANGE 
  583.  
  584.            208            ERROR_META_EXPANSION_TOO_LONG 
  585.  
  586.            254            ERROR_INVALID_EA_NAME 
  587.  
  588.            255            ERROR_EA_LIST_INCONSISTENT 
  589.  
  590.            275            ERROR_EAS_DIDNT_FIT 
  591.  
  592.  Remarks 
  593.  
  594.  The result buffer from DosFindFirst should be less than 64KB. 
  595.  
  596.  DosFindFirst returns directory entries (up to the number requested in 
  597.  pcFileNames) and extended-attribute information for as many files or 
  598.  subdirectories whose names, attributes, and EAs match the specification, and 
  599.  whose information fits in pfindbuf. On output, pcFileNames contains the actual 
  600.  number of directory entries returned. 
  601.  
  602.  The file name pointed to by pszFileSpec can contain global file-name 
  603.  characters. 
  604.  
  605.  DosFindNext uses the directory handle associated with DosFindFirst to continue 
  606.  the search started by the DosFindFirst request. 
  607.  
  608.  Any nonzero return code, except ERROR_EAS_DIDNT_FIT, indicates that no handle 
  609.  has been allocated. This includes such non-error return codes as 
  610.  ERROR_NO_MORE_FILES. 
  611.  
  612.  For ERROR_EAS_DIDNT_FIT, a search handle is returned, and a subsequent call to 
  613.  DosFindNext gets the next matching entry in the directory. You can use 
  614.  DosQueryPathInfo to retrieve the EAs for the matching entry by using the same 
  615.  EA arguments used for the DosFindFirst call, and the name that was returned by 
  616.  DosFindFirst. 
  617.  
  618.  For ERROR_EAS_DIDNT_FIT, only information for the first matching entry is 
  619.  returned. This entry is the one whose extended attributes did not fit in the 
  620.  buffer. The information returned is in the format of that returned for 
  621.  information Level 2. No further entries are returned in the buffer, even if 
  622.  they could fit in the remaining space. 
  623.  
  624.  The GEA2 list contained inside pfindbuf during a Level 3 DosFindFirst and 
  625.  DosFindNext call is not "read-only", it is used by the operating system. When 
  626.  the function returns, the list is restored to its original state, but inside 
  627.  the function, the list is manipulated by the operating system. This is of 
  628.  concern to a multithreaded application, where two different threads might use 
  629.  the same GEA2 list as input. If one thread calls DosFindFirst or DosFindNext 
  630.  while another thread is inside DosFindFirst or DosFindNext, the second thread 
  631.  will fail with a return code of ERROR_BAD_FORMAT. 
  632.  
  633.  Related Functions 
  634.  
  635.      DosClose 
  636.  
  637.      DosFindClose 
  638.  
  639.      DosFindNext 
  640.  
  641.      DosQueryFileInfo 
  642.  
  643.      DosQueryPathInfo 
  644.  
  645.      DosQuerySysInfo 
  646.  
  647.      DosResetBuffer 
  648.  
  649.      DosSearchPath 
  650.  
  651.      DosSetFileInfo 
  652.  
  653.      DosSetPathInfo 
  654.  
  655.  Example Code 
  656.  
  657.  This example lists all the normal files that are in the directory from where 
  658.  the example is invoked. 
  659.  
  660.   #define INCL_DOSFILEMGR   /* File Manager values */
  661.   #define INCL_DOSERRORS    /* DOS error values */
  662.   #include <os2.h>
  663.   #include <stdio.h>
  664.  
  665.   int main (VOID) {
  666.   HDIR          hdirFindHandle = HDIR_CREATE;
  667.   FILEFINDBUF3L FindBuffer     = {0};      /* Returned from FindFirst/Next */
  668.   ULONG         ulResultBufLen = sizeof(FILEFINDBUF3L);
  669.   ULONG         ulFindCount    = 1;        /* Look for 1 file at a time    */
  670.   APIRET        rc             = NO_ERROR; /* Return code                  */
  671.  
  672.   rc = DosFindFirst( "*.*",                /* File pattern - all files     */
  673.   &hdirFindHandle,      /* Directory search handle      */
  674.   FILE_NORMAL,          /* Search attribute             */
  675.   &FindBuffer,          /* Result buffer                */
  676.   ulResultBufLen,       /* Result buffer length         */
  677.   &ulFindCount,         /* Number of entries to find    */
  678.   FIL_STANDARDL);       /* Return Level 11 file info     */
  679.  
  680.   if (rc != NO_ERROR) {
  681.   printf("DosFindFirst error: return code = %u\n",rc);
  682.   return 1;
  683.   } else {
  684.   printf ("%s\n", FindBuffer.achName);   /* Print file name             */
  685.   } /* endif */
  686.  
  687.   /* Keep finding the next file until there are no more files */
  688.   while (rc != ERROR_NO_MORE_FILES) {
  689.   ulFindCount = 1;                      /* Reset find count.            */
  690.  
  691.   rc = DosFindNext(hdirFindHandle,      /* Directory handle             */
  692.   &FindBuffer,         /* Result buffer                */
  693.   ulResultBufLen,      /* Result buffer length         */
  694.   &ulFindCount);       /* Number of entries to find    */
  695.  
  696.   if (rc != NO_ERROR && rc != ERROR_NO_MORE_FILES) {
  697.   printf("DosFindNext error: return code = %u\n",rc);
  698.   return 1;
  699.   } else {
  700.   printf ("%s\n", FindBuffer.achName);    /* Print file name */
  701.   }
  702.   } /* endwhile */
  703.  
  704.   rc = DosFindClose(hdirFindHandle);    /* Close our directory handle */
  705.   if (rc != NO_ERROR) {
  706.   printf("DosFindClose error: return code = %u\n",rc);
  707.   return 1;
  708.   }
  709.   return NO_ERROR;
  710.   }
  711.  
  712.  
  713. ΓòÉΓòÉΓòÉ 2.3. DosFindNext ΓòÉΓòÉΓòÉ
  714.  
  715. Purpose 
  716.  
  717. DosFindNext finds the next set of file objects whose names match the 
  718. specification in a previous call to DosFindFirst or DosFindNext. 
  719.  
  720. Syntax 
  721.  
  722. #define INCL_DOSFILEMGR
  723. #include <os2.h>
  724.  
  725.  APIRET DosFindNext (HDIR hDir, PVOID pfindbuf, ULONG cbfindbuf, 
  726.            PULONG pcFilenames) 
  727.  
  728.  Parameters 
  729.  
  730.  hDir (HDIR) - input 
  731.            The handle of the directory. 
  732.  
  733.  pfindbuf (PVOID) - in/out 
  734.            The address of the directory search information structure. 
  735.  
  736.            The information returned reflects the most recent call to DosClose 
  737.            or DosResetBuffer. 
  738.  
  739.            For the continuation of a Level 3 (FIL_QUERYEASFROMLIST) File 
  740.            Information search, this buffer should contain input in the same 
  741.            format as a Level 3 File Information search by DosFindFirst. 
  742.  
  743.            See the description of the pfindbuf parameter in DosFindFirst for 
  744.            information about the output data that the file system driver places 
  745.            into this buffer. 
  746.  
  747.  cbfindbuf (ULONG) - input 
  748.            The length, in bytes, of pfindbuf. 
  749.  
  750.  pcFilenames (PULONG) - in/out 
  751.            Pointer to the number of entries. 
  752.  
  753.            Input        The address of the number of matching entries requested 
  754.                         in pfindbuf. 
  755.  
  756.            Output       The number of entries placed into pfindbuf. 
  757.  
  758.  Returns 
  759.  
  760.  ulrc (APIRET) - returns 
  761.            Return Code. 
  762.  
  763.            DosFindNext returns one of the following values: 
  764.  
  765.            0              NO_ERROR 
  766.  
  767.            6              ERROR_INVALID_HANDLE 
  768.  
  769.            18             ERROR_NO_MORE_FILES 
  770.  
  771.            26             ERROR_NOT_DOS_DISK 
  772.  
  773.            87             ERROR_INVALID_PARAMETER 
  774.  
  775.            111            ERROR_BUFFER_OVERFLOW 
  776.  
  777.            275            ERROR_EAS_DIDNT_FIT 
  778.  
  779.  Remarks 
  780.  
  781.  If ERROR_BUFFER_OVERFLOW is returned, further calls to DosFindNext start the 
  782.  search from the same entry. 
  783.  
  784.  If ERROR_EAS_DIDNT_FIT is returned, the buffer is too small to hold the 
  785.  extended attributes (EAs) for the first matching entry being returned. A 
  786.  subsequent call to DosFindNext gets the next matching entry. This enables the 
  787.  search to continue if the extended attributes being returned are too large for 
  788.  the buffer. You can use DosQueryPathInfo to retrieve the extended attributes 
  789.  for the matching entry by using the same EA arguments used for the call to 
  790.  DosFindFirst, and the name that was returned by DosFindFirst, 
  791.  
  792.  In the case of ERROR_EAS_DIDNT_FIT, only information for the first matching 
  793.  entry is returned. This is the entry whose extended attributes did not fit in 
  794.  the buffer. The information returned is in the format of Level 2 or Level 12 
  795.  (FIL_QUERYEASIZE) File Information (FILEFINDBUF4 or FILEFINDBUF4L). No further 
  796.  entries are returned in the buffer, even if they could fit in the remaining 
  797.  space. 
  798.  
  799.  Related Functions 
  800.  
  801.      DosClose 
  802.  
  803.      DosFindClose 
  804.  
  805.      DosFindFirst 
  806.  
  807.      DosQueryFileInfo 
  808.  
  809.      DosQueryPathInfo 
  810.  
  811.      DosQuerySysInfo 
  812.  
  813.      DosResetBuffer 
  814.  
  815.      DosSearchPath 
  816.  
  817.      DosSetFileInfo 
  818.  
  819.      DosSetPathInfo 
  820.  
  821.  Example Code 
  822.  
  823.  This example lists all the normal files that are in the directory from where 
  824.  the example is invoked. 
  825.  
  826.   #define INCL_DOSFILEMGR   /* File Manager values */
  827.   #define INCL_DOSERRORS    /* DOS error values */
  828.   #include <os2.h>
  829.   #include <stdio.h>
  830.  
  831.   int main (VOID) {
  832.   HDIR          hdirFindHandle = HDIR_CREATE;
  833.   FILEFINDBUF3L  FindBuffer     = {0};      /* Returned from FindFirst/Next */
  834.   ULONG         ulResultBufLen = sizeof(FILEFINDBUF3L);
  835.   ULONG         ulFindCount    = 1;        /* Look for 1 file at a time    */
  836.   APIRET        rc             = NO_ERROR; /* Return code                  */
  837.  
  838.   rc = DosFindFirst( "*.*",                /* File pattern - all files     */
  839.   &hdirFindHandle,      /* Directory search handle      */
  840.   FILE_NORMAL,          /* Search attribute             */
  841.   &FindBuffer,          /* Result buffer                */
  842.   ulResultBufLen,       /* Result buffer length         */
  843.   &ulFindCount,         /* Number of entries to find    */
  844.   FIL_STANDARDL);       /* Return level 1 file info     */
  845.  
  846.   if (rc != NO_ERROR) {
  847.   printf("DosFindFirst error: return code = %u\n",rc);
  848.   return 1;
  849.   } else {
  850.   printf ("%s\n", FindBuffer.achName);   /* Print file name             */
  851.   } /* endif */
  852.  
  853.   /* Keep finding the next file until there are no more files */
  854.   while (rc != ERROR_NO_MORE_FILES) {
  855.   ulFindCount = 1;                      /* Reset find count.            */
  856.  
  857.   rc = DosFindNext(hdirFindHandle,      /* Directory handle             */
  858.   &FindBuffer,         /* Result buffer                */
  859.   ulResultBufLen,      /* Result buffer length         */
  860.   &ulFindCount);       /* Number of entries to find    */
  861.  
  862.   if (rc != NO_ERROR && rc != ERROR_NO_MORE_FILES) {
  863.   printf("DosFindNext error: return code = %u\n",rc);
  864.   return 1;
  865.   } else {
  866.   printf ("%s\n", FindBuffer.achName);    /* Print file name */
  867.   }
  868.   } /* endwhile */
  869.  
  870.   rc = DosFindClose(hdirFindHandle);    /* Close our directory handle */
  871.   if (rc != NO_ERROR) {
  872.   printf("DosFindClose error: return code = %u\n",rc);
  873.   return 1;
  874.   }
  875.   return NO_ERROR;
  876.   }
  877.  
  878.  
  879. ΓòÉΓòÉΓòÉ 2.4. DosListIOL ΓòÉΓòÉΓòÉ
  880.  
  881. Purpose 
  882.  
  883. DosListIOL performs the specified number of seek/read or seek/write operations 
  884. or both. 
  885.  
  886. Syntax 
  887.  
  888. #define INCL_DOSFILEMGR
  889. #include <os2.h>
  890.  
  891.  APIRET DosListIOL (LONG CmdMode, LONG NumEntries, PLISTIOL pListIO) 
  892.  
  893.  Parameters 
  894.  
  895.  CmdMode (LONG)- input 
  896.            This specifies the mode in which the operations should be performed. 
  897.            Valid modes are: 
  898.  
  899.            LISTIO_ORDERED 
  900.                     Operations are performed synchronously in the given order. 
  901.  
  902.            LISTIO_UNORDERED 
  903.                     Operations are performed independent of order. 
  904.  
  905.  NumEntries (LONG)- input 
  906.            The number of seek/read or seek/write operations in the list. 
  907.  
  908.  pListIOL (PLISTIO)- input/output 
  909.            Pointer to an array of NumEntries LISTIO data structures which 
  910.            contain the information necessary to perform the seek/read and 
  911.            seek/write operations. 
  912.  
  913.  Returns 
  914.  
  915.  ulrc (APIRET) - returns 
  916.            Return Code. 
  917.  
  918.            DosListIOL returns one of the following values: 
  919.  
  920.            0              NO_ERROR 
  921.  
  922.            5              ERROR_ACCESS_DENIED 
  923.  
  924.            6              ERROR_INVALID_HANDLE 
  925.  
  926.            19             ERROR_WRITE_PROTECT 
  927.  
  928.            26             ERROR_NOT_DOS_DISK 
  929.  
  930.            29             ERROR_WRITE_FAULT 
  931.  
  932.            33             ERROR_LOCK_VIOLATION 
  933.  
  934.            87             ERROR_INVALID_PARAMETER 
  935.  
  936.            109            ERROR_BROKEN_PIPE 
  937.  
  938.            234            ERROR_MORE_DATA 
  939.  
  940.  Remarks 
  941.  
  942.  DosListIOL applies the same restrictions for each seek/read and seek/write 
  943.  control block as would be applied if the requests were issued separately with 
  944.  DosSetFilePtrL, DosRead, and DosWrite. 
  945.  
  946.  Each request control block contains fields for the Actual number of bytes 
  947.  read/written and the operation return code. These fields are updated upon 
  948.  completion of each request; therefore, care must be taken that the memory 
  949.  containing the control block array not be deallocated or manipulated by 
  950.  another thread before the DosListIOL request returns. 
  951.  
  952.  There are two valid modes for the list of I/O operations to be processed: 
  953.  
  954.      Ordered - This mode guarantees the order in which the operations will be 
  955.       performed. The API will return with an error code corresponding to the 
  956.       first failed request and will leave the following requests unissued. This 
  957.       provides a synchronous sequence of automatic seek/read and seek/write 
  958.       requests. This is the only mode that is compatible with file systems 
  959.       other than the raw file system. 
  960.  
  961.      Unordered - This mode does not guarantee the order of issue or completion 
  962.       of the requests. The API will return with an error code if any request 
  963.       fails. Additionally, each request in the list will be issued, even those 
  964.       following a failed operation. This mode is valid for the raw file system 
  965.       only. 
  966.  
  967.  Related Functions 
  968.  
  969.      DosOpenL 
  970.  
  971.      DosSetFilePtrL 
  972.  
  973.      DosRead 
  974.  
  975.      DosWrite 
  976.  
  977.  Example Code 
  978.  
  979.  In this example, the source file "SOURCE.DAT" is copied to "TARGET.DAT." 
  980.  First, the information about the source file is obtained by calling 
  981.  DosQueryPathInfo. Next, the target file is created with the same size as the 
  982.  source file. Using a series of calls to DosListIO, the content of the source 
  983.  file is copied to the target file. 
  984.  
  985.   #define INCL_DOSFILEMGR          /* File Manager values */
  986.   #define INCL_DOSERRORS           /* DOS Error values    */
  987.   #define INCL_LONGLONG
  988.   #include #define SOURCE_PATHNAME "source.dat"
  989.   #define TARGET_PATHNAME "target.dat"
  990.   #define BUFFER_SIZE 4096
  991.  
  992.   int main(void) {
  993.      FILESTATUS3L  fsSource = { {0} };          /* Buffer for information about source file  */
  994.      LONGLONG llSize;                           /* Source file size (totalcopy size) */
  995.      HFILE  hfSource   = 0L;                    /* Handle for source file */
  996.      HFILE  hfTarget   = 0L;                    /* Handle for target file */
  997.      ULONG  ulAction = 0;                       /* Action taken by DosOpen*/
  998.      LISTIOL listIOCtrlBlks[2];                 /* List IO control blocks */
  999.      ULONG  ulNumCtrlBlks;                      /* Number of control blocks*/
  1000.      BYTE   pData[BUFFER_SIZE];                 /* Buffer to hold copy data */
  1001.      ULONG  cbData;                             /* Size of data for each IO operation */
  1002.      APIRET rc = NO_ERROR;                      /* Return code */
  1003.  
  1004.      /* Query information about the source file to obtain its size */
  1005.      rc = DosQueryPathInfo(SOURCE_PATHNAME, FIL_STANDARDL, &fsSource, sizeof(fsSource));
  1006.      if (rc != NO_ERROR)
  1007.      {
  1008.         printf("DosQueryPathInfo failed, return code = %u\n", rc);
  1009.         return 1;
  1010.      }
  1011.  
  1012.      llSize = fsSource.cbFile;
  1013.  
  1014.      /* Open the source file for reading */
  1015.      rc = DosOpenL(SOURCE_PATHNAME,               /* File path name */
  1016.                   &hfSource,                      /* File handle */
  1017.                   &ulAction,                      /* Action taken */
  1018.                   0,                              /* File primary allocation */
  1019.                   FILE_ARCHIVED | FILE_NORMAL,    /* File attribute */
  1020.                   OPEN_ACTION_FAIL_IF_NEW |       /* Open existing file */
  1021.                   OPEN_ACTION_OPEN_IF_EXISTS,
  1022.                   OPEN_FLAGS_NOINHERIT |
  1023.                   OPEN_SHARE_DENYNONE  |
  1024.                   OPEN_ACCESS_READWRITE,          /* Open mode of the file */
  1025.                   0L);                            /* No extended attribute */
  1026.  
  1027.      if (rc != NO_ERROR)
  1028.      {
  1029.         printf("DosOpenL failed to open %s, rc = %u\n", SOURCE_PATHNAME, rc);
  1030.         return 1;
  1031.      }
  1032.  
  1033.      /* Open the target file for writing */
  1034.      rc = DosOpenL(TARGET_PATHNAME,               /* File path name */
  1035.                   &hfTarget,                      /* File handle */
  1036.                   &ulAction,                      /* Action taken */
  1037.                   llSize,                         /* Target equals source file size */
  1038.                   FILE_ARCHIVED | FILE_NORMAL,    /* File attribute */
  1039.                   OPEN_ACTION_CREATE_IF_NEW |     /* Open new file */
  1040.                   OPEN_ACTION_FAIL_IF_EXISTS,
  1041.                   OPEN_FLAGS_NOINHERIT |
  1042.                   OPEN_SHARE_DENYNONE  |
  1043.                   OPEN_ACCESS_READWRITE,          /* Open mode of the file */
  1044.                   0L);                            /* No extended attribute */
  1045.  
  1046.      if (rc != NO_ERROR)
  1047.      {
  1048.         printf("DosOpenL failed to create %s, rc = %u\n", TARGET_PATHNAME, rc);
  1049.         DosClose(hfSource);  /* Remember to close source file before exiting */
  1050.         return 1;
  1051.      }
  1052.   In this example, the source file "SOURCE.DAT" is copied to "TARGET.DAT." First,
  1053.   the information about the source file is obtained by calling DosQueryPathInfo.
  1054.   Next, the target file is created with the same size as the source file. Using
  1055.   a series of calls to DosListIO, the content of the source file is copied to
  1056.   the target file.   /* Initialize listIOL control blocks */
  1057.      memset(listIOCtrlBlks, 0, sizeof(listIOCtrlBlks));
  1058.  
  1059.      listIOCtrlBlks[0].hFile = hfSource;                      /* Source file handle */
  1060.      listIOCtrlBlks[0].CmdFlag = LISTIO_READ | FILE_CURRENT;  /* Read operation */
  1061.      listIOCtrlBlks[0].Offset = 0;
  1062.      listIOCtrlBlks[0].pBuffer = (PVOID)pData;
  1063.  
  1064.      listIOCtrlBlks[1].hFile = hfTarget;                      /* Target file handle */
  1065.      listIOCtrlBlks[1].CmdFlag = LISTIO_WRITE | FILE_CURRENT; /* Write operation */
  1066.      listIOCtrlBlks[1].Offset = 0;
  1067.      listIOCtrlBlks[1].pBuffer = (PVOID)pData;
  1068.  
  1069.      while (llSize) {
  1070.  
  1071.         if (llSize < BUFFER_SIZE) {
  1072.            cbData = llSize;
  1073.         } else {
  1074.            cbData = BUFFER_SIZE;
  1075.         }
  1076.         llSize = llSize - cbData;   /* adjust remaining copy size */
  1077.  
  1078.         listIOCtrlBlks[0].NumBytes = cbData;
  1079.         listIOCtrlBlks[1].NumBytes = cbData;
  1080.  
  1081.         ulNumCtrlBlks = 2;
  1082.         rc = DosListIOL(LISTIO_ORDERED,
  1083.                        ulNumCtrlBlks,
  1084.                        listIOCtrlBlks);
  1085.         if (rc != NO_ERROR)
  1086.         {
  1087.            printf("DosListIOL error: rc = %u\n", rc);
  1088.            break;
  1089.         }
  1090.         else
  1091.         {
  1092.  
  1093.            /* Check return code from the read operation */
  1094.            if (listIOCtrlBlks[0].RetCode != NO_ERROR)
  1095.            {
  1096.               printf("DosListIOL read operation failed, rc = %u\n", listIOCtrlBlks[0].RetCode);
  1097.               break;
  1098.            }
  1099.  
  1100.            /* Check return code from the write operation */
  1101.            if (listIOCtrlBlks[0].RetCode != NO_ERROR)
  1102.            {
  1103.               printf("DosListIOL write operation failed, rc = %u\n", listIOCtrlBlks[0].RetCode);
  1104.               break;
  1105.            }
  1106.         }
  1107.      } /* end while */
  1108.  
  1109.      DosClose(hfSource);                /* Close source file */
  1110.      DosClose(hfTarget);                /* Close target file */
  1111.  
  1112.      return NO_ERROR;
  1113.   }
  1114.  
  1115.  
  1116. ΓòÉΓòÉΓòÉ 2.5. DosOpenL ΓòÉΓòÉΓòÉ
  1117.  
  1118. Purpose 
  1119.  
  1120. DosOpenL opens a new file, an existing file, or a replacement for an existing 
  1121. file. An open file can have extended attributes. 
  1122.  
  1123. Syntax 
  1124.  
  1125. #define INCL_DOSFILEMGR
  1126. #include <os2.h>
  1127.  
  1128.  APIRET DosOpenL (PSZ pszFileName, PHFILE pHf, PULONG pulAction, 
  1129.            LONGLONG cbFile, ULONG ulAttribute, ULONG fsOpenFlags, 
  1130.            ULONG fsOpenMode, PEAOP2 peaop2) 
  1131.  
  1132.  Parameters 
  1133.  
  1134.  pszFileName (PSZ) - input 
  1135.            Address of the ASCIIZ path name of the file or device to be opened. 
  1136.  
  1137.  pHf (PHFILE) - output 
  1138.            Address of the handle for the file. 
  1139.  
  1140.  pulAction (PULONG) - output 
  1141.            Address of the variable that receives the value that specifies the 
  1142.            action taken by the DosOpenL function. 
  1143.  
  1144.            If DosOpenL fails, this value has no meaning. Otherwise, it is one 
  1145.            of the following values: 
  1146.  
  1147.            1        FILE_EXISTED 
  1148.  
  1149.                     File already existed. 
  1150.  
  1151.            2        FILE_CREATED 
  1152.  
  1153.                     File was created. 
  1154.  
  1155.            3        FILE_TRUNCATED 
  1156.  
  1157.                     File existed and was changed to a given size (file was 
  1158.                     replaced). 
  1159.  
  1160.  cbFile (LONGLONG) - input 
  1161.            New logical size of the file (end of data, EOD), in bytes. 
  1162.  
  1163.            This parameter is significant only when creating a new file or 
  1164.            replacing an existing one. Otherwise, it is ignored. It is an error 
  1165.            to create or replace a file with a nonzero length if the fsOpenMode 
  1166.            Access-Mode flag is set to read-only. 
  1167.  
  1168.  ulAttribute (ULONG) - input 
  1169.            File attribute information. 
  1170.  
  1171.            Possible values are: 
  1172.  
  1173.            Bits           Description 
  1174.  
  1175.            31-6           Reserved, must be 0. 
  1176.  
  1177.            5              FILE_ARCHIVED (0x00000020) 
  1178.  
  1179.                           File has been archived. 
  1180.  
  1181.            4              FILE_DIRECTORY (0x00000010) 
  1182.  
  1183.                           File is a subdirectory. 
  1184.  
  1185.            3              Reserved, must be 0. 
  1186.  
  1187.            2              FILE_SYSTEM (0x00000004) 
  1188.  
  1189.                           File is a system file. 
  1190.  
  1191.            1              FILE_HIDDEN (0x00000002) 
  1192.  
  1193.                           File is hidden and does not appear in a directory 
  1194.                           listing. 
  1195.  
  1196.            0              FILE_READONLY (0x00000001) 
  1197.  
  1198.                           File can be read from, but not written to. 
  1199.  
  1200.            0              FILE_NORMAL (0x00000000) 
  1201.  
  1202.                           File can be read from or written to. 
  1203.  
  1204.            File attributes apply only if the file is created. 
  1205.  
  1206.            These bits may be set individually or in combination. For example, 
  1207.            an attribute value of 0x00000021 (bits 5 and 0 set to 1) indicates a 
  1208.            read-only file that has been archived. 
  1209.  
  1210.  fsOpenFlags (ULONG) - input 
  1211.            The action to be taken depending on whether the file exists or does 
  1212.            not exist. 
  1213.  
  1214.            Possible values are: 
  1215.  
  1216.            Bits           Description 
  1217.  
  1218.            31-8           Reserved, must be 0. 
  1219.  
  1220.            7-4            The following flags apply if the file does not exist: 
  1221.  
  1222.                           0000       OPEN_ACTION_FAIL_IF_NEW 
  1223.  
  1224.                                      Open an existing file; fail if the file 
  1225.                                      does not exist. 
  1226.  
  1227.                           0001       OPEN_ACTION_CREATE_IF_NEW 
  1228.  
  1229.                                      Create the file if the file does not 
  1230.                                      exist. 
  1231.  
  1232.            3-0            The following flags apply if the file already exists: 
  1233.  
  1234.                           0000       OPEN_ACTION_FAIL_IF_EXISTS 
  1235.  
  1236.                                      Open the file; fail if the file already 
  1237.                                      exists. 
  1238.  
  1239.                           0001       OPEN_ACTION_OPEN_IF_EXISTS 
  1240.  
  1241.                                      Open the file if it already exists. 
  1242.  
  1243.                           0010       OPEN_ACTION_REPLACE_IF_EXISTS 
  1244.  
  1245.                                      Replace the file if it already exists. 
  1246.  
  1247.  fsOpenMode (ULONG) - input 
  1248.            The mode of the open function. Possible values are: 
  1249.  
  1250.            Bits           Description 
  1251.  
  1252.            31-16          Reserved, must be zero. 
  1253.  
  1254.            15             OPEN_FLAGS_DASD (0x00008000) 
  1255.  
  1256.                           Direct Open flag: 
  1257.  
  1258.                           0        pszFileName represents a file to be opened 
  1259.                                    normally. 
  1260.  
  1261.                           1        pszFileName is "drive:" (such as c: or a:), 
  1262.                                    and represents a mounted disk or diskette 
  1263.                                    volume to be opened for direct access. 
  1264.  
  1265.            14             OPEN_FLAGS_WRITE_THROUGH (0x00004000) 
  1266.  
  1267.                           Write-Through flag: 
  1268.  
  1269.                           0        Writes to the file may go through the 
  1270.                                    file-system driver's cache. The file-system 
  1271.                                    driver writes the sectors when the cache is 
  1272.                                    full or the file is closed. 
  1273.  
  1274.                           1        Writes to the file may go through the 
  1275.                                    file-system driver's cache, but the sectors 
  1276.                                    are written (the actual file I/O operation 
  1277.                                    is completed) before a synchronous write 
  1278.                                    call returns. This state of the file defines 
  1279.                                    it as a synchronous file. For synchronous 
  1280.                                    files, this bit must be set, because the 
  1281.                                    data must be written to the medium for 
  1282.                                    synchronous write operations. 
  1283.  
  1284.                           This bit flag is not inherited by child processes. 
  1285.  
  1286.            13             OPEN_FLAGS_FAIL_ON_ERROR (0x00002000) 
  1287.  
  1288.                           Fail-Errors flag. Media I/O errors are handled as 
  1289.                           follows: 
  1290.  
  1291.                           0        Reported through the system critical-error 
  1292.                                    handler. 
  1293.  
  1294.                           1        Reported directly to the caller by way of a 
  1295.                                    return code. 
  1296.  
  1297.                           Media I/O errors generated through Category 08h 
  1298.                           Logical Disk Control IOCtl Commands always get 
  1299.                           reported directly to the caller by way of return 
  1300.                           code. The Fail-Errors function applies only to 
  1301.                           non-IOCtl handle-based file I/O calls. 
  1302.  
  1303.                           This flag bit is not inherited by child processes. 
  1304.  
  1305.            12             OPEN_FLAGS_NO_CACHE (0x00001000) 
  1306.  
  1307.                           No-Cache/Cache flag: 
  1308.  
  1309.                           0        The file-system driver should place data 
  1310.                                    from I/O operations into its cache. 
  1311.  
  1312.                           1        I/O operations to the file need not be done 
  1313.                                    through the file-system driver's cache. 
  1314.  
  1315.                           The setting of this bit determines whether 
  1316.                           file-system drivers should place data into the cache. 
  1317.                           Like the write-through bit, this is a per-handle bit, 
  1318.                           and is not inherited by child processes. 
  1319.  
  1320.            11             Reserved; must be 0. 
  1321.  
  1322.            10-8           The locality of reference flags contain information 
  1323.                           about how the application is to get access to the 
  1324.                           file. The values are as follows: 
  1325.  
  1326.                           000       OPEN_FLAGS_NO_LOCALITY (0x00000000) 
  1327.  
  1328.                                     No locality known. 
  1329.  
  1330.                           001       OPEN_FLAGS_SEQUENTIAL (0x00000100) 
  1331.  
  1332.                                     Mainly sequential access. 
  1333.  
  1334.                           010       OPEN_FLAGS_RANDOM (0x00000200) 
  1335.  
  1336.                                     Mainly random access. 
  1337.  
  1338.                           011       OPEN_FLAGS_RANDOMSEQUENTIAL (0x00000300) 
  1339.  
  1340.                                     Random with some locality. 
  1341.  
  1342.            7              OPEN_FLAGS_NOINHERIT (0x00000080) 
  1343.  
  1344.                           Inheritance flag: 
  1345.  
  1346.                           0        File handle is inherited by a process 
  1347.                                    created from a call to DosExecPgm. 
  1348.  
  1349.                           1        File handle is private to the current 
  1350.                                    process. 
  1351.  
  1352.                           This bit is not inherited by child processes. 
  1353.  
  1354.            6-4            Sharing Mode flags. This field defines any 
  1355.                           restrictions to file access placed by the caller on 
  1356.                           other processes. The values are as follows: 
  1357.  
  1358.                           001       OPEN_SHARE_DENYREADWRITE (0x00000010) 
  1359.  
  1360.                                     Deny read/write access. 
  1361.  
  1362.                           010       OPEN_SHARE_DENYWRITE (0x00000020) 
  1363.  
  1364.                                     Deny write access. 
  1365.  
  1366.                           011       OPEN_SHARE_DENYREAD (0x00000030) 
  1367.  
  1368.                                     Deny read access. 
  1369.  
  1370.                           100       OPEN_SHARE_DENYNONE (0x00000040) 
  1371.  
  1372.                                     Deny neither read nor write access (deny 
  1373.                                     none). 
  1374.  
  1375.                           Any other value is invalid. 
  1376.  
  1377.            29             OPEN_SHARE_DENYLEGACY (0x10000000) 
  1378.  
  1379.                           Deny read/write access by the DosOpen command.: 
  1380.  
  1381.                           0        Allow read/write access by the DosOpen 
  1382.                                    command. 
  1383.  
  1384.                           1        Deny read/write access by the DosOpen 
  1385.                                    command. 
  1386.  
  1387.                                    A file opened by DosOpenL will not be 
  1388.                                    allowed to grow larger  than 2GB while that 
  1389.                                    same file is open with a legacy DosOpen 
  1390.                                    call.  Setting this bit to 1 will prevent 
  1391.                                    access by the obsolete DosOpen      API and 
  1392.                                    ensure that no error will occur when growing 
  1393.                                    the file. 
  1394.  
  1395.                           Any other value is invalid. 
  1396.  
  1397.            3              Reserved; must be 0. 
  1398.  
  1399.            2-0            Access-Mode flags. This field defines the file access 
  1400.                           required by the caller. The values are as follows: 
  1401.  
  1402.                           000       OPEN_ACCESS_READONLY (0x00000000) 
  1403.  
  1404.                                     Read-only access 
  1405.  
  1406.                           001       OPEN_ACCESS_WRITEONLY (0x00000001) 
  1407.  
  1408.                                     Write-only access 
  1409.  
  1410.                           010       OPEN_ACCESS_READWRITE (0x00000002) 
  1411.  
  1412.                                     Read/write access. 
  1413.  
  1414.                           Any other value is invalid, as are any other 
  1415.                           combinations. 
  1416.  
  1417.            File sharing requires the cooperation of sharing processes. This 
  1418.            cooperation is communicated through sharing and access modes. Any 
  1419.            sharing restrictions placed on a file opened by a process are 
  1420.            removed when the process closes the file with a DosClose request. 
  1421.  
  1422.            Sharing Mode 
  1423.                     Specifies the type of file access that other processes may 
  1424.                     have. For example, if other processes can continue to read 
  1425.                     the file while your process is operating on it, specify 
  1426.                     Deny Write. The sharing mode prevents other processes from 
  1427.                     writing to the file but still allows them to read it. 
  1428.  
  1429.            Access Mode 
  1430.                     Specifies the type of file access (access mode) needed by 
  1431.                     your process. For example, if your process requires 
  1432.                     read/write access, and another process has already opened 
  1433.                     the file with a sharing mode of Deny None, your DosOpenL 
  1434.                     request succeeds. However, if the file is open with a 
  1435.                     sharing mode of Deny Write, the process is denied access. 
  1436.  
  1437.                     If the file is inherited by a child process, all sharing 
  1438.                     and access restrictions also are inherited. 
  1439.  
  1440.                     If an open file handle is duplicated by a call to 
  1441.                     DosDupHandle, all sharing and access restrictions also are 
  1442.                     duplicated. 
  1443.  
  1444.  peaop2 (PEAOP2) - in/out 
  1445.            Extended attributes. 
  1446.  
  1447.            This parameter is used only to specify extended attributes (EAs) 
  1448.            when creating a new file, replacing an existing file, or truncating 
  1449.            an existing file. When opening existing files, it should be set to 
  1450.            null. 
  1451.  
  1452.            Input        The address of the extended-attribute buffer, which 
  1453.                         contains an EAOP2 structure. fpFEA2List points to a 
  1454.                         data area where the relevant FEA2 list is to be found. 
  1455.                         fpGEA2List and oError are ignored. 
  1456.  
  1457.            Output       fpGEA2List and fpFEA2List are unchanged. The area that 
  1458.                         fpFEA2List points to is unchanged. If an error occurred 
  1459.                         during the set, oError is the offset of the FEA2 entry 
  1460.                         where the error occurred. The return code from DosOpenL 
  1461.                         is the error code for that error condition. If no error 
  1462.                         occurred, oError is undefined. 
  1463.  
  1464.                         If peaop2 is zero, then no extended attributes are 
  1465.                         defined for the file. 
  1466.  
  1467.                         If extended attributes are not to be defined or 
  1468.                         modified, the pointer peaop2 must be set to zero. 
  1469.  
  1470.  Returns 
  1471.  
  1472.  ulrc (APIRET) - returns 
  1473.            Return Code. 
  1474.  
  1475.            DosOpenL returns one of the following values: 
  1476.  
  1477.            0              NO_ERROR 
  1478.  
  1479.            2              ERROR_FILE_NOT_FOUND 
  1480.  
  1481.            3              ERROR_PATH_NOT_FOUND 
  1482.  
  1483.            4              ERROR_TOO_MANY_OPEN_FILES 
  1484.  
  1485.            5              ERROR_ACCESS_DENIED 
  1486.  
  1487.            12             ERROR_INVALID_ACCESS 
  1488.  
  1489.            26             ERROR_NOT_DOS_DISK 
  1490.  
  1491.            32             ERROR_SHARING_VIOLATION 
  1492.  
  1493.            36             ERROR_SHARING_BUFFER_EXCEEDED 
  1494.  
  1495.            82             ERROR_CANNOT_MAKE 
  1496.  
  1497.            87             ERROR_INVALID_PARAMETER 
  1498.  
  1499.            99             ERROR_DEVICE_IN_USE 
  1500.  
  1501.            108            ERROR_DRIVE_LOCKED 
  1502.  
  1503.            110            ERROR_OPEN_FAILED 
  1504.  
  1505.            112            ERROR_DISK_FULL 
  1506.  
  1507.            206            ERROR_FILENAME_EXCED_RANGE 
  1508.  
  1509.            231            ERROR_PIPE_BUSY 
  1510.  
  1511.  Remarks 
  1512.  
  1513.  A successful DosOpenL request returns a handle for accessing the file. The 
  1514.  read/write pointer is set at the first byte of the file. The position of the 
  1515.  pointer can be changed with DosSetFilePtrL or by read and write operations on 
  1516.  the file. 
  1517.  
  1518.  The file's date and time can be queried with DosQueryFileInfo. They are set 
  1519.  with DosSetFileInfo. 
  1520.  
  1521.  The read-only attribute of a file can be set with the ATTRIB command. 
  1522.  
  1523.  ulAttribute cannot be set to Volume Label. To set volume-label information, 
  1524.  issue DosSetFSInfo with a logical drive number. Volume labels cannot be 
  1525.  opened. 
  1526.  
  1527.  cbFile affects the size of the file only when the file is new or is a 
  1528.  replacement. If an existing file is opened, cbFile is ignored. To change the 
  1529.  size of the existing file, issue DosSetFileSizeL. 
  1530.  
  1531.  The value in cbFile is a recommended size. If the full size cannot be 
  1532.  allocated, the open request may still succeed. The file system makes a 
  1533.  reasonable attempt to allocate the new size in an area that is as nearly 
  1534.  contiguous as possible on the medium. When the file size is extended, the 
  1535.  values of the new bytes are undefined. 
  1536.  
  1537.  The Direct Open bit provides direct access to an entire disk or diskette 
  1538.  volume, independent of the file system. This mode of opening the volume that 
  1539.  is currently on the drive returns a handle to the calling function; the handle 
  1540.  represents the logical volume as a single file.  The calling function 
  1541.  specifies this handle with a DosDevIOCtl Category 8, DSK_LOCKDRIVE request to 
  1542.  prevent other processes from accessing the logical volume. When you are 
  1543.  finished using the logical volume, issue a DosDevIOCtl Category 8, 
  1544.  DSK_UNLOCKDRIVE request to allow other processes to access the logical volume. 
  1545.  
  1546.  The file-handle state bits can be set by DosOpenL and DosSetFHState. An 
  1547.  application can query the file-handle state bits, as well as the rest of the 
  1548.  Open Mode field, by issuing DosQueryFHState. 
  1549.  
  1550.  You can use an EAOP2 structure to set extended attributes in peaop2 when 
  1551.  creating a file, replacing an existing file, or truncating an existing file. 
  1552.  No extended attributes are set when an existing file is just opened. 
  1553.  
  1554.  A replacement operation is logically equivalent to atomically deleting and 
  1555.  re-creating the file. This means that any extended attributes associated with 
  1556.  the file also are deleted before the file is re-created. 
  1557.  
  1558.  Related Functions 
  1559.  
  1560.      DosClose 
  1561.  
  1562.      DosDevIOCtl 
  1563.  
  1564.      DosDupHandle 
  1565.  
  1566.      DosQueryHType 
  1567.  
  1568.      DosSetFileInfo 
  1569.  
  1570.      DosSetFilePtrL 
  1571.  
  1572.      DosSetFileSizeL 
  1573.  
  1574.      DosSetMaxFH 
  1575.  
  1576.      DosSetRelMaxFH 
  1577.  
  1578.  Example Code 
  1579.  
  1580.  This example opens or creates and opens a normal file named "DOSTEST.DAT", 
  1581.  writes to it, reads from it, and finally closes it. 
  1582.  
  1583.   #define INCL_DOSFILEMGR          /* File Manager values */
  1584.   #define INCL_DOSERRORS           /* DOS Error values    */
  1585.   #include <os2.h>
  1586.   #include <stdio.h>
  1587.   #include <string.h>
  1588.  
  1589.   int main(void) {
  1590.   HFILE  hfFileHandle   = 0L;     /* Handle for file being manipulated */
  1591.   ULONG  ulAction       = 0;      /* Action taken by DosOpenL */
  1592.   ULONG  ulBytesRead    = 0;      /* Number of bytes read by DosRead */
  1593.   ULONG  ulWrote        = 0;      /* Number of bytes written by DosWrite */
  1594.   LONGLONG  ullLocal    = 0;      /* File pointer position after DosSetFilePtrL */
  1595.   UCHAR  uchFileName[20]  = "dostest.dat",     /* Name of file */
  1596.   uchFileData[100] = " ";               /* Data to write to file */
  1597.   APIRET rc             = NO_ERROR;            /* Return code */
  1598.  
  1599.   /* Open the file test.dat.  Use an existing file or create a new */
  1600.   /* one if it doesn't exist.                                      */
  1601.   rc = DosOpenL(uchFileName,                    /* File path name */
  1602.   &hfFileHandle,                  /* File handle */
  1603.   &ulAction,                      /* Action taken */
  1604.   (LONGLONG)100,                    /* File primary allocation */
  1605.   FILE_ARCHIVED | FILE_NORMAL,    /* File attribute */
  1606.   OPEN_ACTION_CREATE_IF_NEW |
  1607.   OPEN_ACTION_OPEN_IF_EXISTS,     /* Open function type */
  1608.   OPEN_FLAGS_NOINHERIT |
  1609.   OPEN_SHARE_DENYNONE  |
  1610.   OPEN_ACCESS_READWRITE,          /* Open mode of the file */
  1611.   0L);                            /* No extended attribute */
  1612.  
  1613.   if (rc != NO_ERROR) {
  1614.   printf("DosOpenL error: return code = %u\n", rc);
  1615.   return 1;
  1616.   } else {
  1617.   printf ("DosOpenL: Action taken = %ld\n", ulAction);
  1618.   } /* endif *//* Write a string to the file */
  1619.   strcpy (uchFileData, "testing...\n1...\n2...\n3\n");
  1620.  
  1621.   rc = DosWrite (hfFileHandle,                /* File handle */
  1622.   (PVOID) uchFileData,         /* String to be written */
  1623.   sizeof (uchFileData),        /* Size of string to be written */
  1624.   &ulWrote);                   /* Bytes actually written */
  1625.  
  1626.   if (rc != NO_ERROR) {
  1627.   printf("DosWrite error: return code = %u\n", rc);
  1628.   return 1;
  1629.   } else {
  1630.   printf ("DosWrite: Bytes written = %u\n", ulWrote);
  1631.   } /* endif */
  1632.  
  1633.   /* Move the file pointer back to the beginning of the file */
  1634.   rc = DosSetFilePtrL (hfFileHandle,           /* File Handle */
  1635.   (LONGLONG)0,            /* Offset */
  1636.   FILE_BEGIN,             /* Move from BOF */
  1637.   &ullLocal);             /* New location address */
  1638.   if (rc != NO_ERROR) {
  1639.   printf("DosSetFilePtrL error: return code = %u\n", rc);
  1640.   return 1;
  1641.   }
  1642.  
  1643.   /* Read the first 100 bytes of the file */
  1644.   rc = DosRead (hfFileHandle,                /* File Handle */
  1645.   uchFileData,                 /* String to be read */
  1646.   100L,                        /* Length of string to be read */
  1647.   &ulBytesRead);               /* Bytes actually read */
  1648.  
  1649.   if (rc != NO_ERROR) {
  1650.   printf("DosRead error: return code = %u\n", rc);
  1651.   return 1;
  1652.   } else {
  1653.   printf ("DosRead: Bytes read = %u\n%s\n", ulBytesRead, uchFileData);
  1654.   } /* endif */
  1655.  
  1656.   rc = DosClose(hfFileHandle);                /* Close the file */
  1657.  
  1658.   if (rc != NO_ERROR) {
  1659.   printf("DosClose error: return code = %u\n", rc);
  1660.   return 1;
  1661.   }
  1662.   return NO_ERROR;
  1663.   }
  1664.  
  1665.  
  1666. ΓòÉΓòÉΓòÉ 2.6. DosProtectOpenL ΓòÉΓòÉΓòÉ
  1667.  
  1668. Purpose 
  1669.  
  1670. DosProtectOpenL opens a new file, an existing file, or a replacement for an 
  1671. existing file and returns a protected file handle. An open file can have 
  1672. extended attributes. 
  1673.  
  1674. Syntax 
  1675.  
  1676. #define INCL_DOSFILEMGR
  1677. #include <os2.h>
  1678.  
  1679.  APIRET DosProtectOpenL (PSZ pszFileName, PHFILE phf, PULONG pulAction, 
  1680.            LONGLONG cbFile, ULONG ulAttribute, ULONG fsOpenFlags, 
  1681.            ULONG fsOpenMode, PEAOP2 peaop2, PFHLOCK pfhFileHandleLockID) 
  1682.  
  1683.  Parameters 
  1684.  
  1685.  pszFileName (PSZ) - input 
  1686.            Address of the ASCIIZ path name of the file or device to be opened. 
  1687.  
  1688.  phf (PHFILE) - output 
  1689.            Address of the handle for the file. 
  1690.  
  1691.  pulAction (PULONG) - output 
  1692.            A pointer to the ULONG in which the value that specifies the action 
  1693.            taken by DosProtectOpenL is returned. 
  1694.  
  1695.            If DosProtectOpenL fails, this value has no meaning.  Otherwise, it 
  1696.            is one of the following values: 
  1697.  
  1698.            1        FILE_EXISTED 
  1699.  
  1700.                     File already existed. 
  1701.  
  1702.            2        FILE_CREATED 
  1703.  
  1704.                     File was created. 
  1705.  
  1706.            3        FILE_TRUNCATED 
  1707.  
  1708.                     File existed and was changed to a given size (file was 
  1709.                     replaced). 
  1710.  
  1711.  cbFile (LONGLONG) - input 
  1712.            New logical size of the file (end of data, EOD), in bytes. 
  1713.  
  1714.            This parameter is significant only when creating a new file or 
  1715.            replacing an existing one. Otherwise, it is ignored. It is an error 
  1716.            to create or replace a file with a nonzero length if the fsOpenMode 
  1717.            Access-Mode flag is set to read-only. 
  1718.  
  1719.  ulAttribute (ULONG) - input 
  1720.            File attributes. 
  1721.  
  1722.            This parameter contains the following bit fields: 
  1723.  
  1724.            Bits           Description 
  1725.  
  1726.            31-6           Reserved, must be 0. 
  1727.  
  1728.            5              FILE_ARCHIVED (0x00000020) 
  1729.  
  1730.                           File has been archived. 
  1731.  
  1732.            4              FILE_DIRECTORY (0x00000010) 
  1733.  
  1734.                           File is a subdirectory. 
  1735.  
  1736.            3              Reserved, must be 0. 
  1737.  
  1738.            2              FILE_SYSTEM (0x00000004) 
  1739.  
  1740.                           File is a system file. 
  1741.  
  1742.            1              FILE_HIDDEN (0x00000002) 
  1743.  
  1744.                           File is hidden and does not appear in a directory 
  1745.                           listing. 
  1746.  
  1747.            0              FILE_READONLY (0x00000001) 
  1748.  
  1749.                           File can be read from, but not written to. 
  1750.  
  1751.            0              FILE_NORMAL (0x00000000) 
  1752.  
  1753.                           File can be read from or written to. 
  1754.  
  1755.            File attributes apply only if the file is created. 
  1756.  
  1757.            These bits may be set individually or in combination. For example, 
  1758.            an attribute value of 0x00000021 (bits 5 and 0 set to 1) indicates a 
  1759.            read-only file that has been archived. 
  1760.  
  1761.  fsOpenFlags (ULONG) - input 
  1762.            The action to be taken depending on whether the file exists or does 
  1763.            not exist. 
  1764.  
  1765.            This parameter contains the following bit fields: 
  1766.  
  1767.            Bits           Description 
  1768.  
  1769.            31-8           Reserved, must be 0. 
  1770.  
  1771.            7-4            The following flags apply if the file does not exist: 
  1772.  
  1773.                           0000       OPEN_ACTION_FAIL_IF_NEW 
  1774.  
  1775.                                      Open an existing file; fail if the file 
  1776.                                      does not exist. 
  1777.  
  1778.                           0001       OPEN_ACTION_CREATE_IF_NEW 
  1779.  
  1780.                                      Create the file if the file does not 
  1781.                                      exist. 
  1782.  
  1783.            3-0            The following flags apply if the file does not exist: 
  1784.  
  1785.                           0000       OPEN_ACTION_FAIL_IF_EXISTS 
  1786.  
  1787.                                      Open the file; fail if the file already 
  1788.                                      exists. 
  1789.  
  1790.                           0001       OPEN_ACTION_OPEN_IF_EXISTS 
  1791.  
  1792.                                      Open the file if it already exists. 
  1793.  
  1794.                           0010       OPEN_ACTION_REPLACE_IF_EXISTS 
  1795.  
  1796.                                      Replace the file if it already exists. 
  1797.  
  1798.  fsOpenMode (ULONG) - input 
  1799.            The mode of the open function. 
  1800.  
  1801.            This parameter contains the following bit fields: 
  1802.  
  1803.            Bits           Description 
  1804.  
  1805.            29-16          Reserved, must be zero. 
  1806.  
  1807.            30             OPEN_FLAGS_PROTECTED_HANDLE (0x40000000) 
  1808.  
  1809.                           Protected file handle flag. 
  1810.  
  1811.                           0        Unprotected Handle 
  1812.  
  1813.                           1        Protected Handle 
  1814.  
  1815.                           Protected handle requires the pfhFileHandleLockID to 
  1816.                           be specified on subsequent DosProtectxxxx calls. 
  1817.  
  1818.                           Unprotected handle requires the pfhFileHandleLockID 
  1819.                           value to be specified as zero on subsequent 
  1820.                           DosProtectxxxx calls. An unprotected handle may be 
  1821.                           used with the unprotected calls such as DosRead and 
  1822.                           DosWrite. 
  1823.  
  1824.            31             Reserved, must be zero. 
  1825.  
  1826.            15             OPEN_FLAGS_DASD (x00008000) 
  1827.  
  1828.                           Direct Open flag: 
  1829.  
  1830.                           0        pszFileName represents a file to be opened 
  1831.                                    normally. 
  1832.  
  1833.                           1        pszFileName is "drive:" (such as C: or A:), 
  1834.                                    and represents a mounted disk or diskette 
  1835.                                    volume to be opened for direct access. 
  1836.  
  1837.            14             OPEN_FLAGS_WRITE_THROUGH (0x00004000) 
  1838.  
  1839.                           Write-Through flag: 
  1840.  
  1841.                           0        Writes to the file may go through the 
  1842.                                    file-system driver's cache. The file-system 
  1843.                                    driver writes the sectors when the cache is 
  1844.                                    full or the file is closed. 
  1845.  
  1846.                           1        Writes to the file may go through the 
  1847.                                    file-system driver's cache, but the sectors 
  1848.                                    are written (the actual file I/O operation 
  1849.                                    is completed) before a synchronous write 
  1850.                                    call returns. This state of the file defines 
  1851.                                    it as a synchronous file. For synchronous 
  1852.                                    files, this bit must be set, because the 
  1853.                                    data must be written to the medium for 
  1854.                                    synchronous write operations. 
  1855.  
  1856.                           This bit flag is not inherited by child processes. 
  1857.  
  1858.            13             OPEN_FLAGS_FAIL_ON_ERROR (0x00002000) 
  1859.  
  1860.                           Fail-Errors flag. Media I/O errors are handled as 
  1861.                           follows: 
  1862.  
  1863.                           0        Reported through the system critical-error 
  1864.                                    handler. 
  1865.  
  1866.                           1        Reported directly to the caller by way of a 
  1867.                                    return code. 
  1868.  
  1869.                           Media I/O errors generated through Category 08h 
  1870.                           Logical Disk Control IOCtl Commands always get 
  1871.                           reported directly to the caller by way of return 
  1872.                           code. The Fail-Errors function applies only to 
  1873.                           non-IOCtl handle-based file I/O calls. 
  1874.  
  1875.                           This flag bit is not inherited by child processes. 
  1876.  
  1877.            12             OPEN_FLAGS_NO_CACHE (0x00001000) 
  1878.  
  1879.                           No-Cache/Cache flag: 
  1880.  
  1881.                           0        The file-system driver should place data 
  1882.                                    from I/O operations into its cache. 
  1883.  
  1884.                           1        I/O operations to the file need not be done 
  1885.                                    through the file-system driver's cache. 
  1886.  
  1887.                           The setting of this bit determines whether 
  1888.                           file-system drivers should place data into the cache. 
  1889.                           Like the write-through bit, this is a per-handle bit, 
  1890.                           and is not inherited by child processes. 
  1891.  
  1892.            11             Reserved; must be 0. 
  1893.  
  1894.            10-8           The locality of reference flags contain information 
  1895.                           about how the application is to get access to the 
  1896.                           file. The values are as follows: 
  1897.  
  1898.                           000        OPEN_FLAGS_NO_LOCALITY (0x00000000) 
  1899.  
  1900.                                      No locality known. 
  1901.  
  1902.                           001        OPEN_FLAGS_SEQUENTIAL (0x00000100) 
  1903.  
  1904.                                      Mainly sequential access. 
  1905.  
  1906.                           010        OPEN_FLAGS_RANDOM (0x00000200) 
  1907.  
  1908.                                      Mainly random access. 
  1909.  
  1910.                           011        OPEN_FLAGS_RANDOMSEQUENTIAL (0x00000300) 
  1911.  
  1912.                                      Random with some locality. 
  1913.  
  1914.            7              OPEN_FLAGS_NOINHERIT (0x00000080) 
  1915.  
  1916.                           Inheritance flag: 
  1917.  
  1918.                           0        File handle is inherited by a process 
  1919.                                    created from a call to DosExecPgm. 
  1920.  
  1921.                           1        File handle is private to the current 
  1922.                                    process. 
  1923.  
  1924.                           This bit is not inherited by child processes. 
  1925.  
  1926.            6-4            Sharing Mode flags. This field defines any 
  1927.                           restrictions to file access placed by the caller on 
  1928.                           other processes. The values are as follows: 
  1929.  
  1930.                           001        OPEN_SHARE_DENYREADWRITE (0x00000010) 
  1931.  
  1932.                                      Deny read/write access. 
  1933.  
  1934.                           010        OPEN_SHARE_DENYWRITE (0x00000020) 
  1935.  
  1936.                                      Deny write access. 
  1937.  
  1938.                           011        OPEN_SHARE_DENYREAD (0x00000030) 
  1939.  
  1940.                                      Deny read access. 
  1941.  
  1942.                           100        OPEN_SHARE_DENYNONE (0x00000040) 
  1943.  
  1944.                                      Deny neither read nor write access (deny 
  1945.                                      none). 
  1946.  
  1947.            29             OPEN_SHARE_DENYLEGACY (0x10000000) 
  1948.  
  1949.                           Deny read/write access by the DosOpen command: 
  1950.  
  1951.                           0        Allow read/write access by the DosOpen 
  1952.                                    command. 
  1953.  
  1954.                           1        Deny read/write access by the DosOpen 
  1955.                                    command. 
  1956.  
  1957.                                    A file opened by DosOpenL will not be 
  1958.                                    allowed to grow larger  than 2GB while that 
  1959.                                    same file is open via a legacy DosOpen call. 
  1960.                                    Setting this bit to 1 will prevent access by 
  1961.                                    the obsolete DosOpen      API and ensure 
  1962.                                    that no error will occur when growing the 
  1963.                                    file. 
  1964.  
  1965.                           Any other value is invalid. 
  1966.  
  1967.            3              Reserved; must be 0. 
  1968.  
  1969.            2-0            Access-Mode flags. This field defines the file access 
  1970.                           required by the caller. The values are as follows: 
  1971.  
  1972.                           000        OPEN_ACCESS_READONLY (0x00000000) 
  1973.  
  1974.                                      Read-only access 
  1975.  
  1976.                           001        OPEN_ACCESS_WRITEONLY (0x00000001) 
  1977.  
  1978.                                      Write-only access 
  1979.  
  1980.                           010        OPEN_ACCESS_READWRITE (0x00000002) 
  1981.  
  1982.                                      Read/write access. 
  1983.  
  1984.                           Any other value is invalid, as are any other 
  1985.                           combinations. 
  1986.  
  1987.            File sharing requires the cooperation of sharing processes. This 
  1988.            cooperation is communicated through sharing and access modes. Any 
  1989.            sharing restrictions placed on a file opened by a process are 
  1990.            removed when the process closes the file with a DosClose request. 
  1991.  
  1992.            Sharing Mode 
  1993.                     Specifies the type of file access that other processes may 
  1994.                     have. For example, if other processes can continue to read 
  1995.                     the file while your process is operating on it, specify 
  1996.                     Deny Write. The sharing mode prevents other processes from 
  1997.                     writing to the file but still allows them to read it. 
  1998.  
  1999.            Access Mode 
  2000.                     Specifies the type of file access (access mode) needed by 
  2001.                     your process. For example, if your process requires 
  2002.                     read/write access, and another process has already opened 
  2003.                     the file with a sharing mode of Deny None, your 
  2004.                     DosProtectOpenL request succeeds. However, if the file is 
  2005.                     open with a sharing mode of Deny Write, the process is 
  2006.                     denied access. 
  2007.  
  2008.                     If the file is inherited by a child process, all sharing 
  2009.                     and access restrictions also are inherited. 
  2010.  
  2011.                     If an open file handle is duplicated by a call to 
  2012.                     DosDupHandle, all sharing and access restrictions also are 
  2013.                     duplicated. 
  2014.  
  2015.  peaop2 (PEAOP2) - in/out 
  2016.            A pointer to an extended attribute buffer. 
  2017.  
  2018.            Input        The address of the extended-attribute buffer, which 
  2019.                         contains an EAOP2 structure. The fpFEA2List field in 
  2020.                         the EAOP2 structure points to a data area where the 
  2021.                         relevant FEA2 list is to be found. The fpGEA2List and 
  2022.                         oError fields are ignored. 
  2023.  
  2024.            Output       fpGEA2List and fpFEA2List are unchanged. The area that 
  2025.                         fpFEA2List points to is unchanged. If an error occurred 
  2026.                         during the set, oError is the offset of the FEA2 entry 
  2027.                         where the error occurred. The return code from 
  2028.                         DosProtectOpenL is the error code for that error 
  2029.                         condition. If no error occurred, oError is undefined. 
  2030.  
  2031.            If peaop2 is zero, then no extended attributes are defined for the 
  2032.            file. If extended attributes are not to be defined or modified, the 
  2033.            pointer peaop2 must be set to zero. 
  2034.  
  2035.  pfhFileHandleLockID (PFHLOCK) - output 
  2036.            The address of the 32-bit lockid for the file handle. 
  2037.  
  2038.  Returns 
  2039.  
  2040.  ulrc (APIRET) - returns 
  2041.            Return Code. 
  2042.  
  2043.            DosProtectOpenL returns one of the following values: 
  2044.  
  2045.            0              NO_ERROR 
  2046.  
  2047.            2              ERROR_FILE_NOT_FOUND 
  2048.  
  2049.            3              ERROR_PATH_NOT_FOUND 
  2050.  
  2051.            4              ERROR_TOO_MANY_OPEN_FILES 
  2052.  
  2053.            5              ERROR_ACCESS_DENIED 
  2054.  
  2055.            12             ERROR_INVALID_ACCESS 
  2056.  
  2057.            26             ERROR_NOT_DOS_DISK 
  2058.  
  2059.            32             ERROR_SHARING_VIOLATION 
  2060.  
  2061.            36             ERROR_SHARING_BUFFER_EXCEEDED 
  2062.  
  2063.            82             ERROR_CANNOT_MAKE 
  2064.  
  2065.            87             ERROR_INVALID_PARAMETER 
  2066.  
  2067.            99             ERROR_DEVICE_IN_USE 
  2068.  
  2069.            108            ERROR_DRIVE_LOCKED 
  2070.  
  2071.            110            ERROR_OPEN_FAILED 
  2072.  
  2073.            112            ERROR_DISK_FULL 
  2074.  
  2075.            206            ERROR_FILENAME_EXCED_RANGE 
  2076.  
  2077.            231            ERROR_PIPE_BUSY 
  2078.  
  2079.  Remarks 
  2080.  
  2081.  A successful DosProtectOpenL request returns a handle and a 32-bit lockid for 
  2082.  accessing the file. The read/write pointer is set at the first byte of the 
  2083.  file. The position of the pointer can be changed with DosProtectSetFilePtrL or 
  2084.  by read and write operations on the file. 
  2085.  
  2086.  The file's date and time can be queried with DosProtectQueryFileInfo. They are 
  2087.  set with DosProtectSetFileInfo. 
  2088.  
  2089.  The read-only attribute of a file can be set with the ATTRIB command. 
  2090.  
  2091.  ulAttribute cannot be set to Volume Label. To set volume-label information, 
  2092.  issue DosProtectSetFileInfo with a logical drive number.  Volume labels cannot 
  2093.  be opened. 
  2094.  
  2095.  cbFile affects the size of the file only when the file is new or is a 
  2096.  replacement. If an existing file is opened, cbFile is ignored. To change the 
  2097.  size of the existing file, issue DosProtectSetFileSizeL. 
  2098.  
  2099.  The value in cbFile is a recommended size. If the full size cannot be 
  2100.  allocated, the open request may still succeed.  The file system makes a 
  2101.  reasonable attempt to allocate the new size in an area that is as nearly 
  2102.  contiguous as possible on the medium. When the file size is extended, the 
  2103.  values of the new bytes are undefined. 
  2104.  
  2105.  The Direct Open bit provides direct access to an entire disk or diskette 
  2106.  volume, independent of the file system. This mode of opening the volume that 
  2107.  is currently on the drive returns a handle to the calling function; the handle 
  2108.  represents the logical volume as a single file. The calling function specifies 
  2109.  this handle with a DosDevIOCtl Category 8, DSK_LOCKDRIVE request to prevent 
  2110.  other processes from accessing the logical volume. When you are finished using 
  2111.  the logical volume, issue a DosDevIOCtl Category 8, DSK_UNLOCKDRIVE request to 
  2112.  allow other processes to access the logical volume. 
  2113.  
  2114.  The file-handle state bits can be set by DosProtectOpenL and 
  2115.  DosProtectSetFHState. An application can query the file-handle state bits, as 
  2116.  well as the rest of the Open Mode field, by issuing DosProtectQueryFHState. 
  2117.  
  2118.  You can use an EAOP2 structure to set extended attributes in peaop2 when 
  2119.  creating a file, replacing an existing file, or truncating an existing file. 
  2120.  No extended attributes are set when an existing file is just opened. 
  2121.  
  2122.  A replacement operation is logically equivalent to atomically deleting and 
  2123.  re-creating the file. This means that any extended attributes associated with 
  2124.  the file also are deleted before the file is re-created. 
  2125.  
  2126.  The pfhFileHandleLockID returned is required on each of the DosProtectxxx 
  2127.  functions. An incorrect pfhFileHandleLockID on subsequent DosProtectxxx calls 
  2128.  results in an ERROR_ACCESS_DENIED return code. 
  2129.  
  2130.  The DosProtectxxx functions can be used with a NULL filehandle lockid, if the 
  2131.  subject filehandle was obtained from DosOpen. 
  2132.  
  2133.  Related Functions 
  2134.  
  2135.      DosDevIOCtl 
  2136.  
  2137.      DosDupHandle 
  2138.  
  2139.      DosProtectClose 
  2140.  
  2141.      DosProtectSetFileInfo 
  2142.  
  2143.      DosProtectSetFilePtrL 
  2144.  
  2145.      DosProtectSetFileSizeL 
  2146.  
  2147.      DosQueryHType 
  2148.  
  2149.      DosSetMaxFH 
  2150.  
  2151.      DosSetRelMaxFH 
  2152.  
  2153.  Example Code 
  2154.  
  2155.  This example opens or creates and opens a file named "DOSPROT.DAT", writes to 
  2156.  it, reads from it, and finally closes it using DosProtect functions. 
  2157.  
  2158.   #define INCL_DOSFILEMGR          /* File Manager values */
  2159.   #define INCL_DOSERRORS           /* DOS Error values    */
  2160.   #include <os2.h>
  2161.   #include <stdio.h>
  2162.   #include <string.h>
  2163.  
  2164.   int main(VOID) {
  2165.   HFILE  hfFileHandle   = 0L;
  2166.   ULONG  ulAction       = 0;
  2167.   ULONG  ulBytesRead    = 0;
  2168.   ULONG  ulWrote        = 0;
  2169.   LONGLONG  ullLocal    = 0;
  2170.   UCHAR  uchFileName[20]  = "dosprot.dat",
  2171.   uchFileData[100] = " ";
  2172.   FHLOCK FileHandleLock = 0;        /* File handle lock   */
  2173.   APIRET rc             = NO_ERROR; /* Return code */
  2174.  
  2175.   /* Open the file dosprot.dat.  Make it read/write, open it */
  2176.   /* if it already exists and create it if it is new.     */
  2177.   rc = DosProtectOpenL(uchFileName,             /* File path name          */
  2178.   &hfFileHandle,                  /* File handle             */
  2179.   &ulAction,                      /* Action taken            */
  2180.   (LONGLONG)100,                      /* File primary allocation */
  2181.   FILE_ARCHIVED | FILE_NORMAL,    /* File attribute          */
  2182.   OPEN_ACTION_CREATE_IF_NEW |
  2183.   OPEN_ACTION_OPEN_IF_EXISTS,     /* Open function type      */
  2184.   OPEN_FLAGS_NOINHERIT |
  2185.   OPEN_SHARE_DENYNONE  |
  2186.   OPEN_ACCESS_READWRITE,          /* Open mode of the file   */
  2187.   0L,                             /* No extended attribute   */
  2188.   &FileHandleLock);               /* File handle lock id     */
  2189.   if (rc != NO_ERROR) {
  2190.   printf("DosProtectOpenL error: return code = %u\n", rc);
  2191.   return 1;
  2192.   } else {
  2193.   printf ("DosProtectOpenL: Action taken = %u\n", ulAction);
  2194.   } /* endif */
  2195.  
  2196.   /* Write a string to the file */
  2197.   strcpy (uchFileData, "testing...\n3...\n2...\n1\n");
  2198.  
  2199.   rc = DosProtectWrite (hfFileHandle,       /* File handle                  */
  2200.   (PVOID) uchFileData,       /* String to be written         */
  2201.   sizeof (uchFileData),      /* Size of string to be written */
  2202.   &ulWrote,                  /* Bytes actually written       */
  2203.   FileHandleLock);           /* File handle lock id          */if (rc != NO_ERROR) {
  2204.   printf("DosProtectWrite error: return code = %u\n", rc);
  2205.   return 1;
  2206.   } else {
  2207.   printf ("DosProtectWrite: Bytes written = %u\n", ulWrote);
  2208.   } /* endif */
  2209.  
  2210.   /* Move the file pointer back to the beginning of the file */
  2211.   rc = DosProtectSetFilePtrL (hfFileHandle,    /* File Handle          */
  2212.   (LONGLONG)0,            /* Offset               */
  2213.   FILE_BEGIN,             /* Move from BOF        */
  2214.   &ullLocal,               /* New location address */
  2215.   FileHandleLock);        /* File handle lock id  */
  2216.   if (rc != NO_ERROR) {
  2217.   printf("DosSetFilePtrL error: return code = %u\n", rc);
  2218.   return 1;
  2219.   }
  2220.  
  2221.   /* Read the first 100 bytes of the file */
  2222.   rc = DosProtectRead (hfFileHandle,         /* File Handle                 */
  2223.   uchFileData,                 /* String to be read           */
  2224.   100L,                        /* Length of string to be read */
  2225.   &ulBytesRead,                /* Bytes actually read         */
  2226.   FileHandleLock);             /* File handle lock id         */
  2227.   if (rc != NO_ERROR) {
  2228.   printf("DosProtectRead error: return code = %u\n", rc);
  2229.   return 1;
  2230.   } else {
  2231.   printf("DosProtectRead: Bytes read = %u\n%s\n", ulBytesRead, uchFileData);
  2232.   } /* endif */
  2233.  
  2234.   rc = DosProtectClose(hfFileHandle, FileHandleLock);   /* Close the file */
  2235.   if (rc != NO_ERROR) {
  2236.   printf("DosProtectClose error: return code = %u\n", rc);
  2237.   return 1;
  2238.   }
  2239.   return NO_ERROR;
  2240.   }
  2241.  
  2242.  
  2243. ΓòÉΓòÉΓòÉ 2.7. DosProtectQueryFileInfo ΓòÉΓòÉΓòÉ
  2244.  
  2245. Purpose 
  2246.  
  2247. DosProtectQueryFileInfo gets file information. 
  2248.  
  2249. Syntax 
  2250.  
  2251. #define INCL_DOSFILEMGR
  2252. #include <os2.h>
  2253.  
  2254.  APIRET DosProtectQueryFileInfo (HFILE hf, ULONG ulInfoLevel, PVOID pInfo, 
  2255.            ULONG cbInfoBuf, FHLOCK fhFileHandleLockID) 
  2256.  
  2257.  Parameters 
  2258.  
  2259.  hf (HFILE) - input 
  2260.            File handle. 
  2261.  
  2262.  ulInfoLevel (ULONG) - input 
  2263.            Level of file information required. 
  2264.  
  2265.            Specify a value: 
  2266.  
  2267.            1        FIL_STANDARD 
  2268.  
  2269.                     Level 1 file information 
  2270.  
  2271.            11       FIL_STANDARDL 
  2272.  
  2273.                     Level 11 file information 
  2274.  
  2275.            2        FIL_QUERYEASIZE 
  2276.  
  2277.                     Level 2 file information 
  2278.  
  2279.            12       FIL_QUERYEASIZEL 
  2280.  
  2281.                     Level 12 file information 
  2282.  
  2283.            3        FIL_QUERYEASFROMLIST 
  2284.  
  2285.                     Level 3 file information 
  2286.  
  2287.            The structures described in pInfo indicate the information returned 
  2288.            for each of these levels. 
  2289.  
  2290.  pInfo (PVOID) - output 
  2291.            Address of the storage area where the system returns the requested 
  2292.            level of file information. 
  2293.  
  2294.            File information, where applicable, is at least as accurate as the 
  2295.            most recent DosProtectClose, DosResetBuffer, DosProtectSetFileInfo, 
  2296.            or DosSetPathInfo. 
  2297.  
  2298.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) 
  2299.                     pInfo contains the FILESTATUS3 data structure, to which 
  2300.                     file information is returned. 
  2301.  
  2302.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  2303.                     pInfo contains the FILESTATUS3L data structure, to which 
  2304.                     file information is returned. 
  2305.  
  2306.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) 
  2307.                     pInfo contains the FILESTATUS4 data structure. This is 
  2308.                     similar to the Level 1 structure, with the addition of the 
  2309.                     cbList field after the attrFile field. 
  2310.  
  2311.                     The cbList field is an ULONG. On output, this field 
  2312.                     contains the size, in bytes, of the file's entire extended 
  2313.                     attribute (EA) set on disk. You can use this value to 
  2314.                     calculate the size of the buffer required to hold the EA 
  2315.                     information returned when a value of 3 is specified for 
  2316.                     ulInfoLevel. The buffer size is less than or equal to twice 
  2317.                     the size of the file's entire EA set on disk. 
  2318.  
  2319.            Level 12 File Information (ulInfoLevel == FIL_QUERYEASIZEL) 
  2320.                     pInfo contains the FILESTATUS4L data structure. This is 
  2321.                     similar to the Level 11 structure, with the addition of the 
  2322.                     cbList field after the attrFile field. 
  2323.  
  2324.                     The cbList field is an ULONG. On output, this field 
  2325.                     contains the size, in bytes, of the file's entire extended 
  2326.                     attribute (EA) set on disk. You can use this value to 
  2327.                     calculate the size of the buffer required to hold the EA 
  2328.                     information returned when a value of 3 is specified for 
  2329.                     ulInfoLevel. The buffer size is less than or equal to twice 
  2330.                     the size of the file's entire EA set on disk. 
  2331.  
  2332.            Level 3 File Information (ulInfoLevel == FIL_QUERYEASFROMLIST) 
  2333.  
  2334.                     Input        pInfo contains an EAOP2 data structure. 
  2335.                                  fpGEA2List points to a GEA2 list defining the 
  2336.                                  attribute names whose values are returned. The 
  2337.                                  GEA2 data structures must be aligned on a 
  2338.                                  doubleword boundary. Each oNextEntryOffset 
  2339.                                  field must contain the number of bytes from 
  2340.                                  the beginning of the current entry to the 
  2341.                                  beginning of the next entry in the GEA2 list. 
  2342.                                  The oNextEntryOffset field in the last entry 
  2343.                                  of the GEA2 list must be zero. fpFEA2List 
  2344.                                  points to a data area where the relevant FEA2 
  2345.                                  list is returned. The length field of this 
  2346.                                  FEA2 list is valid, giving the size of the 
  2347.                                  FEA2 list buffer. oError is ignored. 
  2348.  
  2349.                     Output       pInfo is unchanged. The buffer pointed to by 
  2350.                                  fpFEA2List is filled in with the returned 
  2351.                                  information. If the buffer that fpFEA2List 
  2352.                                  points to is not large enough to hold the 
  2353.                                  returned information (the return code is 
  2354.                                  ERROR_BUFFER_OVERFLOW), cbList is still valid, 
  2355.                                  assuming there is at least enough space for 
  2356.                                  it. Its value is the size of the entire EA set 
  2357.                                  on disk for the file, even though only a 
  2358.                                  subset of attributes was requested. 
  2359.  
  2360.  cbInfoBuf (ULONG) - input 
  2361.            The length, in bytes, of pInfo. 
  2362.  
  2363.  fhFileHandleLockID (FHLOCK) - input 
  2364.            The filehandle lockid returned by a previous DosProtectOpenL. 
  2365.  
  2366.  Returns 
  2367.  
  2368.  ulrc (APIRET) - returns 
  2369.            Return Code. 
  2370.  
  2371.            DosProtectQueryFile returns one of the following values: 
  2372.  
  2373.            0              NO_ERROR 
  2374.  
  2375.            5              ERROR_ACCESS_DENIED 
  2376.  
  2377.            6              ERROR_INVALID_HANDLE 
  2378.  
  2379.            111            ERROR_BUFFER_OVERFLOW 
  2380.  
  2381.            124            ERROR_INVALID_LEVEL 
  2382.  
  2383.            130            ERROR_DIRECT_ACCESS_HANDLE 
  2384.  
  2385.            254            ERROR_INVALID_EA_NAME 
  2386.  
  2387.            255            ERROR_EA_LIST_INCONSISTENT 
  2388.  
  2389.  Remarks 
  2390.  
  2391.  In the FAT file system, only date and time information contained in level-1 
  2392.  file information can be modified. Zero is returned for the creation and access 
  2393.  dates and times. 
  2394.  
  2395.  To return information contained in any of the file information levels, 
  2396.  DosProtectQueryFileInfo must be able to read the open file. 
  2397.  DosProtectQueryFileInfo works only when the file is opened for read access, 
  2398.  with a deny-write sharing mode specified for access by other processes. If 
  2399.  another process that has specified conflicting sharing and access modes has 
  2400.  already opened the file, any call to DosProtectOpen will fail. 
  2401.  
  2402.  DosProtectEnumAttribute returns the lengths of extended attributes. This 
  2403.  information can be used to calculate what size pInfo needs to be to hold 
  2404.  full-extended-attribute (FEA) information returned by DosProtectQueryFileInfo 
  2405.  when Level 3 is specified. The size of the buffer is calculated as follows: 
  2406.  
  2407.       Four bytes (for oNextEntryOffset) + 
  2408.       One byte (for fEA) + 
  2409.       One byte (for cbName) + 
  2410.       Two bytes (for cbValue) + 
  2411.       Value of cbName (for the name of the EA) + 
  2412.       One byte (for terminating NULL in cbName) + 
  2413.       Value of cbValue (for the value of the EA) 
  2414.  
  2415.  Related Functions 
  2416.  
  2417.      DosProtectClose 
  2418.  
  2419.      DosProtectOpenL 
  2420.  
  2421.      DosProtectEnumAttribute 
  2422.  
  2423.      DosProtectSetFileInfo 
  2424.  
  2425.      DosQueryPathInfo 
  2426.  
  2427.      DosResetBuffer 
  2428.  
  2429.      DosProtectSetFileSizeL 
  2430.  
  2431.      DosSetPathInfo 
  2432.  
  2433.  Example Code 
  2434.  
  2435.  This example creates a read-only file named "DOSFDEL.DAT", then changes the 
  2436.  file attributes to normal, and uses DosForceDelete to delete the file so that 
  2437.  it can not be restored using UNDELETE. 
  2438.  
  2439.   #define INCL_DOSFILEMGR   /* File Manager values */
  2440.   #define INCL_DOSERRORS    /* DOS error values    */
  2441.   #include <os2.h>
  2442.   #include <stdio.h>
  2443.  
  2444.   int main(VOID) {
  2445.  
  2446.   UCHAR       uchFileName[]   = "DOSFDEL.DAT";   /* File to delete    */
  2447.   HFILE       fhDelFile       = 0;               /* File handle from DosOpenL  */
  2448.   FILESTATUS3L fsts3FileInfo   = {{0}};  /* Information associated with file   */
  2449.   ULONG       ulBufferSize    = sizeof(FILESTATUS3L); /* File info buffer size */
  2450.   ULONG       ulOpenAction    = 0;                 /* Action taken by DosOpenL */
  2451.   APIRET      rc              = NO_ERROR;          /* Return code             */
  2452.   FHLOCK      FHLock          = 0;                 /* File handle lock        */
  2453.  
  2454.   /* Create a read-only file */
  2455.  
  2456.   rc = DosProtectOpenL(uchFileName, &fhDelFile,
  2457.   &ulOpenAction, (longlong)10, FILE_READONLY,
  2458.   OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
  2459.   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, 0L, &FHLock);
  2460.   if (rc != NO_ERROR) {
  2461.   printf("DosProtectOpenL error: return code = %u\n", rc);
  2462.   return 1;
  2463.   }
  2464.  
  2465.   rc = DosProtectQueryFileInfo(fhDelFile, FIL_STANDARDL,
  2466.   &fsts3FileInfo, ulBufferSize, FHLock);   /* Get standard info */
  2467.   if (rc != NO_ERROR) {
  2468.   printf("DosProtectQueryFileInfo error: return code = %u\n", rc);
  2469.   return 1;
  2470.   } else { printf("File %s created read-only.\n",uchFileName); }
  2471.  
  2472.   /*   Change the file attributes to be "normal"  */
  2473.  
  2474.   fsts3FileInfo.attrFile  = FILE_NORMAL;
  2475.   rc = DosProtectSetFileInfo(fhDelFile, FIL_STANDARDL,
  2476.   &fsts3FileInfo, ulBufferSize, FHLock);
  2477.   if (rc != NO_ERROR) {
  2478.   printf("DosProtectSetFileInfo error: return code = %u\n", rc);
  2479.   return 1;
  2480.   }
  2481.   rc = DosProtectClose(fhDelFile, FHLock);
  2482.   /* Should verify that (rc != NO_ERROR) here... *//* Delete the file */
  2483.  
  2484.   rc = DosForceDelete(uchFileName);
  2485.   if (rc != NO_ERROR) {
  2486.   printf("DosForceDelete error: return code = %u\n", rc);
  2487.   return 1;
  2488.   } else {
  2489.   printf("File %s has been deleted.\n",uchFileName);
  2490.   }  /* endif */
  2491.  
  2492.   return NO_ERROR;
  2493.   }
  2494.  
  2495.  
  2496. ΓòÉΓòÉΓòÉ 2.8. DosProtectSetFileInfo ΓòÉΓòÉΓòÉ
  2497.  
  2498. Purpose 
  2499.  
  2500. DosProtectSetFileInfo sets file information. 
  2501.  
  2502. Syntax 
  2503.  
  2504. #define INCL_DOSFILEMGR
  2505. #include  <os2.h>
  2506.  
  2507.  APIRET DosProtectSetFileInfo (HFILE hf, ULONG ulInfoLevel, PVOID pInfoBuf, 
  2508.            ULONG cbInfoBuf, FHLOCK fhFileHandleLockID) 
  2509.  
  2510.  Parameters 
  2511.  
  2512.  hf (HFILE) - input 
  2513.            File handle. 
  2514.  
  2515.  ulInfoLevel (ULONG) - input 
  2516.            Level of file information being set. 
  2517.  
  2518.            Specify a value: 
  2519.  
  2520.            1        FIL_STANDARD 
  2521.  
  2522.                     Level 1 file information 
  2523.  
  2524.            11       FIL_STANDARDL 
  2525.  
  2526.                     Level 11 file information 
  2527.  
  2528.            2        FIL_QUERYEASIZE 
  2529.  
  2530.                     Level 2 file information 
  2531.  
  2532.            The structures described in pInfoBuf indicate the information being 
  2533.            set for each of these levels. 
  2534.  
  2535.  pInfoBuf (PVOID) - input 
  2536.            Address of the storage area containing the structures for file 
  2537.            information levels. 
  2538.  
  2539.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) 
  2540.                    pInfoBuf contains the FILESTATUS3 data structure. 
  2541.  
  2542.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  2543.                    pInfo contains the FILESTATUS3L data structure, to which 
  2544.                    file information is returned. 
  2545.  
  2546.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) 
  2547.                    pInfoBuf contains an EAOP2 data structure. 
  2548.  
  2549.                    Level 2 sets a series of EA name/value pairs. On input, 
  2550.                    pInfoBuf is an EAOP2 data structure. fpGEA2List is ignored. 
  2551.                    fpFEA2List points to a data area where the relevant is an 
  2552.                    FEA2 list is to be found. oError is ignored. 
  2553.  
  2554.                    On output, fpGEA2List and fpFEA2List are unchanged. The area 
  2555.                    pointed to by fpFEA2List is unchanged. If an error occurred 
  2556.                    during the set, oError is the offset of the FEA2 where the 
  2557.                    error occurred. The return code is the error code 
  2558.                    corresponding to the condition generating the error. If no 
  2559.                    error occurred, oError is undefined. 
  2560.  
  2561.  cbInfoBuf (ULONG) - input 
  2562.            The length, in bytes, of pInfoBuf. 
  2563.  
  2564.  fhFileHandleLockID (FHLOCK) - input 
  2565.            The filehandle lockid obtained from DosProtectOpen. 
  2566.  
  2567.  Returns 
  2568.  
  2569.  ulrc (APIRET) - returns 
  2570.            Return Code. 
  2571.  
  2572.            DosProtectSetFileInfo returns one of the following values: 
  2573.  
  2574.            0              NO_ERROR 
  2575.  
  2576.            1              ERROR_INVALID_FUNCTION 
  2577.  
  2578.            5              ERROR_ACCESS_DENIED 
  2579.  
  2580.            6              ERROR_INVALID_HANDLE 
  2581.  
  2582.            87             ERROR_INVALID_PARAMETER 
  2583.  
  2584.            122            ERROR_INSUFFICIENT_BUFFER 
  2585.  
  2586.            124            ERROR_INVALID_LEVEL 
  2587.  
  2588.            130            ERROR_DIRECT_ACCESS_HANDLE 
  2589.  
  2590.            254            ERROR_INVALID_EA_NAME 
  2591.  
  2592.            255            ERROR_EA_LIST_INCONSISTENT 
  2593.  
  2594.  Remarks 
  2595.  
  2596.  DosProtectSetFileInfo is successful only when the file is opened for write 
  2597.  access, and access by other processes is prevented by a deny-both sharing 
  2598.  mode. If the file is already opened with conflicting sharing rights, any call 
  2599.  to DosProtectOpen will fail. 
  2600.  
  2601.  A value of 0 in the date and time components of a field does not change the 
  2602.  field. For example, if both "last write date" and "last write time" are 
  2603.  specified as 0 in the Level 1 information structure, then both attributes of 
  2604.  the file are left unchanged. If either "last write date" or "last write time" 
  2605.  are other than 0, both attributes of the file are set to the new values. 
  2606.  
  2607.  In the FAT file system, only the dates and times of the last write can be 
  2608.  modified. Creation and last-access dates and times are not affected. 
  2609.  
  2610.  The last-modification date and time will be changed if the extended attributes 
  2611.  are modified. 
  2612.  
  2613.  Related Functions 
  2614.  
  2615.      DosProtectClose 
  2616.  
  2617.      DosProtectEnumAttribute 
  2618.  
  2619.      DosProtectOpen 
  2620.  
  2621.      DosProtectQueryFileInfo 
  2622.  
  2623.      DosQueryPathInfo 
  2624.  
  2625.      DosResetBuffer 
  2626.  
  2627.      DosSetFileSize 
  2628.  
  2629.      DosSetPathInfo 
  2630.  
  2631.  Example Code 
  2632.  
  2633.  This example creates a read-only file named "DOSFDEL.DAT", then changes its 
  2634.  attributes to normal file, and finally uses DosForceDelete to delete the file 
  2635.  so that it cannot be restored using UNDELETE. 
  2636.  
  2637.   #define INCL_DOSFILEMGR   /* File Manager values */
  2638.   #define INCL_DOSERRORS    /* DOS error values    */
  2639.   #include <os2.h>
  2640.   #include <stdio.h>
  2641.  
  2642.   int main(VOID) {
  2643.  
  2644.   UCHAR       uchFileName[]   = "DOSFDEL.DAT";   /* File to delete    */
  2645.   HFILE       fhDelFile       = 0;               /* File handle from DosOpenL  */
  2646.   FILESTATUS3L fsts3FileInfo   = {{0}};  /* Information associated with file   */
  2647.   ULONG       ulBufferSize    = sizeof(FILESTATUS3L); /* File info buffer size */
  2648.   ULONG       ulOpenAction    = 0;                 /* Action taken by DosOpenL */
  2649.   APIRET      rc              = NO_ERROR;          /* Return code             */
  2650.   FHLOCK      FHLock          = 0;                 /* File handle lock        */
  2651.  
  2652.   /* Create a read-only file */
  2653.  
  2654.   rc = DosProtectOpenL(uchFileName, &fhDelFile,
  2655.   &ulOpenAction, (LONGLONG)10, FILE_READONLY,
  2656.   OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
  2657.   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, 0L, &FHLock);
  2658.   if (rc != NO_ERROR) {
  2659.   printf("DosProtectOpenL error: return code = %u\n", rc);
  2660.   return 1;
  2661.   }
  2662.  
  2663.   rc = DosProtectQueryFileInfo(fhDelFile, FIL_STANDARDL,
  2664.   &fsts3FileInfo, ulBufferSize, FHLock);   /* Get standard info */
  2665.   if (rc != NO_ERROR) {
  2666.   printf("DosProtectQueryFileInfo error: return code = %u\n", rc);
  2667.   return 1;
  2668.   } else { printf("File %s created read-only.\n",uchFileName); }
  2669.  
  2670.   /*   Change the file attributes to be "normal"  */
  2671.  
  2672.   fsts3FileInfo.attrFile  = FILE_NORMAL;
  2673.   rc = DosProtectSetFileInfo(fhDelFile, FIL_STANDARDL,
  2674.   &fsts3FileInfo, ulBufferSize, FHLock);
  2675.   if (rc != NO_ERROR) {
  2676.   printf("DosProtectSetFileInfo error: return code = %u\n", rc);
  2677.   return 1;
  2678.   }
  2679.  
  2680.   rc = DosProtectClose(fhDelFile, FHLock);
  2681.   /* Should verify that (rc != NO_ERROR) here... *//* Delete the file */
  2682.  
  2683.   rc = DosForceDelete(uchFileName);
  2684.   if (rc != NO_ERROR) {
  2685.   printf("DosForceDelete error: return code = %u\n", rc);
  2686.   return 1;
  2687.   } else {
  2688.   printf("File %s has been deleted.\n",uchFileName);
  2689.   }  /* endif */
  2690.  
  2691.   return NO_ERROR;
  2692.   }
  2693.  
  2694.  
  2695. ΓòÉΓòÉΓòÉ 2.9. DosProtectSetFileLocksL ΓòÉΓòÉΓòÉ
  2696.  
  2697. Purpose 
  2698.  
  2699. DosProtectSetFileLocksL locks and unlocks a range of an open file. 
  2700.  
  2701. Syntax 
  2702.  
  2703. #define INCL_DOSFILEMGR
  2704. #include <os2.h>
  2705.  
  2706.  APIRET DosProtectSetFileLocksL (HFILE hFile, PFILELOCKL pflUnlock, 
  2707.            PFILELOCKL pflLock, ULONG timeout, ULONG flags, 
  2708.            FHLOCK fhFileHandleLockID) 
  2709.  
  2710.  Parameters 
  2711.  
  2712.  hFile (HFILE) - input 
  2713.            File handle. 
  2714.  
  2715.  pflUnlock (PFILELOCKL) - input 
  2716.            Address of the structure containing the offset and length of a range 
  2717.            to be unlocked. 
  2718.  
  2719.            The structure is shown in the following figure: 
  2720.  
  2721.                       typedef struct _FILELOCKL {
  2722.                         LONGLONG       lOffset;
  2723.                         LONGLONG       lRange;
  2724.                       } FILELOCKL;
  2725.  
  2726.  pflLock (PFILELOCKL) - input 
  2727.            Address of the structure containing the offset and length of a range 
  2728.            to be locked 
  2729.  
  2730.  timeout (ULONG) - input 
  2731.            The maximum time that the process is to wait for the requested 
  2732.            locks. 
  2733.  
  2734.            The time is represented in milliseconds. 
  2735.  
  2736.  flags (ULONG) - input 
  2737.            Flags that describe the action to be taken. 
  2738.  
  2739.            Possible actions are: 
  2740.  
  2741.            Bits           Description 
  2742.  
  2743.            31-2           Reserved flags 
  2744.  
  2745.            1              Atomic 
  2746.  
  2747.                           This bit defines a request for atomic locking. If 
  2748.                           this bit is set to 1 and the lock range is equal to 
  2749.                           the unlock range, an atomic lock occurs. If this bit 
  2750.                           is set to 1 and the lock range is not equal to the 
  2751.                           unlock range, an error is returned. 
  2752.  
  2753.                           If this bit is set to 0, then the lock may or may not 
  2754.                           occur atomically with the unlock. 
  2755.  
  2756.            0              Share 
  2757.  
  2758.                           This bit defines the type of access that other 
  2759.                           processes may have to the file range that is being 
  2760.                           locked. 
  2761.  
  2762.                           If this bit is set to 0 (the default), other 
  2763.                           processes have no access to the locked file range. 
  2764.                           The current process has exclusive access to the 
  2765.                           locked file range, which must not overlap any other 
  2766.                           locked file range. 
  2767.  
  2768.                           If this bit is set to 1, the current process and 
  2769.                           other processes have shared read-only access to the 
  2770.                           locked file range. A file range with shared access 
  2771.                           may overlap any other file range with shared access, 
  2772.                           but must not overlap any other file range with 
  2773.                           exclusive access. 
  2774.  
  2775.  fhFileHandleLockID (FHLOCK) - input 
  2776.            The filehandle lockid returned by a previous DosProtectOpenL. 
  2777.  
  2778.  Returns 
  2779.  
  2780.  ulrc (APIRET) - returns 
  2781.            Return Code. 
  2782.  
  2783.            DosProtectSetFileLocksL returns one of the following values: 
  2784.  
  2785.            0              NO_ERROR 
  2786.  
  2787.            6              ERROR_INVALID_HANDLE 
  2788.  
  2789.            33             ERROR_LOCK_VIOLATION 
  2790.  
  2791.            36             ERROR_SHARING_BUFFER_EXCEEDED 
  2792.  
  2793.            87             ERROR_INVALID_PARAMETER 
  2794.  
  2795.            95             ERROR_INTERRUPT 
  2796.  
  2797.            174            ERROR_ATOMIC_LOCK_NOT_SUPPORTED 
  2798.  
  2799.            175            ERROR_READ_LOCKS_NOT_SUPPORTED 
  2800.  
  2801.  Remarks 
  2802.  
  2803.  DosProtectSetFileLocksL allows a process to lock and unlock a range in a file. 
  2804.  The time during which a file range is locked should be short. 
  2805.  
  2806.  If the lock and unlock ranges are both zero, ERROR_LOCK_VIOLATION is returned 
  2807.  to the caller. 
  2808.  
  2809.  If you only want to lock a file range, set the unlock file offset and the 
  2810.  unlock range length to zero. 
  2811.  
  2812.  If you only want to unlock a file range, set the lock file offset and the lock 
  2813.  range length to zero. 
  2814.  
  2815.  When the Atomic bit of flags is set to 0, and DosProtectSetFileLocksL 
  2816.  specifies a lock operation and an unlock operation, the unlock operation 
  2817.  occurs first, and then the lock operation is performed. If an error occurs 
  2818.  during the unlock operation, an error code is returned and the lock operation 
  2819.  is not performed. If an error occurs during the lock operation, an error code 
  2820.  is returned and the unlock remains in effect if it was successful. 
  2821.  
  2822.  The lock operation is atomic when all of these conditions are met: 
  2823.  
  2824.      The Atomic bit is set to 1 in flags 
  2825.  
  2826.      The unlock range is the same as the lock range 
  2827.  
  2828.      The process has shared access to the file range, and has requested 
  2829.       exclusive access to it; or the process has exclusive access to the file 
  2830.       range, and has requested shared access to it. 
  2831.  
  2832.  Some file system drivers (FSDs) may not support atomic lock operations. 
  2833.  Versions of the operating system prior to OS/2 Version 2.00 do not support 
  2834.  atomic lock operations. If the application receives the error code 
  2835.  ERROR_ATOMIC_LOCK_NOT_SUPPORTED, the application should unlock the file range 
  2836.  and then lock it using a non-atomic operation (with the atomic bit set to 0 in 
  2837.  flags). The application should also refresh its internal buffers before making 
  2838.  any changes to the file. 
  2839.  
  2840.  If you issue DosProtectClose to close a file with locks still in effect, the 
  2841.  locks are released in no defined sequence. 
  2842.  
  2843.  If you end a process with a file open, and you have locks in effect in that 
  2844.  file, the file is closed and the locks are released in no defined sequence. 
  2845.  
  2846.  The locked range can be anywhere in the logical file. Locking beyond the end 
  2847.  of the file is not an error. A file range to be locked exclusively must first 
  2848.  be cleared of any locked file sub-ranges or overlapping locked file ranges. 
  2849.  
  2850.  If you repeat DosProtectSetFileLocksL for the same file handle and file range, 
  2851.  then you duplicate access to the file range. Access to locked file ranges is 
  2852.  not duplicated across DosExecPgm. The proper method of using locks is to 
  2853.  attempt to lock the file range, and to examine the return value. 
  2854.  
  2855.  The following table shows the level of access granted when the accessed file 
  2856.  range is locked with an exclusive lock or a shared lock. "Owner" refers to a 
  2857.  process that owns the lock. "Non-owner" refers to a process that does not own 
  2858.  the lock. 
  2859.  
  2860.  
  2861.    Action        Exclusive Lock             Shared Lock
  2862.  
  2863.    Owner read    Success                    Success
  2864.  
  2865.    Non-owner     Wait for unlock. Return    Success
  2866.    read          error code after time-out.
  2867.  
  2868.    Owner write   Success                    Wait for unlock. Return
  2869.                                             error code after time-out.
  2870.  
  2871.    Non-owner     Wait for unlock. Return    Wait for unlock. Return
  2872.    write         error code after time-out. error code after time-out.
  2873.  
  2874.  If only locking is specified, DosProtectSetFileLocksL locks the specified file 
  2875.  range using pflLock If the lock operation cannot be accomplished, an error is 
  2876.  returned, and the file range is not locked. 
  2877.  
  2878.  After the lock request is processed, a file range can be unlocked using the 
  2879.  pflUnlock parameter of another DosProtectSetFileLocksL request. If unlocking 
  2880.  cannot be accomplished, an error is returned. 
  2881.  
  2882.  Instead of denying read/write access to an entire file by specifying access 
  2883.  and sharing modes with DosProtectOpenL requests, a process attempts to lock 
  2884.  only the range needed for read/write access and examines the error code 
  2885.  returned. 
  2886.  
  2887.  Once a specified file range is locked exclusively, read and write access by 
  2888.  another process is denied until the file range is unlocked. If both unlocking 
  2889.  and locking are specified by DosProtectSetFileLocksL, the unlocking operation 
  2890.  is performed first, then locking is done. 
  2891.  
  2892.  Related Functions 
  2893.  
  2894.      DosCancelLockRequestL 
  2895.  
  2896.      DosDupHandle 
  2897.  
  2898.      DosExecPgm 
  2899.  
  2900.      DosProtectOpenL 
  2901.  
  2902.  Example Code 
  2903.  
  2904.  This example opens or creates and opens a file named "FLOCK.DAT" in protected 
  2905.  mode, and updates it using file locks. 
  2906.  
  2907.   #define INCL_DOSFILEMGR       /* File Manager values */
  2908.   #define INCL_DOSERRORS        /* DOS Error values    */
  2909.   #include <os2.h>
  2910.   #include <stdio.h>
  2911.   #include <string.h>
  2912.  
  2913.   int main(VOID) {
  2914.  
  2915.   HFILE     FileHandle   = NULLHANDLE;  /* File handle */
  2916.   ULONG     Action       = 0,           /* Action taken by DosOpenL */
  2917.   Wrote        = 0,           /* Number of bytes written by DosWrite */
  2918.   i            = 0;           /* Loop index */
  2919.   CHAR      FileData[40] = "Forty bytes of demonstration text data\r\n";
  2920.   APIRET    rc           = NO_ERROR;    /* Return code */
  2921.   FHLOCK    FHLock       = 0;           /* File handle lock   */
  2922.   FILELOCKL  LockArea     = {0},         /* Area of file to lock */
  2923.   UnlockArea   = {0};         /* Area of file to unlock */
  2924.  
  2925.   rc = DosProtectOpenL("flock.dat",                   /* File to open */
  2926.   &FileHandle,                   /* File handle */
  2927.   &Action,                       /* Action taken */
  2928.   (LONGLONG)4000,                /* File primary allocation */
  2929.   FILE_ARCHIVED,                 /* File attributes */
  2930.   FILE_OPEN | FILE_CREATE,       /* Open function type */
  2931.   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE,
  2932.   0L,                            /* No extended attributes */
  2933.   &FHLock);                      /* File handle lock */
  2934.   if (rc != NO_ERROR) {                       /* If open failed */
  2935.   printf("DosProtectOpenL error: return code = %u\n", rc);
  2936.   return 1;
  2937.   }
  2938.  
  2939.   LockArea.lOffset = 0;              /* Start locking at beginning of file */
  2940.   LockArea.lRange =  40;             /* Use a lock range of 40 bytes       */
  2941.   UnLockArea.lOffset = 0;              /* Start unlocking at beginning of file */
  2942.   UnLockArea.lRange =  0;              /* Use a unlock range of 0 bytes       */
  2943.  
  2944.   /* Write 8000 bytes to the file, 40 bytes at a time */
  2945.  
  2946.   for (i=0; i<200; ++i) {
  2947.  
  2948.   rc = DosProtectSetFileLocksL(FileHandle,        /* File handle   */
  2949.   &UnlockArea,       /* Unlock previous record (if any) */
  2950.   &LockArea,         /* Lock current record */
  2951.   2000L,             /* Lock time-out value of 2 seconds */
  2952.   0L,                /* Exclusive lock, not atomic */
  2953.   FHLock);           /* File handle lock */
  2954.   if (rc != NO_ERROR) {
  2955.   printf("DosProtectSetFileLocksL error: return code = %u\n", rc);
  2956.   return 1;
  2957.   }
  2958.   rc = DosProtectWrite(FileHandle, FileData, sizeof(FileData), &Wrote, FHLock);
  2959.   if (rc != NO_ERROR) {
  2960.   printf("DosProtectWrite error: return code = %u\n", rc);
  2961.   return 1;
  2962.   }
  2963.   UnlockArea = LockArea;      /* Will unlock this record on next iteration */
  2964.   LockArea.lOffset += 40;     /* Prepare to lock next record               */
  2965.  
  2966.   } /* endfor - 8000 bytes written */
  2967.  
  2968.   rc = DosProtectClose(FileHandle,FHLock);    /* Close file, release any locks */
  2969.   /* Should check if (rc != NO_ERROR) here .... */
  2970.  
  2971.   return NO_ERROR;
  2972.   }
  2973.  
  2974.  
  2975. ΓòÉΓòÉΓòÉ 2.10. DosProtectSetFilePtrL ΓòÉΓòÉΓòÉ
  2976.  
  2977. Purpose 
  2978.  
  2979. DosProtectSetFilePtrL moves the read or write pointer according to the type of 
  2980. move specified. 
  2981.  
  2982. Syntax 
  2983.  
  2984. #define INCL_DOSFILEMGR
  2985. #include <os2.h>
  2986.  
  2987.  APIRET DosProtectSetFilePtrL (HFILE hFile, LONGLONG ib, ULONG method, 
  2988.            PLONGLONG ibActual, FHLOCK fhFileHandleLockID) 
  2989.  
  2990.  Parameters 
  2991.  
  2992.  hFile (HFILE) - input 
  2993.            The handle returned by a previous DosOpenL function. 
  2994.  
  2995.  ib (LONGLONG) - input 
  2996.            The signed distance (offset) to move, in bytes. 
  2997.  
  2998.  method (LONG) - input 
  2999.            The method of moving. 
  3000.  
  3001.            This field specifies the location in the file at which the 
  3002.            read/write pointer starts before adding the ib offset. The values 
  3003.            and their meanings are as shown in the following list: 
  3004.  
  3005.            0        FILE_BEGIN 
  3006.  
  3007.                     Move the pointer from the beginning of the file. 
  3008.  
  3009.            1        FILE_CURRENT 
  3010.  
  3011.                     Move the pointer from the current location of the 
  3012.                     read/write pointer. 
  3013.  
  3014.            2        FILE_END 
  3015.  
  3016.                     Move the pointer from the end of the file. Use this method 
  3017.                     to determine a file's size. 
  3018.  
  3019.  ibActual (PLONGLONG) - output 
  3020.            Address of the new pointer location. 
  3021.  
  3022.  fhFileHandleLockID (FHLOCK) - input 
  3023.            The filehandle lockid returned by a previous DosProtectOpenL. 
  3024.  
  3025.  Returns 
  3026.  
  3027.  ulrc (APIRET) - returns 
  3028.            Return Code. 
  3029.  
  3030.            DosProtectSetFilePtrL returns one of the following values: 
  3031.  
  3032.            0              NO_ERROR 
  3033.  
  3034.            1              ERROR_INVALID_FUNCTION 
  3035.  
  3036.            6              ERROR_INVALID_HANDLE 
  3037.  
  3038.            132            ERROR_SEEK_ON_DEVICE 
  3039.  
  3040.            131            ERROR_NEGATIVE_SEEK 
  3041.  
  3042.            130            ERROR_DIRECT_ACCESS_HANDLE 
  3043.  
  3044.  Remarks 
  3045.  
  3046.  The read/write pointer in a file is a signed 64-bit number. A negative value 
  3047.  for ib moves the pointer backward in the file; a positive value moves it 
  3048.  forward. DosProtectSetFilePtrL cannot be used to move to a negative position 
  3049.  in the file. 
  3050.  
  3051.  DosProtectSetFilePtrL cannot be used for a character device or pipe. 
  3052.  
  3053.  Related Functions 
  3054.  
  3055.      DosProtectOpenL 
  3056.  
  3057.      DosProtectRead 
  3058.  
  3059.      DosProtectSetFileSizeL 
  3060.  
  3061.      DosProtectWrite 
  3062.  
  3063.  Example Code 
  3064.  
  3065.  This example opens or creates and opens a file named "DOSPROT.DAT", writes a 
  3066.  string to it, returns the file pointer to the beginning of the file, reads it, 
  3067.  and finally closes it using DosProtect functions. 
  3068.  
  3069.   #define INCL_DOSFILEMGR          /* File Manager values */
  3070.   #define INCL_DOSERRORS           /* DOS Error values    */
  3071.   #include <os2.h>
  3072.   #include <stdio.h>
  3073.   #include <string.h>
  3074.  
  3075.   int main(VOID) {
  3076.   HFILE  hfFileHandle   = 0L;
  3077.   ULONG  ulAction       = 0;
  3078.   ULONG  ulBytesRead    = 0;
  3079.   ULONG  ulWrote        = 0;
  3080.   LONGLONG  ullLocal    = 0;
  3081.   UCHAR  uchFileName[20]  = "dosprot.dat",
  3082.   uchFileData[100] = " ";
  3083.   FHLOCK FileHandleLock = 0;        /* File handle lock   */
  3084.   APIRET rc             = NO_ERROR; /* Return code */
  3085.  
  3086.   /* Open the file test.dat.  Make it read/write, open it */
  3087.   /* if it already exists and create it if it is new.     */
  3088.   rc = DosProtectOpenL(uchFileName,             /* File path name          */
  3089.   &hfFileHandle,                  /* File handle             */
  3090.   &ulAction,                      /* Action taken            */
  3091.   (LONGLONG)100,                           /* File primary allocation */
  3092.   FILE_ARCHIVED | FILE_NORMAL,    /* File attribute          */
  3093.   OPEN_ACTION_CREATE_IF_NEW |
  3094.   OPEN_ACTION_OPEN_IF_EXISTS,     /* Open function type      */
  3095.   OPEN_FLAGS_NOINHERIT |
  3096.   OPEN_SHARE_DENYNONE  |
  3097.   OPEN_ACCESS_READWRITE,          /* Open mode of the file   */
  3098.   0L,                             /* No extended attribute   */
  3099.   &FileHandleLock);               /* File handle lock id     */
  3100.   if (rc != NO_ERROR) {
  3101.   printf("DosProtectOpenL error: return code = %u\n", rc);
  3102.   return 1;
  3103.   } else {
  3104.   printf ("DosProtectOpenL: Action taken = %u\n", ulAction);
  3105.   } /* endif */
  3106.  
  3107.   /* Write a string to the file */
  3108.   strcpy (uchFileData, "testing...\n3...\n2...\n1\n");
  3109.  
  3110.   rc = DosProtectWrite (hfFileHandle,       /* File handle                  */
  3111.   (PVOID) uchFileData,       /* String to be written         */
  3112.   sizeof (uchFileData),      /* Size of string to be written */
  3113.   &ulWrote,                  /* Bytes actually written       */
  3114.   FileHandleLock);           /* File handle lock id          */if (rc != NO_ERROR) {
  3115.   printf("DosProtectWrite error: return code = %u\n", rc);
  3116.   return 1;
  3117.   } else {
  3118.   printf ("DosProtectWrite: Bytes written = %u\n", ulWrote);
  3119.   } /* endif */
  3120.  
  3121.   /* Move the file pointer back to the beginning of the file */
  3122.   rc = DosProtectSetFilePtrL (hfFileHandle,   /* File Handle          */
  3123.   (LONGLONG)0,            /* Offset               */
  3124.   FILE_BEGIN,             /* Move from BOF        */
  3125.   &ullLocal,              /* New location address */
  3126.   FileHandleLock);        /* File handle lock id  */
  3127.   if (rc != NO_ERROR) {
  3128.   printf("DosSetFilePtr error: return code = %u\n", rc);
  3129.   return 1;
  3130.   }
  3131.  
  3132.   /* Read the first 100 bytes of the file */
  3133.   rc = DosProtectRead (hfFileHandle,         /* File Handle                 */
  3134.   uchFileData,                 /* String to be read           */
  3135.   100L,                        /* Length of string to be read */
  3136.   &ulBytesRead,                /* Bytes actually read         */
  3137.   FileHandleLock);             /* File handle lock id         */
  3138.   if (rc != NO_ERROR) {
  3139.   printf("DosProtectRead error: return code = %u\n", rc);
  3140.   return 1;
  3141.   } else {
  3142.   printf("DosProtectRead: Bytes read = %u\n%s\n", ulBytesRead, uchFileData);
  3143.   } /* endif */
  3144.  
  3145.   rc = DosProtectClose(hfFileHandle, FileHandleLock);   /* Close the file */
  3146.   if (rc != NO_ERROR) {
  3147.   printf("DosProtectClose error: return code = %u\n", rc);
  3148.   return 1;
  3149.   }
  3150.   return NO_ERROR;
  3151.   }
  3152.  
  3153.  
  3154. ΓòÉΓòÉΓòÉ 2.11. DosProtectSetFileSizeL ΓòÉΓòÉΓòÉ
  3155.  
  3156. Purpose 
  3157.  
  3158. DosProtectSetFileSizeL changes the size of a file. 
  3159.  
  3160. Syntax 
  3161.  
  3162. #define INCL_DOSFILEMGR
  3163. #include <os2.h>
  3164.  
  3165.  APIRET DosProtectSetFileSizeL (HFILE hFile, LONGLONG cbSize, 
  3166.            FHLOCK fhFileHandleLockID) 
  3167.  
  3168.  Parameters 
  3169.  
  3170.  hFile (HFILE) - input 
  3171.            Handle of the file whose size to be changed. 
  3172.  
  3173.  cbSize (LONGLONG) - input 
  3174.            New size, in bytes, of the file. 
  3175.  
  3176.  fhFileHandleLockID (FHLOCK) - input 
  3177.            The filehandle lockid obtained from DosProtectOpenL. 
  3178.  
  3179.  Returns 
  3180.  
  3181.  ulrc (APIRET) - returns 
  3182.            Return Code. 
  3183.  
  3184.            DosProtectSetFileSizeL returns one of the following values: 
  3185.  
  3186.            0              NO_ERROR 
  3187.  
  3188.            5              ERROR_ACCESS_DENIED 
  3189.  
  3190.            6              ERROR_INVALID_HANDLE 
  3191.  
  3192.            26             ERROR_NOT_DOS_DISK 
  3193.  
  3194.            33             ERROR_LOCK_VIOLATION 
  3195.  
  3196.            87             ERROR_INVALID_PARAMETER 
  3197.  
  3198.            112            ERROR_DISK_FULL 
  3199.  
  3200.  Remarks 
  3201.  
  3202.  When DosProtectSetFileSizeL is issued, the file must be open in a mode that 
  3203.  allows write access. 
  3204.  
  3205.  The size of the open file can be truncated or extended. If the file size is 
  3206.  being extended, the file system tries to allocate additional bytes in a 
  3207.  contiguous (or nearly contiguous) space on the medium. The values of the new 
  3208.  bytes are undefined. 
  3209.  
  3210.  Related Functions 
  3211.  
  3212.      DosProtectOpenL 
  3213.  
  3214.      DosProtectQueryFileInfo 
  3215.  
  3216.      DosQueryPathInfo 
  3217.  
  3218.  Example Code 
  3219.  
  3220.  This example writes to a file named "DOSPMAN.DAT", resets the buffer, and 
  3221.  changes the size of the file using DosProtect functions. 
  3222.  
  3223.   #define INCL_DOSFILEMGR          /* File Manager values */
  3224.   #define INCL_DOSERRORS           /* DOS Error values    */
  3225.   #include <os2.h>
  3226.   #include <stdio.h>
  3227.   #include <string.h>
  3228.  
  3229.   int main(VOID) {
  3230.   HFILE  hfFileHandle   = 0L;     /* Handle for file being manipulated */
  3231.   ULONG  ulAction       = 0;      /* Action taken by DosOpenL */
  3232.   FHLOCK FileHandleLock = 0;      /* File handle lock   */
  3233.  
  3234.   ULONG  ulWrote        = 0;      /* Number of bytes written by DosWrite */
  3235.   UCHAR  uchFileName[20]  = "dospman.dat",     /* Name of file */
  3236.   uchFileData[4]   = "DATA";            /* Data to write to file */
  3237.   APIRET rc             = NO_ERROR;            /* Return code */
  3238.  
  3239.   /* Open the file dosman.dat.  Use an existing file or create a new */
  3240.   /* one if it doesn't exist.                                      */
  3241.   rc = DosProtectOpenL(uchFileName, &hfFileHandle, &ulAction, (LONGLONG)4,
  3242.   FILE_ARCHIVED | FILE_NORMAL,
  3243.   OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
  3244.   OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYNONE  |
  3245.   OPEN_ACCESS_READWRITE, 0L, &FileHandleLock);
  3246.   if (rc != NO_ERROR) {
  3247.   printf("DosProtectOpenL error: return code = %u\n", rc);
  3248.   return 1;
  3249.   }
  3250.  
  3251.   rc = DosProtectWrite (hfFileHandle, (PVOID) uchFileData,
  3252.   sizeof (uchFileData), &ulWrote, FileHandleLock);
  3253.   if (rc != NO_ERROR) {
  3254.   printf("DosProtectWrite error: return code = %u\n", rc);
  3255.   return 1;
  3256.   }
  3257.  
  3258.   rc = DosResetBuffer (hfFileHandle);
  3259.   if (rc != NO_ERROR) {
  3260.   printf("DosResetBuffer error: return code = %u\n", rc);
  3261.   return 1;
  3262.   } /* endif */
  3263.  
  3264.   rc = DosProtectSetFileSizeL (hfFileHandle, (LONGLONG)8, FileHandleLock);
  3265.   if (rc != NO_ERROR) {
  3266.   printf("DosProtectSetFileSizeL error: return code = %u\n", rc);
  3267.   return 1;
  3268.   }
  3269.  
  3270.   return NO_ERROR;
  3271.   }
  3272.  
  3273.  
  3274. ΓòÉΓòÉΓòÉ 2.12. DosQueryFileInfo ΓòÉΓòÉΓòÉ
  3275.  
  3276. Purpose 
  3277.  
  3278. DosQueryFileInfo gets file information. 
  3279.  
  3280. Syntax 
  3281.  
  3282. #define INCL_DOSFILEMGR
  3283. #include <os2.h>
  3284.  
  3285.  APIRET DosQueryFileInfo (HFILE hf, ULONG ulInfoLevel, PVOID pInfo, 
  3286.            ULONG cbInfoBuf) 
  3287.  
  3288.  Parameters 
  3289.  
  3290.  hf (HFILE) - input 
  3291.            The file handle. 
  3292.  
  3293.  ulInfoLevel (ULONG) - input 
  3294.            Level of file information required. 
  3295.  
  3296.            Specify a value: 
  3297.  
  3298.            1        FIL_STANDARD 
  3299.  
  3300.                     Level 1 file information 
  3301.  
  3302.            11       FIL_STANDARDL 
  3303.  
  3304.                     Level 11 file information 
  3305.  
  3306.            2        FIL_QUERYEASIZE 
  3307.  
  3308.                     Level 2 file information 
  3309.  
  3310.            12       FIL_QUERYEASIZEL 
  3311.  
  3312.                     Level 12 file information 
  3313.  
  3314.            3        FIL_QUERYEASFROMLIST 
  3315.  
  3316.                     Level 3 file information 
  3317.  
  3318.            Level 4 is reserved. 
  3319.  
  3320.            The structures described in pInfo indicate the information returned 
  3321.            for each of these levels. 
  3322.  
  3323.  pInfo (PVOID) - output 
  3324.            Address of the storage area where the system returns the requested 
  3325.            level of file information. 
  3326.  
  3327.            File information, where applicable, is at least as accurate as the 
  3328.            most recent DosClose, DosResetBuffer, DosSetFileInfo, or 
  3329.            DosSetPathInfo. 
  3330.  
  3331.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) 
  3332.                     pInfo contains the FILESTATUS3 data structure, in which 
  3333.                     file information is returned. 
  3334.  
  3335.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  3336.                     pInfo contains the FILESTATUS3L data structure, in which 
  3337.                     file information is returned. 
  3338.  
  3339.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) 
  3340.                     pInfo contains the FILESTATUS4 data structure. This is 
  3341.                     similar to the Level 1 structure, with the addition of the 
  3342.                     cbList field after the attrFile field. 
  3343.  
  3344.                     The cbList field is an unsigned ULONG. On output, this 
  3345.                     field contains the size, in bytes, of the file's entire 
  3346.                     extended attribute (EA) set on disk. You can use this value 
  3347.                     to calculate the size of the buffer required to hold the EA 
  3348.                     information returned when a value of 3 is specified for 
  3349.                     ulInfoLevel. The buffer size is less than or equal to twice 
  3350.                     the size of the file's entire EA set on disk. 
  3351.  
  3352.            Level 12 File Information (ulInfoLevel == FIL_QUERYEASIZEL) 
  3353.                     pInfo contains the FILESTATUS4L data structure. This is 
  3354.                     similar to the Level 1 structure, with the addition of the 
  3355.                     cbList field after the attrFile field. 
  3356.  
  3357.                     The cbList field is an unsigned ULONG. On output, this 
  3358.                     field contains the size, in bytes, of the file's entire 
  3359.                     extended attribute (EA) set on disk. You can use this value 
  3360.                     to calculate the size of the buffer required to hold the EA 
  3361.                     information returned when a value of 3 is specified for 
  3362.                     ulInfoLevel. The buffer size is less than or equal to twice 
  3363.                     the size of the file's entire EA set on disk. 
  3364.  
  3365.            Level 3 File Information (ulInfoLevel == FIL_QUERYEASFROMLIST) 
  3366.  
  3367.                     Input        pInfo contains an EAOP2 data structure. 
  3368.                                  fpGEA2List points to a GEA2 list defining the 
  3369.                                  attribute names whose values are returned. The 
  3370.                                  GEA2 data structures must be aligned on a 
  3371.                                  doubleword boundary. Each oNextEntryOffset 
  3372.                                  field must contain the number of bytes from 
  3373.                                  the beginning of the current entry to the 
  3374.                                  beginning of the next entry in the GEA2 list. 
  3375.                                  The oNextEntryOffset field in the last entry 
  3376.                                  of the GEA2 list must be 0. fpFEA2List points 
  3377.                                  to a data area where the relevant FEA2 list is 
  3378.                                  returned. The length field of this FEA2 list 
  3379.                                  is valid, giving the size of the FEA2 list 
  3380.                                  buffer. oError is ignored. 
  3381.  
  3382.                     Output       pInfo is unchanged. The buffer pointed to by 
  3383.                                  fpFEA2List is filled with the returned 
  3384.                                  information. If the buffer that fpFEA2List 
  3385.                                  points to is not large enough to hold the 
  3386.                                  returned information (the return code is 
  3387.                                  ERROR_BUFFER_OVERFLOW), cbList is still valid, 
  3388.                                  assuming there is at least enough space for 
  3389.                                  it. Its value is the size of the entire EA set 
  3390.                                  on disk for the file, even though only a 
  3391.                                  subset of attributes was requested. 
  3392.  
  3393.  cbInfoBuf (ULONG) - input 
  3394.            The length, in bytes, of pInfo. 
  3395.  
  3396.  Returns 
  3397.  
  3398.  ulrc (APIRET) - returns 
  3399.            Return Code. 
  3400.  
  3401.            DosQueryFileInfo returns one of the following values: 
  3402.  
  3403.            0              NO_ERROR 
  3404.  
  3405.            5              ERROR_ACCESS_DENIED 
  3406.  
  3407.            6              ERROR_INVALID_HANDLE 
  3408.  
  3409.            111            ERROR_BUFFER_OVERFLOW 
  3410.  
  3411.            124            ERROR_INVALID_LEVEL 
  3412.  
  3413.            130            ERROR_DIRECT_ACCESS_HANDLE 
  3414.  
  3415.            254            ERROR_INVALID_EA_NAME 
  3416.  
  3417.            255            ERROR_EA_LIST_INCONSISTENT 
  3418.  
  3419.  Remarks 
  3420.  
  3421.  Information levels designated "L" should be used in order to get complete size 
  3422.  information for files larger than 2GB. If information levels designated "L" 
  3423.  are not used, a size of one byte will be returned for files which are >2GB in 
  3424.  size. 
  3425.  
  3426.  In the FAT file system, only date and time information contained in Level 1 
  3427.  file information can be modified. Zero is returned for the creation and access 
  3428.  dates and times. 
  3429.  
  3430.  To return information contained in any of the file information levels, 
  3431.  DosQueryFileInfo must be able to read the open file. DosQueryFileInfo works 
  3432.  only when the file is opened for read access, with a deny-write sharing mode 
  3433.  specified for access by other processes. If another process that has specified 
  3434.  conflicting sharing and access modes has already opened the file, any call to 
  3435.  DosOpenL will fail. 
  3436.  
  3437.  DosEnumAttribute returns the lengths of EAs. This information can be used to 
  3438.  calculate what size pInfo needs to be to hold full-extended-attribute (FEA) 
  3439.  information returned by DosQueryFileInfo when Level 3 is specified. The size 
  3440.  of the buffer is calculated as follows: 
  3441.  
  3442.       Four bytes (for oNextEntryOffset) + 
  3443.       One byte (for fEA + 
  3444.       One byte (for cbName) + 
  3445.       Two bytes (for cbValue) + 
  3446.       Value of cbName (for the name of the EA) + 
  3447.       One byte (for terminating NULL in cbName) + 
  3448.       Value of cbValue (for the value of the EA) 
  3449.  
  3450.  Related Functions 
  3451.  
  3452.      DosClose 
  3453.  
  3454.      DosEnumAttribute 
  3455.  
  3456.      DosOpen 
  3457.  
  3458.      DosOpenL 
  3459.  
  3460.      DosQueryPathInfo 
  3461.  
  3462.      DosResetBuffer 
  3463.  
  3464.      DosSetFileInfo 
  3465.  
  3466.      DosSetFileSize 
  3467.  
  3468.      DosSetFileSizeL 
  3469.  
  3470.      DosSetPathInfo 
  3471.  
  3472.  Example Code 
  3473.  
  3474.  This example obtains the information of the "CONFIG.SYS" file. 
  3475.  
  3476.   #define INCL_DOSFILEMGR   /* File Manager values */
  3477.   #define INCL_DOSERRORS    /* DOS error values    */
  3478.   #include <os2.h>
  3479.   #include <stdio.h>
  3480.  
  3481.   int main(VOID) {
  3482.   UCHAR        uchFileName[80] = "C:\\CONFIG.SYS";  /* File to manipulate    */
  3483.   FILESTATUS3L  fsts3ConfigInfo = {{0}};       /* Buffer for file information */
  3484.   ULONG        ulBufSize     = sizeof(FILESTATUS3L);  /* Size of above buffer */
  3485.   HFILE        hfConfig      = 0;             /* Handle for Config file      */
  3486.   ULONG        ulOpenAction  = 0;             /* Action taken by DosOpenL     */
  3487.   APIRET       rc            = NO_ERROR;      /* Return code                 */
  3488.  
  3489.   rc = DosOpenL(uchFileName,                 /* File to open (path and name) */
  3490.   &hfConfig,                /* File handle returned         */
  3491.   &ulOpenAction,               /* Action taken by DosOpenL      */
  3492.   (LONGLONG)0,0L,        /* Primary allocation and attributes (ignored) */
  3493.   OPEN_ACTION_FAIL_IF_NEW |
  3494.   OPEN_ACTION_OPEN_IF_EXISTS,  /* Open an existing file only   */
  3495.   OPEN_FLAGS_NOINHERIT | OPEN_ACCESS_READONLY |
  3496.   OPEN_SHARE_DENYNONE,         /* Read access only             */
  3497.   0L);                         /* Extended attributes (ignored)*/
  3498.  
  3499.   if (rc != NO_ERROR) {
  3500.   printf("DosOpenL error: return code = %u\n", rc);
  3501.   return 1;
  3502.   }
  3503.  
  3504.   rc = DosQueryFileInfo(hfConfig,   /* Handle of file                  */
  3505.   FIL_STANDARDL,  /* Request standard (Level 11) info */
  3506.   &fsts3ConfigInfo, /* Buffer for file information  */
  3507.   ulBufSize);    /* Size of buffer                  */
  3508.   if (rc != NO_ERROR) {
  3509.   printf("DosQueryFileInfo error: return code = %u\n", rc);
  3510.   return 1;
  3511.   }
  3512.  
  3513.   rc = DosClose(hfConfig);      /* Close the file  (check RC in real life) */
  3514.   printf("%s ---  File size: %lld bytes\n",uchFileName, fsts3ConfigInfo.cbFile);
  3515.   printf("Last updated: %d/%d/%d; %d:%2.2d\n",
  3516.   fsts3ConfigInfo.fdateLastWrite.month,        /* Month            */
  3517.   fsts3ConfigInfo.fdateLastWrite.day,          /* Day              */
  3518.   (fsts3ConfigInfo.fdateLastWrite.year+1980L), /* Years since 1980 */
  3519.   fsts3ConfigInfo.ftimeLastWrite.hours,        /* Hours            */
  3520.   fsts3ConfigInfo.ftimeLastWrite.minutes);     /* Minutes          */
  3521.  
  3522.   return NO_ERROR;
  3523.   }
  3524.  
  3525.  
  3526. ΓòÉΓòÉΓòÉ 2.13. DosQueryPathInfo ΓòÉΓòÉΓòÉ
  3527.  
  3528. Purpose 
  3529.  
  3530. DosQueryPathInfo gets file information for a file or subdirectory. 
  3531.  
  3532. Syntax 
  3533.  
  3534. #define INCL_DOSFILEMGR
  3535. #include <os2.h>
  3536.  
  3537.  APIRET DosQueryPathInfo (PSZ pszPathName, ULONG ulInfoLevel, PVOID pInfoBuf, 
  3538.            ULONG cbInfoBuf) 
  3539.  
  3540.  Parameters 
  3541.  
  3542.  pszPathName (PSZ) - input 
  3543.            Address of the ASCIIZ file specification of the file or 
  3544.            subdirectory. 
  3545.  
  3546.            Global file-name characters can be used in the name only for level 5 
  3547.            file information. 
  3548.  
  3549.            DosQuerySysInfo is called by an application during initialization to 
  3550.            determine the maximum path length allowed by the operating system. 
  3551.  
  3552.  ulInfoLevel (ULONG) - input 
  3553.            The level of path information required. 
  3554.  
  3555.            Specify a value: 
  3556.  
  3557.            1        FIL_STANDARD 
  3558.  
  3559.                     Level 1 file information 
  3560.  
  3561.            11       FIL_STANDARDL 
  3562.  
  3563.                     Level 11 file information 
  3564.  
  3565.            2        FIL_QUERYEASIZE 
  3566.  
  3567.                     Level 2 file information 
  3568.  
  3569.            12       FIL_QUERYEASIZEL 
  3570.  
  3571.                     Level 12 file information 
  3572.  
  3573.            3        FIL_QUERYEASFROMLIST 
  3574.  
  3575.                     Level 3 file information 
  3576.  
  3577.            5        FIL_QUERYFULLNAME 
  3578.  
  3579.                     Level 5 file information 
  3580.  
  3581.            Level 4 is reserved. 
  3582.  
  3583.            The structures described in pInfoBuf indicate the information 
  3584.            returned for each of these levels. 
  3585.  
  3586.  pInfoBuf (PVOID) - output 
  3587.            Address of the storage area containing the requested level of path 
  3588.            information. 
  3589.  
  3590.            Path information, where applicable, is based on the most recent 
  3591.            DosClose, DosResetBuffer, DosSetFileInfo, or DosSetPathInfo. 
  3592.  
  3593.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) 
  3594.                    pInfoBuf contains the FILESTATUS3 data structure, in which 
  3595.                    path information is returned. 
  3596.  
  3597.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  3598.                    pInfoBuf contains the FILESTATUS3L data structure, in which 
  3599.                    path information is returned. 
  3600.  
  3601.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) 
  3602.                    pInfoBuf contains the FILESTATUS4 data structure. This is 
  3603.                    similar to the Level 1 structure, with the addition of the 
  3604.                    cbList field after the attrFile field. 
  3605.  
  3606.                    The cbList field is an unsigned LONG On output, this field 
  3607.                    contains the size, in bytes, of the file's entire extended 
  3608.                    attribute (EA) set on disk. You can use this value to 
  3609.                    calculate the size of the buffer required to hold the EA 
  3610.                    information returned when a value of 3 is specified for 
  3611.                    ulInfoLevel. The buffer size is less than or equal to twice 
  3612.                    the size of the file's entire EA set on disk. 
  3613.  
  3614.            Level 12 File Information (ulInfoLevel == FIL_QUERYEASIZEL) 
  3615.                    pInfoBuf contains the FILESTATUS4L data structure. This is 
  3616.                    similar to the Level 1 structure, with the addition of the 
  3617.                    cbList field after the attrFile field. 
  3618.  
  3619.                    The cbList field is an unsigned ULONG On output, this field 
  3620.                    contains the size, in bytes, of the file's entire extended 
  3621.                    attribute (EA) set on disk. You can use this value to 
  3622.                    calculate the size of the buffer required to hold the EA 
  3623.                    information returned when a value of 3 is specified for 
  3624.                    ulInfoLevel. The buffer size is less than or equal to twice 
  3625.                    the size of the file's entire EA set on disk. 
  3626.  
  3627.            Level 3 File Information (ulInfoLevel == FIL_QUERYEASFROMLIST) 
  3628.                    This is a subset of the EA information of the file. 
  3629.  
  3630.                    Input        ulInfoLevel contains an EAOP2 data structure. 
  3631.                                 fpGEA2List points to a GEA2 that defines the 
  3632.                                 attribute names whose values are returned. The 
  3633.                                 GEA2 data structures must be aligned on a 
  3634.                                 doubleword boundary. Each oNextEntryOffset 
  3635.                                 field must contain the number of bytes from the 
  3636.                                 beginning of the current entry to the beginning 
  3637.                                 of the next entry in the GEA2 list. The 
  3638.                                 oNextEntryOffset field in the last entry of the 
  3639.                                 GEA2 list must be zero. fpFEA2List points to a 
  3640.                                 data area where the relevant FEA2  list is 
  3641.                                 returned. The length field of this FEA2 list is 
  3642.                                 valid, giving the size of the FEA2 list buffer. 
  3643.                                 oError is ignored. 
  3644.  
  3645.                    Output       pInfoBuf is unchanged. If an error occurs, 
  3646.                                 oError points to the GEA2 entry that caused the 
  3647.                                 error. The buffer pointed to by fpFEA2List is 
  3648.                                 filled in with the returned information. If the 
  3649.                                 buffer that fpFEA2List points to is not large 
  3650.                                 enough to hold the returned information (the 
  3651.                                 return code is ERROR_BUFFER_OVERFLOW), cbList 
  3652.                                 is still valid, assuming there is at least 
  3653.                                 enough space for it. Its value is the size, in 
  3654.                                 bytes, of the file's entire EA set on disk, 
  3655.                                 even though only a subset of attributes was 
  3656.                                 requested. The size of the buffer required to 
  3657.                                 hold the EA information is less than or equal 
  3658.                                 to twice the size of the file's entire EA set 
  3659.                                 on disk. 
  3660.  
  3661.            Level 5 File Information (ulInfoLevel == FIL_QUERYFULLNAME) 
  3662.                    Level 5 returns the fully-qualified ASCIIZ name of 
  3663.                    pszPathName in pInfoBuf. pszPathName may contain global 
  3664.                    file-name characters. 
  3665.  
  3666.  cbInfoBuf (ULONG) - input 
  3667.            The length, in bytes, of pInfoBuf. 
  3668.  
  3669.  Returns 
  3670.  
  3671.  ulrc (APIRET) - returns 
  3672.            Return Code. 
  3673.  
  3674.            DosQueryPathInfo returns one of the following values: 
  3675.  
  3676.            0              NO_ERROR 
  3677.  
  3678.            3              ERROR_PATH_NOT_FOUND 
  3679.  
  3680.            32             ERROR_SHARING_VIOLATION 
  3681.  
  3682.            111            ERROR_BUFFER_OVERFLOW 
  3683.  
  3684.            124            ERROR_INVALID_LEVEL 
  3685.  
  3686.            206            ERROR_FILENAME_EXCED_RANGE 
  3687.  
  3688.            254            ERROR_INVALID_EA_NAME 
  3689.  
  3690.            255            ERROR_EA_LIST_INCONSISTENT 
  3691.  
  3692.  Remarks 
  3693.  
  3694.  In the FAT file system, only date and time information contained in Level 1 
  3695.  file information can be modified. Zero is returned for the creation and access 
  3696.  dates and times. 
  3697.  
  3698.  For DosQueryPathInfo to return information contained in any of the file 
  3699.  information levels, the file object must be opened for read access, with a 
  3700.  deny-write sharing mode specified for access by other processes. Thus, if the 
  3701.  file object is already accessed by another process that holds conflicting 
  3702.  sharing and access rights, a call to DosQueryPathInfo fails. 
  3703.  
  3704.  Related Functions 
  3705.  
  3706.      DosClose 
  3707.  
  3708.      DosCreateDir 
  3709.  
  3710.      DosEnumAttribute 
  3711.  
  3712.      DosOpen 
  3713.  
  3714.      DosOpenL 
  3715.  
  3716.      DosQueryFileInfo 
  3717.  
  3718.      DosResetBuffer 
  3719.  
  3720.      DosSetFileInfo 
  3721.  
  3722.      DosSetPathInfo 
  3723.  
  3724.  Example Code 
  3725.  
  3726.  The first example obtains information about the file "STARTUP.CMD." The second 
  3727.  example obtains information about the directory "SYSTEM." 
  3728.  
  3729.   #define INCL_DOSFILEMGR   /* File Manager values */
  3730.   #define INCL_DOSERRORS    /* DOS error values    */
  3731.   #include <os2.h>
  3732.   #include <stdio.h>
  3733.  
  3734.   int main(VOID) {
  3735.   UCHAR        uchFileName[80] = "C:\\STARTUP.CMD";  /* File to manipulate    */
  3736.   FILESTATUS3L  fsts3ConfigInfo = {{0}};       /* Buffer for file information */
  3737.   ULONG        ulBufSize     = sizeof(FILESTATUS3L);  /* Size of above buffer */
  3738.   APIRET       rc            = NO_ERROR;      /* Return code                 */
  3739.  
  3740.   rc = DosQueryPathInfo(uchFileName,   /* Path and name of file           */
  3741.   FIL_STANDARDL,  /* Request standard (Level 11) info */
  3742.   &fsts3ConfigInfo, /* Buffer for file information  */
  3743.   ulBufSize);    /* Size of buffer                  */
  3744.   if (rc != NO_ERROR) {
  3745.   printf("DosQueryPathInfo error: return code = %u\n", rc);
  3746.   return 1;
  3747.   }
  3748.  
  3749.   printf("%s ---  File size: %lld bytes\n",uchFileName, fsts3ConfigInfo.cbFile);
  3750.   printf("Last updated: %d/%d/%d; %d:%2.2d\n",
  3751.   fsts3ConfigInfo.fdateLastWrite.month,        /* Month            */
  3752.   fsts3ConfigInfo.fdateLastWrite.day,          /* Day              */
  3753.   (fsts3ConfigInfo.fdateLastWrite.year+1980L), /* Years since 1980 */
  3754.   fsts3ConfigInfo.ftimeLastWrite.hours,        /* Hours            */
  3755.   fsts3ConfigInfo.ftimeLastWrite.minutes);     /* Minutes          */
  3756.  
  3757.   return NO_ERROR;
  3758.   }
  3759.   #define INCL_DOSFILEMGR   /* File Manager values */
  3760.   #define INCL_DOSERRORS    /* DOS error values    */
  3761.   #include <os2.h>
  3762.   #include <stdio.h>
  3763.  
  3764.   int main(VOID) {
  3765.   UCHAR        uchPathName[255] = "C:\\OS2\\SYSTEM"; /* Path of interest     */
  3766.   FILESTATUS3L  fsts3ConfigInfo = {{0}};       /* Buffer for path information */
  3767.   ULONG        ulBufSize     = sizeof(FILESTATUS3L);  /* Size of above buffer */
  3768.   APIRET       rc            = NO_ERROR;      /* Return code                 */
  3769.  
  3770.   rc = DosQueryPathInfo(uchPathName,   /* Name of path                    */
  3771.   FIL_STANDARDL,  /* Request standard (Level 11) info */
  3772.   &fsts3ConfigInfo, /* Buffer for information       */
  3773.   ulBufSize);       /* Size of buffer               */
  3774.   if (rc != NO_ERROR) {
  3775.   printf("DosQueryPathInfo error: return code = %u\n", rc);
  3776.   return 1;
  3777.   }
  3778.  
  3779.   printf("Information for subdirectory: %s:\n",uchPathName);
  3780.   printf("Last updated: %d/%d/%d; %d:%2.2d\n",
  3781.   fsts3ConfigInfo.fdateLastWrite.month,        /* Month            */
  3782.   fsts3ConfigInfo.fdateLastWrite.day,          /* Day              */
  3783.   (fsts3ConfigInfo.fdateLastWrite.year+1980L), /* Years since 1980 */
  3784.   fsts3ConfigInfo.ftimeLastWrite.hours,        /* Hours            */
  3785.   fsts3ConfigInfo.ftimeLastWrite.minutes);     /* Minutes          */
  3786.  
  3787.   return NO_ERROR;
  3788.   }
  3789.  
  3790.  
  3791. ΓòÉΓòÉΓòÉ 2.14. DosQuerySysInfo ΓòÉΓòÉΓòÉ
  3792.  
  3793. Purpose 
  3794.  
  3795. DosQuerySysInfo returns values of static system variables. 
  3796.  
  3797. Syntax 
  3798.  
  3799. #define INCL_DOSMISC
  3800. #include  <os2.h>
  3801.  
  3802.  APIRET DosQuerySysInfo (ULONG iStart, ULONG iLast, PVOID pBuf, ULONG cbBuf) 
  3803.  
  3804.  Parameters 
  3805.  
  3806.  iStart (ULONG) - input 
  3807.            Ordinal of the first system variable to return. 
  3808.  
  3809.  iLast (ULONG) - input 
  3810.            Ordinal of the last system variable to return. 
  3811.  
  3812.  pBuf (PVOID) - output 
  3813.            Address of the data buffer where the system returns the variable 
  3814.            values. 
  3815.  
  3816.  cbBuf (ULONG) - input 
  3817.            Length, in bytes, of the data buffer. 
  3818.  
  3819.  Returns 
  3820.  
  3821.  ulrc (APIRET) - returns 
  3822.            Return Code. 
  3823.  
  3824.            DosQuerySysInfo returns one of the following values: 
  3825.  
  3826.            0              NO_ERROR 
  3827.  
  3828.            87             ERROR_INVALID_PARAMETER 
  3829.  
  3830.            111            ERROR_BUFFER_OVERFLOW 
  3831.  
  3832.  Remarks 
  3833.  
  3834.  DosQuerySysInfo returns a single system variable or a range of system 
  3835.  variables to a user-allocated buffer. To request a single system variable, set 
  3836.  iStart equal to iLast. To request a range of system variables, set iStart less 
  3837.  than iLast. 
  3838.  
  3839.  Each system variable is a ULONG value. The following list gives the ordinal 
  3840.  index, name, and description of the system variables. 
  3841.  
  3842.  1   QSV_MAX_PATH_LENGTH 
  3843.  
  3844.      Maximum length, in bytes, of a path name. 
  3845.  
  3846.  2   QSV_MAX_TEXT_SESSIONS 
  3847.  
  3848.      Maximum number of text sessions. 
  3849.  
  3850.  3   QSV_MAX_PM_SESSIONS 
  3851.  
  3852.      Maximum number of PM sessions. 
  3853.  
  3854.  4   QSV_MAX_VDM_SESSIONS 
  3855.  
  3856.      Maximum number of DOS sessions. 
  3857.  
  3858.  5   QSV_BOOT_DRIVE 
  3859.  
  3860.      Drive from which the system was started (1 means drive A, 2 means drive B, 
  3861.      and so on). 
  3862.  
  3863.  6   QSV_DYN_PRI_VARIATION 
  3864.  
  3865.      Dynamic priority variation flag (0 means absolute priority, 1 means 
  3866.      dynamic priority). 
  3867.  
  3868.  7   QSV_MAX_WAIT 
  3869.  
  3870.      Maximum wait in seconds. 
  3871.  
  3872.  8   QSV_MIN_SLICE 
  3873.  
  3874.      Minimum time slice in milliseconds. 
  3875.  
  3876.  9   QSV_MAX_SLICE 
  3877.  
  3878.      Maximum time slice in milliseconds. 
  3879.  
  3880.  10  QSV_PAGE_SIZE 
  3881.  
  3882.      Memory page size in bytes. This value is 4096 for the 80386 processor. 
  3883.  
  3884.  11  QSV_VERSION_MAJOR 
  3885.  
  3886.      Major version number (see note below). 
  3887.  
  3888.  12  QSV_VERSION_MINOR 
  3889.  
  3890.      Minor version number (see note below). 
  3891.  
  3892.  13  QSV_VERSION_REVISION 
  3893.  
  3894.      Revision number (see note below). 
  3895.  
  3896.  14  QSV_MS_COUNT 
  3897.  
  3898.      Value of a 32-bit, free-running millisecond counter. This value is zero 
  3899.      when the system is started. 
  3900.  
  3901.  15  QSV_TIME_LOW 
  3902.  
  3903.      Low-order 32 bits of the time in seconds since January 1, 1970 at 0:00:00. 
  3904.  
  3905.  16  QSV_TIME_HIGH 
  3906.  
  3907.      High-order 32 bits of the time in seconds since January 1, 1970 at 
  3908.      0:00:00. 
  3909.  
  3910.  17  QSV_TOTPHYSMEM 
  3911.  
  3912.      Total number of bytes of physical memory in the system. 
  3913.  
  3914.  18  QSV_TOTRESMEM 
  3915.  
  3916.      Total number of bytes of resident memory in the system. 
  3917.  
  3918.  19  QSV_TOTAVAILMEM 
  3919.  
  3920.      Maximum number of bytes of memory that can be allocated by all processes 
  3921.      in the system. This number is advisory and is not guaranteed, since system 
  3922.      conditions change constantly. 
  3923.  
  3924.  20  QSV_MAXPRMEM 
  3925.  
  3926.      Maximum number of bytes of memory that this process can allocate in its 
  3927.      private arena. This number is advisory and is not guaranteed, since system 
  3928.      conditions change constantly. 
  3929.  
  3930.  21  QSV_MAXSHMEM 
  3931.  
  3932.      Maximum number of bytes of memory that a process can allocate in the 
  3933.      shared arena. This number is advisory and is not guaranteed, since system 
  3934.      conditions change constantly. 
  3935.  
  3936.  22  QSV_TIMER_INTERVAL 
  3937.  
  3938.      Timer interval in tenths of a millisecond. 
  3939.  
  3940.  23  QSV_MAX_COMP_LENGTH 
  3941.  
  3942.      Maximum length, in bytes, of one component in a path name. 
  3943.  
  3944.  24  QSV_FOREGROUND_FS_SESSION 
  3945.  
  3946.      Session ID of the current foreground full-screen session. Note that this 
  3947.      only applies to full-screen sessions. The Presentation Manager session 
  3948.      (which displays Vio-windowed, PM, and windowed DOS Sessions) is 
  3949.      full-screen session ID 1. 
  3950.  
  3951.  25  QSV_FOREGROUND_PROCESS 
  3952.  
  3953.      Process ID of the current foreground process. 
  3954.  
  3955.  26  QSV_NUMPROCESSORS 
  3956.  
  3957.      Number of processors in the machine 
  3958.  
  3959.  27  QSV_MAXHPRMEM 
  3960.  
  3961.      Maximum amount of free space in process's high private arena. Because 
  3962.      system conditions change constantly, this number is advisory and is not 
  3963.      guaranteed.  In addition, this number does not indicate the largest single 
  3964.      memory object you can allocate because the arena may be fragmented. 
  3965.  
  3966.  28  QSV_MAXHSHMEM 
  3967.  
  3968.      Maximum amount of free space in process's high shared arena. Because 
  3969.      system conditions change constantly, this number is advisory and is not 
  3970.      guaranteed. In addition, this number does not indicate the largest single 
  3971.      memory object you can allocate because the arena may be fragmented. 
  3972.  
  3973.  29  QSV_MAXPROCESSES 
  3974.  
  3975.      Maximum number of concurrent processes supported. 
  3976.  
  3977.  30  QSV_VIRTUALADDRESSLIMIT 
  3978.  
  3979.      Size of the user's address space in megabytes (that is, the value of the 
  3980.      rounded VIRTUALADDRESSLIMIT) 
  3981.  
  3982.  30  QSV_MAX 
  3983.  
  3984.  Note:  Major, minor and revision numbers for versions of OS/2 operating system 
  3985.         are described below: 
  3986.  
  3987.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3988.   Γöé                ΓöéMajor           ΓöéMinor           ΓöéRevision        Γöé
  3989.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3990.   ΓöéOS/2 2.0        Γöé20              Γöé00              Γöé0               Γöé
  3991.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3992.   ΓöéOS/2 2.1        Γöé20              Γöé10              Γöé0               Γöé
  3993.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3994.   ΓöéOS/2 2.11       Γöé20              Γöé11              Γöé0               Γöé
  3995.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3996.   ΓöéOS/2 3.0        Γöé20              Γöé30              Γöé0               Γöé
  3997.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3998.   ΓöéOS/2 4.0        Γöé20              Γöé40              Γöé0               Γöé
  3999.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4000.  
  4001.  An application can specify file objects managed by an installable file system 
  4002.  that supports long file names.  Because some installable file systems support 
  4003.  longer names than others, the application should issue DosQuerySysInfo upon 
  4004.  initialization. 
  4005.  
  4006.  DosQuerySysInfo returns the maximum path length (QSV_MAX_PATH_LENGTH) 
  4007.  supported by the installed file system. The path length includes the drive 
  4008.  specifier (d:), the leading backslash ( \ ), and the trailing null character. 
  4009.  The value returned by DosQuerySysInfo can be used to allocate buffers for path 
  4010.  names returned by other functions, for example, DosFindFirst and DosFindNext. 
  4011.  
  4012.  Related Functions 
  4013.  
  4014.      DosCreateDir 
  4015.  
  4016.      DosFindFirst 
  4017.  
  4018.      DosFindNext 
  4019.  
  4020.      DosOpen 
  4021.  
  4022.      DosQueryCurrentDir 
  4023.  
  4024.      DosQueryFSInfo 
  4025.  
  4026.      DosQueryPathInfo 
  4027.  
  4028.      DosSearchPath 
  4029.  
  4030.      DosSetCurrentDir 
  4031.  
  4032.      DosSetPathInfo 
  4033.  
  4034.      DosSetFSInfo 
  4035.  
  4036.  Example Code 
  4037.  
  4038.  This example queries and displays the maximum length for a path name and the 
  4039.  total amount of physical memory in bytes. 
  4040.  
  4041.   #define INCL_DOSMISC       /* DOS Miscellaneous values */
  4042.   #define INCL_DOSERRORS     /* DOS Error values         */
  4043.   #include <os2.h>
  4044.   #include <stdio.h>
  4045.  
  4046.   int main(VOID)  {
  4047.  
  4048.   ULONG   aulSysInfo[QSV_MAX] = {0};       /* System Information Data Buffer */
  4049.   APIRET  rc                  = NO_ERROR;  /* Return code                    */
  4050.  
  4051.   rc = DosQuerySysInfo(1L,                 /* Request all available system   */
  4052.   QSV_MAX,            /* information                    */
  4053.   (PVOID)aulSysInfo,
  4054.   sizeof(ULONG)*QSV_MAX);
  4055.  
  4056.   if (rc != NO_ERROR) {
  4057.   printf("DosQuerySysInfo error: return code = %u\n", rc);
  4058.   return 1;
  4059.   } else {
  4060.   printf("Maximum length for a path name is %u characters.\n",
  4061.   aulSysInfo[QSV_MAX_PATH_LENGTH-1]);  /* Max length of path name */
  4062.  
  4063.   printf("Total physical memory is %u bytes.\n",
  4064.   aulSysInfo[QSV_TOTPHYSMEM-1]);       /* Total physical memory   */
  4065.   } /* endif */
  4066.  
  4067.   return NO_ERROR;
  4068.   }
  4069.  
  4070.  
  4071. ΓòÉΓòÉΓòÉ 2.15. DosQueryThreadAffinity ΓòÉΓòÉΓòÉ
  4072.  
  4073. Purpose 
  4074.  
  4075. DosQueryThreadAffinity allows a thread to inquire for the current thread's 
  4076. processor affinity mask and the system's capable processor affinity mask. 
  4077.  
  4078. Syntax 
  4079.  
  4080.  APIRET DosQueryThreadAffinity (ULONG scope, PMPAffinity pAffinityMask) 
  4081.  
  4082.  Parameters 
  4083.  
  4084.  scope(ULONG) -input 
  4085.  
  4086.            AFNTY_THREAD   Return the current threads processor affinity mask. 
  4087.  
  4088.            AFNTY_SYSTEM   Return the system's current capable processor 
  4089.                           affinity mask. 
  4090.  
  4091.  pAffinityMask(PMPAffinity) -input 
  4092.            Address of MPAffinity structure to receive the affinity mask. 
  4093.            Processors 0-31 are in mask [0] and processors 32-63 are in mask 
  4094.            [1]. 
  4095.  
  4096.  Returns 
  4097.  
  4098.  ulrc (APIRET) - returns 
  4099.            Return Code. 
  4100.  
  4101.            DosQueryThreadAffinity returns one of the following values: 
  4102.  
  4103.            13             ERROR_INVALID_DATA 
  4104.  
  4105.            87             ERROR_INVALID_PARAMETER 
  4106.  
  4107.  Remarks 
  4108.  
  4109.  DosQueryThreadAffinity allows a thread to ask the Processor Affinity Mask for: 
  4110.  
  4111.    1. The current thread's processor affinity mask, scope =AFNTY_THREAD, 
  4112.       returns qwThreadAffinity, for the calling thread. 
  4113.  
  4114.    2. The system's capable processor affinity mask, scope=AFNTY_SYSTEM, returns 
  4115.       qwCapableAffinity for the system. The caller may then use any subset of 
  4116.       the returned affinity mask to change the threads processor affinity in a 
  4117.       later call to DosSetThreadAffinity. 
  4118.  
  4119.  Related Functions 
  4120.  
  4121.      DosSetThreadAffinity 
  4122.  
  4123.  Example Code 
  4124.  
  4125.   #define INCL_DOS
  4126.   #define INCL_32
  4127.   #define INCL_DOSERRORS
  4128.   #define INCL_NOPMAPI
  4129.   #include <os2.h>
  4130.   #include <stdio.h>
  4131.  
  4132.   int main(void) {
  4133.   APIRET rc;
  4134.   MPAFFINITY affinity;
  4135.  
  4136.   rc = DosQueryThreadAffinity(AFNTY_SYSTEM, &affinity);
  4137.   printf("Query system's affinity: rc = %08.8xh\n",rc);
  4138.   printf("Query system's affinity: affinity[0] = %08.8xh, affinity[1] = %08.8xh\n",
  4139.           affinity.mask[0], affinity.mask[1]);
  4140.   return rc;
  4141.   }
  4142.  
  4143.  
  4144. ΓòÉΓòÉΓòÉ 2.16. DosSetFileInfo ΓòÉΓòÉΓòÉ
  4145.  
  4146. Purpose 
  4147.  
  4148. DosSetFileInfo sets file information. 
  4149.  
  4150. Syntax 
  4151.  
  4152. #define INCL_DOSFILEMGR
  4153. #include <os2.h>
  4154.  
  4155.  APIRET DosSetFileInfo (HFILE hf, ULONG ulInfoLevel, PVOID pInfoBuf, 
  4156.            ULONG cbInfoBuf) 
  4157.  
  4158.  Parameters 
  4159.  
  4160.  hf (HFILE) - input 
  4161.            File handle. 
  4162.  
  4163.  ulInfoLevel (ULONG) - input 
  4164.            Level of file information being set. 
  4165.  
  4166.            Specify a value: 
  4167.  
  4168.            1        FIL_STANDARD 
  4169.  
  4170.                     Level 1 file information 
  4171.  
  4172.            11       FIL_STANDARDL 
  4173.  
  4174.                     Level 11 file information 
  4175.  
  4176.            2        FIL_QUERYEASIZE 
  4177.  
  4178.                     Level 2 file information 
  4179.  
  4180.            The structures described in pInfoBuf indicate the information being 
  4181.            set for each of these levels. 
  4182.  
  4183.  pInfoBuf (PVOID) - input 
  4184.            Address of the storage area containing the structures for file 
  4185.            information levels. 
  4186.  
  4187.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) 
  4188.                     pInfoBuf contains the FILESTATUS3 data structure. 
  4189.  
  4190.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  4191.                     pInfo contains the FILESTATUS3L data structure, in which 
  4192.                     file information is returned. 
  4193.  
  4194.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) 
  4195.                     pInfoBuf contains an EAOP2 data structure, and sets a 
  4196.                     series of EA name/value pairs. 
  4197.  
  4198.                     Input        pInfoBuf is an EAOP2 data structure in which 
  4199.                                  fpFEA2List points to a data area where the 
  4200.                                  relevant FEA2LIST is to be found. fpGEA2List 
  4201.                                  and oError are ignored. 
  4202.  
  4203.                     Output       fpGEA2List and fpFEA2List are unchanged. The 
  4204.                                  area pointed to by fpFEA2List is also 
  4205.                                  unchanged. If an error occurred during the 
  4206.                                  set, oError is the offset of the FEA2 where 
  4207.                                  the error occurred. The return code is the 
  4208.                                  error code corresponding to the condition 
  4209.                                  generating the error. If no error occurred, 
  4210.                                  oError is undefined. 
  4211.  
  4212.  cbInfoBuf (ULONG) - input 
  4213.            The length, in bytes, of pInfoBuf. 
  4214.  
  4215.  Returns 
  4216.  
  4217.  ulrc (APIRET) - returns 
  4218.            Return Code. 
  4219.  
  4220.            DosSetFileInfo returns one of the following values: 
  4221.  
  4222.            0              NO_ERROR 
  4223.  
  4224.            1              ERROR_INVALID_FUNCTION 
  4225.  
  4226.            5              ERROR_ACCESS_DENIED 
  4227.  
  4228.            6              ERROR_INVALID_HANDLE 
  4229.  
  4230.            87             ERROR_INVALID_PARAMETER 
  4231.  
  4232.            122            ERROR_INSUFFICIENT_BUFFER 
  4233.  
  4234.            124            ERROR_INVALID_LEVEL 
  4235.  
  4236.            130            ERROR_DIRECT_ACCESS_HANDLE 
  4237.  
  4238.            254            ERROR_INVALID_EA_NAME 
  4239.  
  4240.            255            ERROR_EA_LIST_INCONSISTENT 
  4241.  
  4242.  Remarks 
  4243.  
  4244.  DosSetFileInfo is successful only when the file is opened for write access, 
  4245.  and access by other processes is prevented by a deny-both sharing mode. If the 
  4246.  file is already opened with conflicting sharing rights, any call to DosOpen 
  4247.  will fail. 
  4248.  
  4249.  A value of 0 in the date and time components of a field does not change the 
  4250.  field. For example, if both "last write date" and "last write time" are 
  4251.  specified as 0 in the Level 1 information structure, then both attributes of 
  4252.  the file are left unchanged. If either "last write date" or "last write time" 
  4253.  are other than 0, both attributes of the file are set to the new values. 
  4254.  
  4255.  In the FAT file system, only the dates and times of the last write can be 
  4256.  modified. Creation and last-access dates and times are not affected. 
  4257.  
  4258.  The last-modification date and time will be changed if the extended attributes 
  4259.  are modified. 
  4260.  
  4261.  Related Functions 
  4262.  
  4263.      DosClose 
  4264.  
  4265.      DosEnumAttribute 
  4266.  
  4267.      DosOpen 
  4268.  
  4269.      DosOpenL 
  4270.  
  4271.      DosQueryFileInfo 
  4272.  
  4273.      DosQueryPathInfo 
  4274.  
  4275.      DosResetBuffer 
  4276.  
  4277.      DosSetFileSize 
  4278.  
  4279.      DosSetFileSizeL 
  4280.  
  4281.      DosSetPathInfo 
  4282.  
  4283.  Example Code 
  4284.  
  4285.  This example creates a read-only file named "DOSFDEL.DAT", and then changes 
  4286.  the file attributes. It uses DosForceDelete to delete the file so it cannot be 
  4287.  restored using UNDELETE. 
  4288.  
  4289.   #define INCL_DOSFILEMGR   /* File Manager values */
  4290.   #define INCL_DOSERRORS    /* DOS error values    */
  4291.   #include <os2.h>
  4292.   #include <stdio.h>
  4293.  
  4294.   int main(VOID) {
  4295.  
  4296.   UCHAR       uchFileName[]   = "DOSFDEL.DAT";   /* File we want to delete    */
  4297.   HFILE       fhDelFile       = 0;               /* File handle from DosOpenL  */
  4298.   FILESTATUS3L fsts3FileInfo   = {{0}};  /* Information associated with file   */
  4299.   ULONG       ulBufferSize    = sizeof(FILESTATUS3L); /* File info buffer size */
  4300.   ULONG       ulOpenAction    = 0;                 /* Action taken by DosOpenL */
  4301.   APIRET      rc              = NO_ERROR;          /* Return code             */
  4302.  
  4303.   /* Create a read-only file */
  4304.  
  4305.   rc = DosOpenL(uchFileName, &fhDelFile,
  4306.   &ulOpenAction, (LONGLONG)10, FILE_READONLY,
  4307.   OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
  4308.   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, 0L);
  4309.   if (rc != NO_ERROR) {
  4310.   printf("DosOpenL error: return code = %u\n", rc);
  4311.   return 1;       }
  4312.  
  4313.   rc = DosQueryFileInfo(fhDelFile, FIL_STANDARDL,
  4314.   &fsts3FileInfo, ulBufferSize);  /* Get standard info */
  4315.   if (rc != NO_ERROR) {
  4316.   printf("DosQueryFileInfo error: return code = %u\n", rc);
  4317.   return 1;
  4318.   } else { printf("File %s created read-only.\n",uchFileName); }
  4319.  
  4320.   fsts3FileInfo.attrFile  = FILE_NORMAL;
  4321.   rc = DosSetFileInfo(fhDelFile, FIL_STANDARDL,
  4322.   &fsts3FileInfo, ulBufferSize);
  4323.   if (rc != NO_ERROR) {
  4324.   printf("DosSetFileInfo error: return code = %u\n", rc);
  4325.   return 1;
  4326.   }
  4327.  
  4328.   rc = DosClose(fhDelFile);
  4329.   /* should check (rc != NO_ERROR) here... */
  4330.  
  4331.   /* Delete the file */
  4332.  
  4333.   rc = DosForceDelete(uchFileName);
  4334.   if (rc != NO_ERROR) {
  4335.   printf("DosForceDelete error: return code = %u\n", rc);
  4336.   return 1;
  4337.   } else {
  4338.   printf("File %s has been deleted.\n",uchFileName);
  4339.   } /* endif */
  4340.  
  4341.   return NO_ERROR;
  4342.   }
  4343.  
  4344.  
  4345. ΓòÉΓòÉΓòÉ 2.17. DosSetFileLocksL ΓòÉΓòÉΓòÉ
  4346.  
  4347. Purpose 
  4348.  
  4349. DosSetFileLocksL locks and unlocks a range of an open file. 
  4350.  
  4351. Syntax 
  4352.  
  4353. #define INCL_DOSFILEMGR
  4354. #include <os2.h>
  4355.  
  4356.  APIRET DosSetFileLocksL (HFILE hFile, PFILELOCKL pflUnlock, 
  4357.            PFILELOCKL pflLock, ULONG timeout, ULONG flags) 
  4358.  
  4359.  Parameters 
  4360.  
  4361.  hFile (HFILE) - input 
  4362.            File handle. 
  4363.  
  4364.  pflUnlock (PFILELOCKL) - input 
  4365.            Address of the structure containing the offset and length of a range 
  4366.            to be unlocked. 
  4367.  
  4368.  pflLock (PFILELOCKL) - input 
  4369.            Address of the structure containing the offset and length of a range 
  4370.            to be locked. 
  4371.  
  4372.  timeout (ULONG) - input 
  4373.            The maximum time, in milliseconds, that the process is to wait for 
  4374.            the requested locks. 
  4375.  
  4376.  flags (ULONG) - input 
  4377.            Flags that describe the action to be taken. 
  4378.  
  4379.            This parameter has the following bit fields: 
  4380.  
  4381.            Bits           Description 
  4382.  
  4383.            31-2           Reserved flags 
  4384.  
  4385.            1              Atomic 
  4386.  
  4387.                           This bit defines a request for atomic locking. If 
  4388.                           this bit is set to 1 and the lock range is equal to 
  4389.                           the unlock range, an atomic lock occurs. If this bit 
  4390.                           is set to 1 and the lock range is not equal to the 
  4391.                           unlock range, an error is returned. 
  4392.  
  4393.                           If this bit is set to 0, then the lock may or may not 
  4394.                           occur atomically with the unlock. 
  4395.  
  4396.            0              Share 
  4397.  
  4398.                           This bit defines the type of access that other 
  4399.                           processes may have to the file range that is being 
  4400.                           locked. 
  4401.  
  4402.                           If this bit is set to 0 (the default), other 
  4403.                           processes have no access to the locked file range. 
  4404.                           The current process has exclusive access to the 
  4405.                           locked file range, which must not overlap any other 
  4406.                           locked file range. 
  4407.  
  4408.                           If this bit is set to 1, the current process and 
  4409.                           other processes have shared read-only access to the 
  4410.                           locked file range. A file range with shared access 
  4411.                           may overlap any other file range with shared access, 
  4412.                           but must not overlap any other file range with 
  4413.                           exclusive access. 
  4414.  
  4415.  Returns 
  4416.  
  4417.  ulrc (APIRET) - returns 
  4418.            Return Code. 
  4419.  
  4420.            DosSetFileLocksL returns one of the following values: 
  4421.  
  4422.            0              NO_ERROR 
  4423.  
  4424.            1              ERROR_INVALID_FUNCTION 
  4425.  
  4426.            6              ERROR_INVALID_HANDLE 
  4427.  
  4428.            33             ERROR_LOCK_VIOLATION 
  4429.  
  4430.            36             ERROR_SHARING_BUFFER_EXCEEDED 
  4431.  
  4432.            87             ERROR_INVALID_PARAMETER 
  4433.  
  4434.            95             ERROR_INTERRUPT 
  4435.  
  4436.            174            ERROR_ATOMIC_LOCK_NOT_SUPPORTED 
  4437.  
  4438.            175            ERROR_READ_LOCKS_NOT_SUPPORTED 
  4439.  
  4440.  Remarks 
  4441.  
  4442.  DosSetFileLocksL allows a process to lock and unlock a range in a file. The 
  4443.  time during which a file range is locked should be short. 
  4444.  
  4445.  If the lock and unlock ranges are both zero, ERROR_LOCK_VIOLATION is returned 
  4446.  to the caller. 
  4447.  
  4448.  If you only want to lock a file range, set the unlock file offset and the 
  4449.  unlock range length to zero. 
  4450.  
  4451.  If you only want to unlock a file range, set the lock file offset and the lock 
  4452.  range length to zero. 
  4453.  
  4454.  When the Atomic bit of flags is set to 0, and DosSetFileLocksL specifies a 
  4455.  lock operation and an unlock operation, the unlock operation occurs first, and 
  4456.  then the lock operation is performed. If an error occurs during the unlock 
  4457.  operation, an error code is returned and the lock operation is not performed. 
  4458.  If an error occurs during the lock operation, an error code is returned and 
  4459.  the unlock remains in effect if it was successful. 
  4460.  
  4461.  The lock operation is atomic when all of these conditions are met: 
  4462.  
  4463.      The Atomic bit is set to 1 in flags 
  4464.  
  4465.      The unlock range is the same as the lock range 
  4466.  
  4467.      The process has shared access to the file range, and has requested 
  4468.       exclusive access to it; or the process has exclusive access to the file 
  4469.       range, and has requested shared access to it. 
  4470.  
  4471.  Some file system drivers (FSDs) may not support atomic lock operations. 
  4472.  Versions of the operating system prior to OS/2 Version 2.00 do not support 
  4473.  atomic lock operations. If the application receives the error code 
  4474.  ERROR_ATOMIC_LOCK_NOT_SUPPORTED, the application should unlock the file range 
  4475.  and then lock it using a non-atomic operation (with the atomic bit set to 0 in 
  4476.  flags). The application should also refresh its internal buffers before making 
  4477.  any changes to the file. 
  4478.  
  4479.  If you issue DosClose to close a file with locks still in effect, the locks 
  4480.  are released in no defined sequence. 
  4481.  
  4482.  If you end a process with a file open, and you have locks in effect in that 
  4483.  file, the file is closed and the locks are released in no defined sequence. 
  4484.  
  4485.  The locked range can be anywhere in the logical file. Locking beyond the end 
  4486.  of the file is not an error. A file range to be locked exclusively must first 
  4487.  be cleared of any locked file subranges or overlapping locked file ranges. 
  4488.  
  4489.  If you repeat DosSetFileLocksL for the same file handle and file range, then 
  4490.  you duplicate access to the file range. Access to locked file ranges is not 
  4491.  duplicated across DosExecPgm. The proper method of using locks is to attempt 
  4492.  to lock the file range, and to examine the return value. 
  4493.  
  4494.  The following table shows the level of access granted when the accessed file 
  4495.  range is locked with an exclusive lock or a shared lock. "Owner" refers to a 
  4496.  process that owns the lock. "Non-owner" refers to a process that does not own 
  4497.  the lock. 
  4498.  
  4499.  
  4500.    Action        Exclusive Lock             Shared Lock
  4501.  
  4502.    Owner read    Success                    Success
  4503.  
  4504.    Non-owner     Wait for unlock. Return    Success
  4505.    read          error code after time-out.
  4506.  
  4507.    Owner write   Success                    Wait for unlock. Return
  4508.                                             error code after time-out.
  4509.  
  4510.    Non-owner     Wait for unlock. Return    Wait for unlock. Return
  4511.    write         error code after time-out. error code after time-out.
  4512.  
  4513.  If only locking is specified, DosSetFileLocksL locks the specified file range 
  4514.  using pflLock. If the lock operation cannot be accomplished, an error is 
  4515.  returned, and the file range is not locked. 
  4516.  
  4517.  After the lock request is processed, a file range can be unlocked using the 
  4518.  pflUnlock parameter of another DosSetFileLocksL request. If unlocking cannot 
  4519.  be accomplished, an error is returned. 
  4520.  
  4521.  Instead of denying read/write access to an entire file by specifying access 
  4522.  and sharing modes with DosOpenL requests, a process attempts to lock only the 
  4523.  range needed for read/write access and examines the error code returned. 
  4524.  
  4525.  Once a specified file range is locked exclusively, read and write access by 
  4526.  another process is denied until the file range is unlocked. If both unlocking 
  4527.  and locking are specified by DosSetFileLocksL, the unlocking operation is 
  4528.  performed first, then locking is done. 
  4529.  
  4530.  Related Functions 
  4531.  
  4532.      DosCancelLockRequestL 
  4533.  
  4534.      DosDupHandle 
  4535.  
  4536.      DosExecPgm 
  4537.  
  4538.      DosOpenL 
  4539.  
  4540.  Example Code 
  4541.  
  4542.  This example opens or creates and opens a file named "FLOCK.DAT," and updates 
  4543.  it using file locks. 
  4544.  
  4545.   #define INCL_DOSFILEMGR       /* File Manager values */
  4546.   #define INCL_DOSERRORS        /* DOS Error values    */
  4547.   #include <os2.h>
  4548.   #include <stdio.h>
  4549.   #include <string.h>
  4550.  
  4551.   int main(VOID) {
  4552.  
  4553.   HFILE     FileHandle   = NULLHANDLE;  /* File handle */
  4554.   ULONG     Action       = 0,           /* Action taken by DosOpenL */
  4555.   Wrote        = 0,           /* Number of bytes written by DosWrite */
  4556.   i            = 0;           /* Loop index */
  4557.   CHAR      FileData[40] = "Forty bytes of demonstration text data\r\n";
  4558.   APIRET    rc           = NO_ERROR;    /* Return code */
  4559.   FILELOCKL  LockArea     = {0},         /* Area of file to lock */
  4560.   UnlockArea   = {0};         /* Area of file to unlock */
  4561.  
  4562.   rc = DosOpenL("flock.dat",                   /* File to open */
  4563.   &FileHandle,                   /* File handle */
  4564.   &Action,                       /* Action taken */
  4565.   (LONGLONG)4000,                /* File primary allocation */
  4566.   FILE_ARCHIVED,                 /* File attributes */
  4567.   FILE_OPEN | FILE_CREATE,       /* Open function type */
  4568.   OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE,
  4569.   0L);                           /* No extended attributes */
  4570.   if (rc != NO_ERROR) {                       /* If open failed */
  4571.   printf("DosOpenL error: return code = %u\n", rc);
  4572.   return 1;
  4573.   }
  4574.   LockArea.lOffset = 0;              /* Start locking at beginning of file */
  4575.   LockArea.lRange =  40;             /* Use a lock range of 40 bytes       */
  4576.   UnLockArea.lOffset = 0;            /* Start unlocking at beginning of file */
  4577.   UnLockArea.lRange =  0;            /* Use a unlock range of 0 bytes       */
  4578.  
  4579.   /* Write 8000 bytes to the file, 40 bytes at a time */
  4580.   for (i=0; i<200; ++i) {
  4581.   rc = DosSetFileLocksL(FileHandle,        /* File handle   */
  4582.   &UnlockArea,       /* Unlock previous record (if any) */
  4583.   &LockArea,         /* Lock current record */
  4584.   2000L,             /* Lock time-out value of 2 seconds */
  4585.   0L);               /* Exclusive lock, not atomic */
  4586.   if (rc != NO_ERROR) {
  4587.   printf("DosSetFileLocksL error: return code = %u\n", rc);
  4588.   return 1;
  4589.   }
  4590.  
  4591.   rc = DosWrite(FileHandle, FileData, sizeof(FileData), &Wrote);
  4592.   if (rc != NO_ERROR) {
  4593.   printf("DosWrite error: return code = %u\n", rc);
  4594.   return 1;
  4595.   }
  4596.  
  4597.   UnlockArea = LockArea;      /* Will unlock this record on next iteration */
  4598.   LockArea.lOffset += 40;     /* Prepare to lock next record               */
  4599.  
  4600.   } /* endfor - 8000 bytes written */
  4601.   rc = DosClose(FileHandle);    /* Close file, this releases outstanding locks */
  4602.   /* Should check if (rc != NO_ERROR) here ... */
  4603.   return NO_ERROR;
  4604.   }
  4605.  
  4606.  
  4607. ΓòÉΓòÉΓòÉ 2.18. DosSetFilePtrL ΓòÉΓòÉΓòÉ
  4608.  
  4609. Purpose 
  4610.  
  4611. DosSetFilePtrL moves the read/write pointer according to the type of move 
  4612. specified. 
  4613.  
  4614. Syntax 
  4615.  
  4616. #define INCL_DOSFILEMGR
  4617. #include <os2.h>
  4618.  
  4619.  APIRET DosSetFilePtrL (HFILE hFile, LONGLONG ib, ULONG method, 
  4620.            PLONGLONG ibActual) 
  4621.  
  4622.  Parameters 
  4623.  
  4624.  hFile (HFILE) - input 
  4625.            The handle returned by a previous DosOpenL function. 
  4626.  
  4627.  ib (LONGLONG) - input 
  4628.            The signed distance (offset) to move, in bytes. 
  4629.  
  4630.  method (ULONG) - input 
  4631.            The method of moving. 
  4632.  
  4633.            Specifies a location in the file from where the ib to move the 
  4634.            read/write pointer starts. The values and their meanings are 
  4635.            described in the following list: 
  4636.  
  4637.            0        FILE_BEGIN 
  4638.  
  4639.                     Move the pointer from the beginning of the file. 
  4640.  
  4641.            1        FILE_CURRENT 
  4642.  
  4643.                     Move the pointer from the current location of the 
  4644.                     read/write pointer. 
  4645.  
  4646.            2        FILE_END 
  4647.  
  4648.                     Move the pointer from the end of the file. Use this method 
  4649.                     to determine a file's size. 
  4650.  
  4651.  ibActual (PLONGLONG) - output 
  4652.            Address of the new pointer location. 
  4653.  
  4654.  Returns 
  4655.  
  4656.  ulrc (APIRET) - returns 
  4657.            Return Code. 
  4658.  
  4659.            DosSetFilePtrL returns one of the following values: 
  4660.  
  4661.            0              NO_ERROR 
  4662.  
  4663.            1              ERROR_INVALID_FUNCTION 
  4664.  
  4665.            6              ERROR_INVALID_HANDLE 
  4666.  
  4667.            132            ERROR_SEEK_ON_DEVICE 
  4668.  
  4669.            131            ERROR_NEGATIVE_SEEK 
  4670.  
  4671.            130            ERROR_DIRECT_ACCESS_HANDLE 
  4672.  
  4673.  Remarks 
  4674.  
  4675.  The read/write pointer in a file is a signed 64-bit number. A negative value 
  4676.  for ib moves the pointer backward in the file; a positive value moves it 
  4677.  forward. DosSetFilePtrL cannot be used to move to a negative position in the 
  4678.  file. 
  4679.  
  4680.  DosSetFilePtrL cannot be used for a character device or pipe. 
  4681.  
  4682.  Related Functions 
  4683.  
  4684.      DosOpenL 
  4685.  
  4686.      DosRead 
  4687.  
  4688.      DosSetFileSizeL 
  4689.  
  4690.      DosWrite 
  4691.  
  4692.  Example Code 
  4693.  
  4694.  This example opens or creates and opens a file named "DOSTEST.DAT", writes to 
  4695.  it, positions the file pointer back to the beginning of the file, reads from 
  4696.  the file, and finally closes it. 
  4697.  
  4698.   #define INCL_DOSFILEMGR          /* File Manager values */
  4699.   #define INCL_DOSERRORS           /* DOS Error values    */
  4700.   #include <os2.h>
  4701.   #include <stdio.h>
  4702.   #include <string.h>
  4703.  
  4704.   int main(void) {
  4705.   HFILE  hfFileHandle   = 0L;     /* Handle for file being manipulated */
  4706.   ULONG  ulAction       = 0;      /* Action taken by DosOpenL */
  4707.   ULONG  ulBytesRead    = 0;      /* Number of bytes read by DosRead */
  4708.   ULONG  ulWrote        = 0;      /* Number of bytes written by DosWrite */
  4709.   LONGLONG  ullLocal    = 0;      /* File pointer position after DosSetFilePtr */
  4710.   UCHAR  uchFileName[20]  = "dostest.dat",     /* Name of file */
  4711.   uchFileData[100] = " ";               /* Data to write to file */
  4712.   APIRET rc             = NO_ERROR;            /* Return code */
  4713.  
  4714.   /* Open the file test.dat.  Use an existing file or create a new */
  4715.   /* one if it doesn't exist.                                      */
  4716.   rc = DosOpenL(uchFileName,                    /* File path name */
  4717.   &hfFileHandle,                  /* File handle */
  4718.   &ulAction,                      /* Action taken */
  4719.   (LONGLONG)100,                  /* File primary allocation */
  4720.   FILE_ARCHIVED | FILE_NORMAL,    /* File attribute */
  4721.   OPEN_ACTION_CREATE_IF_NEW |
  4722.   OPEN_ACTION_OPEN_IF_EXISTS,     /* Open function type */
  4723.   OPEN_FLAGS_NOINHERIT |
  4724.   OPEN_SHARE_DENYNONE  |
  4725.   OPEN_ACCESS_READWRITE,          /* Open mode of the file */
  4726.   0L);                            /* No extended attribute */if (rc != NO_ERROR) {
  4727.   printf("DosOpenL error: return code = %u\n", rc);
  4728.   return 1;
  4729.   } else {
  4730.   printf ("DosOpenL: Action taken = %ld\n", ulAction);
  4731.   } /* endif */
  4732.  
  4733.   /* Write a string to the file */
  4734.   strcpy (uchFileData, "testing...\n1...\n2...\n3\n");
  4735.  
  4736.   rc = DosWrite (hfFileHandle,                /* File handle */
  4737.   (PVOID) uchFileData,         /* String to be written */
  4738.   sizeof (uchFileData),        /* Size of string to be written */
  4739.   &ulWrote);                   /* Bytes actually written */
  4740.  
  4741.   if (rc != NO_ERROR) {
  4742.   printf("DosWrite error: return code = %u\n", rc);
  4743.   return 1;
  4744.   } else {
  4745.   printf ("DosWrite: Bytes written = %u\n", ulWrote);
  4746.   } /* endif */
  4747.  
  4748.   /* Move the file pointer back to the beginning of the file */
  4749.   rc = DosSetFilePtrL (hfFileHandle,           /* File Handle */
  4750.   (LONGLONG)0,            /* Offset */
  4751.   FILE_BEGIN,             /* Move from BOF */
  4752.   &ullLocal);             /* New location address */
  4753.   if (rc != NO_ERROR) {
  4754.   printf("DosSetFilePtrL error: return code = %u\n", rc);
  4755.   return 1;
  4756.   }
  4757.  
  4758.   /* Read the first 100 bytes of the file */
  4759.   rc = DosRead (hfFileHandle,                /* File Handle */
  4760.   uchFileData,                 /* String to be read */
  4761.   100L,                        /* Length of string to be read */
  4762.   &ulBytesRead);               /* Bytes actually read */
  4763.  
  4764.   if (rc != NO_ERROR) {
  4765.   printf("DosRead error: return code = %u\n", rc);
  4766.   return 1;
  4767.   } else {
  4768.   printf ("DosRead: Bytes read = %u\n%s\n", ulBytesRead, uchFileData);
  4769.   } /* endif */
  4770.  
  4771.   rc = DosClose(hfFileHandle);                /* Close the file */
  4772.  
  4773.   if (rc != NO_ERROR) {
  4774.   printf("DosClose error: return code = %u\n", rc);
  4775.   return 1;
  4776.   }
  4777.   return NO_ERROR;
  4778.   }
  4779.  
  4780.  
  4781. ΓòÉΓòÉΓòÉ 2.19. DosSetFileSizeL ΓòÉΓòÉΓòÉ
  4782.  
  4783. Purpose 
  4784.  
  4785. DosSetFileSizeL changes the size of a file. 
  4786.  
  4787. Syntax 
  4788.  
  4789. #define INCL_DOSFILEMGR
  4790. #include <os2.h>
  4791.  
  4792.  APIRET DosSetFileSizeL (HFILE hFile, LONGLONG cbSize) 
  4793.  
  4794.  Parameters 
  4795.  
  4796.  hFile (HFILE) - input 
  4797.            The handle of the file whose size to be changed. 
  4798.  
  4799.  cbSize (LONGLONG) - input 
  4800.            The new size, in bytes, of the file. 
  4801.  
  4802.  Returns 
  4803.  
  4804.  ulrc (APIRET) - returns 
  4805.            Return Code. 
  4806.  
  4807.            DosSetFileSizeL returns one of the following values: 
  4808.  
  4809.            0              NO_ERROR 
  4810.  
  4811.            5              ERROR_ACCESS_DENIED 
  4812.  
  4813.            6              ERROR_INVALID_HANDLE 
  4814.  
  4815.            26             ERROR_NOT_DOS_DISK 
  4816.  
  4817.            33             ERROR_LOCK_VIOLATION 
  4818.  
  4819.            87             ERROR_INVALID_PARAMETER 
  4820.  
  4821.            112            ERROR_DISK_FULL 
  4822.  
  4823.  Remarks 
  4824.  
  4825.  When DosSetFileSizeL is issued, the file must be open in a mode that allows 
  4826.  write access. 
  4827.  
  4828.  The size of the open file can be truncated or extended. If the file size is 
  4829.  being extended, the file system tries to allocate additional bytes in a 
  4830.  contiguous (or nearly contiguous) space on the medium. The values of the new 
  4831.  bytes are undefined. 
  4832.  
  4833.  Related Functions 
  4834.  
  4835.      DosOpenL 
  4836.  
  4837.      DosQueryFileInfo 
  4838.  
  4839.      DosQueryPathInfo 
  4840.  
  4841.  Example Code 
  4842.  
  4843.  This example writes to a file named "DOSMAN.DAT", resets the buffer, and 
  4844.  changes the file size. 
  4845.  
  4846.   #define INCL_DOSFILEMGR          /* File Manager values */
  4847.   #define INCL_DOSERRORS           /* DOS Error values    */
  4848.   #include <os2.h>
  4849.   #include <stdio.h>
  4850.   #include <string.h>
  4851.  
  4852.   int main(VOID) {
  4853.   HFILE  hfFileHandle   = 0L;     /* Handle for file being manipulated */
  4854.   ULONG  ulAction       = 0;      /* Action taken by DosOpenL */
  4855.   ULONG  ulWrote        = 0;      /* Number of bytes written by DosWrite */
  4856.   UCHAR  uchFileName[20]  = "dosman.dat",     /* Name of file */
  4857.   uchFileData[4]   = "DATA";            /* Data to write to file */
  4858.   APIRET rc             = NO_ERROR;            /* Return code */
  4859.  
  4860.   /* Open the file dosman.dat.  Use an existing file or create a new */
  4861.   /* one if it doesn't exist.                                      */
  4862.   rc = DosOpenL(uchFileName, &hfFileHandle, &ulAction, (LONGLONG)4,
  4863.   FILE_ARCHIVED | FILE_NORMAL,
  4864.   OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
  4865.   OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYNONE  |
  4866.   OPEN_ACCESS_READWRITE, 0L);
  4867.   if (rc != NO_ERROR) {
  4868.   printf("DosOpenL error: return code = %u\n", rc);
  4869.   return 1;
  4870.   }
  4871.  
  4872.   rc = DosWrite (hfFileHandle, (PVOID) uchFileData,
  4873.   sizeof (uchFileData), &ulWrote);
  4874.   if (rc != NO_ERROR) {
  4875.   printf("DosWrite error: return code = %u\n", rc);
  4876.   return 1;
  4877.   }
  4878.  
  4879.   rc = DosResetBuffer (hfFileHandle);
  4880.   if (rc != NO_ERROR) {
  4881.   printf("DosResetBuffer error: return code = %u\n", rc);
  4882.   return 1;
  4883.   } /* endif */
  4884.  
  4885.   rc = DosSetFileSizeL (hfFileHandle, (LONGLONG)8);    /* Change file size */
  4886.   if (rc != NO_ERROR) {
  4887.   printf("DosSetFileSizeL error: return code = %u\n", rc);
  4888.   return 1;
  4889.   }
  4890.  
  4891.   return NO_ERROR;
  4892.   }
  4893.  
  4894.  
  4895. ΓòÉΓòÉΓòÉ 2.20. DosSetPathInfo ΓòÉΓòÉΓòÉ
  4896.  
  4897. Purpose 
  4898.  
  4899. DosSetPathInfo sets information for a file or directory. 
  4900.  
  4901. Syntax 
  4902.  
  4903. #define INCL_DOSFILEMGR
  4904. #include <os2.h>
  4905.  
  4906.  APIRET DosSetPathInfo (PSZ pszPathName, ULONG ulInfoLevel, PVOID pInfoBuf, 
  4907.            ULONG cbInfoBuf, ULONG flOptions) 
  4908.  
  4909.  Parameters 
  4910.  
  4911.  pszPathName (PSZ) - input 
  4912.            Address of the ASCIIZ full path name of the file or subdirectory. 
  4913.  
  4914.            Global file-name characters are not permitted. 
  4915.  
  4916.            DosQuerySysInfo is called by an application during initialization to 
  4917.            determine the maximum path length allowed by the operating system. 
  4918.  
  4919.  ulInfoLevel (ULONG) - input 
  4920.            The level of file directory information being defined. 
  4921.  
  4922.            A value of 1, 11, or 2 can be specified, as shown in the following 
  4923.            list. 
  4924.  
  4925.            1        FIL_STANDARD 
  4926.  
  4927.                     Level 1 file information 
  4928.  
  4929.            11       FIL_STANDARDL 
  4930.  
  4931.                     Level 11 file information 
  4932.  
  4933.            2        FIL_QUERYEASIZE 
  4934.  
  4935.                     Level 2 file information 
  4936.  
  4937.            The structures described in pInfoBuf indicate the information being 
  4938.            set for each of these levels. 
  4939.  
  4940.  pInfoBuf (PVOID) - input 
  4941.            Address of the storage area containing the file information being 
  4942.            set. 
  4943.  
  4944.            Level 1 File Information (ulInfoLevel == FIL_STANDARD) 
  4945.                     pInfoBuf contains the FILESTATUS3 data structure. 
  4946.  
  4947.            Level 11 File Information (ulInfoLevel == FIL_STANDARDL) 
  4948.                     pInfo contains the FILESTATUS3L data structure, to which 
  4949.                     file information is returned. 
  4950.  
  4951.            Level 2 File Information (ulInfoLevel == FIL_QUERYEASIZE) 
  4952.                     pInfoBuf contains an EAOP2 data structure. 
  4953.  
  4954.                     Level 2 sets a series of extended attribute (EA) name/value 
  4955.                     pairs. 
  4956.  
  4957.                     Input        pInfoBuf contains an EAOP2 data structure. 
  4958.                                  fpGEA2List is ignored. fpFEA2List points to a 
  4959.                                  data area where the relevant FEA2 list is to 
  4960.                                  be found. oError is ignored. The FEA2 data 
  4961.                                  structures must be aligned on a doubleword 
  4962.                                  boundary. Each oNextEntryOffset field must 
  4963.                                  contain the number of bytes from the beginning 
  4964.                                  of the current entry to the beginning of the 
  4965.                                  next entry in the FEA2 list. The 
  4966.                                  oNextEntryOffset field in the last entry of 
  4967.                                  the FEA2 list must be zero. 
  4968.  
  4969.                     Output       fpGEA2List and fpFEA2List are unchanged. The 
  4970.                                  area that fpFEA2List points to is unchanged. 
  4971.                                  If an error occurred during the set, oError is 
  4972.                                  the offset of the FEA2 entry where the error 
  4973.                                  occurred. The return code is the error code 
  4974.                                  corresponding to the condition that caused the 
  4975.                                  error. If no error occurred, oError is 
  4976.                                  undefined. 
  4977.  
  4978.  cbInfoBuf (ULONG) - input 
  4979.            The length, in bytes, of pInfoBuf. 
  4980.  
  4981.  flOptions (ULONG) - input 
  4982.            Information on how the set operation is to be performed. 
  4983.  
  4984.            If flOptions is 0x00000010 (DSPI_WRTTHRU), then all the information, 
  4985.            including extended attributes (EAs), must be written to the disk 
  4986.            before returning to the application. This guarantees that the EAs 
  4987.            have been written to the disk. All other bits are reserved, and must 
  4988.            be zero. 
  4989.  
  4990.  Returns 
  4991.  
  4992.  ulrc (APIRET) - returns 
  4993.            Return Code. 
  4994.  
  4995.            DosSetPathInfo returns one of the following values: 
  4996.  
  4997.            0              NO_ERROR 
  4998.  
  4999.            2              ERROR_FILE_NOT_FOUND 
  5000.  
  5001.            3              ERROR_PATH_NOT_FOUND 
  5002.  
  5003.            32             ERROR_SHARING_VIOLATION 
  5004.  
  5005.            87             ERROR_INVALID_PARAMETER 
  5006.  
  5007.            124            ERROR_INVALID_LEVEL 
  5008.  
  5009.            206            ERROR_FILENAME_EXCED_RANGE 
  5010.  
  5011.            122            ERROR_INSUFFICIENT_BUFFER 
  5012.  
  5013.            254            ERROR_INVALID_EA_NAME 
  5014.  
  5015.            255            ERROR_EA_LIST_INCONSISTENT 
  5016.  
  5017.  Remarks 
  5018.  
  5019.  To use DosSetPathInfo to set any level of file information for a file or 
  5020.  subdirectory, a process must have exclusive write access to the closed file 
  5021.  object. Thus, if the file object is already accessed by another process, any 
  5022.  call to DosSetPathInfo will fail. 
  5023.  
  5024.  A value of 0 in the date and time components of a field causes that field to 
  5025.  be left unchanged. For example, if both "last write date" and "last write 
  5026.  time" are specified as 0 in the Level 1 information structure, then both 
  5027.  attributes of the file are left unchanged. If either "last write date" or 
  5028.  "last write time" are other than 0, then both attributes of the file are set 
  5029.  to the new values. 
  5030.  
  5031.  For data integrity purposes, the Write-Through bit in flOptions should be used 
  5032.  only to write the extended attributes to the disk immediately, instead of 
  5033.  caching them and writing them later. Having the Write-Through bit set 
  5034.  constantly can degrade performance. 
  5035.  
  5036.  In the FAT file system, only the dates and times of the last write can be 
  5037.  modified. Creation and last-access dates and times are not affected. 
  5038.  
  5039.  The last-modification date and time will be changed if the extended attributes 
  5040.  are modified. 
  5041.  
  5042.  Related Functions 
  5043.  
  5044.      DosEnumAttribute 
  5045.  
  5046.      DosQueryFileInfo 
  5047.  
  5048.      DosQueryPathInfo 
  5049.  
  5050.      DosQuerySysInfo 
  5051.  
  5052.      DosSetFileInfo 
  5053.  
  5054.  Example Code 
  5055.  
  5056.  This example creates a directory named "HIDEME", makes it hidden, and finally 
  5057.  deletes it. 
  5058.  
  5059.   #define INCL_DOSFILEMGR   /* File Manager values */
  5060.   #define INCL_DOSERRORS    /* DOS Error values    */
  5061.   #include <os2.h>
  5062.   #include <stdio.h>
  5063.   #include <string.h>
  5064.  
  5065.   int main(VOID) {
  5066.   UCHAR       achNewDir[256]  = "\\HIDEME";           /* Directory name    */
  5067.   FILESTATUS3 fsts3PathInfo   = {{0}};                /* Directory info    */
  5068.   ULONG       ulBufferSize    = sizeof(FILESTATUS3);  /* Buffer size       */
  5069.   APIRET      rc              = NO_ERROR;             /* Return code       */
  5070.  
  5071.   rc = DosCreateDir(achNewDir, (PEAOP2) NULL);        /* Create directory
  5072.   with no EAs       */
  5073.   if (rc != NO_ERROR) {
  5074.   printf("DosCreateDir error: return code = %u\n", rc);
  5075.   return 1;
  5076.   } else {
  5077.   printf("Directory %s created.\n",achNewDir);
  5078.   }
  5079.  
  5080.   rc = DosQueryPathInfo(achNewDir, FIL_STANDARD,
  5081.   &fsts3PathInfo, ulBufferSize); /* Get standard info */
  5082.   if (rc != NO_ERROR) {
  5083.   printf("DosQueryPathInfo error: return code = %u\n", rc);
  5084.   return 1;
  5085.   }
  5086.  
  5087.   fsts3PathInfo.attrFile  = FILE_HIDDEN;   /* Add HIDDEN attribute to path */
  5088.  
  5089.   rc = DosSetPathInfo(achNewDir,           /* Change directory info on     */
  5090.   FIL_STANDARD,                            /* the disk using the buffer    */
  5091.   &fsts3PathInfo,                   /*just updated.             */
  5092.   ulBufferSize,
  5093.   DSPI_WRTTHRU );      /* Write data before returning  */
  5094.   if (rc != NO_ERROR) {
  5095.   printf("DosSetPathInfo error: return code = %u\n", rc);
  5096.   return 1;
  5097.   } else {
  5098.   printf("Directory %s hidden.\n",achNewDir);
  5099.   }/* Delete the hidden directory.  If this step is omitted, the directory
  5100.   can still be manipulated by standard OS/2 commands like CHDIR and
  5101.   RMDIR, it will just not be displayed in a DIR command without the
  5102.   /AH display option specified.                                     */
  5103.  
  5104.   rc = DosDeleteDir (achNewDir);
  5105.   if (rc != NO_ERROR) {
  5106.   printf ("DosDeleteDir error : return code = %u\n", rc);
  5107.   return 1;
  5108.   } else {
  5109.   printf("Directory %s deleted.\n",achNewDir);
  5110.   }
  5111.  
  5112.   return NO_ERROR;
  5113.   }
  5114.  
  5115.  
  5116. ΓòÉΓòÉΓòÉ 2.21. DosSetThreadAffinity ΓòÉΓòÉΓòÉ
  5117.  
  5118. Purpose 
  5119.  
  5120. DosSetThreadAffinity allows the calling thread to change the processor affinity 
  5121. mask for the current thread. 
  5122.  
  5123. Syntax 
  5124.  
  5125.  APIRET DosSetThreadAffinity (PMPAffinity pAffinityMask) 
  5126.  
  5127.  Parameters 
  5128.  
  5129.  pAffinityMask (PMPAffinity) - input 
  5130.            Address of an MPAFFINITY structure that will become the current 
  5131.            thread's affinity mask. 
  5132.  
  5133.  Returns 
  5134.  
  5135.  ulrc (APIRET) - returns 
  5136.            Return Code. 
  5137.  
  5138.            DosSetThreadAffinity returns one of the following values: 
  5139.  
  5140.            13             ERROR_INVALID_DATA 
  5141.  
  5142.            87             ERROR_INVALID_PARAMETER 
  5143.  
  5144.  Remarks 
  5145.  
  5146.  The processor affinity mask contains 1 bit per processor. A maximum of 64 
  5147.  processors can be designated. If affinity bits are on for non-existent 
  5148.  processors, the error ERROR_INVALID_DATA will be returned. 
  5149.  
  5150.  Related Functions 
  5151.  
  5152.      DosQueryThreadAffinity 
  5153.  
  5154.  Example Code 
  5155.  
  5156.   #define INCL_DOS
  5157.   #define INCL_32
  5158.   #define INCL_DOSERRORS
  5159.   #define INCL_NOPMAPI
  5160.   #include <os2.h>
  5161.   #include <stdio.h>
  5162.  
  5163.   int main(void)
  5164.   {
  5165.   APIRET rc;
  5166.   MPAFFINITY affinity;
  5167.  
  5168.   rc = DosSetThreadAffinity(&affinity);
  5169.   printf("Set thread's affinity: rc = %08.8xh\n", rc);
  5170.   printf("Set thread's affinity: affinity[0] = %08.8xh, affinity[1] = %08.8xh\n",
  5171.           affinity.mask[0], affinity.mask[1]);
  5172.   return rc;
  5173.   }
  5174.  
  5175.  
  5176. ΓòÉΓòÉΓòÉ 3. Raw I/O File System APIs ΓòÉΓòÉΓòÉ
  5177.  
  5178. This chapter contains an alphabetic list of the following Raw File System APIs. 
  5179.  
  5180.      DosClose 
  5181.  
  5182.      DosListIO 
  5183.  
  5184.      DosOpen 
  5185.  
  5186.      DosRead 
  5187.  
  5188.      DosSetFilePtr 
  5189.  
  5190.      DosWrite 
  5191.  
  5192.  The OS/2 raw file system provides an interface for applications to manage data 
  5193.  efficiently on the logical partitions or physical hard drives installed in a 
  5194.  system.  Some of the raw file system function is available by using a 
  5195.  combination of the DosPhysicalDisk and DosDevIOCtl application programming 
  5196.  interfaces. 
  5197.  
  5198.  The OS/2 raw file system provides a programming abstraction that treats each 
  5199.  logical partition or physical disk as one large file that can be opened, 
  5200.  locked, seeked, read from, written to, and closed. Logical partitions are 
  5201.  identified using the Universal Naming Convention (UNC) in the form of 
  5202.  '\\.\X:', where 'X' can be substituted with the letter corresponding the 
  5203.  logical partition desired on any hard drive, floppy disk or CD-ROM drive. 
  5204.  Physical disks are identified using UNC naming in the form of 
  5205.  '\\.\Physical_Disk#', where '#' is replaced with the physical disk number 
  5206.  corresponding to the number found in the LVM command. The combination of the 
  5207.  naming convention and use of the common file system application programming 
  5208.  interfaces (APIs) provides a greatly simplified migration path for 
  5209.  applications. 
  5210.  
  5211.  Traditionally, raw file systems have been utilized by applications that manage 
  5212.  large amounts of data under heavy workloads. Typically, this has been 
  5213.  commercial database servers performing on-line transaction processing.  Disk 
  5214.  I/O can become a bottleneck under these conditions and the use of an efficient 
  5215.  raw file system can be very useful in improving system performance, through 
  5216.  reduced path length and serialization. 
  5217.  
  5218.  
  5219. ΓòÉΓòÉΓòÉ 3.1. DosClose ΓòÉΓòÉΓòÉ
  5220.  
  5221. Purpose 
  5222.  
  5223. DosClose closes a handle to a disk. 
  5224.  
  5225. Syntax 
  5226.  
  5227. #define INCL_DOSFILEMGR
  5228. #include <os2.h>
  5229.  
  5230.  APIRET DosClose (HFILE hFile) 
  5231.  
  5232.  Parameters 
  5233.  
  5234.  hFile (HFILE) - input 
  5235.            The handle returned by DosOpen. 
  5236.  
  5237.  Returns 
  5238.  
  5239.  ulrc (APIRET) - returns 
  5240.            Return Code. 
  5241.  
  5242.            DosClose returns one of the following values: 
  5243.  
  5244.            0              NO_ERROR 
  5245.  
  5246.            2               ERROR_FILE_NOT_FOUND 
  5247.  
  5248.            5              ERROR_ACCESS_DENIED 
  5249.  
  5250.            6              ERROR_INVALID_HANDLE 
  5251.  
  5252.  Remarks 
  5253.  
  5254.  The disk can no longer be accessed using this handle. If opened with the 
  5255.  OPEN_SHARE_DENYREADWRITE flag, the disk is unlocked. 
  5256.  
  5257.  Related Functions 
  5258.  
  5259.      DosOpen 
  5260.  
  5261.  Example Code 
  5262.  
  5263.  The following is NOT a complete usable program.  It is simply intended  to 
  5264.  provide an idea of how to use Raw I/O File System APIs (e.g. DosOpen, DosRead, 
  5265.  DosWrite, DosSetFilePtr, and DosClose). 
  5266.  
  5267.  This example opens physical disk #1 for reading and physical disk #2 for 
  5268.  writing.  DosSetFilePtr is used to set the pointer to the beginning of the 
  5269.  disks. Using DosRead and DosWrite, 10 megabytes of data is transferred from 
  5270.  disk #1 to disk #2. Finally, DosClosed is issued to close the disk handles. 
  5271.  
  5272.  It is assumed that the size of each of the two disks is at least 10 megabytes. 
  5273.  
  5274.   #define INCL_DOSFILEMGR          /* Include File Manager APIs */
  5275.   #define INCL_DOSMEMMGR           /* Includes Memory Management APIs */
  5276.   #define INCL_DOSERRORS           /* DOS Error values */
  5277.   #include <os2.h>
  5278.   #include <stdio.h>
  5279.   #include <string.h>
  5280.  
  5281.   #define SIXTY_FOUR_K 0x10000
  5282.   #define ONE_MEG     0x100000
  5283.   #define TEN_MEG     10*ONE_MEG
  5284.  
  5285.   #define UNC_DISK1  "\\\\.\\Physical_Disk1"
  5286.   #define UNC_DISK2  "\\\\.\\Physical_Disk2"
  5287.  
  5288.   int main(void) {
  5289.      HFILE  hfDisk1        = 0;      /* Handle for disk #1 */
  5290.      HFILE  hfDisk2        = 0;      /* Handle for disk #2 */
  5291.      ULONG  ulAction       = 0;      /* Action taken by DosOpen */
  5292.      ULONG  cbRead         = 0;      /* Bytes to read */
  5293.      ULONG  cbActualRead   = 0;      /* Bytes read by DosRead */
  5294.      ULONG  cbWrite        = 0;      /* Bytes to write */
  5295.      ULONG  ulLocation     = 0;
  5296.      ULONG  cbActualWrote  = 0;      /* Bytes written by DosWrite */
  5297.      UCHAR  uchFileName1[20]  = UNC_DISK1, /* UNC Name of disk 1 */
  5298.             uchFileName2[20]  = UNC_DISK2; /* UNC Name of disk 2 */
  5299.      PBYTE  pBuffer        = 0;
  5300.      ULONG  cbTotal        = 0;
  5301.  
  5302.      APIRET rc             = NO_ERROR;            /* Return code */
  5303.  
  5304.      /* Open a raw file system disk #1 for reading */
  5305.      rc = DosOpen(uchFileName1,               /* File name */
  5306.                   &hfDisk1,                   /* File handle */
  5307.                   &ulAction,                  /* Action taken by DosOpen */
  5308.                   0L,                         /* no file size */
  5309.                   FILE_NORMAL,                /* File attribute */
  5310.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  5311.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  5312.                   OPEN_ACCESS_READONLY,
  5313.                   0L);                        /* No extented attributes */
  5314.      if (rc != NO_ERROR) {
  5315.         printf("DosOpen error rc = %u\n", rc);
  5316.         return(1);
  5317.      } /* endif */
  5318.  
  5319.      /* Set the pointer to the begining of the disk */
  5320.      rc = DosSetFilePtr(hfDisk1,      /* Handle for disk 1 */
  5321.                         0L,           /* Offset must be multiple of 512 */
  5322.                         FILE_BEGIN,   /* Begin of the disk */
  5323.                         &ulLocation); /* New pointer location */
  5324.      if (rc != NO_ERROR) {
  5325.         printf("DosSetFilePtr error rc = %u\n", rc);
  5326.         return(1);
  5327.      } /* endif */
  5328.  
  5329.      /* Open a raw file system disk #2 for writing */
  5330.      rc = DosOpen(uchFileName2,               /* File name */
  5331.                   &hfDisk2,                   /* File handle */
  5332.                   &ulAction,                  /* Action taken by DosOpen */
  5333.                   0L,                         /* no file size */
  5334.                   FILE_NORMAL,                /* File attribute */
  5335.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  5336.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  5337.                   OPEN_ACCESS_READWRITE,
  5338.                   0L);                        /* No extented attributes */
  5339.      if (rc != NO_ERROR) {
  5340.         printf("DosOpen error rc = %u\n", rc);
  5341.         return(1);
  5342.      } /* endif */
  5343.  
  5344.      /* Set the pointer to the begining of the disk */
  5345.      rc = DosSetFilePtr(hfDisk2,      /* Handle for disk 1 */
  5346.                         0L,           /* Offset must be multiple of 512 */
  5347.                         FILE_BEGIN,   /* Begin of the disk */
  5348.                         &ulLocation); /* New pointer location */
  5349.      if (rc != NO_ERROR) {
  5350.         printf("DosSetFilePtr error rc = %u\n", rc);
  5351.         return(1);
  5352.      } /* endif */
  5353.  
  5354.  
  5355.      /* Allocate 64K of memory for transfer operations */
  5356.      rc = DosAllocMem((PPVOID)&pBuffer, /* Pointer to buffer */
  5357.                        SIXTY_FOUR_K,      /* Buffer size */
  5358.                        PAG_COMMIT |     /* Allocation flags */
  5359.                        PAG_READ |
  5360.                        PAG_WRITE);
  5361.      if (rc != NO_ERROR) {
  5362.         printf("DosAllocMem error rc = %u\n", rc);
  5363.         return(1);
  5364.      } /* endif */
  5365.  
  5366.      cbRead = SIXTY_FOUR_K;
  5367.      while (rc == NO_ERROR && cbTotal < TEN_MEG) {
  5368.  
  5369.         /* Read from #1 */
  5370.         rc = DosRead(hfDisk1,         /* Handle for disk 1 */
  5371.                      pBuffer,         /* Pointer to buffer */
  5372.                      cbRead,          /* Size must be multiple of 512 */
  5373.                      &cbActualRead);  /* Actual read by DosOpen */
  5374.         if (rc) {
  5375.            printf("DosRead error: return code = %u\n", rc);
  5376.            return 1;
  5377.         }
  5378.  
  5379.         /* Write to disk #2 */
  5380.         cbWrite = cbActualRead;
  5381.         rc = DosWrite(hfDisk2,         /* Handle for disk 2 */
  5382.                       pBuffer,         /* Pointer to buffer */
  5383.                       cbWrite,         /* Size must be multiple of 512 */
  5384.                       &cbActualWrote); /* Actual written by DosOpen */
  5385.         if (rc) {
  5386.            printf("DosWrite error: return code = %u\n", rc);
  5387.            return 1;
  5388.         }
  5389.         if (cbActualRead != cbActualWrote) {
  5390.            printf("Bytes read (%u) does not equal bytes written (%u)\n",
  5391.                   cbActualRead, cbActualWrote);
  5392.            return 1;
  5393.         }
  5394.         cbTotal += cbActualRead; /* Update total transferred */
  5395.      }
  5396.  
  5397.      printf("Transfer successfully %d bytes from disk #1 to disk #2.\n",
  5398.             cbTotal);
  5399.  
  5400.      /* Free allocated memmory */
  5401.      rc = DosFreeMem(pBuffer);
  5402.      if (rc != NO_ERROR) {
  5403.         printf("DosFreeMem error: return code = %u\n", rc);
  5404.         return 1;
  5405.      }
  5406.  
  5407.      rc = DosClose(hfDisk1);
  5408.      if (rc != NO_ERROR) {
  5409.         printf("DosClose error: return code = %u\n", rc);
  5410.         return 1;
  5411.      }
  5412.  
  5413.      rc = DosClose(hfDisk2);
  5414.      if (rc != NO_ERROR) {
  5415.         printf("DosClose error: return code = %u\n", rc);
  5416.         return 1;
  5417.      }
  5418.   return NO_ERROR;
  5419.   }
  5420.  
  5421.  
  5422. ΓòÉΓòÉΓòÉ 3.2. DosListIO ΓòÉΓòÉΓòÉ
  5423.  
  5424. Purpose 
  5425.  
  5426. DosListIO performs the specified number of seek/read and/or seek/write 
  5427. operations. 
  5428.  
  5429. Syntax 
  5430.  
  5431. #define INCL_DOSFILEMGR
  5432. #include <os2.h>
  5433.  
  5434.  APIRET DosListIO (ULONG CmdMode, ULONG NumEntries, PLISTIO pListIO) 
  5435.  
  5436.  Parameters 
  5437.  
  5438.  CmdMode (ULONG)- input 
  5439.            This specifies the mode in which the operations should be performed. 
  5440.            Valid modes are: 
  5441.  
  5442.            LISTIO_ORDERED 
  5443.                     Operations are performed synchronously in the given order. 
  5444.  
  5445.            LISTIO_UNORDERED 
  5446.                     Operations are performed independent of order. 
  5447.  
  5448.  NumEntries (ULONG)- input 
  5449.            The number of seek/read or seek/write operations in the list. 
  5450.  
  5451.  pListIO (PLISTIO)- input/output 
  5452.            Pointer to an array of NumEntries LISTIO data structures which 
  5453.            contain the information necessary to perform the seek/read and 
  5454.            seek/write operations. 
  5455.  
  5456.  Returns 
  5457.  
  5458.  ulrc (APIRET) - returns 
  5459.            Return Code. 
  5460.  
  5461.            DosListIO returns one of the following values: 
  5462.  
  5463.            0              NO_ERROR 
  5464.  
  5465.            5              ERROR_ACCESS_DENIED 
  5466.  
  5467.            6              ERROR_INVALID_HANDLE 
  5468.  
  5469.            19             ERROR_WRITE_PROTECT 
  5470.  
  5471.            26             ERROR_NOT_DOS_DISK 
  5472.  
  5473.            29             ERROR_WRITE_FAULT 
  5474.  
  5475.            33             ERROR_LOCK_VIOLATION 
  5476.  
  5477.            87             ERROR_INVALID_PARAMETER 
  5478.  
  5479.            109            ERROR_BROKEN_PIPE 
  5480.  
  5481.            234            ERROR_MORE_DATA 
  5482.  
  5483.  Remarks 
  5484.  
  5485.  DosListIO applies the same restrictions for each seek/read and seek/write 
  5486.  control block as would be applied if the requests were issued separately with 
  5487.  DosSetFilePtr, DosRead, and DosWrite. 
  5488.  
  5489.  Each request control block contains fields for the Actual number of bytes 
  5490.  read/written and the operation return code. These fields are updated upon 
  5491.  completion of each request, therefore care must be taken that the memory 
  5492.  containing the control block array not be deallocated or manipulated by 
  5493.  another thread before the DosListIO request returns. 
  5494.  
  5495.  There are two valid modes for the list of I/O operations to be processed: 
  5496.  
  5497.      Ordered - This mode guarantees the order in which the operations will be 
  5498.       performed. The API will return with an error code corresponding to the 
  5499.       first failed request and will leave the following requests unissued. This 
  5500.       provide a synchronous sequence of automatic seek/read and seek/write 
  5501.       requests. This is the only mode that is compatible with file systems 
  5502.       other than the raw file system. 
  5503.  
  5504.      Unordered - This mode does not guarantee the order of issue or completion 
  5505.       of the requests. The API will return with an error code if any request 
  5506.       fails. Additionally, each request in the list will be issued, even those 
  5507.       following a failed operation. This mode is valid for the raw file system 
  5508.       only. 
  5509.  
  5510.  Related Functions 
  5511.  
  5512.      DosOpen 
  5513.  
  5514.      DosSetFilePtr 
  5515.  
  5516.      DosRead 
  5517.  
  5518.      DosWrite 
  5519.  
  5520.  Example Code 
  5521.  
  5522.  The following is NOT a complete usable program.  It is simply intended to 
  5523.  provide an idea of how to use Raw I/O File System APIs (e.g. DosOpen, 
  5524.  DosListIO, and DosClose). 
  5525.  
  5526.  This example opens physical disk #1 for reading and physical disk #2  for 
  5527.  writing.  Using DosListIO, 10 megabytes of data is transferred disk #1 to disk 
  5528.  #2.  Finally, DosClosed is issued to close the disk handles. 
  5529.  
  5530.  It is assumed that the size of each of the two disks is at least 10 megabytes. 
  5531.  
  5532.   #define INCL_DOSFILEMGR          /* Include File Manager APIs */
  5533.   #define INCL_DOSMEMMGR           /* Includes Memory Management APIs */
  5534.   #define INCL_DOSERRORS           /* DOS Error values */
  5535.   #include <os2.h>
  5536.   #include <stdio.h>
  5537.   #include <stdlib.h>
  5538.   #include <string.h>
  5539.  
  5540.   #define SIXTY_FOUR_K 0x10000
  5541.   #define ONE_MEG     0x100000
  5542.   #define TEN_MEG     10*ONE_MEG
  5543.  
  5544.   #define UNC_DISK1  "\\\\.\\Physical_Disk1"
  5545.   #define UNC_DISK2  "\\\\.\\Physical_Disk2"
  5546.  
  5547.   int main(void) {
  5548.      LISTIO listIOCtrlBlks[2];          /* List IO control blocks   */
  5549.      ULONG  ulNumCtrlBlks;              /* Number of control blocks */
  5550.      HFILE  hfDisk1        = 0;         /* Handle for disk #1 */
  5551.      HFILE  hfDisk2        = 0;         /* Handle for disk #2 */
  5552.      ULONG  ulAction       = 0;         /* Action taken by DosOpen */
  5553.      UCHAR  uchFileName1[20]  = UNC_DISK1, /* UNC Name of disk 1 */
  5554.             uchFileName2[20]  = UNC_DISK2; /* UNC Name of disk 2 */
  5555.      PBYTE  pBuffer        = 0;
  5556.      ULONG  cbTotal        = 0;
  5557.  
  5558.      APIRET rc = NO_ERROR;              /* Return code */
  5559.  
  5560.      /* Open a raw file system disk #1 for reading */
  5561.      rc = DosOpen(uchFileName1,               /* File name */
  5562.                   &hfDisk1,                   /* File handle */
  5563.                   &ulAction,                  /* Action taken by DosOpen */
  5564.                   0L,                         /* no file size */
  5565.                   FILE_NORMAL,                /* File attribute */
  5566.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  5567.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  5568.                   OPEN_ACCESS_READONLY,
  5569.                   0L);                        /* No extented attributes */
  5570.      if (rc != NO_ERROR) {
  5571.         printf("DosOpen error rc = %u\n", rc);
  5572.         return(1);
  5573.      } /* endif */
  5574.  
  5575.      /* Open a raw file system disk #2 for writing */
  5576.      rc = DosOpen(uchFileName2,               /* File name */
  5577.                   &hfDisk2,                   /* File handle */
  5578.                   &ulAction,                  /* Action taken by DosOpen */
  5579.                   0L,                         /* no file size */
  5580.                   FILE_NORMAL,                /* File attribute */
  5581.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  5582.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  5583.                   OPEN_ACCESS_READWRITE,
  5584.                   0L);                        /* No extented attributes */
  5585.      if (rc != NO_ERROR) {
  5586.         printf("DosOpen error rc = %u\n", rc);
  5587.         return(1);
  5588.      } /* endif */
  5589.  
  5590.  
  5591.      /* Allocate 64K of memory for transfer operations */
  5592.      rc = DosAllocMem((PPVOID)&pBuffer, /* Pointer to buffer */
  5593.                        SIXTY_FOUR_K,      /* Buffer size */
  5594.                        PAG_COMMIT |     /* Allocation flags */
  5595.                        PAG_READ |
  5596.                        PAG_WRITE);
  5597.      if (rc != NO_ERROR) {
  5598.         printf("DosAllocMem error rc = %u\n", rc);
  5599.         return(1);
  5600.      } /* endif */
  5601.  
  5602.      /* Initialize listIO control blocks */
  5603.      memset(listIOCtrlBlks, 0, sizeof(listIOCtrlBlks));
  5604.  
  5605.      listIOCtrlBlks[0].hFile = hfDisk1;       /* Handle for disk 1 */
  5606.      listIOCtrlBlks[0].CmdFlag = LISTIO_READ | /* Read operation */
  5607.                                  FILE_CURRENT;
  5608.      listIOCtrlBlks[0].Offset = 0;
  5609.      listIOCtrlBlks[0].pBuffer = (PVOID)pBuffer;
  5610.      listIOCtrlBlks[0].NumBytes = SIXTY_FOUR_K;
  5611.  
  5612.      listIOCtrlBlks[1].hFile = hfDisk2;        /* Handle for disk 2 */
  5613.      listIOCtrlBlks[1].CmdFlag = LISTIO_WRITE | /* Write operation */
  5614.                                  FILE_CURRENT;
  5615.      listIOCtrlBlks[1].Offset = 0;
  5616.      listIOCtrlBlks[1].pBuffer = (PVOID)pBuffer;
  5617.      listIOCtrlBlks[1].NumBytes = SIXTY_FOUR_K;
  5618.  
  5619.      while (cbTotal < TEN_MEG) {
  5620.  
  5621.  
  5622.         ulNumCtrlBlks = 2;
  5623.         rc = DosListIO(LISTIO_ORDERED,
  5624.                        ulNumCtrlBlks,
  5625.                        listIOCtrlBlks);
  5626.         if (rc != NO_ERROR) {
  5627.            printf("DosListIO error: rc = %u\n", rc);
  5628.            break;
  5629.         } else {
  5630.  
  5631.            /* Check return code from the read operation */
  5632.            if (listIOCtrlBlks[0].RetCode != NO_ERROR) {
  5633.               printf("DosListIO read operation failed, rc = %u\n",
  5634.                       listIOCtrlBlks[0].RetCode);
  5635.              return 1;
  5636.            }
  5637.  
  5638.            /* Check return code from the write operation */
  5639.            if (listIOCtrlBlks[0].RetCode != NO_ERROR) {
  5640.               printf("DosListIO write operation failed, rc = %u\n",
  5641.                       listIOCtrlBlks[0].RetCode);
  5642.               return 1;
  5643.            }
  5644.         }
  5645.  
  5646.         if (listIOCtrlBlks[0].Actual != listIOCtrlBlks[1].Actual) {
  5647.            printf("Bytes read (%u) does not equal bytes written (%u)\n",
  5648.                   listIOCtrlBlks[0].Actual, listIOCtrlBlks[1].Actual);
  5649.            return 1;
  5650.         }
  5651.  
  5652.         cbTotal += SIXTY_FOUR_K; /* Update total transferred */
  5653.  
  5654.      } /* end while */
  5655.  
  5656.      printf("Transfer successfully %d bytes from disk #1 to disk #2.\n",
  5657.             cbTotal);
  5658.  
  5659.      /* Free allocated memmory */
  5660.      rc = DosFreeMem(pBuffer);
  5661.      if (rc != NO_ERROR) {
  5662.         printf("DosFreeMem error: return code = %u\n", rc);
  5663.         return 1;
  5664.      }
  5665.  
  5666.      rc = DosClose(hfDisk1);
  5667.      if (rc != NO_ERROR) {
  5668.         printf("DosClose error: return code = %u\n", rc);
  5669.         return 1;
  5670.      }
  5671.  
  5672.      rc = DosClose(hfDisk2);
  5673.      if (rc != NO_ERROR) {
  5674.         printf("DosClose error: return code = %u\n", rc);
  5675.         return 1;
  5676.      }
  5677.   return NO_ERROR;
  5678.   }
  5679.  
  5680.  
  5681. ΓòÉΓòÉΓòÉ 3.3. DosOpen ΓòÉΓòÉΓòÉ
  5682.  
  5683. Purpose 
  5684.  
  5685. DosOpen opens a physical or logical disk and returns a handle to be used to 
  5686. perform operations upon the disk specified. 
  5687.  
  5688. Syntax 
  5689.  
  5690. #define INCL_DOSFILEMGR
  5691. #include <os2.h>
  5692.  
  5693.  APIRET DosOpen (PSZ pszFileName, PHFILE pHf, PULONG pulAction, ULONG cbFile, 
  5694.            ULONG ulAttribute, ULONG fsOpenFlags, ULONG fsOpenMode, 
  5695.            PEAOP2 peaop2) 
  5696.  
  5697.  Parameters 
  5698.  
  5699.  pszFileName (PSZ) - input 
  5700.            Address of the ASCIIZ path name of the logical partition or physical 
  5701.            disk to be opened. 
  5702.  
  5703.  pHf (PHFILE) - output 
  5704.            Address of the handle for the disk. 
  5705.  
  5706.  pulAction (PULONG) - output 
  5707.            Address of the variable that receives the value that specifies the 
  5708.            action taken by the DosOpen function. 
  5709.  
  5710.            If DosOpen fails, this value has no meaning. Otherwise, the raw file 
  5711.            system should always reutn FILE_EXISTED (1).: 
  5712.  
  5713.  cbFile (ULONG) - input 
  5714.            Not used by the raw file system. 
  5715.  
  5716.  ulAttribute (ULONG) - input 
  5717.            File attributes are ignored because disks are not created. 
  5718.  
  5719.  fsOpenFlags (ULONG) - input 
  5720.            Not used by the raw file system. 
  5721.  
  5722.  fsOpenMode (ULONG) - input 
  5723.            OPEN_ACCESS_READWRITE - Only valid access mode. 
  5724.  
  5725.            OPEN_SHARE_DENYNONE - Allows other processes to read/write from 
  5726.            disk. 
  5727.  
  5728.            OPEN_SHARE_DENYREADWRITE - Locks disk from access by other processes 
  5729.            and file systems. 
  5730.  
  5731.            Invalid flags are: OPEN_ACCESS_WRITEONLY, OPEN_ACCESS_READONLY, 
  5732.            OPEN_SHARE_DENYREAD, OPEN_SHARE_DENYWRITE, and OPEN_FLAGS_DASD. 
  5733.  
  5734.            Valid but unimplemented flags are: OPEN_FLAGS_NOINHERIT, 
  5735.            OPEN_FLAGS_RANDOMSEQUENTIAL, OPEN_FLAGS_RANDOM, 
  5736.            OPEN_FLAGS_SEQUENTIAL, OPEN_FLAGS_NO_LOCALITY, OPEN_FLAGS_NO_CACHE, 
  5737.            OPEN_FLAGS_FAIL_ON_ERROR, and OPEN_FLAGS_WRITE_THROUGH. 
  5738.  
  5739.  peaop2 (PEAOP2) - in/out 
  5740.            Unused by raw file system. 
  5741.  
  5742.  Returns 
  5743.  
  5744.  ulrc (APIRET) - returns 
  5745.            Return Code. 
  5746.  
  5747.            DosOpen returns one of the following values: 
  5748.  
  5749.            0              NO_ERROR 
  5750.  
  5751.            2              ERROR_FILE_NOT_FOUND 
  5752.  
  5753.            3              ERROR_PATH_NOT_FOUND 
  5754.  
  5755.            4              ERROR_TOO_MANY_OPEN_FILES 
  5756.  
  5757.            5              ERROR_ACCESS_DENIED 
  5758.  
  5759.            12             ERROR_INVALID_ACCESS 
  5760.  
  5761.            26             ERROR_NOT_DOS_DISK 
  5762.  
  5763.            32             ERROR_SHARING_VIOLATION 
  5764.  
  5765.            36             ERROR_SHARING_BUFFER_EXCEEDED 
  5766.  
  5767.            82             ERROR_CANNOT_MAKE 
  5768.  
  5769.            87             ERROR_INVALID_PARAMETER 
  5770.  
  5771.            99             ERROR_DEVICE_IN_USE 
  5772.  
  5773.            108            ERROR_DRIVE_LOCKED 
  5774.  
  5775.            110            ERROR_OPEN_FAILED 
  5776.  
  5777.            112            ERROR_DISK_FULL 
  5778.  
  5779.            206            ERROR_FILENAME_EXCED_RANGE 
  5780.  
  5781.            231            ERROR_PIPE_BUSY 
  5782.  
  5783.  Remarks 
  5784.  
  5785.  A successful DosOpen request returns a handle for accessing the disk. The 
  5786.  read/write pointer is set at the first byte of the disk. The position of the 
  5787.  pointer can be changed with DosSetFilePtr or by read and write operations on 
  5788.  the disk. 
  5789.  
  5790.  The direct open bit (OPEN_FLAGS_DASD) is not used with the raw file system. 
  5791.  However, when using the raw file system to access logical partitions and disk 
  5792.  locking is required, the following logic should be used.  First, the 
  5793.  application should lock the disk by passing the handle to DosDevIOCtl, 
  5794.  Category 8, DSK_LOCKDRIVE. Second, the application should perform the desired 
  5795.  operations on the disk. Lastly, the application should unlock the disk using 
  5796.  DosDevIOCtl Category 8, DSK_UNLOCKDRIVE. 
  5797.  
  5798.  If locking is desired when using the raw file system on physical disk, the 
  5799.  OPEN_SHARE_DENYREADWRITE flag should be used. The disk will automatically be 
  5800.  unlocked when the disk is closed with DosClose. 
  5801.  
  5802.  Related Functions 
  5803.  
  5804.      DosClose 
  5805.  
  5806.      DosDevIOCtl 
  5807.  
  5808.  Example Code 
  5809.  
  5810.  The following is NOT a complete usable program.  It is simply intended  to 
  5811.  provide an idea of how to use Raw I/O File System APIs (e.g. DosOpen, DosRead, 
  5812.  DosWrite, DosSetFilePtr, and DosClose). 
  5813.  
  5814.  This example opens physical disk #1 for reading and physical disk #2  for 
  5815.  writing.  DosSetFilePtr is used to set the pointer to the beginning of the 
  5816.  disks. Using DosRead and DosWrite, 10 megabytes of data is transferred from 
  5817.  disk #1 to disk #2. Finally, DosClosed is issued to close the disk handles. 
  5818.  
  5819.  It is assumed that the size of each of the two disks is at least 10 megabytes. 
  5820.  
  5821.   #define INCL_DOSFILEMGR          /* Include File Manager APIs */
  5822.   #define INCL_DOSMEMMGR           /* Includes Memory Management APIs */
  5823.   #define INCL_DOSERRORS           /* DOS Error values */
  5824.   #include <os2.h>
  5825.   #include <stdio.h>
  5826.   #include <string.h>
  5827.   #define SIXTY_FOUR_K 0x10000
  5828.   #define ONE_MEG     0x100000
  5829.   #define TEN_MEG     10*ONE_MEG
  5830.  
  5831.   #define UNC_DISK1  "\\\\.\\Physical_Disk1"
  5832.   #define UNC_DISK2  "\\\\.\\Physical_Disk2"
  5833.  
  5834.   int main(void) {
  5835.      HFILE  hfDisk1        = 0;      /* Handle for disk #1 */
  5836.      HFILE  hfDisk2        = 0;      /* Handle for disk #2 */
  5837.      ULONG  ulAction       = 0;      /* Action taken by DosOpen */
  5838.      ULONG  cbRead         = 0;      /* Bytes to read */
  5839.      ULONG  cbActualRead   = 0;      /* Bytes read by DosRead */
  5840.      ULONG  cbWrite        = 0;      /* Bytes to write */
  5841.      ULONG  ulLocation     = 0;
  5842.      ULONG  cbActualWrote  = 0;      /* Bytes written by DosWrite */
  5843.      UCHAR  uchFileName1[20]  = UNC_DISK1, /* UNC Name of disk 1 */
  5844.             uchFileName2[20]  = UNC_DISK2; /* UNC Name of disk 2 */
  5845.      PBYTE  pBuffer        = 0;
  5846.      ULONG  cbTotal        = 0;
  5847.  
  5848.      APIRET rc             = NO_ERROR;            /* Return code */
  5849.  
  5850.      /* Open a raw file system disk #1 for reading */
  5851.      rc = DosOpen(uchFileName1,               /* File name */
  5852.                   &hfDisk1,                   /* File handle */
  5853.                   &ulAction,                  /* Action taken by DosOpen */
  5854.                   0L,                         /* no file size */
  5855.                   FILE_NORMAL,                /* File attribute */
  5856.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  5857.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  5858.                   OPEN_ACCESS_READONLY,
  5859.                   0L);                        /* No extented attributes */
  5860.      if (rc != NO_ERROR) {
  5861.         printf("DosOpen error rc = %u\n", rc);
  5862.         return(1);
  5863.      } /* endif */
  5864.  
  5865.      /* Set the pointer to the begining of the disk */
  5866.      rc = DosSetFilePtr(hfDisk1,      /* Handle for disk 1 */
  5867.                         0L,           /* Offset must be multiple of 512 */
  5868.                         FILE_BEGIN,   /* Begin of the disk */
  5869.                         &ulLocation); /* New pointer location */
  5870.      if (rc != NO_ERROR) {
  5871.         printf("DosSetFilePtr error rc = %u\n", rc);
  5872.         return(1);
  5873.      } /* endif */
  5874.  
  5875.      /* Open a raw file system disk #2 for writing */
  5876.      rc = DosOpen(uchFileName2,               /* File name */
  5877.                   &hfDisk2,                   /* File handle */
  5878.                   &ulAction,                  /* Action taken by DosOpen */
  5879.                   0L,                         /* no file size */
  5880.                   FILE_NORMAL,                /* File attribute */
  5881.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  5882.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  5883.                   OPEN_ACCESS_READWRITE,
  5884.                   0L);                        /* No extented attributes */
  5885.      if (rc != NO_ERROR) {
  5886.         printf("DosOpen error rc = %u\n", rc);
  5887.         return(1);
  5888.      } /* endif */
  5889.  
  5890.      /* Set the pointer to the begining of the disk */
  5891.      rc = DosSetFilePtr(hfDisk2,      /* Handle for disk 1 */
  5892.                         0L,           /* Offset must be multiple of 512 */
  5893.                         FILE_BEGIN,   /* Begin of the disk */
  5894.                         &ulLocation); /* New pointer location */
  5895.      if (rc != NO_ERROR) {
  5896.         printf("DosSetFilePtr error rc = %u\n", rc);
  5897.         return(1);
  5898.      } /* endif */
  5899.  
  5900.  
  5901.      /* Allocate 64K of memory for transfer operations */
  5902.      rc = DosAllocMem((PPVOID)&pBuffer, /* Pointer to buffer */
  5903.                        SIXTY_FOUR_K,      /* Buffer size */
  5904.                        PAG_COMMIT |     /* Allocation flags */
  5905.                        PAG_READ |
  5906.                        PAG_WRITE);
  5907.      if (rc != NO_ERROR) {
  5908.         printf("DosAllocMem error rc = %u\n", rc);
  5909.         return(1);
  5910.      } /* endif */
  5911.  
  5912.      cbRead = SIXTY_FOUR_K;
  5913.      while (rc == NO_ERROR && cbTotal < TEN_MEG) {
  5914.  
  5915.         /* Read from #1 */
  5916.         rc = DosRead(hfDisk1,         /* Handle for disk 1 */
  5917.                      pBuffer,         /* Pointer to buffer */
  5918.                      cbRead,          /* Size must be multiple of 512 */
  5919.                      &cbActualRead);  /* Actual read by DosOpen */
  5920.         if (rc) {
  5921.            printf("DosRead error: return code = %u\n", rc);
  5922.            return 1;
  5923.         }
  5924.  
  5925.         /* Write to disk #2 */
  5926.         cbWrite = cbActualRead;
  5927.         rc = DosWrite(hfDisk2,         /* Handle for disk 2 */
  5928.                       pBuffer,         /* Pointer to buffer */
  5929.                       cbWrite,         /* Size must be multiple of 512 */
  5930.                       &cbActualWrote); /* Actual written by DosOpen */
  5931.         if (rc) {
  5932.            printf("DosWrite error: return code = %u\n", rc);
  5933.            return 1;
  5934.         }
  5935.         if (cbActualRead != cbActualWrote) {
  5936.            printf("Bytes read (%u) does not equal bytes written (%u)\n",
  5937.                   cbActualRead, cbActualWrote);
  5938.            return 1;
  5939.         }
  5940.         cbTotal += cbActualRead; /* Update total transferred */
  5941.      }
  5942.  
  5943.      printf("Transfer successfully %d bytes from disk #1 to disk #2.\n",
  5944.             cbTotal);
  5945.  
  5946.      /* Free allocated memmory */
  5947.      rc = DosFreeMem(pBuffer);
  5948.      if (rc != NO_ERROR) {
  5949.         printf("DosFreeMem error: return code = %u\n", rc);
  5950.         return 1;
  5951.      }
  5952.  
  5953.      rc = DosClose(hfDisk1);
  5954.      if (rc != NO_ERROR) {
  5955.         printf("DosClose error: return code = %u\n", rc);
  5956.         return 1;
  5957.      }
  5958.  
  5959.      rc = DosClose(hfDisk2);
  5960.      if (rc != NO_ERROR) {
  5961.         printf("DosClose error: return code = %u\n", rc);
  5962.         return 1;
  5963.   return NO_ERROR;
  5964.   }
  5965.  
  5966.  
  5967. ΓòÉΓòÉΓòÉ 3.4. DosRead ΓòÉΓòÉΓòÉ
  5968.  
  5969. Purpose 
  5970.  
  5971. DosRead reads the specified number of bytes from a disk to a buffered location. 
  5972.  
  5973. Syntax 
  5974.  
  5975. #define INCL_DOSFILEMGR
  5976. #include <os2.h>
  5977.  
  5978.  APIRET DosRead (HFILE hf, PVOID pBuffer,  ULONG cbRead, PULONG pcbActual) 
  5979.  
  5980.  Parameters 
  5981.  
  5982.  hFile (HFILE) - input 
  5983.            File handle obtained from DosOpen. 
  5984.  
  5985.  pBuffer (PVOID) - output 
  5986.            Address of the buffer to receive the bytes read. 
  5987.  
  5988.  cbRead (ULONG) - input 
  5989.            The number of bytes to be read into pBuffer. This must be a multiple 
  5990.            of the sector size (512) for the raw file system. 
  5991.  
  5992.  pcbActual (PULONG) - output 
  5993.            Address of the variable to receive the number of bytes actually 
  5994.            read. 
  5995.  
  5996.  Returns 
  5997.  
  5998.  ulrc (APIRET) - returns 
  5999.            Return Code. 
  6000.  
  6001.            DosRead returns one of the following values: 
  6002.  
  6003.            0              NO_ERROR 
  6004.  
  6005.            5               ERROR_ACCESS_DENIED 
  6006.  
  6007.            6              ERROR_INVALID_HANDLE 
  6008.  
  6009.            26             ERROR_NOT_DOS_DISK 
  6010.  
  6011.            33             ERROR_LOCK_VIOLATION 
  6012.  
  6013.            109            ERROR_BROKEN_PIPE 
  6014.  
  6015.            234            ERROR_MORE_DATA 
  6016.  
  6017.  Remarks 
  6018.  
  6019.  DosRead begins reading from the current file pointer position. The file 
  6020.  pointer is updated by reading the data. 
  6021.  
  6022.  The requested number of bytes might not be read. If the value returned in 
  6023.  pcbActual is less than requested, the process tried to read past the end of 
  6024.  the disk. 
  6025.  
  6026.  A value of zero for cbRead is not considered an error. It is treated as a null 
  6027.  operation. 
  6028.  
  6029.  Using the raw file system on logical partitions requires you to lock and 
  6030.  unlock the volume using the DosDevIOCtl Category 8, DSK_LOCKDRIVE and 
  6031.  DSK_UNLOCKDRIVE. Reads and writes will not succeed until the logical drive is 
  6032.  locked. 
  6033.  
  6034.  The raw file system requires that the number of bytes read be a multiple of 
  6035.  the sector size (512). 
  6036.  
  6037.  Related Functions 
  6038.  
  6039.      DosOpen 
  6040.  
  6041.      DosListIO 
  6042.  
  6043.      DosSetFilePtr 
  6044.  
  6045.      DosWrite 
  6046.  
  6047.  Example Code 
  6048.  
  6049.  The following is NOT a complete usable program.  It is simply intended to 
  6050.  provide an idea of how to use Raw I/O File System APIs (e.g. DosOpen, DosRead, 
  6051.  DosWrite, DosSetFilePtr, and DosClose). 
  6052.  
  6053.  This example opens physical disk #1 for reading and physical disk #2  for 
  6054.  writing.  DosSetFilePtr is used to set the pointer to the beginning of the 
  6055.  disks. Using DosRead and DosWrite, 10 megabytes of data is transferred from 
  6056.  disk #1 to disk #2. Finally, DosClosed is issued to close the disk handles. 
  6057.  
  6058.  It is assumed that the size of each of the two disks is at least 10 megabytes. 
  6059.  
  6060.   #define INCL_DOSFILEMGR          /* Include File Manager APIs */
  6061.   #define INCL_DOSMEMMGR           /* Includes Memory Management APIs */
  6062.   #define INCL_DOSERRORS           /* DOS Error values */
  6063.   #include <os2.h>
  6064.   #include <stdio.h>
  6065.   #include <string.h>
  6066.  
  6067.   #define SIXTY_FOUR_K 0x10000
  6068.   #define ONE_MEG     0x100000
  6069.   #define TEN_MEG     10*ONE_MEG
  6070.  
  6071.   #define UNC_DISK1  "\\\\.\\Physical_Disk1"
  6072.   #define UNC_DISK2  "\\\\.\\Physical_Disk2"
  6073.  
  6074.   int main(void) {
  6075.      HFILE  hfDisk1        = 0;      /* Handle for disk #1 */
  6076.      HFILE  hfDisk2        = 0;      /* Handle for disk #2 */
  6077.      ULONG  ulAction       = 0;      /* Action taken by DosOpen */
  6078.      ULONG  cbRead         = 0;      /* Bytes to read */
  6079.      ULONG  cbActualRead   = 0;      /* Bytes read by DosRead */
  6080.      ULONG  cbWrite        = 0;      /* Bytes to write */
  6081.      ULONG  ulLocation     = 0;
  6082.      ULONG  cbActualWrote  = 0;      /* Bytes written by DosWrite */
  6083.      UCHAR  uchFileName1[20]  = UNC_DISK1, /* UNC Name of disk 1 */
  6084.             uchFileName2[20]  = UNC_DISK2; /* UNC Name of disk 2 */
  6085.      PBYTE  pBuffer        = 0;
  6086.      ULONG  cbTotal        = 0;
  6087.  
  6088.      APIRET rc             = NO_ERROR;            /* Return code */
  6089.  
  6090.      /* Open a raw file system disk #1 for reading */
  6091.      rc = DosOpen(uchFileName1,               /* File name */
  6092.                   &hfDisk1,                   /* File handle */
  6093.                   &ulAction,                  /* Action taken by DosOpen */
  6094.                   0L,                         /* no file size */
  6095.                   FILE_NORMAL,                /* File attribute */
  6096.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  6097.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  6098.                   OPEN_ACCESS_READONLY,
  6099.                   0L);                        /* No extented attributes */
  6100.      if (rc != NO_ERROR) {
  6101.         printf("DosOpen error rc = %u\n", rc);
  6102.         return(1);
  6103.      } /* endif */
  6104.  
  6105.      /* Set the pointer to the begining of the disk */
  6106.      rc = DosSetFilePtr(hfDisk1,      /* Handle for disk 1 */
  6107.                         0L,           /* Offset must be multiple of 512 */
  6108.                         FILE_BEGIN,   /* Begin of the disk */
  6109.                         &ulLocation); /* New pointer location */
  6110.      if (rc != NO_ERROR) {
  6111.         printf("DosSetFilePtr error rc = %u\n", rc);
  6112.         return(1);
  6113.      } /* endif */
  6114.  
  6115.      /* Open a raw file system disk #2 for writing */
  6116.      rc = DosOpen(uchFileName2,               /* File name */
  6117.                   &hfDisk2,                   /* File handle */
  6118.                   &ulAction,                  /* Action taken by DosOpen */
  6119.                   0L,                         /* no file size */
  6120.                   FILE_NORMAL,                /* File attribute */
  6121.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  6122.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  6123.                   OPEN_ACCESS_READWRITE,
  6124.                   0L);                        /* No extented attributes */
  6125.      if (rc != NO_ERROR) {
  6126.         printf("DosOpen error rc = %u\n", rc);
  6127.         return(1);
  6128.      } /* endif */
  6129.  
  6130.      /* Set the pointer to the begining of the disk */
  6131.      rc = DosSetFilePtr(hfDisk2,      /* Handle for disk 1 */
  6132.                         0L,           /* Offset must be multiple of 512 */
  6133.                         FILE_BEGIN,   /* Begin of the disk */
  6134.                         &ulLocation); /* New pointer location */
  6135.      if (rc != NO_ERROR) {
  6136.         printf("DosSetFilePtr error rc = %u\n", rc);
  6137.         return(1);
  6138.      } /* endif */
  6139.  
  6140.  
  6141.      /* Allocate 64K of memory for transfer operations */
  6142.      rc = DosAllocMem((PPVOID)&pBuffer, /* Pointer to buffer */
  6143.                        SIXTY_FOUR_K,      /* Buffer size */
  6144.                        PAG_COMMIT |     /* Allocation flags */
  6145.                        PAG_READ |
  6146.                        PAG_WRITE);
  6147.      if (rc != NO_ERROR) {
  6148.         printf("DosAllocMem error rc = %u\n", rc);
  6149.         return(1);
  6150.      } /* endif */
  6151.  
  6152.      cbRead = SIXTY_FOUR_K;
  6153.      while (rc == NO_ERROR && cbTotal < TEN_MEG) {
  6154.  
  6155.         /* Read from #1 */
  6156.         rc = DosRead(hfDisk1,         /* Handle for disk 1 */
  6157.                      pBuffer,         /* Pointer to buffer */
  6158.                      cbRead,          /* Size must be multiple of 512 */
  6159.                      &cbActualRead);  /* Actual read by DosOpen */
  6160.         if (rc) {
  6161.            printf("DosRead error: return code = %u\n", rc);
  6162.            return 1;
  6163.         }
  6164.  
  6165.         /* Write to disk #2 */
  6166.         cbWrite = cbActualRead;
  6167.         rc = DosWrite(hfDisk2,         /* Handle for disk 2 */
  6168.                       pBuffer,         /* Pointer to buffer */
  6169.                       cbWrite,         /* Size must be multiple of 512 */
  6170.                       &cbActualWrote); /* Actual written by DosOpen */
  6171.         if (rc) {
  6172.            printf("DosWrite error: return code = %u\n", rc);
  6173.            return 1;
  6174.         }
  6175.         if (cbActualRead != cbActualWrote) {
  6176.            printf("Bytes read (%u) does not equal bytes written (%u)\n",
  6177.                   cbActualRead, cbActualWrote);
  6178.            return 1;
  6179.         }
  6180.         cbTotal += cbActualRead; /* Update total transferred */
  6181.      }
  6182.  
  6183.      printf("Transfer successfully %d bytes from disk #1 to disk #2.\n",
  6184.             cbTotal);
  6185.  
  6186.      /* Free allocated memmory */
  6187.      rc = DosFreeMem(pBuffer);
  6188.      if (rc != NO_ERROR) {
  6189.         printf("DosFreeMem error: return code = %u\n", rc);
  6190.         return 1;
  6191.      }
  6192.  
  6193.      rc = DosClose(hfDisk1);
  6194.      if (rc != NO_ERROR) {
  6195.         printf("DosClose error: return code = %u\n", rc);
  6196.         return 1;
  6197.      }
  6198.  
  6199.      rc = DosClose(hfDisk2);
  6200.      if (rc != NO_ERROR) {
  6201.         printf("DosClose error: return code = %u\n", rc);
  6202.         return 1;
  6203.      }
  6204.   return NO_ERROR;
  6205.   }
  6206.  
  6207.  
  6208. ΓòÉΓòÉΓòÉ 3.5. DosSetFilePtr ΓòÉΓòÉΓòÉ
  6209.  
  6210. Purpose 
  6211.  
  6212. DosSetFilePtr moves the read/write pointer according to the type of move 
  6213. specified. 
  6214.  
  6215. Syntax 
  6216.  
  6217. #define INCL_DOSFILEMGR
  6218. #include <os2.h>
  6219.  
  6220.  APIRET DosSetFilePtr (HFILE hFile, LONG ib, ULONG method, PULONG ibActual) 
  6221.  
  6222.  Parameters 
  6223.  
  6224.  hFile (HFILE) - input 
  6225.            The handle returned by a previous DosOpen function. 
  6226.  
  6227.  ib (LONG) - input 
  6228.            The signed distance (offset) to move the read/write pointer, in 
  6229.            bytes. The raw file system requires that the offset be a multiple of 
  6230.            the sector size (512). 
  6231.  
  6232.  method (ULONG) - input 
  6233.            The method of moving. 
  6234.  
  6235.            Specifies a location in the file from where the ib to move the 
  6236.            read/write pointer starts. The values and their meanings are 
  6237.            described in the following list: 
  6238.  
  6239.            0        FILE_BEGIN 
  6240.  
  6241.                     Move the pointer from the beginning of the file. 
  6242.  
  6243.            1        FILE_CURRENT 
  6244.  
  6245.                     Move the pointer from the current location of the 
  6246.                     read/write pointer. 
  6247.  
  6248.            2        FILE_END 
  6249.  
  6250.                     Move the pointer from the end of the file. Use this method 
  6251.                     to determine a file's size. 
  6252.  
  6253.  ibActual (PULONG) - output 
  6254.            Address of the new pointer location. 
  6255.  
  6256.  Returns 
  6257.  
  6258.  ulrc (APIRET) - returns 
  6259.            Return Code. 
  6260.  
  6261.            DosSetFilePtr returns one of the following values: 
  6262.  
  6263.            0              NO_ERROR 
  6264.  
  6265.            1              ERROR_INVALID_FUNCTION 
  6266.  
  6267.            6              ERROR_INVALID_HANDLE 
  6268.  
  6269.            25             ERROR_SEEK 
  6270.  
  6271.            130            ERROR_DIRECT_ACCESS_HANDLE 
  6272.  
  6273.            131            ERROR_NEGATIVE_SEEK 
  6274.  
  6275.            132            ERROR_SEEK_ON_DEVICE 
  6276.  
  6277.  Remarks 
  6278.  
  6279.  The read/write pointer in a file is a signed 32-bit number. A negative value 
  6280.  for ib moves the pointer backward; a positive value moves it forward. The 
  6281.  resulting pointer value cannot be negative or larger than the disk or an error 
  6282.  will be returned. The signed 32-bit value of the read/write pointer limits the 
  6283.  raw file system to the first 2 Gigabytes of a disk. 
  6284.  
  6285.  Related Functions 
  6286.  
  6287.      DosOpen 
  6288.  
  6289.      DosListIO 
  6290.  
  6291.      DosRead 
  6292.  
  6293.      DosWrite 
  6294.  
  6295.  Example Code 
  6296.  
  6297.  The following is NOT a complete usable program.  It is simply intended  to 
  6298.  provide an idea of how to use Raw I/O File System APIs (e.g. DosOpen, DosRead, 
  6299.  DosWrite, DosSetFilePtr, and DosClose). 
  6300.  
  6301.  This example opens physical disk #1 for reading and physical disk #2  for 
  6302.  writing.  DosSetFilePtr is used to set the pointer to the beginning of the 
  6303.  disks. Using DosRead and DosWrite, 10 megabytes of data is transferred from 
  6304.  disk #1 to disk #2. Finally, DosClosed is issued to close the disk handles. 
  6305.  
  6306.  It is assumed that the size of each of the two disks is at least 10 megabytes. 
  6307.  
  6308.   #define INCL_DOSFILEMGR          /* Include File Manager APIs */
  6309.   #define INCL_DOSMEMMGR           /* Includes Memory Management APIs */
  6310.   #define INCL_DOSERRORS           /* DOS Error values */
  6311.   #include <os2.h>
  6312.   #include <stdio.h>
  6313.   #include <string.h>
  6314.  
  6315.   #define SIXTY_FOUR_K 0x10000
  6316.   #define ONE_MEG     0x100000
  6317.   #define TEN_MEG     10*ONE_MEG
  6318.  
  6319.   #define UNC_DISK1  "\\\\.\\Physical_Disk1"
  6320.   #define UNC_DISK2  "\\\\.\\Physical_Disk2"
  6321.  
  6322.   int main(void) {
  6323.      HFILE  hfDisk1        = 0;      /* Handle for disk #1 */
  6324.      HFILE  hfDisk2        = 0;      /* Handle for disk #2 */
  6325.      ULONG  ulAction       = 0;      /* Action taken by DosOpen */
  6326.      ULONG  cbRead         = 0;      /* Bytes to read */
  6327.      ULONG  cbActualRead   = 0;      /* Bytes read by DosRead */
  6328.      ULONG  cbWrite        = 0;      /* Bytes to write */
  6329.      ULONG  ulLocation     = 0;
  6330.      ULONG  cbActualWrote  = 0;      /* Bytes written by DosWrite */
  6331.      UCHAR  uchFileName1[20]  = UNC_DISK1, /* UNC Name of disk 1 */
  6332.             uchFileName2[20]  = UNC_DISK2; /* UNC Name of disk 2 */
  6333.      PBYTE  pBuffer        = 0;
  6334.      ULONG  cbTotal        = 0;
  6335.  
  6336.      APIRET rc             = NO_ERROR;            /* Return code */
  6337.  
  6338.      /* Open a raw file system disk #1 for reading */
  6339.      rc = DosOpen(uchFileName1,               /* File name */
  6340.                   &hfDisk1,                   /* File handle */
  6341.                   &ulAction,                  /* Action taken by DosOpen */
  6342.                   0L,                         /* no file size */
  6343.                   FILE_NORMAL,                /* File attribute */
  6344.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  6345.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  6346.                   OPEN_ACCESS_READONLY,
  6347.                   0L);                        /* No extented attributes */
  6348.      if (rc != NO_ERROR) {
  6349.         printf("DosOpen error rc = %u\n", rc);
  6350.         return(1);
  6351.      } /* endif */
  6352.  
  6353.      /* Set the pointer to the begining of the disk */
  6354.      rc = DosSetFilePtr(hfDisk1,      /* Handle for disk 1 */
  6355.                         0L,           /* Offset must be multiple of 512 */
  6356.                         FILE_BEGIN,   /* Begin of the disk */
  6357.                         &ulLocation); /* New pointer location */
  6358.      if (rc != NO_ERROR) {
  6359.         printf("DosSetFilePtr error rc = %u\n", rc);
  6360.         return(1);
  6361.      } /* endif */
  6362.  
  6363.      /* Open a raw file system disk #2 for writing */
  6364.      rc = DosOpen(uchFileName2,               /* File name */
  6365.                   &hfDisk2,                   /* File handle */
  6366.                   &ulAction,                  /* Action taken by DosOpen */
  6367.                   0L,                         /* no file size */
  6368.                   FILE_NORMAL,                /* File attribute */
  6369.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  6370.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  6371.                   OPEN_ACCESS_READWRITE,
  6372.                   0L);                        /* No extented attributes */
  6373.      if (rc != NO_ERROR) {
  6374.         printf("DosOpen error rc = %u\n", rc);
  6375.         return(1);
  6376.      } /* endif */
  6377.  
  6378.      /* Set the pointer to the begining of the disk */
  6379.      rc = DosSetFilePtr(hfDisk2,      /* Handle for disk 1 */
  6380.                         0L,           /* Offset must be multiple of 512 */
  6381.                         FILE_BEGIN,   /* Begin of the disk */
  6382.                         &ulLocation); /* New pointer location */
  6383.      if (rc != NO_ERROR) {
  6384.         printf("DosSetFilePtr error rc = %u\n", rc);
  6385.         return(1);
  6386.      } /* endif */
  6387.  
  6388.  
  6389.      /* Allocate 64K of memory for transfer operations */
  6390.      rc = DosAllocMem((PPVOID)&pBuffer, /* Pointer to buffer */
  6391.                        SIXTY_FOUR_K,      /* Buffer size */
  6392.                        PAG_COMMIT |     /* Allocation flags */
  6393.                        PAG_READ |
  6394.                        PAG_WRITE);
  6395.      if (rc != NO_ERROR) {
  6396.         printf("DosAllocMem error rc = %u\n", rc);
  6397.         return(1);
  6398.      } /* endif */
  6399.  
  6400.      cbRead = SIXTY_FOUR_K;
  6401.      while (rc == NO_ERROR && cbTotal < TEN_MEG) {
  6402.  
  6403.         /* Read from #1 */
  6404.         rc = DosRead(hfDisk1,         /* Handle for disk 1 */
  6405.                      pBuffer,         /* Pointer to buffer */
  6406.                      cbRead,          /* Size must be multiple of 512 */
  6407.                      &cbActualRead);  /* Actual read by DosOpen */
  6408.         if (rc) {
  6409.            printf("DosRead error: return code = %u\n", rc);
  6410.            return 1;
  6411.         }
  6412.  
  6413.         /* Write to disk #2 */
  6414.         cbWrite = cbActualRead;
  6415.         rc = DosWrite(hfDisk2,         /* Handle for disk 2 */
  6416.                       pBuffer,         /* Pointer to buffer */
  6417.                       cbWrite,         /* Size must be multiple of 512 */
  6418.                       &cbActualWrote); /* Actual written by DosOpen */
  6419.         if (rc) {
  6420.            printf("DosWrite error: return code = %u\n", rc);
  6421.            return 1;
  6422.         }
  6423.         if (cbActualRead != cbActualWrote) {
  6424.            printf("Bytes read (%u) does not equal bytes written (%u)\n",
  6425.                   cbActualRead, cbActualWrote);
  6426.            return 1;
  6427.         }
  6428.         cbTotal += cbActualRead; /* Update total transferred */
  6429.      }
  6430.  
  6431.      printf("Transfer successfully %d bytes from disk #1 to disk #2.\n",
  6432.             cbTotal);
  6433.  
  6434.      /* Free allocated memmory */
  6435.      rc = DosFreeMem(pBuffer);
  6436.      if (rc != NO_ERROR) {
  6437.         printf("DosFreeMem error: return code = %u\n", rc);
  6438.         return 1;
  6439.      }
  6440.  
  6441.      rc = DosClose(hfDisk1);
  6442.      if (rc != NO_ERROR) {
  6443.         printf("DosClose error: return code = %u\n", rc);
  6444.         return 1;
  6445.      }
  6446.  
  6447.      rc = DosClose(hfDisk2);
  6448.      if (rc != NO_ERROR) {
  6449.         printf("DosClose error: return code = %u\n", rc);
  6450.         return 1;
  6451.      }
  6452.   return NO_ERROR;
  6453.   }
  6454.  
  6455.  
  6456. ΓòÉΓòÉΓòÉ 3.6. DosWrite ΓòÉΓòÉΓòÉ
  6457.  
  6458. Purpose 
  6459.  
  6460. DosWrite writes a specified number of bytes from a buffer to the specified disk 
  6461.  
  6462. Syntax 
  6463.  
  6464. #define INCL_DOSFILEMGR
  6465. #include <os2.h>
  6466.  
  6467.  APIRET DosWrite (HFILE hFile,  PVOID pBuffer, ULONG cbWrite, PULONG pcbActual) 
  6468.  
  6469.  Parameters 
  6470.  
  6471.  hFile (HFILE) - input 
  6472.            File handle obtained from DosOpen. 
  6473.  
  6474.  pBuffer (PVOID) - input 
  6475.            Address of the buffer that contains the data to write. 
  6476.  
  6477.  cbWrite (ULONG) - input 
  6478.            The number of bytes to write. The raw file system requires that the 
  6479.            number of bytes be a multiple of the sector size (512). 
  6480.  
  6481.  pcbActual (PULONG) - output 
  6482.            Address of the variable to receive the number of bytes actually 
  6483.            written. 
  6484.  
  6485.  Returns 
  6486.  
  6487.  ulrc (APIRET) - returns 
  6488.            Return Code. 
  6489.  
  6490.            DosWrite returns one of the following values: 
  6491.  
  6492.            0              NO_ERROR 
  6493.  
  6494.            5               ERROR_ACCESS_DENIED 
  6495.  
  6496.            6              ERROR_INVALID_HANDLE 
  6497.  
  6498.            19              ERROR_WRITE_PROTECT 
  6499.  
  6500.            26             ERROR_NOT_DOS_DISK 
  6501.  
  6502.            29              ERROR_WRITE_FAULT 
  6503.  
  6504.            33             ERROR_LOCK_VIOLATION 
  6505.  
  6506.            87             ERROR_INVALID_PARAMETER 
  6507.  
  6508.            109            ERROR_BROKEN_PIPE 
  6509.  
  6510.  Remarks 
  6511.  
  6512.  DosWrite begins writing at the current file pointer position. The file pointer 
  6513.  is updated to where the write completed. 
  6514.  
  6515.  If there is not enough space on the disk or diskette to write all of the bytes 
  6516.  specified by cbWrite, the DosWrite does not write any bytes. An error is 
  6517.  returned and pcbActual is set to zero. 
  6518.  
  6519.  Using the raw file system on logical partitions requires you to lock and 
  6520.  unlock the volume using the DosDevIOCtl Category 8, DSK_LOCKDRIVE and 
  6521.  DSK_UNLOCKDRIVE. Writes will not succeed until the logical drive is locked. 
  6522.  
  6523.  The raw file system requires that the number of bytes written be a multiple of 
  6524.  the sector size (512). 
  6525.  
  6526.  Related Functions 
  6527.  
  6528.      DosOpen 
  6529.  
  6530.      DosListIO 
  6531.  
  6532.      DosRead 
  6533.  
  6534.      DosSetFilePtr 
  6535.  
  6536.  Example Code 
  6537.  
  6538.  The following is NOT a complete usable program.  It is simply intended  to 
  6539.  provide an idea of how to use Raw I/O File System APIs (e.g. DosOpen, DosRead, 
  6540.  DosWrite, DosSetFilePtr, and DosClose). 
  6541.  
  6542.  This example opens physical disk #1 for reading and physical disk #2  for 
  6543.  writing.  DosSetFilePtr is used to set the pointer to the beginning of the 
  6544.  disks. Using DosRead and DosWrite, 10 megabytes of data is transferred from 
  6545.  disk #1 to disk #2. Finally, DosClosed is issued to close the disk handles. 
  6546.  
  6547.  It is assumed that the size of each of the two disks is at least 10 megabytes. 
  6548.  
  6549.   #define INCL_DOSFILEMGR          /* Include File Manager APIs */
  6550.   #define INCL_DOSMEMMGR           /* Includes Memory Management APIs */
  6551.   #define INCL_DOSERRORS           /* DOS Error values */
  6552.   #include <os2.h>
  6553.   #include <stdio.h>
  6554.   #include <string.h>
  6555.  
  6556.   #define SIXTY_FOUR_K 0x10000
  6557.   #define ONE_MEG     0x100000
  6558.   #define TEN_MEG     10*ONE_MEG
  6559.  
  6560.   #define UNC_DISK1  "\\\\.\\Physical_Disk1"
  6561.   #define UNC_DISK2  "\\\\.\\Physical_Disk2"
  6562.  
  6563.   int main(void) {
  6564.      HFILE  hfDisk1        = 0;      /* Handle for disk #1 */
  6565.      HFILE  hfDisk2        = 0;      /* Handle for disk #2 */
  6566.      ULONG  ulAction       = 0;      /* Action taken by DosOpen */
  6567.      ULONG  cbRead         = 0;      /* Bytes to read */
  6568.      ULONG  cbActualRead   = 0;      /* Bytes read by DosRead */
  6569.      ULONG  cbWrite        = 0;      /* Bytes to write */
  6570.      ULONG  ulLocation     = 0;
  6571.      ULONG  cbActualWrote  = 0;      /* Bytes written by DosWrite */
  6572.      UCHAR  uchFileName1[20]  = UNC_DISK1, /* UNC Name of disk 1 */
  6573.             uchFileName2[20]  = UNC_DISK2; /* UNC Name of disk 2 */
  6574.      PBYTE  pBuffer        = 0;
  6575.      ULONG  cbTotal        = 0;
  6576.  
  6577.      APIRET rc             = NO_ERROR;            /* Return code */
  6578.  
  6579.      /* Open a raw file system disk #1 for reading */
  6580.      rc = DosOpen(uchFileName1,               /* File name */
  6581.                   &hfDisk1,                   /* File handle */
  6582.                   &ulAction,                  /* Action taken by DosOpen */
  6583.                   0L,                         /* no file size */
  6584.                   FILE_NORMAL,                /* File attribute */
  6585.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  6586.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  6587.                   OPEN_ACCESS_READONLY,
  6588.                   0L);                        /* No extented attributes */
  6589.      if (rc != NO_ERROR) {
  6590.         printf("DosOpen error rc = %u\n", rc);
  6591.         return(1);
  6592.      } /* endif */
  6593.  
  6594.      /* Set the pointer to the begining of the disk */
  6595.      rc = DosSetFilePtr(hfDisk1,      /* Handle for disk 1 */
  6596.                         0L,           /* Offset must be multiple of 512 */
  6597.                         FILE_BEGIN,   /* Begin of the disk */
  6598.                         &ulLocation); /* New pointer location */
  6599.      if (rc != NO_ERROR) {
  6600.         printf("DosSetFilePtr error rc = %u\n", rc);
  6601.         return(1);
  6602.      } /* endif */
  6603.  
  6604.      /* Open a raw file system disk #2 for writing */
  6605.      rc = DosOpen(uchFileName2,               /* File name */
  6606.                   &hfDisk2,                   /* File handle */
  6607.                   &ulAction,                  /* Action taken by DosOpen */
  6608.                   0L,                         /* no file size */
  6609.                   FILE_NORMAL,                /* File attribute */
  6610.                   OPEN_ACTION_OPEN_IF_EXISTS, /* Open existing disk */
  6611.                   OPEN_SHARE_DENYNONE |       /* Access mode */
  6612.                   OPEN_ACCESS_READWRITE,
  6613.                   0L);                        /* No extented attributes */
  6614.      if (rc != NO_ERROR) {
  6615.         printf("DosOpen error rc = %u\n", rc);
  6616.         return(1);
  6617.      } /* endif */
  6618.  
  6619.      /* Set the pointer to the begining of the disk */
  6620.      rc = DosSetFilePtr(hfDisk2,      /* Handle for disk 1 */
  6621.                         0L,           /* Offset must be multiple of 512 */
  6622.                         FILE_BEGIN,   /* Begin of the disk */
  6623.                         &ulLocation); /* New pointer location */
  6624.      if (rc != NO_ERROR) {
  6625.         printf("DosSetFilePtr error rc = %u\n", rc);
  6626.         return(1);
  6627.      } /* endif */
  6628.  
  6629.  
  6630.      /* Allocate 64K of memory for transfer operations */
  6631.      rc = DosAllocMem((PPVOID)&pBuffer, /* Pointer to buffer */
  6632.                        SIXTY_FOUR_K,      /* Buffer size */
  6633.                        PAG_COMMIT |     /* Allocation flags */
  6634.                        PAG_READ |
  6635.                        PAG_WRITE);
  6636.      if (rc != NO_ERROR) {
  6637.         printf("DosAllocMem error rc = %u\n", rc);
  6638.         return(1);
  6639.      } /* endif */
  6640.  
  6641.      cbRead = SIXTY_FOUR_K;
  6642.      while (rc == NO_ERROR && cbTotal < TEN_MEG) {
  6643.  
  6644.         /* Read from #1 */
  6645.         rc = DosRead(hfDisk1,         /* Handle for disk 1 */
  6646.                      pBuffer,         /* Pointer to buffer */
  6647.                      cbRead,          /* Size must be multiple of 512 */
  6648.                      &cbActualRead);  /* Actual read by DosOpen */
  6649.         if (rc) {
  6650.            printf("DosRead error: return code = %u\n", rc);
  6651.            return 1;
  6652.         }
  6653.  
  6654.         /* Write to disk #2 */
  6655.         cbWrite = cbActualRead;
  6656.         rc = DosWrite(hfDisk2,         /* Handle for disk 2 */
  6657.                       pBuffer,         /* Pointer to buffer */
  6658.                       cbWrite,         /* Size must be multiple of 512 */
  6659.                       &cbActualWrote); /* Actual written by DosOpen */
  6660.         if (rc) {
  6661.            printf("DosWrite error: return code = %u\n", rc);
  6662.            return 1;
  6663.         }
  6664.         if (cbActualRead != cbActualWrote) {
  6665.            printf("Bytes read (%u) does not equal bytes written (%u)\n",
  6666.                   cbActualRead, cbActualWrote);
  6667.            return 1;
  6668.         }
  6669.         cbTotal += cbActualRead; /* Update total transferred */
  6670.      }
  6671.  
  6672.      printf("Transfer successfully %d bytes from disk #1 to disk #2.\n",
  6673.             cbTotal);
  6674.  
  6675.      /* Free allocated memmory */
  6676.      rc = DosFreeMem(pBuffer);
  6677.      if (rc != NO_ERROR) {
  6678.         printf("DosFreeMem error: return code = %u\n", rc);
  6679.         return 1;
  6680.      }
  6681.  
  6682.      rc = DosClose(hfDisk1);
  6683.      if (rc != NO_ERROR) {
  6684.         printf("DosClose error: return code = %u\n", rc);
  6685.         return 1;
  6686.      }
  6687.  
  6688.      rc = DosClose(hfDisk2);
  6689.      if (rc != NO_ERROR) {
  6690.         printf("DosClose error: return code = %u\n", rc);
  6691.         return 1;
  6692.      }
  6693.   return NO_ERROR;
  6694.   }
  6695.  
  6696.  
  6697. ΓòÉΓòÉΓòÉ 4. Network APIs ΓòÉΓòÉΓòÉ
  6698.  
  6699. This chapter contains an alphabetic list of the following Server Category APIs. 
  6700.  
  6701.      NetServerNameAdd or Net32ServerNameAdd 
  6702.  
  6703.      NetServerNameDel or Net32ServerNameDel 
  6704.  
  6705.      NetServerNameEnum or Net32ServerNameEnum 
  6706.  
  6707.  A number of Network APIs are multiple server name aware and will work in the 
  6708.  context of a servername, if the first parameter (the servername) is provided. 
  6709.  If no servername is provided and the API is issued locally, then the 
  6710.  information returned may be for shares, device queues, or sessions that exist 
  6711.  across all server names. If name conflicts exist, such as two shares with the 
  6712.  same name on different servernames, the API may act on the first match it 
  6713.  finds when no servername has been provided.The APIs that are multiple server 
  6714.  name aware include: 
  6715.  
  6716.  Serial Device Category 
  6717.  
  6718.      NetCharDevQEnum 
  6719.  
  6720.      NetCharDevQGetInfo 
  6721.  
  6722.      NetCharDevQSetInfo 
  6723.  
  6724.      NetCharDevQPurge 
  6725.  
  6726.      NetCharDevQPurgeSelf 
  6727.  
  6728.  Share Category 
  6729.  
  6730.      NetShareEnum 
  6731.  
  6732.      NetShareGetInfo 
  6733.  
  6734.      NetShareSetInfo 
  6735.  
  6736.      NetShareAdd 
  6737.  
  6738.      NetShareDel 
  6739.  
  6740.      NetShareCheck 
  6741.  
  6742.  Session Category 
  6743.  
  6744.      NetSessionEnum 
  6745.  
  6746.      NetSessionGetInfo 
  6747.  
  6748.      NetSessionDel 
  6749.  
  6750.  Connection Category 
  6751.  
  6752.      NetConnectionEnum 
  6753.  
  6754.  
  6755. ΓòÉΓòÉΓòÉ 4.1. NetServerNameAdd or Net32ServerNameAdd ΓòÉΓòÉΓòÉ
  6756.  
  6757. Purpose 
  6758.  
  6759. NetServerNameAdd adds a secondary server computername to a server allowing 
  6760. network requests directed to the sceondary server name to be received and 
  6761. processed by the server. 
  6762.  
  6763. Syntax 
  6764.  
  6765. #include <netcons.h>
  6766. #include <server.h>
  6767.  
  6768.  NetServerNameAdd const UCHAR LSFAR* pszServerName, const UCHAR 
  6769.            LSFAR* pszAddName) 
  6770.  
  6771.  Net32ServerNameAdd const UCHAR LSFAR* pszServerName, const UCHAR 
  6772.            LSFAR* pszAddName) 
  6773.  
  6774.  Parameters 
  6775.  
  6776.  pszServerName (const UCHAR LSFAR*) -input 
  6777.            Points to a NULL-terminated string containing the name of the server 
  6778.            to be added. 
  6779.  
  6780.  pszAddName (const UCHAR LSFAR*) -input 
  6781.  
  6782.  Returns 
  6783.  
  6784.  ulrc (APIRET) - returns 
  6785.            Return Code. 
  6786.  
  6787.            NetServerNameAdd or Net32ServerNameAdd returns one of the following 
  6788.            values: 
  6789.  
  6790.            0              NERR_Success 
  6791.  
  6792.            5              ERROR_ACCESS_DENIED 
  6793.  
  6794.            52             ERROR_DUP_NAME 
  6795.  
  6796.            53             ERROR_BAD_NETPATH 
  6797.  
  6798.            54             ERROR_NETWORK_BUSY 
  6799.  
  6800.            56             ERROR_TOO_MANY_CMDS 
  6801.  
  6802.            59             ERROR_UNEXP_NET_ERR 
  6803.  
  6804.            68             ERROR_TOO_MANY_NAMES 
  6805.  
  6806.            71             ERROR_REQ_NOT_ACCEP 
  6807.  
  6808.            87             ERROR_INVALID_PARAMETER 
  6809.  
  6810.            2102           NERR_NetNotStarted 
  6811.  
  6812.            2114           NERR_ServerNotStarted 
  6813.  
  6814.            2140           NERR_InternalError 
  6815.  
  6816.            2141           NERR_BadTransactConfig 
  6817.  
  6818.            2142           NERR_InvalidAPI 
  6819.  
  6820.            2468           NERR_TooManySrvNames 
  6821.  
  6822.  Remarks 
  6823.  
  6824.  The maximum number of names a server can support is defined by the manifest 
  6825.  SV_MAX_SRV_NAMES in server.h. 
  6826.  
  6827.  The machine must also be properly configured for the additional Netbios names 
  6828.  required as specified by the names parameter on the NETx= line of the 
  6829.  IBMLAN.INI file. 
  6830.  
  6831.  This API can be called from OS/2 workstations. Administrative or server 
  6832.  operator authority is required to call this API. 
  6833.  
  6834.  Related Functions 
  6835.  
  6836.      NetServerNameDel 
  6837.  
  6838.      NetServerNameEnum 
  6839.  
  6840.  Example Code 
  6841.  
  6842.  This example adds a servername called "Server18", then enumerates the server 
  6843.  names in use and finally removes the "Server18" servername. 
  6844.  
  6845.   #define PURE_32
  6846.   #define INCL_DOS
  6847.   #define INCL_DOSERRORS
  6848.   #include <os2.h>
  6849.   #include <stdio.h>
  6850.   #include <stdlib.h>
  6851.   #include <string.h>
  6852.   #include <netcons.h>
  6853.   #include <server.h>
  6854.   int main(VOID)
  6855.   {
  6856.  
  6857.      struct server_info_0 LSFAR * pBuffer; /* pointer to enum return info */
  6858.      ULONG  ulBufLen=4096;                 /* length in bytes of enum buffer */
  6859.      ULONG  ulLevel=0;                     /* enum return info level */
  6860.      ULONG  ulEntriesRead=0;               /* total entries read from enum */
  6861.      ULONG  ulEntriesAvail=0;              /* total entries available from enum */
  6862.      CHAR   achServer[CNLEN+1];            /* remote server name or '\0' */
  6863.      CHAR   achName[CNLEN+1];              /* server name to add and delete */
  6864.      ULONG  ulReturnCode=0;                /* return code */
  6865.  
  6866.      strcpy(achName,"Server18");         /* initialize servername to use */
  6867.      achServer[0] = '\0';                  /* initialize for local API call */
  6868.  
  6869.      ulReturnCode = Net32ServerNameAdd(achServer,achName);
  6870.  
  6871.      if (ulReturnCode == NO_ERROR)
  6872.      {
  6873.         if ((pBuffer = malloc(ulBufLen)) != NULL)
  6874.         {
  6875.            ulReturnCode = Net32ServerNameEnum(achServer,
  6876.                                               ulLevel,
  6877.                                               (unsigned char *)pBuffer,
  6878.                                               ulBufLen,
  6879.                                               &ulEntriesRead,
  6880.                                               &ulEntriesAvail);
  6881.  
  6882.  
  6883.            if (ulReturnCode == NO_ERROR || ulReturnCode == ERROR_MORE_DATA)
  6884.            {
  6885.               printf("Total entries read == %u\n",ulEntriesRead);
  6886.               printf("Total entries available == %u\n",ulEntriesAvail);
  6887.               printf("Server names are:\n");
  6888.  
  6889.               while (ulEntriesRead) {
  6890.                  printf("\t%s\n",pBuffer->sv0_name);  /* print out name */
  6891.                  pBuffer++;                           /* advance to next entry */
  6892.                  ulEntriesRead--;                     /* dec entries displayed */
  6893.               } /* endwhile */
  6894.            }
  6895.            else
  6896.            {
  6897.               printf("Net32ServerNameEnum() error: return code = %u.\n",
  6898.                      ulReturnCode);
  6899.               Net32ServerNameDel(achServer,achName);
  6900.               return 1;
  6901.            }
  6902.         } else {
  6903.            printf("malloc() failed!\n");
  6904.            return 1;
  6905.         }
  6906.  
  6907.         ulReturnCode = Net32ServerNameDel(achServer,achName);
  6908.  
  6909.         if (ulReturnCode != NO_ERROR)
  6910.         {
  6911.            printf("Net32ServerNameDel() error: return code = %u.\n",
  6912.                   ulReturnCode);
  6913.            return 1;
  6914.         }
  6915.      }
  6916.      else
  6917.      {
  6918.          printf("Net32ServerNameAdd() error: return code = %u.\n",
  6919.                 ulReturnCode);
  6920.          return 1;
  6921.      }
  6922.  
  6923.      return NO_ERROR;
  6924.   }
  6925.  
  6926.  
  6927. ΓòÉΓòÉΓòÉ 4.2. NetServerNameDel or Net32ServerNameDel ΓòÉΓòÉΓòÉ
  6928.  
  6929. Purpose 
  6930.  
  6931. NetServerNameDel removes a secondary server computername from a server and 
  6932. removes all shares and closes all sessions established to that name. 
  6933.  
  6934. Syntax 
  6935.  
  6936. #include <netcons.h>
  6937. #include <server.h>
  6938.  
  6939.  NetServerNameDel const UCHAR LSFAR* pszServerName, const UCHAR LSFAR*, 
  6940.            pszDelName) 
  6941.  
  6942.  Net32ServerNameDel const UCHAR LSFAR* pszServerName, const UCHAR LSFAR*, 
  6943.            pszDelName) 
  6944.  
  6945.  Parameters 
  6946.  
  6947.  pszServerName(const UCHAR LSFAR*) - input 
  6948.            Points to a NULL-terminated string containing the server name to be 
  6949.            deleted. 
  6950.  
  6951.  pszDelName(const UCHAR LSFAR*) - input 
  6952.  
  6953.  Returns 
  6954.  
  6955.  ulrc (APIRET) - returns 
  6956.            Return Code. 
  6957.  
  6958.            NetServerNameDel or Net32ServerNameDel returns one of the following 
  6959.            values: 
  6960.  
  6961.            0              NERR_Success 
  6962.  
  6963.            5              ERROR_ACCESS_DENIED 
  6964.  
  6965.            53             ERROR_BAD_NETPATH 
  6966.  
  6967.            54             ERROR_NETWORK_BUSY 
  6968.  
  6969.            56             ERROR_TOO_MANY_CMDS 
  6970.  
  6971.            59             ERROR_UNEXP_NET_ERR 
  6972.  
  6973.            71             ERROR_REQ_NOT_ACCEP 
  6974.  
  6975.            87             ERROR_INVALID_PARAMETER 
  6976.  
  6977.            2102           NERR_NetNotStarted 
  6978.  
  6979.            2114           NERR_ServerNotStarted 
  6980.  
  6981.            2140           NERR_InternalError 
  6982.  
  6983.            2141           NERR_BadTransactConfig 
  6984.  
  6985.            2142           NERR_InvalidAPI 
  6986.  
  6987.            2460           NERR_NoSuchServer 
  6988.  
  6989.            2469           NERR_DelPrimaryName 
  6990.  
  6991.  Remarks 
  6992.  
  6993.  Only secondary server names can be deleted by the API. An attempt to delete 
  6994.  the primary server name will result in NERR_DelPrimaryName being returned. 
  6995.  
  6996.  If a name successfully deleted had sessions to it, then the name may still 
  6997.  show in NetServerNameEnum and may not be re-added until the server has 
  6998.  completed closing all sessions established to that name. 
  6999.  
  7000.  Any shares that were added to the deleted name will also be removed. 
  7001.  
  7002.  This API can be called from OS/2 workstations. Administrative or server 
  7003.  operator authority is required to call this API. 
  7004.  
  7005.  Related Functions 
  7006.  
  7007.      NetServerNameAdd 
  7008.  
  7009.      NetServerNameEnum 
  7010.  
  7011.  Example Code 
  7012.  
  7013.  This example adds a servername called "Server18", then enumerates the server 
  7014.  names in use and finally removes the "Server18" servername. 
  7015.  
  7016.   #define PURE_32
  7017.   #define INCL_DOS
  7018.   #define INCL_DOSERRORS
  7019.   #include <os2.h>
  7020.   #include <stdio.h>
  7021.   #include <stdlib.h>
  7022.   #include <string.h>
  7023.   #include <netcons.h>
  7024.   #include <server.h>
  7025.   int main(VOID)
  7026.   {
  7027.  
  7028.      struct server_info_0 LSFAR * pBuffer; /* pointer to enum return info */
  7029.      ULONG  ulBufLen=4096;                 /* length in bytes of enum buffer */
  7030.      ULONG  ulLevel=0;                     /* enum return info level */
  7031.      ULONG  ulEntriesRead=0;               /* total entries read from enum */
  7032.      ULONG  ulEntriesAvail=0;              /* total entries available from enum */
  7033.      CHAR   achServer[CNLEN+1];            /* remote server name or '\0' */
  7034.      CHAR   achName[CNLEN+1];              /* server name to add and delete */
  7035.      ULONG  ulReturnCode=0;                /* return code */
  7036.  
  7037.      strcpy(achName,"Server18");         /* initialize servername to use */
  7038.      achServer[0] = '\0';                  /* initialize for local API call */
  7039.  
  7040.      ulReturnCode = Net32ServerNameAdd(achServer,achName);
  7041.  
  7042.      if (ulReturnCode == NO_ERROR)
  7043.      {
  7044.         if ((pBuffer = malloc(ulBufLen)) != NULL)
  7045.         {
  7046.            ulReturnCode = Net32ServerNameEnum(achServer,
  7047.                                               ulLevel,
  7048.                                               (unsigned char *)pBuffer,
  7049.                                               ulBufLen,
  7050.                                               &ulEntriesRead,
  7051.                                               &ulEntriesAvail);
  7052.  
  7053.  
  7054.            if (ulReturnCode == NO_ERROR || ulReturnCode == ERROR_MORE_DATA)
  7055.            {
  7056.               printf("Total entries read == %u\n",ulEntriesRead);
  7057.               printf("Total entries available == %u\n",ulEntriesAvail);
  7058.               printf("Server names are:\n");
  7059.  
  7060.               while (ulEntriesRead) {
  7061.                  printf("\t%s\n",pBuffer->sv0_name);  /* print out name */
  7062.                  pBuffer++;                           /* advance to next entry */
  7063.                  ulEntriesRead--;                     /* dec entries displayed */
  7064.               } /* endwhile */
  7065.            }
  7066.            else
  7067.            {
  7068.               printf("Net32ServerNameEnum() error: return code = %u.\n",
  7069.                      ulReturnCode);
  7070.               Net32ServerNameDel(achServer,achName);
  7071.               return 1;
  7072.            }
  7073.         } else {
  7074.            printf("malloc() failed!\n");
  7075.            return 1;
  7076.         }
  7077.  
  7078.         ulReturnCode = Net32ServerNameDel(achServer,achName);
  7079.  
  7080.         if (ulReturnCode != NO_ERROR)
  7081.         {
  7082.            printf("Net32ServerNameDel() error: return code = %u.\n",
  7083.                   ulReturnCode);
  7084.            return 1;
  7085.         }
  7086.      }
  7087.      else
  7088.      {
  7089.          printf("Net32ServerNameAdd() error: return code = %u.\n",
  7090.                 ulReturnCode);
  7091.          return 1;
  7092.      }
  7093.  
  7094.      return NO_ERROR;
  7095.   }
  7096.  
  7097.  
  7098. ΓòÉΓòÉΓòÉ 4.3. NetServerNameEnum or Net32ServerNameEnum ΓòÉΓòÉΓòÉ
  7099.  
  7100. Purpose 
  7101.  
  7102. NetServerNameEnum enumerates the set of computernames by which a server is 
  7103. known by on the network. 
  7104.  
  7105. Syntax 
  7106.  
  7107. #include <netcons.h>
  7108. #include <server.h>
  7109.  
  7110.  NetServerNameEnum const UCHAR LSFAR* pszServerName, SHORT sLevel, UCHAR 
  7111.            LSFAR* buf, USHORT usBuflen, USHORT LSFAR* pusEntriesReturned, 
  7112.            USHORT LSFAR* pusEntriesAvail) 
  7113.  
  7114.  Net32ServerNameEnum const UCHAR pszServerName, ULONG ulLevel, UCHAR* Buf, 
  7115.            ULONG ulBuflen,  ULONG* pulEntriesReturned, ULONG* pulEntriesAvail) 
  7116.  
  7117.  Parameters 
  7118.  
  7119.  pszServerName(const UCHAR LSFAR*) - input 
  7120.            Points to a string containing the network name of the server. 
  7121.  
  7122.  sLevel(SHORT)- input 
  7123.            Specifies the level of detail (MBZ) for the server_info data 
  7124.            structure, as described in Server Level 0. Other levels such as 1, 
  7125.            2, 3 and 20 are not valid for NetServerNameEnum. 
  7126.  
  7127.  buf(UCHAR*)-output 
  7128.            Points to the local buffer address of the data structure to be sent 
  7129.            or received. 
  7130.  
  7131.  usBuflen(USHORT) or (ULONG)-input 
  7132.            Specifies the amount of local memory allocated to the buf data 
  7133.            structure. 
  7134.  
  7135.  pusEntriesReturned(USHORT LSFAR*) or pulEntriesReturned(ULONG*) or 
  7136.  (PULONG)-output 
  7137.            Points to the number of data structures returned. 
  7138.  
  7139.  pusEntriesAvail(USHORT LSFAR*) orpusEntriesAvail (ULONG*) or (PULONG)-output 
  7140.            Points to the number of data structures currently available. 
  7141.  
  7142.  ulLevel(ULONG)-input 
  7143.            Specifies the level of detail (MBZ) for the server_info data 
  7144.            structure, as described in Server Level 0. Other levels such as 1, 
  7145.            2, 3 and 20 are not valid for NetServerNameEnum. 
  7146.  
  7147.  Returns 
  7148.  
  7149.  ulrc (APIRET) - returns for 32-bit 
  7150.  
  7151.  ushort (APIRET) - returns for 16-bit 
  7152.            Return Code. 
  7153.  
  7154.            NetServerNameEnum orNet32ServerNameEnum returns one of the following 
  7155.            values: 
  7156.  
  7157.            0              NERR_Success 
  7158.  
  7159.            5              ERROR_ACCESS_DENIED 
  7160.  
  7161.            124            ERROR_INVALID_LEVEL 
  7162.  
  7163.            234            ERROR_MORE_DATA 
  7164.  
  7165.            2102           NERR_NetNotStarted 
  7166.  
  7167.            2114           NERR_ServerNotStarted 
  7168.  
  7169.            2140           NERR_InternalError 
  7170.  
  7171.            2141           NERR_BadTransactConfig 
  7172.  
  7173.            2142           NERR_InvalidAPI 
  7174.  
  7175.  Remarks 
  7176.  
  7177.  If you call this API with the buffer length parameter equal to zero, the API 
  7178.  returns a value for total entries available. This technique is useful if you 
  7179.  do not know the exact buffer size required. 
  7180.  
  7181.  The NetServerNameEnum API can obtain only level 0 data structures. 
  7182.  
  7183.  This API returns the list of server names being used by a server. This may 
  7184.  include names in the process of being added or deleted, not just active server 
  7185.  names. 
  7186.  
  7187.  The set of server names returned will always list the primary server name 
  7188.  first, and if there are no other server names in use, the primary server name 
  7189.  will be the only name returned in the return buffer. 
  7190.  
  7191.  This API can be called from OS/2 workstations. Administrative or server 
  7192.  operator authority is required to call this API. 
  7193.  
  7194.  Related Functions 
  7195.  
  7196.      NetServerNameAdd 
  7197.  
  7198.      NetServerNameDel 
  7199.  
  7200.  Example Code 
  7201.  
  7202.  This example adds a servername called "Server18", then enumerates the server 
  7203.  names in use and finally removes the "Server18"" servername. 
  7204.  
  7205.   #define PURE_32
  7206.   #define INCL_DOS
  7207.   #define INCL_DOSERRORS
  7208.   #include <os2.h>
  7209.   #include <stdio.h>
  7210.   #include <stdlib.h>
  7211.   #include <string.h>
  7212.   #include <netcons.h>
  7213.   #include <server.h>
  7214.   int main(VOID)
  7215.   {
  7216.  
  7217.      struct server_info_0 LSFAR * pBuffer; /* pointer to enum return info */
  7218.      ULONG  ulBufLen=4096;                 /* length in bytes of enum buffer */
  7219.      ULONG  ulLevel=0;                     /* enum return info level */
  7220.      ULONG  ulEntriesRead=0;               /* total entries read from enum */
  7221.      ULONG  ulEntriesAvail=0;              /* total entries available from enum */
  7222.      CHAR   achServer[CNLEN+1];            /* remote server name or '\0' */
  7223.      CHAR   achName[CNLEN+1];              /* server name to add and delete */
  7224.      ULONG  ulReturnCode=0;                /* return code */
  7225.  
  7226.      strcpy(achName,"Server18");         /* initialize servername to use */
  7227.      achServer[0] = '\0';                  /* initialize for local API call */
  7228.  
  7229.      ulReturnCode = Net32ServerNameAdd(achServer,achName);
  7230.  
  7231.      if (ulReturnCode == NO_ERROR)
  7232.      {
  7233.         if ((pBuffer = malloc(ulBufLen)) != NULL)
  7234.         {
  7235.            ulReturnCode = Net32ServerNameEnum(achServer,
  7236.                                               ulLevel,
  7237.                                               (unsigned char *)pBuffer,
  7238.                                               ulBufLen,
  7239.                                               &ulEntriesRead,
  7240.                                               &ulEntriesAvail);
  7241.  
  7242.  
  7243.            if (ulReturnCode == NO_ERROR || ulReturnCode == ERROR_MORE_DATA)
  7244.            {
  7245.               printf("Total entries read == %u\n",ulEntriesRead);
  7246.               printf("Total entries available == %u\n",ulEntriesAvail);
  7247.               printf("Server names are:\n");
  7248.  
  7249.               while (ulEntriesRead) {
  7250.                  printf("\t%s\n",pBuffer->sv0_name);  /* print out name */
  7251.                  pBuffer++;                           /* advance to next entry */
  7252.                  ulEntriesRead--;                     /* dec entries displayed */
  7253.               } /* endwhile */
  7254.            }
  7255.            else
  7256.            {
  7257.               printf("Net32ServerNameEnum() error: return code = %u.\n",
  7258.                      ulReturnCode);
  7259.               Net32ServerNameDel(achServer,achName);
  7260.               return 1;
  7261.            }
  7262.         } else {
  7263.            printf("malloc() failed!\n");
  7264.            return 1;
  7265.         }
  7266.  
  7267.         ulReturnCode = Net32ServerNameDel(achServer,achName);
  7268.  
  7269.         if (ulReturnCode != NO_ERROR)
  7270.         {
  7271.            printf("Net32ServerNameDel() error: return code = %u.\n",
  7272.                   ulReturnCode);
  7273.            return 1;
  7274.         }
  7275.      }
  7276.      else
  7277.      {
  7278.          printf("Net32ServerNameAdd() error: return code = %u.\n",
  7279.                 ulReturnCode);
  7280.          return 1;
  7281.      }
  7282.  
  7283.      return NO_ERROR;
  7284.   }
  7285.  
  7286.  
  7287. ΓòÉΓòÉΓòÉ 5. Windows Functions ΓòÉΓòÉΓòÉ
  7288.  
  7289.  
  7290. ΓòÉΓòÉΓòÉ 5.1. WinRestartWorkplace ΓòÉΓòÉΓòÉ
  7291.  
  7292. Purpose 
  7293.  
  7294. This function causes the Workplace process to terminate and re-initialize. 
  7295.  
  7296. This function is applicable to OS/2 Warp 4, or higher, and WorkSpace On-Demand 
  7297. client operating systems. 
  7298.  
  7299. Syntax 
  7300.  
  7301. #include <os2.h>
  7302.  
  7303. BOOL32 APIENTRY WinRestartWorkplace(VOID);
  7304.  
  7305. Parameters 
  7306.  
  7307. None. 
  7308.  
  7309. Returns 
  7310.  
  7311.  rc (BOOL32) - returns 
  7312.            Always returns FALSE. 
  7313.  
  7314.  Remarks 
  7315.  
  7316.  This function will cause the Workplace process to terminate and re-initialize. 
  7317.  This call is useful in debugging workplace objects or for install programs 
  7318.  that reregister system classes. 
  7319.  
  7320.  Example Code 
  7321.  
  7322.  This example terminates and re-initializes the Workplace process. 
  7323.  
  7324.   #include <os2.h>
  7325.   BOOL32 EXPENTRY WinRestartWorkplace(VOID);
  7326.  
  7327.   /* Terminate and re-initialize the Workplace process */
  7328.   WinRestartWorkplace();
  7329.  
  7330.  
  7331. ΓòÉΓòÉΓòÉ 6. IOCtls ΓòÉΓòÉΓòÉ
  7332.  
  7333. This chapter contains the following IOCtl commands. 
  7334.  
  7335. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7336. ΓöéCategory        ΓöéFunction        ΓöéDescription                      Γöé
  7337. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7338. Γöé08h             Γöé69h             ΓöéLogical Volume Management        Γöé
  7339. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7340. Γöé80h             Γöé0Eh             ΓöéQuery HardDrive Geometry and     Γöé
  7341. Γöé                Γöé                ΓöéPhysical Parameters              Γöé
  7342. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7343.  
  7344.  
  7345. ΓòÉΓòÉΓòÉ 6.1. Logical Volume Management-DSK_LVMMGMT(69h) ΓòÉΓòÉΓòÉ
  7346.  
  7347. Purpose 
  7348.  
  7349.  This IOCtl may be used with any logical volume to which a drive letter has 
  7350. been assigned. This function will be used by FORMAT and will also be of use to 
  7351. those writing disk utilities for OS/2. 
  7352.  
  7353. Parameter Packet Format 
  7354.  
  7355. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7356. ΓöéField                      Length              C Datatype         Γöé
  7357. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7358. ΓöéCommand Information        BYTE                UCHAR              Γöé
  7359. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7360. ΓöéDrive Unit                 BYTE                UCHAR              Γöé
  7361. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7362. ΓöéTable Number               WORD                USHORT             Γöé
  7363. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7364. ΓöéLSN                        4 BYTES             ULONG              Γöé
  7365. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7366.  
  7367.  Command Information 
  7368.       Command information may be: 
  7369.  
  7370.       0              Identify Volume Type 
  7371.  
  7372.       1              Enable Bad Block Relocation 
  7373.  
  7374.       2              Disable Bad Block Relocation 
  7375.  
  7376.       3              Get Bad Block Information 
  7377.  
  7378.       4              Get Table Size 
  7379.  
  7380.       5              Get Relocated Sector List 
  7381.  
  7382.       6              Get Relocated Data 
  7383.  
  7384.       7              Remove Relocation Table Entry 
  7385.  
  7386.       8              Clear Relocation Table 
  7387.  
  7388.       9              Get Drive Name 
  7389.  
  7390.       The Identify Volume Type command provides a way to determine whether a 
  7391.       volume is a Compatibility or LVM Volume. 
  7392.  
  7393.       The Enable Bad Block Relocation command enables bad block relocation on 
  7394.       the specified volume if that volume supports it. 
  7395.  
  7396.       The Disable Bad Block Relocation command disables bad block relocation on 
  7397.       the specified volume. 
  7398.  
  7399.       Get Bad Block Information returns the total number of bad block 
  7400.       relocations which are currently in effect for the specified volume, as 
  7401.       well as the number of relocation tables being used to perform bad block 
  7402.       relocation for the specified volume.  There is one bad block relocation 
  7403.       table per physical disk partition, so, for LVM volumes employing drive 
  7404.       linking, there may be several such tables. 
  7405.  
  7406.       Get Table Size returns the number of active entries in the specified bad 
  7407.       block relocation table, as well as the maximum number of entries that the 
  7408.       table can hold.  The size of a bad block relocation table is dependent 
  7409.       upon the size of the partition it is supporting.  Larger partitions have 
  7410.       larger relocation tables, while smaller partitions have smaller 
  7411.       relocation tables. 
  7412.  
  7413.       Get Relocated Sector List returns an array of Logical Sector Numbers 
  7414.       (LSN).  Each LSN in the array is a sector whose data had to be relocated 
  7415.       because of a problem writing to that sector.  The array returned is 
  7416.       specific to a Relocation Table.  The user supplied buffer must be large 
  7417.       enough to hold the entire array.  The size of the array can be determined 
  7418.       by using the Get Table Size command to find the number of active entries 
  7419.       in the table, and then multiplying that value by the size of a Logical 
  7420.       Sector Number (currently, 4 bytes). 
  7421.  
  7422.       Get Relocated Data returns the data associated with a sector that appears 
  7423.       in a relocation table for the specified volume.  The user supplied buffer 
  7424.       must be at least 512 bytes in length, because 512 bytes are returned. 
  7425.  
  7426.       Remove Relocation Table Entry removes the specified LSN from the 
  7427.       relocation tables on the specified volume.  This function is typically 
  7428.       used by utilities which adjust the file system on a volume so that all 
  7429.       LSNs requiring relocation are removed from use.  Since the file system 
  7430.       will never use these LSNs again, they can be safely removed from the 
  7431.       relocation tables for the volume, thereby freeing those entries to be 
  7432.       used again. 
  7433.  
  7434.       Clear Relocation Table is used to remove all of the entries in a 
  7435.       relocation table in a single operation.  This function is intended to be 
  7436.       used by FORMAT immediately before a long format is performed.  Typically, 
  7437.       FORMAT will disable bad block relocation and clear the bad block 
  7438.       relocation tables prior to a long format so that all bad sectors may be 
  7439.       detected by FORMAT.  FORMAT will place any bad sectors detected into the 
  7440.       bad block list for the appropriate file system. 
  7441.  
  7442.       Get Drive Name is used to return the user defined name associated with 
  7443.       the physical drive on which the specified relocation table resides.  This 
  7444.       function can be used to identify which physical drive contains a specific 
  7445.       relocation table associated with a volume.  The name returned will not 
  7446.       exceed 20 characters. 
  7447.  
  7448.  Drive Unit 
  7449.       Drive Unit is used only when the IOCtl is issued without using a 
  7450.       previously allocated file handle. In this case, the IOCtl must be issued 
  7451.       with a file handle of -1. Drive Unit values are 0=A, 1=B, 2=C, etc. 
  7452.  
  7453.  Table Number 
  7454.       Table Number is the number of the relocation table to operate on. This 
  7455.       field is not used for commands 0-3, and 6-8. 
  7456.  
  7457.  LSN 
  7458.       LSN is the logical sector number of sector requiring relocation. This 
  7459.       field is used only by commands 6 and 7. 
  7460.  
  7461.  Data Packet Format 
  7462.  
  7463.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7464.   ΓöéField                      Length              C Datatype         Γöé
  7465.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7466.   ΓöéReturn Value               BYTE                UCHAR              Γöé
  7467.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7468.   ΓöéBuffer                     4 BYTEs             void*              Γöé
  7469.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7470.  
  7471.  Return Value 
  7472.       Return Value is set by every command that this IOCtl accepts. The 
  7473.       specific meaning of the value it is set to is dependent upon the command 
  7474.       issued. 
  7475.  
  7476.  Buffer 
  7477.       Buffer is a pointer to an area of memory large enough to hold any return 
  7478.       value associated with the command issued. Some commands do not make use 
  7479.       of Buffer. For these commands, Buffer should be NULL. 
  7480.  
  7481.  Values Returned 
  7482.       Command Information and possible return values are: 
  7483.  
  7484.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7485.   ΓöéCommand Information Return Value        Buffer                    Γöé
  7486.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7487.   Γöé0                   1 = Compatibility V Unused                    Γöé
  7488.   Γöé                    2 = Logical Volume                            Γöé
  7489.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7490.   Γöé1                   0 = Success         Unused                    Γöé
  7491.   Γöé                    1 = Failure                                   Γöé
  7492.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7493.   Γöé2                   0 = Success         Unused                    Γöé
  7494.   Γöé                    1 = Failure                                   Γöé
  7495.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7496.   Γöé3                   0 = Success         typedef struct_BadBlockInfΓöé
  7497.   Γöé                    1 = Failure         ULONG Total_Relocations;  Γöé
  7498.   Γöé                                        ULONG Total_Tables;       Γöé
  7499.   Γöé                                        }BadBlockInfo;            Γöé
  7500.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7501.   Γöé4                   0 = Success         typedef struct_BadBlackInfΓöé
  7502.   Γöé                    1 = Failure         ULONG Active_Relocations; Γöé
  7503.   Γöé                                        ULONG Max_Relocations;    Γöé
  7504.   Γöé                                        }BadBlockTableInfo;       Γöé
  7505.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7506.   Γöé5                   0 = Success         Array of LSNs.            Γöé
  7507.   Γöé                    1 = Failure         Each entry in array is    Γöé
  7508.   Γöé                                        sector requiring relocatioΓöé
  7509.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7510.   Γöé6                   0 = Success         Data written to           Γöé
  7511.   Γöé                    1 = Failure         specified sector          Γöé
  7512.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7513.   Γöé7                   0 = Success         Unused                    Γöé
  7514.   Γöé                    1 = Failure                                   Γöé
  7515.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7516.   Γöé8                   0 = Success         Unused                    Γöé
  7517.   Γöé                    1 = Failure                                   Γöé
  7518.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7519.   Γöé9                   0 = Success         Text of name being        Γöé
  7520.   Γöé                    1 = Failure         returned by this function.Γöé
  7521.   Γöé                                        Name will be null terminatΓöé
  7522.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7523.  
  7524.  Returns 
  7525.  
  7526.  Possible values are shown in the following list: 
  7527.  
  7528.  0         NO_ERROR 
  7529.  
  7530.  6         ERROR_INVALID_HANDLE 
  7531.  
  7532.  15        ERROR_INVALID_DRIVE 
  7533.  
  7534.  31        ERROR_GEN_FAILURE 
  7535.  
  7536.  87        ERROR_INVALID_PARAMETER 
  7537.  
  7538.  
  7539. ΓòÉΓòÉΓòÉ 6.2. Query Hard Drive Geometry and Physical Parameters-OEMHLP_QUERYDISKINFO (0Eh) ΓòÉΓòÉΓòÉ
  7540.  
  7541. Purpose 
  7542.  
  7543.  This function returns geometry and physical parameters about the specified 
  7544. physical hard disk, if available. This information is acquired from BIOS via 
  7545. INT 13h function 48h at system boot. 
  7546.  
  7547. Parameter Packet Format 
  7548.  
  7549. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7550. ΓöéField                            Length                          Γöé
  7551. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7552. ΓöéDrive Number                     BYTE                            Γöé
  7553. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7554.  
  7555.  Drive Number 
  7556.       The BIOS drive number for which geometry and physical parameters are 
  7557.       requested. The value must be 80h or greater. 
  7558.  
  7559.  Data Packet Format 
  7560.  
  7561.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7562.   ΓöéField                                     Length                  Γöé
  7563.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7564.   ΓöéReserved                                  WORD                    Γöé
  7565.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7566.   ΓöéInformation Flags                         WORD                    Γöé
  7567.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7568.   ΓöéNumber of Physical Cylinders              DWORD                   Γöé
  7569.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7570.   ΓöéNumber of Physical Heads                  DWORD                   Γöé
  7571.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7572.   ΓöéNumber of Sectors Per Track               DWORD                   Γöé
  7573.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7574.   ΓöéNumber of Physical Sectors                QWORD                   Γöé
  7575.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7576.   ΓöéNumber of Bytes in a Sector               WORD                    Γöé
  7577.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7578.   ΓöéReserved                                  DWORD                   Γöé
  7579.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7580.   ΓöéI/O Port Base Address                     WORD                    Γöé
  7581.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7582.   ΓöéControl Port Address                      WORD                    Γöé
  7583.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7584.   ΓöéHead Register Upper Nibble                BYTE                    Γöé
  7585.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7586.   ΓöéReserved                                  BYTE                    Γöé
  7587.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7588.   ΓöéIRQ Information                           BYTE                    Γöé
  7589.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7590.   ΓöéBlock Count for ATA R/W Multiple          BYTE                    Γöé
  7591.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7592.   ΓöéDMA Information                           BYTE                    Γöé
  7593.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7594.   ΓöéPIO Information                           BYTE                    Γöé
  7595.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7596.   ΓöéBIOS Selected Hardware Option Flags       WORD                    Γöé
  7597.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7598.   ΓöéReserved                                  WORD                    Γöé
  7599.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7600.   ΓöéDPT Extension Revision                    BYTE                    Γöé
  7601.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7602.  
  7603.  Information Flags 
  7604.       Bits are defined as follows: 
  7605.  
  7606.       Bit            Description 
  7607.  
  7608.       0              DMA boundary errors are handled transparently 
  7609.  
  7610.       1              The geometry returned in bytes 4-15 is valid 
  7611.  
  7612.       2              Media is removable. Bits 4-6 are not valid if this bit is 
  7613.                      0 
  7614.  
  7615.       3              Device supports write verify 
  7616.  
  7617.       4              Device has media change notification 
  7618.  
  7619.       5              Media is lockable 
  7620.  
  7621.       6              Device geometry is set to maximum and no media is present 
  7622.                      when this bit is set to 1. 
  7623.  
  7624.       7-15           Reserved 
  7625.  
  7626.  Number of Physical Cylinders 
  7627.       The number of physical cylinders on the physical drive. This field is 
  7628.       valid only if BIT 1 of the information flags is set to 1. 
  7629.  
  7630.  Number of Physical Heads 
  7631.       The number of physical heads on the physical drive. This field is valid 
  7632.       only if BIT 1 of the information flags is set to 1. 
  7633.  
  7634.  Number of Sectors Per Track 
  7635.       The number of sectors per track on the physical drive. This field is 
  7636.       valid only if BIT 1 of the information flags is set to 1. 
  7637.  
  7638.  Number of Physical Sectors 
  7639.       The number of physical sectors on the physical drive. 
  7640.  
  7641.  Number of Bytes in a Sector 
  7642.       The number of bytes per sector on the physical drive. 
  7643.  
  7644.  I/O Port Base Address 
  7645.       This word is the address of the data register in ATA Command Block. 
  7646.  
  7647.  Control Port Address 
  7648.       This word is the address of the ATA Control Block Register. 
  7649.  
  7650.  Head Register Upper Nibble 
  7651.       The upper nibble of this byte is logically ORed with the head number, or 
  7652.       upper 4 bits of the LBA, each time the disk is accessed. 
  7653.  
  7654.       Bit            Description 
  7655.  
  7656.       0-3            0 
  7657.  
  7658.       4              ATA DEV bit 
  7659.  
  7660.       5              1 
  7661.  
  7662.       6              LBA enabled (1 = enabled) 
  7663.  
  7664.       7              1 
  7665.  
  7666.  IRQ Information 
  7667.       Bits are defined as follows: 
  7668.  
  7669.       Bit            Description 
  7670.  
  7671.       0-3            IRQ for this drive 
  7672.  
  7673.       4-7            0 
  7674.  
  7675.  Block Count for ATA R/W Multiple 
  7676.       If the hard disk was configured to use the READ/WRITE MULTIPLE command, 
  7677.       then this field contains the block size of the transfer in sectors. 
  7678.  
  7679.  DMA Information 
  7680.       If the BIOS has configured the system to perform multi-word DMA transfers 
  7681.       in place of the normal PIO transfers, this field specified the DMA mode 
  7682.       in the upper nibble, as per the ATA-2 or later definition, and the DMA 
  7683.       Channel in the lower nibble. ATA Channels which conform to SFF-8038i set 
  7684.       the DMA channel to 0. Note that the DMA Type field does not follow the 
  7685.       format of the data returned by the drive. The value of the DMA mode is 
  7686.       not limited to 2. 
  7687.  
  7688.       Bit            Description 
  7689.  
  7690.       0-3            DMA Channel 
  7691.  
  7692.       4-7            DMA Type 
  7693.  
  7694.  PIO Information 
  7695.       If the BIOS has configured the system to perform PIO data transfers other 
  7696.       than mode 0, this field specifies the PIO mode as per the ATA-2 or later 
  7697.       definition. 
  7698.  
  7699.       Bit            Description 
  7700.  
  7701.       0-3            PIO Type 
  7702.  
  7703.       4-7            0 
  7704.  
  7705.  BIOS Selected Hardware Option Flags 
  7706.       Bits are defined as follows: 
  7707.  
  7708.       Bit            Description 
  7709.  
  7710.       0              Fast PIO accessing enabled 
  7711.  
  7712.       1              DMA accessing enabled 
  7713.  
  7714.       2              ATA READ/WRITE MULTIPLE accessing enabled 
  7715.  
  7716.       3              CHS translation enabled 
  7717.  
  7718.       4              LBA translation enabled 
  7719.  
  7720.       5              Removeable media 
  7721.  
  7722.       6              ATAPI device 
  7723.  
  7724.       7              32-bit transfer mode 
  7725.  
  7726.       8              ATAPI device uses command packet interrupt 
  7727.  
  7728.       9-10           Translation type 
  7729.  
  7730.                      00             Bit-shift translation 
  7731.  
  7732.                      01             LBA assisted translation 
  7733.  
  7734.                      10             Reserved 
  7735.  
  7736.                      11             Vendor specific translation 
  7737.  
  7738.       11             Ultra DMA accessing enabled 
  7739.  
  7740.       12-15          Reserved 
  7741.  
  7742.  DPT Extension Revision 
  7743.       Revision of DPT Extension provided by BIOS 
  7744.  
  7745.  Returns 
  7746.  
  7747.  Possible values are shown in the following list: 
  7748.  
  7749.  0         NO_ERROR 
  7750.  
  7751.  87        ERROR_INVALID_PARAMETER 
  7752.  
  7753.  Remarks 
  7754.  
  7755.  Information in the data packet will be filled in, if BIOS supports INT 13h 
  7756.  Function 48h and if BIOS can access the entire hardfile through INT 13h 
  7757.  Function 42h and Function 43h. If either condition is not met, all fields in 
  7758.  the data packet with be 0. 
  7759.  
  7760.  
  7761. ΓòÉΓòÉΓòÉ 7. Device Helper (DevHlp) Services and Function Codes ΓòÉΓòÉΓòÉ
  7762.  
  7763. DevHlp services include: 
  7764.  
  7765. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7766. ΓöéDevHlp_OpenFile         Γöé7FH   ΓöéOpen file (system initialization  Γöé
  7767. Γöé                        Γöé      Γöétime only)                        Γöé
  7768. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7769. ΓöéDevHlp_CloseFile        Γöé80H   ΓöéClose file (system initialization Γöé
  7770. Γöé                        Γöé      Γöétime only)                        Γöé
  7771. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7772. ΓöéDevHlp_ReadFile         Γöé81H   ΓöéRead (system initialization time  Γöé
  7773. Γöé                        Γöé      Γöéonly)                             Γöé
  7774. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7775. ΓöéDevHlp_ReadFileAt       Γöé82H   ΓöéSeek and read (system             Γöé
  7776. Γöé                        Γöé      Γöéinitialization time only)         Γöé
  7777. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7778. ΓöéDevHlp_RegisterKDD      Γöé83H   ΓöéRegister driver with kernel       Γöé
  7779. Γöé                        Γöé      Γöédebugger                          Γöé
  7780. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7781.  
  7782. System event notification: 
  7783.  
  7784. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7785. ΓöéEvent                ΓöéIndex     ΓöéDescription                      Γöé
  7786. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7787. Γöéevent_POWER          Γöé9         ΓöéPower off event                  Γöé
  7788. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7789.  
  7790.  
  7791. ΓòÉΓòÉΓòÉ 7.1. DevHlp_GetDosVar ΓòÉΓòÉΓòÉ
  7792.  
  7793. DevHlp_GetDosVar returns the address of a kernel variable. 
  7794.  
  7795.  Calling Sequence in Assembler 
  7796.  
  7797.                       MOV   AL,index                ; Index wanted.
  7798.                       MOV   CX,VarMember            ; Only used by index 14 and 16.
  7799.                       MOV   DL,DevHlp_GetDOSVar
  7800.  
  7801.                       CALL  [Device_Help]
  7802.  
  7803.  Results in Assembler 
  7804.  
  7805.            'C' Clear if successful. AX:BX points to the index. 
  7806.  
  7807.            'C' Set if error. 
  7808.  
  7809.  Calling Sequence in C 
  7810.  
  7811.                       #include  "dhcalls.h"
  7812.  
  7813.            USHORT APIENTRY DevHelp_GetDOSVar ( USHORT VarNumber, USHORT 
  7814.                           VarMember, PPVOID KernelVar ) 
  7815.  
  7816.  VarNumber (USHORT) 
  7817.            The index into the list of read only variables: 
  7818.  
  7819.                       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7820.                       ΓöéDHGETDOSV_SYSINFOSEG                                       Γöé1     Γöé
  7821.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7822.                       ΓöéDHGETDOSV_LOCINFOSEG                                       Γöé2     Γöé
  7823.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7824.                       ΓöéDHGETDOSV_VECTORSDF                                        Γöé4     Γöé
  7825.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7826.                       ΓöéDHGETDOSV_VECTORREBOOT                                     Γöé5     Γöé
  7827.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7828.                       ΓöéDHGETDOSV_VECTORMSATS                                      Γöé6     Γöé
  7829.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7830.                       ΓöéDHGETDOSV_YIELDFLAG                                        Γöé7     Γöé
  7831.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7832.                       ΓöéDHGETDOSV_TCYIELDFLAG                                      Γöé8     Γöé
  7833.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7834.                       ΓöéDHGETDOSV_DOSCODEPAGE                                      Γöé11    Γöé
  7835.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7836.                       ΓöéDHGETDOSV_INTERRUPTLEV                                     Γöé13    Γöé
  7837.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7838.                       ΓöéDHGETDOSV_DEVICECLASSTABLE                                 Γöé14    Γöé
  7839.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7840.                       ΓöéDHGETDOSV_DMQSSELECTOR                                     Γöé15    Γöé
  7841.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7842.                       ΓöéDHGETDOSV_APMINFO                                          Γöé16    Γöé
  7843.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7844.                       ΓöéDHGETDOSV_APM11INFO                                        Γöé17    Γöé
  7845.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7846.                       ΓöéDHGETDOSV_CPUMODE                                          Γöé18    Γöé
  7847.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7848.                       ΓöéDHGETDOSV_CPUMODE                                          Γöé19    Γöé
  7849.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7850.                       ΓöéDHGETDOSV_TOTALCPUS                                        Γöé20    Γöé
  7851.                       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7852.  
  7853.  VarMember (USHORT) 
  7854.            Applicable only to VarNumber 14 or 16. 
  7855.  
  7856.            For VarNumber = 14 
  7857.  
  7858.                       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7859.                       ΓöéVarMember=1                     Γöé(Disk) has a maximum of 32      Γöé
  7860.                       Γöé                                Γöéentries in the DCT.             Γöé
  7861.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7862.                       ΓöéVarMember=2                     ΓöéMouse) has a maximum of 3       Γöé
  7863.                       Γöé                                Γöéentries in the DCT.             Γöé
  7864.                       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7865.  
  7866.            For VarNumber = 16 
  7867.  
  7868.                       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7869.                       ΓöéVarMember=0                     ΓöéQuery presence of APM BIOS.     Γöé
  7870.                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7871.                       ΓöéVarMember=1                     ΓöéQuery presence of APM BIOS and  Γöé
  7872.                       Γöé                                Γöéestablish connection.           Γöé
  7873.                       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7874.  
  7875.  KernelVar (PPVOID) 
  7876.            Pointer to the address of requested variable to be returned. 
  7877.  
  7878.  Results in C 
  7879.  
  7880.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7881.   ΓöéSuccess Indicator:              ΓöéClear if successful; returns    Γöé
  7882.   Γöé                                Γöéaddress of the requested        Γöé
  7883.   Γöé                                Γöévariable in KernelVar.          Γöé
  7884.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7885.   ΓöéPossible errors:                ΓöéNone.                           Γöé
  7886.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7887.  
  7888.  Remarks 
  7889.  
  7890.  The following table contains the list of read-only variables: 
  7891.  
  7892.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7893.   ΓöéIndex      ΓöéVariable Description                                  Γöé
  7894.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7895.   Γöé  1        ΓöéGlobalInfoSeg:WORD.  Valid at task time and interrupt Γöé
  7896.   Γöé           Γöétime, but not at INIT time.  See below.               Γöé
  7897.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7898.   Γöé  2        ΓöéLocalInfoSeg:DWORD.  Selector/segment address of localΓöé
  7899.   Γöé           Γöéinformation segment for the current Local Descriptor  Γöé
  7900.   Γöé           ΓöéTable (LDT).  Valid only at task time.  See below.    Γöé
  7901.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7902.   Γöé  3        ΓöéReserved.                                             Γöé
  7903.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7904.   Γöé  4        ΓöéVectorSDF:DWORD.  Pointer to the stand-alone dump     Γöé
  7905.   Γöé           Γöéfacility. Valid at task time and interrupt time.      Γöé
  7906.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7907.   Γöé  5        ΓöéVectorReboot:DWORD.  Pointer to restart the operating Γöé
  7908.   Γöé           Γöésystem. Valid at task time and interrupt time.        Γöé
  7909.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7910.   Γöé  6        ΓöéReserved.                                             Γöé
  7911.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7912.   Γöé  7        ΓöéYieldFlag:BYTE.  Indicator for performing yields.     Γöé
  7913.   Γöé           ΓöéValid only at task time.                              Γöé
  7914.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7915.   Γöé  8        ΓöéTCYieldFlag:BYTE.  Indicator for performing           Γöé
  7916.   Γöé           Γöétime-critical yields. Valid only at task time.        Γöé
  7917.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7918.   Γöé  9        ΓöéReserved.                                             Γöé
  7919.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7920.   Γöé 10        ΓöéReserved.                                             Γöé
  7921.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7922.   Γöé 11        ΓöéDOS session Code Page Tag pointer: DWORD.             Γöé
  7923.   Γöé           ΓöéSegment:offset of the DOS session's current code page Γöé
  7924.   Γöé           Γöétag.  Valid only at task time.                        Γöé
  7925.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7926.   Γöé 12        ΓöéReserved.                                             Γöé
  7927.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7928.   Γöé 13        ΓöéInterrupt Level                                       Γöé
  7929.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7930.   Γöé 14        ΓöéDeviceClass Table (See DH_RegisterDeviceClass)        Γöé
  7931.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7932.   Γöé 15        ΓöéDMQS Selector:  Point to XGA adapter.  DMQS           Γöé
  7933.   Γöé           Γöéinformation offset is assumed to start at zero.       Γöé
  7934.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7935.   Γöé 16        ΓöéAPMInfo:APMStruc. Advanced Power Management BIOS      Γöé
  7936.   Γöé           ΓöéInformation                                           Γöé
  7937.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7938.   Γöé17         ΓöéAPMInfo: APMStruc version 1.1. Advanced Power         Γöé
  7939.   Γöé           ΓöéManagement BIOS Information                           Γöé
  7940.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7941.   Γöé18         ΓöéSMP_Active: DWORD Information on the operating system Γöé
  7942.   Γöé           Γöé(OS) support for more than 1 CPU. Returns 1 if the OS Γöé
  7943.   Γöé           Γöéhas SMP support and 0 if the OS has uniprocessor      Γöé
  7944.   Γöé           Γöésupport.                                              Γöé
  7945.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7946.   Γöé19         ΓöéPSDInfo.psd_flags: DWORD PSD status area where severalΓöé
  7947.   Γöé           Γöépieces of useful information about the PSD can be     Γöé
  7948.   Γöé           Γöéobtained. After obtaining the variable address, the   Γöé
  7949.   Γöé           Γöécaller must test the bit for the desired aspect of theΓöé
  7950.   Γöé           ΓöéPSD. The PSD flags definition is as follows:          Γöé
  7951.   Γöé           ΓöéPSD_INITIALIZED (0x80000000) PSD has been initialized Γöé
  7952.   Γöé           ΓöéPSD_INSTALLED (0x40000000) PSD has been installed     Γöé
  7953.   Γöé           ΓöéPSD_ADV_INT_MODE (0x20000000) PSD is in advaanced     Γöé
  7954.   Γöé           Γöéinterrupt mode PSD_KERNEL_PIC (0x10000000) Let the    Γöé
  7955.   Γöé           Γöékernel interrupt manager EOI                          Γöé
  7956.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7957.   Γöé20         ΓöécProcessors: DWORD Information for the Multi-ProcessorΓöé
  7958.   Γöé           Γöéenvironment. Indicates the number of processors       Γöé
  7959.   Γöé           Γöécurrently running in the MP environment. A value of 1 Γöé
  7960.   Γöé           Γöéis returned in Uni-Processor environment.             Γöé
  7961.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7962.  
  7963.  GlobalInfoSeg (PSEL)  Address of the global information segment structure, as 
  7964.                        defined below: 
  7965.  
  7966.                        Time (ULONG)                   Time in seconds since 
  7967.                                                       1/1/1970. 
  7968.  
  7969.                        Millisecs (ULONG)              Time in milliseconds. 
  7970.  
  7971.                        Hours (UCHAR)                  Current hour. 
  7972.  
  7973.                        Minute (UCHAR)                 Current minute. 
  7974.  
  7975.                        Seconds (UCHAR)                Current second. 
  7976.  
  7977.                        HundredSec (UCHAR)             Current hundreth of a 
  7978.                                                       second. 
  7979.  
  7980.                        TimeZone (USHORT)              Minutes from UTC.  If 
  7981.                                                       FFFFH, TimeZone is 
  7982.                                                       undefined. 
  7983.  
  7984.                        Interval (USHORT)              Timer interval in tenths 
  7985.                                                       of milliseconds. 
  7986.  
  7987.                        Day (UCHAR)                    Day. 
  7988.  
  7989.                        Month (UCHAR)                  Month. 
  7990.  
  7991.                        Year (USHORT)                  Year. 
  7992.  
  7993.                        Weekday (UCHAR)                Day of the week: 
  7994.  
  7995.                                                       0       Sunday 
  7996.                                                       1       Monday 
  7997.                                                       2       Tuesday 
  7998.                                                       3       Wednesday 
  7999.                                                       4       Thursday 
  8000.                                                       5       Friday 
  8001.                                                       6       Saturday 
  8002.  
  8003.                        MajorVersion (UCHAR)           Major version number. 
  8004.  
  8005.                        MinorVersion (UCHAR)           Minor version number. 
  8006.  
  8007.                        Revision (UCHAR)               Revision letter. 
  8008.  
  8009.                        CurrentSession (UCHAR)         Current foreground 
  8010.                                                       full-screen session. 
  8011.  
  8012.                        MaxNumSessions (UCHAR)         Maximum number of 
  8013.                                                       full-screen sessions. 
  8014.  
  8015.                        HugeShift (UCHAR)              Shift count for huge 
  8016.                                                       segments. 
  8017.  
  8018.                        ProtModeInd (UCHAR)            Protect-mode-only 
  8019.                                                       indicator: 
  8020.  
  8021.                                                       0       DOS and OS/2 
  8022.                                                               sessions. 
  8023.                                                       1       OS/2 session 
  8024.                                                               only. 
  8025.  
  8026.                        LastProcess (USHORT)           Process ID of the current 
  8027.                                                       foreground process. 
  8028.  
  8029.                        DynVarFlag (UCHAR)             Dynamic variation flag: 
  8030.  
  8031.                                                       0       Absolute. 
  8032.                                                       1       Enabled. 
  8033.  
  8034.                        MaxWait (UCHAR)                Maximum wait in seconds. 
  8035.  
  8036.                        MinTimeSlice (USHORT)          Minimum time slice in 
  8037.                                                       milliseconds. 
  8038.  
  8039.                        MaxTimeSlice (USHORT)          Maximum time slice in 
  8040.                                                       milliseconds. 
  8041.  
  8042.                        BootDrive (USHORT)             Drive from which the 
  8043.                                                       system startup occurred: 
  8044.  
  8045.                                                       1       Drive A 
  8046.                                                       2       Drive B 
  8047.                                                       n       Drive n. 
  8048.  
  8049.                        TraceFlags (UCHAR)             Thirty-two system trace 
  8050.                                                       major code flags.  Each 
  8051.                                                       bit corresponds to a 
  8052.                                                       trace major code 00H-FFH. 
  8053.                                                       The most significant bit 
  8054.                                                       (left-most) of the first 
  8055.                                                       byte corresponds to major 
  8056.                                                       code 00H.  Values are: 
  8057.  
  8058.                                                       0       Trace disabled. 
  8059.                                                       1       Trace enabled. 
  8060.  
  8061.                        MaxTextSessions (UCHAR)        Maximum number of VIO 
  8062.                                                       windowable sessions. 
  8063.  
  8064.                        MaxPMSessions (UCHAR)          Maximum number of 
  8065.                                                       Presentation Manager 
  8066.                                                       sessions. 
  8067.  
  8068.  LocalInfoSeg (PSEL)   Address of the selector for the local information 
  8069.                        segment structure, as defined below: 
  8070.  
  8071.                        ProcessID (PID)                 Current Process ID. 
  8072.  
  8073.                        ParentProcessID (PID)           Parent Process ID. 
  8074.  
  8075.                        ThreadPrty (USHORT)             Priority of current 
  8076.                                                        thread. 
  8077.  
  8078.                        ThreadID (TID)                  Current Thread ID. 
  8079.  
  8080.                        SessionID (USHORT)              Current Session ID. 
  8081.  
  8082.                        ProcStatus (UCHAR)              Process status. 
  8083.  
  8084.                        Unused (UCHAR)                  Unused. 
  8085.  
  8086.                        ForegroundProcess (BOOL)        Current process is in 
  8087.                                                        foreground (has keyboard 
  8088.                                                        focus): 
  8089.  
  8090.                                                        -1       Implies YES 
  8091.                                                        0        Implies NO. 
  8092.  
  8093.                        TypeProcess (UCHAR)             Type of process: 
  8094.  
  8095.                                                        0       Full screen 
  8096.                                                                protect-mode 
  8097.                                                                session. 
  8098.                                                        1       Requires real 
  8099.                                                                mode. 
  8100.                                                        2       VIO windowable 
  8101.                                                                protect-mode 
  8102.                                                                session. 
  8103.                                                        3       Presentation 
  8104.                                                                Manager 
  8105.                                                                protect-mode 
  8106.                                                                session. 
  8107.                                                        4       Detached 
  8108.                                                                protect-mode 
  8109.                                                                process. 
  8110.  
  8111.                        Unused (UCHAR)                  Unused. 
  8112.  
  8113.                        EnvironmentSel (SEL)            Environment selector. 
  8114.  
  8115.                        CmdLineOff (USHORT)             Command line offset in 
  8116.                                                        the segment addressed by 
  8117.                                                        EnvironmentSel. 
  8118.  
  8119.                        DataSegLen (USHORT)             Length of the data 
  8120.                                                        segment in bytes. 
  8121.  
  8122.                        StackSize (USHORT)              Stack size in bytes. 
  8123.  
  8124.                        HeapSize (USHORT)               Heap size in bytes. 
  8125.  
  8126.                        HModule (UHMODULE)              Module handle. 
  8127.  
  8128.                        DSSel (SEL)                     Data segment selector. 
  8129.  
  8130.  APMInfo               Advanced Power Management BIOS Information, as defined 
  8131.                        below: 
  8132.  
  8133.                        APM_CodeSeg (WORD)             APM 16-bit code segment 
  8134.                                                       (real-mode segment base 
  8135.                                                       address). 
  8136.  
  8137.                                                                                                             From APM BIOS, INT 15h AX=5302H.
  8138.  
  8139.                        APM_DataSeg (WORD)             APM 16-bit data segment 
  8140.                                                       (real-mode segment base 
  8141.                                                       address). 
  8142.  
  8143.                                                                                                             From APM BIOS, INT 15h AX=5302H.
  8144.  
  8145.                        APM_Offset  (WORD)             Offset to entry point. 
  8146.  
  8147.                                                                                                             From APM BIOS, INT 15h AX=5302H.
  8148.  
  8149.                        APM_Flags  (WORD)              APM capability flags. 
  8150.  
  8151.                                                                                                             From APM BIOS, INT 15h AX=5300H.
  8152.  
  8153.                        APM_Level  (WORD)              APM revision level. 
  8154.  
  8155.                                                                                                             From APM BIOS, INT 15h AX=5300H.
  8156.  
  8157.                        APM_CPUIdle (6 bytes (DF))     APM Services Entry Point 
  8158.                                                       for CPU Idle and Busy 
  8159.                                                       Functions. 
  8160.  
  8161.                        Note:  APM_CodeSeg and APM_DataSeg are segment 
  8162.                               addresses, not selectors. It is the 
  8163.                               responsibility of the device driver to convert 
  8164.                               the segment address to a valid protect-mode 
  8165.                               selector. 
  8166.  
  8167.  The first time GetDOSVar is called at device-driver initialization with index 
  8168.  (AL) = 10H and CX = 1, the system sets the values for APM_CodeSeg, 
  8169.  APM_DataSeg, APM_Offset, APM_Flags, and APM_Level. On return, AX:BX points to 
  8170.  the APMInfo structure. 
  8171.  
  8172.  If GetDOSVar is called at device-driver initialization with index (AL) = 10h 
  8173.  and CX = 0, the system sets the values for APM_Flags and APM_Level. On return, 
  8174.  AX:BX points to the APMInfo structure. Other fields in the APMInfo structure 
  8175.  might have been set by a previous call to GetDOSVar with index = 10h and CX = 
  8176.  1. 
  8177.  
  8178.  If GetDOSVar is called after device-driver initialization with index (AL) = 
  8179.  10H, no information in the APMInfo structure is modified. On return, AX:BX 
  8180.  points to the APMInfo structure. 
  8181.  
  8182.  APM_CPUIdle contains the address of the CPU Idle and Busy processing routines 
  8183.  from the Power Management Services device driver. This variable is initially 
  8184.  empty (NULL) until Power Management Services loads and places the addresses 
  8185.  for the CPU Idle and Busy routines into the variable area. The variable 
  8186.  address must be the 16:16 Selector:Offset. The Offset is 0-extended to 32 
  8187.  bits, and the value must be represented in 16:32 format. The APM_CPUIdle 
  8188.  function utilizes the AX register as the control selection flag for BUSY 
  8189.  (AX=00001H) and IDLE (AX=0000H) requests. 
  8190.  
  8191.  These variables are maintained by the kernel for the benefit of physical 
  8192.  device drivers.  Notice that the address returned is the address of the 
  8193.  indicated variable; the variable can contain a vector to some facility, or it 
  8194.  can contain a structure. 
  8195.  
  8196.  
  8197. ΓòÉΓòÉΓòÉ 8. DosDebug Commands ΓòÉΓòÉΓòÉ
  8198.  
  8199. This chapter contains an alphabetic list of the following debug commands. 
  8200.  
  8201. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8202. ΓöéCmd No.  ΓöéCommand Name                 ΓöéDescription               Γöé
  8203. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8204. Γöé33       ΓöéDBG_C_Attach                 ΓöéAttach to a Process       Γöé
  8205. Γöé         Γöé                             ΓöéCommand                   Γöé
  8206. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8207. Γöé34       ΓöéDBG_C_Detach                 ΓöéDetach from a Process     Γöé
  8208. Γöé         Γöé                             Γöéunder Debug Command       Γöé
  8209. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8210. Γöé35       ΓöéDBG_C_RegDebug               ΓöéJIT (Just-in_Time)        Γöé
  8211. Γöé         Γöé                             ΓöéDebugger                  Γöé
  8212. Γöé         Γöé                             ΓöéRegistration/De-RegistratiΓöé
  8213. Γöé         Γöé                             ΓöéCommand                   Γöé
  8214. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8215. Γöé36       ΓöéDBG_C_QueryDebug             ΓöéQuery JIT (Just-in_Time)  Γöé
  8216. Γöé         Γöé                             ΓöéDebugger Registered       Γöé
  8217. Γöé         Γöé                             ΓöéCommand                   Γöé
  8218. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8219.  
  8220.  
  8221. ΓòÉΓòÉΓòÉ 8.1. DBG_C_Attach ΓòÉΓòÉΓòÉ
  8222.  
  8223.  Debug Command 33- Debug Attach Command 
  8224.  
  8225. Parameters 
  8226.  
  8227.  Addr   Possible values are shown in the list below: 
  8228.  
  8229.         0x00000000     The default action is to sever the connection between 
  8230.                        the debugger and the program being debugged, if a system 
  8231.                        resource is being held. 
  8232.  
  8233.         0x00000001     The sever action is not wanted between the debugger and 
  8234.                        the program being debugged. 
  8235.  
  8236.  Pid    Process ID of debuggee 
  8237.  
  8238.  Tid    Reserved, must be zero 
  8239.  
  8240.  Cmd    DBG_C_Attach 
  8241.  
  8242.  Value  Debugging Level Number 
  8243.  
  8244.         The only permitted debugging level number is shown in the following 
  8245.         list: 
  8246.  
  8247.         1        = DBG_L_386 
  8248.  
  8249.  This must be the first DosDebug command called when dynamically attaching to a 
  8250.  process. No other DosDebug command will be accepted until the debugging 
  8251.  connection has been established except for DBG_C_RegDebug to register a JIT 
  8252.  (Just-in-time) debugger on a per-process basis and DBG_C_QueryDebug to query 
  8253.  the JIT debug information. See DBG_C_RegDebug and DBG_C_QueryDebug for more 
  8254.  information. 
  8255.  
  8256.  Returns 
  8257.  
  8258.  This command establishes a debugging connection. It must be the initial 
  8259.  command, since it verifies the buffer format for the rest of the connection. 
  8260.  
  8261.  Because DosDebug usually cannot be ported to new machines without changing the 
  8262.  format of the buffer, this command is needed to establish that the debugger is 
  8263.  capable of handling the desired buffer format. 
  8264.  
  8265.  If the requested debugging level is not supported, an error is returned, and 
  8266.  the connection is not made. This gives the debugger a chance to try again or 
  8267.  to start automatically a different debugger process that uses a different 
  8268.  buffer format. 
  8269.  
  8270.  For this command, the machine-independent and PID portion of the buffer is 
  8271.  examined. This portion includes the Pid, Tid, Cmd, and Value fields. This 
  8272.  makes it possible to port the DosDebug buffer from one machine to another 
  8273.  without returning an error to the debugger on the initial DosDebug command. 
  8274.  
  8275.  The only DosDebug notifications that are returned by this command are 
  8276.  DBG_N_Success and DBG_N_Error. 
  8277.  
  8278.  Restrictions 
  8279.  
  8280.  This DBG_C_Attach command does not require that the session for the program 
  8281.  being debugged tohave been started with EXEC_TRACE, or SSF_TRACEOPT_XXX option 
  8282.  by DosExecPgm or DosStartSession, as DBG_C_Connect requires. 
  8283.  
  8284.  If a connection to the program being debugged is established by a debugger, 
  8285.  then another debug session cannot attach to the program being debugged while 
  8286.  the first debugger is attached. 
  8287.  
  8288.  Remarks 
  8289.  
  8290.  If Addr is not 0, the connection between the debugger and the program being 
  8291.  debugged is not severed. If any threads of the program being debugged, other 
  8292.  than the thread that encountered the debug event, are holding system 
  8293.  semaphores, they will be allowed to run until they release the semaphores. 
  8294.  They will then be stopped, and the notification will be delivered. 
  8295.  
  8296.  If the thread encountering the debug event is holding a system semaphore, the 
  8297.  connection between the debugger and the program being debugged is severed by 
  8298.  terminating the program being debugged and returning a DBG_N_Error 
  8299.  notification to the debugger with the value field set to 0 and the register 
  8300.  set filled in. No further DosDebug commands will be accepted by the program 
  8301.  being debugged, nor will it generate any other notifications. 
  8302.  
  8303.  If a DBG_C_Stop is issued, and a thread owning a system semaphore is about to 
  8304.  generate a DBG_N_AsyncStop notification, it will be allowed to continue 
  8305.  execution until it releases the semaphore. It will then be stopped, and the 
  8306.  notification will be delivered. This is the only exception to the severing of 
  8307.  the debugger/debugbee rule. 
  8308.  
  8309.  If Addr is set to 0, the connection between the debugger and the program being 
  8310.  debugged is severed if a system resource is being held, in which case DosDebug 
  8311.  returns: 
  8312.  
  8313.  Tid    Thread owning semaphore 
  8314.  
  8315.  Cmd    DBG_N_Error 
  8316.  
  8317.  Value  ERROR_EXCL_SEM_ALREADY_OWNED 
  8318.  
  8319.  If the debugger needs to present some information to the user or use the 
  8320.  thread holding the system resource, the debugger must terminate the program 
  8321.  being debugged. Any other action might result in a system halt. 
  8322.  
  8323.  Upon attach to a process, a series of notifications will occur. The 
  8324.  notifications include the current EXE module notification, thread (all that 
  8325.  exist in the debuggee) create notifications, and currently loaded modules 
  8326.  (DLLs) notifications. The notifications occur as DBG_NPModuleLoad, 
  8327.  DBG_N_ThreadCreate, etc, just as they do with the DBG_C_Connect command. 
  8328.  
  8329.  
  8330. ΓòÉΓòÉΓòÉ 8.2. DBG_C_Detach ΓòÉΓòÉΓòÉ
  8331.  
  8332.  Debug Command 34- Debug Detach Command 
  8333.  
  8334. Parameters 
  8335.  
  8336.  Pid    Process of ID of debuggee 
  8337.  
  8338.  Cmd    DBG_C_Detach 
  8339.  
  8340.  Returns 
  8341.  
  8342.  This command detaches from the debugee connection. It is the last comand 
  8343.  issued before resuming the process. 
  8344.  
  8345.  The only DosDebug notifications that are returned by this command are 
  8346.  DBG_N_Success and DBG_N_Error. 
  8347.  
  8348.  Restrictions 
  8349.  
  8350.  Detach only works on a debuggee process currently under debug using the attach 
  8351.  command, DBG_C_Attach.  You cannot use DBG_C_Detach if you used DBG_C_Connect. 
  8352.  DBG_C_Attach and DBG_C_Detach are paired and are used for debugging a process 
  8353.  that is already running. 
  8354.  
  8355.  Remarks 
  8356.  
  8357.  By using this function, a debugger can only remove debug context of a given 
  8358.  debuggee process as stated above.  If the debugger needs to detach and have 
  8359.  the debuggee terminate, it is neccessary to use DBG_C_Term command instead of 
  8360.  DBG_C_Detach.  This will terminate the debuggee process and remove attach 
  8361.  information. 
  8362.  
  8363.  
  8364. ΓòÉΓòÉΓòÉ 8.3. DBG_C_RegDebug ΓòÉΓòÉΓòÉ
  8365.  
  8366.  Debug Command 35-JIT (Just-in-Time) Debugger Registration/De-Registration 
  8367. Command 
  8368.  
  8369. Parameters 
  8370.  
  8371.  Pid    Process of ID of debuggee 
  8372.  
  8373.  Cmd    DBG_C_RegDbg 
  8374.  
  8375.  Buffer Pointer to JIT Debugger path name and arguments 
  8376.  
  8377.         Address of the buffer in which the fully-qualified path name of the JIT 
  8378.         debugger is specified.  The path name can be followed by an optional 
  8379.         arguments to the JIT debugger.  If %d is found in the arguments, the 
  8380.         system will replace %d with the ID of the failing process.  If %d is 
  8381.         not found in the arguments, the system will assume argument one is the 
  8382.         process ID. 
  8383.  
  8384.         A coded example of this follows: 
  8385.  
  8386.         Assume the ID of the failing process is 99. 
  8387.  
  8388.         If Buffer contains "C:\OS2\MYJITDBG.EXE /Tn /K /P%d",  the system will 
  8389.         launch the JIT debugger as "C:\OS2\MYJITDBG.EXE /Tn /K /P99" 
  8390.  
  8391.         If Buffer contains "C:\OS2\MYJITDBG.EXE /Tn /K",  the system will 
  8392.         launch the JIT debugger as "C:\OS2\MYJITDBG.EXE 99 /Tn /K" 
  8393.  
  8394.  Len    0 or the size of Buffer in bytes 
  8395.  
  8396.         A Len of 0 is used to deregister the JIT debugger from the given 
  8397.         process. Buffer is ignored in this case. If Len is 0 and no JIT 
  8398.         debugger is registered the system will return error code 
  8399.         ERROR_INSUFFICIENT_BUFFER. 
  8400.  
  8401.  Addr   Registration Flags 
  8402.  
  8403.         JIT_REG_INHERIT Enable children processes to inherit registered 
  8404.                        per-process JIT debugger from parent. (This is the 
  8405.                        default.) 
  8406.  
  8407.         JIT_REG_NONINHERIT Do not allow inheritance of per-process JIT debugger 
  8408.                        to the children of that parent process. 
  8409.  
  8410.         If Inheritance is being used with DosStartSession() on a PM 
  8411.         application, the inheritance link is broken. This is due to the design 
  8412.         of sessions management for DosStartSession() which causes all children 
  8413.         processes to always inherit from the PM. The recommended way to start a 
  8414.         child process is through DosExecPgm() under the same session type. The 
  8415.         parent-child relationship will be set up correctly and the JIT will be 
  8416.         inherited. Otherwise the parent application has to register the JIT on 
  8417.         every DosStartSession() child process. The JIT could also be registered 
  8418.         on the main PMSHELL.EXE process. This would cause all future 
  8419.         DosStartSession() processes to inherit the JIT information from PM. 
  8420.         This works around the DosStartSession() inheritance problem above. 
  8421.  
  8422.  Value  Return error code, if any 
  8423.  
  8424.  Returns 
  8425.  
  8426.  The only DosDebug notifications that are returned by this command are 
  8427.  DBG_N_Success and DBG_N_Error. 
  8428.  
  8429.  Valid Field return error return code(s): 
  8430.  
  8431.  ERROR_FILE_NOT_FOUND File was not found in specified path 
  8432.  
  8433.  ERROR_INSUFFICIENT BUFFER Returned if JIT Debugger not registered and a Len of 
  8434.            0 passed into register 
  8435.  
  8436.  Restrictions 
  8437.  
  8438.  This is one of the only DosDebug commands that can be called without having to 
  8439.  issue a DBG_C_Connect or DBG_C_Attach first. This command is usually called 
  8440.  after starting a process using DosExecPgm() or DosStartSession() in order to 
  8441.  gather the PID to use with the registration command. Another way of gathering 
  8442.  PID information is to use the DosQuerySysState(). This will return all of the 
  8443.  current Process ID's running in the system. See DosQuerySysState() for more 
  8444.  information. The registration of the debugger must use a fully-qualified path 
  8445.  name and executable for per-process and global registration.  Registration 
  8446.  will not occur if the debugger is not physically found on the disk upon 
  8447.  registration.  If you make multiple calls to DosDebug with the DBG_C_RegDbg 
  8448.  command, the previous debugger will be deleted and the newest one will be 
  8449.  registered. If the DBG_C_RegDbg is called with the size field of 0 and a JIT 
  8450.  debugger exists, the JIT debugger will be unregistered. This only applies for 
  8451.  per-process JIT registration. Global registration cannot be unregistered. This 
  8452.  is set for a systemwide level. 
  8453.  
  8454.  If a per-process JIT registration exists, it will be used over the global JIT 
  8455.  registration specified in the CONFIG.SYS. 
  8456.  
  8457.  Remarks 
  8458.  
  8459.  The JIT debugger is invoked when an application process encounters a trap or 
  8460.  exception not serviced by that application's exception management.  Under 
  8461.  normal operations, where a JIT debugger has not been registered with the OS, 
  8462.  the application would be terminated by the user on a Hard Error Popup. This 
  8463.  disallowed state information from being gathered.  By registering a JIT 
  8464.  debugger with the OS, the OS will launch the JIT debugger in place of the Hard 
  8465.  Error popup. 
  8466.  
  8467.  The JIT debugger should attach to the dying process allowing the user to debug 
  8468.  the dying process using a conventional debug program or just gather state 
  8469.  debugger (unattended).  A state debugger would gather required information to 
  8470.  determine the state of the process dying; e.g., stack, registers, addresses, 
  8471.  storage, etc.  Once the state is gathered, the state debugger could save it to 
  8472.  a log and terminate the offending process and/or start a new process in place 
  8473.  of the old. This is completely customizable in the JIT debugger. 
  8474.  
  8475.  There are two types of JIT registration supported in OS/2.  The first type is 
  8476.  global registration.  This allows the user to register a global debugger for 
  8477.  the entire OS in the CONFIG.SYS.  This debugger will be launched for any 
  8478.  process in the OS that has an error.  The global debugger will not support 
  8479.  launching a PM (Presentation Manager) JIT debugger.  This has to be a VIO 
  8480.  application (or one that produces no screen output) because of the 
  8481.  organization of the boot cycle at which a JIT debugger can be invoked.  The 
  8482.  global JIT registration is done before the loading of device drivers, IFS, 
  8483.  CALLS, and RUNS.  This enables JIT support for all of these types of files. 
  8484.  
  8485.  The syntax for the CONFIG.SYS is as follows: 
  8486.  
  8487.  JITDBGREG=[JIT_PathName] [arguments] 
  8488.  
  8489.  Refer to Buffer under parameters section above to see how [JIT_PathName] and 
  8490.  [arguments] are used. 
  8491.  
  8492.  Example: 
  8493.  
  8494.  JITDBGREG=c:\os2\MYJITDBG.EXE /Tn /K /PID%d 
  8495.  
  8496.  The second type of JIT registration is the per-process registration. This type 
  8497.  of registration allows the user to register any type of debugger including PM 
  8498.  and VIO using the DBG_C_RegDbg command above. 
  8499.  
  8500.  Attention: The JIT debugger writer needs to be aware of the environment that 
  8501.  the JIT is being used in because of PM and VIO considerations for starting the 
  8502.  debugger in regards session management and screen groups. 
  8503.  
  8504.  Note:  For kernel debugger users there is an option to turn off the JIT 
  8505.         debugger support when trying to catch traps in the kernel debugger. See 
  8506.         the .on, .of and .oq switches in the kernel debugger help. 
  8507.  
  8508.  
  8509. ΓòÉΓòÉΓòÉ 8.4. DBG_C_QueryDebug ΓòÉΓòÉΓòÉ
  8510.  
  8511.  Debug Command 36- Query JIT (Just-in-Time) Debugger Registered Command 
  8512.  
  8513. Parameters 
  8514.  
  8515.  Pid    Process of ID of debuggee (Required for per-process entry) 
  8516.  
  8517.  Cmd    DBG_C_QueryDebug 
  8518.  
  8519.  Addr   Registration Flags 
  8520.  
  8521.         DBGQ_JIT_GLOBAL Query registered global debugger 
  8522.  
  8523.         DBGQ_JIT_PERPROC Query registered per-process debugger 
  8524.  
  8525.  Buffer A pointer to the buffer where the fully-qualified path name of the JIT 
  8526.         debugger is returned. 
  8527.  
  8528.  Len    Size of Buffer in bytes 
  8529.  
  8530.  Value  Error code, if any 
  8531.  
  8532.         ERROR_INSUFFICIENT_BUFFER Buffer too small 
  8533.  
  8534.         ERROR_INVALID_FLAG_NUMBER Invalid Registration Flag 
  8535.  
  8536.  Returns 
  8537.  
  8538.  This command returns the specified query form the operating system of the 
  8539.  registered debugger. The buffer will contain NULL if no debugger is 
  8540.  registered. 
  8541.  
  8542.  The only DosDebug notifications that are returned by this command are 
  8543.  DBG_N_Success and DBG_N_Error. 
  8544.  
  8545.  Remarks 
  8546.  
  8547.  The DBG_C_QueryDbg command returns the registered JIT debugger from a process 
  8548.  or the system (Global). The buffer contains the JIT debugger full path name 
  8549.  and any arguments specified to the debugger. 
  8550.  
  8551.  
  8552. ΓòÉΓòÉΓòÉ 9. Data Types ΓòÉΓòÉΓòÉ
  8553.  
  8554. This chapter contains an alphabetic list of the following data types. 
  8555.  
  8556.      FILELOCKL 
  8557.  
  8558.      FILEFINDBUF3L 
  8559.  
  8560.      FILEFINDBUF4L 
  8561.  
  8562.      FILESTATUS3L 
  8563.  
  8564.      FILESTATUS4L 
  8565.  
  8566.      MPAffinity 
  8567.  
  8568.  
  8569. ΓòÉΓòÉΓòÉ 9.1. FILELOCKL ΓòÉΓòÉΓòÉ
  8570.  
  8571. Definition 
  8572.  
  8573. FILELOCKL data structure 
  8574.  
  8575. Syntax 
  8576.  
  8577. typedef struct _FILELOCKL {
  8578.   LONGLONG       lOffset;
  8579.   LONGLONG       lRange;
  8580. } FILELOCK;
  8581.  
  8582. typedef FILELOCK *PFILELOCK;
  8583.  
  8584. Fields 
  8585.  
  8586.  lOffset (LONGLONG) 
  8587.            Offset to the beginning of the lock (or unlock) range. 
  8588.  
  8589.  lRange (LONGLONG) 
  8590.            Length, in bytes, of the lock (or unlock) range. 
  8591.  
  8592.            A value of 0 indicates that locking (or unlocking) is not required. 
  8593.  
  8594.  
  8595. ΓòÉΓòÉΓòÉ 9.2. FILEFINDBUF3L ΓòÉΓòÉΓòÉ
  8596.  
  8597. Definition 
  8598.  
  8599. Find the file buffer data structure 
  8600.  
  8601. Syntax 
  8602.  
  8603. typedef struct _FILEFINDBUF3L {
  8604.   ULONG       oNextEntryOffset;
  8605.   FDATE       fdateCreation;
  8606.   FTIME       ftimeCreation;
  8607.   FDATE       fdateLastAccess;
  8608.   FTIME       ftimeLastAccess;
  8609.   FDATE       fdateLastWrite;
  8610.   FTIME       ftimeLastWrite;
  8611.   LONGLONG    cbFile;
  8612.   LONGLONG    cbFileAlloc;
  8613.   ULONG       attrFile;
  8614.   UCHAR       cchName;
  8615.   CHAR        achName[CCHMAXPATHCOMP];
  8616. } FILEFINDBUF3L;
  8617.  
  8618. typedef FILEFINDBUF3L *PFILEFINDBUF3L;
  8619.  
  8620. Fields 
  8621.  
  8622.  fdateCreation (FDATE) 
  8623.            Date of file creation. 
  8624.  
  8625.  ftimeCreation (FTIME) 
  8626.            Time of file creation. 
  8627.  
  8628.  fdateLastAccess (FDATE) 
  8629.            Date of last access. 
  8630.  
  8631.  ftimeLastAccess (FTIME) 
  8632.            Time of last access. 
  8633.  
  8634.  fdateLastWrite (FDATE) 
  8635.            Date of last write. 
  8636.  
  8637.  ftimeLastWrite (FTIME) 
  8638.            Time of last write. 
  8639.  
  8640.  cbFile (LONGLONG) 
  8641.            Size of file. 
  8642.  
  8643.  cbFileAlloc (LONGLONG) 
  8644.            Allocated size. 
  8645.  
  8646.  attrFile (ULONG) 
  8647.            File attributes. 
  8648.  
  8649.  cchName (UCHAR) 
  8650.            Length of file name. 
  8651.  
  8652.  achName[CCHMAXPATHCOMP] (CHAR) 
  8653.            File name including null terminator. 
  8654.  
  8655.  
  8656. ΓòÉΓòÉΓòÉ 9.3. FILEFINDBUF4L ΓòÉΓòÉΓòÉ
  8657.  
  8658. Definition 
  8659.  
  8660. Level 12 (32-bit) information (used with EAs). 
  8661.  
  8662. Syntax 
  8663.  
  8664. typedef struct _FILEFINDBUF4 {
  8665.   ULONG       oNextEntryOffset;
  8666.   FDATE       fdateCreation;
  8667.   FTIME       ftimeCreation;
  8668.   FDATE       fdateLastAccess;
  8669.   FTIME       ftimeLastAccess;
  8670.   FDATE       fdateLastWrite;
  8671.   FTIME       ftimeLastWrite;
  8672.   LONGLONG    cbFile;
  8673.   LONGLONG    cbFileAlloc;
  8674.   ULONG       attrFile;
  8675.   ULONG       cbList;
  8676.   UCHAR       cchName;
  8677.   CHAR        achName[CCHMAXPATHCOMP];
  8678. } FILEFINDBUF4;
  8679.  
  8680. typedef FILEFINDBUF4L *PFILEFINDBUFL4;
  8681.  
  8682. Fields 
  8683.  
  8684.  oNextEntryOffset (ULONG) 
  8685.            Offset of next entry. 
  8686.  
  8687.  fdateCreation (FDATE) 
  8688.            Date of file creation. 
  8689.  
  8690.  ftimeCreation (FTIME) 
  8691.            Time of file creation. 
  8692.  
  8693.  fdateLastAccess (FDATE) 
  8694.            Date of last access. 
  8695.  
  8696.  ftimeLastAccess (FTIME) 
  8697.            Time of last access. 
  8698.  
  8699.  fdateLastWrite (FDATE) 
  8700.            Date of last write. 
  8701.  
  8702.  ftimeLastWrite (FTIME) 
  8703.            Time of last write. 
  8704.  
  8705.  cbFile (LONGLONG) 
  8706.            Size of file. 
  8707.  
  8708.  cbFileAlloc (LONGLONG) 
  8709.            Allocated size. 
  8710.  
  8711.  attrFile (ULONG) 
  8712.            File attributes. 
  8713.  
  8714.  cbList (ULONG) 
  8715.            Size of the file's extended attributes. 
  8716.  
  8717.            The size is measured in bytes and is the size of the file's entire 
  8718.            extended attribute set on the disk. 
  8719.  
  8720.  cchName (UCHAR) 
  8721.            Length of file name. 
  8722.  
  8723.  achName[CCHMAXPATHCOMP] (CHAR) 
  8724.            File name including null terminator. 
  8725.  
  8726.  
  8727. ΓòÉΓòÉΓòÉ 9.4. FILESTATUS3L ΓòÉΓòÉΓòÉ
  8728.  
  8729. Definition 
  8730.  
  8731. Level 11 (32-bit) (FIL_STANDARDL) information 
  8732.  
  8733. Syntax 
  8734.  
  8735. typedef struct _FILESTATUS3L {
  8736.   FDATE       fdateCreation;
  8737.   FTIME       ftimeCreation;
  8738.   FDATE       fdateLastAccess;
  8739.   FTIME       ftimeLastAccess;
  8740.   FDATE       fdateLastWrite;
  8741.   FTIME       ftimeLastWrite;
  8742.   LONGLONG    cbFile;
  8743.   LONGLONG    cbFileAlloc;
  8744.   ULONG       attrFile;
  8745. } FILESTATUS3L;
  8746.  
  8747. typedef FILESTATUS3L *PFILESTATUS3L;
  8748.  
  8749. Fields 
  8750.  
  8751.  fdateCreation (FDATE) 
  8752.            Date of file creation. 
  8753.  
  8754.  ftimeCreation (FTIME) 
  8755.            Time of file creation. 
  8756.  
  8757.  fdateLastAccess (FDATE) 
  8758.            Date of last access. 
  8759.  
  8760.  ftimeLastAccess (FTIME) 
  8761.            Time of last access. 
  8762.  
  8763.  fdateLastWrite (FDATE) 
  8764.            Date of last write. 
  8765.  
  8766.  ftimeLastWrite (FTIME) 
  8767.            Time of last write. 
  8768.  
  8769.  cbFile (LONGLONG) 
  8770.            File size (end of data). 
  8771.  
  8772.  cbFileAlloc (LONGLONG) 
  8773.            File allocated size. 
  8774.  
  8775.  attrFile (ULONG) 
  8776.            Attributes of the file. 
  8777.  
  8778.  
  8779. ΓòÉΓòÉΓòÉ 9.5. FILESTATUS4L ΓòÉΓòÉΓòÉ
  8780.  
  8781. Definition 
  8782.  
  8783. Level 12 (32-bit) (FIL_QUERYEASIZEL) information 
  8784.  
  8785. Syntax 
  8786.  
  8787. typedef struct _FILESTATUS4L{
  8788.   FDATE       fdateCreation;
  8789.   FTIME       ftimeCreation;
  8790.   FDATE       fdateLastAccess;
  8791.   FTIME       ftimeLastAccess;
  8792.   FDATE       fdateLastWrite;
  8793.   FTIME       ftimeLastWrite;
  8794.   LONGLONG    cbFile;
  8795.   LONGLONG    cbFileAlloc;
  8796.   ULONG       attrFile;
  8797.   ULONG       cbList;
  8798. } FILESTATUS4L;
  8799.  
  8800. typedef FILESTATUS4L *PFILESTATUS4L;
  8801.  
  8802. Fields 
  8803.  
  8804.  fdateCreation (FDATE) 
  8805.            Date of file creation. 
  8806.  
  8807.  ftimeCreation (FTIME) 
  8808.            Time of file creation. 
  8809.  
  8810.  fdateLastAccess (FDATE) 
  8811.            Date of last access. 
  8812.  
  8813.  ftimeLastAccess (FTIME) 
  8814.            Time of last access. 
  8815.  
  8816.  fdateLastWrite (FDATE) 
  8817.            Date of last write. 
  8818.  
  8819.  ftimeLastWrite (FTIME) 
  8820.            Time of last write. 
  8821.  
  8822.  cbFile (LONGLONG) 
  8823.            File size (end of data). 
  8824.  
  8825.  cbFileAlloc (LONGLONG) 
  8826.            File allocated size. 
  8827.  
  8828.  attrFile (ULONG) 
  8829.            Attributes of the file. 
  8830.  
  8831.  cbList (ULONG) 
  8832.            Length of entire EA set. 
  8833.  
  8834.  
  8835. ΓòÉΓòÉΓòÉ 9.6. ListIOL ΓòÉΓòÉΓòÉ
  8836.  
  8837. Definition 
  8838.  
  8839. ListIOL data structure 
  8840.  
  8841. Syntax 
  8842.  
  8843. typedef struct _ListIOL {
  8844.   HFILE       hFile;
  8845.   ULONG       CmdFlag;
  8846.   LONGLONG    Offset;
  8847.   PVOID       pBuffer;
  8848.   ULONG       NumBytes;
  8849.   ULONG       Actual;
  8850.   ULONG       RetCode;
  8851.   ULONG       Reserved;
  8852.   ULONG       Reserved2[3];
  8853.   ULONG       Reserved3[2];
  8854. } ListIOL;
  8855.  
  8856. typedef  ListIOL * ListIOL
  8857.  
  8858. Fields 
  8859.  
  8860.  hFile (HFILE ) 
  8861.            File handle. 
  8862.  
  8863.  CmdFlag (ULONG ) 
  8864.            Command Flag. 
  8865.  
  8866.  Offset (LONGLONG) 
  8867.            Seek offse.t 
  8868.  
  8869.  pBuffer (PVOID ) 
  8870.            Pointer to buffer. 
  8871.  
  8872.  NumBytes (ULONG ) 
  8873.            Number of bytes to read/write. 
  8874.  
  8875.  Actual (ULONG ) 
  8876.            Actual number of bytes to read/write. 
  8877.  
  8878.  RetCode (ULONG ) 
  8879.            Operation return code. 
  8880.  
  8881.  Reserved (ULONG ) 
  8882.            (Internal.) 
  8883.  
  8884.  Reserved2[3](ULONG ) 
  8885.            (Internal). 
  8886.  
  8887.   Reserved3[2](ULONG ) 
  8888.            (Internal). 
  8889.  
  8890.  
  8891. ΓòÉΓòÉΓòÉ 9.7. MPAffinity ΓòÉΓòÉΓòÉ
  8892.  
  8893. Definition 
  8894.  
  8895. Multi-Processor affinity mask. The mask contains 1 bit per processor and 
  8896. supports a maximum of 64 processors. 
  8897.  
  8898. Syntax 
  8899.  
  8900. typedef struct _MPAffinity {
  8901.   ULONG       mask [2];
  8902. }MPAFFINITY;
  8903.  
  8904. typedef  MPAffinity *MPAffinity
  8905.  
  8906. Fields 
  8907.  
  8908.  mask (ULONG ) 
  8909.            CPUs 0 through 31 in [0] and CPUs 32 through 63 in [1]. 
  8910.  
  8911.            Non-existent processors are represented as reset bits (0). 
  8912.  
  8913.  
  8914. ΓòÉΓòÉΓòÉ 10. APIs Supporting High Memory Objects ΓòÉΓòÉΓòÉ
  8915.  
  8916.  
  8917. ΓòÉΓòÉΓòÉ 10.1. APIs in Warp Server 4 Advanced/SMP ΓòÉΓòÉΓòÉ
  8918.  
  8919.      DosFindFirst 
  8920.  
  8921.      DosFindNext 
  8922.  
  8923.      DosFreeMem 
  8924.  
  8925.      DosGetNamedSharedMem 
  8926.  
  8927.      DosGiveSharedMem 
  8928.  
  8929.      DosLoadModule 
  8930.  
  8931.      DosOpen 
  8932.  
  8933.      DosQueryMem 
  8934.  
  8935.      DosQueryModuleName 
  8936.  
  8937.      DosQueryPageUsage 
  8938.  
  8939.      DosQueryPathInfo 
  8940.  
  8941.      DosRead 
  8942.  
  8943.      DosSetMem 
  8944.  
  8945.      DosSetPathInfo 
  8946.  
  8947.      DosSubAllocMem 
  8948.  
  8949.      DosSubFreeMem 
  8950.  
  8951.      DosSubSetMem 
  8952.  
  8953.      DosSubUnsetMem 
  8954.  
  8955.      DosWrite 
  8956.  
  8957.      DosAddMuxWaitSem 
  8958.  
  8959.      DosCloseEventSem 
  8960.  
  8961.      DosCloseMutexSem 
  8962.  
  8963.      DosCloseMuxWaitSem 
  8964.  
  8965.      DosCreateEventSem 
  8966.  
  8967.      DosCreateMutexSem 
  8968.  
  8969.      DosCreateMuxWaitSem 
  8970.  
  8971.      DosDeleteMuxWaitSem 
  8972.  
  8973.      DosOpenEventSem 
  8974.  
  8975.      DosOpenMutexSem 
  8976.  
  8977.      DosOpenMutexWaitSem 
  8978.  
  8979.      DosPostEventSem 
  8980.  
  8981.      DosQueryEventSem 
  8982.  
  8983.      DosQueryMutexSem 
  8984.  
  8985.      DosQueryMuxWaitSem 
  8986.  
  8987.      DosReleaseMutexSem 
  8988.  
  8989.      DosRequestMutexSem 
  8990.  
  8991.      DosResetEventSem 
  8992.  
  8993.      DosWaitEventSem 
  8994.  
  8995.      DosWaitMuxWaitSem 
  8996.  
  8997.  
  8998. ΓòÉΓòÉΓòÉ 10.2. 32-bit Exception-handling APIs ΓòÉΓòÉΓòÉ
  8999.  
  9000.      DosAcknowledgeSignalException 
  9001.  
  9002.      DosEnterMustComplete 
  9003.  
  9004.      DosExitMustComplete 
  9005.  
  9006.      DosRaiseException 
  9007.  
  9008.      DosSendSignalException 
  9009.  
  9010.      DosSetExceptionHandler 
  9011.  
  9012.      DosSetSignalExceptionFocus 
  9013.  
  9014.      DosUnsetExceptionHandler 
  9015.  
  9016.      DosUnwindException 
  9017.  
  9018.  
  9019. ΓòÉΓòÉΓòÉ 10.3. DB2 Requested APIs to Have High Memory support ΓòÉΓòÉΓòÉ
  9020.  
  9021.      DosCopy 
  9022.  
  9023.      DosCreateDir 
  9024.  
  9025.      DosCreateNPipe 
  9026.  
  9027.      DosCreateQueue 
  9028.  
  9029.      DosCreateThread2 
  9030.  
  9031.      DosDelete 
  9032.  
  9033.      DosDeleteDir 
  9034.  
  9035.      DosExecPgm 
  9036.  
  9037.      DosMove 
  9038.  
  9039.      DosPhysicalDisk 
  9040.  
  9041.      DosQueryCurrentDir 
  9042.  
  9043.      DosQueryCurrentDisk 
  9044.  
  9045.      DosQueryFSAttach 
  9046.  
  9047.      DosQueryFSInfo 
  9048.  
  9049.      DosQueryFileInfo 
  9050.  
  9051.      DosQueryModuleHandle 
  9052.  
  9053.      DosQueryNPHState 
  9054.  
  9055.      DosReadQueue 
  9056.  
  9057.      DosScanEnv 
  9058.  
  9059.      DosSearchPath 
  9060.  
  9061.      DosSetCurrentDir 
  9062.  
  9063.      DosSetFileInfo 
  9064.  
  9065.      DosSetFileLocks 
  9066.  
  9067.      DosSetRelMaxFH 
  9068.  
  9069.  
  9070. ΓòÉΓòÉΓòÉ 11. Notices ΓòÉΓòÉΓòÉ
  9071.  
  9072. This information was developed for products and services offered in the U.S.A. 
  9073. IBM may not offer the products, services, or features discussed in this 
  9074. document in other countries. Consult your local IBM representative for 
  9075. information on the products and services currently available in your area. Any 
  9076. reference to an IBM product, program, or service is not intended to state or 
  9077. imply that only that IBM product, program, or service may be used. Any 
  9078. functionally equivalent product, program, or service that does not infringe any 
  9079. IBM intellectual property right may be used instead.  However, it is the user's 
  9080. responsibility to evaluate and verify the operation of any non-IBM product, 
  9081. program, or service. 
  9082.  
  9083. IBM may have patents or pending patent applications covering subject matter in 
  9084. this document. The furnishing of this document does not give you any license to 
  9085. these patents. You can send license inquiries, in writing, to: 
  9086.  
  9087. IBM Director of Licensing
  9088. IBM Corporation
  9089. North Castle Drive
  9090. Armonk, NY  10504-1785
  9091. U.S.A.
  9092.  
  9093. For license inquiries regarding double-byte (DBCS) information, contact the IBM 
  9094. Intellectual Property Department in your country or send inquiries, in writing, 
  9095. to: 
  9096.  
  9097. IBM World Trade Asia Corporation Licensing
  9098. 2-31 Roppongi 3-chome, Minato-ku
  9099. Tokyo 106, Japan
  9100.  
  9101. The following paragraph does not apply to the United Kingdom or any other 
  9102. country where such provisions are inconsistent with local law: INTERNATIONAL 
  9103. BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT 
  9104. WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 
  9105. THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A 
  9106. PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied 
  9107. warranties in certain transactions, therefore, this statement may not apply to 
  9108. you. 
  9109.  
  9110. This information could include technical inaccuracies or typographical errors. 
  9111. Changes are periodically made to the information herein; these changes will be 
  9112. incorporated in new editions of the information.  IBM may make improvements 
  9113. and/or changes in the product(s) and/or the program(s) described in this 
  9114. information at any time without notice. 
  9115.  
  9116. Any references in this information to non-IBM Web sites are provided for 
  9117. convenience  only and do not in any manner serve as an endorsement of those Web 
  9118. sites.  The  materials at those Web sites are not part of the materials for 
  9119. this IBM product and use  of those Web sites is at your own risk. 
  9120.  
  9121. Licensees of this program who wish to have information about it for the purpose 
  9122. of enabling:  (i) the exchange of information between independently created 
  9123. programs and other programs (including this one) and (ii) the mutual use of the 
  9124. information which has been exchanged, should contact: 
  9125.  
  9126. IBM Corporation
  9127. Department LZKS
  9128. 11400 Burnet Road
  9129. Austin, TX 78758
  9130. U.S.A.
  9131.  
  9132. Such information may be available, subject to appropriate terms and conditions, 
  9133. including in some cases, payment of a fee. 
  9134.  
  9135. The licensed program described in this document and all licensed material 
  9136. available for it are provided by IBM under terms of the IBM Customer Agreement, 
  9137. IBM International Program License Agreement, or any equivalent agreement 
  9138. between us. 
  9139.  
  9140. Any performance data contained herein was determined in a controlled 
  9141. environment.  Therefore, the results obtained in other operating environments 
  9142. may vary significantly.  Some measurements may have been made on 
  9143. development-level systems and there is no guarantee that these measurements 
  9144. will be the same on generally available systems. Furthermore, some measurement 
  9145. may have been estimated through extrapolation.  Actual results may vary. Users 
  9146. of this document should verify the applicable data for their specific 
  9147. environment. 
  9148.  
  9149. Information concerning non-IBM products was obtained from the suppliers of 
  9150. those products, their published announcements or other publicly available 
  9151. sources.  IBM has not tested those products and cannot confirm the accuracy of 
  9152. performance, compatibility or any other claims related to non-IBM products. 
  9153. Questions on the capabilities of non-IBM products should be addressed to the 
  9154. suppliers of those products. 
  9155.  
  9156. All statements regarding IBM's future direction or intent are subject to change 
  9157. or withdrawal without notice, and represent goals and objectives only. 
  9158.  
  9159. All IBM prices shown are IBM's suggested retail prices, are current and are 
  9160. subject to change without notice.  Dealer prices may vary. 
  9161.  
  9162. COPYRIGHT LICENSE: 
  9163.  
  9164. This information contains sample application programs in source language, which 
  9165. illustrates programming techniques on various operating platforms.  You may 
  9166. copy, modify, and distribute these sample programs in any form without payment 
  9167. to IBM, for the purposes of developing, using, marketing or distributing 
  9168. application programs conforming to the application programming interface for 
  9169. the operating platform for which the sample programs are written. 
  9170.  
  9171. These examples have not been thoroughly tested under all conditions.  IBM, 
  9172. therefore, cannot guarantee or imply reliability, serviceability, or function 
  9173. of these programs. You may copy, modify, and distribute these sample programs 
  9174. in any form without payment to IBM for the purposes of developing, using, 
  9175. marketing, or distributing application programs conforming to IBM's application 
  9176. programming interfaces. 
  9177.  
  9178.  
  9179. ΓòÉΓòÉΓòÉ 11.1. Trademarks ΓòÉΓòÉΓòÉ
  9180.  
  9181. The following are trademarks of International Business Machines Corporation in 
  9182. the United States, or other countries, or both: 
  9183.  
  9184. IBM
  9185. OS/2
  9186.  
  9187. Other company, product, and service names may be trademarks or service marks of 
  9188. others.