Esempio n. 1
0
enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
{
	if (ndr_flags & NDR_SCALARS) {
		uint32_t decompressed_length = 0;
		uint32_t compressed_length = 0;
		if (r->ts) {
			{
				struct ndr_push *_ndr_ts;
				NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
				{
					struct ndr_push *_ndr_ts_compressed;
					NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
					NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
					decompressed_length = _ndr_ts_compressed->offset;
					NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
				}
				compressed_length = _ndr_ts->offset;
				talloc_free(_ndr_ts);
			}
		}
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
	}
	if (ndr_flags & NDR_BUFFERS) {
		if (r->ts) {
			{
				struct ndr_push *_ndr_ts;
				NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
				{
					struct ndr_push *_ndr_ts_compressed;
					NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
					NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
					NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
				}
				NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
			}
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 2
0
_PUBLIC_ enum ndr_err_code ndr_push_pcap_data(struct ndr_push *ndr, int ndr_flags, const struct pcap_data *r)
{
    uint32_t cntr_printers_0;
    if (ndr_flags & NDR_SCALARS) {
        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
        NDR_CHECK(ndr_push_align(ndr, 5));
        NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
        for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
            NDR_CHECK(ndr_push_pcap_printer(ndr, NDR_SCALARS, &r->printers[cntr_printers_0]));
        }
        NDR_CHECK(ndr_push_trailer_align(ndr, 5));
    }
    if (ndr_flags & NDR_BUFFERS) {
        for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
            NDR_CHECK(ndr_push_pcap_printer(ndr, NDR_BUFFERS, &r->printers[cntr_printers_0]));
        }
    }
    return NDR_ERR_SUCCESS;
}
Esempio n. 3
0
_PUBLIC_ enum ndr_err_code ndr_push_PERF_COUNTER_DEFINITION(struct ndr_push *ndr, int ndr_flags, const struct PERF_COUNTER_DEFINITION *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ByteLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterNameTitleIndex));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterNameTitlePointer));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterHelpTitleIndex));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterHelpTitlePointer));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DefaultScale));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DetailLevel));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterType));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterSize));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CounterOffset));
		NDR_CHECK(ndr_push_trailer_align(ndr, 4));
	}
	if (ndr_flags & NDR_BUFFERS) {
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 4
0
_PUBLIC_ enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r)
{
	uint32_t cntr_aces_0;
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_security_acl_revision(ndr, NDR_SCALARS, r->revision));
		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_acl(r, ndr->iconv_convenience, ndr->flags)));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aces));
		for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) {
			NDR_CHECK(ndr_push_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0]));
		}
		NDR_CHECK(ndr_push_trailer_align(ndr, 4));
	}
	if (ndr_flags & NDR_BUFFERS) {
		for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) {
			NDR_CHECK(ndr_push_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0]));
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 5
0
_PUBLIC_ enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 5));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_security_descriptor(r->sd, ndr->iconv_convenience, ndr->flags)));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd));
		NDR_CHECK(ndr_push_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		if (r->sd) {
			{
				struct ndr_push *_ndr_sd;
				NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sd, 4, -1));
				NDR_CHECK(ndr_push_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd));
				NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sd, 4, -1));
			}
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 6
0
_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;
}
Esempio n. 7
0
_PUBLIC_ enum ndr_err_code ndr_push_PERF_INSTANCE_DEFINITION(struct ndr_push *ndr, int ndr_flags, const struct PERF_INSTANCE_DEFINITION *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 5));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ByteLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ParentObjectTitleIndex));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ParentObjectTitlePointer));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->UniqueID));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->NameOffset));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->NameLength));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
		NDR_CHECK(ndr_push_PERF_COUNTER_BLOCK(ndr, NDR_SCALARS, &r->counter_data));
		NDR_CHECK(ndr_push_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		if (r->data) {
			NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->data));
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 8
0
_PUBLIC_ enum ndr_err_code ndr_push_notify_entry(struct ndr_push *ndr, int ndr_flags, const struct notify_entry *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 8));
		NDR_CHECK(ndr_push_server_id(ndr, NDR_SCALARS, &r->server));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->filter));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->subdir_filter));
		{
			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->path));
			ndr->flags = _flags_save_string;
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->path_len));
		NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->private_data));
	}
	if (ndr_flags & NDR_BUFFERS) {
		NDR_CHECK(ndr_push_server_id(ndr, NDR_BUFFERS, &r->server));
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 9
0
_PUBLIC_ enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const 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_push_align(ndr, 4));
			NDR_CHECK(ndr_push_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_push_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;
}
Esempio n. 10
0
/* Modified to call AuthenticationInformationArray with 'count' specified */
_PUBLIC_ enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
		NDR_CHECK(ndr_push_relative_ptr1(ndr, r->current));
		NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous));
	}
	if (ndr_flags & NDR_BUFFERS) {
		if (r->current) {
			NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->current));
			NDR_CHECK(ndr_push_AuthenticationInformationArray_with_count(ndr, NDR_SCALARS|NDR_BUFFERS, r->count, r->current));
			NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->current));
		}
		if (r->previous) {
			NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->previous));
			NDR_CHECK(ndr_push_AuthenticationInformationArray_with_count(ndr, NDR_SCALARS|NDR_BUFFERS, r->count, r->previous));
			NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->previous));
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 11
0
_PUBLIC_ enum ndr_err_code ndr_push_PERF_DATA_BLOCK(struct ndr_push *ndr, int ndr_flags, const struct PERF_DATA_BLOCK *r)
{
	uint32_t cntr_Signature_0;
	uint32_t cntr_objects_0;
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 8));
		for (cntr_Signature_0 = 0; cntr_Signature_0 < 4; cntr_Signature_0++) {
			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature[cntr_Signature_0]));
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->LittleEndian));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Version));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Revision));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->TotalByteLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->HeaderLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->NumObjectTypes));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DefaultObject));
		NDR_CHECK(ndr_push_SYSTEMTIME(ndr, NDR_SCALARS, &r->SystemTime));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Padding));
		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->PerfTime));
		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->PerfFreq));
		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->PerfTime100nSec));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SystemNameLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SystemNameOffset));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
		for (cntr_objects_0 = 0; cntr_objects_0 < r->NumObjectTypes; cntr_objects_0++) {
			NDR_CHECK(ndr_push_PERF_OBJECT_TYPE(ndr, NDR_SCALARS, &r->objects[cntr_objects_0]));
		}
		NDR_CHECK(ndr_push_trailer_align(ndr, 8));
	}
	if (ndr_flags & NDR_BUFFERS) {
		if (r->data) {
			NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->data));
		}
		for (cntr_objects_0 = 0; cntr_objects_0 < r->NumObjectTypes; cntr_objects_0++) {
			NDR_CHECK(ndr_push_PERF_OBJECT_TYPE(ndr, NDR_BUFFERS, &r->objects[cntr_objects_0]));
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 12
0
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,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_pad;
					struct ndr_push *_ndr_info;
					size_t _ndr_size = _ndr_size_PAC_INFO(r->info, r->type, 0);
					NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info_pad, 0, NDR_ROUND(_ndr_size, 8)));
					NDR_CHECK(ndr_push_subcontext_start(_ndr_info_pad, &_ndr_info, 0, _ndr_size));
					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_info_pad, _ndr_info, 0, _ndr_size));
					NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info_pad, 0, NDR_ROUND(_ndr_size, 8)));
				}
				NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->info));
			}
			ndr->flags = _flags_save_PAC_INFO;
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 13
0
static enum ndr_err_code ndr_push_xattr_DosInfo2Old(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo2Old *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size));
		NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
		NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
		NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time));
		NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time));
		NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->write_time));
		{
			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;
		}
	}
	if (ndr_flags & NDR_BUFFERS) {
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 14
0
_PUBLIC_ NTSTATUS ndr_push_WbemQualifier(struct ndr_push *ndr, int ndr_flags, const struct WbemQualifier *r)
{
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 4));
            	NDR_CHECK(ndr_push_relative_ptr1(ndr, r->name));
                NDR_CHECK(ndr_push_WBEM_FLAVOR_TYPE(ndr, NDR_SCALARS, r->flavors));
                NDR_CHECK(ndr_push_CIMTYPE_ENUMERATION(ndr, NDR_SCALARS, r->cimtype));
                NDR_CHECK(ndr_push_set_switch_value(ndr, &r->value, r->cimtype & CIM_TYPEMASK));
                NDR_CHECK(ndr_push_CIMVAR(ndr, NDR_SCALARS, &r->value));
        }
        if (ndr_flags & NDR_BUFFERS) {
                if (r->name) {
			uint32_t ofs;
			int32_t i;
			for (i = 0; i < arr_sizeof(qualifier_keys); ++i)
				if (qualifier_keys[i] && !strcmp(r->name, qualifier_keys[i])) break;
			if (i == arr_sizeof(qualifier_keys)) {
				if (!strncmp(qn_unknown, r->name, sizeof(qn_unknown) - 1))
                            		i = atoi(r->name + sizeof(qn_unknown) - 1);
				else
					i = -1;
			}
			if (i >= 0) {
				ofs = ndr->offset;
				NDR_CHECK(ndr_token_retrieve(&ndr->relative_list, r->name, &ndr->offset));
				NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x80000000 | i));
				ndr->offset = ofs;
			} else {
                    		NDR_CHECK(ndr_push_relative_ptr2(ndr, r->name));
                    		NDR_CHECK(ndr_push_CIMSTRING(ndr, NDR_SCALARS, &r->name));
			}
                }
                NDR_CHECK(ndr_push_CIMVAR(ndr, NDR_BUFFERS, &r->value));
        }
        return NT_STATUS_OK;
}
Esempio n. 15
0
NTSTATUS 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, 4));
            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));
        }
        if (ndr_flags & NDR_BUFFERS) {
            if (r->owner_sid) {
                NDR_CHECK(ndr_push_relative_ptr2(ndr, r->owner_sid));
                NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid));
            }
            if (r->group_sid) {
                NDR_CHECK(ndr_push_relative_ptr2(ndr, r->group_sid));
                NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid));
            }
            if (r->sacl) {
                NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sacl));
                NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl));
            }
            if (r->dacl) {
                NDR_CHECK(ndr_push_relative_ptr2(ndr, r->dacl));
                NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl));
            }
        }
        ndr->flags = _flags_save_STRUCT;
    }
    return NT_STATUS_OK;
}
Esempio n. 16
0
_PUBLIC_ enum ndr_err_code ndr_push_PERF_OBJECT_TYPE(struct ndr_push *ndr, int ndr_flags, const struct PERF_OBJECT_TYPE *r)
{
	uint32_t cntr_counters_0;
	uint32_t cntr_instances_0;
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 8));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->TotalByteLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DefinitionLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->HeaderLength));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ObjectNameTitleIndex));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ObjectNameTitlePointer));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ObjectHelpTitleIndex));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ObjectHelpTitlePointer));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DetailLevel));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->NumCounters));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DefaultCounter));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->NumInstances));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->CodePage));
		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->PerfTime));
		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->PerfFreq));
		for (cntr_counters_0 = 0; cntr_counters_0 < r->NumCounters; cntr_counters_0++) {
			NDR_CHECK(ndr_push_PERF_COUNTER_DEFINITION(ndr, NDR_SCALARS, &r->counters[cntr_counters_0]));
		}
		for (cntr_instances_0 = 0; cntr_instances_0 < r->NumInstances; cntr_instances_0++) {
			NDR_CHECK(ndr_push_PERF_INSTANCE_DEFINITION(ndr, NDR_SCALARS, &r->instances[cntr_instances_0]));
		}
		NDR_CHECK(ndr_push_PERF_COUNTER_BLOCK(ndr, NDR_SCALARS, &r->counter_data));
		NDR_CHECK(ndr_push_trailer_align(ndr, 8));
	}
	if (ndr_flags & NDR_BUFFERS) {
		for (cntr_instances_0 = 0; cntr_instances_0 < r->NumInstances; cntr_instances_0++) {
			NDR_CHECK(ndr_push_PERF_INSTANCE_DEFINITION(ndr, NDR_BUFFERS, &r->instances[cntr_instances_0]));
		}
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 17
0
/* We have manual push/pull because we didn't manage to do the alignment
 * purely in PIDL as the padding is sized so that the whole access_check_v3
 * struct size is a multiple of 16 (as specified in 2.2.2.4 of ms-bkrp.pdf)
 */
_PUBLIC_ enum ndr_err_code ndr_push_bkrp_access_check_v3(struct ndr_push *ndr, int ndr_flags, const struct bkrp_access_check_v3 *r)
{
	if (ndr_flags & NDR_SCALARS) {
		size_t ofs;
		size_t pad;
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00000001));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nonce_len));
		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nonce, r->nonce_len));
		NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
		/* We articially increment the offset of 64 bytes (size of hash
		 * comming after the pad) so that ndr_align can determine easily
		 * the correct pad size to make the whole struct 16 bytes aligned
		 */
		ofs = ndr->offset + 64;
		pad = ndr_align_size(ofs, 16);
		NDR_CHECK(ndr_push_zero(ndr, pad));
		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 64));
		NDR_CHECK(ndr_push_trailer_align(ndr, 4));
	}
	if (ndr_flags & NDR_BUFFERS) {
	}
	return NDR_ERR_SUCCESS;
}
Esempio n. 18
0
_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;
}