Re-run make idl.
[gd/samba/.git] / source / librpc / gen_ndr / ndr_netlogon.c
index ec237fa883224d9a93460c94cce614fb15e3aac6..fb5c4603ee09b99a8fb39dbba17da64540781c85 100644 (file)
@@ -6,7 +6,7 @@
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "librpc/gen_ndr/ndr_security.h"
-static NTSTATUS ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasInfo *r)
+static enum ndr_err_code ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -53,10 +53,10 @@ static NTSTATUS ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->script_path, ndr_charset_length(r->script_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasInfo *r)
+static enum ndr_err_code ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasInfo *r)
 {
        uint32_t _ptr_account_name;
        TALLOC_CTX *_mem_save_account_name_0;
@@ -155,7 +155,7 @@ static NTSTATUS ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struc
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_script_path_0, 0);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r)
@@ -201,7 +201,7 @@ _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, co
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r)
+static enum ndr_err_code ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -210,10 +210,10 @@ static NTSTATUS ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags,
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r)
+static enum ndr_err_code ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -222,7 +222,7 @@ static NTSTATUS ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags,
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r)
@@ -234,7 +234,7 @@ _PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r)
+static enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r)
 {
        uint32_t cntr_bindata_1;
        if (ndr_flags & NDR_SCALARS) {
@@ -253,10 +253,10 @@ static NTSTATUS ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, c
                        }
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r)
+static enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r)
 {
        uint32_t _ptr_bindata;
        uint32_t cntr_bindata_1;
@@ -298,7 +298,7 @@ static NTSTATUS ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, s
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bindata, r->length / 2));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r)
@@ -327,12 +327,39 @@ _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parameter_control));
+               NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
@@ -343,15 +370,15 @@ static NTSTATUS ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r)
+static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parameter_control));
+               NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
@@ -362,7 +389,7 @@ static NTSTATUS ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags,
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r)
@@ -370,7 +397,7 @@ _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *nam
        ndr_print_struct(ndr, name, "netr_IdentityInfo");
        ndr->depth++;
        ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
-       ndr_print_uint32(ndr, "parameter_control", r->parameter_control);
+       ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control);
        ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low);
        ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high);
        ndr_print_lsa_String(ndr, "account_name", &r->account_name);
@@ -378,7 +405,7 @@ _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r)
+static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -391,10 +418,10 @@ static NTSTATUS ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->lmpassword));
                NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->ntpassword));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r)
+static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -407,7 +434,7 @@ static NTSTATUS ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags,
                NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->lmpassword));
                NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->ntpassword));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r)
@@ -420,7 +447,7 @@ _PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r)
+static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -441,10 +468,10 @@ static NTSTATUS ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_fl
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r)
+static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r)
 {
        uint32_t _ptr_data;
        TALLOC_CTX *_mem_save_data_0;
@@ -484,7 +511,7 @@ static NTSTATUS ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_fl
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r)
@@ -507,7 +534,7 @@ _PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char
        }
 }
 
-static NTSTATUS ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r)
+static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -526,10 +553,10 @@ static NTSTATUS ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, c
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r)
+static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -548,7 +575,7 @@ static NTSTATUS ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, s
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r)
@@ -567,31 +594,31 @@ _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name
        }
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case 1:
+                       case 1: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
-                       break;
+                       break; }
 
-                       case 2:
+                       case 2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
-                       break;
+                       break; }
 
-                       case 3:
+                       case 3: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
-                       break;
+                       break; }
 
-                       case 5:
+                       case 5: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
-                       break;
+                       break; }
 
-                       case 6:
+                       case 6: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -634,10 +661,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags,
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
 {
        int level;
        uint16_t _level;
@@ -755,7 +782,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags,
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r)
@@ -814,40 +841,7 @@ _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name,
        }
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_GroupMembership(struct ndr_push *ndr, int ndr_flags, const struct netr_GroupMembership *r)
-{
-       if (ndr_flags & NDR_SCALARS) {
-               NDR_CHECK(ndr_push_align(ndr, 4));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes));
-       }
-       if (ndr_flags & NDR_BUFFERS) {
-       }
-       return NT_STATUS_OK;
-}
-
-_PUBLIC_ NTSTATUS ndr_pull_netr_GroupMembership(struct ndr_pull *ndr, int ndr_flags, struct netr_GroupMembership *r)
-{
-       if (ndr_flags & NDR_SCALARS) {
-               NDR_CHECK(ndr_pull_align(ndr, 4));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes));
-       }
-       if (ndr_flags & NDR_BUFFERS) {
-       }
-       return NT_STATUS_OK;
-}
-
-_PUBLIC_ void ndr_print_netr_GroupMembership(struct ndr_print *ndr, const char *name, const struct netr_GroupMembership *r)
-{
-       ndr_print_struct(ndr, name, "netr_GroupMembership");
-       ndr->depth++;
-       ndr_print_uint32(ndr, "rid", r->rid);
-       ndr_print_uint32(ndr, "attributes", r->attributes);
-       ndr->depth--;
-}
-
-_PUBLIC_ NTSTATUS ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -860,10 +854,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_fla
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -876,7 +870,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_fla
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r)
@@ -892,7 +886,7 @@ _PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *n
        }
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -905,10 +899,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -921,7 +915,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r)
@@ -937,18 +931,18 @@ _PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *nam
        }
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
 {
        uint32_t v;
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
        *r = v;
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r)
@@ -965,10 +959,11 @@ _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name,
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r);
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r)
+static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r)
 {
        uint32_t cntr_unknown_0;
        if (ndr_flags & NDR_SCALARS) {
@@ -1015,10 +1010,10 @@ static NTSTATUS ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, c
                        NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r)
+static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r)
 {
        uint32_t _ptr_domain_sid;
        TALLOC_CTX *_mem_save_domain_sid_0;
@@ -1075,7 +1070,7 @@ static NTSTATUS ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, s
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r)
@@ -1126,7 +1121,7 @@ _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r)
+static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -1135,10 +1130,10 @@ static NTSTATUS ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, cons
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r)
+static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -1147,7 +1142,7 @@ static NTSTATUS ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, stru
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r)
@@ -1158,22 +1153,22 @@ _PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, c
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r)
+static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribute));
+               NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
        }
        if (ndr_flags & NDR_BUFFERS) {
                if (r->sid) {
                        NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r)
+static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r)
 {
        uint32_t _ptr_sid;
        TALLOC_CTX *_mem_save_sid_0;
@@ -1185,7 +1180,7 @@ static NTSTATUS ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struc
                } else {
                        r->sid = NULL;
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribute));
+               NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
        }
        if (ndr_flags & NDR_BUFFERS) {
                if (r->sid) {
@@ -1195,7 +1190,7 @@ static NTSTATUS ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struc
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r)
@@ -1208,11 +1203,11 @@ _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, co
                ndr_print_dom_sid2(ndr, "sid", r->sid);
        }
        ndr->depth--;
-       ndr_print_uint32(ndr, "attribute", r->attribute);
+       ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
        ndr->depth--;
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r)
 {
        uint32_t cntr_sids_1;
        if (ndr_flags & NDR_SCALARS) {
@@ -1233,10 +1228,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, co
                        }
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r)
 {
        uint32_t _ptr_sids;
        uint32_t cntr_sids_1;
@@ -1275,7 +1270,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, st
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r)
@@ -1304,7 +1299,7 @@ _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, c
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r)
+static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r)
 {
        uint32_t cntr_sids_1;
        uint32_t cntr_unknown4_0;
@@ -1333,10 +1328,10 @@ static NTSTATUS ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, cons
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r)
+static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r)
 {
        uint32_t _ptr_sids;
        uint32_t cntr_sids_1;
@@ -1383,7 +1378,7 @@ static NTSTATUS ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, stru
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r)
@@ -1426,7 +1421,7 @@ _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, c
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r)
+static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r)
 {
        uint32_t cntr_expansionroom_0;
        if (ndr_flags & NDR_SCALARS) {
@@ -1464,10 +1459,10 @@ static NTSTATUS ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r)
+static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r)
 {
        uint32_t _ptr_pac;
        TALLOC_CTX *_mem_save_pac_0;
@@ -1533,7 +1528,7 @@ static NTSTATUS ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struc
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r)
@@ -1577,31 +1572,31 @@ _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, co
        ndr->depth--;
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case 2:
+                       case 2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2));
-                       break;
+                       break; }
 
-                       case 3:
+                       case 3: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3));
-                       break;
+                       break; }
 
-                       case 4:
+                       case 4: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
-                       break;
+                       break; }
 
-                       case 5:
+                       case 5: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
-                       break;
+                       break; }
 
-                       case 6:
+                       case 6: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -1644,10 +1639,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags,
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r)
 {
        int level;
        uint16_t _level;
@@ -1767,7 +1762,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags,
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r)
@@ -1826,7 +1821,7 @@ _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name,
        }
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -1839,10 +1834,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags,
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -1855,7 +1850,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags,
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r)
@@ -1871,7 +1866,7 @@ _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name,
        }
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -1880,10 +1875,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -1892,7 +1887,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r)
@@ -1904,7 +1899,7 @@ _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_USER *r)
+static enum ndr_err_code ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_USER *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -1930,10 +1925,10 @@ static NTSTATUS ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_fl
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r)
 {
        uint32_t _ptr_account_name;
        TALLOC_CTX *_mem_save_account_name_0;
@@ -1972,7 +1967,7 @@ static NTSTATUS ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_fl
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r)
@@ -1996,7 +1991,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r)
+static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2008,10 +2003,10 @@ static NTSTATUS ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, co
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->pwd));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r)
+static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2023,7 +2018,7 @@ static NTSTATUS ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, st
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->pwd));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r)
@@ -2037,25 +2032,25 @@ _PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r)
+static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
-               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_size));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
-               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_size));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags));
                NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
                NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r)
+static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2072,7 +2067,7 @@ static NTSTATUS ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r)
@@ -2080,44 +2075,44 @@ _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *
        ndr_print_struct(ndr, name, "netr_PasswordHistory");
        ndr->depth++;
        ndr_print_uint16(ndr, "nt_length", r->nt_length);
-       ndr_print_uint16(ndr, "nt_size", r->nt_size);
+       ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size);
        ndr_print_uint32(ndr, "nt_flags", r->nt_flags);
        ndr_print_uint16(ndr, "lm_length", r->lm_length);
-       ndr_print_uint16(ndr, "lm_size", r->lm_size);
+       ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size);
        ndr_print_uint32(ndr, "lm_flags", r->lm_flags);
        ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length);
        ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length);
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r)
+static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
                NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
                NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
-               NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->lmhistory));
+               NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
        }
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->lmpassword));
                NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->ntpassword));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r)
+static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
                NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
                NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
-               NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->lmhistory));
+               NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
        }
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->lmpassword));
                NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->ntpassword));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r)
@@ -2126,11 +2121,11 @@ _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name,
        ndr->depth++;
        ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword);
        ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword);
-       ndr_print_netr_PasswordHistory(ndr, "lmhistory", &r->lmhistory);
+       ndr_print_netr_PasswordHistory(ndr, "history", &r->history);
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_USER_KEY_UNION(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY_UNION *r)
+static enum ndr_err_code ndr_push_netr_USER_KEY_UNION(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY_UNION *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2139,10 +2134,10 @@ static NTSTATUS ndr_push_netr_USER_KEY_UNION(struct ndr_push *ndr, int ndr_flags
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_BUFFERS, &r->keys2));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r)
+static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2151,7 +2146,7 @@ static NTSTATUS ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_BUFFERS, &r->keys2));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r)
@@ -2162,7 +2157,7 @@ _PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *n
        ndr->depth--;
 }
 
-_PUBLIC_ NTSTATUS ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r)
+_PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2172,10 +2167,10 @@ _PUBLIC_ NTSTATUS ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, c
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_BUFFERS, &r->keys));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2185,7 +2180,7 @@ _PUBLIC_ NTSTATUS ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, s
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_BUFFERS, &r->keys));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r)
@@ -2197,7 +2192,7 @@ _PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_PRIVATE_INFO *r)
+static enum ndr_err_code ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_PRIVATE_INFO *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2221,10 +2216,10 @@ static NTSTATUS ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push *ndr, int ndr_fl
                        ndr->flags = _flags_save_uint8;
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r)
+static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r)
 {
        uint32_t _ptr_SensitiveData;
        TALLOC_CTX *_mem_save_SensitiveData_0;
@@ -2262,7 +2257,7 @@ static NTSTATUS ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_fl
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r)
@@ -2280,7 +2275,7 @@ _PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r)
+static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2342,10 +2337,10 @@ static NTSTATUS ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, co
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2407,7 +2402,7 @@ static NTSTATUS ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, st
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r)
@@ -2454,7 +2449,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r)
+static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2487,10 +2482,10 @@ static NTSTATUS ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2523,7 +2518,7 @@ static NTSTATUS ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags,
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r)
@@ -2552,7 +2547,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r)
+static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2580,10 +2575,10 @@ static NTSTATUS ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, c
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2611,7 +2606,7 @@ static NTSTATUS ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, s
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r)
@@ -2635,7 +2630,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r)
+static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2658,10 +2653,10 @@ static NTSTATUS ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2684,7 +2679,7 @@ static NTSTATUS ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags,
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r)
@@ -2704,7 +2699,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP_MEMBER *r)
+static enum ndr_err_code ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP_MEMBER *r)
 {
        uint32_t cntr_rids_1;
        uint32_t cntr_attribs_1;
@@ -2732,10 +2727,10 @@ static NTSTATUS ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_f
                        }
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r)
 {
        uint32_t _ptr_rids;
        uint32_t cntr_rids_1;
@@ -2799,7 +2794,7 @@ static NTSTATUS ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_f
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r)
@@ -2848,7 +2843,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r)
+static enum ndr_err_code ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2873,10 +2868,10 @@ static NTSTATUS ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, c
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2901,7 +2896,7 @@ static NTSTATUS ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, s
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r)
@@ -2923,7 +2918,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS_MEMBER *r)
+static enum ndr_err_code ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS_MEMBER *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2936,10 +2931,10 @@ static NTSTATUS ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push *ndr, int ndr_f
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2952,7 +2947,7 @@ static NTSTATUS ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_f
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r)
@@ -2967,7 +2962,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r)
+static enum ndr_err_code ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -2980,10 +2975,10 @@ static NTSTATUS ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags,
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r)
+static enum ndr_err_code ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -2996,7 +2991,7 @@ static NTSTATUS ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags,
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r)
@@ -3012,7 +3007,7 @@ _PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r)
+static enum ndr_err_code ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r)
 {
        uint32_t cntr_eventauditoptions_1;
        if (ndr_flags & NDR_SCALARS) {
@@ -3055,10 +3050,10 @@ static NTSTATUS ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r)
 {
        uint32_t _ptr_eventauditoptions;
        uint32_t cntr_eventauditoptions_1;
@@ -3129,7 +3124,7 @@ static NTSTATUS ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags,
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eventauditoptions, r->maxauditeventcount + 1));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r)
@@ -3180,7 +3175,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_TRUSTED_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_TRUSTED_DOMAIN *r)
+static enum ndr_err_code ndr_push_netr_DELTA_TRUSTED_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_TRUSTED_DOMAIN *r)
 {
        uint32_t cntr_controller_names_1;
        if (ndr_flags & NDR_SCALARS) {
@@ -3216,10 +3211,10 @@ static NTSTATUS ndr_push_netr_DELTA_TRUSTED_DOMAIN(struct ndr_push *ndr, int ndr
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_TRUSTED_DOMAIN *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_TRUSTED_DOMAIN *r)
 {
        uint32_t _ptr_controller_names;
        uint32_t cntr_controller_names_1;
@@ -3273,7 +3268,7 @@ static NTSTATUS ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->controller_names, r->num_controllers));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r)
@@ -3312,7 +3307,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const c
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_DELETE_TRUST(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_TRUST *r)
+static enum ndr_err_code ndr_push_netr_DELTA_DELETE_TRUST(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_TRUST *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 2));
@@ -3320,10 +3315,10 @@ static NTSTATUS ndr_push_netr_DELTA_DELETE_TRUST(struct ndr_push *ndr, int ndr_f
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_TRUST *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_TRUST *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 2));
@@ -3331,7 +3326,7 @@ static NTSTATUS ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_f
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r)
@@ -3342,7 +3337,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ACCOUNT *r)
+static enum ndr_err_code ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ACCOUNT *r)
 {
        uint32_t cntr_privilege_attrib_1;
        uint32_t cntr_privilege_name_1;
@@ -3387,10 +3382,10 @@ static NTSTATUS ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ACCOUNT *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ACCOUNT *r)
 {
        uint32_t _ptr_privilege_attrib;
        uint32_t cntr_privilege_attrib_1;
@@ -3471,7 +3466,7 @@ static NTSTATUS ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags,
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_name, r->privilege_entries));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r)
@@ -3529,7 +3524,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_DELETE_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_ACCOUNT *r)
+static enum ndr_err_code ndr_push_netr_DELTA_DELETE_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_ACCOUNT *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 2));
@@ -3537,10 +3532,10 @@ static NTSTATUS ndr_push_netr_DELTA_DELETE_ACCOUNT(struct ndr_push *ndr, int ndr
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_ACCOUNT *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_ACCOUNT *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 2));
@@ -3548,7 +3543,7 @@ static NTSTATUS ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r)
@@ -3559,7 +3554,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const c
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_DELETE_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_SECRET *r)
+static enum ndr_err_code ndr_push_netr_DELTA_DELETE_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_SECRET *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 2));
@@ -3567,10 +3562,10 @@ static NTSTATUS ndr_push_netr_DELTA_DELETE_SECRET(struct ndr_push *ndr, int ndr_
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_SECRET *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_SECRET *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 2));
@@ -3578,7 +3573,7 @@ static NTSTATUS ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r)
@@ -3589,7 +3584,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const ch
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags, const struct netr_CIPHER_VALUE *r)
+static enum ndr_err_code ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags, const struct netr_CIPHER_VALUE *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -3605,10 +3600,10 @@ static NTSTATUS ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags,
                        NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->cipher_data, r->len));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags, struct netr_CIPHER_VALUE *r)
