Fix warnings on FreeBSD-based platforms
[ira/wip.git] / source3 / librpc / gen_ndr / ndr_winreg.c
index 811749d7594a2889349b9f2a637d6575bacfb947..053e155616b1121dce9c572fcdd6a623a73c12e1 100644 (file)
@@ -6,39 +6,47 @@
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "librpc/gen_ndr/ndr_initshutdown.h"
 #include "librpc/gen_ndr/ndr_security.h"
-NTSTATUS ndr_push_winreg_AccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+static enum ndr_err_code ndr_push_winreg_AccessMask(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;
 }
 
-NTSTATUS ndr_pull_winreg_AccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+static enum ndr_err_code ndr_pull_winreg_AccessMask(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_winreg_AccessMask(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), "KEY_QUERY_VALUE", KEY_QUERY_VALUE, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_SET_VALUE", KEY_SET_VALUE, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_SUB_KEY", KEY_CREATE_SUB_KEY, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_ENUMERATE_SUB_KEYS", KEY_ENUMERATE_SUB_KEYS, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_NOTIFY", KEY_NOTIFY, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_LINK", KEY_CREATE_LINK, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_64KEY", KEY_WOW64_64KEY, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_32KEY", KEY_WOW64_32KEY, r);
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
+static enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r)
+static enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *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_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r)
@@ -62,12 +70,12 @@ _PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enu
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
 
-_PUBLIC_ NTSTATUS ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
-               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name)*2));
-               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name)*2));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
        }
        if (ndr_flags & NDR_BUFFERS) {
@@ -78,10 +86,10 @@ _PUBLIC_ NTSTATUS ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, co
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ NTSTATUS ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r)
 {
        uint32_t _ptr_name;
        TALLOC_CTX *_mem_save_name_0;
@@ -110,15 +118,15 @@ _PUBLIC_ NTSTATUS ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, st
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r)
 {
        ndr_print_struct(ndr, name, "winreg_String");
        ndr->depth++;
-       ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name)*2:r->name_len);
-       ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name)*2:r->name_size);
+       ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_len);
+       ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_size);
        ndr_print_ptr(ndr, "name", r->name);
        ndr->depth++;
        if (r->name) {
@@ -128,7 +136,7 @@ _PUBLIC_ void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, c
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityData *r)
+static enum ndr_err_code ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityData *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -144,10 +152,10 @@ NTSTATUS ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_flags, const str
                        NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->len));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityData *r)
+static enum ndr_err_code ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityData *r)
 {
        uint32_t _ptr_data;
        TALLOC_CTX *_mem_save_data_0;
@@ -182,7 +190,7 @@ NTSTATUS ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_flags, struct Ke
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->len));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r)
@@ -200,7 +208,7 @@ _PUBLIC_ void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_SecBuf *r)
+static enum ndr_err_code ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_SecBuf *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -211,10 +219,10 @@ NTSTATUS ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_flags, const struc
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sd));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_SecBuf *r)
+static enum ndr_err_code ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_SecBuf *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -225,7 +233,7 @@ NTSTATUS ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_flags, struct winr
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sd));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r)
@@ -238,18 +246,18 @@ _PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, c
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_CreateAction(struct ndr_push *ndr, int ndr_flags, enum winreg_CreateAction r)
+static enum ndr_err_code ndr_push_winreg_CreateAction(struct ndr_push *ndr, int ndr_flags, enum winreg_CreateAction r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_CreateAction(struct ndr_pull *ndr, int ndr_flags, enum winreg_CreateAction *r)
+static enum ndr_err_code ndr_pull_winreg_CreateAction(struct ndr_pull *ndr, int ndr_flags, enum winreg_CreateAction *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_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r)
@@ -264,26 +272,26 @@ _PUBLIC_ void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *n
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
 
-NTSTATUS ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_StringBuf *r)
+static enum ndr_err_code ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_StringBuf *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
-               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term_null(r->name)*2));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term_null(r->name) * 2));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
        }
        if (ndr_flags & NDR_BUFFERS) {
                if (r->name) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size/2));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2));
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term_null(r->name)*2/2));
-                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m_term_null(r->name)*2/2, sizeof(uint16_t), CH_UTF16));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term_null(r->name) * 2 / 2));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m_term_null(r->name) * 2 / 2, sizeof(uint16_t), CH_UTF16));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_StringBuf *r)
+static enum ndr_err_code ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_StringBuf *r)
 {
        uint32_t _ptr_name;
        TALLOC_CTX *_mem_save_name_0;
@@ -311,20 +319,20 @@ NTSTATUS ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr_flags, struct w
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
                }
                if (r->name) {
-                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->name, r->size/2));
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->name, r->size / 2));
                }
                if (r->name) {
-                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->name, r->length/2));
+                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->name, r->length / 2));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r)
 {
        ndr_print_struct(ndr, name, "winreg_StringBuf");
        ndr->depth++;
-       ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term_null(r->name)*2:r->length);
+       ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term_null(r->name) * 2:r->length);
        ndr_print_uint16(ndr, "size", r->size);
        ndr_print_ptr(ndr, "name", r->name);
        ndr->depth++;
@@ -335,7 +343,78 @@ _PUBLIC_ void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityAttribute *r)
+static enum ndr_err_code ndr_push_winreg_ValNameBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_ValNameBuf *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2 / 2));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m_term(r->name) * 2 / 2, sizeof(uint16_t), CH_UTF16));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winreg_ValNameBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_ValNameBuf *r)
+{
+       uint32_t _ptr_name;
+       TALLOC_CTX *_mem_save_name_0;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
+               NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
+               if (_ptr_name) {
+                       NDR_PULL_ALLOC(ndr, r->name);
+               } else {
+                       r->name = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->name) {
+                       _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
+                       if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->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->name), ndr_get_array_length(ndr, &r->name));
+                       }
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
+               }
+               if (r->name) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->name, r->size / 2));
+               }
+               if (r->name) {
+                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->name, r->length / 2));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winreg_ValNameBuf(struct ndr_print *ndr, const char *name, const struct winreg_ValNameBuf *r)
+{
+       ndr_print_struct(ndr, name, "winreg_ValNameBuf");
+       ndr->depth++;
+       ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->length);
+       ndr_print_uint16(ndr, "size", r->size);
+       ndr_print_ptr(ndr, "name", r->name);
+       ndr->depth++;
+       if (r->name) {
+               ndr_print_string(ndr, "name", r->name);
+       }
+       ndr->depth--;
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityAttribute *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -346,10 +425,10 @@ NTSTATUS ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, cons
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityAttribute *r)
+static enum ndr_err_code ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityAttribute *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -360,7 +439,7 @@ NTSTATUS ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int ndr_flags, stru
        if (ndr_flags & NDR_BUFFERS) {
                NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r)
