NWPSCfgGetFirstPrinter(3nw)


NWPSCfgGetFirstPrinter -- finds first printer in list maintained by print server

Synopsis

   #include <nwps_cfg.h> 
   or 
   #include <nwpsrv.h> 
   

NWCCODE NWAPI NWPSCfgGetFirstPrinter (WORD connType, DWORD connID, NWPSListHandle NWFAR *handle, char NWFAR *pServerName, char NWFAR *printerName);

Description

The parameters are as follows:

connType
(IN) Specifies either NWPS_BINDERY_SERVICE, NWPS_BINDERY_SERVICE_PRE_40, or NWPS_DIRECTORY_SERVICE.

connID
(IN) Specifies the connection or context identifier.

handle
(OUT) Points to the value to be passed to NWPSCfgGetNextPrinter and NWPSCfgEndNextPrinter.

pserverName
(IN/OUT) Points to the name of the print server. Its maximum length is MAX_DN_BYTES for Directory Services; 48 characters for other services.

printerName
(OUT) Points to the name of the first printer found. Its maximum length is MAX_DN_BYTES for Directory Services; 48 characters for other services.

Return values

0x0000
Successful

0x7760
NWPSE_END_OF_LIST

-1
General Error

other
Bindery Error

Notices

Memory allocated and files opened by NWPSCfgGetFirstPrinter must be respectively deallocated and closed by NWPSCfgEndNextPrinter. If the completion code is non-zero, the value returned for the handle is zero, and calling NWPSCfgEndNextPrinter is not required.

pserverName is optional in NWPS_DIRECTORY_SERVICE mode; it is required in NWPS_BINDERY_SERVICE mode. If present, only the printers for that particular print server are scanned.

In Directory Services, if pserverName points to an empty string, all printers are scanned; and their associated print server names are also returned. If pserverName is NULL, all printers are scanned but no print server names are returned. The latter method is the fastest for Directory Services.

Services

Print Server

References

NWPSCfgEndNextPrinter(3nw), NWPSCfgGetNextPrinter(3nw), NWPSCfgVerifyPrinter(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.