+static enum ndr_err_code ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags, struct netr_CIPHER_VALUE *r)
 {
        uint32_t _ptr_cipher_data;
        TALLOC_CTX *_mem_save_cipher_data_0;
@@ -3643,7 +3638,7 @@ static NTSTATUS ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags,
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->cipher_data, r->len));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r)
@@ -3661,7 +3656,7 @@ _PUBLIC_ void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_SECRET *r)
+static enum ndr_err_code ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_SECRET *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -3689,10 +3684,10 @@ static NTSTATUS ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_SECRET *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_SECRET *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -3720,7 +3715,7 @@ static NTSTATUS ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags,
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r)
@@ -3744,18 +3739,18 @@ _PUBLIC_ void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DeltaEnum(struct ndr_push *ndr, int ndr_flags, enum netr_DeltaEnum r)
+static enum ndr_err_code ndr_push_netr_DeltaEnum(struct ndr_push *ndr, int ndr_flags, enum netr_DeltaEnum r)
 {
        NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DeltaEnum(struct ndr_pull *ndr, int ndr_flags, enum netr_DeltaEnum *r)
+static enum ndr_err_code ndr_pull_netr_DeltaEnum(struct ndr_pull *ndr, int ndr_flags, enum netr_DeltaEnum *r)
 {
        uint16_t v;
        NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
        *r = v;
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r)
@@ -3789,96 +3784,96 @@ _PUBLIC_ void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name,
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
 
-static NTSTATUS ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_UNION *r)
+static enum ndr_err_code ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_UNION *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case NETR_DELTA_DOMAIN:
+                       case NETR_DELTA_DOMAIN: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_GROUP:
+                       case NETR_DELTA_GROUP: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->group));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_GROUP:
-                       break;
+                       case NETR_DELTA_DELETE_GROUP: {
+                       break; }
 
-                       case NETR_DELTA_RENAME_GROUP:
+                       case NETR_DELTA_RENAME_GROUP: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_group));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_USER:
+                       case NETR_DELTA_USER: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_USER:
-                       break;
+                       case NETR_DELTA_DELETE_USER: {
+                       break; }
 
-                       case NETR_DELTA_RENAME_USER:
+                       case NETR_DELTA_RENAME_USER: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_user));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_GROUP_MEMBER:
+                       case NETR_DELTA_GROUP_MEMBER: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_member));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_ALIAS:
+                       case NETR_DELTA_ALIAS: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_ALIAS:
-                       break;
+                       case NETR_DELTA_DELETE_ALIAS: {
+                       break; }
 
-                       case NETR_DELTA_RENAME_ALIAS:
+                       case NETR_DELTA_RENAME_ALIAS: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_alias));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_ALIAS_MEMBER:
+                       case NETR_DELTA_ALIAS_MEMBER: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias_member));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_POLICY:
+                       case NETR_DELTA_POLICY: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_TRUSTED_DOMAIN:
+                       case NETR_DELTA_TRUSTED_DOMAIN: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_TRUST:
+                       case NETR_DELTA_DELETE_TRUST: {
                                NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_ACCOUNT:
+                       case NETR_DELTA_ACCOUNT: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->account));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_ACCOUNT:
+                       case NETR_DELTA_DELETE_ACCOUNT: {
                                NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_SECRET:
+                       case NETR_DELTA_SECRET: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->secret));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_SECRET:
+                       case NETR_DELTA_DELETE_SECRET: {
                                NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_GROUP2:
+                       case NETR_DELTA_DELETE_GROUP2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_group));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_USER2:
+                       case NETR_DELTA_DELETE_USER2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_user));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_MODIFY_COUNT:
+                       case NETR_DELTA_MODIFY_COUNT: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->modified_count));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -4005,10 +4000,10 @@ static NTSTATUS ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, c
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_UNION *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_UNION *r)
 {
        int level;
        uint16_t _level;
@@ -4388,7 +4383,7 @@ static NTSTATUS ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, u
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r)
@@ -4567,98 +4562,98 @@ _PUBLIC_ void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name
        }
 }
 
-static NTSTATUS ndr_push_netr_DELTA_ID_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_ID_UNION *r)
+static enum ndr_err_code ndr_push_netr_DELTA_ID_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_ID_UNION *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case NETR_DELTA_DOMAIN:
+                       case NETR_DELTA_DOMAIN: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_GROUP:
+                       case NETR_DELTA_GROUP: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_GROUP:
+                       case NETR_DELTA_DELETE_GROUP: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_RENAME_GROUP:
+                       case NETR_DELTA_RENAME_GROUP: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_USER:
+                       case NETR_DELTA_USER: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_USER:
+                       case NETR_DELTA_DELETE_USER: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_RENAME_USER:
+                       case NETR_DELTA_RENAME_USER: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_GROUP_MEMBER:
+                       case NETR_DELTA_GROUP_MEMBER: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_ALIAS:
+                       case NETR_DELTA_ALIAS: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_ALIAS:
+                       case NETR_DELTA_DELETE_ALIAS: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_RENAME_ALIAS:
+                       case NETR_DELTA_RENAME_ALIAS: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_ALIAS_MEMBER:
+                       case NETR_DELTA_ALIAS_MEMBER: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_POLICY:
+                       case NETR_DELTA_POLICY: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_TRUSTED_DOMAIN:
+                       case NETR_DELTA_TRUSTED_DOMAIN: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_TRUST:
+                       case NETR_DELTA_DELETE_TRUST: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_ACCOUNT:
+                       case NETR_DELTA_ACCOUNT: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_ACCOUNT:
+                       case NETR_DELTA_DELETE_ACCOUNT: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_SECRET:
+                       case NETR_DELTA_SECRET: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_SECRET:
+                       case NETR_DELTA_DELETE_SECRET: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_GROUP2:
+                       case NETR_DELTA_DELETE_GROUP2: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_DELETE_USER2:
+                       case NETR_DELTA_DELETE_USER2: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
-                       break;
+                       break; }
 
-                       case NETR_DELTA_MODIFY_COUNT:
-                       break;
+                       case NETR_DELTA_MODIFY_COUNT: {
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -4764,10 +4759,10 @@ static NTSTATUS ndr_push_netr_DELTA_ID_UNION(struct ndr_push *ndr, int ndr_flags
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_ID_UNION *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_ID_UNION *r)
 {
        int level;
        uint16_t _level;
@@ -5039,7 +5034,7 @@ static NTSTATUS ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r)
@@ -5175,7 +5170,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *n
        }
 }
 
-static NTSTATUS ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM *r)
+static enum ndr_err_code ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -5189,10 +5184,10 @@ static NTSTATUS ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, co
                NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union));
                NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -5206,7 +5201,7 @@ static NTSTATUS ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, st
                NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union));
                NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r)
@@ -5221,7 +5216,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DELTA_ENUM_ARRAY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM_ARRAY *r)
+static enum ndr_err_code ndr_push_netr_DELTA_ENUM_ARRAY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM_ARRAY *r)
 {
        uint32_t cntr_delta_enum_1;
        if (ndr_flags & NDR_SCALARS) {
@@ -5240,10 +5235,10 @@ static NTSTATUS ndr_push_netr_DELTA_ENUM_ARRAY(struct ndr_push *ndr, int ndr_fla
                        }
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM_ARRAY *r)
+static enum ndr_err_code ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM_ARRAY *r)
 {
        uint32_t _ptr_delta_enum;
        uint32_t cntr_delta_enum_1;
@@ -5280,7 +5275,7 @@ static NTSTATUS ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_fla
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->delta_enum, r->num_deltas));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r)
@@ -5308,7 +5303,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_UAS_INFO_0(struct ndr_push *ndr, int ndr_flags, const struct netr_UAS_INFO_0 *r)
+static enum ndr_err_code ndr_push_netr_UAS_INFO_0(struct ndr_push *ndr, int ndr_flags, const struct netr_UAS_INFO_0 *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -5323,10 +5318,10 @@ static NTSTATUS ndr_push_netr_UAS_INFO_0(struct ndr_push *ndr, int ndr_flags, co
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, struct netr_UAS_INFO_0 *r)
+static enum ndr_err_code ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, struct netr_UAS_INFO_0 *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -5341,7 +5336,7 @@ static NTSTATUS ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, st
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r)
@@ -5359,7 +5354,7 @@ _PUBLIC_ void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name,
        }
 }
 
-static NTSTATUS ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags, const struct netr_AccountBuffer *r)
+static enum ndr_err_code ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags, const struct netr_AccountBuffer *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -5372,10 +5367,10 @@ static NTSTATUS ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags,
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags, struct netr_AccountBuffer *r)
+static enum ndr_err_code ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags, struct netr_AccountBuffer *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -5388,7 +5383,7 @@ static NTSTATUS ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags,
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r)
@@ -5399,7 +5394,7 @@ _PUBLIC_ void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETLOGON_INFO_1(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_1 *r)
+static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_1(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_1 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -5408,10 +5403,10 @@ static NTSTATUS ndr_push_netr_NETLOGON_INFO_1(struct ndr_push *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_1 *r)
+static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_1 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -5420,7 +5415,7 @@ static NTSTATUS ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r)
@@ -5432,7 +5427,7 @@ _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETLOGON_INFO_2(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_2 *r)
+static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_2(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_2 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -5446,10 +5441,10 @@ static NTSTATUS ndr_push_netr_NETLOGON_INFO_2(struct ndr_push *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_2 *r)
+static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_2 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -5466,7 +5461,7 @@ static NTSTATUS ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r)
@@ -5480,7 +5475,7 @@ _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETLOGON_INFO_3(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_3 *r)
+static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_3(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_3 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -5494,10 +5489,10 @@ static NTSTATUS ndr_push_netr_NETLOGON_INFO_3(struct ndr_push *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_3 *r)
+static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_3 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -5511,7 +5506,7 @@ static NTSTATUS ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flag
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r)
@@ -5528,23 +5523,23 @@ _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_QUERY_INFORMATION *r)
+static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_QUERY_INFORMATION *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case 1:
+                       case 1: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
-                       break;
+                       break; }
 
-                       case 2:
+                       case 2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
-                       break;
+                       break; }
 
-                       case 3:
+                       case 3: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -5575,10 +5570,10 @@ static NTSTATUS ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push *ndr, in
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_QUERY_INFORMATION *r)
+static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_QUERY_INFORMATION *r)
 {
        int level;
        uint32_t _level;
@@ -5659,7 +5654,7 @@ static NTSTATUS ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, in
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r)
@@ -5700,18 +5695,18 @@ _PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, co
        }
 }
 
-static NTSTATUS ndr_push_netr_LogonControlCode(struct ndr_push *ndr, int ndr_flags, enum netr_LogonControlCode r)
+static enum ndr_err_code ndr_push_netr_LogonControlCode(struct ndr_push *ndr, int ndr_flags, enum netr_LogonControlCode r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonControlCode(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonControlCode *r)
+static enum ndr_err_code ndr_pull_netr_LogonControlCode(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonControlCode *r)
 {
        uint32_t v;
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
        *r = v;
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r)
@@ -5719,6 +5714,7 @@ _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char
        const char *val = NULL;
 
        switch (r) {
+               case NETLOGON_CONTROL_SYNC: val = "NETLOGON_CONTROL_SYNC"; break;
                case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break;
                case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break;
                case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break;
@@ -5727,27 +5723,27 @@ _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
 
-static NTSTATUS ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_DATA_INFORMATION *r)
+static enum ndr_err_code ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_DATA_INFORMATION *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case NETLOGON_CONTROL_REDISCOVER:
+                       case NETLOGON_CONTROL_REDISCOVER: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
-                       break;
+                       break; }
 
-                       case NETLOGON_CONTROL_TC_QUERY:
+                       case NETLOGON_CONTROL_TC_QUERY: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
-                       break;
+                       break; }
 
