2.12 Restrictions

Restrictions describe a filter for limiting the view of a table to a particular set of rows. This filter represents a Boolean expression that is evaluated against each item of the table. The item will be included as a row of the restricted table if and only if the value of the Boolean expression evaluates to TRUE.

Restrictions are sent to the server with the RopFindRow ([MS-OXCROPS] section 2.2.5.13), RopRestrict ([MS-OXCROPS] section 2.2.5.3), RopSetSearchCriteria ([MS-OXCROPS] section 2.2.4.4), and RopSynchronizationConfigure ([MS-OXCROPS] section 2.2.13.1) ROP requests, and they are returned from the RopGetSearchCriteria ROP request ([MS-OXCROPS] section 2.2.4.5).

There are 12 different restriction (2) packet formats: Six of them (AndRestriction, OrRestriction, NotRestriction, SubObjectRestriction, CommentRestriction, and CountRestriction) are used to construct more complicated restrictions (2) from one or more simpler ones. The other six types (ContentRestriction, PropertyRestriction, ComparePropertiesRestriction, BitMaskRestriction, SizeRestriction, and ExistRestriction) specify specific tests based on the properties of an item.

Although the packet formats differ, the first 8 bits store RestrictType, an unsigned byte value specifying the type of restriction (2), in the first 8 bits. The possible values for RestrictType are presented in the following table.

RestrictType value

Hexadecimal value

Description

Alternate name

AndRestriction

AndRestriction_r

0x00

Logical AND operation applied to a list of subrestrictions.

RES_AND

OrRestriction

OrRestriction_r

0x01

Logical OR operation applied to a list of subrestrictions.

RES_OR

NotRestriction

NotRestriction_r

0x02

Logical NOT operation applied to a subrestriction.

RES_NOT

ContentRestriction

ContentRestriction_r

0x03

Search a property value for specific content.

RES_CONTENT

PropertyRestriction

PropertyRestriction_r

0x04

Compare a property value with a particular value.

RES_PROPERTY

ComparePropertiesRestriction

ComparePropertiesRestriction_r

0x05

Compare the values of two properties.

RES_COMPAREPROPS

BitMaskRestriction

BitMaskRestriction_r

0x06

Perform a bitwise AND operation on a property value with a mask and compare that with 0 (zero).

RES_BITMASK

SizeRestriction

SizeRestriction_r

0x07

Compare the size of a property value to a particular figure.

RES_SIZE

ExistRestriction

ExistRestriction_r

0x08

Test whether a property has a value.

RES_EXIST

SubObjectRestriction

SubRestriction_r

0x09

Test whether any row of a message's attachment or recipient table satisfies a subrestriction.

RES_SUBRESTRICTION

CommentRestriction

0x0A

Associates a comment with a subrestriction.

RES_COMMENT

CountRestriction

0x0B

Limits the number of matches returned from a subrestriction.

RES_COUNT

The subsections that follow describe each packet format.

There is one variation in the way restriction structures are serialized. In the context of ROP buffers, such as the RopRestrict ROP or the RopSetSearchCriteria ROP, all count fields (such as the number of subrestrictions of an AndRestriction) are 16 bits wide. However, in the context of extended rules, as specified in [MS-OXORULE] section 2.2.4, or search folder definition messages, as specified in [MS-OXOSRCH] section 2.2.1, these counts are 32 bits wide. Such fields are identified as COUNT fields throughout section 2.12.