Jump to content

SplReleaseJob: Difference between revisions

From EDM2
Created page with "This function releases a held print job. == Syntax == SplReleaseJob(pszComputerName, pszQueueName, ulJob); == Parameters == ;pszComputerName (PSZ) - input :Name of comp..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function releases a held print job.  
This function releases a held print job.


== Syntax ==
== Syntax ==
  SplReleaseJob(pszComputerName, pszQueueName, ulJob);
SplReleaseJob(pszComputerName, pszQueueName, ulJob)


== Parameters ==
== Parameters ==
;pszComputerName (PSZ) - input  
;pszComputerName (PSZ) - input:Name of computer where job is to be continued.
:Name of computer where job is to be continued.  
:A NULL string specifies the local workstation.
 
;pszQueueName (PSZ) - input:Queue Name.
:A NULL string specifies the local workstation.  
;ulJob (ULONG) - input:Job identification number.
 
;pszQueueName (PSZ) - input  
:Queue Name.  
 
;ulJob (ULONG) - input  
:Job identification number.  


== Returns ==
== Returns ==
;rc (SPLERR) - returns  
;rc (SPLERR) - returns:Return code.
:Return code.  


:;NO_ERROR (0)  
:NO_ERROR (0) :No errors occurred.
::No errors occurred.  
:ERROR_ACCESS_DENIED (5) :Access is denied.
:;ERROR_ACCESS_DENIED (5)  
:ERROR_NOT_SUPPORTED (50) :This request is not supported by the network.
::Access is denied.  
:ERROR_BAD_NETPATH (53) :The network path cannot be located.
:;ERROR_NOT_SUPPORTED (50)  
:NERR_NetNotStarted (2102) :The network program is not started.
::This request is not supported by the network.  
:NERR_JobNotFound (2151) :The print job does not exist.
:;ERROR_BAD_NETPATH (53)  
:NERR_SpoolerNotLoaded (2161) :The spooler is not running.
::The network path cannot be located.  
:NERR_JobInvalidState (2164) :This operation cannot be performed on the print job in its current state.
:;NERR_NetNotStarted (2102)  
:NERR_InvalidComputer (2351) :The computer name is invalid.
::The network program is not started.  
:;NERR_JobNotFound (2151)  
::The print job does not exist.  
:;NERR_SpoolerNotLoaded (2161)  
::The spooler is not running.  
:;NERR_JobInvalidState (2164)  
::This operation cannot be performed on the print job in its current state.  
:;NERR_InvalidComputer (2351)  
::The computer name is invalid.  


== Sample ==
== Sample ==
This sample code will release the job id that is entered at the prompt.  
This sample code will release the job id that is entered at the prompt.
 
<pre>
<pre>
#define INCL_BASE
#define INCL_BASE
Line 95: Line 78:


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


== Remarks ==
== Remarks ==
Any job can be released by a user with administrator privilege.  
Any job can be released by a user with administrator privilege.


A job created locally can be released locally regardless of user privilege level, but it can be released remotely only by a user with administrator privilege.  
A job created locally can be released locally regardless of user privilege level, but it can be released remotely only by a user with administrator privilege.


A remote job can be released by a user without administrator privilege only if the user identification of the person initiating the request is the same as the user identification of the person who created the job.  
A remote job can be released by a user without administrator privilege only if the user identification of the person initiating the request is the same as the user identification of the person who created the job.


== Related Functions ==
== Related Functions ==
* [[SplEnumJob]]
* [[SplEnumJob]]
* [[SplHoldJob]]
* [[SplHoldJob]]
* [[SplQueryJob]]  
* [[SplQueryJob]]


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

Latest revision as of 20:23, 2 July 2023

This function releases a held print job.

Syntax

SplReleaseJob(pszComputerName, pszQueueName, ulJob)

Parameters

pszComputerName (PSZ) - input
Name of computer where job is to be continued.
A NULL string specifies the local workstation.
pszQueueName (PSZ) - input
Queue Name.
ulJob (ULONG) - input
Job identification number.

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_JobNotFound (2151) :The print job does not exist.
NERR_SpoolerNotLoaded (2161) :The spooler is not running.
NERR_JobInvalidState (2164) :This operation cannot be performed on the print job in its current state.
NERR_InvalidComputer (2351) :The computer name is invalid.

Sample

This sample code will release the job id that is entered at the prompt.

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

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

   /* Get job id from the input argument  */
   ulJob = atoi(argv[1]);

   /* Call the function to do the release. If an error is returned, print it. */
   splerr=SplReleaseJob( pszComputerName, pszQueueName, ulJob);
   switch (splerr)
   {
   case NO_ERROR:
      printf("Job %d was released.\n",ulJob);
      break;
   case NERR_JobNotFound:
      printf("Job does not exist.\n");
      break;
   case  NERR_JobInvalidState:
      printf("This operation can't be performed on the print Job.\n");
      break;
   default:
      printf("Errorcode = %ld\n",splerr);
   } /* endswitch */
   DosExit( EXIT_PROCESS , 0 ) ;
   argc;
   return (splerr);
}

Call Sequence

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

PSZ       pszComputerName;  /*  Name of computer where job is to be continued. */
PSZ       pszQueueName;     /*  Queue Name. */
ULONG     ulJob;            /*  Job identification number. */
SPLERR    rc;               /*  Return code. */

rc = SplReleaseJob(pszComputerName, pszQueueName, ulJob);

Remarks

Any job can be released by a user with administrator privilege.

A job created locally can be released locally regardless of user privilege level, but it can be released remotely only by a user with administrator privilege.

A remote job can be released by a user without administrator privilege only if the user identification of the person initiating the request is the same as the user identification of the person who created the job.

Related Functions