@@ -373,7 +452,7 @@ _PUBLIC_ void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_QueryMultipleValue(struct ndr_push *ndr, int ndr_flags, const struct QueryMultipleValue *r)
+static enum ndr_err_code ndr_push_QueryMultipleValue(struct ndr_push *ndr, int ndr_flags, const struct QueryMultipleValue *r)
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
@@ -387,10 +466,10 @@ NTSTATUS ndr_push_QueryMultipleValue(struct ndr_push *ndr, int ndr_flags, const
                        NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int ndr_flags, struct QueryMultipleValue *r)
+static enum ndr_err_code ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int ndr_flags, struct QueryMultipleValue *r)
 {
        uint32_t _ptr_name;
        TALLOC_CTX *_mem_save_name_0;
@@ -414,7 +493,7 @@ NTSTATUS ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int ndr_flags, struct
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r)
@@ -433,7 +512,7 @@ _PUBLIC_ void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCR *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCR *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -443,14 +522,16 @@ NTSTATUS ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKCR(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCR *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKCR(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCR *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -484,7 +565,7 @@ NTSTATUS ndr_pull_winreg_OpenHKCR(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r)
@@ -519,7 +600,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCU *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCU *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -529,14 +610,16 @@ NTSTATUS ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKCU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCU *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKCU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCU *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -570,7 +653,7 @@ NTSTATUS ndr_pull_winreg_OpenHKCU(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r)
@@ -605,7 +688,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -615,14 +698,16 @@ NTSTATUS ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -656,7 +741,7 @@ NTSTATUS ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r)
@@ -691,7 +776,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPD *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPD *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -701,14 +786,16 @@ NTSTATUS ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKPD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPD *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKPD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPD *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -742,7 +829,7 @@ NTSTATUS ndr_pull_winreg_OpenHKPD(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r)
@@ -777,7 +864,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKU *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKU *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -787,14 +874,16 @@ NTSTATUS ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const struct w
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKU *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKU *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -828,7 +917,7 @@ NTSTATUS ndr_pull_winreg_OpenHKU(struct ndr_pull *ndr, int flags, struct winreg_
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r)
@@ -863,21 +952,25 @@ _PUBLIC_ void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r)
+static enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r)
+static enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
@@ -903,7 +996,7 @@ NTSTATUS ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r)
@@ -935,10 +1028,12 @@ _PUBLIC_ void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r)
+static enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name));
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass));
@@ -954,7 +1049,9 @@ NTSTATUS ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct
                }
        }
        if (flags & NDR_OUT) {
-               if (r->out.new_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.new_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_handle));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.action_taken));
                if (r->out.action_taken) {
@@ -962,10 +1059,10 @@ NTSTATUS ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r)
+static enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r)
 {
        uint32_t _ptr_secdesc;
        uint32_t _ptr_action_taken;
@@ -1036,7 +1133,7 @@ NTSTATUS ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winre
                }
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r)
@@ -1090,20 +1187,22 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r)
+static enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r)
+static enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
@@ -1119,7 +1218,7 @@ NTSTATUS ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winre
        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_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r)
@@ -1148,20 +1247,22 @@ _PUBLIC_ void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_DeleteValue(struct ndr_push *ndr, int flags, const struct winreg_DeleteValue *r)
+static enum ndr_err_code ndr_push_winreg_DeleteValue(struct ndr_push *ndr, int flags, const struct winreg_DeleteValue *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_DeleteValue(struct ndr_pull *ndr, int flags, struct winreg_DeleteValue *r)
+static enum ndr_err_code ndr_pull_winreg_DeleteValue(struct ndr_pull *ndr, int flags, struct winreg_DeleteValue *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
@@ -1177,7 +1278,7 @@ NTSTATUS ndr_pull_winreg_DeleteValue(struct ndr_pull *ndr, int flags, struct win
        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_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r)
@@ -1206,13 +1307,17 @@ _PUBLIC_ void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *na
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r)
+static enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index));
-               if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyclass));
                if (r->in.keyclass) {
@@ -1224,7 +1329,9 @@ NTSTATUS ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct w
                }
        }
        if (flags & NDR_OUT) {
-               if (r->out.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.keyclass));
                if (r->out.keyclass) {
@@ -1236,10 +1343,10 @@ NTSTATUS ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct w
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r)
+static enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r)
 {
        uint32_t _ptr_keyclass;
        uint32_t _ptr_last_changed_time;
@@ -1326,7 +1433,7 @@ NTSTATUS ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_
                }
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r)
@@ -1387,73 +1494,79 @@ _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r)
+static enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index));
-               if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-               NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
+               if (r->in.name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_winreg_ValNameBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type));
                if (r->in.type) {
                        NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type));
                }
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data));
-               if (r->in.data) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.value));
+               if (r->in.value) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size));
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.value_length));
-                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.value_length));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length));
+                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.value, *r->in.length));
                }
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_size));
-               if (r->in.data_size) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.size));
+               if (r->in.size) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size));
                }
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.value_length));
-               if (r->in.value_length) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.value_length));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.length));
+               if (r->in.length) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length));
                }
        }
        if (flags & NDR_OUT) {
-               if (r->out.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-               NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
+               if (r->out.name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_winreg_ValNameBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.type));
                if (r->out.type) {
                        NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type));
                }
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data));
-               if (r->out.data) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.value));
+               if (r->out.value) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size));
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.value_length));
-                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.value_length));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
+                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.value, *r->out.length));
                }
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_size));
-               if (r->out.data_size) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.size));
+               if (r->out.size) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size));
                }
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.value_length));
-               if (r->out.value_length) {
-                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.value_length));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.length));
+               if (r->out.length) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r)
+static enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r)
 {
        uint32_t _ptr_type;
-       uint32_t _ptr_data;
-       uint32_t _ptr_data_size;
-       uint32_t _ptr_value_length;
+       uint32_t _ptr_value;
+       uint32_t _ptr_size;
+       uint32_t _ptr_length;
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_name_0;
        TALLOC_CTX *_mem_save_type_0;
-       TALLOC_CTX *_mem_save_data_0;
-       TALLOC_CTX *_mem_save_data_size_0;
-       TALLOC_CTX *_mem_save_value_length_0;
+       TALLOC_CTX *_mem_save_value_0;
+       TALLOC_CTX *_mem_save_size_0;
+       TALLOC_CTX *_mem_save_length_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -1470,7 +1583,7 @@ NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winre
                }
                _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
