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_efs.c
index f82ab65c4ea9ae0264ff6028e40321be765621da..851e17086db6a1fd63f8cd7eafb799e538d808c2 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_efs.h"
 
 struct _s3_compat_EfsRpcOpenFileRaw_state {
@@ -9,11 +11,11 @@ struct _s3_compat_EfsRpcOpenFileRaw_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcOpenFileRaw_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcOpenFileRaw *r)
+                                                           struct tevent_context *ev,
+                                                           struct dcerpc_call_handle *call,
+                                                           struct EfsRpcOpenFileRaw *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcOpenFileRaw_state *state;
        struct pipes_struct *p;
 
@@ -27,6 +29,10 @@ static struct tevent_req *_s3_compat_EfsRpcOpenFileRaw_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.pvContext = talloc_zero(r, struct policy_handle);
@@ -38,7 +44,7 @@ static struct tevent_req *_s3_compat_EfsRpcOpenFileRaw_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);
        }
 
@@ -58,11 +64,11 @@ struct _s3_compat_EfsRpcReadFileRaw_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcReadFileRaw_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcReadFileRaw *r)
+                                                           struct tevent_context *ev,
+                                                           struct dcerpc_call_handle *call,
+                                                           struct EfsRpcReadFileRaw *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcReadFileRaw_state *state;
        struct pipes_struct *p;
 
@@ -76,12 +82,16 @@ static struct tevent_req *_s3_compat_EfsRpcReadFileRaw_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);
+       }
 
        r->out.result = _EfsRpcReadFileRaw(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);
        }
 
@@ -101,11 +111,11 @@ struct _s3_compat_EfsRpcWriteFileRaw_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcWriteFileRaw_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcWriteFileRaw *r)
+                                                            struct tevent_context *ev,
+                                                            struct dcerpc_call_handle *call,
+                                                            struct EfsRpcWriteFileRaw *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcWriteFileRaw_state *state;
        struct pipes_struct *p;
 
@@ -119,12 +129,16 @@ static struct tevent_req *_s3_compat_EfsRpcWriteFileRaw_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);
+       }
 
        r->out.result = _EfsRpcWriteFileRaw(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);
        }
 
@@ -144,11 +158,11 @@ struct _s3_compat_EfsRpcCloseRaw_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcCloseRaw_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcCloseRaw *r)
+                                                        struct tevent_context *ev,
+                                                        struct dcerpc_call_handle *call,
+                                                        struct EfsRpcCloseRaw *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcCloseRaw_state *state;
        struct pipes_struct *p;
 
@@ -162,6 +176,10 @@ static struct tevent_req *_s3_compat_EfsRpcCloseRaw_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.pvContext = r->in.pvContext;
@@ -169,7 +187,7 @@ static struct tevent_req *_s3_compat_EfsRpcCloseRaw_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);
        }
 
@@ -189,11 +207,11 @@ struct _s3_compat_EfsRpcEncryptFileSrv_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcEncryptFileSrv_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcEncryptFileSrv *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct EfsRpcEncryptFileSrv *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcEncryptFileSrv_state *state;
        struct pipes_struct *p;
 
@@ -207,12 +225,16 @@ static struct tevent_req *_s3_compat_EfsRpcEncryptFileSrv_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 = _EfsRpcEncryptFileSrv(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);
        }
 
@@ -232,11 +254,11 @@ struct _s3_compat_EfsRpcDecryptFileSrv_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcDecryptFileSrv_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcDecryptFileSrv *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct EfsRpcDecryptFileSrv *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcDecryptFileSrv_state *state;
        struct pipes_struct *p;
 
@@ -250,12 +272,16 @@ static struct tevent_req *_s3_compat_EfsRpcDecryptFileSrv_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 = _EfsRpcDecryptFileSrv(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);
        }
 
@@ -275,11 +301,11 @@ struct _s3_compat_EfsRpcQueryUsersOnFile_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcQueryUsersOnFile_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcQueryUsersOnFile *r)
+                                                                struct tevent_context *ev,
+                                                                struct dcerpc_call_handle *call,
+                                                                struct EfsRpcQueryUsersOnFile *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcQueryUsersOnFile_state *state;
        struct pipes_struct *p;
 
@@ -293,6 +319,10 @@ static struct tevent_req *_s3_compat_EfsRpcQueryUsersOnFile_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.pUsers = talloc_zero(r, struct ENCRYPTION_CERTIFICATE_HASH_LIST *);
@@ -304,7 +334,7 @@ static struct tevent_req *_s3_compat_EfsRpcQueryUsersOnFile_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);
        }
 
@@ -324,11 +354,11 @@ struct _s3_compat_EfsRpcQueryRecoveryAgents_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcQueryRecoveryAgents_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcQueryRecoveryAgents *r)
+                                                                   struct tevent_context *ev,
+                                                                   struct dcerpc_call_handle *call,
+                                                                   struct EfsRpcQueryRecoveryAgents *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcQueryRecoveryAgents_state *state;
        struct pipes_struct *p;
 
