NWPSCfgGetFirstPrinterAttr(3nw)


NWPSCfgGetFirstPrinterAttr -- finds first printer attribute value

Synopsis

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

NWCCODE NWAPI NWPSCfgGetFirstPrinterAttr (WORD connType, DWORD connID, char NWFAR *pServerName, char NWFAR *printerName, WORD attrID, NWPSListHandle NWFAR *handle, void NWFAR *attrValue);

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.

pServerName
(IN) Points to the name of the print server (optional in NWPS_DIRECTORY_SERVICE).

printerName
(IN) Points to the name of the printer.

attrID
(IN) Specifies the print services attribute identifier.

handle
(OUT) Points to the value to be passed toNWPSCfgGetNextPrinterAttr and NWPSCfgEndNextPrinterAttr(optional).

attrValue
(OUT) Points to the buffer in which to place the first attribute found. Its maximum length is MAX_DN_BYTES + sizeof(NWPSTypedName).

Return values

0x0000
Successful

0x7772
NWPSE_ERROR_EXPANDING_DB

-1
General Error

other
Bindery or Directory Services Errors

Notices

Memory allocated and files opened by NWPSCfgGetFirstPrinterAttr must be respectively deallocated and closed by calling NWPSCfgEndNextPrinterAttr. If the completion code is non-zero, or if the attribute requested is single-valued, the value returned for the handle is zero. In this case, calling NWPSCfgEndNextPrinterAttr is not required.

The type of the buffer pointed to by attrValue depends on the value of attrID. If attrID is not recognized, an error is returned.

pServerName is required for calls where connType is NWPS_BINDERY_SERVICE; it is ignored when connType is NWPS_DIRECTORY_SERVICE. Bindery printers do not exist independent of their print server.

handle is optional. If handle is NULL, NWPSCfgEndNextPrinterAttr is called by NWPSCfgGetFirstPrinterAttr to release any allocated resources. Normally calls to NWPSCfgGetFirstPrinterAttr for single-valued attributes should pass a NULL pointer to the handle. Calls to NWPSCfgGetFirstPrinterAttr for multi-valued attributes may also pass a NULL pointer if only the first value in the list is desired, or if the caller is trying only to determine the existence of elements in the list.

Legal attribute identifiers and values for the printer configuration follow:

Bindery Identifier Directory Identifier Type Multi Valued
None NWPS_ATTR_ACL Object_ACL_T Yes
None NWPS_ATTR_CART char[ ] Yes
NWPS_ATTR_CN NWPS_ATTR_CN char[ ] No
NWPS_ATTR_CONF NWPS_ATTR_CONF Octet_String_T No
NWPS_ATTR_DESC NWPS_ATTR_DESC char[ ] No
NWPS_ATTR_DQUEUE NWPS_ATTR_DQUEUE char[ ] No
None NWPS_ATTR_HOST_DEV char[ ] No
None NWPS_ATTR_MEMORY Integer_T No
None NWPS_ATTR_NADD Net_Address_T Yes
None NWPS_ATTR_NADD_REST Net_Address_T Yes
NWPS_ATTR_NOTIFY NWPS_ATTR_NOTIFY Typed_Name_T Yes
NWPS_ATTR_OPER NWPS_ATTR_OPER char[ ] Yes
NWPS_ATTR_OWNER NWPS_ATTR_OWNER char[ ] Yes
None NWPS_ATTR_PAGE char[ ] Yes
NWPS_ATTR_PRINT_SER NWPS_ATTR_PRINT_SER Typed_Name_T (The printer number is obtained from typed name's level field.) No
NWPS_ATTR_QUEUE NWPS_ATTR_QUEUE Typed_Name_T Yes
None NWPS_ATTR_SEE_ALSO char[ ] Yes
None NWPS_ATTR_SERIAL char[ ] Yes
NWPS_ATTR_STAT NWPS_ATTR_STAT Integer_T No
None NWPS_ATTR_TYPE (faces) char[ ] Yes

 
 ------------------------------------------------------------------------------ 
| Bindery Identifier |  Directory Identifier  |  Type          |  Multi Valued| 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_ACL         |  Object_ACL_T  |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_CART        |  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_CN       |  NWPS_ATTR_CN          |  char[ ]       |  No          | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_CONF     |  NWPS_ATTR_CONF        |  Octet_String_T|  No          | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_DESC     |  NWPS_ATTR_DESC        |  char[ ]       |  No          | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_DQUEUE   |  NWPS_ATTR_DQUEUE      |  char[ ]       |  No          | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_HOST_DEV    |  char[ ]       |  No          | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_MEMORY      |  Integer_T     |  No          | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_NADD        |  Net_Address_T |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_NADD_REST   |  Net_Address_T |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_NOTIFY   |  NWPS_ATTR_NOTIFY      |  Typed_Name_T  |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_OPER     |  NWPS_ATTR_OPER        |  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_OWNER    |  NWPS_ATTR_OWNER       |  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_PAGE        |  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_PRINT_SER|  NWPS_ATTR_PRINT_SER   |  Typed_Name_T  |  No          | 
|                    |                        |  (The printer  |              | 
|                    |                        |  number is     |              | 
|                    |                        |  obtained from |              | 
|                    |                        |  typed name's  |              | 
|                    |                        |  level field.) |              | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_QUEUE    |  NWPS_ATTR_QUEUE       |  Typed_Name_T  |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_SEE_ALSO    |  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_SERIAL      |  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
| NWPS_ATTR_STAT     |  NWPS_ATTR_STAT        |  Integer_T     |  No          | 
|--------------------|------------------------|----------------|--------------| 
| None               |  NWPS_ATTR_TYPE (faces)|  char[ ]       |  Yes         | 
|--------------------|------------------------|----------------|--------------| 
char[ ] is a NULL-terminated ASCII string.

NWPS_ATTR_STAT values follow:

   0 = NWPS_PSTAT_JOB_WAIT 
   1 = NWPS_PSTAT_FORM_WAIT 
   2 = NWPS_PSTAT_PRINTING 
   3 = NWPS_PSTAT_PAUSED 
   4 = NWPS_PSTAT_STOPPED 
   5 = NWPS_PSTAT_MARK_EJECT 
   6 = NWPS_PSTAT_READY_TO_DOWN 
   7 = NWPS_PSTAT_NOT_CONNECTED 
   8 = NWPS_PSTAT_PRIVATE 

Services

Print Server

References

NWPSCfgEndNextPrinterAttr(3nw), NWPSCfgGetNextPrinterAttr(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.