r15385: Some work to bring the python code up to date with the
authorDeryck Hodge <deryck@samba.org>
Mon, 1 May 2006 22:31:33 +0000 (22:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:16:38 +0000 (11:16 -0500)
rpc client rewrite.
(This used to be commit fd5bcecceb518d0683f400a61e11ce37f3d52d42)

source3/python/py_lsa.c
source3/python/py_lsa.h
source3/python/py_samr.c
source3/python/py_samr.h
source3/python/py_spoolss_drivers.c
source3/python/py_spoolss_ports.c
source3/python/py_spoolss_printerdata.c
source3/python/py_spoolss_printers.c
source3/python/py_srvsvc.c

index a4e8254e0d15b072081598345bb0d126cd89e514..915223a5bb78453e52395b644bb87648b98fc1ee 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "python/py_lsa.h"
 
-PyObject *new_lsa_policy_hnd_object(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+PyObject *new_lsa_policy_hnd_object(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                                    POLICY_HND *pol)
 {
        lsa_policy_hnd_object *o;
@@ -90,14 +90,14 @@ static PyObject *lsa_open_policy(PyObject *self, PyObject *args,
        }
 
        ntstatus = rpccli_lsa_open_policy(
-               cli, mem_ctx, True, desired_access, &hnd);
+               cli->pipe_list, mem_ctx, True, desired_access, &hnd);
 
        if (!NT_STATUS_IS_OK(ntstatus)) {
                PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));
                goto done;
        }
 
-       result = new_lsa_policy_hnd_object(cli, mem_ctx, &hnd);
+       result = new_lsa_policy_hnd_object(cli->pipe_list, mem_ctx, &hnd);
 
 done:
        if (!result) {
index 99f3de50b1ffb2529fff47cdea9ce27f6c3171fa..44a0b37b35a8737df37db849b7ed579a441b523a 100644 (file)
@@ -27,7 +27,7 @@
 
 typedef struct {
        PyObject_HEAD
-       struct cli_state *cli;
+       struct rpc_pipe_client *cli;
        TALLOC_CTX *mem_ctx;
        POLICY_HND pol;
 } lsa_policy_hnd_object;
index a26cd8d132e3eb9a9ec020d0b1341c1804e3ba6b..c448c4f89a3aff5dbcc47797574bba5fd1644fe1 100644 (file)
@@ -569,7 +569,7 @@ static PyObject *samr_connect(PyObject *self, PyObject *args, PyObject *kw)
                goto done;
        }
 
