mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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 ed95fe3c63
)
This commit is contained in:
parent
f799df03d4
commit
99cf1bef10
@ -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++;
|
||||
|
@ -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)] */
|
||||
};
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user