共用方式為


2.2.1.4 QueryCell

The QueryCell structure represents either a constraint on a single property in a table, as used to construct a query on the table or, alternatively, one of the special query options identified by an eSpecialQueryOption (section 2.2.1.3) value.

The QueryCell type is a custom-marshaled type for which two custom marshaling formats are specified in this section. The 32-bit QueryCell marshaling format is optimized for implementations that use a 32-bit address space, and the 64-bit QueryCell marshaling format is optimized for implementations that use a 64-bit address space. All implementations MUST support the 32-bit format and MAY<4> additionally support the 64-bit format.

A client and a server optionally perform capability negotiation, as specified in section 3.1.4.2, for the 64-bit QueryCell marshaling format. If this capability negotiation is performed, and if both the client and the server support the 64-bit format, the 64-bit format MUST be used. If this capability negotiation is not performed, or if either the client or the server does not support the 64-bit format, the 32-bit format MUST be used.

A QueryCell is always associated with a variable-typed comparison data value, although this value can be null. The comparison data value is not part of the QueryCell marshaling format; instead, it is supplied in a separate parameter when marshaling a query, as specified in section 2.2.1.6. The QueryCell does, however, specify the size, in bytes, of its associated comparison data, the data type of the comparison data, and whether the comparison data is non-null.


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

NonNullComparisonData (variable)

...

QueryOperator

IndexOrOption

ComparisonDataType

ComparisonDataSize

NonNullComparisonData (variable): Size depends on negotiated QueryCell marshaling format. It MUST be 4 bytes in the 32-bit format and MUST be 8 bytes in the 64-bit format. It MUST be set to zero if the comparison data is null and MUST be set to a nonzero value if the comparison data is non-null. On receipt, the server MUST treat all nonzero values identically.

QueryOperator (4 bytes): MUST be set to one of the following values.

Value

Meaning

eOPERATOR_EQUAL

0x00000000

The QueryCell represents an equality constraint.

eOPERATOR_NOTEQUAL

0x00000001

The QueryCell represents an inequality constraint.

IndexOrOption (4 bytes): MUST be set to either the zero-based index of a property in a table (values strictly less than 0xF0000000) or an eSpecialQueryOption value (values greater than or equal to 0xF0000000).

ComparisonDataType (4 bytes): The eDataType (section 2.2.1.2) value that represents the data type of the comparison data.

ComparisonDataSize (4 bytes): The size, in bytes, of the comparison data. If the representation of the comparison data in a QueryComparisonData (section 2.2.1.6) structure requires padding to a multiple of 4 bytes, this size MUST NOT include the padding bytes. If the comparison data is null, this MUST be set to zero. If the comparison data is non-null and the ComparisonDataType field is one of the following data type tags, this field is constrained as follows.

Data type tag

Constraint

eDT_ULONG

MUST be set to 0x00000004.

eDT_GUID

MUST be set to 0x00000010 (decimal 16).

eDT_LPWSTR

MUST be a multiple of 2.