s4:drepl_notify: don't look at the internals of 'struct rpc_request'
authorStefan Metzmacher <metze@samba.org>
Sat, 27 Feb 2010 08:43:21 +0000 (09:43 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 1 Mar 2010 15:11:56 +0000 (16:11 +0100)
metze

source4/dsdb/repl/drepl_notify.c

index a67aae9207d754e0bf027fb3867badf67235f02f..c3ca5ed31018b5b147d951d48078d304ad358a0a 100644 (file)
@@ -39,6 +39,7 @@
 
 struct dreplsrv_op_notify_state {
        struct dreplsrv_notify_operation *op;
+       void *ndr_struct_ptr;
 };
 
 static void dreplsrv_op_notify_connect_done(struct tevent_req *subreq);
@@ -122,6 +123,8 @@ static void dreplsrv_op_notify_replica_sync_trigger(struct tevent_req *req)
                r->in.req->req1.options |= DRSUAPI_DRS_SYNC_URGENT;
        }
 
+       state->ndr_struct_ptr = r;
+
        rreq = dcerpc_drsuapi_DsReplicaSync_send(drsuapi->pipe, r, r);
        if (tevent_req_nomem(rreq, req)) {
                return;
@@ -133,10 +136,15 @@ static void dreplsrv_op_notify_replica_sync_done(struct rpc_request *rreq)
 {
        struct tevent_req *req = talloc_get_type(rreq->async.private_data,
                                                 struct tevent_req);
-       struct drsuapi_DsReplicaSync *r = talloc_get_type(rreq->ndr.struct_ptr,
+       struct dreplsrv_op_notify_state *state =
+               tevent_req_data(req,
+               struct dreplsrv_op_notify_state);
+       struct drsuapi_DsReplicaSync *r = talloc_get_type(state->ndr_struct_ptr,
                                                          struct drsuapi_DsReplicaSync);
        NTSTATUS status;
 
+       state->ndr_struct_ptr = NULL;
+
        status = dcerpc_drsuapi_DsReplicaSync_recv(rreq);
        if (tevent_req_nterror(req, status)) {
                return;