_PUBLIC_ enum ndr_err_code ndr_pull_FILE_NOTIFY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, struct FILE_NOTIFY_INFORMATION *r) { uint32_t size_FileName1_0 = 0; { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->NextEntryOffset)); NDR_CHECK(ndr_pull_FILE_NOTIFY_ACTION(ndr, NDR_SCALARS, &r->Action)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->FileNameLength)); { uint32_t _flags_save_uint16 = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM); size_FileName1_0 = r->FileNameLength; NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->FileName1, size_FileName1_0, sizeof(uint16_t), CH_UTF16)); ndr->flags = _flags_save_uint16; } NDR_CHECK(ndr_pull_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience,0))); { uint32_t _flags_save_PAC_INFO = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info)); ndr->flags = _flags_save_PAC_INFO; } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); } if (ndr_flags & NDR_BUFFERS) { { uint32_t _flags_save_PAC_INFO = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); if (r->info) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->info)); { struct ndr_push *_ndr_info; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience, 0))); NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->info, r->type)); NDR_CHECK(ndr_push_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience,0))); } NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->info)); } ndr->flags = _flags_save_PAC_INFO; } } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_push_witness_notifyResponse(struct ndr_push *ndr, int ndr_flags, const struct witness_notifyResponse *r) { uint32_t cntr_messages_0; { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_witness_notifyResponse_type(ndr, NDR_SCALARS, r->type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_witness_notifyResponse(r, ndr->flags) - 20)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->messages)); if (r->messages) { uint32_t _flags_save_witness_notifyResponse_message = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); { struct ndr_push *_ndr_messages; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_messages, 4, ndr_size_witness_notifyResponse(r, ndr->flags) - 20)); for (cntr_messages_0 = 0; cntr_messages_0 < (r->num); cntr_messages_0++) { NDR_CHECK(ndr_push_set_switch_value(_ndr_messages, &r->messages[cntr_messages_0], r->type)); NDR_CHECK(ndr_push_witness_notifyResponse_message(_ndr_messages, NDR_SCALARS, &r->messages[cntr_messages_0])); } NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_messages, 4, ndr_size_witness_notifyResponse(r, ndr->flags) - 20)); } ndr->flags = _flags_save_witness_notifyResponse_message; } NDR_CHECK(ndr_push_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size)); { uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info)); ndr->flags = _flags_save_DATA_BLOB_REM; } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); } if (ndr_flags & NDR_BUFFERS) { { uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); if (r->info) { NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info)); { struct ndr_push *_ndr_info; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); } } ndr->flags = _flags_save_DATA_BLOB_REM; } } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_push_TRUSTED_DOM_PASS(struct ndr_push *ndr, int ndr_flags, const struct TRUSTED_DOM_PASS *r) { { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->uni_name))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->uni_name, 32, sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->pass))); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pass)); ndr->flags = _flags_save_string; } NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->mod_time)); NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->domain_sid)); NDR_CHECK(ndr_push_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r) { uint32_t _ptr_info; TALLOC_CTX *_mem_save_info_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size)); { uint32_t _flags_save_PAC_INFO = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { NDR_PULL_ALLOC(ndr, r->info); NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info)); } else { r->info = NULL; } ndr->flags = _flags_save_PAC_INFO; } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad)); } if (ndr_flags & NDR_BUFFERS) { { uint32_t _flags_save_PAC_INFO = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); if (r->info) { uint32_t _relative_save_offset; _relative_save_offset = ndr->offset; NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info)); _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); { struct ndr_pull *_ndr_info_pad; struct ndr_pull *_ndr_info; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info_pad, 0, NDR_ROUND(r->_ndr_size, 8))); NDR_CHECK(ndr_pull_subcontext_start(_ndr_info_pad, &_ndr_info, 0, r->_ndr_size)); NDR_CHECK(ndr_pull_set_switch_value(_ndr_info, r->info, r->type)); NDR_CHECK(ndr_pull_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info)); NDR_CHECK(ndr_pull_subcontext_end(_ndr_info_pad, _ndr_info, 0, r->_ndr_size)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info_pad, 0, NDR_ROUND(r->_ndr_size, 8))); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); if (ndr->offset > ndr->relative_highest_offset) { ndr->relative_highest_offset = ndr->offset; } ndr->offset = _relative_save_offset; } ndr->flags = _flags_save_PAC_INFO; } } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_witness_notifyResponse(struct ndr_pull *ndr, int ndr_flags, struct witness_notifyResponse *r) { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); NDR_PULL_CHECK_FLAGS(ndr, ndr_flags); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_witness_notifyResponse_type(ndr, NDR_SCALARS, &r->type)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num)); { uint32_t _flags_save_witness_notifyResponse_message = ndr->flags; uint32_t _ptr_messages; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_messages)); if (_ptr_messages) { NDR_PULL_ALLOC(ndr, r->messages); } else { r->messages = NULL; } if (r->messages) { uint32_t size_messages_0 = 0; uint32_t cntr_messages_0; TALLOC_CTX *_mem_save_messages_0; size_messages_0 = r->num; NDR_PULL_ALLOC_N(ndr, r->messages, size_messages_0); _mem_save_messages_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->messages, 0); { struct ndr_pull *_ndr_messages; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_messages, 4, r->length)); for (cntr_messages_0 = 0; cntr_messages_0 < (size_messages_0); cntr_messages_0++) { NDR_CHECK(ndr_pull_set_switch_value(_ndr_messages, &r->messages[cntr_messages_0], r->type)); NDR_CHECK(ndr_pull_witness_notifyResponse_message(_ndr_messages, NDR_SCALARS, &r->messages[cntr_messages_0])); } NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_messages, 4, r->length)); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_messages_0, 0); } ndr->flags = _flags_save_witness_notifyResponse_message; } NDR_CHECK(ndr_pull_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_push_xattr_DOSATTRIB(struct ndr_push *ndr, int ndr_flags, const struct xattr_DOSATTRIB *r) { if (ndr_flags & NDR_SCALARS) { char *attrib_hex = NULL; attrib_hex = ndr_compat_xattr_attrib_hex(ndr, r); NDR_ERR_HAVE_NO_MEMORY(attrib_hex); NDR_CHECK(ndr_push_align(ndr, 4)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, attrib_hex)); ndr->flags = _flags_save_string; } if (r->version == 0xFFFF) { return NDR_ERR_SUCCESS; } NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version)); NDR_CHECK(ndr_push_xattr_DosInfo(ndr, NDR_SCALARS, &r->info)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_bkup_NTBackupFile(struct ndr_pull *ndr, int ndr_flags, struct bkup_NTBackupFile *r) { uint32_t cntr_streams_0; { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { uint32_t remaining = ndr->data_size - ndr->offset; r->num_stream = 0; r->streams = NULL; for (cntr_streams_0 = 0; remaining > 0; cntr_streams_0++) { r->num_stream += 1; _TMP_PULL_REALLOC_N(ndr, r->streams, struct bkup_Win32StreamId, r->num_stream); NDR_CHECK(ndr_pull_bkup_Win32StreamId(ndr, NDR_SCALARS, &r->streams[cntr_streams_0])); remaining = ndr->data_size - ndr->offset; } } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; }
static enum ndr_err_code ndr_pull_frsapi_Info(struct ndr_pull *ndr, int ndr_flags, struct frsapi_Info *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length2)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); NDR_CHECK(ndr_pull_frsapi_InfoEnum(ndr, NDR_SCALARS, &r->level)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->query_counter)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->offset)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->blob_len)); { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); { struct ndr_pull *_ndr_blob; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_blob, 0, r->length - r->offset)); NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_blob, NDR_SCALARS, &r->blob)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_blob, 0, r->length - r->offset)); } ndr->flags = _flags_save_DATA_BLOB; } NDR_CHECK(ndr_pull_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_dnsp_DnssrvRpcRecord(struct ndr_pull *ndr, int ndr_flags, struct dnsp_DnssrvRpcRecord *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->wDataLength)); NDR_CHECK(ndr_pull_dns_record_type(ndr, NDR_SCALARS, &r->wType)); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->version)); NDR_CHECK(ndr_pull_dns_record_rank(ndr, NDR_SCALARS, &r->rank)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dwSerial)); { uint32_t _flags_save_uint32 = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dwTtlSeconds)); ndr->flags = _flags_save_uint32; } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dwReserved)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dwTimeStamp)); NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->data, r->wType)); NDR_CHECK(ndr_pull_dnsRecordData(ndr, NDR_SCALARS, &r->data)); NDR_CHECK(ndr_pull_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
/* Manually modified to handle the dom_sid being optional based on if it is present (size is non-zero) or not */ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->request_count)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); ndr->flags = _flags_save_string; } { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); ndr->flags = _flags_save_string; } { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); ndr->flags = _flags_save_string; } NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_control)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size)); if (r->sid_size) { uint32_t _flags_save_DATA_BLOB = ndr->flags; struct ndr_pull *_ndr_sid; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); ndr->flags = _flags_save_DATA_BLOB; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size)); NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size)); } else { ZERO_STRUCT(r->sid); } NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r) { { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type)); { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->signature)); ndr->flags = _flags_save_DATA_BLOB; } } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
_PUBLIC_ void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r) { ndr_print_struct(ndr, name, "PAC_SIGNATURE_DATA"); { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); ndr->depth++; ndr_print_uint32(ndr, "type", r->type); ndr_print_DATA_BLOB(ndr, "signature", r->signature); ndr->depth--; ndr->flags = _flags_save_STRUCT; } }
_PUBLIC_ enum ndr_err_code ndr_push_FILE_NOTIFY_INFORMATION(struct ndr_push *ndr, int ndr_flags, const struct FILE_NOTIFY_INFORMATION *r) { { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->NextEntryOffset)); NDR_CHECK(ndr_push_FILE_NOTIFY_ACTION(ndr, NDR_SCALARS, r->Action)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->FileName1) * 2)); { uint32_t _flags_save_uint16 = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->FileName1, strlen_m(r->FileName1) * 2, sizeof(uint16_t), CH_UTF16)); ndr->flags = _flags_save_uint16; } NDR_CHECK(ndr_push_trailer_align(ndr, 4)); } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
static enum ndr_err_code ndr_pull_DATA_BLOB_REM(struct ndr_pull *ndr, int ndr_flags, struct DATA_BLOB_REM *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); ndr->flags = _flags_save_DATA_BLOB; } } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
static enum ndr_err_code ndr_pull_xattr_EA(struct ndr_pull *ndr, int ndr_flags, struct xattr_EA *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); ndr->flags = _flags_save_string; } NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
_PUBLIC_ void ndr_print_FILE_NOTIFY_INFORMATION(struct ndr_print *ndr, const char *name, const struct FILE_NOTIFY_INFORMATION *r) { ndr_print_struct(ndr, name, "FILE_NOTIFY_INFORMATION"); if (r == NULL) { ndr_print_null(ndr); return; } { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); ndr->depth++; ndr_print_uint32(ndr, "NextEntryOffset", r->NextEntryOffset); ndr_print_FILE_NOTIFY_ACTION(ndr, "Action", r->Action); ndr_print_uint32(ndr, "FileNameLength", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->FileName1) * 2:r->FileNameLength); ndr_print_string(ndr, "FileName1", r->FileName1); ndr->depth--; ndr->flags = _flags_save_STRUCT; } }
_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattr(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattr *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); ndr->flags = _flags_save_string; } NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
/* Manually modified to only pull some parts of the structure if certain flags provided */ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r, uint32_t nt_version_flags) { { uint32_t _flags_save_STRUCT = ndr->flags; ZERO_STRUCTP(r); ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain_name)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); if (nt_version_flags & NETLOGON_NT_VERSION_5EX_WITH_IP) { NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size)); { struct ndr_pull *_ndr_sockaddr; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size)); NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS|NDR_BUFFERS, &r->sockaddr)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size)); } } if (nt_version_flags & NETLOGON_NT_VERSION_WITH_CLOSEST_SITE) { NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site)); } NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); if (r->nt_version != nt_version_flags) { return NDR_ERR_VALIDATE; } NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_pull_GUID(ndr, NDR_BUFFERS, &r->domain_uuid)); } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_notify_event(struct ndr_pull *ndr, int ndr_flags, struct notify_event *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 8)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->action)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path)); ndr->flags = _flags_save_string; } NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->private_data)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
_PUBLIC_ void ndr_print_TRUSTED_DOM_PASS(struct ndr_print *ndr, const char *name, const struct TRUSTED_DOM_PASS *r) { ndr_print_struct(ndr, name, "TRUSTED_DOM_PASS"); { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); ndr->depth++; ndr_print_uint32(ndr, "uni_name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->uni_name):r->uni_name_len); ndr_print_string(ndr, "uni_name", r->uni_name); ndr_print_uint32(ndr, "pass_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->pass):r->pass_len); ndr_print_string(ndr, "pass", r->pass); ndr_print_time_t(ndr, "mod_time", r->mod_time); ndr_print_dom_sid(ndr, "domain_sid", &r->domain_sid); ndr->depth--; ndr->flags = _flags_save_STRUCT; } }
static enum ndr_err_code ndr_pull_xattr_DosStream(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStream *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); ndr->flags = _flags_save_string; } } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }
_PUBLIC_ void ndr_print_winreg_Data(struct ndr_print *ndr, const char *name, const union winreg_Data *r) { int level; { uint32_t _flags_save_UNION = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); level = ndr_print_get_switch_value(ndr, r); ndr_print_union(ndr, name, level, "winreg_Data"); switch (level) { case REG_NONE: break; case REG_SZ: ndr_print_string(ndr, "string", r->string); break; case REG_EXPAND_SZ: ndr_print_string(ndr, "string", r->string); break; case REG_BINARY: ndr_print_DATA_BLOB(ndr, "binary", r->binary); break; case REG_DWORD: ndr_print_uint32(ndr, "value", r->value); break; case REG_DWORD_BIG_ENDIAN: ndr_print_uint32(ndr, "value", r->value); break; case REG_MULTI_SZ: ndr_print_string_array(ndr, "string_array", r->string_array); break; default: ndr_print_DATA_BLOB(ndr, "data", r->data); break; } ndr->flags = _flags_save_UNION; } }
_PUBLIC_ enum ndr_err_code ndr_push_bkup_NTBackupFile(struct ndr_push *ndr, int ndr_flags, const struct bkup_NTBackupFile *r) { uint32_t cntr_streams_0; { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 2)); for (cntr_streams_0 = 0; cntr_streams_0 < r->num_stream; cntr_streams_0++) { NDR_CHECK(ndr_push_bkup_Win32StreamId(ndr, NDR_SCALARS, &r->streams[cntr_streams_0])); } NDR_CHECK(ndr_push_trailer_align(ndr, 8)); } if (ndr_flags & NDR_BUFFERS) { } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int ndr_flags, struct ntprinting_printer *r) { uint32_t _ptr_devmode; TALLOC_CTX *_mem_save_devmode_0; { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 5)); NDR_CHECK(ndr_pull_ntprinting_printer_info(ndr, NDR_SCALARS, &r->info)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); if (_ptr_devmode) { NDR_PULL_ALLOC(ndr, r->devmode); } else { r->devmode = NULL; } } if (ndr_flags & NDR_BUFFERS) { if (r->devmode) { _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); NDR_CHECK(ndr_pull_ntprinting_devicemode(ndr, NDR_SCALARS|NDR_BUFFERS, r->devmode)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); } } if (ndr_flags & NDR_SCALARS) { r->count = 0; NDR_PULL_ALLOC_N(ndr, r->printer_data, r->count); while (ndr->offset + 4 <= ndr->data_size) { uint32_t ptr = 0; ptr = IVAL(ndr->data, ndr->offset); if (ptr == 0) { break; } r->printer_data = talloc_realloc(ndr, r->printer_data, struct ntprinting_printer_data, r->count + 1); NDR_ERR_HAVE_NO_MEMORY(r->printer_data); NDR_CHECK(ndr_pull_ntprinting_printer_data(ndr, NDR_SCALARS, &r->printer_data[r->count])); r->count++; } NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } ndr->flags = _flags_save_STRUCT; }
enum ndr_err_code ndr_push_BSTR(struct ndr_push *ndr, int ndr_flags, const struct BSTR *r) { uint32_t len; uint32_t flags; enum ndr_err_code status; len = strlen(r->data); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x72657355)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, len)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2*len)); flags = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM | LIBNDR_FLAG_STR_SIZE4); status = ndr_push_string(ndr, NDR_SCALARS, r->data); ndr->flags = flags; return status; } return NDR_ERR_SUCCESS; }
NTSTATUS ndr_push_BSTR(struct ndr_push *ndr, int ndr_flags, const BSTR *r) { uint32_t len; uint32_t flags; NTSTATUS status; len = strlen(*r); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x72657355)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, len)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2*len)); flags = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM | LIBNDR_FLAG_STR_SIZE4); status = ndr_push_string(ndr, NDR_SCALARS, *r); ndr->flags = flags; return status; } return NT_STATUS_OK; }
_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r) { { uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 5)); NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision)); NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type)); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid)); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid)); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl)); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl)); NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { if (r->owner_sid) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->owner_sid)); NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->owner_sid)); } if (r->group_sid) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->group_sid)); NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->group_sid)); } if (r->sacl) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->sacl)); NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->sacl)); } if (r->dacl) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dacl)); NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dacl)); } } ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; }
_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DOSATTRIB(struct ndr_pull *ndr, int ndr_flags, struct xattr_DOSATTRIB *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->attrib_hex)); ndr->flags = _flags_save_string; } if (ndr->offset >= ndr->data_size) { unsigned int dosattr; int ret; if (r->attrib_hex[0] != '0') { } if (r->attrib_hex[1] != 'x') { } ret = sscanf(r->attrib_hex, "%x", &dosattr); if (ret != 1) { } r->version = 0xFFFF; r->info.compatinfoFFFF.attrib = dosattr; return NDR_ERR_SUCCESS; } NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); if (r->version == 0xFFFF) { return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "ndr_pull_xattr_DOSATTRIB: " "invalid level 0x%02X", r->version); } NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version)); NDR_CHECK(ndr_pull_xattr_DosInfo(ndr, NDR_SCALARS, &r->info)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; }