Jump to content

SplSetPort: Difference between revisions

From EDM2
Created page with "This function sets the BIDI capabilities of a printer port. This function is used by the print object or other applications to enable or disable BIDI communications with a p..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function sets the BIDI capabilities of a printer port.  
This function sets the BIDI capabilities of a printer port.
 
This function is used by the print object or other applications to enable or disable BIDI communications with a printer. If the port driver is capable of BIDI communications, SplSetPort can override the port driver and disable BIDI with the printer. This is useful in case there are problems with the BIDI components.


This function is used by the print object or other applications to enable or disable BIDI communications with a printer. If the port driver is capable of BIDI communications, SplSetPort can override the port driver and disable BIDI with the printer. This is useful in case there are problems with the BIDI components.
== Syntax ==  
== Syntax ==  
  SplSetPort(pszComputerName, pszPortName, ulLevel, pBuf, cbBuf, ulParmNum);
  SplSetPort(pszComputerName, pszPortName, ulLevel, pBuf, cbBuf, ulParmNum)


== Parameters ==
== Parameters ==
;pszComputerName (PSZ) - input  
;pszComputerName (PSZ) - input:Name of the computer connected to the port.
:Name of the computer connected to the port.  
:This value can be NULL for a local machine.
 
;pszPortName (PSZ) - input:Name of the port to set.
:This value can be NULL for a local machine.  
;ulLevel (ULONG) - input:Level of information to set.
 
:This must be 2.
;pszPortName (PSZ) - input  
;pBuf (PVOID) - input:Buffer containing new port setting.
:Name of the port to set.  
;cbBuf (ULONG) - input:Length of buffer pointed to by pBuf, in bytes.
 
;ulParmNum (ULONG) - input:Parameter number used to change port settings.
;ulLevel (ULONG) - input  
:Parameter number must be one of the following:
:Level of information to set.  
:Value Description
 
:1
:This must be 2.  
::PRPO_PORT_DRIVER
 
::Port driver. This will be the new port driver for the printer port.
;pBuf (PVOID) - input  
:2
:Buffer containing new port setting.  
::PRPO_PROTOCOL_CNV
 
::Protocol converter. This will override the values returned by BIDI_Q_PORT. The spooler will use this protocol converter when using this port in BIDI mode.
;cbBuf (ULONG) - input  
:3
:Length of buffer pointed to by pBuf, in bytes.  
::PRPO_MODE
 
::BIDI mode of the port. The ULONG value pointed to by pBuf must be one of the following values:
;ulParmNum (ULONG) - input  
::Value Description
:Parameter number used to change port settings.  
::1
 
:::PRPORT_AUTODETECT Auto-detect mode. The spooler will use the results of BIDI_Q_PORT to decide if BIDI should be enabled and which protocol converter to use. This is the default.
:Parameter number must be one of the following:  
::2
 
:::PRPORT_DISABLE_BIDI
:Value Description  
:::BIDI disabled. The spooler will not use the printer in BIDI mode. This overrides the port driver.
:1  
::3
::PRPO_PORT_DRIVER  
:::PRPORT_ENABLE_BIDI
::Port driver. This will be the new port driver for the printer port.  
:::BIDI enabled. This is set only if an application knows a printer is capable of using a protocol converter, but the port driver does not know which converter to use. The application must also supply the protocol converter name when setting a port to this mode.
 
:4
:2  
::PRPO_PRIORITY
::PRPO_PROTOCOL_CNV  
::Priority. Currently not supported.
::Protocol converter. This will override the values returned by BIDI_Q_PORT. The spooler will use this protocol converter when using this port in BIDI mode.  
 
:3  
::PRPO_MODE  
::BIDI mode of the port. The ULONG value pointed to by pBuf must be one of the following values:  
 
::Value Description  
::1  
:::PRPORT_AUTODETECT Auto-detect mode. The spooler will use the results of BIDI_Q_PORT to decide if BIDI should be enabled and which protocol converter to use. This is the default.  
 
::2  
:::PRPORT_DISABLE_BIDI  
:::BIDI disabled. The spooler will not use the printer in BIDI mode. This overrides the port driver.  
 
