2.2.2.3.1 RopSortTable ROP Request Buffer

The following descriptions define valid fields for the RopSortTable ROP request buffer ([MS-OXCROPS] section 2.2.5.2.1).

SortTableFlags (1 byte): A structure that contains an OR'ed combination of the asynchronous flags, which are specified in section 2.2.2.1.4.<5> This field MUST NOT have any of the other bits set.

SortOrderCount (2 bytes): An unsigned integer that specifies the number of SortOrder structures, as specified in [MS-OXCDATA] section 2.13.1, in the SortOrders field.

CategoryCount (2 bytes): An unsigned integer that specifies the number of SortOrder structures, as specified in [MS-OXCDATA] section 2.13.1, in the SortOrders field, that are designated as category columns. The SortOrder structures occupy the first CategoryCount field positions in the SortOrders array. The value of the CategoryCount field MUST be in the range 0 to the value of the SortOrderCount field.

ExpandedCount (2 bytes): An unsigned integer that specifies the number of categories that start in the expanded state. This value MUST be in the range 0 to the value of the CategoryCount field. The first categories of the ExpandedCount field are initially expanded. If the value of the CategoryCount field is equal to the value of the ExpandedCount field, then all categories are expanded.

SortOrders (variable): An array of SortOrder structures, as specified in [MS-OXCDATA] section 2.13.1, that defines the sort to be performed. The number of SortOrder structures in the array MUST be equal to the value of the SortOrderCount field. For categorized sorting, the SortOrder structure specifies the property type and property ID that are used as the category. When the value of the SortOrderCount field exceeds the value of the CategoryCount field, indicating that there are more sort keys than categories, categories are created from the SortOrder structures that appear first in the SortOrders array. The remaining SortOrder structures are used to sort the rows within the categories.

For example, if the SortOrderCount field is set to 0x0003 and the CategoryCount field is set to 0x0002, the columns described by the PropertyType and PropertyId members of the first two entries in the SortOrders field are used as the category columns. The first entry serves as the top-level category grouping; the second entry as the secondary grouping. All of the rows that match the two category columns are sorted using the sort key defined in the third entry.

If a SortOrder structure specifies a multivalue property, it MUST also have the MultivalueInstance bit set, as specified in [MS-OXCDATA] section 2.11.1.3, specifying that the sort be performed using the individual values of that property. Sort order on a multivalue property that is not also being used for multivalue instances is undefined. The SortOrders field MUST NOT contain more than one SortOrder structure specifying a multivalue property in the first CategoryCount field positions of the array.

If the Order member of a SortOrder structure is set to "Ascending", the table will be sorted in ascending order by the column specified in the PropertyType and PropertyId members.

If the Order member of a SortOrder structure is set to "Descending", the table will be sorted in descending order by the column specified in the PropertyType and PropertyId members.

If the Order member of a SortOrder structure is set to "MaximumCategory", that structure directly follows the first CategoryCount structure in the SortOrders field and the value of the CategoryCount field MUST be greater than 0x0000 (zero). This SortOrder structure, at position CategoryCount + 1 in the array, modifies the immediately previous category sort. The categories in the table will be not be sorted by the column specified in the category sort. The categories will be sorted according to each category's maximum value of the specified column. Any SortOrder structures after this one will subsort the rows within each category.