Jump to content

DosQNmPHandState: Difference between revisions

From EDM2
Created page with "==Description== This call returns information for a named pipe's specific handle state. ==Syntax== <PRE> DosQNmPHandState (Handle, PipeHandleState) </PRE> ==Parameters..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call returns information for a named pipe's specific handle state.
This call returns information for a named pipe's specific handle state.  
 
==Syntax==
==Syntax==
<PRE>
  DosQNmPHandState (Handle, PipeHandleState)
  DosQNmPHandState
 
    (Handle, PipeHandleState)
</PRE>


==Parameters==
==Parameters==
; Handle (HPIPE) - input : Handle of the named pipe returned by DosMakeNmPipe or DosOpen.  
;Handle (HPIPE) - input : Handle of the named pipe returned by DosMakeNmPipe or DosOpen.
 
;PipeHandleState (PUSHORT) - output : Address of the named pipe handle state:
; PipeHandleState (PUSHORT) - output : Address of the named pipe handle state:
::15 - Blocking; pipe is defined as follows:
 
:::0 = Reads/Writes block if no data available.
Bit        Description
:::1 = Reads/Writes return immediately if no data available.
15       Blocking; pipe is defined as follows:
:::Reads normally block until at least partial data can be returned. Writes, by default, block until all bytes requested have been written. :::Non-blocking mode (value is 1) changes this behavior as follows:  
        0 = Reads/Writes block if no data available.
:::* DosRead returns immediately with BytesRead = 0 (as defined in DosRead) if no data is available.  
        1 = Reads/Writes return immediately if no data available.
:::* DosWrite returns immediately with BytesWritten = 0 (as defined in DosWrite) if insufficient buffer space is available in the pipe, or the entire data area is transferred.
::14 - Server or requester end; end-point of named pipe shown as follows:
Reads normally block until at least partial data can be returned. Writes, by default, block until all bytes requested have been written. Non-blocking mode (value is 1) changes this behavior as follows:  
:::0 = Handle is the client end of a named pipe.
* DosRead returns immediately with BytesRead = 0 (as defined in DosRead) if no data is available.  
:::1 = Handle is the server (requester) end of a named pipe.
* DosWrite returns immediately with BytesWritten = 0 (as defined in DosWrite) if insufficient buffer space is available in the pipe, or the entire data area is transferred.
::13-12 - Reserved.
14     Server or requester end; end-point of named pipe shown as follows:
::11-10 - Type of named pipe:
        0 = Handle is the client end of a named pipe.
:::00 = Pipe is a byte stream pipe.
        1 = Handle is the server (requester) end of a named pipe.  
:::01 = Pipe is a message stream pipe.
13-12       Reserved.
::9-8 - Read mode:
11-10 Type of named pipe:
:::00 = Read pipe as a byte stream.
            00 = Pipe is a byte stream pipe.
:::01 = Read pipe as a message stream.
            01 = Pipe is a message stream pipe.  
::7-0 - Instance count; 8-bit count to control pipe instances. When making the first instance of a named pipe, this field specifies how many instances can be created. Instances are as follows:
   
:::1 - This can be the only instance (pipe is unique).
9-8       Read mode:
:::-1 - The number of instances is unlimited.
        00 = Read pipe as a byte stream.
:::0 - Reserved value.
        01 = Read pipe as a message stream.  
   
7-0       Instance count; 8-bit count to control pipe instances. When making the first instance of a named pipe, this field specifies how many instances can be created. Instances are as follows:  
 
Value        Definition
1       This can be the only instance (pipe is unique).  
-1       The number of instances is unlimited.  
0       Reserved value.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 NO_ERROR
Return code descriptions are:
*230 ERROR_BAD_PIPE
 
*233 ERROR_PIPE_NOT_CONNECTED
* 0         NO_ERROR
* 230       ERROR_BAD_PIPE
* 233       ERROR_PIPE_NOT_CONNECTED