@@ -342,6 +372,10 @@ static struct tevent_req *_s3_compat_EfsRpcQueryRecoveryAgents_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.pRecoveryAgents = talloc_zero(r, struct ENCRYPTION_CERTIFICATE_HASH_LIST *);
@@ -353,7 +387,7 @@ static struct tevent_req *_s3_compat_EfsRpcQueryRecoveryAgents_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);
        }
 
@@ -373,11 +407,11 @@ struct _s3_compat_EfsRpcRemoveUsersFromFile_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcRemoveUsersFromFile_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcRemoveUsersFromFile *r)
+                                                                   struct tevent_context *ev,
+                                                                   struct dcerpc_call_handle *call,
+                                                                   struct EfsRpcRemoveUsersFromFile *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcRemoveUsersFromFile_state *state;
        struct pipes_struct *p;
 
@@ -391,12 +425,16 @@ static struct tevent_req *_s3_compat_EfsRpcRemoveUsersFromFile_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 = _EfsRpcRemoveUsersFromFile(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_EfsRpcAddUsersToFile_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcAddUsersToFile_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcAddUsersToFile *r)
+                                                              struct tevent_context *ev,
+                                                              struct dcerpc_call_handle *call,
+                                                              struct EfsRpcAddUsersToFile *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcAddUsersToFile_state *state;
        struct pipes_struct *p;
 
@@ -434,12 +472,16 @@ static struct tevent_req *_s3_compat_EfsRpcAddUsersToFile_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 = _EfsRpcAddUsersToFile(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);
        }
 
@@ -459,11 +501,11 @@ struct _s3_compat_EfsRpcSetFileEncryptionKey_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcSetFileEncryptionKey_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcSetFileEncryptionKey *r)
+                                                                    struct tevent_context *ev,
+                                                                    struct dcerpc_call_handle *call,
+                                                                    struct EfsRpcSetFileEncryptionKey *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcSetFileEncryptionKey_state *state;
        struct pipes_struct *p;
 
@@ -477,12 +519,16 @@ static struct tevent_req *_s3_compat_EfsRpcSetFileEncryptionKey_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 = _EfsRpcSetFileEncryptionKey(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);
        }
 
@@ -502,11 +548,11 @@ struct _s3_compat_EfsRpcNotSupported_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcNotSupported_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcNotSupported *r)
+                                                            struct tevent_context *ev,
+                                                            struct dcerpc_call_handle *call,
+                                                            struct EfsRpcNotSupported *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcNotSupported_state *state;
        struct pipes_struct *p;
 
@@ -520,12 +566,16 @@ static struct tevent_req *_s3_compat_EfsRpcNotSupported_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);
+       }
 
        r->out.result = _EfsRpcNotSupported(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);
        }
 
@@ -545,11 +595,11 @@ struct _s3_compat_EfsRpcFileKeyInfo_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcFileKeyInfo_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcFileKeyInfo *r)
+                                                           struct tevent_context *ev,
+                                                           struct dcerpc_call_handle *call,
+                                                           struct EfsRpcFileKeyInfo *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcFileKeyInfo_state *state;
        struct pipes_struct *p;
 
@@ -563,12 +613,16 @@ static struct tevent_req *_s3_compat_EfsRpcFileKeyInfo_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);
+       }
 
        r->out.result = _EfsRpcFileKeyInfo(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);
        }
 
@@ -588,11 +642,11 @@ struct _s3_compat_EfsRpcDuplicateEncryptionInfoFile_state {
 };
 
 static struct tevent_req *_s3_compat_EfsRpcDuplicateEncryptionInfoFile_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct dcerpc_call_handle *call,
-                                       struct EfsRpcDuplicateEncryptionInfoFile *r)
+                                                                           struct tevent_context *ev,
+                                                                           struct dcerpc_call_handle *call,
+                                                                           struct EfsRpcDuplicateEncryptionInfoFile *r)
 {
-       struct tevent_req *req
+       struct tevent_req *req;
        struct _s3_compat_EfsRpcDuplicateEncryptionInfoFile_state *state;
        struct pipes_struct *p;
 
@@ -606,12 +660,16 @@ static struct tevent_req *_s3_compat_EfsRpcDuplicateEncryptionInfoFile_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);
+       }
 
        r->out.result = _EfsRpcDuplicateEncryptionInfoFile(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);
        }
 
@@ -625,7 +683,7 @@ static NTSTATUS _s3_compat_EfsRpcDuplicateEncryptionInfoFile_recv(struct tevent_
 }
 
 
-static const struct dcerpc_call_entry_point_fns struct _s3_compat_efs_fns[] = {
+static const struct dcerpc_call_entry_point_fns _s3_compat_efs_fns[] = {
        {
                .send_fn = (dcerpc_call_entry_point_send_fn_t)
                        _s3_compat_EfsRpcOpenFileRaw_send,
@@ -717,10 +775,12 @@ static const struct dcerpc_call_entry_point_fns struct _s3_compat_efs_fns[] = {
 };
 
 static const struct dcerpc_call_entry_point_vector _s3_compat_efs_epv[] = {
+       {
        .name = "_s3_compat_efs",
        .table = &ndr_table_efs,
        .num_fns = 14,
        .fns = _s3_compat_efs_fns,
+       },
 };
 
 NTSTATUS dcerpc_server_setup_s3compat_efs(struct dcerpc_server *server)