rpc client rewrite.
#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;
}
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) {
typedef struct {
PyObject_HEAD
- struct cli_state *cli;
+ struct rpc_pipe_client *cli;
TALLOC_CTX *mem_ctx;
POLICY_HND pol;
} lsa_policy_hnd_object;
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);
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;
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;
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;
}
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)) {
}
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));
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));
/* 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));
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;
}
}
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)) {
/* 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));
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;
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));