-                       case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
+                       case NETLOGON_CONTROL_TRANSPORT_NOTIFY: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
-                       break;
+                       break; }
 
-                       case NETLOGON_CONTROL_SET_DBFLAG:
+                       case NETLOGON_CONTROL_SET_DBFLAG: {
                                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -5790,10 +5786,10 @@ static NTSTATUS ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push *ndr, int
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_DATA_INFORMATION *r)
+static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_DATA_INFORMATION *r)
 {
        int level;
        uint32_t _level;
@@ -5897,7 +5893,7 @@ static NTSTATUS ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r)
@@ -5942,17 +5938,178 @@ _PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, con
        }
 }
 
-static NTSTATUS ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r)
+static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->data) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *r)
+{
+       uint32_t _ptr_data;
+       TALLOC_CTX *_mem_save_data_0;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
+               if (_ptr_data) {
+                       NDR_PULL_ALLOC(ndr, r->data);
+               } else {
+                       r->data = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->data) {
+                       _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
+                       NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
+                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+               }
+               if (r->data) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r)
+{
+       ndr_print_struct(ndr, name, "netr_Blob");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "length", r->length);
+       ndr_print_ptr(ndr, "data", r->data);
+       ndr->depth++;
+       if (r->data) {
+               ndr_print_array_uint8(ndr, "data", r->data, r->length);
+       }
+       ndr->depth--;
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_DsRGetDCName_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME, r);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r)
+{
+       const char *val = NULL;
+
+       switch (r) {
+               case DS_ADDRESS_TYPE_INET: val = "DS_ADDRESS_TYPE_INET"; break;
+               case DS_ADDRESS_TYPE_NETBIOS: val = "DS_ADDRESS_TYPE_NETBIOS"; break;
+       }
+       ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static enum ndr_err_code ndr_push_netr_DsR_DcFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_DsR_DcFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST, r);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_unc));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_address));
-               NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->dc_address_type));
+               NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, r->dc_address_type));
                NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_name));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dc_flags));
+               NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr, NDR_SCALARS, r->dc_flags));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_site_name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_site_name));
        }
@@ -5995,10 +6152,10 @@ static NTSTATUS ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_fla
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_site_name, ndr_charset_length(r->client_site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r)
+static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r)
 {
        uint32_t _ptr_dc_unc;
        TALLOC_CTX *_mem_save_dc_unc_0;
@@ -6026,7 +6183,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_fla
                } else {
                        r->dc_address = NULL;
                }
-               NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->dc_address_type));
+               NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, &r->dc_address_type));
                NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
                if (_ptr_domain_name) {
@@ -6040,7 +6197,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_fla
                } else {
                        r->forest_name = NULL;
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dc_flags));
+               NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr, NDR_SCALARS, &r->dc_flags));
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_site_name));
                if (_ptr_dc_site_name) {
                        NDR_PULL_ALLOC(ndr, r->dc_site_name);
@@ -6129,7 +6286,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_fla
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_site_name_0, 0);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r)
@@ -6148,7 +6305,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char
                ndr_print_string(ndr, "dc_address", r->dc_address);
        }
        ndr->depth--;
-       ndr_print_int32(ndr, "dc_address_type", r->dc_address_type);
+       ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr, "dc_address_type", r->dc_address_type);
        ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
        ndr_print_ptr(ndr, "domain_name", r->domain_name);
        ndr->depth++;
@@ -6162,7 +6319,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char
                ndr_print_string(ndr, "forest_name", r->forest_name);
        }
        ndr->depth--;
-       ndr_print_uint32(ndr, "dc_flags", r->dc_flags);
+       ndr_print_netr_DsR_DcFlags(ndr, "dc_flags", r->dc_flags);
        ndr_print_ptr(ndr, "dc_site_name", r->dc_site_name);
        ndr->depth++;
        if (r->dc_site_name) {
@@ -6178,67 +6335,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *r)
-{
-       if (ndr_flags & NDR_SCALARS) {
-               NDR_CHECK(ndr_push_align(ndr, 4));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
-       }
-       if (ndr_flags & NDR_BUFFERS) {
-               if (r->data) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
-                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
-               }
-       }
-       return NT_STATUS_OK;
-}
-
-static NTSTATUS ndr_pull_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *r)
-{
-       uint32_t _ptr_data;
-       TALLOC_CTX *_mem_save_data_0;
-       if (ndr_flags & NDR_SCALARS) {
-               NDR_CHECK(ndr_pull_align(ndr, 4));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
-               if (_ptr_data) {
-                       NDR_PULL_ALLOC(ndr, r->data);
-               } else {
-                       r->data = NULL;
-               }
-       }
-       if (ndr_flags & NDR_BUFFERS) {
-               if (r->data) {
-                       _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
-                       NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
-                       NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
-                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
-               }
-               if (r->data) {
-                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
-               }
-       }
-       return NT_STATUS_OK;
-}
-
-_PUBLIC_ void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r)
-{
-       ndr_print_struct(ndr, name, "netr_Blob");
-       ndr->depth++;
-       ndr_print_uint32(ndr, "length", r->length);
-       ndr_print_ptr(ndr, "data", r->data);
-       ndr->depth++;
-       if (r->data) {
-               ndr_print_array_uint8(ndr, "data", r->data, r->length);
-       }
-       ndr->depth--;
-       ndr->depth--;
-}
-
-static NTSTATUS ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r)
+static enum ndr_err_code ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r)
 {
        uint32_t cntr_data_1;
        {
@@ -6262,10 +6359,10 @@ static NTSTATUS ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags,
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct netr_BinaryString *r)
+static enum ndr_err_code ndr_pull_netr_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct netr_BinaryString *r)
 {
        uint32_t _ptr_data;
        uint32_t cntr_data_1;
@@ -6312,7 +6409,7 @@ static NTSTATUS ndr_pull_netr_BinaryString(struct ndr_pull *ndr, int ndr_flags,
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r)
@@ -6346,7 +6443,7 @@ _PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *nam
        }
 }
 
-static NTSTATUS ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainQuery1 *r)
+static enum ndr_err_code ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainQuery1 *r)
 {
        uint32_t cntr_unknown7_0;
        if (ndr_flags & NDR_SCALARS) {
@@ -6409,10 +6506,10 @@ static NTSTATUS ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int ndr_flags,
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown5));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown6));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainQuery1 *r)
+static enum ndr_err_code ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainQuery1 *r)
 {
        uint32_t _ptr_workstation_domain;
        TALLOC_CTX *_mem_save_workstation_domain_0;
@@ -6553,7 +6650,7 @@ static NTSTATUS ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int ndr_flags,
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown5));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown6));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r)
@@ -6616,19 +6713,19 @@ _PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DomainQuery(struct ndr_push *ndr, int ndr_flags, const union netr_DomainQuery *r)
+static enum ndr_err_code ndr_push_netr_DomainQuery(struct ndr_push *ndr, int ndr_flags, const union netr_DomainQuery *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case 1:
+                       case 1: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1));
-                       break;
+                       break; }
 
-                       case 2:
+                       case 2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -6653,10 +6750,10 @@ static NTSTATUS ndr_push_netr_DomainQuery(struct ndr_push *ndr, int ndr_flags, c
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DomainQuery(struct ndr_pull *ndr, int ndr_flags, union netr_DomainQuery *r)
+static enum ndr_err_code ndr_pull_netr_DomainQuery(struct ndr_pull *ndr, int ndr_flags, union netr_DomainQuery *r)
 {
        int level;
        uint32_t _level;
@@ -6716,7 +6813,7 @@ static NTSTATUS ndr_pull_netr_DomainQuery(struct ndr_pull *ndr, int ndr_flags, u
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r)
@@ -6748,7 +6845,7 @@ _PUBLIC_ void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name
        }
 }
 
-static NTSTATUS ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustInfo *r)
+static enum ndr_err_code ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustInfo *r)
 {
        uint32_t cntr_unknown1_0;
        uint32_t cntr_unknown_0;
@@ -6778,10 +6875,10 @@ static NTSTATUS ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int ndr_flag
                        NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_BUFFERS, &r->unknown1[cntr_unknown1_0]));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustInfo *r)
+static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustInfo *r)
 {
        uint32_t _ptr_sid;
        TALLOC_CTX *_mem_save_sid_0;
@@ -6821,7 +6918,7 @@ static NTSTATUS ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int ndr_flag
                        NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_BUFFERS, &r->unknown1[cntr_unknown1_0]));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r)
@@ -6865,7 +6962,7 @@ _PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInfo1 *r)
+static enum ndr_err_code ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInfo1 *r)
 {
        uint32_t cntr_trusts_1;
        uint32_t cntr_unknown_0;
@@ -6890,10 +6987,10 @@ static NTSTATUS ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr_flags, c
                        }
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainInfo1 *r)
+static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainInfo1 *r)
 {
        uint32_t _ptr_trusts;
        uint32_t cntr_trusts_1;
@@ -6936,7 +7033,7 @@ static NTSTATUS ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr_flags, s
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->trusts, r->num_trusts));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r)
@@ -6977,19 +7074,19 @@ _PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union netr_DomainInfo *r)
+static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union netr_DomainInfo *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                int level = ndr_push_get_switch_value(ndr, r);
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
                switch (level) {
-                       case 1:
+                       case 1: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
-                       break;
+                       break; }
 
-                       case 2:
+                       case 2: {
                                NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
-                       break;
+                       break; }
 
                        default:
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
@@ -7014,10 +7111,10 @@ static NTSTATUS ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, co
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union netr_DomainInfo *r)
+static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union netr_DomainInfo *r)
 {
        int level;
        uint32_t _level;
@@ -7077,7 +7174,7 @@ static NTSTATUS ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, un
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r)
@@ -7109,7 +7206,7 @@ _PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name,
        }
 }
 
-static NTSTATUS ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct netr_CryptPassword *r)
+static enum ndr_err_code ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct netr_CryptPassword *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -7123,10 +7220,10 @@ static NTSTATUS ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags,
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct netr_CryptPassword *r)
+static enum ndr_err_code ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct netr_CryptPassword *r)
 {
        {
                uint32_t _flags_save_STRUCT = ndr->flags;
@@ -7140,7 +7237,7 @@ static NTSTATUS ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags,
                }
                ndr->flags = _flags_save_STRUCT;
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r)
@@ -7157,45 +7254,192 @@ _PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *na
        }
 }
 
-static NTSTATUS ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesWCtr *r)
 {
-       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       uint32_t cntr_sitename_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sitename) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
+                       }
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
+                       }
+               }
+       }
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesWCtr *r)
 {
-       uint32_t v;
-       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
-       *r = v;
-       return NT_STATUS_OK;
+       uint32_t _ptr_sitename;
+       uint32_t cntr_sitename_1;
+       TALLOC_CTX *_mem_save_sitename_0;
+       TALLOC_CTX *_mem_save_sitename_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
+               if (_ptr_sitename) {
+                       NDR_PULL_ALLOC(ndr, r->sitename);
+               } else {
+                       r->sitename = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sitename) {
+                       _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
+                       NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename));
+                       _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
+                       }
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
+               }
+               if (r->sitename) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count));
+               }
+       }
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r)
 {
-       ndr_print_uint32(ndr, name, r);
+       uint32_t cntr_sitename_1;
+       ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesWCtr");
        ndr->depth++;
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r);
+       ndr_print_uint32(ndr, "count", r->count);
+       ndr_print_ptr(ndr, "sitename", r->sitename);
+       ndr->depth++;
+       if (r->sitename) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "sitename", r->count);
+               ndr->depth++;
+               for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_sitename_1);
+                       if (idx_1) {
+                               ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r)
+static enum ndr_err_code ndr_push_netr_DsRAddress(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddress *r)
 {
-       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->buffer) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
+                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->size));
+               }
+       }
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_TrustType(struct ndr_pull *ndr, int ndr_flags, enum netr_TrustType *r)
+static enum ndr_err_code ndr_pull_netr_DsRAddress(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddress *r)
+{
+       uint32_t _ptr_buffer;
+       TALLOC_CTX *_mem_save_buffer_0;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
+               if (_ptr_buffer) {
+                       NDR_PULL_ALLOC(ndr, r->buffer);
+               } else {
+                       r->buffer = NULL;
+               }
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->buffer) {
+                       _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer));
+                       NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer));
+                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer)));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
+               }
+               if (r->buffer) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->size));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r)
+{
+       ndr_print_struct(ndr, name, "netr_DsRAddress");
+       ndr->depth++;
+       ndr_print_ptr(ndr, "buffer", r->buffer);
+       ndr->depth++;
+       if (r->buffer) {
+               ndr_print_array_uint8(ndr, "buffer", r->buffer, r->size);
+       }
+       ndr->depth--;
+       ndr_print_uint32(ndr, "size", r->size);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_TrustType(struct ndr_pull *ndr, int ndr_flags, enum netr_TrustType *r)
 {
        uint32_t v;
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
        *r = v;
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r)
@@ -7211,18 +7455,18 @@ _PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name,
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
 
-static NTSTATUS ndr_push_netr_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+static enum ndr_err_code ndr_push_netr_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+static enum ndr_err_code ndr_pull_netr_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
 {
        uint32_t v;
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
        *r = v;
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
@@ -7239,7 +7483,7 @@ _PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrust *r)
+static enum ndr_err_code ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrust *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -7270,10 +7514,10 @@ static NTSTATUS ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, c
                }
                NDR_CHECK(ndr_push_GUID(ndr, NDR_BUFFERS, &r->guid));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrust *r)
+static enum ndr_err_code ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrust *r)
 {
        uint32_t _ptr_netbios_name;
        TALLOC_CTX *_mem_save_netbios_name_0;
@@ -7340,7 +7584,7 @@ static NTSTATUS ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, s
                }
                NDR_CHECK(ndr_pull_GUID(ndr, NDR_BUFFERS, &r->guid));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r)
