DosQNmPipeInfo: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
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). | ||
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. | ; InfoBufSize (USHORT) - input : Length of InfoBuf. | ||
==Return Code== | ==Return Code== | ||
rc (USHORT) - return | rc (USHORT) - return | ||
Return code descriptions are: | Return code descriptions are: | ||
* 0 NO_ERROR | * 0 NO_ERROR | ||
Line 45: | Line 32: | ||
===C Binding=== | ===C Binding=== | ||
<PRE> | <PRE> | ||
typedef struct npi_data1 { /* PipeInfo data block (returned, | typedef struct npi_data1 { /* PipeInfo data block (returned, 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 */ | ||
Line 59: | Line 45: | ||
USHORT rc = DosQNmPipeInfo(Handle, InfoLevel, InfoBuf, InfoBufSize); | USHORT rc = DosQNmPipeInfo(Handle, InfoLevel, InfoBuf, InfoBufSize); | ||
HPIPE | HPIPE Handle; /* Pipe handle */ | ||
USHORT | USHORT InfoLevel; /* Pipe data required */ | ||
PBYTE | PBYTE InfoBuf; /* Pipe data buffer */ | ||
USHORT | USHORT InfoBufSize; /* Pipe data buffer size */ | ||
USHORT | USHORT rc; /* return code */ | ||
</PRE> | </PRE> | ||
Line 80: | Line 66: | ||
Returns WORD | Returns WORD | ||
</PRE> | </PRE> | ||
==Related Functions== | ==Related Functions== | ||
* | *[[DosMakeNmPipe]] | ||
*[[DosOpen]] | |||
[[Category:Dos]] | [[Category:Dos]] |
Revision as of 21:41, 5 April 2018
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.
Example Code
C Binding
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 Binding
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