Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

DosSetFHandState

This call sets the state of the specified file.

Specifies whether a handle of a named pipe can be inherited, and write-behind is allowed.

Syntax

DosSetFHandState (FileHandle, FileHandleState)

Parameters

This bit is not inherited by child processes.

Media I/O errors generated through an IOCTL category 8 function always get reported directly to the caller by way of a return code. The Fail-Errors function applies only to non-IOCTL handle-based type file I/O calls.

This bit is not inherited by child processes.

This bit is an advisory bit, and is used to advise FSDs and device drivers on whether it is worth caching the data or not. This bit, like the write-through bit, is a per-handle bit. This bit is not inherited by child processes.

Return Code

rc (USHORT) - return:Return code descriptions are:

Remarks

OS/2 does not guarantee the order that sectors are written for multiple sector writes. If an application requires several sectors written in a specific order, the operator should issue them as separate synchronous write operations. Setting the write-through flag does not affect any previous writes. That data may remain in the buffers. When a critical error occurs that the application cannot handle, it may reset critical error handling to be performed by the system. This is done by calling DosSetFHandState to turn off the fail/errors bit and reissuing the I/O call. The expected critical error reoccurs and control is passed to the system critical error handler. The precise time that the effect of this function is visible at the application level is unpredictable when asynchronous I/O is pending.

The file handle state bits set by this function can be queried by DosQFHandState.

Family API Considerations

Some options operate differently in the DOS mode than in OS/2 mode. Therefore, the following restrictions apply to DosSetFHandState when coding for the DOS mode:

Named Pipe Considerations

DosSetFHandState allows setting of the inheritance (I) and Write-Through (W) bits. Setting W to 1 prevents write-behind operations on remote pipes.

Bindings

C

#define INCL_DOSFILEMGR
 
USHORT  rc = DosSetFHandState(FileHandle, FileHandleState);
HFILE   FileHandle;      /* File handle */
USHORT  FileHandleState; /* File handle state */
USHORT  rc;              /* return code */

MASM

EXTRN  DosSetFHandState:FAR
INCL_DOSFILEMGR     EQU 1
 
PUSH   WORD    FileHandle      ;File handle
PUSH   WORD    FileHandleState ;File handle state
CALL   DosSetFHandState
 
Returns WORD