@@ -7373,7 +7617,325 @@ _PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r)
+static enum ndr_err_code ndr_push_netr_DomainTrustList(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustList *r)
+{
+       uint32_t cntr_array_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->array) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+                       for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
+                               NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
+                       }
+                       for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
+                               NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
+                       }
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_DomainTrustList(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustList *r)
+{
+       uint32_t _ptr_array;
+       uint32_t cntr_array_1;
+       TALLOC_CTX *_mem_save_array_0;
+       TALLOC_CTX *_mem_save_array_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
+               if (_ptr_array) {
+                       NDR_PULL_ALLOC(ndr, r->array);
+               } else {
+                       r->array = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->array) {
+                       _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
+                       NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
+                       _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
+                       for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
+                               NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
+                       }
+                       for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
+                               NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
+               }
+               if (r->array) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r)
+{
+       uint32_t cntr_array_1;
+       ndr_print_struct(ndr, name, "netr_DomainTrustList");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "count", r->count);
+       ndr_print_ptr(ndr, "array", r->array);
+       ndr->depth++;
+       if (r->array) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "array", r->count);
+               ndr->depth++;
+               for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_array_1);
+                       if (idx_1) {
+                               ndr_print_netr_DomainTrust(ndr, "array", &r->array[cntr_array_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesExWCtr *r)
+{
+       uint32_t cntr_sitename_1;
+       uint32_t cntr_subnetname_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->subnetname));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sitename) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
+                       }
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
+                       }
+               }
+               if (r->subnetname) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+                       for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1]));
+                       }
+                       for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1]));
+                       }
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesExWCtr *r)
+{
+       uint32_t _ptr_sitename;
+       uint32_t cntr_sitename_1;
+       TALLOC_CTX *_mem_save_sitename_0;
+       TALLOC_CTX *_mem_save_sitename_1;
+       uint32_t _ptr_subnetname;
+       uint32_t cntr_subnetname_1;
+       TALLOC_CTX *_mem_save_subnetname_0;
+       TALLOC_CTX *_mem_save_subnetname_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename));
+               if (_ptr_sitename) {
+                       NDR_PULL_ALLOC(ndr, r->sitename);
+               } else {
+                       r->sitename = NULL;
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_subnetname));
+               if (_ptr_subnetname) {
+                       NDR_PULL_ALLOC(ndr, r->subnetname);
+               } else {
+                       r->subnetname = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sitename) {
+                       _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename));
+                       NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename));
+                       _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0);
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1]));
+                       }
+                       for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0);
+               }
+               if (r->subnetname) {
+                       _mem_save_subnetname_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->subnetname));
+                       NDR_PULL_ALLOC_N(ndr, r->subnetname, ndr_get_array_size(ndr, &r->subnetname));
+                       _mem_save_subnetname_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0);
+                       for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1]));
+                       }
+                       for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_0, 0);
+               }
+               if (r->sitename) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count));
+               }
+               if (r->subnetname) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->subnetname, r->count));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r)
+{
+       uint32_t cntr_sitename_1;
+       uint32_t cntr_subnetname_1;
+       ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExWCtr");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "count", r->count);
+       ndr_print_ptr(ndr, "sitename", r->sitename);
+       ndr->depth++;
+       if (r->sitename) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "sitename", r->count);
+               ndr->depth++;
+               for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_sitename_1);
+                       if (idx_1) {
+                               ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
+       ndr_print_ptr(ndr, "subnetname", r->subnetname);
+       ndr->depth++;
+       if (r->subnetname) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "subnetname", r->count);
+               ndr->depth++;
+               for (cntr_subnetname_1=0;cntr_subnetname_1<r->count;cntr_subnetname_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_subnetname_1);
+                       if (idx_1) {
+                               ndr_print_lsa_String(ndr, "subnetname", &r->subnetname[cntr_subnetname_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_DcSitesCtr(struct ndr_push *ndr, int ndr_flags, const struct DcSitesCtr *r)
+{
+       uint32_t cntr_sites_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->sites));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sites) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites));
+                       for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1]));
+                       }
+                       for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1]));
+                       }
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_DcSitesCtr(struct ndr_pull *ndr, int ndr_flags, struct DcSitesCtr *r)
+{
+       uint32_t _ptr_sites;
+       uint32_t cntr_sites_1;
+       TALLOC_CTX *_mem_save_sites_0;
+       TALLOC_CTX *_mem_save_sites_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sites));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sites));
+               if (_ptr_sites) {
+                       NDR_PULL_ALLOC(ndr, r->sites);
+               } else {
+                       r->sites = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sites) {
+                       _mem_save_sites_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->sites));
+                       NDR_PULL_ALLOC_N(ndr, r->sites, ndr_get_array_size(ndr, &r->sites));
+                       _mem_save_sites_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0);
+                       for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1]));
+                       }
+                       for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_0, 0);
+               }
+               if (r->sites) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sites, r->num_sites));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r)
+{
+       uint32_t cntr_sites_1;
+       ndr_print_struct(ndr, name, "DcSitesCtr");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "num_sites", r->num_sites);
+       ndr_print_ptr(ndr, "sites", r->sites);
+       ndr->depth++;
+       if (r->sites) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "sites", r->num_sites);
+               ndr->depth++;
+               for (cntr_sites_1=0;cntr_sites_1<r->num_sites;cntr_sites_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_sites_1);
+                       if (idx_1) {
+                               ndr_print_lsa_String(ndr, "sites", &r->sites[cntr_sites_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -7393,19 +7955,18 @@ static NTSTATUS ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, con
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info));
-               if (r->out.info) {
-                       NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+               if (r->out.info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
+               NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r)
+static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r)
 {
        uint32_t _ptr_server_name;
-       uint32_t _ptr_info;
        TALLOC_CTX *_mem_save_server_name_0;
        TALLOC_CTX *_mem_save_info_0;
        if (flags & NDR_IN) {
@@ -7443,23 +8004,20 @@ static NTSTATUS ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, str
                }
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16));
+               NDR_PULL_ALLOC(ndr, r->out.info);
+               ZERO_STRUCTP(r->out.info);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
-               if (_ptr_info) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->out.info);
-               } else {
-                       r->out.info = NULL;
-               }
-               if (r->out.info) {
-                       _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
-                       NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
+               _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r)
@@ -7487,9 +8045,7 @@ _PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *na
                ndr->depth++;
                ndr_print_ptr(ndr, "info", r->out.info);
                ndr->depth++;
-               if (r->out.info) {
-                       ndr_print_netr_UasInfo(ndr, "info", r->out.info);
-               }
+               ndr_print_netr_UasInfo(ndr, "info", r->out.info);
                ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -7497,7 +8053,7 @@ _PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogoff *r)
+static enum ndr_err_code ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogoff *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -7523,10 +8079,10 @@ static NTSTATUS ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, co
                NDR_CHECK(ndr_push_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogoff *r)
+static enum ndr_err_code ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogoff *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
@@ -7579,7 +8135,7 @@ static NTSTATUS ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, st
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r)
@@ -7615,7 +8171,7 @@ _PUBLIC_ void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *n
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogon *r)
+static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogon *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -7641,8 +8197,11 @@ static NTSTATUS ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, con
                        NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
                }
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.logon_level));
-               NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
-               NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+               if (r->in.logon == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
+               NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
        }
        if (flags & NDR_OUT) {
@@ -7661,10 +8220,10 @@ static NTSTATUS ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, con
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.authoritative));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogon *r)
+static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogon *r)
 {
        uint32_t _ptr_server_name;
        uint32_t _ptr_computer_name;
@@ -7674,6 +8233,7 @@ static NTSTATUS ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, str
        TALLOC_CTX *_mem_save_computer_name_0;
        TALLOC_CTX *_mem_save_credential_0;
        TALLOC_CTX *_mem_save_return_authenticator_0;
+       TALLOC_CTX *_mem_save_logon_0;
        TALLOC_CTX *_mem_save_validation_0;
        TALLOC_CTX *_mem_save_authoritative_0;
        if (flags & NDR_IN) {
@@ -7740,8 +8300,14 @@ static NTSTATUS ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, str
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
                }
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.logon_level));
-               NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
-               NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.logon);
+               }
+               _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
+               NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
                NDR_PULL_ALLOC(ndr, r->out.validation);
                ZERO_STRUCTP(r->out.validation);
@@ -7778,7 +8344,7 @@ static NTSTATUS ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, str
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r)
@@ -7816,8 +8382,11 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *na
                }
                ndr->depth--;
                ndr_print_uint16(ndr, "logon_level", r->in.logon_level);
-               ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level);
-               ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon);
+               ndr_print_ptr(ndr, "logon", r->in.logon);
+               ndr->depth++;
+               ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
+               ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
+               ndr->depth--;
                ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
                ndr->depth--;
        }
@@ -7845,7 +8414,7 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogoff *r)
+static enum ndr_err_code ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogoff *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -7881,10 +8450,10 @@ static NTSTATUS ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, co
                }
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogoff *r)
+static enum ndr_err_code ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogoff *r)
 {
        uint32_t _ptr_server_name;
        uint32_t _ptr_computer_name;
@@ -7976,7 +8545,7 @@ static NTSTATUS ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, st
                }
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r)
@@ -8033,7 +8602,7 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *n
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r)
+static enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -8053,20 +8622,21 @@ static NTSTATUS ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags
                NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
        }
        if (flags & NDR_OUT) {
-               if (r->out.credentials == NULL) {
+               if (r->out.return_credentials == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials));
+               NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r)
+static enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
        TALLOC_CTX *_mem_save_credentials_0;
+       TALLOC_CTX *_mem_save_return_credentials_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -8102,20 +8672,20 @@ static NTSTATUS ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags
                NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_PULL_ALLOC(ndr, r->out.credentials);
-               *r->out.credentials = *r->in.credentials;
+               NDR_PULL_ALLOC(ndr, r->out.return_credentials);
+               ZERO_STRUCTP(r->out.return_credentials);
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC(ndr, r->out.credentials);
+                       NDR_PULL_ALLOC(ndr, r->out.return_credentials);
                }
-               _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->out.credentials, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.credentials));
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
+               _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r)
@@ -8144,9 +8714,9 @@ _PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const cha
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "netr_ServerReqChallenge");
                ndr->depth++;
-               ndr_print_ptr(ndr, "credentials", r->out.credentials);
+               ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
                ndr->depth++;
-               ndr_print_netr_Credential(ndr, "credentials", r->out.credentials);
+               ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
                ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
@@ -8154,7 +8724,7 @@ _PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate *r)
+static enum ndr_err_code ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -8179,20 +8749,21 @@ static NTSTATUS ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags
                NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
        }
        if (flags & NDR_OUT) {
-               if (r->out.credentials == NULL) {
+               if (r->out.return_credentials == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials));
+               NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate *r)
+static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
        TALLOC_CTX *_mem_save_credentials_0;
+       TALLOC_CTX *_mem_save_return_credentials_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -8236,20 +8807,20 @@ static NTSTATUS ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags
                NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_PULL_ALLOC(ndr, r->out.credentials);
-               *r->out.credentials = *r->in.credentials;
+               NDR_PULL_ALLOC(ndr, r->out.return_credentials);
+               ZERO_STRUCTP(r->out.return_credentials);
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC(ndr, r->out.credentials);
+                       NDR_PULL_ALLOC(ndr, r->out.return_credentials);
                }
-               _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->out.credentials, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.credentials));
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
+               _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r)
@@ -8280,9 +8851,9 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const cha
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "netr_ServerAuthenticate");
                ndr->depth++;
-               ndr_print_ptr(ndr, "credentials", r->out.credentials);
+               ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
                ndr->depth++;
-               ndr_print_netr_Credential(ndr, "credentials", r->out.credentials);
+               ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
                ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
@@ -8290,7 +8861,7 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet *r)
+static enum ndr_err_code ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -8309,8 +8880,14 @@ static NTSTATUS ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags,
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
-               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.new_password));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               if (r->in.new_password == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_password));
        }
        if (flags & NDR_OUT) {
                if (r->out.return_authenticator == NULL) {
@@ -8319,14 +8896,16 @@ static NTSTATUS ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags,
                NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet *r)
+static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_credential_0;
        TALLOC_CTX *_mem_save_return_authenticator_0;
+       TALLOC_CTX *_mem_save_new_password_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -8363,8 +8942,20 @@ static NTSTATUS ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags,
                }
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
-               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.new_password));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.new_password);
+               }
+               _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_password));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
                ZERO_STRUCTP(r->out.return_authenticator);
        }
@@ -8378,7 +8969,7 @@ static NTSTATUS ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags,
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r)
@@ -8400,10 +8991,16 @@ _PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char
                ndr_print_string(ndr, "account_name", r->in.account_name);
                ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
                ndr_print_string(ndr, "computer_name", r->in.computer_name);
-               ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
-               ndr_print_samr_Password(ndr, "new_password", &r->in.new_password);
-               ndr->depth--;
-       }
+               ndr_print_ptr(ndr, "credential", r->in.credential);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "new_password", r->in.new_password);
+               ndr->depth++;
+               ndr_print_samr_Password(ndr, "new_password", r->in.new_password);
+               ndr->depth--;
+               ndr->depth--;
+       }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "netr_ServerPasswordSet");
                ndr->depth++;
@@ -8417,7 +9014,7 @@ _PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, const struct netr_DatabaseDeltas *r)
+static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, const struct netr_DatabaseDeltas *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
@@ -8428,7 +9025,10 @@ static NTSTATUS ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, co
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
                if (r->in.return_authenticator == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
@@ -8449,21 +9049,26 @@ static NTSTATUS ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, co
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
                NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num));
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array));
-               if (r->out.delta_enum_array) {
-                       NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
+               if (r->out.delta_enum_array == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
+               if (*r->out.delta_enum_array) {
+                       NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
                }
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r)
+static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r)
 {
        uint32_t _ptr_delta_enum_array;
+       TALLOC_CTX *_mem_save_credential_0;
        TALLOC_CTX *_mem_save_return_authenticator_0;
        TALLOC_CTX *_mem_save_sequence_num_0;
        TALLOC_CTX *_mem_save_delta_enum_array_0;
+       TALLOC_CTX *_mem_save_delta_enum_array_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -8481,7 +9086,13 @@ static NTSTATUS ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, st
                }
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
                }
@@ -8502,6 +9113,8 @@ static NTSTATUS ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, st
                *r->out.return_authenticator = *r->in.return_authenticator;
                NDR_PULL_ALLOC(ndr, r->out.sequence_num);
                *r->out.sequence_num = *r->in.sequence_num;
+               NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+               ZERO_STRUCTP(r->out.delta_enum_array);
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -8518,21 +9131,27 @@ static NTSTATUS ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, st
                NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence_num, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->out.sequence_num));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+               }
+               _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
                if (_ptr_delta_enum_array) {
-                       NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+                       NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
                } else {
-                       r->out.delta_enum_array = NULL;
+                       *r->out.delta_enum_array = NULL;
                }
-               if (r->out.delta_enum_array) {
-                       _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0);
-                       NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0);
+               if (*r->out.delta_enum_array) {
+                       _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
+                       NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
                }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r)
@@ -8547,7 +9166,10 @@ _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *n
                ndr->depth++;
                ndr_print_string(ndr, "logon_server", r->in.logon_server);
                ndr_print_string(ndr, "computername", r->in.computername);
-               ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
+               ndr_print_ptr(ndr, "credential", r->in.credential);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
                ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
                ndr->depth++;
                ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
@@ -8573,17 +9195,20 @@ _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *n
                ndr->depth--;
                ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
                ndr->depth++;
-               if (r->out.delta_enum_array) {
-                       ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array);
+               ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
+               ndr->depth++;
+               if (*r->out.delta_enum_array) {
+                       ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
                }
                ndr->depth--;
