diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-10-15 14:47:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:28 -0500 |
commit | 99cf1bef108c7236b8181325633d643be0902bd3 (patch) | |
tree | c3110e0071b1a635a683171afd76f60ff9a6a18d /source3 | |
parent | f799df03d4899ce9a8e6c5b025424501ceb17c1f (diff) | |
download | samba-99cf1bef108c7236b8181325633d643be0902bd3.tar.gz samba-99cf1bef108c7236b8181325633d643be0902bd3.tar.bz2 samba-99cf1bef108c7236b8181325633d643be0902bd3.zip |
r19290: regedit running on nt4 will cut off the last character from a enumkey without
this patch. Jerry, Jelmer, can you please check this?
Thanks,
Volker
(This used to be commit ed95fe3c63d48de9504d43f90e72f11ec0617064)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/librpc/gen_ndr/ndr_winreg.c | 8 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/winreg.h | 2 | ||||
-rw-r--r-- | source3/librpc/idl/winreg.idl | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c index 67fd9f52c5..c7a91afad8 100644 --- a/source3/librpc/gen_ndr/ndr_winreg.c +++ b/source3/librpc/gen_ndr/ndr_winreg.c @@ -268,7 +268,7 @@ NTSTATUS ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const st { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(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, r->size)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); } @@ -276,8 +276,8 @@ NTSTATUS ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const st 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(r->name)*2/2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m(r->name)*2/2, sizeof(uint16_t), CH_UTF16)); + 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 NT_STATUS_OK; @@ -324,7 +324,7 @@ _PUBLIC_ void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name { ndr_print_struct(ndr, name, "winreg_StringBuf"); ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->name)*2:r->length); + 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++; diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h index 24ed2e55f8..2379a7493e 100644 --- a/source3/librpc/gen_ndr/winreg.h +++ b/source3/librpc/gen_ndr/winreg.h @@ -48,7 +48,7 @@ enum winreg_CreateAction { }; struct winreg_StringBuf { - uint16_t length;/* [value(strlen_m(name)*2)] */ + uint16_t length;/* [value(strlen_m_term(name)*2)] */ uint16_t size; const char *name;/* [unique,length_is(length/2),charset(UTF16),size_is(size/2)] */ }; diff --git a/source3/librpc/idl/winreg.idl b/source3/librpc/idl/winreg.idl index 5178e3c7a7..13e3dcfc50 100644 --- a/source3/librpc/idl/winreg.idl +++ b/source3/librpc/idl/winreg.idl @@ -131,7 +131,7 @@ ); typedef struct { - [value(strlen_m(name)*2)] uint16 length; + [value(strlen_m_term(name)*2)] uint16 length; /* size cannot be auto-set by value() as it is the amount of space the server is allowed to use for this string in the reply, not its current size */ |