SplPdEnumPort: Difference between revisions
Created page with "SplPdEnumPort enumerates the port names and port descriptions that this port driver can manipulate. == Syntax == SplPdEnumPort(hab, pBuf, cbBuf, pulReturned, pulTotal, pcbN..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
SplPdEnumPort enumerates the port names and port descriptions that this port driver can manipulate. | SplPdEnumPort enumerates the port names and port descriptions that this port driver can manipulate. | ||
== Syntax == | |||
SplPdEnumPort(hab, pBuf, cbBuf, pulReturned, pulTotal, pcbNeeded) | == Syntax == | ||
SplPdEnumPort(hab, pBuf, cbBuf, pulReturned, pulTotal, pcbNeeded) | |||
== Parameters == | == Parameters == | ||
;hab (HAB) - input : The handle to the anchor block. | |||
; hab (HAB) - input : The handle to the anchor block. | ;pBuf (PVOID) - input : The pointer to the buffer of data structures. | ||
;cbBuf (ULONG) - input : The size of the buffer in bytes. | |||
; pBuf (PVOID) - input : The pointer to the buffer of data structures. | ;pulReturned (PULONG) - input : The number of port entries returned. | ||
;pulTotal (PULONG) - input : The total number of port entries. | |||
; cbBuf (ULONG) - input : The size of the buffer in bytes. | ;pcbNeeded (PULONG) - input : The size of the buffer required for all data. | ||
; pulReturned (PULONG) - input : The number of port entries returned. | |||
; pulTotal (PULONG) - input : The total number of port entries. | |||
pcbNeeded (PULONG) - input | |||
The size of the buffer required for all data. | |||
== 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 | |||
ERROR_INSUFFICIENT_BUFFER | ERROR_MORE_DATA | ||
ERROR_MORE_DATA | NO_ERROR | ||
NO_ERROR | The buffer, on return, consists of an array of the following data structure: | ||
The buffer, on return, consists of an array of the following data structure: | |||
typedef struct _PORTNAMES { | typedef struct _PORTNAMES { | ||
PSZ pszPortName; | PSZ pszPortName; | ||
PSZ pszPortDesc; | PSZ pszPortDesc; | ||
} PORTNAMES; | } PORTNAMES; | ||
== Sample == | == Sample == | ||
Line 55: | Line 42: | ||
== Remarks == | == Remarks == | ||
If the buffer is too small to hold even one data structure, the error code ERROR_INSUFFICIENT_BUFFER, is returned. If there is more data, ERROR_MORE_DATA is returned and cbRequired gives the size of buffer required to get all the data | If the buffer is too small to hold even one data structure, the error code ERROR_INSUFFICIENT_BUFFER, is returned. If there is more data, ERROR_MORE_DATA is returned and cbRequired gives the size of buffer required to get all the data. | ||
The Workplace Shell is the expected caller of this function and determines which ports to install in OS2SYS.INI. The port descriptions are used to label the icon for each port. The Workplace Shell does not allow the installation of ports that can be serviced by more than one port driver. The first port installed is used. The Workplace Shell does not display other ports for installation. If another port is required, the first port must be uninstalled. | |||
[[Category:Spl]] | [[Category:Spl]] |
Latest revision as of 21:44, 2 July 2023
SplPdEnumPort enumerates the port names and port descriptions that this port driver can manipulate.
Syntax
SplPdEnumPort(hab, pBuf, cbBuf, pulReturned, pulTotal, pcbNeeded)
Parameters
- hab (HAB) - input
- The handle to the anchor block.
- pBuf (PVOID) - input
- The pointer to the buffer of data structures.
- cbBuf (ULONG) - input
- The size of the buffer in bytes.
- pulReturned (PULONG) - input
- The number of port entries returned.
- pulTotal (PULONG) - input
- The total number of port entries.
- pcbNeeded (PULONG) - input
- The size of the buffer required for all data.
Returns
- rc (APIERR) - returns
- Return codes.
This handling routine returns the following errors:
ERROR_INSUFFICIENT_BUFFER ERROR_MORE_DATA NO_ERROR
The buffer, on return, consists of an array of the following data structure:
typedef struct _PORTNAMES { PSZ pszPortName; PSZ pszPortDesc; } PORTNAMES;
Sample
#include <os2.h> HAB hab; /* The handle to the anchor block. */ PVOID pBuf; /* The pointer to the buffer of data structures. */ ULONG cbBuf; /* The size of the buffer in bytes. */ PULONG pulReturned; /* The number of port entries returned. */ PULONG pulTotal; /* The total number of port entries. */ PULONG pcbNeeded; /* The size of the buffer required for all data. */ APIERR rc; /* Return codes. */ rc = SplPdEnumPort(hab, pBuf, cbBuf, pulReturned, pulTotal, pcbNeeded);
Remarks
If the buffer is too small to hold even one data structure, the error code ERROR_INSUFFICIENT_BUFFER, is returned. If there is more data, ERROR_MORE_DATA is returned and cbRequired gives the size of buffer required to get all the data.
The Workplace Shell is the expected caller of this function and determines which ports to install in OS2SYS.INI. The port descriptions are used to label the icon for each port. The Workplace Shell does not allow the installation of ports that can be serviced by more than one port driver. The first port installed is used. The Workplace Shell does not display other ports for installation. If another port is required, the first port must be uninstalled.