+               ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync *r)
+static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
@@ -8615,18 +9240,17 @@ static NTSTATUS ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, cons
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context));
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array));
-               if (r->out.delta_enum_array) {
-                       NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
+               if (r->out.delta_enum_array == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
+               NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r)
+static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r)
 {
-       uint32_t _ptr_delta_enum_array;
        TALLOC_CTX *_mem_save_return_authenticator_0;
        TALLOC_CTX *_mem_save_sync_context_0;
        TALLOC_CTX *_mem_save_delta_enum_array_0;
@@ -8668,6 +9292,8 @@ static NTSTATUS ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, stru
                *r->out.return_authenticator = *r->in.return_authenticator;
                NDR_PULL_ALLOC(ndr, r->out.sync_context);
                *r->out.sync_context = *r->in.sync_context;
+               NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+               ZERO_STRUCTP(r->out.delta_enum_array);
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -8684,21 +9310,16 @@ static NTSTATUS ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, stru
                NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
-               if (_ptr_delta_enum_array) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
-               } else {
-                       r->out.delta_enum_array = NULL;
-               }
-               if (r->out.delta_enum_array) {
-                       _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0);
-                       NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0);
                }
+               _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r)
@@ -8739,9 +9360,7 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *nam
                ndr->depth--;
                ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
                ndr->depth++;
-               if (r->out.delta_enum_array) {
-                       ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array);
-               }
+               ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array);
                ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
@@ -8749,7 +9368,7 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, const struct netr_AccountDeltas *r)
+static enum ndr_err_code ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, const struct netr_AccountDeltas *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
@@ -8801,10 +9420,10 @@ static NTSTATUS ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, con
                NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, struct netr_AccountDeltas *r)
+static enum ndr_err_code ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, struct netr_AccountDeltas *r)
 {
        uint32_t _ptr_logon_server;
        TALLOC_CTX *_mem_save_logon_server_0;
@@ -8907,7 +9526,7 @@ static NTSTATUS ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, str
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r)
@@ -8967,7 +9586,7 @@ _PUBLIC_ void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const struct netr_AccountSync *r)
+static enum ndr_err_code ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const struct netr_AccountSync *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
@@ -9026,10 +9645,10 @@ static NTSTATUS ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const
                NDR_CHECK(ndr_push_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struct netr_AccountSync *r)
+static enum ndr_err_code ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struct netr_AccountSync *r)
 {
        uint32_t _ptr_logon_server;
        TALLOC_CTX *_mem_save_logon_server_0;
@@ -9148,7 +9767,7 @@ static NTSTATUS ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struc
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r)
@@ -9215,7 +9834,7 @@ _PUBLIC_ void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const struct netr_GetDcName *r)
+static enum ndr_err_code ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const struct netr_GetDcName *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
@@ -9234,25 +9853,25 @@ static NTSTATUS ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const s
                if (r->out.dcname == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               if (*r->out.dcname == NULL) {
-                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
+               if (*r->out.dcname) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
-               NDR_CHECK(ndr_push_ref_ptr(ndr));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
-               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
+               NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct netr_GetDcName *r)
+static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct netr_GetDcName *r)
 {
        uint32_t _ptr_domainname;
        uint32_t _ptr_dcname;
        TALLOC_CTX *_mem_save_domainname_0;
        TALLOC_CTX *_mem_save_dcname_0;
+       TALLOC_CTX *_mem_save_dcname_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9290,18 +9909,28 @@ static NTSTATUS ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct
                }
                _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dcname));
-               NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
-               NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
-               if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) {
-                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname));
-               }
-               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t)));
-               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
+               if (_ptr_dcname) {
+                       NDR_PULL_ALLOC(ndr, *r->out.dcname);
+               } else {
+                       *r->out.dcname = NULL;
+               }
+               if (*r->out.dcname) {
+                       _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
+                       NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
+                       if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
+               }
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
+               NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r)
@@ -9330,16 +9959,18 @@ _PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name,
                ndr->depth++;
                ndr_print_ptr(ndr, "dcname", *r->out.dcname);
                ndr->depth++;
-               ndr_print_string(ndr, "dcname", *r->out.dcname);
+               if (*r->out.dcname) {
+                       ndr_print_string(ndr, "dcname", *r->out.dcname);
+               }
                ndr->depth--;
                ndr->depth--;
-               ndr_print_NTSTATUS(ndr, "result", r->out.result);
+               ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, const struct netr_LogonControl *r)
+static enum ndr_err_code ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, const struct netr_LogonControl *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
@@ -9360,10 +9991,10 @@ static NTSTATUS ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, cons
                NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, struct netr_LogonControl *r)
+static enum ndr_err_code ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, struct netr_LogonControl *r)
 {
        uint32_t _ptr_logon_server;
        TALLOC_CTX *_mem_save_logon_server_0;
@@ -9405,7 +10036,7 @@ static NTSTATUS ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, stru
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r)
@@ -9442,7 +10073,7 @@ _PUBLIC_ void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, const struct netr_GetAnyDCName *r)
+static enum ndr_err_code ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, const struct netr_GetAnyDCName *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
@@ -9464,20 +10095,19 @@ static NTSTATUS ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, cons
                if (r->out.dcname == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               if (*r->out.dcname == NULL) {
-                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
+               if (*r->out.dcname) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
-               NDR_CHECK(ndr_push_ref_ptr(ndr));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16)));
-               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, struct netr_GetAnyDCName *r)
+static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, struct netr_GetAnyDCName *r)
 {
        uint32_t _ptr_logon_server;
        uint32_t _ptr_domainname;
@@ -9485,6 +10115,7 @@ static NTSTATUS ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, stru
        TALLOC_CTX *_mem_save_logon_server_0;
        TALLOC_CTX *_mem_save_domainname_0;
        TALLOC_CTX *_mem_save_dcname_0;
+       TALLOC_CTX *_mem_save_dcname_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9533,18 +10164,28 @@ static NTSTATUS ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, stru
                }
                _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dcname));
-               NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
-               NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
-               if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) {
-                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname));
-               }
-               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t)));
-               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
+               if (_ptr_dcname) {
+                       NDR_PULL_ALLOC(ndr, *r->out.dcname);
+               } else {
+                       *r->out.dcname = NULL;
+               }
+               if (*r->out.dcname) {
+                       _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
+                       NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
+                       if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
+               }
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r)
@@ -9578,7 +10219,9 @@ _PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *nam
                ndr->depth++;
                ndr_print_ptr(ndr, "dcname", *r->out.dcname);
                ndr->depth++;
-               ndr_print_string(ndr, "dcname", *r->out.dcname);
+               if (*r->out.dcname) {
+                       ndr_print_string(ndr, "dcname", *r->out.dcname);
+               }
                ndr->depth--;
                ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
@@ -9587,7 +10230,7 @@ _PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, const struct netr_LogonControl2 *r)
+static enum ndr_err_code ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, const struct netr_LogonControl2 *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
@@ -9599,8 +10242,11 @@ static NTSTATUS ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, con
                }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.function_code));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
-               NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.data, r->in.function_code));
-               NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data));
+               if (r->in.data == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code));
+               NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
        }
        if (flags & NDR_OUT) {
                if (r->out.query == NULL) {
@@ -9610,13 +10256,14 @@ static NTSTATUS ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, con
                NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, struct netr_LogonControl2 *r)
+static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, struct netr_LogonControl2 *r)
 {
        uint32_t _ptr_logon_server;
        TALLOC_CTX *_mem_save_logon_server_0;
+       TALLOC_CTX *_mem_save_data_0;
        TALLOC_CTX *_mem_save_query_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
@@ -9641,8 +10288,14 @@ static NTSTATUS ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, str
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.function_code));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
-               NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.data, r->in.function_code));
-               NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.data);
+               }
+               _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code));
+               NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_PULL_ALLOC(ndr, r->out.query);
                ZERO_STRUCTP(r->out.query);
        }
@@ -9657,7 +10310,7 @@ static NTSTATUS ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, str
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r)
@@ -9678,8 +10331,11 @@ _PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *na
                ndr->depth--;
                ndr_print_uint32(ndr, "function_code", r->in.function_code);
                ndr_print_uint32(ndr, "level", r->in.level);
-               ndr_print_set_switch_value(ndr, &r->in.data, r->in.function_code);
-               ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", &r->in.data);
+               ndr_print_ptr(ndr, "data", r->in.data);
+               ndr->depth++;
+               ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code);
+               ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -9696,7 +10352,7 @@ _PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate2 *r)
+static enum ndr_err_code ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate2 *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -9725,24 +10381,25 @@ static NTSTATUS ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flag
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.negotiate_flags));
        }
        if (flags & NDR_OUT) {
-               if (r->out.credentials == NULL) {
+               if (r->out.return_credentials == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials));
+               NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
                if (r->out.negotiate_flags == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.negotiate_flags));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate2 *r)
+static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate2 *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
        TALLOC_CTX *_mem_save_credentials_0;
+       TALLOC_CTX *_mem_save_return_credentials_0;
        TALLOC_CTX *_mem_save_negotiate_flags_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
@@ -9794,19 +10451,19 @@ static NTSTATUS ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flag
                NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.negotiate_flags));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_PULL_ALLOC(ndr, r->out.credentials);
-               *r->out.credentials = *r->in.credentials;
+               NDR_PULL_ALLOC(ndr, r->out.return_credentials);
+               ZERO_STRUCTP(r->out.return_credentials);
                NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
                *r->out.negotiate_flags = *r->in.negotiate_flags;
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC(ndr, r->out.credentials);
+                       NDR_PULL_ALLOC(ndr, r->out.return_credentials);
                }
-               _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->out.credentials, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.credentials));
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC);
+               _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC);
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->out.negotiate_flags);
                }
@@ -9816,7 +10473,7 @@ static NTSTATUS ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flag
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r)
@@ -9851,9 +10508,9 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const ch
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "netr_ServerAuthenticate2");
                ndr->depth++;
-               ndr_print_ptr(ndr, "credentials", r->out.credentials);
+               ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials);
                ndr->depth++;
-               ndr_print_netr_Credential(ndr, "credentials", r->out.credentials);
+               ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials);
                ndr->depth--;
                ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags);
                ndr->depth++;
@@ -9865,7 +10522,7 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const ch
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync2 *r)
+static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync2 *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
@@ -9876,7 +10533,10 @@ static NTSTATUS ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, con
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16)));
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
                if (r->in.return_authenticator == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
@@ -9898,21 +10558,26 @@ static NTSTATUS ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, con
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context));
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array));
-               if (r->out.delta_enum_array) {
-                       NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
+               if (r->out.delta_enum_array == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array));
+               if (*r->out.delta_enum_array) {
+                       NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
                }
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r)
+static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r)
 {
        uint32_t _ptr_delta_enum_array;
+       TALLOC_CTX *_mem_save_credential_0;
        TALLOC_CTX *_mem_save_return_authenticator_0;
        TALLOC_CTX *_mem_save_sync_context_0;
        TALLOC_CTX *_mem_save_delta_enum_array_0;
+       TALLOC_CTX *_mem_save_delta_enum_array_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9930,7 +10595,13 @@ static NTSTATUS ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, str
                }
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->in.return_authenticator);
                }
@@ -9952,6 +10623,8 @@ static NTSTATUS ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, str
                *r->out.return_authenticator = *r->in.return_authenticator;
                NDR_PULL_ALLOC(ndr, r->out.sync_context);
                *r->out.sync_context = *r->in.sync_context;
+               NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+               ZERO_STRUCTP(r->out.delta_enum_array);
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -9968,21 +10641,27 @@ static NTSTATUS ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, str
                NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+               }
+               _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
                if (_ptr_delta_enum_array) {
-                       NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+                       NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array);
                } else {
-                       r->out.delta_enum_array = NULL;
+                       *r->out.delta_enum_array = NULL;
                }
-               if (r->out.delta_enum_array) {
-                       _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0);
-                       NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0);
+               if (*r->out.delta_enum_array) {
+                       _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0);
+                       NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0);
                }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r)
@@ -9997,7 +10676,10 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *na
                ndr->depth++;
                ndr_print_string(ndr, "logon_server", r->in.logon_server);
                ndr_print_string(ndr, "computername", r->in.computername);
-               ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
+               ndr_print_ptr(ndr, "credential", r->in.credential);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
                ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator);
                ndr->depth++;
                ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
@@ -10024,17 +10706,20 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *na
                ndr->depth--;
                ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
                ndr->depth++;
-               if (r->out.delta_enum_array) {
-                       ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array);
+               ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array);
+               ndr->depth++;
+               if (*r->out.delta_enum_array) {
+                       ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array);
                }
                ndr->depth--;
+               ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, const struct netr_DatabaseRedo *r)
+static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, const struct netr_DatabaseRedo *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16)));
@@ -10062,19 +10747,18 @@ static NTSTATUS ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, cons
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
                NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array));
-               if (r->out.delta_enum_array) {
-                       NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
+               if (r->out.delta_enum_array == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
+               NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r)
+static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r)
 {
        uint32_t _ptr_change_log_entry;
-       uint32_t _ptr_delta_enum_array;
        TALLOC_CTX *_mem_save_return_authenticator_0;
        TALLOC_CTX *_mem_save_change_log_entry_0;
        TALLOC_CTX *_mem_save_delta_enum_array_0;
@@ -10120,6 +10804,8 @@ static NTSTATUS ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, stru
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.change_log_entry_size));
                NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
                *r->out.return_authenticator = *r->in.return_authenticator;
+               NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
+               ZERO_STRUCTP(r->out.delta_enum_array);
                if (r->in.change_log_entry) {
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.change_log_entry, r->in.change_log_entry_size));
                }
@@ -10132,21 +10818,16 @@ static NTSTATUS ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, stru
                NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array));
-               if (_ptr_delta_enum_array) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->out.delta_enum_array);
-               } else {
-                       r->out.delta_enum_array = NULL;
-               }
-               if (r->out.delta_enum_array) {
-                       _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0);
-                       NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0);
                }
+               _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r)
@@ -10184,9 +10865,7 @@ _PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *nam
                ndr->depth--;
                ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array);
                ndr->depth++;
-               if (r->out.delta_enum_array) {
-                       ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array);
-               }
+               ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array);
                ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
@@ -10194,7 +10873,7 @@ _PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, const struct netr_LogonControl2Ex *r)
+static enum ndr_err_code ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, const struct netr_LogonControl2Ex *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server));
@@ -10217,10 +10896,10 @@ static NTSTATUS ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, c
                NDR_CHECK(ndr_push_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, struct netr_LogonControl2Ex *r)
+static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, struct netr_LogonControl2Ex *r)
 {
        uint32_t _ptr_logon_server;
        TALLOC_CTX *_mem_save_logon_server_0;
@@ -10264,7 +10943,7 @@ static NTSTATUS ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, s
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r)
@@ -10303,48 +10982,101 @@ _PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_push *ndr, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINS *r)
+static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomains *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.trusted_domains_blob == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_pull *ndr, int flags, struct netr_NETRENUMERATETRUSTEDDOMAINS *r)
+static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomains *r)
 {
+       uint32_t _ptr_server_name;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_trusted_domains_blob_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob);
+               ZERO_STRUCTP(r->out.trusted_domains_blob);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob);
+               }
+               _mem_save_trusted_domains_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.trusted_domains_blob, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_blob_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINS *r)
+_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r)
 {
-       ndr_print_struct(ndr, name, "netr_NETRENUMERATETRUSTEDDOMAINS");
+       ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomains");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRENUMERATETRUSTEDDOMAINS");
+               ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomains");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
                ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRENUMERATETRUSTEDDOMAINS");
