summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-18 11:25:21 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-18 13:34:04 +0100
commit5e9ce495eef98b2b27a77bf042514ccb2037d33d (patch)
tree657dd0c58f72d34bf4020aa46ba563d1490ab94f
parentf055fce74c0f569e8bfcf29e5c4fadb592a7c87d (diff)
downloadsamba-5e9ce495eef98b2b27a77bf042514ccb2037d33d.tar.gz
samba-5e9ce495eef98b2b27a77bf042514ccb2037d33d.tar.bz2
samba-5e9ce495eef98b2b27a77bf042514ccb2037d33d.zip
s4:librpc/rpc: let pyrpc make use of dcerpc_binding_handle stubs
metze
-rw-r--r--source4/librpc/rpc/dcerpc.h2
-rw-r--r--source4/librpc/rpc/pyrpc.c5
-rw-r--r--source4/librpc/rpc/pyrpc.h4
3 files changed, 7 insertions, 4 deletions
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index 08210e03c0..70e90c45dd 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -392,8 +392,6 @@ NTSTATUS dcerpc_request(struct dcerpc_pipe *p,
DATA_BLOB *stub_data_in,
DATA_BLOB *stub_data_out);
-typedef NTSTATUS (*dcerpc_call_fn) (struct dcerpc_pipe *, TALLOC_CTX *, void *);
-
enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot);
const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index 00bc6835f4..012f188ce1 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -57,7 +57,7 @@ static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface,
return NULL;
}
- status = md->call(iface->pipe, mem_ctx, r);
+ status = md->call(iface->binding_handle, mem_ctx, r);
if (NT_STATUS_IS_ERR(status)) {
PyErr_SetDCERPCStatus(iface->pipe, status);
talloc_free(mem_ctx);
@@ -356,6 +356,7 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py
}
ret->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
+ ret->binding_handle = ret->pipe->binding_handle;
return (PyObject *)ret;
}
@@ -425,6 +426,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObje
}
ret->pipe = NULL;
+ ret->binding_handle = NULL;
if (py_basis != Py_None) {
struct dcerpc_pipe *base_pipe;
@@ -451,6 +453,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObje
return NULL;
}
ret->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
+ ret->binding_handle = ret->pipe->binding_handle;
return (PyObject *)ret;
}
diff --git a/source4/librpc/rpc/pyrpc.h b/source4/librpc/rpc/pyrpc.h
index efbcac688c..32337549f1 100644
--- a/source4/librpc/rpc/pyrpc.h
+++ b/source4/librpc/rpc/pyrpc.h
@@ -44,6 +44,7 @@
typedef struct {
PyObject_HEAD
struct dcerpc_pipe *pipe;
+ struct dcerpc_binding_handle *binding_handle;
} dcerpc_InterfaceObject;
PyAPI_DATA(PyTypeObject) dcerpc_InterfaceType;
@@ -55,13 +56,14 @@ PyAPI_DATA(PyTypeObject) dcerpc_InterfaceType;
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status);
+typedef NTSTATUS (*py_dcerpc_call_fn) (struct dcerpc_binding_handle *, TALLOC_CTX *, void *);
typedef bool (*py_data_pack_fn) (PyObject *args, PyObject *kwargs, void *r);
typedef PyObject *(*py_data_unpack_fn) (void *r);
struct PyNdrRpcMethodDef {
const char *name;
const char *doc;
- dcerpc_call_fn call;
+ py_dcerpc_call_fn call;
py_data_pack_fn pack_in_data;
py_data_unpack_fn unpack_out_data;
uint32_t opnum;