diff options
Diffstat (limited to 'librpc/gen_ndr/ndr_winreg.c')
-rw-r--r-- | librpc/gen_ndr/ndr_winreg.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/librpc/gen_ndr/ndr_winreg.c b/librpc/gen_ndr/ndr_winreg.c index 6f432d37c5..609cc59cc5 100644 --- a/librpc/gen_ndr/ndr_winreg.c +++ b/librpc/gen_ndr/ndr_winreg.c @@ -217,6 +217,32 @@ _PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, c ndr->depth--; } +static enum ndr_err_code ndr_push_winreg_KeyType(struct ndr_push *ndr, int ndr_flags, enum winreg_KeyType r) +{ + NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_KeyType(struct ndr_pull *ndr, int ndr_flags, enum winreg_KeyType *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_KeyType(struct ndr_print *ndr, const char *name, enum winreg_KeyType r) +{ + const char *val = NULL; + + switch (r) { + case REG_KEYTYPE_NON_VOLATILE: val = "REG_KEYTYPE_NON_VOLATILE"; break; + case REG_KEYTYPE_VOLATILE: val = "REG_KEYTYPE_VOLATILE"; break; + case REG_KEYTYPE_SYMLINK: val = "REG_KEYTYPE_SYMLINK"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, 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_enum_uint32(ndr, NDR_SCALARS, r)); @@ -1041,7 +1067,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int f NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); + NDR_CHECK(ndr_push_winreg_KeyType(ndr, NDR_SCALARS, r->in.options)); NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.secdesc)); if (r->in.secdesc) { @@ -1086,7 +1112,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int f 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.name)); NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options)); + NDR_CHECK(ndr_pull_winreg_KeyType(ndr, NDR_SCALARS, &r->in.options)); NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); if (_ptr_secdesc) { @@ -1156,7 +1182,7 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name ndr->depth--; ndr_print_winreg_String(ndr, "name", &r->in.name); ndr_print_winreg_String(ndr, "keyclass", &r->in.keyclass); - ndr_print_uint32(ndr, "options", r->in.options); + ndr_print_winreg_KeyType(ndr, "options", r->in.options); ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); ndr_print_ptr(ndr, "secdesc", r->in.secdesc); ndr->depth++; @@ -2153,7 +2179,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int fla } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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_KeyType(ndr, NDR_SCALARS, r->in.options)); NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { @@ -2181,7 +2207,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int fla NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_winreg_KeyType(ndr, NDR_SCALARS, &r->in.options)); NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); NDR_PULL_ALLOC(ndr, r->out.handle); ZERO_STRUCTP(r->out.handle); @@ -2214,7 +2240,7 @@ _PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, ndr_print_policy_handle(ndr, "parent_handle", r->in.parent_handle); ndr->depth--; ndr_print_winreg_String(ndr, "keyname", &r->in.keyname); - ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_winreg_KeyType(ndr, "options", r->in.options); ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); ndr->depth--; } |