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"
PyObject *result = NULL, *creds = NULL;
PRINTER_DRIVER_CTR ctr;
int level = 1, i;
- uint32 needed, num_drivers;
+ uint32 num_drivers;
char *arch = "Windows NT x86", *server, *errstr;
static char *kwlist[] = {"server", "level", "creds", "arch", NULL};
struct cli_state *cli = NULL;
goto done;
}
- werror = cli_spoolss_enumprinterdrivers(
- cli, mem_ctx, 0, &needed, level, arch,
+ werror = rpccli_spoolss_enumprinterdrivers(
+ cli->pipe_list, mem_ctx, level, arch,
&num_drivers, &ctr);
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_enumprinterdrivers(
- cli, mem_ctx, needed, NULL, level, arch,
- &num_drivers, &ctr);
-
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
goto done;
PyObject *result = Py_None;
PRINTER_DRIVER_CTR ctr;
int level = 1;
- uint32 needed;
char *arch = "Windows NT x86";
int version = 2;
static char *kwlist[] = {"level", "arch", NULL};
/* Call rpc function */
- werror = cli_spoolss_getprinterdriver(
- hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, level,
- arch, version, &ctr);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_getprinterdriver(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- level, arch, version, &ctr);
+ werror = rpccli_spoolss_getprinterdriver(
+ hnd->cli, hnd->mem_ctx, &hnd->pol, level, arch, version, &ctr);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
WERROR werror;
PyObject *result = NULL, *creds = NULL;
DRIVER_DIRECTORY_CTR ctr;
- uint32 needed, level = 1;
+ uint32 level = 1;
char *arch = "Windows NT x86", *server, *errstr;
static char *kwlist[] = {"server", "level", "arch", "creds", NULL};
struct cli_state *cli = NULL;
goto done;
}
- werror = cli_spoolss_getprinterdriverdir(
- cli, mem_ctx, 0, &needed, level, arch, &ctr);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_getprinterdriverdir(
- cli, mem_ctx, needed, NULL, level, arch, &ctr);
+ werror = rpccli_spoolss_getprinterdriverdir(
+ cli->pipe_list, mem_ctx, level, arch, &ctr);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
case 3:
ctr.info3 = &dinfo.driver_3;
- if (!py_to_DRIVER_INFO_3(&dinfo.driver_3, info)) {
+ if (!py_to_DRIVER_INFO_3(&dinfo.driver_3, info, mem_ctx)) {
PyErr_SetString(spoolss_error,
"error converting to driver info 3");
goto done;
goto done;
}
- werror = cli_spoolss_addprinterdriver(cli, mem_ctx, level, &ctr);
+ werror = rpccli_spoolss_addprinterdriver(cli->pipe_list, mem_ctx, level, &ctr);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));