int print_queue_status(int snum,
print_queue_struct **ppqueue,
print_status_struct *status);
-bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
- WERROR *errcode);
-bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
- WERROR *errcode);
-bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
- WERROR *errcode);
+WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum);
+WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum);
+WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum);
/* The following definitions come from printing/printing_db.c */
Pause a queue.
****************************************************************************/
-bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
- WERROR *errcode)
+WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum)
{
int ret;
struct printif *current_printif = get_printer_fns( snum );
if (!print_access_check(server_info, snum,
PRINTER_ACCESS_ADMINISTER)) {
- *errcode = WERR_ACCESS_DENIED;
- return False;
+ return WERR_ACCESS_DENIED;
}
unbecome_root();
if (ret != 0) {
- *errcode = WERR_INVALID_PARAM;
- return False;
+ return WERR_INVALID_PARAM;
}
/* force update the database */
notify_printer_status(snum, PRINTER_STATUS_PAUSED);
- return True;
+ return WERR_OK;
}
/****************************************************************************
Resume a queue.
****************************************************************************/
-bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
- WERROR *errcode)
+WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum)
{
int ret;
struct printif *current_printif = get_printer_fns( snum );
if (!print_access_check(server_info, snum,
PRINTER_ACCESS_ADMINISTER)) {
- *errcode = WERR_ACCESS_DENIED;
- return False;
+ return WERR_ACCESS_DENIED;
}
become_root();
unbecome_root();
if (ret != 0) {
- *errcode = WERR_INVALID_PARAM;
- return False;
+ return WERR_INVALID_PARAM;
}
/* make sure the database is up to date */
notify_printer_status(snum, PRINTER_STATUS_OK);
- return True;
+ return WERR_OK;
}
/****************************************************************************
Purge a queue - implemented by deleting all jobs that we can delete.
****************************************************************************/
-bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
- WERROR *errcode)
+WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum)
{
print_queue_struct *queue;
print_status_struct status;
SAFE_FREE(queue);
- return True;
+ return WERR_OK;
}
switch (command) {
case SPOOLSS_PRINTER_CONTROL_PAUSE:
- if (print_queue_pause(p->server_info, snum, &errcode)) {
- errcode = WERR_OK;
- }
+ errcode = print_queue_pause(p->server_info, snum);
break;
case SPOOLSS_PRINTER_CONTROL_RESUME:
case SPOOLSS_PRINTER_CONTROL_UNPAUSE:
- if (print_queue_resume(p->server_info, snum, &errcode)) {
- errcode = WERR_OK;
- }
+ errcode = print_queue_resume(p->server_info, snum);
break;
case SPOOLSS_PRINTER_CONTROL_PURGE:
- if (print_queue_purge(p->server_info, snum, &errcode)) {
- errcode = WERR_OK;
- }
+ errcode = print_queue_purge(p->server_info, snum);
break;
default:
return WERR_UNKNOWN_LEVEL;
switch (function) {
case 74: /* Pause queue */
- if (print_queue_pause(conn->server_info, snum, &werr)) {
- errcode = NERR_Success;
- }
+ werr = print_queue_pause(conn->server_info, snum);
break;
case 75: /* Resume queue */
- if (print_queue_resume(conn->server_info, snum, &werr)) {
- errcode = NERR_Success;
- }
+ werr = print_queue_resume(conn->server_info, snum);
break;
case 103: /* Purge */
- if (print_queue_purge(conn->server_info, snum, &werr)) {
- errcode = NERR_Success;
- }
+ werr = print_queue_purge(conn->server_info, snum);
+ break;
+ default:
+ werr = WERR_NOT_SUPPORTED;
break;
}
- if (!W_ERROR_IS_OK(werr)) errcode = W_ERROR_V(werr);
+ errcode = W_ERROR_V(werr);
out:
SSVAL(*rparam,0,errcode);