git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / s3compat_drsuapi.c
index 8422dfeef4e438b63a62e8636dc2a5c1adcad6e0..61cc5d6693063721e8a3ebc6abf8003563f84126 100644 (file)
@@ -1,5 +1,7 @@
 #include "includes.h"
 #include "ntdomain.h"
+#include "lib/util/tevent_ntstatus.h"
+#include "librpc/rpc/dcerpc_connection.h"
 #include "bin/default/librpc/gen_ndr/s3compat_drsuapi.h"
 
 struct _s3_compat_drsuapi_DsBind_state {
@@ -9,11 +11,11 @@ struct _s3_compat_drsuapi_DsBind_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsBind *r)
+                                                        struct tevent_context *ev,
+                                                        struct dcerpc_call_handle *call,
+                                                        struct drsuapi_DsBind *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsBind_state *state;
        struct pipes_struct *p;
 
@@ -27,6 +29,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.bind_info = r->in.bind_info;
@@ -39,7 +45,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -59,11 +65,11 @@ struct _s3_compat_drsuapi_DsUnbind_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsUnbind *r)
+                                                          struct tevent_context *ev,
+                                                          struct dcerpc_call_handle *call,
+                                                          struct drsuapi_DsUnbind *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsUnbind_state *state;
        struct pipes_struct *p;
 
@@ -77,6 +83,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.bind_handle = r->in.bind_handle;
@@ -84,7 +94,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -104,11 +114,11 @@ struct _s3_compat_drsuapi_DsReplicaSync_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsReplicaSync_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsReplicaSync *r)
+                                                               struct tevent_context *ev,
+                                                               struct dcerpc_call_handle *call,
+                                                               struct drsuapi_DsReplicaSync *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsReplicaSync_state *state;
        struct pipes_struct *p;
 
@@ -122,12 +132,16 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaSync_send(TALLOC_CTX *mem_
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _drsuapi_DsReplicaSync(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -147,11 +161,11 @@ struct _s3_compat_drsuapi_DsGetNCChanges_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsGetNCChanges *r)
+                                                                struct tevent_context *ev,
+                                                                struct dcerpc_call_handle *call,
+                                                                struct drsuapi_DsGetNCChanges *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsGetNCChanges_state *state;
        struct pipes_struct *p;
 
@@ -165,6 +179,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -181,7 +199,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -201,11 +219,11 @@ struct _s3_compat_drsuapi_DsReplicaUpdateRefs_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsReplicaUpdateRefs_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsReplicaUpdateRefs *r)
+                                                                     struct tevent_context *ev,
+                                                                     struct dcerpc_call_handle *call,
+                                                                     struct drsuapi_DsReplicaUpdateRefs *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsReplicaUpdateRefs_state *state;
        struct pipes_struct *p;
 