+               ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomains");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "trusted_domains_blob", r->out.trusted_domains_blob);
                ndr->depth++;
+               ndr_print_netr_Blob(ndr, "trusted_domains_blob", r->out.trusted_domains_blob);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCName *r)
+static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCName *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
@@ -10369,19 +11101,22 @@ static NTSTATUS ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, cons
                if (r->in.site_guid) {
                        NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.site_guid));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
+               NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info));
-               if (r->out.info) {
-                       NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+               if (r->out.info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
+               if (*r->out.info) {
+                       NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCName *r)
+static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCName *r)
 {
        uint32_t _ptr_server_unc;
        uint32_t _ptr_domain_name;
@@ -10393,6 +11128,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, stru
        TALLOC_CTX *_mem_save_domain_guid_0;
        TALLOC_CTX *_mem_save_site_guid_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_info_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -10456,24 +11192,32 @@ static NTSTATUS ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, stru
                        NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.site_guid));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_guid_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_PULL_ALLOC(ndr, r->out.info);
+               ZERO_STRUCTP(r->out.info);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.info);
+               }
+               _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
                if (_ptr_info) {
-                       NDR_PULL_ALLOC(ndr, r->out.info);
+                       NDR_PULL_ALLOC(ndr, *r->out.info);
                } else {
-                       r->out.info = NULL;
+                       *r->out.info = NULL;
                }
-               if (r->out.info) {
-                       _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
-                       NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+               if (*r->out.info) {
+                       _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
+                       NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
                }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r)
@@ -10510,7 +11254,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *nam
                        ndr_print_GUID(ndr, "site_guid", r->in.site_guid);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "flags", r->in.flags);
+               ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -10518,34 +11262,37 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *nam
                ndr->depth++;
                ndr_print_ptr(ndr, "info", r->out.info);
                ndr->depth++;
-               if (r->out.info) {
-                       ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info);
+               ndr_print_ptr(ndr, "info", *r->out.info);
+               ndr->depth++;
+               if (*r->out.info) {
+                       ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
                }
                ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONDUMMYROUTINE1(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r)
+static enum ndr_err_code ndr_push_netr_NETRLOGONDUMMYROUTINE1(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONDUMMYROUTINE1(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONDUMMYROUTINE1 *r)
+static enum ndr_err_code ndr_pull_netr_NETRLOGONDUMMYROUTINE1(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONDUMMYROUTINE1 *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r)
@@ -10569,24 +11316,24 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
+static enum ndr_err_code ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSETSERVICEBITS *r)
+static enum ndr_err_code ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSETSERVICEBITS *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r)
@@ -10610,65 +11357,151 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, cons
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONGETTRUSTRID(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTRUSTRID *r)
+static enum ndr_err_code ndr_push_netr_LogonGetTrustRid(struct ndr_push *ndr, int flags, const struct netr_LogonGetTrustRid *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
+               if (r->in.domain_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.rid == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONGETTRUSTRID(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTRUSTRID *r)
+static enum ndr_err_code ndr_pull_netr_LogonGetTrustRid(struct ndr_pull *ndr, int flags, struct netr_LogonGetTrustRid *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t _ptr_domain_name;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_domain_name_0;
+       TALLOC_CTX *_mem_save_rid_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
+               if (_ptr_domain_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.domain_name);
+               } else {
+                       r->in.domain_name = NULL;
+               }
+               if (r->in.domain_name) {
+                       _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
+                       if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
+               }
+               NDR_PULL_ALLOC(ndr, r->out.rid);
+               ZERO_STRUCTP(r->out.rid);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.rid);
+               }
+               _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_NETRLOGONGETTRUSTRID(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTRUSTRID *r)
+_PUBLIC_ void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r)
 {
-       ndr_print_struct(ndr, name, "netr_NETRLOGONGETTRUSTRID");
+       ndr_print_struct(ndr, name, "netr_LogonGetTrustRid");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRLOGONGETTRUSTRID");
+               ndr_print_struct(ndr, "in", "netr_LogonGetTrustRid");
                ndr->depth++;
-               ndr->depth--;
-       }
-       if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRLOGONGETTRUSTRID");
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
                ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
+               ndr->depth++;
+               if (r->in.domain_name) {
+                       ndr_print_string(ndr, "domain_name", r->in.domain_name);
+               }
+               ndr->depth--;
+               ndr->depth--;
+       }
+       if (flags & NDR_OUT) {
+               ndr_print_struct(ndr, "out", "netr_LogonGetTrustRid");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "rid", r->out.rid);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "rid", *r->out.rid);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
+static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
+static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r)
@@ -10692,24 +11525,24 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
+static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
+static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r)
@@ -10733,7 +11566,7 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r)
+static enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -10776,10 +11609,10 @@ static NTSTATUS ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flag
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r)
+static enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
@@ -10867,7 +11700,7 @@ static NTSTATUS ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flag
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r)
@@ -10920,7 +11753,7 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const ch
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx *r)
+static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
@@ -10948,19 +11781,22 @@ static NTSTATUS ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, co
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
+               NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info));
-               if (r->out.info) {
-                       NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+               if (r->out.info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
+               if (*r->out.info) {
+                       NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx *r)
+static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx *r)
 {
        uint32_t _ptr_server_unc;
        uint32_t _ptr_domain_name;
@@ -10972,6 +11808,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, st
        TALLOC_CTX *_mem_save_domain_guid_0;
        TALLOC_CTX *_mem_save_site_name_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_info_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11041,24 +11878,32 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, st
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_PULL_ALLOC(ndr, r->out.info);
+               ZERO_STRUCTP(r->out.info);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.info);
+               }
+               _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
                if (_ptr_info) {
-                       NDR_PULL_ALLOC(ndr, r->out.info);
+                       NDR_PULL_ALLOC(ndr, *r->out.info);
                } else {
-                       r->out.info = NULL;
+                       *r->out.info = NULL;
                }
-               if (r->out.info) {
-                       _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
-                       NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+               if (*r->out.info) {
+                       _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
+                       NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
                }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r)
@@ -11095,7 +11940,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *n
                        ndr_print_string(ndr, "site_name", r->in.site_name);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "flags", r->in.flags);
+               ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -11103,17 +11948,20 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *n
                ndr->depth++;
                ndr_print_ptr(ndr, "info", r->out.info);
                ndr->depth++;
-               if (r->out.info) {
-                       ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info);
+               ndr_print_ptr(ndr, "info", *r->out.info);
+               ndr->depth++;
+               if (*r->out.info) {
+                       ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
                }
                ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, const struct netr_DsRGetSiteName *r)
+static enum ndr_err_code ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, const struct netr_DsRGetSiteName *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name));
@@ -11128,25 +11976,25 @@ static NTSTATUS ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, co
                if (r->out.site == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               if (*r->out.site == NULL) {
-                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.site));
+               if (*r->out.site) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
-               NDR_CHECK(ndr_push_ref_ptr(ndr));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16)));
-               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, struct netr_DsRGetSiteName *r)
+static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, struct netr_DsRGetSiteName *r)
 {
        uint32_t _ptr_computer_name;
        uint32_t _ptr_site;
        TALLOC_CTX *_mem_save_computer_name_0;
        TALLOC_CTX *_mem_save_site_0;
+       TALLOC_CTX *_mem_save_site_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11177,18 +12025,28 @@ static NTSTATUS ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, st
                }
                _mem_save_site_0 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->out.site, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_site));
-               NDR_CHECK(ndr_pull_array_size(ndr, r->out.site));
-               NDR_CHECK(ndr_pull_array_length(ndr, r->out.site));
-               if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) {
-                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site));
-               }
-               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t)));
-               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site));
+               if (_ptr_site) {
+                       NDR_PULL_ALLOC(ndr, *r->out.site);
+               } else {
+                       *r->out.site = NULL;
+               }
+               if (*r->out.site) {
+                       _mem_save_site_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.site, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, r->out.site));
+                       NDR_CHECK(ndr_pull_array_length(ndr, r->out.site));
+                       if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_1, 0);
+               }
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r)
@@ -11216,7 +12074,9 @@ _PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *n
                ndr->depth++;
                ndr_print_ptr(ndr, "site", *r->out.site);
                ndr->depth++;
-               ndr_print_string(ndr, "site", *r->out.site);
+               if (*r->out.site) {
+                       ndr_print_string(ndr, "site", *r->out.site);
+               }
                ndr->depth--;
                ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
@@ -11225,7 +12085,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *n
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags, const struct netr_LogonGetDomainInfo *r)
+static enum ndr_err_code ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags, const struct netr_LogonGetDomainInfo *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
@@ -11263,10 +12123,10 @@ static NTSTATUS ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags
                NDR_CHECK(ndr_push_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags, struct netr_LogonGetDomainInfo *r)
+static enum ndr_err_code ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags, struct netr_LogonGetDomainInfo *r)
 {
        uint32_t _ptr_computer_name;
        TALLOC_CTX *_mem_save_computer_name_0;
@@ -11341,7 +12201,7 @@ static NTSTATUS ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r)
@@ -11392,7 +12252,7 @@ _PUBLIC_ void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet2 *r)
+static enum ndr_err_code ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet2 *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -11421,10 +12281,10 @@ static NTSTATUS ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags
                NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet2 *r)
+static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet2 *r)
 {
        uint32_t _ptr_server_name;
        TALLOC_CTX *_mem_save_server_name_0;
@@ -11480,7 +12340,7 @@ static NTSTATUS ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r)
@@ -11519,65 +12379,179 @@ _PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRSERVERPASSWORDGET(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERPASSWORDGET *r)
+static enum ndr_err_code ndr_push_netr_ServerPasswordGet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordGet *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
        }
        if (flags & NDR_OUT) {
+               if (r->out.return_authenticator == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               if (r->out.password == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRSERVERPASSWORDGET(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERPASSWORDGET *r)
+static enum ndr_err_code ndr_pull_netr_ServerPasswordGet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordGet *r)
 {
+       uint32_t _ptr_server_name;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_credential_0;
+       TALLOC_CTX *_mem_save_return_authenticator_0;
+       TALLOC_CTX *_mem_save_password_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
+               if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
+               if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               ZERO_STRUCTP(r->out.return_authenticator);
+               NDR_PULL_ALLOC(ndr, r->out.password);
+               ZERO_STRUCTP(r->out.password);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               }
+               _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.password);
+               }
+               _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_NETRSERVERPASSWORDGET(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERPASSWORDGET *r)
+_PUBLIC_ void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r)
 {
-       ndr_print_struct(ndr, name, "netr_NETRSERVERPASSWORDGET");
+       ndr_print_struct(ndr, name, "netr_ServerPasswordGet");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRSERVERPASSWORDGET");
+               ndr_print_struct(ndr, "in", "netr_ServerPasswordGet");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_string(ndr, "account_name", r->in.account_name);
+               ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
+               ndr_print_string(ndr, "computer_name", r->in.computer_name);
+               ndr_print_ptr(ndr, "credential", r->in.credential);
                ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRSERVERPASSWORDGET");
+               ndr_print_struct(ndr, "out", "netr_ServerPasswordGet");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "password", r->out.password);
                ndr->depth++;
+               ndr_print_samr_Password(ndr, "password", r->out.password);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
+static enum ndr_err_code ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSENDTOSAM *r)
+static enum ndr_err_code ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSENDTOSAM *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r)
@@ -11601,48 +12575,172 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DSRADDRESSTOSITENAMESW(struct ndr_push *ndr, int flags, const struct netr_DSRADDRESSTOSITENAMESW *r)
+static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesW *r)
 {
+       uint32_t cntr_addresses_1;
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
+               if (r->in.addresses == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
+               }
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.ctr == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
+               if (*r->out.ctr) {
+                       NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
+               }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DSRADDRESSTOSITENAMESW(struct ndr_pull *ndr, int flags, struct netr_DSRADDRESSTOSITENAMESW *r)
+static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesW *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t cntr_addresses_1;
+       uint32_t _ptr_ctr;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_addresses_1;
+       TALLOC_CTX *_mem_save_ctr_0;
+       TALLOC_CTX *_mem_save_ctr_1;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
+               if (r->in.count < 0 || r->in.count > 32000) {
+                       return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses));
+               }
+               _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0);
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
+               }
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0);
+               NDR_PULL_ALLOC(ndr, r->out.ctr);
+               ZERO_STRUCTP(r->out.ctr);
+               if (r->in.addresses) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count));
+               }
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.ctr);
+               }
+               _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
+               if (_ptr_ctr) {
+                       NDR_PULL_ALLOC(ndr, *r->out.ctr);
+               } else {
+                       *r->out.ctr = NULL;
+               }
+               if (*r->out.ctr) {
+                       _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
+                       NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_DSRADDRESSTOSITENAMESW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRADDRESSTOSITENAMESW *r)
+_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r)
 {
-       ndr_print_struct(ndr, name, "netr_DSRADDRESSTOSITENAMESW");
+       uint32_t cntr_addresses_1;
+       ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesW");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_DSRADDRESSTOSITENAMESW");
+               ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesW");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_uint32(ndr, "count", r->in.count);
+               ndr_print_ptr(ndr, "addresses", r->in.addresses);
                ndr->depth++;
+               ndr->print(ndr, "%s: ARRAY(%d)", "addresses", r->in.count);
+               ndr->depth++;
+               for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_addresses_1);
+                       if (idx_1) {
+                               ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_DSRADDRESSTOSITENAMESW");
+               ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesW");
                ndr->depth++;
+               ndr_print_ptr(ndr, "ctr", r->out.ctr);
+               ndr->depth++;
+               ndr_print_ptr(ndr, "ctr", *r->out.ctr);
+               ndr->depth++;
+               if (*r->out.ctr) {
+                       ndr_print_netr_DsRAddressToSitenamesWCtr(ndr, "ctr", *r->out.ctr);
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx2 *r)
+static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx2 *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc));
@@ -11659,7 +12757,7 @@ static NTSTATUS ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, c
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16)));
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_account, ndr_charset_length(r->in.client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.mask));
+               NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.mask));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name));
                if (r->in.domain_name) {
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16)));
@@ -11678,19 +12776,22 @@ static NTSTATUS ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, c
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16)));
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
+               NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info));
-               if (r->out.info) {
-                       NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+               if (r->out.info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
+               if (*r->out.info) {
+                       NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx2 *r)
+static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx2 *r)
 {
        uint32_t _ptr_server_unc;
        uint32_t _ptr_client_account;
@@ -11704,6 +12805,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, s
        TALLOC_CTX *_mem_save_domain_guid_0;
        TALLOC_CTX *_mem_save_site_name_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_info_1;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11743,7 +12845,7 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, s
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_account, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t), CH_UTF16));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.mask));
+               NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.mask));
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
                if (_ptr_domain_name) {
                        NDR_PULL_ALLOC(ndr, r->in.domain_name);
@@ -11792,24 +12894,32 @@ static NTSTATUS ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, s
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_PULL_ALLOC(ndr, r->out.info);
+               ZERO_STRUCTP(r->out.info);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.info);
+               }
+               _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
                if (_ptr_info) {
-                       NDR_PULL_ALLOC(ndr, r->out.info);
+                       NDR_PULL_ALLOC(ndr, *r->out.info);
                } else {
-                       r->out.info = NULL;
+                       *r->out.info = NULL;
                }