-       ntstatus = rpccli_samr_connect(cli, mem_ctx, desired_access, &hnd);
+       ntstatus = rpccli_samr_connect(cli->pipe_list, mem_ctx, desired_access, &hnd);
 
        if (!NT_STATUS_IS_OK(ntstatus)) {
                cli_shutdown(cli);
index 8e91b1671ec3f45db31308e15eefac0b9ae904d8..9cde99e2d04d669e2b073b4edd74195376dc4d4a 100644 (file)
@@ -27,7 +27,7 @@
 
 typedef struct {
        PyObject_HEAD
-       struct cli_state *cli;
+       struct rpc_pipe_client *cli;
        TALLOC_CTX *mem_ctx;
        POLICY_HND connect_pol;
 } samr_connect_hnd_object;
@@ -36,7 +36,7 @@ typedef struct {
 
 typedef struct {
        PyObject_HEAD
-       struct cli_state *cli;
+       struct rpc_pipe_client *cli;
        TALLOC_CTX *mem_ctx;
        POLICY_HND domain_pol;
 } samr_domain_hnd_object;
@@ -45,7 +45,7 @@ typedef struct {
 
 typedef struct {
        PyObject_HEAD
-       struct cli_state *cli;
+       struct rpc_pipe_client *cli;
        TALLOC_CTX *mem_ctx;
        POLICY_HND user_pol;
 } samr_user_hnd_object;
index 3d7ca3a8fc733551cf5e785ae7fa472576df712d..1ececf1e377ece3ab9c9577f57fa46bee2d7a207 100644 (file)
@@ -70,7 +70,7 @@ PyObject *spoolss_enumprinterdrivers(PyObject *self, PyObject *args,
        }       
 
        werror = rpccli_spoolss_enumprinterdrivers(
-               cli, mem_ctx, level, arch,
+               cli->pipe_list, mem_ctx, level, arch,
                &num_drivers, &ctr);
 
        if (!W_ERROR_IS_OK(werror)) {
@@ -263,7 +263,7 @@ PyObject *spoolss_getprinterdriverdir(PyObject *self, PyObject *args,
        }       
 
        werror = rpccli_spoolss_getprinterdriverdir(
-               cli, mem_ctx, level, arch, &ctr);
+               cli->pipe_list, mem_ctx, level, arch, &ctr);
 
        if (!W_ERROR_IS_OK(werror)) {
                PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
@@ -361,7 +361,7 @@ PyObject *spoolss_addprinterdriver(PyObject *self, PyObject *args,
                goto done;
        }
 
-       werror = rpccli_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));
index 721ac956eb4522f2502c9d037787b1fd47056535..96b81589f9efa3fd384ad71d1b739032749bf056 100644 (file)
@@ -68,7 +68,7 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw)
        /* Call rpc function */
        
        werror = rpccli_spoolss_enum_ports( 
-               cli, mem_ctx, level, &num_ports, &ctr);
+               cli->pipe_list, mem_ctx, level, &num_ports, &ctr);
 
        if (!W_ERROR_IS_OK(werror)) {
                PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
index e89f985fefd4ebdf807f54ca85626b980037aeb2..ed9e1cbd82de2041de9e8055b5a27baaeadb16c2 100644 (file)
@@ -321,7 +321,7 @@ PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject
                return NULL;
 
        if (!(ctr = TALLOC_ZERO_P(hnd->mem_ctx, REGVAL_CTR))) {
-               PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
+               PyErr_SetString(spoolss_error, "talloc failed");
                return NULL;
        }
 
index 50c19fcf0451db16b13a22059d001c21c5ade6ca..25cd051f3cc54277ac9e5df88904178a680a0ea0 100644 (file)
@@ -69,7 +69,7 @@ PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw)
        }
 
        werror = rpccli_spoolss_open_printer_ex(
-               cli, mem_ctx, unc_name, "", desired_access, server, 
+               cli->pipe_list, mem_ctx, unc_name, "", desired_access, server, 
                "", &hnd);
 
        if (!W_ERROR_IS_OK(werror)) {
@@ -327,7 +327,7 @@ PyObject *spoolss_enumprinters(PyObject *self, PyObject *args, PyObject *kw)
        /* Call rpc function */
        
        werror = rpccli_spoolss_enum_printers(
-               cli, mem_ctx, name, flags, level, &num_printers, &ctr);
+               cli->pipe_list, mem_ctx, name, flags, level, &num_printers, &ctr);
 
        if (!W_ERROR_IS_OK(werror)) {
                PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
@@ -448,7 +448,7 @@ PyObject *spoolss_addprinterex(PyObject *self, PyObject *args, PyObject *kw)
 
        ctr.printers_2 = &info2;
 
-       werror = rpccli_spoolss_addprinterex(cli, mem_ctx, 2, &ctr);
+       werror = rpccli_spoolss_addprinterex(cli->pipe_list, mem_ctx, 2, &ctr);
 
        Py_INCREF(Py_None);
        result = Py_None;
index 567572a9e5c0d13ac7998ee809d60cb037319d7e..03ed7fd84b10884c81be37fbb4dc0870e608f260 100644 (file)
@@ -120,7 +120,7 @@ PyObject *srvsvc_netservergetinfo(PyObject *self, PyObject *args,
 
        ZERO_STRUCT(ctr);
 
-       status = rpccli_srvsvc_net_srv_get_info(cli, mem_ctx, level, &ctr);
+       status = rpccli_srvsvc_net_srv_get_info(cli->pipe_list, mem_ctx, level, &ctr);
 
        if (!NT_STATUS_IS_OK(status)) {
                PyErr_SetObject(srvsvc_error, py_werror_tuple(status));