{
TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev;
- struct tevent_req *req;
NTSTATUS status = NT_STATUS_OK;
+ struct dcerpc_call *call;
+ struct tevent_req *subreq;
+ struct dcerpc_presentation *pres[1];
ev = samba_tevent_context_init(frame);
if (ev == NULL) {
goto fail;
}
- req = rpc_pipe_bind_send(frame, ev, cli, auth);
- if (req == NULL) {
+ call = dcerpc_call_allocate(frame, cli->assoc, NULL, NULL);
+
+ pres[0] = cli->pres;
+
+ subreq = dcerpc_do_bind_send(frame, ev, cli->conn, call,
+ cli->sec, ARRAY_SIZE(pres), pres);
+
+ if (subreq == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
}
- if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+ if (!tevent_req_poll_ntstatus(subreq, ev, &status)) {
goto fail;
}
- status = rpc_pipe_bind_recv(req);
+ status = dcerpc_do_bind_recv(subreq);
fail:
TALLOC_FREE(frame);
return status;