+               NDR_CHECK(ndr_pull_winreg_ValNameBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
                if (_ptr_type) {
@@ -1484,57 +1597,57 @@ NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winre
                        NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0);
                }
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
-               if (_ptr_data) {
-                       NDR_PULL_ALLOC(ndr, r->in.data);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value));
+               if (_ptr_value) {
+                       NDR_PULL_ALLOC(ndr, r->in.value);
                } else {
-                       r->in.data = NULL;
-               }
-               if (r->in.data) {
-                       _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->in.data, 0);
-                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data));
-                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.data));
-                       if (ndr_get_array_length(ndr, &r->in.data) > ndr_get_array_size(ndr, &r->in.data)) {
-                               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.data), ndr_get_array_length(ndr, &r->in.data));
+                       r->in.value = NULL;
+               }
+               if (r->in.value) {
+                       _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.value, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.value));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.value));
+                       if (ndr_get_array_length(ndr, &r->in.value) > ndr_get_array_size(ndr, &r->in.value)) {
+                               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.value), ndr_get_array_length(ndr, &r->in.value));
                        }
-                       NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data));
-                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_length(ndr, &r->in.data)));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+                       NDR_PULL_ALLOC_N(ndr, r->in.value, ndr_get_array_size(ndr, &r->in.value));
+                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.value, ndr_get_array_length(ndr, &r->in.value)));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0);
                }
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size));
-               if (_ptr_data_size) {
-                       NDR_PULL_ALLOC(ndr, r->in.data_size);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size));
+               if (_ptr_size) {
+                       NDR_PULL_ALLOC(ndr, r->in.size);
                } else {
-                       r->in.data_size = NULL;
+                       r->in.size = NULL;
                }
-               if (r->in.data_size) {
-                       _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->in.data_size, 0);
-                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_size));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0);
+               if (r->in.size) {
+                       _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.size, 0);
+                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.size));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0);
                }
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value_length));
-               if (_ptr_value_length) {
-                       NDR_PULL_ALLOC(ndr, r->in.value_length);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length));
+               if (_ptr_length) {
+                       NDR_PULL_ALLOC(ndr, r->in.length);
                } else {
-                       r->in.value_length = NULL;
+                       r->in.length = NULL;
                }
-               if (r->in.value_length) {
-                       _mem_save_value_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->in.value_length, 0);
-                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.value_length));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_length_0, 0);
+               if (r->in.length) {
+                       _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.length, 0);
+                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0);
                }
                NDR_PULL_ALLOC(ndr, r->out.name);
                *r->out.name = *r->in.name;
-               if (r->in.data) {
-                       if (r->in.data_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, *r->in.data_size));
+               if (r->in.value) {
+                       if (r->in.size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.value, *r->in.size));
                }
-               if (r->in.data) {
-                       if (r->in.value_length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.data, *r->in.value_length));
+               if (r->in.value) {
+                       if (r->in.length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
+                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.value, *r->in.length));
                }
        }
        if (flags & NDR_OUT) {
@@ -1543,7 +1656,7 @@ NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winre
                }
                _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
+               NDR_CHECK(ndr_pull_winreg_ValNameBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
                if (_ptr_type) {
@@ -1557,59 +1670,59 @@ NTSTATUS ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winre
                        NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0);
                }
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
-               if (_ptr_data) {
-                       NDR_PULL_ALLOC(ndr, r->out.data);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value));
+               if (_ptr_value) {
+                       NDR_PULL_ALLOC(ndr, r->out.value);
                } else {
-                       r->out.data = NULL;
-               }
-               if (r->out.data) {
-                       _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.data, 0);
-                       NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data));
-                       NDR_CHECK(ndr_pull_array_length(ndr, &r->out.data));
-                       if (ndr_get_array_length(ndr, &r->out.data) > ndr_get_array_size(ndr, &r->out.data)) {
-                               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.data), ndr_get_array_length(ndr, &r->out.data));
+                       r->out.value = NULL;
+               }
+               if (r->out.value) {
+                       _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->out.value, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->out.value));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->out.value));
+                       if (ndr_get_array_length(ndr, &r->out.value) > ndr_get_array_size(ndr, &r->out.value)) {
+                               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.value), ndr_get_array_length(ndr, &r->out.value));
                        }
-                       NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data));
-                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_length(ndr, &r->out.data)));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+                       NDR_PULL_ALLOC_N(ndr, r->out.value, ndr_get_array_size(ndr, &r->out.value));
+                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.value, ndr_get_array_length(ndr, &r->out.value)));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0);
                }
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size));
-               if (_ptr_data_size) {
-                       NDR_PULL_ALLOC(ndr, r->out.data_size);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size));
+               if (_ptr_size) {
+                       NDR_PULL_ALLOC(ndr, r->out.size);
                } else {
-                       r->out.data_size = NULL;
+                       r->out.size = NULL;
                }
-               if (r->out.data_size) {
-                       _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.data_size, 0);
-                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_size));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0);
+               if (r->out.size) {
+                       _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->out.size, 0);
+                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0);
                }
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value_length));
-               if (_ptr_value_length) {
-                       NDR_PULL_ALLOC(ndr, r->out.value_length);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length));
+               if (_ptr_length) {
+                       NDR_PULL_ALLOC(ndr, r->out.length);
                } else {
-                       r->out.value_length = NULL;
+                       r->out.length = NULL;
                }
-               if (r->out.value_length) {
-                       _mem_save_value_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->out.value_length, 0);
-                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.value_length));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_length_0, 0);
+               if (r->out.length) {
+                       _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->out.length, 0);
+                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0);
                }
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
-               if (r->out.data) {
-                       if (r->out.data_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, *r->out.data_size));
+               if (r->out.value) {
+                       if (r->out.size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.value, *r->out.size));
                }
-               if (r->out.data) {
-                       if (r->out.value_length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.data, *r->out.value_length));
+               if (r->out.value) {
+                       if (r->out.length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
+                       NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.value, *r->out.length));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r)
@@ -1629,7 +1742,7 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name
                ndr_print_uint32(ndr, "enum_index", r->in.enum_index);
                ndr_print_ptr(ndr, "name", r->in.name);
                ndr->depth++;
-               ndr_print_winreg_StringBuf(ndr, "name", r->in.name);
+               ndr_print_winreg_ValNameBuf(ndr, "name", r->in.name);
                ndr->depth--;
                ndr_print_ptr(ndr, "type", r->in.type);
                ndr->depth++;
@@ -1637,22 +1750,23 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name
                        ndr_print_winreg_Type(ndr, "type", *r->in.type);
                }
                ndr->depth--;
-               ndr_print_ptr(ndr, "data", r->in.data);
+               ndr_print_ptr(ndr, "value", r->in.value);
                ndr->depth++;
-               if (r->in.data) {
-                       ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.value_length);
+               if (r->in.value) {
+                       if (r->in.length == NULL) return;
+                       ndr_print_array_uint8(ndr, "value", r->in.value, *r->in.length);
                }
                ndr->depth--;
-               ndr_print_ptr(ndr, "data_size", r->in.data_size);
+               ndr_print_ptr(ndr, "size", r->in.size);
                ndr->depth++;