-               if (r->out.info) {
-                       _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
-                       NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+               if (*r->out.info) {
+                       _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
+                       NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
                }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r)
@@ -11834,7 +12944,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *
                        ndr_print_string(ndr, "client_account", r->in.client_account);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "mask", r->in.mask);
+               ndr_print_samr_AcctFlags(ndr, "mask", r->in.mask);
                ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
                ndr->depth++;
                if (r->in.domain_name) {
@@ -11853,7 +12963,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *
                        ndr_print_string(ndr, "site_name", r->in.site_name);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "flags", r->in.flags);
+               ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -11861,34 +12971,37 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *
                ndr->depth++;
                ndr_print_ptr(ndr, "info", r->out.info);
                ndr->depth++;
-               if (r->out.info) {
-                       ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info);
+               ndr_print_ptr(ndr, "info", *r->out.info);
+               ndr->depth++;
+               if (*r->out.info) {
+                       ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
                }
                ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
+static enum ndr_err_code ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
+static enum ndr_err_code ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r)
@@ -11912,130 +13025,360 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_prin
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_push *ndr, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r)
+static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.dom_trust_list == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_pull *ndr, int flags, struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r)
+static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomainsEx *r)
 {
+       uint32_t _ptr_server_name;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_dom_trust_list_0;
        if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
-       }
-       return NT_STATUS_OK;
-}
+               ZERO_STRUCT(r->out);
 
-_PUBLIC_ void ndr_print_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r)
-{
-       ndr_print_struct(ndr, name, "netr_NETRENUMERATETRUSTEDDOMAINSEX");
-       ndr->depth++;
-       if (flags & NDR_SET_VALUES) {
-               ndr->flags |= LIBNDR_PRINT_SET_VALUES;
-       }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_PULL_ALLOC(ndr, r->out.dom_trust_list);
+               ZERO_STRUCTP(r->out.dom_trust_list);
+       }
+       if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.dom_trust_list);
+               }
+               _mem_save_dom_trust_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.dom_trust_list, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_trust_list_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r)
+{
+       ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomainsEx");
+       ndr->depth++;
+       if (flags & NDR_SET_VALUES) {
+               ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+       }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRENUMERATETRUSTEDDOMAINSEX");
+               ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomainsEx");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
                ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRENUMERATETRUSTEDDOMAINSEX");
+               ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomainsEx");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "dom_trust_list", r->out.dom_trust_list);
                ndr->depth++;
+               ndr_print_netr_DomainTrustList(ndr, "dom_trust_list", r->out.dom_trust_list);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_push *ndr, int flags, const struct netr_DSRADDRESSTOSITENAMESEXW *r)
+static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesExW *r)
 {
+       uint32_t cntr_addresses_1;
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
+               if (r->in.addresses == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
+               }
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.ctr == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr));
+               if (*r->out.ctr) {
+                       NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
+               }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_pull *ndr, int flags, struct netr_DSRADDRESSTOSITENAMESEXW *r)
+static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesExW *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t cntr_addresses_1;
+       uint32_t _ptr_ctr;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_addresses_1;
+       TALLOC_CTX *_mem_save_ctr_0;
+       TALLOC_CTX *_mem_save_ctr_1;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
+               if (r->in.count < 0 || r->in.count > 32000) {
+                       return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses));
+               }
+               _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0);
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1]));
+               }
+               for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) {
+                       NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1]));
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0);
+               NDR_PULL_ALLOC(ndr, r->out.ctr);
+               ZERO_STRUCTP(r->out.ctr);
+               if (r->in.addresses) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count));
+               }
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.ctr);
+               }
+               _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr));
+               if (_ptr_ctr) {
+                       NDR_PULL_ALLOC(ndr, *r->out.ctr);
+               } else {
+                       *r->out.ctr = NULL;
+               }
+               if (*r->out.ctr) {
+                       _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0);
+                       NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRADDRESSTOSITENAMESEXW *r)
+_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r)
 {
-       ndr_print_struct(ndr, name, "netr_DSRADDRESSTOSITENAMESEXW");
+       uint32_t cntr_addresses_1;
+       ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExW");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_DSRADDRESSTOSITENAMESEXW");
+               ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesExW");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_uint32(ndr, "count", r->in.count);
+               ndr_print_ptr(ndr, "addresses", r->in.addresses);
+               ndr->depth++;
+               ndr->print(ndr, "%s: ARRAY(%d)", "addresses", r->in.count);
                ndr->depth++;
+               for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) {
+                       char *idx_1=NULL;
+                       asprintf(&idx_1, "[%d]", cntr_addresses_1);
+                       if (idx_1) {
+                               ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_DSRADDRESSTOSITENAMESEXW");
+               ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesExW");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "ctr", r->out.ctr);
                ndr->depth++;
+               ndr_print_ptr(ndr, "ctr", *r->out.ctr);
+               ndr->depth++;
+               if (*r->out.ctr) {
+                       ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr, "ctr", *r->out.ctr);
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DSRGETDCSITECOVERAGEW(struct ndr_push *ndr, int flags, const struct netr_DSRGETDCSITECOVERAGEW *r)
+static enum ndr_err_code ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push *ndr, int flags, const struct netr_DsrGetDcSiteCoverageW *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.ctr == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DSRGETDCSITECOVERAGEW(struct ndr_pull *ndr, int flags, struct netr_DSRGETDCSITECOVERAGEW *r)
+static enum ndr_err_code ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull *ndr, int flags, struct netr_DsrGetDcSiteCoverageW *r)
 {
+       uint32_t _ptr_server_name;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_ctr_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_PULL_ALLOC(ndr, r->out.ctr);
+               ZERO_STRUCTP(r->out.ctr);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.ctr);
+               }
+               _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_DSRGETDCSITECOVERAGEW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRGETDCSITECOVERAGEW *r)
+_PUBLIC_ void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r)
 {
-       ndr_print_struct(ndr, name, "netr_DSRGETDCSITECOVERAGEW");
+       ndr_print_struct(ndr, name, "netr_DsrGetDcSiteCoverageW");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_DSRGETDCSITECOVERAGEW");
+               ndr_print_struct(ndr, "in", "netr_DsrGetDcSiteCoverageW");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
                ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_DSRGETDCSITECOVERAGEW");
+               ndr_print_struct(ndr, "out", "netr_DsrGetDcSiteCoverageW");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "ctr", r->out.ctr);
                ndr->depth++;
+               ndr_print_DcSitesCtr(ndr, "ctr", r->out.ctr);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonEx *r)
+static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonEx *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -12053,8 +13396,11 @@ static NTSTATUS ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, c
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.logon_level));
-               NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
-               NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+               if (r->in.logon == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
+               NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
                if (r->in.flags == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
@@ -12077,15 +13423,16 @@ static NTSTATUS ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, c
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonEx *r)
+static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonEx *r)
 {
        uint32_t _ptr_server_name;
        uint32_t _ptr_computer_name;
        TALLOC_CTX *_mem_save_server_name_0;
        TALLOC_CTX *_mem_save_computer_name_0;
+       TALLOC_CTX *_mem_save_logon_0;
        TALLOC_CTX *_mem_save_validation_0;
        TALLOC_CTX *_mem_save_authoritative_0;
        TALLOC_CTX *_mem_save_flags_0;
@@ -12129,8 +13476,14 @@ static NTSTATUS ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, s
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
                }
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.logon_level));
-               NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
-               NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.logon);
+               }
+               _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
+               NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->in.flags);
@@ -12171,7 +13524,7 @@ static NTSTATUS ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, s
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r)
@@ -12197,8 +13550,11 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *
                }
                ndr->depth--;
                ndr_print_uint16(ndr, "logon_level", r->in.logon_level);
-               ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level);
-               ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon);
+               ndr_print_ptr(ndr, "logon", r->in.logon);
+               ndr->depth++;
+               ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
+               ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
+               ndr->depth--;
                ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
                ndr_print_ptr(ndr, "flags", r->in.flags);
                ndr->depth++;
@@ -12228,9 +13584,8 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
+static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
 {
-       uint32_t cntr_trusts_1;
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
                if (r->in.server_name) {
@@ -12242,37 +13597,20 @@ static NTSTATUS ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int
                NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags));
        }
        if (flags & NDR_OUT) {
-               if (r->out.count == NULL) {
-                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-               }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
                if (r->out.trusts == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
-               for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) {
-                       if (r->out.trusts[cntr_trusts_1] == NULL) {
-                               return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-                       }
-                       NDR_CHECK(ndr_push_ref_ptr(ndr));
-               }
-               for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) {
-                       NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts[cntr_trusts_1]));
-               }
+               NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r)
+static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r)
 {
        uint32_t _ptr_server_name;
-       uint32_t _ptr_trusts;
-       uint32_t cntr_trusts_1;
        TALLOC_CTX *_mem_save_server_name_0;
-       TALLOC_CTX *_mem_save_count_0;
-       TALLOC_CTX *_mem_save_trusts_1;
-       TALLOC_CTX *_mem_save_trusts_2;
+       TALLOC_CTX *_mem_save_trusts_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -12295,49 +13633,24 @@ static NTSTATUS ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
                }
                NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->in.trust_flags));
-               NDR_PULL_ALLOC(ndr, r->out.count);
-               ZERO_STRUCTP(r->out.count);
-               NDR_PULL_ALLOC_N(ndr, r->out.trusts, count);
-               memset(r->out.trusts, 0, count * sizeof(*r->out.trusts));
+               NDR_PULL_ALLOC(ndr, r->out.trusts);
+               ZERO_STRUCTP(r->out.trusts);
        }
        if (flags & NDR_OUT) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC(ndr, r->out.count);
-               }
-               _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_array_size(ndr, &r->out.trusts));
-               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC_N(ndr, r->out.trusts, ndr_get_array_size(ndr, &r->out.trusts));
-               }
-               _mem_save_trusts_1 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, 0);
-               for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) {
-                       NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_trusts));
-                       if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                               NDR_PULL_ALLOC(ndr, r->out.trusts[cntr_trusts_1]);
-                       }
-               }
-               for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) {
-                       _mem_save_trusts_2 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts[cntr_trusts_1], LIBNDR_FLAG_REF_ALLOC);
-                       NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts[cntr_trusts_1]));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_2, LIBNDR_FLAG_REF_ALLOC);
+                       NDR_PULL_ALLOC(ndr, r->out.trusts);
                }
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_1, 0);
+               _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
-               if (r->out.trusts) {
-                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.trusts, r->out.count));
-               }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r)
 {
-       uint32_t cntr_trusts_1;
        ndr_print_struct(ndr, name, "netr_DsrEnumerateDomainTrusts");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
@@ -12358,26 +13671,9 @@ _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, con
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "netr_DsrEnumerateDomainTrusts");
                ndr->depth++;
-               ndr_print_ptr(ndr, "count", r->out.count);
-               ndr->depth++;
-               ndr_print_uint32(ndr, "count", *r->out.count);
-               ndr->depth--;
                ndr_print_ptr(ndr, "trusts", r->out.trusts);
                ndr->depth++;
