r7633: this patch started as an attempt to make the dcerpc code use a given
[bbaumbach/samba-autobuild/.git] / source4 / lib / com / main.c
index 378c3738b9b40f8208e3879093f3f424b76ed4f9..210e8ba79c39d3060e35c9349bedbb1cde0077a7 100644 (file)
 #include "includes.h"
 #include "dlinklist.h"
 #include "lib/com/com.h"
+#include "lib/events/events.h"
 #include "librpc/gen_ndr/com_dcom.h"
 
-WERROR com_init(struct com_context **ctx)
+WERROR com_init(struct com_context **ctx, struct event_context *event_ctx)
 {
        *ctx = talloc(NULL, struct com_context);
+       if (event_ctx == NULL) {
+               event_ctx = event_context_init(*ctx);
+       }
+       (*ctx)->event_ctx = event_ctx;
        return WERR_OK;
 }