-               if (r->in.data_size) {
-                       ndr_print_uint32(ndr, "data_size", *r->in.data_size);
+               if (r->in.size) {
+                       ndr_print_uint32(ndr, "size", *r->in.size);
                }
                ndr->depth--;
-               ndr_print_ptr(ndr, "value_length", r->in.value_length);
+               ndr_print_ptr(ndr, "length", r->in.length);
                ndr->depth++;
-               if (r->in.value_length) {
-                       ndr_print_uint32(ndr, "value_length", *r->in.value_length);
+               if (r->in.length) {
+                       ndr_print_uint32(ndr, "length", *r->in.length);
                }
                ndr->depth--;
                ndr->depth--;
@@ -1662,7 +1776,7 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name
                ndr->depth++;
                ndr_print_ptr(ndr, "name", r->out.name);
                ndr->depth++;
-               ndr_print_winreg_StringBuf(ndr, "name", r->out.name);
+               ndr_print_winreg_ValNameBuf(ndr, "name", r->out.name);
                ndr->depth--;
                ndr_print_ptr(ndr, "type", r->out.type);
                ndr->depth++;
@@ -1670,22 +1784,23 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name
                        ndr_print_winreg_Type(ndr, "type", *r->out.type);
                }
                ndr->depth--;
-               ndr_print_ptr(ndr, "data", r->out.data);
+               ndr_print_ptr(ndr, "value", r->out.value);
                ndr->depth++;
-               if (r->out.data) {
-                       ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.value_length);
+               if (r->out.value) {
+                       if (r->out.length == NULL) return;
+                       ndr_print_array_uint8(ndr, "value", r->out.value, *r->out.length);
                }
                ndr->depth--;
-               ndr_print_ptr(ndr, "data_size", r->out.data_size);
+               ndr_print_ptr(ndr, "size", r->out.size);
                ndr->depth++;
-               if (r->out.data_size) {
-                       ndr_print_uint32(ndr, "data_size", *r->out.data_size);
+               if (r->out.size) {
+                       ndr_print_uint32(ndr, "size", *r->out.size);
                }
                ndr->depth--;
-               ndr_print_ptr(ndr, "value_length", r->out.value_length);
+               ndr_print_ptr(ndr, "length", r->out.length);
                ndr->depth++;
-               if (r->out.value_length) {
-                       ndr_print_uint32(ndr, "value_length", *r->out.value_length);
+               if (r->out.length) {
+                       ndr_print_uint32(ndr, "length", *r->out.length);
                }
                ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
@@ -1694,19 +1809,21 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r)
+static enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r)
+static enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
@@ -1721,7 +1838,7 @@ NTSTATUS ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg
        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_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r)
@@ -1749,24 +1866,30 @@ _PUBLIC_ void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r)
+static enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info));
-               if (r->in.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.sd == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
        }
        if (flags & NDR_OUT) {
-               if (r->out.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.sd == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r)
+static enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_sd_0;
@@ -1801,7 +1924,7 @@ NTSTATUS ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_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_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r)
@@ -1838,10 +1961,12 @@ _PUBLIC_ void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_LoadKey(struct ndr_push *ndr, int flags, const struct winreg_LoadKey *r)
+static enum ndr_err_code ndr_push_winreg_LoadKey(struct ndr_push *ndr, int flags, const struct winreg_LoadKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyname));
                if (r->in.keyname) {
@@ -1855,10 +1980,10 @@ NTSTATUS ndr_push_winreg_LoadKey(struct ndr_push *ndr, int flags, const struct w
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_LoadKey(struct ndr_pull *ndr, int flags, struct winreg_LoadKey *r)
+static enum ndr_err_code ndr_pull_winreg_LoadKey(struct ndr_pull *ndr, int flags, struct winreg_LoadKey *r)
 {
        uint32_t _ptr_keyname;
        uint32_t _ptr_filename;
@@ -1901,7 +2026,7 @@ NTSTATUS ndr_pull_winreg_LoadKey(struct ndr_pull *ndr, int flags, struct winreg_
        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_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r)
@@ -1941,10 +2066,12 @@ _PUBLIC_ void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r)
+static enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.watch_subtree));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.notify_filter));
@@ -1956,10 +2083,10 @@ NTSTATUS ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, c
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r)
+static enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
@@ -1980,7 +2107,7 @@ NTSTATUS ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, s
        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_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r)
@@ -2014,24 +2141,28 @@ _PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r)
+static enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.parent_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.parent_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.parent_handle));
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown));
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r)
+static enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r)
 {
        TALLOC_CTX *_mem_save_parent_handle_0;
        TALLOC_CTX *_mem_save_handle_0;
@@ -2061,7 +2192,7 @@ NTSTATUS ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r)
@@ -2096,39 +2227,61 @@ _PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r)
+static enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
-               if (r->in.classname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.classname == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.classname));
        }
        if (flags & NDR_OUT) {
-               if (r->out.classname == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.classname == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.classname));
-               if (r->out.num_subkeys == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.num_subkeys == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_subkeys));
-               if (r->out.max_subkeylen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.max_subkeylen == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_subkeylen));
-               if (r->out.max_classlen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.max_classlen == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_classlen));
-               if (r->out.num_values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.num_values == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_values));
-               if (r->out.max_valnamelen == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.max_valnamelen == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valnamelen));
-               if (r->out.max_valbufsize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.max_valbufsize == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.max_valbufsize));
-               if (r->out.secdescsize == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.secdescsize == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.secdescsize));
-               if (r->out.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.last_changed_time == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r)
+static enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_classname_0;
@@ -2242,7 +2395,7 @@ NTSTATUS ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct wi
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_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_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r)
@@ -2310,12 +2463,17 @@ _PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *n
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r)
+static enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
-               NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value_name));
+               if (r->in.value_name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type));
                if (r->in.type) {
                        NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type));
@@ -2358,16 +2516,17 @@ NTSTATUS ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struc
                }
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r)
+static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r)
 {
        uint32_t _ptr_type;
        uint32_t _ptr_data;
        uint32_t _ptr_data_size;
        uint32_t _ptr_value_length;
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_value_name_0;
        TALLOC_CTX *_mem_save_type_0;
        TALLOC_CTX *_mem_save_data_0;
        TALLOC_CTX *_mem_save_data_size_0;
@@ -2382,7 +2541,13 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr
                NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value_name));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.value_name);
+               }
+               _mem_save_value_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.value_name, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_name_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
                if (_ptr_type) {
                        NDR_PULL_ALLOC(ndr, r->in.type);
@@ -2438,11 +2603,11 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_length_0, 0);
                }
                if (r->in.data) {
-                       if (r->in.data_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+                       if (r->in.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, *r->in.data_size));
                }
                if (r->in.data) {
-                       if (r->in.value_length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+                       if (r->in.value_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.data, *r->in.value_length));
                }
        }
@@ -2503,15 +2668,15 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr
                }
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
                if (r->out.data) {
-                       if (r->out.data_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+                       if (r->out.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, *r->out.data_size));
                }
                if (r->out.data) {
-                       if (r->out.value_length == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+                       if (r->out.value_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.data, *r->out.value_length));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r)
@@ -2528,7 +2693,10 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
                ndr->depth++;
                ndr_print_policy_handle(ndr, "handle", r->in.handle);
                ndr->depth--;
