diff options
Diffstat (limited to 'source3/librpc')
-rw-r--r-- | source3/librpc/gen_ndr/cli_unixinfo.c | 16 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_unixinfo.h | 6 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_winreg.c | 82 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_winreg.h | 10 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_winreg.c | 8 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/winreg.h | 2 |
6 files changed, 48 insertions, 76 deletions
diff --git a/source3/librpc/gen_ndr/cli_unixinfo.c b/source3/librpc/gen_ndr/cli_unixinfo.c index 49ac8c8e72..078500a953 100644 --- a/source3/librpc/gen_ndr/cli_unixinfo.c +++ b/source3/librpc/gen_ndr/cli_unixinfo.c @@ -37,7 +37,7 @@ NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c return r.out.result; } -NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t uid, struct dom_sid *sid) +NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t uid, struct dom_sid **sid) { struct unixinfo_UidToSid r; NTSTATUS status; @@ -62,9 +62,7 @@ NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c } /* Return variables */ - if ( sid ) { - *sid = *r.out.sid; - } + *sid = r.out.sid; /* Return result */ return r.out.result; @@ -101,7 +99,7 @@ NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c return r.out.result; } -NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t gid, struct dom_sid *sid) +NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t gid, struct dom_sid **sid) { struct unixinfo_GidToSid r; NTSTATUS status; @@ -126,15 +124,13 @@ NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c } /* Return variables */ - if ( sid ) { - *sid = *r.out.sid; - } + *sid = r.out.sid; /* Return result */ return r.out.result; } -NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo *infos) +NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo **infos) { struct unixinfo_GetPWUid r; NTSTATUS status; @@ -161,7 +157,7 @@ NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c /* Return variables */ *count = *r.out.count; - *infos = *r.out.infos; + *infos = r.out.infos; /* Return result */ return r.out.result; diff --git a/source3/librpc/gen_ndr/cli_unixinfo.h b/source3/librpc/gen_ndr/cli_unixinfo.h index f0f2b54626..1a1683cb37 100644 --- a/source3/librpc/gen_ndr/cli_unixinfo.h +++ b/source3/librpc/gen_ndr/cli_unixinfo.h @@ -2,8 +2,8 @@ #ifndef __CLI_UNIXINFO__ #define __CLI_UNIXINFO__ NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *uid); -NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t uid, struct dom_sid *sid); +NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t uid, struct dom_sid **sid); NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *gid); -NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t gid, struct dom_sid *sid); -NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo *infos); +NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint64_t gid, struct dom_sid **sid); +NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo **infos); #endif /* __CLI_UNIXINFO__ */ diff --git a/source3/librpc/gen_ndr/cli_winreg.c b/source3/librpc/gen_ndr/cli_winreg.c index e8f24f1941..88ea868f60 100644 --- a/source3/librpc/gen_ndr/cli_winreg.c +++ b/source3/librpc/gen_ndr/cli_winreg.c @@ -197,7 +197,7 @@ NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction *action_taken) +NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction **action_taken) { struct winreg_CreateKey r; NTSTATUS status; @@ -209,7 +209,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct r.in.options = options; r.in.access_mask = access_mask; r.in.secdesc = secdesc; - r.in.action_taken = action_taken; + r.in.action_taken = *action_taken; if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r); @@ -229,9 +229,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct /* Return variables */ *new_handle = *r.out.new_handle; - if ( action_taken ) { - *action_taken = *r.out.action_taken; - } + *action_taken = r.out.action_taken; /* Return result */ return werror_to_ntstatus(r.out.result); @@ -299,7 +297,7 @@ NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf *keyclass, NTTIME *last_changed_time) +NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf **keyclass, NTTIME **last_changed_time) { struct winreg_EnumKey r; NTSTATUS status; @@ -308,8 +306,8 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, r.in.handle = handle; r.in.enum_index = enum_index; r.in.name = name; - r.in.keyclass = keyclass; - r.in.last_changed_time = last_changed_time; + r.in.keyclass = *keyclass; + r.in.last_changed_time = *last_changed_time; if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r); @@ -329,18 +327,14 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, /* Return variables */ *name = *r.out.name; - if ( keyclass ) { - *keyclass = *r.out.keyclass; - } - if ( last_changed_time ) { - *last_changed_time = *r.out.last_changed_time; - } + *keyclass = r.out.keyclass; + *last_changed_time = r.out.last_changed_time; /* Return result */ return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length) +NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, enum winreg_Type **type, uint8_t **data, uint32_t **data_size, uint32_t **value_length) { struct winreg_EnumValue r; NTSTATUS status; @@ -349,10 +343,10 @@ NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct r.in.handle = handle; r.in.enum_index = enum_index; r.in.name = name; - r.in.type = type; - r.in.data = data; - r.in.data_size = data_size; - r.in.value_length = value_length; + r.in.type = *type; + r.in.data = *data; + r.in.data_size = *data_size; + r.in.value_length = *value_length; if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(winreg_EnumValue, &r); @@ -372,18 +366,10 @@ NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct /* Return variables */ *name = *r.out.name; - if ( type ) { - *type = *r.out.type; - } - if ( data ) { - *data = *r.out.data; - } - if ( data_size ) { - *data_size = *r.out.data_size; - } - if ( value_length ) { - *value_length = *r.out.value_length; - } + *type = r.out.type; + *data = r.out.data; + *data_size = r.out.data_size; + *value_length = r.out.value_length; /* Return result */ return werror_to_ntstatus(r.out.result); @@ -594,7 +580,7 @@ NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length) +NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type **type, uint8_t **data, uint32_t **data_size, uint32_t **value_length) { struct winreg_QueryValue r; NTSTATUS status; @@ -602,10 +588,10 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c /* In parameters */ r.in.handle = handle; r.in.value_name = value_name; - r.in.type = type; - r.in.data = data; - r.in.data_size = data_size; - r.in.value_length = value_length; + r.in.type = *type; + r.in.data = *data; + r.in.data_size = *data_size; + r.in.value_length = *value_length; if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r); @@ -624,18 +610,10 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c } /* Return variables */ - if ( type ) { - *type = *r.out.type; - } - if ( data ) { - *data = *r.out.data; - } - if ( data_size ) { - *data_size = *r.out.data_size; - } - if ( value_length ) { - *value_length = *r.out.value_length; - } + *type = r.out.type; + *data = r.out.data; + *data_size = r.out.data_size; + *value_length = r.out.value_length; /* Return result */ return werror_to_ntstatus(r.out.result); @@ -989,7 +967,7 @@ NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *key_handle, struct QueryMultipleValue *values, uint32_t num_values, uint8_t *buffer, uint32_t *buffer_size) +NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *key_handle, struct QueryMultipleValue *values, uint32_t num_values, uint8_t **buffer, uint32_t *buffer_size) { struct winreg_QueryMultipleValues r; NTSTATUS status; @@ -998,7 +976,7 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_C r.in.key_handle = key_handle; r.in.values = values; r.in.num_values = num_values; - r.in.buffer = buffer; + r.in.buffer = *buffer; r.in.buffer_size = buffer_size; if (DEBUGLEVEL >= 10) @@ -1019,9 +997,7 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_C /* Return variables */ *values = *r.out.values; - if ( buffer ) { - *buffer = *r.out.buffer; - } + *buffer = r.out.buffer; *buffer_size = *r.out.buffer_size; /* Return result */ diff --git a/source3/librpc/gen_ndr/cli_winreg.h b/source3/librpc/gen_ndr/cli_winreg.h index d6df871c9a..0e451f5145 100644 --- a/source3/librpc/gen_ndr/cli_winreg.h +++ b/source3/librpc/gen_ndr/cli_winreg.h @@ -7,18 +7,18 @@ NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle); NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle); NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle); -NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction *action_taken); +NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction **action_taken); NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String key); NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value); -NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf *keyclass, NTTIME *last_changed_time); -NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length); +NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf **keyclass, NTTIME **last_changed_time); +NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, enum winreg_Type **type, uint8_t **data, uint32_t **data_size, uint32_t **value_length); NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle); NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t sec_info, struct KeySecurityData *sd); NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *keyname, struct winreg_String *filename); NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint8_t watch_subtree, uint32_t notify_filter, uint32_t unknown, struct winreg_String string1, struct winreg_String string2, uint32_t unknown2); NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *parent_handle, struct winreg_String keyname, uint32_t unknown, uint32_t access_mask, struct policy_handle *handle); NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *classname, uint32_t *num_subkeys, uint32_t *max_subkeylen, uint32_t *max_classlen, uint32_t *num_values, uint32_t *max_valnamelen, uint32_t *max_valbufsize, uint32_t *secdescsize, NTTIME *last_changed_time); -NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length); +NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type **type, uint8_t **data, uint32_t **data_size, uint32_t **value_length); NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *filename, uint32_t flags); NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *filename, struct KeySecurityAttribute *sec_attrib); @@ -30,7 +30,7 @@ NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli, TALLOC_C NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *version); NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle); NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle); -NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *key_handle, struct QueryMultipleValue *values, uint32_t num_values, uint8_t *buffer, uint32_t *buffer_size); +NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *key_handle, struct QueryMultipleValue *values, uint32_t num_values, uint8_t **buffer, uint32_t *buffer_size); NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *hostname, struct initshutdown_String *message, uint32_t timeout, uint8_t force_apps, uint8_t reboot, uint32_t reason); NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle); diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c index c7a91afad8..811749d759 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_term(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)); } @@ -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_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)); + 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; @@ -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_term(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++; diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h index 8b2e4c5151..87ba27e623 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_term(name)*2)] */ + uint16_t length;/* [value(strlen_m_term_null(name)*2)] */ uint16_t size; const char *name;/* [unique,length_is(length/2),charset(UTF16),size_is(size/2)] */ }; |