Jump to content

SplReleaseQueue: Difference between revisions

From EDM2
Created page with "This function releases a held print queue. == Syntax == SplReleaseQueue(pszComputerName, pszQueueName); == Parameters == ;pszComputerName (PSZ) - input :Name of computer ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function releases a held print queue.
This function releases a held print queue.
== Syntax ==
  SplReleaseQueue(pszComputerName, pszQueueName);
== Parameters ==
;pszComputerName (PSZ) - input
:Name of computer where queue is to be continued.  


:A NULL string specifies the local workstation.
== Syntax ==
SplReleaseQueue(pszComputerName, pszQueueName)


;pszQueueName (PSZ) - input  
== Parameters ==
:Queue name.  
;pszComputerName (PSZ) - input:Name of computer where queue is to be continued.
:A NULL string specifies the local workstation.
;pszQueueName (PSZ) - input:Queue name.


== Returns ==
== Returns ==
;rc (SPLERR) - returns  
;rc (SPLERR) - returns:Return code.
:Return code.
 
:;NO_ERROR (0)
::No errors occurred.
:;ERROR_ACCESS_DENIED (5)
::Access is denied.
:;ERROR_NOT_SUPPORTED (50)
::This request is not supported by the network.
:;ERROR_BAD_NETPATH (53)
::The network path cannot be located.
:;NERR_NetNotStarted (2102)
::The network program is not started.
:;NERR_QNotFound (2150)
::The printer queue does not exist.
:;NERR_InvalidComputer (2351)
::The computer name is invalid.  


:NO_ERROR (0) :No errors occurred.
:ERROR_ACCESS_DENIED (5) :Access is denied.
:ERROR_NOT_SUPPORTED (50) :This request is not supported by the network.
:ERROR_BAD_NETPATH (53) :The network path cannot be located.
:NERR_NetNotStarted (2102) :The network program is not started.
:NERR_QNotFound (2150) :The printer queue does not exist.
:NERR_InvalidComputer (2351) :The computer name is invalid.


== Sample ==
== Sample ==
This sample code will release the local queue that is entered at the prompt.
This sample code will release the local queue that is entered at the prompt.
<pre>  
<pre>
 
#define INCL_SPL
#define INCL_SPL
#define INCL_SPLERRORS
#define INCL_SPLERRORS
Line 74: Line 62:
   return (splerr);
   return (splerr);
}
}
</pre>
</pre>


Line 88: Line 74:


rc = SplReleaseQueue(pszComputerName, pszQueueName);
rc = SplReleaseQueue(pszComputerName, pszQueueName);
</pre>
</pre>


== Remarks ==
== Remarks ==
This function releases a queue that has been held by a [[SplHoldQueue]] function, or disabled by an error on the queue. It does not affect an active print queue.  
This function releases a queue that has been held by a [[SplHoldQueue]] function, or disabled by an error on the queue. It does not affect an active print queue.
 
To release a queue on a remote server requires administrator privilege on the remote server.


To release a queue on a remote server requires administrator privilege on the remote server.
== Related Functions ==
== Related Functions ==
* [[SplEnumQueue]]
* [[SplEnumQueue]]
* [[SplHoldQueue]]
* [[SplHoldQueue]]
* [[SplQueryQueue]]  
* [[SplQueryQueue]]
 


[[Category:spl]]
[[Category:spl]]

Latest revision as of 20:25, 2 July 2023

This function releases a held print queue.

Syntax

SplReleaseQueue(pszComputerName, pszQueueName)

Parameters

pszComputerName (PSZ) - input
Name of computer where queue is to be continued.
A NULL string specifies the local workstation.
pszQueueName (PSZ) - input
Queue name.

Returns

rc (SPLERR) - returns
Return code.
NO_ERROR (0) :No errors occurred.
ERROR_ACCESS_DENIED (5) :Access is denied.
ERROR_NOT_SUPPORTED (50) :This request is not supported by the network.
ERROR_BAD_NETPATH (53) :The network path cannot be located.
NERR_NetNotStarted (2102) :The network program is not started.
NERR_QNotFound (2150) :The printer queue does not exist.
NERR_InvalidComputer (2351) :The computer name is invalid.

Sample

This sample code will release the local queue that is entered at the prompt.

#define INCL_SPL
#define INCL_SPLERRORS
#include <os2.h>
#include <stdio.h>     /* for printf function */

INT main (argc, argv)
   INT argc;
   CHAR *argv[];
{
   SPLERR splerr ;
   PSZ    pszComputerName = NULL ;
   PSZ    pszQueueName ;

   /* Get queue name from the input argument.                                */
   pszQueueName = argv[1];

   /* Call the function to do the release. If an error is returned, print it. */
   splerr=SplReleaseQueue(pszComputerName, pszQueueName);
   if (splerr != 0L)
   {
      switch (splerr)
      {
         case NERR_QNotFound:
            printf("Queue does not exist.\n");
            break;
         case  NERR_SpoolerNotLoaded:
            printf("The Spooler is not running.\n");
            break;
         default:
            printf("Errorcode = %ld\n",splerr);
      } /* endswitch */
   }
   else
   {
      printf("Queue %s was released.\n",pszQueueName);
   } /* endif */
   DosExit( EXIT_PROCESS , 0 ) ;
   return (splerr);
}

Call Sequence

#define INCL_SPL /* Or use INCL_PM, */
#include <os2.h>

PSZ       pszComputerName;  /*  Name of computer where queue is to be continued. */
PSZ       pszQueueName;     /*  Queue name. */
SPLERR    rc;               /*  Return code. */

rc = SplReleaseQueue(pszComputerName, pszQueueName);

Remarks

This function releases a queue that has been held by a SplHoldQueue function, or disabled by an error on the queue. It does not affect an active print queue.

To release a queue on a remote server requires administrator privilege on the remote server.

Related Functions