-               ndr_print_winreg_String(ndr, "value_name", &r->in.value_name);
+               ndr_print_ptr(ndr, "value_name", r->in.value_name);
+               ndr->depth++;
+               ndr_print_winreg_String(ndr, "value_name", r->in.value_name);
+               ndr->depth--;
                ndr_print_ptr(ndr, "type", r->in.type);
                ndr->depth++;
                if (r->in.type) {
@@ -2538,6 +2706,7 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
                ndr_print_ptr(ndr, "data", r->in.data);
                ndr->depth++;
                if (r->in.data) {
+                       if (r->in.value_length == NULL) return;
                        ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.value_length);
                }
                ndr->depth--;
@@ -2567,6 +2736,7 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
                ndr_print_ptr(ndr, "data", r->out.data);
                ndr->depth++;
                if (r->out.data) {
+                       if (r->out.value_length == NULL) return;
                        ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.value_length);
                }
                ndr->depth--;
@@ -2588,24 +2758,24 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_ReplaceKey(struct ndr_push *ndr, int flags, const struct winreg_ReplaceKey *r)
+static enum ndr_err_code ndr_push_winreg_ReplaceKey(struct ndr_push *ndr, int flags, const struct winreg_ReplaceKey *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;
 }
 
-NTSTATUS ndr_pull_winreg_ReplaceKey(struct ndr_pull *ndr, int flags, struct winreg_ReplaceKey *r)
+static enum ndr_err_code ndr_pull_winreg_ReplaceKey(struct ndr_pull *ndr, int flags, struct winreg_ReplaceKey *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_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r)
@@ -2629,22 +2799,26 @@ _PUBLIC_ void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_RestoreKey(struct ndr_push *ndr, int flags, const struct winreg_RestoreKey *r)
+static enum ndr_err_code ndr_push_winreg_RestoreKey(struct ndr_push *ndr, int flags, const struct winreg_RestoreKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
-               if (r->in.filename == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.filename == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_RestoreKey(struct ndr_pull *ndr, int flags, struct winreg_RestoreKey *r)
+static enum ndr_err_code ndr_pull_winreg_RestoreKey(struct ndr_pull *ndr, int flags, struct winreg_RestoreKey *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_filename_0;
@@ -2668,7 +2842,7 @@ NTSTATUS ndr_pull_winreg_RestoreKey(struct ndr_pull *ndr, int flags, struct winr
        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_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r)
@@ -2701,12 +2875,16 @@ _PUBLIC_ void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_SaveKey(struct ndr_push *ndr, int flags, const struct winreg_SaveKey *r)
+static enum ndr_err_code ndr_push_winreg_SaveKey(struct ndr_push *ndr, int flags, const struct winreg_SaveKey *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
-               if (r->in.filename == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.filename == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sec_attrib));
                if (r->in.sec_attrib) {
@@ -2716,10 +2894,10 @@ NTSTATUS ndr_push_winreg_SaveKey(struct ndr_push *ndr, int flags, const struct w
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_SaveKey(struct ndr_pull *ndr, int flags, struct winreg_SaveKey *r)
+static enum ndr_err_code ndr_pull_winreg_SaveKey(struct ndr_pull *ndr, int flags, struct winreg_SaveKey *r)
 {
        uint32_t _ptr_sec_attrib;
        TALLOC_CTX *_mem_save_handle_0;
@@ -2756,7 +2934,7 @@ NTSTATUS ndr_pull_winreg_SaveKey(struct ndr_pull *ndr, int flags, struct winreg_
        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_winreg_SaveKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKey *r)
@@ -2794,30 +2972,30 @@ _PUBLIC_ void ndr_print_winreg_SaveKey(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_SetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_SetKeySecurity *r)
+static enum ndr_err_code ndr_push_winreg_SetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_SetKeySecurity *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
-               if (r->in.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.sd == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
        }
        if (flags & NDR_OUT) {
-               if (r->out.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-               NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_SetKeySecurity *r)
+static enum ndr_err_code ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_SetKeySecurity *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_sd_0;
        if (flags & NDR_IN) {
-               ZERO_STRUCT(r->out);
-
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->in.handle);
                }
@@ -2833,20 +3011,11 @@ NTSTATUS ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct
                NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC);
-               NDR_PULL_ALLOC(ndr, r->out.sd);
-               *r->out.sd = *r->in.sd;
        }
        if (flags & NDR_OUT) {
-               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC(ndr, r->out.sd);
-               }
-               _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->out.sd, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_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_winreg_SetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetKeySecurity *r)
@@ -2873,24 +3042,24 @@ _PUBLIC_ void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "winreg_SetKeySecurity");
                ndr->depth++;
-               ndr_print_ptr(ndr, "sd", r->out.sd);
-               ndr->depth++;
-               ndr_print_KeySecurityData(ndr, "sd", r->out.sd);
-               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_SetValue(struct ndr_push *ndr, int flags, const struct winreg_SetValue *r)
+static enum ndr_err_code ndr_push_winreg_SetValue(struct ndr_push *ndr, int flags, const struct winreg_SetValue *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
                NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name));
                NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type));
-               if (r->in.data == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.data == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size));
                NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.size));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size));
@@ -2898,10 +3067,10 @@ NTSTATUS ndr_push_winreg_SetValue(struct ndr_push *ndr, int flags, const struct
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_SetValue(struct ndr_pull *ndr, int flags, struct winreg_SetValue *r)
+static enum ndr_err_code ndr_pull_winreg_SetValue(struct ndr_pull *ndr, int flags, struct winreg_SetValue *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
@@ -2927,7 +3096,7 @@ NTSTATUS ndr_pull_winreg_SetValue(struct ndr_pull *ndr, int flags, struct winreg
        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_winreg_SetValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetValue *r)
@@ -2962,24 +3131,24 @@ _PUBLIC_ void ndr_print_winreg_SetValue(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_UnLoadKey(struct ndr_push *ndr, int flags, const struct winreg_UnLoadKey *r)
+static enum ndr_err_code ndr_push_winreg_UnLoadKey(struct ndr_push *ndr, int flags, const struct winreg_UnLoadKey *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;
 }
 
-NTSTATUS ndr_pull_winreg_UnLoadKey(struct ndr_pull *ndr, int flags, struct winreg_UnLoadKey *r)
+static enum ndr_err_code ndr_pull_winreg_UnLoadKey(struct ndr_pull *ndr, int flags, struct winreg_UnLoadKey *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_winreg_UnLoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_UnLoadKey *r)
@@ -3003,7 +3172,7 @@ _PUBLIC_ void ndr_print_winreg_UnLoadKey(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_InitiateSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdown *r)
+static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdown *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname));
@@ -3016,15 +3185,15 @@ NTSTATUS ndr_push_winreg_InitiateSystemShutdown(struct ndr_push *ndr, int flags,
                }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
-               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.reboot));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_InitiateSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdown *r)
+static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdown *r)
 {
        uint32_t _ptr_hostname;
        uint32_t _ptr_message;
@@ -3057,12 +3226,12 @@ NTSTATUS ndr_pull_winreg_InitiateSystemShutdown(struct ndr_pull *ndr, int flags,
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps));
-               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.reboot));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot));
        }
        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_winreg_InitiateSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdown *r)
