SplSetPort

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
 * ERROR_INVALID_PARAMETER(87)
 * An invalid parameter was specified; most likely an invalid pBuf value or an invalid ulParmNum value.


 * ERROR_NOT_SUPPORTED(50)
 * Command not supported on pszComputerName.


 * NERR_DestNotFound(2152)
 * The port name does not exist.

Sample

 * 1) define INCL_SPL
 * 2) define INCL_SPLBIDI
 * 3) include 

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);