SplPdQueryPort: Difference between revisions
Appearance
Created page with "SplPdQueryPort returns textual data that describes the port configuration in a way that can be printed by the Workplace Shell. == Syntax == SplPdQueryPort(hab, pszPortName,..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
SplPdQueryPort returns textual data that describes the port configuration in a way that can be printed by the Workplace Shell. | SplPdQueryPort returns textual data that describes the port configuration in a way that can be printed by the Workplace Shell. | ||
== Syntax == | |||
SplPdQueryPort(hab, pszPortName, pBuf, cbBuf, cItems) | == Syntax == | ||
SplPdQueryPort(hab, pszPortName, pBuf, cbBuf, cItems) | |||
== Parameters == | == Parameters == | ||
; hab (HAB) - input : The handle to the anchor block. | ; hab (HAB) - input : The handle to the anchor block. | ||
; pszPortName (PSZ) - input: The name of the port to be configured. | |||
; pszPortName (PSZ) - input | ; pBuf (PVOID) - input:The pointer to the buffer of data structures. | ||
: The name of the port to be configured. | ; cbBuf (ULONG) - input: The size of the buffer in bytes. | ||
; cItems (PULONG) - input: The count of the number of strings of description returned. | |||
; pBuf (PVOID) - input | |||
:The pointer to the buffer of data structures. | |||
; cbBuf (ULONG) - input | |||
: The size of the buffer in bytes. | |||
; cItems (PULONG) - input | |||
: The count of the number of strings of description returned. | |||
== Returns == | == Returns == | ||
; rc (APIERR) - returns : Return codes. | ; rc (APIERR) - returns : Return codes. | ||
This handling routine returns the following errors: | |||
This handling routine returns the following errors: | * ERROR_INSUFFICIENT_BUFFER | ||
* NO_ERROR | |||
* ERROR_INSUFFICIENT_BUFFER | |||
* NO_ERROR | |||
== Sample == | == Sample == | ||
Line 37: | Line 28: | ||
APIERR rc; /* Return codes. */ | APIERR rc; /* Return codes. */ | ||
rc = SplPdQueryPort(hab, pszPortName, pBuf, | rc = SplPdQueryPort(hab, pszPortName, pBuf, cbBuf, cItems); | ||
</pre> | </pre> | ||
== Remarks == | == Remarks == | ||
The buffer consists of an array of strings (PSZ), the number of which is given by cItems. Each string contains one line of text that can be 0 to 80 characters long. The port name and port description | The buffer consists of an array of strings (PSZ), the number of which is given by cItems. Each string contains one line of text that can be 0 to 80 characters long. The port name and port description are not required; the Workplace Shell can retrieve these from the OS2SYS.INI file. | ||
The maximum size of the data returned is | The maximum size of the data returned is 4 KB. If the buffer is too small, the error code, ERROR_INSUFFICIENT_BUFFER, is returned. | ||
[[Category:Spl]] | [[Category:Spl]] |
Latest revision as of 19:46, 2 July 2023
SplPdQueryPort returns textual data that describes the port configuration in a way that can be printed by the Workplace Shell.
Syntax
SplPdQueryPort(hab, pszPortName, pBuf, cbBuf, cItems)
Parameters
- hab (HAB) - input
- The handle to the anchor block.
- pszPortName (PSZ) - input
- The name of the port to be configured.
- pBuf (PVOID) - input
- The pointer to the buffer of data structures.
- cbBuf (ULONG) - input
- The size of the buffer in bytes.
- cItems (PULONG) - input
- The count of the number of strings of description returned.
Returns
- rc (APIERR) - returns
- Return codes.
This handling routine returns the following errors:
- ERROR_INSUFFICIENT_BUFFER
- NO_ERROR
Sample
#include <os2.h> HAB hab; /* The handle to the anchor block. */ PSZ pszPortName; /* The name of the port to be configured. */ PVOID pBuf; /* The pointer to the buffer of data structures. */ ULONG cbBuf; /* The size of the buffer in bytes. */ PULONG cItems; /* The count of the number of strings of description returned. */ APIERR rc; /* Return codes. */ rc = SplPdQueryPort(hab, pszPortName, pBuf, cbBuf, cItems);
Remarks
The buffer consists of an array of strings (PSZ), the number of which is given by cItems. Each string contains one line of text that can be 0 to 80 characters long. The port name and port description are not required; the Workplace Shell can retrieve these from the OS2SYS.INI file.
The maximum size of the data returned is 4 KB. If the buffer is too small, the error code, ERROR_INSUFFICIENT_BUFFER, is returned.