svn commit: samba r7320 - in
branches/SAMBA_4_0/source/lib/messaging: .
tridge at samba.org
tridge at samba.org
Mon Jun 6 05:47:15 GMT 2005
Author: tridge
Date: 2005-06-06 05:47:14 +0000 (Mon, 06 Jun 2005)
New Revision: 7320
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7320
Log:
added support for a private pointer in irpc registered handlers
Modified:
branches/SAMBA_4_0/source/lib/messaging/irpc.h
branches/SAMBA_4_0/source/lib/messaging/messaging.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/messaging/irpc.h
===================================================================
--- branches/SAMBA_4_0/source/lib/messaging/irpc.h 2005-06-06 04:09:07 UTC (rev 7319)
+++ branches/SAMBA_4_0/source/lib/messaging/irpc.h 2005-06-06 05:47:14 UTC (rev 7320)
@@ -25,6 +25,7 @@
*/
struct irpc_message {
uint32_t from;
+ void *private;
};
/* don't allow calls to take too long */
@@ -35,10 +36,10 @@
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 @@
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,
Modified: branches/SAMBA_4_0/source/lib/messaging/messaging.c
===================================================================
--- branches/SAMBA_4_0/source/lib/messaging/messaging.c 2005-06-06 04:09:07 UTC (rev 7319)
+++ branches/SAMBA_4_0/source/lib/messaging/messaging.c 2005-06-06 05:47:14 UTC (rev 7320)
@@ -422,6 +422,7 @@
const struct dcerpc_interface_table *table;
int callnum;
irpc_function_t fn;
+ void *private;
};
@@ -430,7 +431,7 @@
*/
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 @@
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 @@
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 */
More information about the samba-cvs
mailing list