diff options
Diffstat (limited to 'librpc/gen_ndr/ndr_winreg.c')
-rw-r--r-- | librpc/gen_ndr/ndr_winreg.c | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/librpc/gen_ndr/ndr_winreg.c b/librpc/gen_ndr/ndr_winreg.c index e28e9ac7f0..21d97b8756 100644 --- a/librpc/gen_ndr/ndr_winreg.c +++ b/librpc/gen_ndr/ndr_winreg.c @@ -5,6 +5,7 @@ #include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_misc.h" 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)); @@ -34,41 +35,6 @@ _PUBLIC_ void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *nam ndr->depth--; } -_PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r) -{ - NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ 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_enum_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r) -{ - const char *val = NULL; - - switch (r) { - case REG_NONE: val = "REG_NONE"; break; - case REG_SZ: val = "REG_SZ"; break; - case REG_EXPAND_SZ: val = "REG_EXPAND_SZ"; break; - case REG_BINARY: val = "REG_BINARY"; break; - case REG_DWORD: val = "REG_DWORD"; break; - case REG_DWORD_BIG_ENDIAN: val = "REG_DWORD_BIG_ENDIAN"; break; - case REG_LINK: val = "REG_LINK"; break; - case REG_MULTI_SZ: val = "REG_MULTI_SZ"; break; - case REG_RESOURCE_LIST: val = "REG_RESOURCE_LIST"; break; - case REG_FULL_RESOURCE_DESCRIPTOR: val = "REG_FULL_RESOURCE_DESCRIPTOR"; break; - case REG_RESOURCE_REQUIREMENTS_LIST: val = "REG_RESOURCE_REQUIREMENTS_LIST"; break; - case REG_QWORD: val = "REG_QWORD"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, 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) { @@ -76,6 +42,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_ 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)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -102,6 +69,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_ } else { r->name = NULL; } + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -142,6 +110,7 @@ static enum ndr_err_code ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_ NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->data) { @@ -168,6 +137,7 @@ static enum ndr_err_code ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_ } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->data) { @@ -214,6 +184,7 @@ static enum ndr_err_code ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_fl NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sd)); NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sd)); @@ -228,6 +199,7 @@ static enum ndr_err_code ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_fl NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sd)); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit)); + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sd)); @@ -278,6 +250,7 @@ static enum ndr_err_code ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr 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)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -304,6 +277,7 @@ static enum ndr_err_code ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr } else { r->name = NULL; } + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -349,6 +323,7 @@ static enum ndr_err_code ndr_push_winreg_ValNameBuf(struct ndr_push *ndr, int nd 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)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -375,6 +350,7 @@ static enum ndr_err_code ndr_pull_winreg_ValNameBuf(struct ndr_pull *ndr, int nd } else { r->name = NULL; } + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -445,6 +421,7 @@ static enum ndr_err_code ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_size)); NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data)); NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data)); @@ -459,6 +436,7 @@ static enum ndr_err_code ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_size)); NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data)); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit)); + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data)); @@ -484,6 +462,7 @@ static enum ndr_err_code ndr_push_QueryMultipleValue(struct ndr_push *ndr, int n NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->offset)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { @@ -508,6 +487,7 @@ static enum ndr_err_code ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int n NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->offset)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->name) { |