This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "python/py_spoolss.h"
WERROR werror;
PyObject *result;
int level = 1;
- uint32 i, needed, num_jobs;
+ uint32 i, num_jobs;
static char *kwlist[] = {"level", NULL};
JOB_INFO_CTR ctr;
/* Call rpc function */
- werror = cli_spoolss_enumjobs(
- hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, level, 0,
- 1000, &num_jobs, &ctr);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_enumjobs(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- level, 0, 1000, &num_jobs, &ctr);
+ werror = rpccli_spoolss_enumjobs(
+ hnd->cli, hnd->mem_ctx, &hnd->pol, level, 0, 1000,
+ &num_jobs, &ctr);
/* Return value */
/* Call rpc function */
- werror = cli_spoolss_setjob(hnd->cli, hnd->mem_ctx, &hnd->pol,
- jobid, level, command);
+ werror = rpccli_spoolss_setjob(
+ hnd->cli, hnd->mem_ctx, &hnd->pol, jobid, level, command);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self;
WERROR werror;
PyObject *result;
- uint32 level = 1, jobid, needed;
+ uint32 level = 1, jobid;
static char *kwlist[] = {"jobid", "level", NULL};
JOB_INFO_CTR ctr;
/* Call rpc function */
- werror = cli_spoolss_getjob(hnd->cli, hnd->mem_ctx, 0, &needed,
- &hnd->pol, jobid, level, &ctr);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_getjob(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- jobid, level, &ctr);
+ werror = rpccli_spoolss_getjob(
+ hnd->cli, hnd->mem_ctx, &hnd->pol, jobid, level, &ctr);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
switch(level) {
case 1:
- py_from_JOB_INFO_1(&result, ctr.job.job_info_1);
+ py_from_JOB_INFO_1(&result, &ctr.job.job_info_1[0]);
break;
case 2:
- py_from_JOB_INFO_2(&result, ctr.job.job_info_2);
+ py_from_JOB_INFO_2(&result, &ctr.job.job_info_2[0]);
break;
}
/* Call rpc function */
- werror = cli_spoolss_startpageprinter(
+ werror = rpccli_spoolss_startpageprinter(
hnd->cli, hnd->mem_ctx, &hnd->pol);
if (!W_ERROR_IS_OK(werror)) {
/* Call rpc function */
- werror = cli_spoolss_endpageprinter(
+ werror = rpccli_spoolss_endpageprinter(
hnd->cli, hnd->mem_ctx, &hnd->pol);
if (!W_ERROR_IS_OK(werror)) {
/* Call rpc function */
- werror = cli_spoolss_startdocprinter(
+ werror = rpccli_spoolss_startdocprinter(
hnd->cli, hnd->mem_ctx, &hnd->pol, document_name,
output_file, data_type, &jobid);
/* Call rpc function */
- werror = cli_spoolss_enddocprinter(hnd->cli, hnd->mem_ctx, &hnd->pol);
+ werror = rpccli_spoolss_enddocprinter(
+ hnd->cli, hnd->mem_ctx, &hnd->pol);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
/* Call rpc function */
- werror = cli_spoolss_writeprinter(
+ werror = rpccli_spoolss_writeprinter(
hnd->cli, hnd->mem_ctx, &hnd->pol, PyString_Size(data),
PyString_AsString(data), &num_written);