コード例 #1
0
ファイル: ndr_security.c プロジェクト: AllardJ/Tomato
_PUBLIC_ enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r)
{
	if (ndr_flags & NDR_SCALARS) {
		int level = ndr_push_get_switch_value(ndr, r);
		NDR_CHECK(ndr_push_union_align(ndr, 4));
		switch (level) {
			case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: {
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
			break; }

			case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: {
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
			break; }

			case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: {
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
			break; }

			case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: {
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
			break; }

			default: {
			break; }

		}
	}
	if (ndr_flags & NDR_BUFFERS) {
		int level = ndr_push_get_switch_value(ndr, r);
		switch (level) {
			case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
			break;

			case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
			break;

			case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
			break;

			case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
				NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
			break;

			default:
			break;

		}
	}
	return NDR_ERR_SUCCESS;
}
コード例 #2
0
static NTSTATUS ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r)
{
    int level;
    level = ndr_push_get_switch_value(ndr, r);
    if (ndr_flags & NDR_SCALARS) {
        switch (level) {
        case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
            break;

        case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
            break;

        case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
            break;

        case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object));
            break;

        default:
            break;

        }
    }
    if (ndr_flags & NDR_BUFFERS) {
        switch (level) {
        case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
            break;

        case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
            break;

        case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
            break;

        case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
            NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object));
            break;

        default:
            break;

        }
    }
    return NT_STATUS_OK;
}