WORD WNetLockQueueData(szQueue, szUser, lplpQueueStruct) | |||
LPSTR szQueue; | |||
LPSTR szUser; | |||
LPQUEUESTRUCT FAR * lplpQueueStruct; |
The WNetLockQueueData function locks a buffer, maintained by the driver, that describes the state of the queue. (The structure can be created at this time if it was not already available.) Print Manager calls this function.
szQueue
Points to a null-terminated name of a local or remote queue.
szUser
Points to a null-terminated user name. If the szUser parameter is not NULL, it indicates that Print Manager is only interested in jobs belonging to that user. If this parameter is NULL, Print Manager will assume that QUEUESTRUCT contains information about all jobs.
lplpQueueStruct
Points to a variable to receive the address (selector:offset) of a driver-supplied buffer. The buffer contains a single QUEUESTRUCT structure followed by zero or more JOBSTRUCT structures and the variable-length strings to which they refer. The number of JOBSTRUCT structures is specified by the pqJobcount member in QUEUESTRUCT. The structure has the following format:
typedef struct _queuestruct {
WORD pqName; /* queue name (offset) */
WORD pqComment; /* queue comment string (offset) */
WORD pqStatus; /* queue status */
WORD pqJobcount; /* number of JOBSTRUCTs following */
WORD pqPrinters; /* number of printers for queue */
/* (zero if not available) */
} QUEUESTRUCT;
typedef QUEUESTRUCT FAR * LPQUEUESTRUCT;
The return value is one of the following values.
Value | Meaning |
WN_BAD_POINTER | Invalid pointer. |
WN_BAD_QUEUE | The szQueue parameter is not a valid net queue or redirected. device |
WN_NET_ERROR | Network error. |
WN_NOT_SUPPORTED | Function not supported. |
WN_OUT_OF_MEMORY | Out of memory. |
WN_SUCCESS | Success. |
The export ordinal for this function is 10.
While Print Manager's lock is in effect, the queue data must not be modified or moved. Each lock operation is completed by a matching unlock operation.
If the queue status is WNPRQ_PROBLEM, which means that all the printers on this queue have stopped, examining the job status for the first job in the queue. The first job usually reveals the exact nature of the problem. However, this may not be true if the queue is serviced by multiple printers that could have different problems, or if the first job is paused and the first nonpaused job is being held up by an error.