#include "param/param.h"
#include "libcli/resolve/resolve.h"
-struct libnet_context *libnet_context_init(struct event_context *ev,
+struct libnet_context *libnet_context_init(struct tevent_context *ev,
struct loadparm_context *lp_ctx)
{
struct libnet_context *ctx;
return NULL;
}
- /* create brand new libnet context */
- ctx = talloc(ev, struct libnet_context);
+ /* create brand new libnet context */
+ ctx = talloc_zero(ev, struct libnet_context);
if (!ctx) {
return NULL;
}
ctx->event_ctx = ev;
ctx->lp_ctx = lp_ctx;
- /* name resolution methods */
- ctx->resolve_ctx = lp_resolve_context(lp_ctx);
+ /* make sure dcerpc is initialized */
+ dcerpc_init();
- /* connected services' params */
- ZERO_STRUCT(ctx->samr);
- ZERO_STRUCT(ctx->lsa);
+ /* name resolution methods */
+ ctx->resolve_ctx = lpcfg_resolve_context(lp_ctx);
/* default buffer size for various operations requiring specifying a buffer */
ctx->samr.buf_size = 128;