hFile (HFILE) - input

      Handle of the file to be queried.

    pMode (PULONG) - output

      Address of the contents of the open-mode word defined in a previous DosOpen function.

      Bit

        Description
      15
        OPEN_FLAGS_DASD (0x00008000) Direct Open flag:

      • pszFileName field in DosOpen represents a file to be opened normally.

      • pszFileName is the "drive:" (such as C: or A:). It represents a mounted disk or diskette volume to be opened for direct access.
      14
        OPEN_FLAGS_WRITE_THROUGH (0x00004000)
        Write-Through flag:

      • Write operations to the file go through the file system buffer cache.

      • Write operations to the file may go through the file system buffer cache, but the sectors are written (the actual file I/O operation is completed) before a synchronous write call returns. This state of the file defines it as a synchronous file. For synchronous files, this bit is set to 1 because the data must be written to the medium for synchronous write operations.

        The Write-Through flag bit is not inherited by child processes.

      13
        OPEN_FLAGS_FAIL_ON_ERROR (0x00002000)
        Fail-Errors flag. Media I/O errors are handled as follows:

      • Reported through the system critical-error handler.
      • Reported directly to the caller by a return code.

        Media I/O errors generated through Category 08h Logical Disk Control IOCtl Commands always are reported directly to the caller by a return code. The Fail-Errors function applies only to non-IOCtl handle-based file I/O functions.

        The Fail-Errors flag bit is not inherited by child processes.

      12
        OPEN_FLAGS_NO_CACHE (0x00001000)
        Cache or No-Cache:

      • The disk driver should place data from I/O operations into the cache on this file.

      • I/O operations to the file need not be done through the disk-driver cache.

        The setting of this bit determines whether it is worth caching the data for file-systems drivers and device drivers. This bit, like the Write-Through bit, is a per-handle bit.

        This bit is not inherited by child processes.

      11-8
        Reserved bits.
      7
        OPEN_FLAGS_NOINHERIT (0x00000080) Inheritance flag:

      • The file handle is inherited by a process that is created by issuing DosExecPgm.

      • The file handle is private to the current process.

        This bit is not inherited by child processes.

      6-4
        Sharing-Mode flags: Define the operations other processes can perform on the file:

        001

          OPEN_SHARE_DENYREADWRITE
          Deny read and write access.
        010
          OPEN_SHARE_DENYWRITE
          Deny write access.
        011
          OPEN_SHARE_DENYREAD
          Deny read access.
        100
          OPEN_SHARE_DENYNONE
          Deny neither read nor write access (deny none).
        Any other value is invalid.
      3
        Reserved.
      2-0
        Access-Mode flags. File access is assigned as follows:

        000

          OPEN_ACCESS_READONLY
          Read-only access.
        001
          OPEN_ACCESS_WRITEONLY
          Write-only access.
        010
          OPEN_ACCESS_READWRITE
          Read and write access.
        Any other value is invalid.

      ulrc (APIRET) - returns

        Return Code.

        DosQueryFHState returns one of the following values:

      • NO_ERROR 6
          ERROR_INVALID_HANDLE
        For a full list of error codes, see Errors.


      [Back] [Next]