s4: fix various warnings (not "const" related ones)
[sfrench/samba-autobuild/.git] / source4 / lib / com / main.c
index 378c3738b9b40f8208e3879093f3f424b76ed4f9..487ed5b712d002d4e44927bb59302359df1c3eda 100644 (file)
 */
 
 #include "includes.h"
-#include "dlinklist.h"
+#include "../lib/util/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_ctx(struct com_context **ctx, struct tevent_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;
 }
 
@@ -37,7 +42,7 @@ WERROR com_create_object(struct com_context *ctx, struct GUID *clsid, int num_if
        int i;
        struct GUID classfact_iid;
 
-       GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &classfact_iid);
+       GUID_from_string(NDR_ICLASSFACTORY_UUID, &classfact_iid);
 
        /* Obtain class object */
        error = com_get_class_object(ctx, clsid, &classfact_iid, (struct IUnknown **)&factory);
@@ -47,7 +52,7 @@ WERROR com_create_object(struct com_context *ctx, struct GUID *clsid, int num_if
        }
 
        /* Run IClassFactory::CreateInstance() */
-       error = IClassFactory_CreateInstance(factory, ctx, NULL, &classfact_iid, &iunk);
+       error = IClassFactory_CreateInstance(factory, ctx, NULL, &classfact_iid, (struct MInterfacePointer *) &iunk);
        if (!W_ERROR_IS_OK(error)) {
                DEBUG(3, ("Error while calling IClassFactory::CreateInstance : %s\n", win_errstr(error)));
                return error;