Jump to content

DosQNmPipeInfo: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Legacy
|RepFunc=
|Remarks=This page list the older version of the function for reference.
}}
This call returns information for a named pipe.
This call returns information for a named pipe.


Line 9: Line 5:


==Parameters==
==Parameters==
;Handle (HPIPE) - input : Handle of the named pipe that is returned by DosMakeNmPipe or DosOpen.
;Handle (HPIPE) - input : Handle of the named pipe that is returned by [[DosMakeNmPipe]] or [[DosOpen]].
;InfoLevel (USHORT) - input : Level of the required pipe information. Only level 1 file information is supported.
;InfoLevel (USHORT) - input : Level of the required pipe information. Only level 1 file information is supported.
;InfoBuf (PBYTE) - output : Address of the storage area that returns the requested level of named pipe information. For InfoLevel = 1, file information is returned in the following format:
;InfoBuf (PBYTE) - output : Address of the storage area that returns the requested level of named pipe information. For InfoLevel = 1, file information is returned in the following format:
 
::outbufsize (USHORT):  Actual size of buffer for outgoing I/O.
outbufsize (USHORT):  Actual size of buffer for outgoing I/O.  
::inbufsize (USHORT) :  Actual size of buffer for ingoing I/O.
 
::maxnuminstances (UCHAR) : Maximum allowed number of pipe instances.
inbufsize (USHORT) :  Actual size of buffer for ingoing I/O.  
::numinstances (UCHAR) : Current number of pipe instances.
 
::namelength (UCHAR) : Length of pipe name.
maxnuminstances (UCHAR) : Maximum allowed number of pipe instances.  
::pipename (CHAR) : Name of pipe (including \\ComputerName, if remote).
 
;InfoBufSize (USHORT) - input : Length of InfoBuf.
numinstances (UCHAR) : Current number of pipe instances.  
 
namelength (UCHAR) : Length of pipe name.  
 
pipename (CHAR) : Name of pipe (including \\ComputerName, if remote).  
 
; InfoBufSize (USHORT) - input : Length of InfoBuf.
 


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 NO_ERROR
Return code descriptions are:
*111 ERROR_BUFFER_OVERFLOW
* 0   NO_ERROR
*124 ERROR_INVALID_LEVEL
* 111 ERROR_BUFFER_OVERFLOW
*230 ERROR_BAD_PIPE
* 124 ERROR_INVALID_LEVEL
* 230 ERROR_BAD_PIPE


==Remarks==
==Remarks==
Line 42: Line 28:
For level 1 information, if the length of the name of the pipe is greater than 255 bytes, then a length of zero is returned in the length field. The full ASCIIZ name will still be returned in this case.
For level 1 information, if the length of the name of the pipe is greater than 255 bytes, then a length of zero is returned in the length field. The full ASCIIZ name will still be returned in this case.


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
typedef struct  npi_data1 {   /* PipeInfo data block (returned,
typedef struct  npi_data1 { /* PipeInfo data block (returned, level 1) */
                                            level 1) */
   USHORT npi_obuflen;       /* length of outgoing I/O buffer */
   USHORT npi_obuflen;         /* length of outgoing I/O buffer */
   USHORT npi_ibuflen;       /* length of incoming I/O buffer */
   USHORT npi_ibuflen;         /* length of incoming I/O buffer */
   UCHAR  npi_maxicnt;       /* maximum number of instances  */
   UCHAR  npi_maxicnt;         /* maximum number of instances  */
   UCHAR  npi_curicnt;       /* current number of instances  */
   UCHAR  npi_curicnt;         /* current number of instances  */
   UCHAR  npi_namlen;         /* length of pipe name          */
   UCHAR  npi_namlen;           /* length of pipe name          */
   CHAR  npi_name[1];         /* start of name      */
   CHAR  npi_name[1];           /* start of name      */
}; /* npi_data1 */
}; /* npi_data1 */


Line 59: Line 44:
USHORT  rc = DosQNmPipeInfo(Handle, InfoLevel, InfoBuf, InfoBufSize);
USHORT  rc = DosQNmPipeInfo(Handle, InfoLevel, InfoBuf, InfoBufSize);


HPIPE           Handle;        /* Pipe handle */
HPIPE   Handle;        /* Pipe handle */
USHORT           InfoLevel;    /* Pipe data required */
USHORT InfoLevel;    /* Pipe data required */
PBYTE           InfoBuf;      /* Pipe data buffer */
PBYTE   InfoBuf;      /* Pipe data buffer */
USHORT           InfoBufSize;  /* Pipe data buffer size */
USHORT InfoBufSize;  /* Pipe data buffer size */


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


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosQNmPipeInfo:FAR
EXTRN  DosQNmPipeInfo:FAR
Line 80: Line 65:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:Dos]]
[[Category:Dos16]]

Latest revision as of 06:19, 26 January 2020

This call returns information for a named pipe.

Syntax

DosQNmPipeInfo (Handle, InfoLevel, InfoBuf, InfoBufSize)

Parameters

Handle (HPIPE) - input
Handle of the named pipe that is returned by DosMakeNmPipe or DosOpen.
InfoLevel (USHORT) - input
Level of the required pipe information. Only level 1 file information is supported.
InfoBuf (PBYTE) - output
Address of the storage area that returns the requested level of named pipe information. For InfoLevel = 1, file information is returned in the following format:
outbufsize (USHORT): Actual size of buffer for outgoing I/O.
inbufsize (USHORT) : Actual size of buffer for ingoing I/O.
maxnuminstances (UCHAR) : Maximum allowed number of pipe instances.
numinstances (UCHAR) : Current number of pipe instances.
namelength (UCHAR) : Length of pipe name.
pipename (CHAR) : Name of pipe (including \\ComputerName, if remote).
InfoBufSize (USHORT) - input
Length of InfoBuf.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 111 ERROR_BUFFER_OVERFLOW
  • 124 ERROR_INVALID_LEVEL
  • 230 ERROR_BAD_PIPE

Remarks

DosQNmPipeInfo returns all the information that fits in InfoBuf.

For level 1 information, if the length of the name of the pipe is greater than 255 bytes, then a length of zero is returned in the length field. The full ASCIIZ name will still be returned in this case.

Bindings

C

typedef struct   npi_data1 {  /* PipeInfo data block (returned, level 1) */
   USHORT npi_obuflen;        /* length of outgoing I/O buffer */
   USHORT npi_ibuflen;        /* length of incoming I/O buffer */
   UCHAR  npi_maxicnt;        /* maximum number of instances   */
   UCHAR  npi_curicnt;        /* current number of instances   */
   UCHAR  npi_namlen;         /* length of pipe name           */
   CHAR  npi_name[1];         /* start of name       */
}; /* npi_data1 */

#define INCL_DOSNMPIPES

USHORT  rc = DosQNmPipeInfo(Handle, InfoLevel, InfoBuf, InfoBufSize);

HPIPE   Handle;        /* Pipe handle */
USHORT  InfoLevel;     /* Pipe data required */
PBYTE   InfoBuf;       /* Pipe data buffer */
USHORT  InfoBufSize;   /* Pipe data buffer size */

USHORT  rc;            /* return code */

MASM

EXTRN  DosQNmPipeInfo:FAR
INCL_DOSNMPIPES     EQU 1

PUSH   WORD    Handle        ;Pipe handle
PUSH   WORD    InfoLevel     ;Pipe data required
PUSH@  OTHER   InfoBuf       ;Pipe data buffer
PUSH   WORD    InfoBufSize   ;Pipe data buffer size
CALL   DosQNmPipeInfo

Returns WORD