==Remarks==
==Remarks==
At the serving end, the values returned by DosQNmPHandState are those originally established by DosMakeNmPipe or a subsequent DosSetNmPHandState. The values returned by the client end are those originally established by DosOpen or a subsequent DosSetNmPHandState.
At the serving end, the values returned by DosQNmPHandState are those originally established by [[DosMakeNmPipe]] or a subsequent [[DosSetNmPHandState]]. The values returned by the client end are those originally established by DosOpen or a subsequent DosSetNmPHandState.


==Example Code==
==Bindings==
=== C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSNMPIPES
#define INCL_DOSNMPIPES
Line 59: Line 44:
USHORT  rc = DosQNmPHandState(Handle, PipeHandleState);
USHORT  rc = DosQNmPHandState(Handle, PipeHandleState);


HPIPE           Handle;          /* Pipe handle */
HPIPE   Handle;          /* Pipe handle */
PUSHORT         PipeHandleState; /* Pipe handle state */
PUSHORT PipeHandleState; /* Pipe handle state */


USHORT           rc;              /* return code */
USHORT rc;              /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosQNmPHandState:FAR
EXTRN  DosQNmPHandState:FAR
Line 77: Line 62:
</PRE>
</PRE>


==Related Functions==
[[Category:Dos16]]
*
 
[[Category:The OS/2 API Project]]

Latest revision as of 06:18, 26 January 2020

This call returns information for a named pipe's specific handle state.

Syntax

DosQNmPHandState (Handle, PipeHandleState)

Parameters

Handle (HPIPE) - input
Handle of the named pipe returned by DosMakeNmPipe or DosOpen.
PipeHandleState (PUSHORT) - output
Address of the named pipe handle state:
15 - Blocking; pipe is defined as follows:
0 = Reads/Writes block if no data available.
1 = Reads/Writes return immediately if no data available.
Reads normally block until at least partial data can be returned. Writes, by default, block until all bytes requested have been written. :::Non-blocking mode (value is 1) changes this behavior as follows:
  • DosRead returns immediately with BytesRead = 0 (as defined in DosRead) if no data is available.
  • DosWrite returns immediately with BytesWritten = 0 (as defined in DosWrite) if insufficient buffer space is available in the pipe, or the entire data area is transferred.
14 - Server or requester end; end-point of named pipe shown as follows:
0 = Handle is the client end of a named pipe.
1 = Handle is the server (requester) end of a named pipe.
13-12 - Reserved.
11-10 - Type of named pipe:
00 = Pipe is a byte stream pipe.
01 = Pipe is a message stream pipe.
9-8 - Read mode:
00 = Read pipe as a byte stream.
01 = Read pipe as a message stream.
7-0 - Instance count; 8-bit count to control pipe instances. When making the first instance of a named pipe, this field specifies how many instances can be created. Instances are as follows:
1 - This can be the only instance (pipe is unique).
-1 - The number of instances is unlimited.
0 - Reserved value.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 230 ERROR_BAD_PIPE
  • 233 ERROR_PIPE_NOT_CONNECTED

Remarks

At the serving end, the values returned by DosQNmPHandState are those originally established by DosMakeNmPipe or a subsequent DosSetNmPHandState. The values returned by the client end are those originally established by DosOpen or a subsequent DosSetNmPHandState.

Bindings

C

#define INCL_DOSNMPIPES

USHORT  rc = DosQNmPHandState(Handle, PipeHandleState);

HPIPE   Handle;          /* Pipe handle */
PUSHORT PipeHandleState; /* Pipe handle state */

USHORT  rc;              /* return code */

MASM

EXTRN  DosQNmPHandState:FAR
INCL_DOSNMPIPES     EQU 1

PUSH   WORD    Handle          ;Pipe handle
PUSH@  WORD    PipeHandleState ;Pipe handle state (returned)
CALL   DosQNmPHandState

Returns WORD