summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/messaging/irpc.h7
-rw-r--r--source4/lib/messaging/messaging.c7
2 files changed, 9 insertions, 5 deletions
diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h
index 99a2d60f35..cba17a2c97 100644
--- a/source4/lib/messaging/irpc.h
+++ b/source4/lib/messaging/irpc.h
@@ -25,6 +25,7 @@
*/
struct irpc_message {
uint32_t from;
+ void *private;
};
/* don't allow calls to take too long */
@@ -35,10 +36,10 @@ struct irpc_message {
typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r);
/* register a server function with the irpc messaging system */
-#define IRPC_REGISTER(msg_ctx, pipename, funcname, function) \
+#define IRPC_REGISTER(msg_ctx, pipename, funcname, function, private) \
irpc_register(msg_ctx, &dcerpc_table_ ## pipename, \
DCERPC_ ## funcname, \
- (irpc_function_t)function)
+ (irpc_function_t)function, private)
/* make a irpc call */
#define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr) \
@@ -84,7 +85,7 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void
NTSTATUS irpc_register(struct messaging_context *msg_ctx,
const struct dcerpc_interface_table *table,
- int call, irpc_function_t fn);
+ int call, irpc_function_t fn, void *private);
struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx,
uint32_t server_id,
const struct dcerpc_interface_table *table,
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index 823058b0cf..70eb2e7680 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -422,6 +422,7 @@ struct irpc_list {
const struct dcerpc_interface_table *table;
int callnum;
irpc_function_t fn;
+ void *private;
};
@@ -430,7 +431,7 @@ struct irpc_list {
*/
NTSTATUS irpc_register(struct messaging_context *msg_ctx,
const struct dcerpc_interface_table *table,
- int callnum, irpc_function_t fn)
+ int callnum, irpc_function_t fn, void *private)
{
struct irpc_list *irpc;
@@ -449,6 +450,7 @@ NTSTATUS irpc_register(struct messaging_context *msg_ctx,
irpc->table = table;
irpc->callnum = callnum;
irpc->fn = fn;
+ irpc->private = private;
GUID_from_string(irpc->table->uuid, &irpc->uuid);
return NT_STATUS_OK;
@@ -514,7 +516,8 @@ static void irpc_handler_request(struct messaging_context *msg_ctx,
if (!NT_STATUS_IS_OK(status)) goto failed;
/* make the call */
- m.from = src;
+ m.from = src;
+ m.private = i->private;
header->status = i->fn(&m, r);
/* setup the reply */