@@ -3089,7 +3258,7 @@ _PUBLIC_ void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, con
                ndr->depth--;
                ndr_print_uint32(ndr, "timeout", r->in.timeout);
                ndr_print_uint8(ndr, "force_apps", r->in.force_apps);
-               ndr_print_uint8(ndr, "reboot", r->in.reboot);
+               ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -3101,7 +3270,7 @@ _PUBLIC_ void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, con
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_AbortSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_AbortSystemShutdown *r)
+static enum ndr_err_code ndr_push_winreg_AbortSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_AbortSystemShutdown *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server));
@@ -3112,10 +3281,10 @@ NTSTATUS ndr_push_winreg_AbortSystemShutdown(struct ndr_push *ndr, int flags, co
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_AbortSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_AbortSystemShutdown *r)
+static enum ndr_err_code ndr_pull_winreg_AbortSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_AbortSystemShutdown *r)
 {
        uint32_t _ptr_server;
        TALLOC_CTX *_mem_save_server_0;
@@ -3136,7 +3305,7 @@ NTSTATUS ndr_pull_winreg_AbortSystemShutdown(struct ndr_pull *ndr, int flags, st
        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_winreg_AbortSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_AbortSystemShutdown *r)
@@ -3166,21 +3335,25 @@ _PUBLIC_ void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r)
+static enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
        }
        if (flags & NDR_OUT) {
-               if (r->out.version == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.version == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.version));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r)
+static enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_version_0;
@@ -3207,7 +3380,7 @@ NTSTATUS ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winr
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_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_winreg_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetVersion *r)
@@ -3239,7 +3412,7 @@ _PUBLIC_ void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *nam
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKCC(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCC *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKCC(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCC *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -3249,14 +3422,16 @@ NTSTATUS ndr_push_winreg_OpenHKCC(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKCC(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCC *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKCC(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCC *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -3290,7 +3465,7 @@ NTSTATUS ndr_pull_winreg_OpenHKCC(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKCC(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCC *r)
@@ -3325,7 +3500,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKCC(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKDD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKDD *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKDD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKDD *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -3335,14 +3510,16 @@ NTSTATUS ndr_push_winreg_OpenHKDD(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKDD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKDD *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKDD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKDD *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -3376,7 +3553,7 @@ NTSTATUS ndr_pull_winreg_OpenHKDD(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKDD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKDD *r)
@@ -3411,13 +3588,17 @@ _PUBLIC_ void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r)
+static enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r)
 {
        uint32_t cntr_values_1;
        if (flags & NDR_IN) {
-               if (r->in.key_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.key_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.key_handle));
-               if (r->in.values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.values == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values));
@@ -3435,11 +3616,15 @@ NTSTATUS ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, co
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.buffer_size));
                        NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, *r->in.buffer_size));
                }
-               if (r->in.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->in.buffer_size == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.buffer_size));
        }
        if (flags & NDR_OUT) {
-               if (r->out.values == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.values == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values));
@@ -3456,14 +3641,16 @@ NTSTATUS ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, co
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size));
                        NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, *r->out.buffer_size));
                }
-               if (r->out.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.buffer_size == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r)
+static enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r)
 {
        uint32_t cntr_values_1;
        uint32_t _ptr_buffer;
@@ -3489,7 +3676,7 @@ NTSTATUS ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, st
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC_N(ndr, r->in.values, ndr_get_array_size(ndr, &r->in.values));
                }
-               memcpy(r->out.values,r->in.values,ndr_get_array_size(ndr, &r->in.values) * sizeof(*r->in.values));
+               memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->in.values) * sizeof(*r->in.values));
                _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->in.values, 0);
                for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) {
@@ -3526,7 +3713,7 @@ NTSTATUS ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, st
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_PULL_ALLOC_N(ndr, r->out.values, r->in.num_values);
-               memcpy(r->out.values, r->in.values, r->in.num_values * sizeof(*r->in.values));
+               memcpy(r->out.values, r->in.values, (r->in.num_values) * sizeof(*r->in.values));
                NDR_PULL_ALLOC(ndr, r->out.buffer_size);
                *r->out.buffer_size = *r->in.buffer_size;
                if (r->in.values) {
@@ -3536,11 +3723,9 @@ NTSTATUS ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, st
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.values, r->in.num_values));
                }
                if (r->in.buffer) {
-                       if (r->in.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, *r->in.buffer_size));
                }
                if (r->in.buffer) {
-                       if (r->in.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.buffer, *r->in.buffer_size));
                }
        }
@@ -3553,7 +3738,7 @@ NTSTATUS ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, st
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC_N(ndr, r->out.values, ndr_get_array_size(ndr, &r->out.values));
                }
-               memcpy(r->out.values,r->in.values,ndr_get_array_size(ndr, &r->out.values) * sizeof(*r->in.values));
+               memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->out.values) * sizeof(*r->in.values));
                _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->out.values, 0);
                for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) {
@@ -3596,15 +3781,13 @@ NTSTATUS ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, st
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.values, r->in.num_values));
                }
                if (r->out.buffer) {
-                       if (r->out.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.buffer_size));
                }
                if (r->out.buffer) {
-                       if (r->out.buffer_size == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
                        NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.buffer_size));
                }
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues *r)
@@ -3624,12 +3807,11 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const
                ndr->depth--;
                ndr_print_ptr(ndr, "values", r->in.values);
                ndr->depth++;