@@ -219,12 +237,16 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaUpdateRefs_send(TALLOC_CTX
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _drsuapi_DsReplicaUpdateRefs(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -244,11 +266,11 @@ struct _s3_compat_drsuapi_DsReplicaAdd_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsReplicaAdd_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsReplicaAdd *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct drsuapi_DsReplicaAdd *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsReplicaAdd_state *state;
        struct pipes_struct *p;
 
@@ -262,12 +284,16 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaAdd_send(TALLOC_CTX *mem_c
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _drsuapi_DsReplicaAdd(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -287,11 +313,11 @@ struct _s3_compat_drsuapi_DsReplicaDel_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsReplicaDel_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsReplicaDel *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct drsuapi_DsReplicaDel *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsReplicaDel_state *state;
        struct pipes_struct *p;
 
@@ -305,12 +331,16 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaDel_send(TALLOC_CTX *mem_c
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _drsuapi_DsReplicaDel(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -330,11 +360,11 @@ struct _s3_compat_drsuapi_DsReplicaMod_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsReplicaMod_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsReplicaMod *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct drsuapi_DsReplicaMod *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsReplicaMod_state *state;
        struct pipes_struct *p;
 
@@ -348,12 +378,16 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaMod_send(TALLOC_CTX *mem_c
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _drsuapi_DsReplicaMod(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -373,11 +407,11 @@ struct _s3_compat_DRSUAPI_VERIFY_NAMES_state {
 };
 
 static struct tevent_req *_s3_compat_DRSUAPI_VERIFY_NAMES_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct DRSUAPI_VERIFY_NAMES *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct DRSUAPI_VERIFY_NAMES *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_DRSUAPI_VERIFY_NAMES_state *state;
        struct pipes_struct *p;
 
@@ -391,12 +425,16 @@ static struct tevent_req *_s3_compat_DRSUAPI_VERIFY_NAMES_send(TALLOC_CTX *mem_c
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _DRSUAPI_VERIFY_NAMES(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -416,11 +454,11 @@ struct _s3_compat_drsuapi_DsGetMemberships_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsGetMemberships_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsGetMemberships *r)
+                                                                  struct tevent_context *ev,
+                                                                  struct dcerpc_call_handle *call,
+                                                                  struct drsuapi_DsGetMemberships *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsGetMemberships_state *state;
        struct pipes_struct *p;
 
@@ -434,6 +472,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetMemberships_send(TALLOC_CTX *m
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -450,7 +492,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetMemberships_send(TALLOC_CTX *m
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -470,11 +512,11 @@ struct _s3_compat_DRSUAPI_INTER_DOMAIN_MOVE_state {
 };
 
 static struct tevent_req *_s3_compat_DRSUAPI_INTER_DOMAIN_MOVE_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct DRSUAPI_INTER_DOMAIN_MOVE *r)
+                                                                   struct tevent_context *ev,
+                                                                   struct dcerpc_call_handle *call,
+                                                                   struct DRSUAPI_INTER_DOMAIN_MOVE *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_DRSUAPI_INTER_DOMAIN_MOVE_state *state;
        struct pipes_struct *p;
 
@@ -488,12 +530,16 @@ static struct tevent_req *_s3_compat_DRSUAPI_INTER_DOMAIN_MOVE_send(TALLOC_CTX *
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _DRSUAPI_INTER_DOMAIN_MOVE(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -513,11 +559,11 @@ struct _s3_compat_drsuapi_DsGetNT4ChangeLog_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsGetNT4ChangeLog *r)
+                                                                   struct tevent_context *ev,
+                                                                   struct dcerpc_call_handle *call,
+                                                                   struct drsuapi_DsGetNT4ChangeLog *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsGetNT4ChangeLog_state *state;
        struct pipes_struct *p;
 
@@ -531,6 +577,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -547,7 +597,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -567,11 +617,11 @@ struct _s3_compat_drsuapi_DsCrackNames_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsCrackNames *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct drsuapi_DsCrackNames *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsCrackNames_state *state;
        struct pipes_struct *p;
 
@@ -585,6 +635,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_c
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -601,7 +655,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_c
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -621,11 +675,11 @@ struct _s3_compat_drsuapi_DsWriteAccountSpn_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsWriteAccountSpn *r)
+                                                                   struct tevent_context *ev,
+                                                                   struct dcerpc_call_handle *call,
+                                                                   struct drsuapi_DsWriteAccountSpn *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsWriteAccountSpn_state *state;
        struct pipes_struct *p;
 
@@ -639,6 +693,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -655,7 +713,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -675,11 +733,11 @@ struct _s3_compat_drsuapi_DsRemoveDSServer_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsRemoveDSServer *r)
+                                                                  struct tevent_context *ev,
+                                                                  struct dcerpc_call_handle *call,
+                                                                  struct drsuapi_DsRemoveDSServer *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsRemoveDSServer_state *state;
        struct pipes_struct *p;
 
@@ -693,6 +751,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *m
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -709,7 +771,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *m
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -729,11 +791,11 @@ struct _s3_compat_DRSUAPI_REMOVE_DS_DOMAIN_state {
 };
 
 static struct tevent_req *_s3_compat_DRSUAPI_REMOVE_DS_DOMAIN_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct DRSUAPI_REMOVE_DS_DOMAIN *r)
+                                                                  struct tevent_context *ev,
+                                                                  struct dcerpc_call_handle *call,
+                                                                  struct DRSUAPI_REMOVE_DS_DOMAIN *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_DRSUAPI_REMOVE_DS_DOMAIN_state *state;
        struct pipes_struct *p;
 
@@ -747,12 +809,16 @@ static struct tevent_req *_s3_compat_DRSUAPI_REMOVE_DS_DOMAIN_send(TALLOC_CTX *m
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _DRSUAPI_REMOVE_DS_DOMAIN(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -772,11 +838,11 @@ struct _s3_compat_drsuapi_DsGetDomainControllerInfo_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsGetDomainControllerInfo_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsGetDomainControllerInfo *r)
+                                                                           struct tevent_context *ev,
+                                                                           struct dcerpc_call_handle *call,
+                                                                           struct drsuapi_DsGetDomainControllerInfo *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsGetDomainControllerInfo_state *state;
        struct pipes_struct *p;
 
@@ -790,6 +856,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetDomainControllerInfo_send(TALL
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, enum drsuapi_DsGetDCInfoCtrLevels);
@@ -806,7 +876,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetDomainControllerInfo_send(TALL
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -826,11 +896,11 @@ struct _s3_compat_drsuapi_DsAddEntry_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsAddEntry *r)
+                                                            struct tevent_context *ev,
+                                                            struct dcerpc_call_handle *call,
+                                                            struct drsuapi_DsAddEntry *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsAddEntry_state *state;
        struct pipes_struct *p;
 
@@ -844,6 +914,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -860,7 +934,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -880,11 +954,11 @@ struct _s3_compat_drsuapi_DsExecuteKCC_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsExecuteKCC_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsExecuteKCC *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct drsuapi_DsExecuteKCC *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsExecuteKCC_state *state;
        struct pipes_struct *p;
 
@@ -898,12 +972,16 @@ static struct tevent_req *_s3_compat_drsuapi_DsExecuteKCC_send(TALLOC_CTX *mem_c
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _drsuapi_DsExecuteKCC(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -923,11 +1001,11 @@ struct _s3_compat_drsuapi_DsReplicaGetInfo_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsReplicaGetInfo *r)
+                                                                  struct tevent_context *ev,
+                                                                  struct dcerpc_call_handle *call,
+                                                                  struct drsuapi_DsReplicaGetInfo *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsReplicaGetInfo_state *state;
        struct pipes_struct *p;
 
@@ -941,6 +1019,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *m
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.info_type = talloc_zero(r, enum drsuapi_DsReplicaInfoType);
@@ -957,7 +1039,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *m
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -977,11 +1059,11 @@ struct _s3_compat_DRSUAPI_ADD_SID_HISTORY_state {
 };
 
 static struct tevent_req *_s3_compat_DRSUAPI_ADD_SID_HISTORY_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct DRSUAPI_ADD_SID_HISTORY *r)
+                                                                 struct tevent_context *ev,
+                                                                 struct dcerpc_call_handle *call,
+                                                                 struct DRSUAPI_ADD_SID_HISTORY *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_DRSUAPI_ADD_SID_HISTORY_state *state;
        struct pipes_struct *p;
 
@@ -995,12 +1077,16 @@ static struct tevent_req *_s3_compat_DRSUAPI_ADD_SID_HISTORY_send(TALLOC_CTX *me
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _DRSUAPI_ADD_SID_HISTORY(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -1020,11 +1106,11 @@ struct _s3_compat_drsuapi_DsGetMemberships2_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_DsGetMemberships2_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_DsGetMemberships2 *r)
+                                                                   struct tevent_context *ev,
+                                                                   struct dcerpc_call_handle *call,
+                                                                   struct drsuapi_DsGetMemberships2 *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_DsGetMemberships2_state *state;
        struct pipes_struct *p;
 
@@ -1038,6 +1124,10 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetMemberships2_send(TALLOC_CTX *
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -1054,7 +1144,7 @@ static struct tevent_req *_s3_compat_drsuapi_DsGetMemberships2_send(TALLOC_CTX *
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -1074,11 +1164,11 @@ struct _s3_compat_DRSUAPI_REPLICA_VERIFY_OBJECTS_state {
 };
 
 static struct tevent_req *_s3_compat_DRSUAPI_REPLICA_VERIFY_OBJECTS_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
+                                                                        struct tevent_context *ev,
+                                                                        struct dcerpc_call_handle *call,
+                                                                        struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state;
        struct pipes_struct *p;
 
@@ -1092,12 +1182,16 @@ static struct tevent_req *_s3_compat_DRSUAPI_REPLICA_VERIFY_OBJECTS_send(TALLOC_
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _DRSUAPI_REPLICA_VERIFY_OBJECTS(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -1117,11 +1211,11 @@ struct _s3_compat_DRSUAPI_GET_OBJECT_EXISTENCE_state {
 };
 
 static struct tevent_req *_s3_compat_DRSUAPI_GET_OBJECT_EXISTENCE_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
+                                                                      struct tevent_context *ev,
+                                                                      struct dcerpc_call_handle *call,
+                                                                      struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_DRSUAPI_GET_OBJECT_EXISTENCE_state *state;
        struct pipes_struct *p;
 
@@ -1135,12 +1229,16 @@ static struct tevent_req *_s3_compat_DRSUAPI_GET_OBJECT_EXISTENCE_send(TALLOC_CT
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        r->out.result = _DRSUAPI_GET_OBJECT_EXISTENCE(p, r);
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -1160,11 +1258,11 @@ struct _s3_compat_drsuapi_QuerySitesByCost_state {
 };
 
 static struct tevent_req *_s3_compat_drsuapi_QuerySitesByCost_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct drsuapi_QuerySitesByCost *r)
+                                                                  struct tevent_context *ev,
+                                                                  struct dcerpc_call_handle *call,
+                                                                  struct drsuapi_QuerySitesByCost *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_drsuapi_QuerySitesByCost_state *state;
        struct pipes_struct *p;
 
@@ -1178,6 +1276,10 @@ static struct tevent_req *_s3_compat_drsuapi_QuerySitesByCost_send(TALLOC_CTX *m
        state->r = r;
 
        p = dcerpc_call_handle_get_pipes_struct(call);
+       if (p == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return tevent_req_post(req, ev);
+       }
 
        ZERO_STRUCT(r->out);
        r->out.level_out = talloc_zero(r, uint32_t);
@@ -1194,7 +1296,7 @@ static struct tevent_req *_s3_compat_drsuapi_QuerySitesByCost_send(TALLOC_CTX *m
 
        if (p->fault_state) {
                NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
-               tevent_req_nterror(status);
+               tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
 
@@ -1208,7 +1310,7 @@ static NTSTATUS _s3_compat_drsuapi_QuerySitesByCost_recv(struct tevent_req *req)
 }
 
 
-static const struct dcerpc_call_entry_point_fns struct _s3_compat_drsuapi_fns[] = {
+static const struct dcerpc_call_entry_point_fns _s3_compat_drsuapi_fns[] = {
        {
                .send_fn = (dcerpc_call_entry_point_send_fn_t)
                        _s3_compat_drsuapi_DsBind_send,
@@ -1366,10 +1468,12 @@ static const struct dcerpc_call_entry_point_fns struct _s3_compat_drsuapi_fns[]
 };
 
 static const struct dcerpc_call_entry_point_vector _s3_compat_drsuapi_epv[] = {
+       {
        .name = "_s3_compat_drsuapi",
        .table = &ndr_table_drsuapi,
        .num_fns = 25,
        .fns = _s3_compat_drsuapi_fns,
+       },
 };
 
 NTSTATUS dcerpc_server_setup_s3compat_drsuapi(struct dcerpc_server *server)