The DosPrintDestSetInfo API changes the configuration of a print destination.
To use this function to disconnect a printer from a port, supply a null string for the pszLogAddr element of the PRDINFO3 data structure.
Restrictions
This API can be called from DLS and OS/2 workstations, but DLS workstations can issue this call only to a remote LAN Server workstation. Administrator authority is required to call this API.
#define INCL_BASE #include <os2.h> #include <pmspl.h> #include <neterr.h> #include <netcons.h> SPLERR SPLENTRY DosPrintDestSetInfo(pszServername, pszPrinterName, uLevel, buf, usBuflen, parmnum); /* 16 bit */Parameters
See Common Parameter Definitions for the descriptions of the parameters that are not defined here.
pszPrinterName
Note: The pszPrinterName, uLevel, and buf parameters function together for this API as they do for the DosPrintDestGetInfo API. For more information, see the description of uLevel in Print Destination - DosPrintDestGetInfo.
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌─────────────────────────────┬───────┬────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NETWORK_ACCESS_DENIED │ 65 │ Network access is denied. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_LEVEL │ 124 │ The uLevel parameter is not valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_RemoteOnly │ 2106 │ This operation is not supported on │
│ │ │ workstations. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadTransactConfig │ 2141 │ The server is not configured for
│
│ │ │ transactions. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_DestNotFound │ 2152 │ The print destination cannot be found.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_SpoolerNotLoaded │ 2161 │ The spooler service has not been
│
│ │ │ started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_SpoolNoMemory │ 2165 │ A spooler
memory allocation failure │
│ │ │ has occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_DriverNotFound │ 2166 │ The device driver specified has not
│
│ │ │ been installed on the computer. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadDev │ 2341 │ The requested device is not valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidComputer │ 2351 │ The specified computer name is not
│
│ │ │ valid. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