-               ndr->print(ndr, "%s: ARRAY(%d)", "values", r->in.num_values);
+               ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->in.num_values);
                ndr->depth++;
                for (cntr_values_1=0;cntr_values_1<r->in.num_values;cntr_values_1++) {
                        char *idx_1=NULL;
-                       asprintf(&idx_1, "[%d]", cntr_values_1);
-                       if (idx_1) {
+                       if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
                                ndr_print_QueryMultipleValue(ndr, "values", &r->in.values[cntr_values_1]);
                                free(idx_1);
                        }
@@ -3654,12 +3836,11 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const
                ndr->depth++;
                ndr_print_ptr(ndr, "values", r->out.values);
                ndr->depth++;
-               ndr->print(ndr, "%s: ARRAY(%d)", "values", r->in.num_values);
+               ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->in.num_values);
                ndr->depth++;
                for (cntr_values_1=0;cntr_values_1<r->in.num_values;cntr_values_1++) {
                        char *idx_1=NULL;
-                       asprintf(&idx_1, "[%d]", cntr_values_1);
-                       if (idx_1) {
+                       if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
                                ndr_print_QueryMultipleValue(ndr, "values", &r->out.values[cntr_values_1]);
                                free(idx_1);
                        }
@@ -3682,7 +3863,7 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_InitiateSystemShutdownEx(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdownEx *r)
+static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdownEx(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdownEx *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname));
@@ -3695,16 +3876,16 @@ NTSTATUS ndr_push_winreg_InitiateSystemShutdownEx(struct ndr_push *ndr, int flag
                }
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
-               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.reboot));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_InitiateSystemShutdownEx(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdownEx *r)
+static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdownEx(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdownEx *r)
 {
        uint32_t _ptr_hostname;
        uint32_t _ptr_message;
@@ -3737,13 +3918,13 @@ NTSTATUS ndr_pull_winreg_InitiateSystemShutdownEx(struct ndr_pull *ndr, int flag
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps));
-               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.reboot));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason));
        }
        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_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdownEx *r)
@@ -3770,7 +3951,7 @@ _PUBLIC_ void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, c
                ndr->depth--;
                ndr_print_uint32(ndr, "timeout", r->in.timeout);
                ndr_print_uint8(ndr, "force_apps", r->in.force_apps);
-               ndr_print_uint8(ndr, "reboot", r->in.reboot);
+               ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot);
                ndr_print_uint32(ndr, "reason", r->in.reason);
                ndr->depth--;
        }
@@ -3783,24 +3964,24 @@ _PUBLIC_ void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, c
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_SaveKeyEx(struct ndr_push *ndr, int flags, const struct winreg_SaveKeyEx *r)
+static enum ndr_err_code ndr_push_winreg_SaveKeyEx(struct ndr_push *ndr, int flags, const struct winreg_SaveKeyEx *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;
 }
 
