CPropertyRestriction
The CPropertyRestriction structure contains a property to get from each row, a comparison operator and a constant. For each row, the value returned by the specific property in the row is compared against the constant to determine if it has the relationship specified by the _relop field. For the comparison to be true, the datatypes of the values MUST match.
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
1
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
2
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
3
0
|
1
|
_relop
|
_Property (variable)
|
...
|
_prval (variable)
|
...
|
_padding_lcid (variable)
|
...
|
_lcid
|
_relop (4 bytes): A 32-bit unsigned integer specifying the relation to perform on the property. _relop MUST be one of the following values.
Value
|
Meaning
|
PRLT
0x00000000
|
A less-than comparison.
|
PRLE
0x00000001
|
A less-than or equal-to comparison.
|
PRGT
0x00000002
|
A greater-than comparison.
|
PRGE
0x00000003
|
A greater-than or equal-to comparison.
|
PREQ
0x00000004
|
An equality comparison.
|
PRNE
0x00000005
|
A not-equal comparison.
|
PRRE
0x00000006
|
A regular expression comparison (see below).
|
PRAllBits
0x00000007
|
A bitwise AND that returns the value equal to _prval.
|
PRSomeBits
0x00000008
|
A bitwise AND that returns a nonzero value.
|
For vector properties, the behavior of the relational operators depends on the result of a logical OR using a mask and the relational operator.
If there is no mask, the restriction is true if the relational operator holds between each element of a property value and the corresponding element in the _prval field. If, in addition, the two vectors have different lengths, then the vector lengths are compared using the relational operator.
If there is a mask, its possible values are as follows.
Value
|
Meaning
|
PRAll
0x00000100
|
The restriction is true if every element in a property value has the relationship with some element in the _prval field.
|
PRAny
0x00000200
|
The restriction is true if any element in the property value has the relationship with some element in the _prval field.
|
For PRRE relations, regular expressions are expressed with a string that contains special symbols. Any character except an asterisk (*), period (.), question mark (?), or vertical bar (|) matches itself. A regular expression can be enclosed in matching quotes ("…"), and is enclosed in quotes if it contains a space or closing parenthesis (the ")" character).
The asterisk matches any number of characters. The period matches the end of the string. The question mark matches any one character. The vertical bar (|) is an escape character, which indicates special behavior for the characters in the table below the ([) character. The following table explains the meanings of special characters in regular expressions.
Character
|
Meaning
|
(
|
An opening parenthesis opens a group. It is followed by a matching closing parenthesis.
|
)
|
A closing parenthesis closes a group. It is preceded by a matching opening parenthesis.
|
[
|
An opening square bracket preceded (escaped) by a vertical pipe character opens a character class. It is followed by a matching (unescaped) closing square bracket.
|
{
|
An opening brace opens a counted match. It is followed by a matching closing brace.
|
}
|
A closing brace closes a counted match. It is preceded by a matching opening brace.
|
,
|
A comma separates OR clauses.
|
*
|
An asterisk matches zero or more occurrences of the preceding expression.
|
?
|
A question mark matches zero or one occurrence of the preceding expression.
|
+
|
A plus sign matches one or more occurrences of the preceding expression.
|
Other
|
All other characters match themselves.
|
The following table describes characters that, when located between square brackets ([ ]), have special meanings.
Character
|
Meaning
|
^
|
A caret matches everything but following classes. (It is the first character in the string.)
|
]
|
A closing square bracket matches another closing square bracket. It is preceded only by a caret (^); otherwise, it closes the class.
|
-
|
A hyphen is a range operator. It is preceded and followed by normal characters.
|
Other
|
All other characters match themselves (or begin or end a range).
|
The following table describes the syntax used between braces ({ }).
Character
|
Meaning
|
{m}
|
Matches exactly m occurrences of the preceding expression (0 < m < 256).
|
{m,}
|
Matches at least m occurrences of the preceding expression (1 < m < 256).
|
{m, n}
|
Matches between m and n occurrences of the preceding expression, inclusive (0 < m < 256, 0 < n < 256).
|
To match the asterisk and question mark, enclose them within brackets. For example, [*]sample matches "*sample".
_Property (variable): A CFullPropSpec structure indicating the property on which to perform a match operation.
_prval (variable): A CBaseStorageVariant structure containing the value to relate to the property.
If the vType of _prval is VT_BLOB or VT_BLOB_OBJECT, and _Property refers to a property of a string type (VT_LPSTR, VT_LPWSTR, VT_COMPRESSED_LPWSTR, VT_BSTR, or VT_VECTORs or VT_ARRAYs of those base types), then the first byte of the blob SHOULD be the low-order byte of a valid RANGEBOUNDARY ulType value (see section 2.2.1.23) and be followed by a null-terminated Unicode string. The value is interpreted in the same manner as RANGEBOUNDARY values (see section 2.2.1.23).
_padding_lcid (variable): This field MUST be 0 to 3 bytes in length. The length of this field MUST be such that the following _lcid field begins at an offset that is a multiple of 4 bytes from the beginning of the message that contains this structure. If this field is present (that is, length nonzero), the value it contains is arbitrary. The content of this field MUST be ignored by the receiver.
_lcid (4 bytes): A 32-bit unsigned integer representing locale for the string contained in _prval, as specified in [MS-LCID].
CReuseWhere
The CReuseWhere restriction packet contains a WHEREID that refers to the restriction array used to construct a currently open rowset. A rowset is open as long as there is still a cursor returned by CPMCreateQueryOut that has not been freed using CPMFreeCursorIn. A server can use this information to share evaluation of a restriction across multiple queries.
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
1
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
2
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
3
0
|
1
|
whereID
|
whereID (4 bytes): A 32-bit unsigned integer defining a unique WHEREID for referring to the CRestrictionArray.
|