::3  
:::PRPORT_ENABLE_BIDI  
:::BIDI enabled. This is set only if an application knows a printer is capable of using a protocol converter, but the port driver does not know which converter to use. The application must also supply the protocol converter name when setting a port to this mode.  


:4
::PRPO_PRIORITY
::Priority. Currently not supported.
== Returns ==
== Returns ==
; rc (ULONG) - returns : Return codes.  
;rc (ULONG) - returns: Return codes.
*0 Success  
*0 Success
*ERROR_INVALID_PARAMETER(87)
*87 ERROR_INVALID_PARAMETER - An invalid parameter was specified; most likely an invalid pBuf value or an invalid ulParmNum value.
:An invalid parameter was specified; most likely an invalid pBuf value or an invalid ulParmNum value.  
*50 ERROR_NOT_SUPPORTED - Command not supported on pszComputerName.
*ERROR_NOT_SUPPORTED(50)
*2152 NERR_DestNotFound - The port name does not exist.
:Command not supported on pszComputerName.  
*NERR_DestNotFound(2152)
:The port name does not exist.  
 
== Sample ==
<pre>
#define INCL_SPL
#define INCL_SPLBIDI
#include <os2.h>
 
PSZ      pszComputerName;  /*  Name of the computer connected to the port. */
PSZ      pszPortName;      /*  Name of the port to set. */
ULONG    ulLevel;          /*  Level of information to set. */
PVOID    pBuf;            /*  Buffer containing new port setting. */
ULONG    cbBuf;            /*  Length of buffer pointed to by pBuf, in bytes. */
ULONG    ulParmNum;        /*  Parameter number used to change port settings. */
ULONG    rc;              /*  Return codes. */
 
rc = SplSetPort(pszComputerName, pszPortName,
      ulLevel, pBuf, cbBuf, ulParmNum);
 
 
</pre>


[[Category:Spl]]
[[Category:Spl]]

Latest revision as of 15:53, 30 May 2021

This function sets the BIDI capabilities of a printer port.

This function is used by the print object or other applications to enable or disable BIDI communications with a printer. If the port driver is capable of BIDI communications, SplSetPort can override the port driver and disable BIDI with the printer. This is useful in case there are problems with the BIDI components.

Syntax

SplSetPort(pszComputerName, pszPortName, ulLevel, pBuf, cbBuf, ulParmNum)

Parameters

pszComputerName (PSZ) - input
Name of the computer connected to the port.
This value can be NULL for a local machine.
pszPortName (PSZ) - input
Name of the port to set.
ulLevel (ULONG) - input
Level of information to set.
This must be 2.
pBuf (PVOID) - input
Buffer containing new port setting.
cbBuf (ULONG) - input
Length of buffer pointed to by pBuf, in bytes.
ulParmNum (ULONG) - input
Parameter number used to change port settings.
Parameter number must be one of the following:
Value Description
1
PRPO_PORT_DRIVER
Port driver. This will be the new port driver for the printer port.
2
PRPO_PROTOCOL_CNV
Protocol converter. This will override the values returned by BIDI_Q_PORT. The spooler will use this protocol converter when using this port in BIDI mode.
3
PRPO_MODE
BIDI mode of the port. The ULONG value pointed to by pBuf must be one of the following values:
Value Description
1
PRPORT_AUTODETECT Auto-detect mode. The spooler will use the results of BIDI_Q_PORT to decide if BIDI should be enabled and which protocol converter to use. This is the default.
2
PRPORT_DISABLE_BIDI
BIDI disabled. The spooler will not use the printer in BIDI mode. This overrides the port driver.
3
PRPORT_ENABLE_BIDI
BIDI enabled. This is set only if an application knows a printer is capable of using a protocol converter, but the port driver does not know which converter to use. The application must also supply the protocol converter name when setting a port to this mode.
4
PRPO_PRIORITY
Priority. Currently not supported.

Returns

rc (ULONG) - returns
Return codes.
  • 0 Success
  • 87 ERROR_INVALID_PARAMETER - An invalid parameter was specified; most likely an invalid pBuf value or an invalid ulParmNum value.
  • 50 ERROR_NOT_SUPPORTED - Command not supported on pszComputerName.
  • 2152 NERR_DestNotFound - The port name does not exist.