-NTSTATUS ndr_pull_winreg_SaveKeyEx(struct ndr_pull *ndr, int flags, struct winreg_SaveKeyEx *r)
+static enum ndr_err_code ndr_pull_winreg_SaveKeyEx(struct ndr_pull *ndr, int flags, struct winreg_SaveKeyEx *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_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKeyEx *r)
@@ -3824,7 +4005,7 @@ _PUBLIC_ void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKPT(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPT *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKPT(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPT *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -3834,14 +4015,16 @@ NTSTATUS ndr_push_winreg_OpenHKPT(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKPT(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPT *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKPT(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPT *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -3875,7 +4058,7 @@ NTSTATUS ndr_pull_winreg_OpenHKPT(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKPT(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPT *r)
@@ -3910,7 +4093,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKPT(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_OpenHKPN(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPN *r)
+static enum ndr_err_code ndr_push_winreg_OpenHKPN(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPN *r)
 {
        if (flags & NDR_IN) {
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -3920,14 +4103,16 @@ NTSTATUS ndr_push_winreg_OpenHKPN(struct ndr_push *ndr, int flags, const struct
                NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
        }
        if (flags & NDR_OUT) {
-               if (r->out.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               if (r->out.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
-       return NT_STATUS_OK;
+       return NDR_ERR_SUCCESS;
 }
 
-NTSTATUS ndr_pull_winreg_OpenHKPN(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPN *r)
+static enum ndr_err_code ndr_pull_winreg_OpenHKPN(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPN *r)
 {
        uint32_t _ptr_system_name;
        TALLOC_CTX *_mem_save_system_name_0;
@@ -3961,7 +4146,7 @@ NTSTATUS ndr_pull_winreg_OpenHKPN(struct ndr_pull *ndr, int flags, struct winreg
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_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_winreg_OpenHKPN(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPN *r)
@@ -3996,24 +4181,24 @@ _PUBLIC_ void ndr_print_winreg_OpenHKPN(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-NTSTATUS ndr_push_winreg_QueryMultipleValues2(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues2 *r)
+static enum ndr_err_code ndr_push_winreg_QueryMultipleValues2(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues2 *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;
 }
 
-NTSTATUS ndr_pull_winreg_QueryMultipleValues2(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues2 *r)
+static enum ndr_err_code ndr_pull_winreg_QueryMultipleValues2(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues2 *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_winreg_QueryMultipleValues2(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues2 *r)
@@ -4037,14 +4222,14 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-const struct dcerpc_interface_call winreg_calls[] = {
+static const struct ndr_interface_call winreg_calls[] = {
        {
                "winreg_OpenHKCR",
                sizeof(struct winreg_OpenHKCR),
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCR,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCR,
                (ndr_print_function_t) ndr_print_winreg_OpenHKCR,
-               False,
+               false,
        },
        {
                "winreg_OpenHKCU",
@@ -4052,7 +4237,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCU,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCU,
                (ndr_print_function_t) ndr_print_winreg_OpenHKCU,
-               False,
+               false,
        },
        {
                "winreg_OpenHKLM",
@@ -4060,7 +4245,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKLM,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKLM,
                (ndr_print_function_t) ndr_print_winreg_OpenHKLM,
-               False,
+               false,
        },
        {
                "winreg_OpenHKPD",
@@ -4068,7 +4253,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPD,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPD,
                (ndr_print_function_t) ndr_print_winreg_OpenHKPD,
-               False,
+               false,
        },
        {
                "winreg_OpenHKU",
@@ -4076,7 +4261,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKU,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKU,
                (ndr_print_function_t) ndr_print_winreg_OpenHKU,
-               False,
+               false,
        },
        {
                "winreg_CloseKey",
@@ -4084,7 +4269,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_CloseKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_CloseKey,
                (ndr_print_function_t) ndr_print_winreg_CloseKey,
-               False,
+               false,
        },
        {
                "winreg_CreateKey",
@@ -4092,7 +4277,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_CreateKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_CreateKey,
                (ndr_print_function_t) ndr_print_winreg_CreateKey,
-               False,
+               false,
        },
        {
                "winreg_DeleteKey",
@@ -4100,7 +4285,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_DeleteKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteKey,
                (ndr_print_function_t) ndr_print_winreg_DeleteKey,
-               False,
+               false,
        },
        {
                "winreg_DeleteValue",
@@ -4108,7 +4293,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_DeleteValue,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteValue,
                (ndr_print_function_t) ndr_print_winreg_DeleteValue,
-               False,
+               false,
        },
        {
                "winreg_EnumKey",
@@ -4116,7 +4301,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_EnumKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumKey,
                (ndr_print_function_t) ndr_print_winreg_EnumKey,
-               False,
+               false,
        },
        {
                "winreg_EnumValue",
@@ -4124,7 +4309,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_EnumValue,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumValue,
                (ndr_print_function_t) ndr_print_winreg_EnumValue,
-               False,
+               false,
        },
        {
                "winreg_FlushKey",
@@ -4132,7 +4317,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_FlushKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_FlushKey,
                (ndr_print_function_t) ndr_print_winreg_FlushKey,
-               False,
+               false,
        },
        {
                "winreg_GetKeySecurity",
@@ -4140,7 +4325,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_GetKeySecurity,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_GetKeySecurity,
                (ndr_print_function_t) ndr_print_winreg_GetKeySecurity,
-               False,
+               false,
        },
        {
                "winreg_LoadKey",
@@ -4148,7 +4333,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_LoadKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_LoadKey,
                (ndr_print_function_t) ndr_print_winreg_LoadKey,
-               False,
+               false,
        },
        {
                "winreg_NotifyChangeKeyValue",
@@ -4156,7 +4341,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_NotifyChangeKeyValue,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_NotifyChangeKeyValue,
                (ndr_print_function_t) ndr_print_winreg_NotifyChangeKeyValue,
-               False,
+               false,
        },
        {
                "winreg_OpenKey",
@@ -4164,7 +4349,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenKey,
                (ndr_print_function_t) ndr_print_winreg_OpenKey,
-               False,
+               false,
        },
        {
                "winreg_QueryInfoKey",
@@ -4172,7 +4357,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_QueryInfoKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryInfoKey,
                (ndr_print_function_t) ndr_print_winreg_QueryInfoKey,
-               False,
+               false,
        },
        {
                "winreg_QueryValue",
@@ -4180,7 +4365,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_QueryValue,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryValue,
                (ndr_print_function_t) ndr_print_winreg_QueryValue,
-               False,
+               false,
        },
        {
                "winreg_ReplaceKey",
@@ -4188,7 +4373,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_ReplaceKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_ReplaceKey,
                (ndr_print_function_t) ndr_print_winreg_ReplaceKey,
-               False,
+               false,
        },
        {
                "winreg_RestoreKey",
@@ -4196,7 +4381,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_RestoreKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_RestoreKey,
                (ndr_print_function_t) ndr_print_winreg_RestoreKey,
-               False,
+               false,
        },
        {
                "winreg_SaveKey",
@@ -4204,7 +4389,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_SaveKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKey,
                (ndr_print_function_t) ndr_print_winreg_SaveKey,
-               False,
+               false,
        },
        {
                "winreg_SetKeySecurity",
@@ -4212,7 +4397,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_SetKeySecurity,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_SetKeySecurity,
                (ndr_print_function_t) ndr_print_winreg_SetKeySecurity,
-               False,
+               false,
        },
        {
                "winreg_SetValue",
@@ -4220,7 +4405,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_SetValue,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_SetValue,
                (ndr_print_function_t) ndr_print_winreg_SetValue,
-               False,
+               false,
        },
        {
                "winreg_UnLoadKey",
@@ -4228,7 +4413,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_UnLoadKey,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_UnLoadKey,
                (ndr_print_function_t) ndr_print_winreg_UnLoadKey,
-               False,
+               false,
        },
        {
                "winreg_InitiateSystemShutdown",
@@ -4236,7 +4421,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdown,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdown,
                (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdown,
-               False,
+               false,
        },
        {
                "winreg_AbortSystemShutdown",
@@ -4244,7 +4429,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_AbortSystemShutdown,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_AbortSystemShutdown,
                (ndr_print_function_t) ndr_print_winreg_AbortSystemShutdown,
-               False,
+               false,
        },
        {
                "winreg_GetVersion",
@@ -4252,7 +4437,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_GetVersion,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_GetVersion,
                (ndr_print_function_t) ndr_print_winreg_GetVersion,
-               False,
+               false,
        },
        {
                "winreg_OpenHKCC",
@@ -4260,7 +4445,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCC,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCC,
                (ndr_print_function_t) ndr_print_winreg_OpenHKCC,
-               False,
+               false,
        },
        {
                "winreg_OpenHKDD",
@@ -4268,7 +4453,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKDD,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKDD,
                (ndr_print_function_t) ndr_print_winreg_OpenHKDD,
-               False,
+               false,
        },
        {
                "winreg_QueryMultipleValues",
@@ -4276,7 +4461,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues,
                (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues,
-               False,
+               false,
        },
        {
                "winreg_InitiateSystemShutdownEx",
@@ -4284,7 +4469,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdownEx,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdownEx,
                (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdownEx,
-               False,
+               false,
        },
        {
                "winreg_SaveKeyEx",
@@ -4292,7 +4477,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_SaveKeyEx,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKeyEx,
                (ndr_print_function_t) ndr_print_winreg_SaveKeyEx,
-               False,
+               false,
        },
        {
                "winreg_OpenHKPT",
@@ -4300,7 +4485,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPT,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPT,
                (ndr_print_function_t) ndr_print_winreg_OpenHKPT,
-               False,
+               false,
        },
        {
                "winreg_OpenHKPN",
@@ -4308,7 +4493,7 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPN,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPN,
                (ndr_print_function_t) ndr_print_winreg_OpenHKPN,
-               False,
+               false,
        },
        {
                "winreg_QueryMultipleValues2",
@@ -4316,39 +4501,39 @@ const struct dcerpc_interface_call winreg_calls[] = {
                (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues2,
                (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues2,
                (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues2,
-               False,
+               false,
        },
-       { NULL, 0, NULL, NULL, NULL, False }
+       { NULL, 0, NULL, NULL, NULL, false }
 };
 
-const char * const winreg_endpoint_strings[] = {
+static const char * const winreg_endpoint_strings[] = {
        "ncacn_np:[\\pipe\\winreg]", 
        "ncacn_ip_tcp:", 
        "ncalrpc:", 
 };
 
-const struct dcerpc_endpoint_list winreg_endpoints = {
+static const struct ndr_interface_string_array winreg_endpoints = {
        .count  = 3,
        .names  = winreg_endpoint_strings
 };
 
-const char * const winreg_authservice_strings[] = {
+static const char * const winreg_authservice_strings[] = {
        "host", 
 };
 
-const struct dcerpc_authservice_list winreg_authservices = {
-       .count  = 3,
+static const struct ndr_interface_string_array winreg_authservices = {
+       .count  = 1,
        .names  = winreg_authservice_strings
 };
 
 
-const struct dcerpc_interface_table dcerpc_table_winreg = {
+const struct ndr_interface_table ndr_table_winreg = {
        .name           = "winreg",
        .syntax_id      = {
                {0x338cd001,0x2244,0x31f1,{0xaa,0xaa},{0x90,0x00,0x38,0x00,0x10,0x03}},
-               DCERPC_WINREG_VERSION
+               NDR_WINREG_VERSION
        },
-       .helpstring     = DCERPC_WINREG_HELPSTRING,
+       .helpstring     = NDR_WINREG_HELPSTRING,
        .num_calls      = 35,
        .calls          = winreg_calls,
        .endpoints      = &winreg_endpoints,