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 *obj = PyDict_GetItemString(info, "name");
char *form_name = PyString_AsString(obj);
- init_unistr2(&form.name, form_name, strlen(form_name) + 1);
+ init_unistr2(&form.name, form_name, UNI_STR_TERMINATE);
break;
}
default:
return NULL;
}
- werror = cli_spoolss_addform(hnd->cli, hnd->mem_ctx, &hnd->pol,
- level, &form);
+ werror = rpccli_spoolss_addform(hnd->cli, hnd->mem_ctx, &hnd->pol,
+ level, &form);
if (!W_ERROR_IS_OK(werror)) {
char *form_name;
int level = 1;
static char *kwlist[] = {"form_name", "level", NULL};
- uint32 needed;
FORM_1 form;
/* Parse parameters */
/* Call rpc function */
- werror = cli_spoolss_getform(hnd->cli, hnd->mem_ctx, 0, &needed,
- &hnd->pol, form_name, 1, &form);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_getform(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- form_name, 1, &form);
+ werror = rpccli_spoolss_getform(
+ hnd->cli, hnd->mem_ctx, &hnd->pol, form_name, level, &form);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
/* Parse parameters */
if (!PyArg_ParseTupleAndKeywords(
- args, kw, "O!|i", kwlist, &PyDict_Type, &info))
+ args, kw, "O!", kwlist, &PyDict_Type, &info))
return NULL;
if (!get_level_value(info, &level)) {
form_name = PyDict_GetItemString(info, "name");
- werror = cli_spoolss_setform(
+ werror = rpccli_spoolss_setform(
hnd->cli, hnd->mem_ctx, &hnd->pol, level,
PyString_AsString(form_name), &form);
/* Call rpc function */
- werror = cli_spoolss_deleteform(
+ werror = rpccli_spoolss_deleteform(
hnd->cli, hnd->mem_ctx, &hnd->pol, form_name);
if (!W_ERROR_IS_OK(werror)) {
PyObject *result;
spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self;
WERROR werror;
- uint32 level = 1, num_forms, needed, i;
+ uint32 level = 1, num_forms, i;
static char *kwlist[] = {"level", NULL};
FORM_1 *forms;
/* Call rpc function */
- werror = cli_spoolss_enumforms(
- hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, level,
- &num_forms, &forms);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_enumforms(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol, level,
- &num_forms, &forms);
+ werror = rpccli_spoolss_enumforms(
+ hnd->cli, hnd->mem_ctx, &hnd->pol, level, &num_forms, &forms);
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));