Exemplo n.º 1
0
static enum ndr_err_code ndr_push_echo_TestCall(struct ndr_push *ndr, int flags, const struct echo_TestCall *r)
{
	if (flags & NDR_IN) {
		if (r->in.s1 == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
		NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.s1, ndr_charset_length(r->in.s1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
	}
	if (flags & NDR_OUT) {
		if (r->out.s2 == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2));
		if (*r->out.s2) {
			NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
			NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
	}
	return NDR_ERR_SUCCESS;
}
Exemplo n.º 2
0
static enum ndr_err_code ndr_push_frsapi_ForceReplication(struct ndr_push *ndr, int flags, const struct frsapi_ForceReplication *r)
{
	if (flags & NDR_IN) {
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.replica_set_guid));
		if (r->in.replica_set_guid) {
			NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.replica_set_guid));
		}
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.connection_guid));
		if (r->in.connection_guid) {
			NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.connection_guid));
		}
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.replica_set_name));
		if (r->in.replica_set_name) {
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.replica_set_name, CH_UTF16)));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.replica_set_name, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.replica_set_name, ndr_charset_length(r->in.replica_set_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.partner_dns_name));
		if (r->in.partner_dns_name) {
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.partner_dns_name, CH_UTF16)));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.partner_dns_name, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.partner_dns_name, ndr_charset_length(r->in.partner_dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
	}
	if (flags & NDR_OUT) {
		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
	}
	return NDR_ERR_SUCCESS;
}
Exemplo n.º 3
0
static enum ndr_err_code ndr_push_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRolePrimaryDomInfoBasic *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 5));
		NDR_CHECK(ndr_push_dssetup_DsRole(ndr, NDR_SCALARS, r->role));
		NDR_CHECK(ndr_push_dssetup_DsRoleFlags(ndr, NDR_SCALARS, r->flags));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain));
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest));
		NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
		NDR_CHECK(ndr_push_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		if (r->domain) {
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
		if (r->dns_domain) {
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16)));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain, ndr_charset_length(r->dns_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
		if (r->forest) {
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16)));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest, ndr_charset_length(r->forest, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
	}
	return NDR_ERR_SUCCESS;
}
Exemplo n.º 4
0
static enum ndr_err_code ndr_push_pcap_printer(struct ndr_push *ndr, int ndr_flags, const struct pcap_printer *r)
{
    if (ndr_flags & NDR_SCALARS) {
        NDR_CHECK(ndr_push_align(ndr, 5));
        NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
        NDR_CHECK(ndr_push_unique_ptr(ndr, r->location));
        NDR_CHECK(ndr_push_trailer_align(ndr, 5));
    }
    if (ndr_flags & NDR_BUFFERS) {
        if (r->name) {
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
            NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
        }
        if (r->info) {
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
            NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->info, ndr_charset_length(r->info, CH_UTF8), sizeof(uint8_t), CH_UTF8));
        }
        if (r->location) {
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF8)));
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
            NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF8)));
            NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->location, ndr_charset_length(r->location, CH_UTF8), sizeof(uint8_t), CH_UTF8));
        }
    }
    return NDR_ERR_SUCCESS;
}
Exemplo n.º 5
0
static enum ndr_err_code ndr_push_frsapi_IsPathReplicated(struct ndr_push *ndr, int flags, const struct frsapi_IsPathReplicated *r)
{
	if (flags & NDR_IN) {
		NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.path));
		if (r->in.path) {
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.path, CH_UTF16)));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.path, CH_UTF16)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path, ndr_charset_length(r->in.path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		}
		NDR_CHECK(ndr_push_frsapi_ReplicaSetType(ndr, NDR_SCALARS, r->in.replica_set_type));
	}
	if (flags & NDR_OUT) {
		if (r->out.replicated == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.replicated));
		if (r->out.primary == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.primary));
		if (r->out.root == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.root));
		if (r->out.replica_set_guid == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->out.replica_set_guid));
		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
	}
	return NDR_ERR_SUCCESS;
}
Exemplo n.º 6
0
_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;
}
Exemplo n.º 7
0
static enum ndr_err_code ndr_push_PAC_LOGON_NAME(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_NAME *r)
{
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->logon_time));
		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->account_name)));
		NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, 2 * strlen_m(r->account_name), sizeof(uint8_t), CH_UTF16));
	}
	if (ndr_flags & NDR_BUFFERS) {
	}
	return NDR_ERR_SUCCESS;
}
Exemplo n.º 8
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;
}
Exemplo n.º 9
0
static enum ndr_err_code ndr_push_RemoteActivation(struct ndr_push *ndr, int flags, const struct RemoteActivation *r)
{
	uint32_t cntr_pIIDs_1;
	uint32_t cntr_protseq_0;
	uint32_t cntr_ifaces_0;
	uint32_t cntr_results_0;
	if (flags & NDR_IN) {
		NDR_CHECK(ndr_push_ORPCTHIS(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.this_object));
		NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->in.Clsid));
		if (r->in.pwszObjectName == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pwszObjectName, CH_UTF16)));
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pwszObjectName, CH_UTF16)));
		NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pwszObjectName, ndr_charset_length(r->in.pwszObjectName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
		if (r->in.pObjectStorage == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_MInterfacePointer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pObjectStorage));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.ClientImpLevel));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Mode));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Interfaces));
		if (r->in.pIIDs == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.Interfaces));
		for (cntr_pIIDs_1 = 0; cntr_pIIDs_1 < r->in.Interfaces; cntr_pIIDs_1++) {
			NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->in.pIIDs[cntr_pIIDs_1]));
		}
		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.num_protseqs));
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.num_protseqs));
		for (cntr_protseq_0 = 0; cntr_protseq_0 < r->in.num_protseqs; cntr_protseq_0++) {
			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.protseq[cntr_protseq_0]));
		}
	}
	if (flags & NDR_OUT) {
		if (r->out.that == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_ORPCTHAT(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.that));
		if (r->out.pOxid == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.pOxid));
		if (r->out.pdsaOxidBindings == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_DUALSTRINGARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.pdsaOxidBindings));
		if (r->out.ipidRemUnknown == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->out.ipidRemUnknown));
		if (r->out.AuthnHint == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.AuthnHint));
		if (r->out.ServerVersion == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_COMVERSION(ndr, NDR_SCALARS, r->out.ServerVersion));
		if (r->out.hr == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, *r->out.hr));
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.Interfaces));
		for (cntr_ifaces_0 = 0; cntr_ifaces_0 < r->in.Interfaces; cntr_ifaces_0++) {
			if (r->out.ifaces[cntr_ifaces_0] == NULL) {
				return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
			}
		}
		for (cntr_ifaces_0 = 0; cntr_ifaces_0 < r->in.Interfaces; cntr_ifaces_0++) {
			NDR_CHECK(ndr_push_MInterfacePointer(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ifaces[cntr_ifaces_0]));
		}
		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.Interfaces));
		for (cntr_results_0 = 0; cntr_results_0 < r->in.Interfaces; cntr_results_0++) {
			NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.results[cntr_results_0]));
		}
		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
	}
	return NDR_ERR_SUCCESS;
}