-               ndr->print(ndr, "%s: ARRAY(%d)", "trusts", r->out.count);
-               ndr->depth++;
-               for (cntr_trusts_1=0;cntr_trusts_1<r->out.count;cntr_trusts_1++) {
-                       char *idx_1=NULL;
-                       asprintf(&idx_1, "[%d]", cntr_trusts_1);
-                       if (idx_1) {
-                               ndr_print_ptr(ndr, "trusts", r->out.trusts[cntr_trusts_1]);
-                               ndr->depth++;
-                               ndr_print_netr_DomainTrust(ndr, "trusts", r->out.trusts[cntr_trusts_1]);
-                               ndr->depth--;
-                               free(idx_1);
-                       }
-               }
-               ndr->depth--;
+               ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts);
                ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -12385,40 +13681,172 @@ _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, con
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_push *ndr, int flags, const struct netr_DSRDEREGISTERDNSHOSTRECORDS *r)
+static enum ndr_err_code ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push *ndr, int flags, const struct netr_DsrDeregisterDNSHostRecords *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain));
+               if (r->in.domain) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
+               if (r->in.domain_guid) {
+                       NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_guid));
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dsa_guid));
+               if (r->in.dsa_guid) {
+                       NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dsa_guid));
+               }
+               if (r->in.dns_host == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_host, ndr_charset_length(r->in.dns_host, CH_UTF16), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_pull *ndr, int flags, struct netr_DSRDEREGISTERDNSHOSTRECORDS *r)
+static enum ndr_err_code ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull *ndr, int flags, struct netr_DsrDeregisterDNSHostRecords *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t _ptr_domain;
+       uint32_t _ptr_domain_guid;
+       uint32_t _ptr_dsa_guid;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_domain_0;
+       TALLOC_CTX *_mem_save_domain_guid_0;
+       TALLOC_CTX *_mem_save_dsa_guid_0;
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
+               if (_ptr_domain) {
+                       NDR_PULL_ALLOC(ndr, r->in.domain);
+               } else {
+                       r->in.domain = NULL;
+               }
+               if (r->in.domain) {
+                       _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.domain, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
+                       if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain), ndr_get_array_length(ndr, &r->in.domain));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
+               if (_ptr_domain_guid) {
+                       NDR_PULL_ALLOC(ndr, r->in.domain_guid);
+               } else {
+                       r->in.domain_guid = NULL;
+               }
+               if (r->in.domain_guid) {
+                       _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
+                       NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_guid));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_guid));
+               if (_ptr_dsa_guid) {
+                       NDR_PULL_ALLOC(ndr, r->in.dsa_guid);
+               } else {
+                       r->in.dsa_guid = NULL;
+               }
+               if (r->in.dsa_guid) {
+                       _mem_save_dsa_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.dsa_guid, 0);
+                       NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dsa_guid));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_guid_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_host));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_host));
+               if (ndr_get_array_length(ndr, &r->in.dns_host) > ndr_get_array_size(ndr, &r->in.dns_host)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_host), ndr_get_array_length(ndr, &r->in.dns_host));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_host, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRDEREGISTERDNSHOSTRECORDS *r)
+_PUBLIC_ void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r)
 {
-       ndr_print_struct(ndr, name, "netr_DSRDEREGISTERDNSHOSTRECORDS");
+       ndr_print_struct(ndr, name, "netr_DsrDeregisterDNSHostRecords");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_DSRDEREGISTERDNSHOSTRECORDS");
+               ndr_print_struct(ndr, "in", "netr_DsrDeregisterDNSHostRecords");
                ndr->depth++;
-               ndr->depth--;
-       }
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "domain", r->in.domain);
+               ndr->depth++;
+               if (r->in.domain) {
+                       ndr_print_string(ndr, "domain", r->in.domain);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
+               ndr->depth++;
+               if (r->in.domain_guid) {
+                       ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "dsa_guid", r->in.dsa_guid);
+               ndr->depth++;
+               if (r->in.dsa_guid) {
+                       ndr_print_GUID(ndr, "dsa_guid", r->in.dsa_guid);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "dns_host", r->in.dns_host);
+               ndr->depth++;
+               ndr_print_string(ndr, "dns_host", r->in.dns_host);
+               ndr->depth--;
+               ndr->depth--;
+       }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_DSRDEREGISTERDNSHOSTRECORDS");
+               ndr_print_struct(ndr, "out", "netr_DsrDeregisterDNSHostRecords");
                ndr->depth++;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -12426,130 +13854,501 @@ _PUBLIC_ void ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_print *ndr,
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERTRUSTPASSWORDSGET *r)
+static enum ndr_err_code ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push *ndr, int flags, const struct netr_ServerTrustPasswordsGet *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
+               if (r->out.return_authenticator == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               if (r->out.password == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password));
+               if (r->out.password2 == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password2));
+               NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERTRUSTPASSWORDSGET *r)
+static enum ndr_err_code ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull *ndr, int flags, struct netr_ServerTrustPasswordsGet *r)
 {
+       uint32_t _ptr_server_name;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_credential_0;
+       TALLOC_CTX *_mem_save_return_authenticator_0;
+       TALLOC_CTX *_mem_save_password_0;
+       TALLOC_CTX *_mem_save_password2_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
+               if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
+               if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               ZERO_STRUCTP(r->out.return_authenticator);
+               NDR_PULL_ALLOC(ndr, r->out.password);
+               ZERO_STRUCTP(r->out.password);
+               NDR_PULL_ALLOC(ndr, r->out.password2);
+               ZERO_STRUCTP(r->out.password2);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               }
+               _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.password);
+               }
+               _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.password2);
+               }
+               _mem_save_password2_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.password2, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password2));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password2_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERTRUSTPASSWORDSGET *r)
+_PUBLIC_ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r)
 {
-       ndr_print_struct(ndr, name, "netr_NETRSERVERTRUSTPASSWORDSGET");
+       ndr_print_struct(ndr, name, "netr_ServerTrustPasswordsGet");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRSERVERTRUSTPASSWORDSGET");
+               ndr_print_struct(ndr, "in", "netr_ServerTrustPasswordsGet");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_string(ndr, "account_name", r->in.account_name);
+               ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
+               ndr_print_string(ndr, "computer_name", r->in.computer_name);
+               ndr_print_ptr(ndr, "credential", r->in.credential);
                ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRSERVERTRUSTPASSWORDSGET");
+               ndr_print_struct(ndr, "out", "netr_ServerTrustPasswordsGet");
                ndr->depth++;
-               ndr_print_WERROR(ndr, "result", r->out.result);
+               ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "password", r->out.password);
+               ndr->depth++;
+               ndr_print_samr_Password(ndr, "password", r->out.password);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "password2", r->out.password2);
+               ndr->depth++;
+               ndr_print_samr_Password(ndr, "password2", r->out.password2);
+               ndr->depth--;
+               ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct netr_DSRGETFORESTTRUSTINFORMATION *r)
+static enum ndr_err_code ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_DsRGetForestTrustInformation *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.trusted_domain_name));
+               if (r->in.trusted_domain_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
        }
        if (flags & NDR_OUT) {
+               if (r->out.forest_trust_info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info));
+               if (*r->out.forest_trust_info) {
+                       NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
+               }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct netr_DSRGETFORESTTRUSTINFORMATION *r)
+static enum ndr_err_code ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_DsRGetForestTrustInformation *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t _ptr_trusted_domain_name;
+       uint32_t _ptr_forest_trust_info;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_trusted_domain_name_0;
+       TALLOC_CTX *_mem_save_forest_trust_info_0;
+       TALLOC_CTX *_mem_save_forest_trust_info_1;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name));
+               if (_ptr_trusted_domain_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name);
+               } else {
+                       r->in.trusted_domain_name = NULL;
+               }
+               if (r->in.trusted_domain_name) {
+                       _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name));
+                       if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
+               ZERO_STRUCTP(r->out.forest_trust_info);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
+               }
+               _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info));
+               if (_ptr_forest_trust_info) {
+                       NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info);
+               } else {
+                       *r->out.forest_trust_info = NULL;
+               }
+               if (*r->out.forest_trust_info) {
+                       _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0);
+                       NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRGETFORESTTRUSTINFORMATION *r)
+_PUBLIC_ void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r)
 {
-       ndr_print_struct(ndr, name, "netr_DSRGETFORESTTRUSTINFORMATION");
+       ndr_print_struct(ndr, name, "netr_DsRGetForestTrustInformation");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_DSRGETFORESTTRUSTINFORMATION");
+               ndr_print_struct(ndr, "in", "netr_DsRGetForestTrustInformation");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name);
                ndr->depth++;
+               if (r->in.trusted_domain_name) {
+                       ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name);
+               }
+               ndr->depth--;
+               ndr_print_uint32(ndr, "flags", r->in.flags);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_DSRGETFORESTTRUSTINFORMATION");
+               ndr_print_struct(ndr, "out", "netr_DsRGetForestTrustInformation");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info);
+               ndr->depth++;
+               ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info);
                ndr->depth++;
+               if (*r->out.forest_trust_info) {
+                       ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info);
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct netr_NETRGETFORESTTRUSTINFORMATION *r)
+static enum ndr_err_code ndr_push_netr_GetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_GetForestTrustInformation *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               if (r->in.trusted_domain_name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
        }
        if (flags & NDR_OUT) {
+               if (r->out.return_authenticator == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               if (r->out.forest_trust_info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info));
+               if (*r->out.forest_trust_info) {
+                       NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
+               }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct netr_NETRGETFORESTTRUSTINFORMATION *r)
+static enum ndr_err_code ndr_pull_netr_GetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_GetForestTrustInformation *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t _ptr_forest_trust_info;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_credential_0;
+       TALLOC_CTX *_mem_save_return_authenticator_0;
+       TALLOC_CTX *_mem_save_forest_trust_info_0;
+       TALLOC_CTX *_mem_save_forest_trust_info_1;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name));
+               if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               ZERO_STRUCTP(r->out.return_authenticator);
+               NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
+               ZERO_STRUCTP(r->out.forest_trust_info);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               }
+               _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.forest_trust_info);
+               }
+               _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info));
+               if (_ptr_forest_trust_info) {
+                       NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info);
+               } else {
+                       *r->out.forest_trust_info = NULL;
+               }
+               if (*r->out.forest_trust_info) {
+                       _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0);
+                       NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRGETFORESTTRUSTINFORMATION *r)
+_PUBLIC_ void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r)
 {
-       ndr_print_struct(ndr, name, "netr_NETRGETFORESTTRUSTINFORMATION");
+       ndr_print_struct(ndr, name, "netr_GetForestTrustInformation");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRGETFORESTTRUSTINFORMATION");
+               ndr_print_struct(ndr, "in", "netr_GetForestTrustInformation");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
+               ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name);
                ndr->depth++;
+               ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "credential", r->in.credential);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
+               ndr_print_uint32(ndr, "flags", r->in.flags);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRGETFORESTTRUSTINFORMATION");
+               ndr_print_struct(ndr, "out", "netr_GetForestTrustInformation");
                ndr->depth++;
+               ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info);
+               ndr->depth++;
+               ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info);
+               ndr->depth++;
+               if (*r->out.forest_trust_info) {
+                       ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info);
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonWithFlags *r)
+static enum ndr_err_code ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonWithFlags *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
@@ -12603,10 +14402,10 @@ static NTSTATUS ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int f
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.flags));
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonWithFlags *r)
+static enum ndr_err_code ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonWithFlags *r)
 {
        uint32_t _ptr_server_name;
        uint32_t _ptr_computer_name;
@@ -12737,7 +14536,7 @@ static NTSTATUS ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int f
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r)
@@ -12812,24 +14611,24 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-static NTSTATUS ndr_push_netr_NETRSERVERGETTRUSTINFO(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r)
+static enum ndr_err_code ndr_push_netr_NETRSERVERGETTRUSTINFO(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-static NTSTATUS ndr_pull_netr_NETRSERVERGETTRUSTINFO(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERGETTRUSTINFO *r)
+static enum ndr_err_code ndr_pull_netr_NETRSERVERGETTRUSTINFO(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERGETTRUSTINFO *r)
 {
        if (flags & NDR_IN) {
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_netr_NETRSERVERGETTRUSTINFO(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r)
@@ -13007,11 +14806,11 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_NETRENUMERATETRUSTEDDOMAINS",
-               sizeof(struct netr_NETRENUMERATETRUSTEDDOMAINS),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRENUMERATETRUSTEDDOMAINS,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINS,
-               (ndr_print_function_t) ndr_print_netr_NETRENUMERATETRUSTEDDOMAINS,
+               "netr_NetrEnumerateTrustedDomains",
+               sizeof(struct netr_NetrEnumerateTrustedDomains),
+               (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains,
+               (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains,
                false,
        },
        {
@@ -13039,11 +14838,11 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_NETRLOGONGETTRUSTRID",
-               sizeof(struct netr_NETRLOGONGETTRUSTRID),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTRUSTRID,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTRUSTRID,
-               (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTRUSTRID,
+               "netr_LogonGetTrustRid",
+               sizeof(struct netr_LogonGetTrustRid),
+               (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid,
+               (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid,
                false,
        },
        {
@@ -13103,11 +14902,11 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_NETRSERVERPASSWORDGET",
-               sizeof(struct netr_NETRSERVERPASSWORDGET),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRSERVERPASSWORDGET,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRSERVERPASSWORDGET,
-               (ndr_print_function_t) ndr_print_netr_NETRSERVERPASSWORDGET,
+               "netr_ServerPasswordGet",
+               sizeof(struct netr_ServerPasswordGet),
+               (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet,
+               (ndr_print_function_t) ndr_print_netr_ServerPasswordGet,
                false,
        },
        {
@@ -13119,11 +14918,11 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_DSRADDRESSTOSITENAMESW",
-               sizeof(struct netr_DSRADDRESSTOSITENAMESW),
-               (ndr_push_flags_fn_t) ndr_push_netr_DSRADDRESSTOSITENAMESW,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_DSRADDRESSTOSITENAMESW,
-               (ndr_print_function_t) ndr_print_netr_DSRADDRESSTOSITENAMESW,
+               "netr_DsRAddressToSitenamesW",
+               sizeof(struct netr_DsRAddressToSitenamesW),
+               (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW,
+               (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW,
                false,
        },
        {
@@ -13143,27 +14942,27 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_NETRENUMERATETRUSTEDDOMAINSEX",
-               sizeof(struct netr_NETRENUMERATETRUSTEDDOMAINSEX),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRENUMERATETRUSTEDDOMAINSEX,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINSEX,
-               (ndr_print_function_t) ndr_print_netr_NETRENUMERATETRUSTEDDOMAINSEX,
+               "netr_NetrEnumerateTrustedDomainsEx",
+               sizeof(struct netr_NetrEnumerateTrustedDomainsEx),
+               (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx,
+               (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx,
                false,
        },
        {
-               "netr_DSRADDRESSTOSITENAMESEXW",
-               sizeof(struct netr_DSRADDRESSTOSITENAMESEXW),
-               (ndr_push_flags_fn_t) ndr_push_netr_DSRADDRESSTOSITENAMESEXW,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_DSRADDRESSTOSITENAMESEXW,
-               (ndr_print_function_t) ndr_print_netr_DSRADDRESSTOSITENAMESEXW,
+               "netr_DsRAddressToSitenamesExW",
+               sizeof(struct netr_DsRAddressToSitenamesExW),
+               (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW,
+               (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW,
                false,
        },
        {
-               "netr_DSRGETDCSITECOVERAGEW",
-               sizeof(struct netr_DSRGETDCSITECOVERAGEW),
-               (ndr_push_flags_fn_t) ndr_push_netr_DSRGETDCSITECOVERAGEW,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_DSRGETDCSITECOVERAGEW,
-               (ndr_print_function_t) ndr_print_netr_DSRGETDCSITECOVERAGEW,
+               "netr_DsrGetDcSiteCoverageW",
+               sizeof(struct netr_DsrGetDcSiteCoverageW),
+               (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW,
+               (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW,
                false,
        },
        {
@@ -13183,35 +14982,35 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_DSRDEREGISTERDNSHOSTRECORDS",
-               sizeof(struct netr_DSRDEREGISTERDNSHOSTRECORDS),
-               (ndr_push_flags_fn_t) ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS,
-               (ndr_print_function_t) ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS,
+               "netr_DsrDeregisterDNSHostRecords",
+               sizeof(struct netr_DsrDeregisterDNSHostRecords),
+               (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords,
+               (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords,
                false,
        },
        {
-               "netr_NETRSERVERTRUSTPASSWORDSGET",
-               sizeof(struct netr_NETRSERVERTRUSTPASSWORDSGET),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRSERVERTRUSTPASSWORDSGET,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRSERVERTRUSTPASSWORDSGET,
-               (ndr_print_function_t) ndr_print_netr_NETRSERVERTRUSTPASSWORDSGET,
+               "netr_ServerTrustPasswordsGet",
+               sizeof(struct netr_ServerTrustPasswordsGet),
+               (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet,
+               (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet,
                false,
        },
        {
-               "netr_DSRGETFORESTTRUSTINFORMATION",
-               sizeof(struct netr_DSRGETFORESTTRUSTINFORMATION),
-               (ndr_push_flags_fn_t) ndr_push_netr_DSRGETFORESTTRUSTINFORMATION,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_DSRGETFORESTTRUSTINFORMATION,
-               (ndr_print_function_t) ndr_print_netr_DSRGETFORESTTRUSTINFORMATION,
+               "netr_DsRGetForestTrustInformation",
+               sizeof(struct netr_DsRGetForestTrustInformation),
+               (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation,
+               (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation,
                false,
        },
        {
-               "netr_NETRGETFORESTTRUSTINFORMATION",
-               sizeof(struct netr_NETRGETFORESTTRUSTINFORMATION),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRGETFORESTTRUSTINFORMATION,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRGETFORESTTRUSTINFORMATION,
-               (ndr_print_function_t) ndr_print_netr_NETRGETFORESTTRUSTINFORMATION,
+               "netr_GetForestTrustInformation",
+               sizeof(struct netr_GetForestTrustInformation),
+               (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation,
+               (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation,
                false,
        },
        {