3.1.4.1.9 NspiSeekEntries (Opnum 4)

The NspiSeekEntries method searches for and sets the logical position in a specific table to the first entry greater than or equal to a specified value. Optionally, it might also return information about rows in the table.

 long NspiSeekEntries(
   [in] NSPI_HANDLE hRpc,
   [in] DWORD Reserved,
   [in, out] STAT* pStat,
   [in] PropertyValue_r* pTarget,
   [in, unique] PropertyTagArray_r* lpETable,
   [in, unique] PropertyTagArray_r* pPropTags,
   [out] PropertyRowSet_r** ppRows
 );

hRpc: An RPC context handle, as specified in section 2.2.10.

Reserved: A DWORD [MS-DTYP] value that is reserved for future use. Ignored by the server.

pStat: A pointer to a STAT block that describes a logical position in a specific address book container. This parameter is used to both specify input parameters from the client and return values from the server.

pTarget: A PropertyValue_r value holding the value that is being sought.

lpETable: The value NULL or a PropertyTagArray_r value. It holds a list of Minimal Entry IDs that comprises a restricted address book container.

pPropTags: The value NULL or a reference to a PropertyTagArray_r value. Contains list of the proptags of the columns that client wants to be returned for each row returned.

ppRows: A reference to a PropertyRowSet_r value. Contains the address book container rows the server returns in response to the request.

Return Values: The server returns a long value specifying the return status of the method.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified in [MS-RPCE].

Server Processing Rules: Upon receiving this message, the server MUST process the data from the message subject to the following constraints:

  1. If the CodePage field of the input parameter pStat contains the value CP_WINUNICODE, the server MUST return one of the return values specified in section 2.2.1.2. No further constraints are applied to server processing of this method; in this case server behavior is undefined. Note especially that there is no constraint on the data the server returns in any output parameter other than the return value, nor is there any constraint on how or whether the server changes its state.

  2. If the input parameter lpETable is not NULL and does not contain an Explicit Table both containing a restriction of the table specified by the input parameter pStat and sorted as specified by the SortType field of the input parameter pStat, the server MUST return one of the return values specified in section 2.2.1.2. No further constraints are applied to server processing of this method; in this case server behavior is undefined. Note especially that there is no constraint on the data the server returns in any output parameter other than the return value, nor is there any constraint on how or whether the server changes its state.

  3. If the input parameter Reserved contains any value other than 0, the server MUST return one of the return values specified in section 2.2.1.2. No further constraints are applied to server processing of this method; in this case server behavior is undefined. Note especially that there is no constraint on the data the server returns in any output parameter other than the return value, nor is there any constraint on how or if the server changes its state.

  4. If the server returns any return values other than "Success", the server MUST return a NULL for the output parameter ppRows and MUST NOT modify the value of the parameter pStat.

  5. The server MAY make additional validations as described in section 5. If the server chooses to limit the visibility of data based on these validations, the server MUST proceed as if that data did not exist in the address book.

  6. If the server is unable to locate the address book container specified by the ContainerID field in the input parameter pStat, the server MUST return the return value "InvalidBookmark".

  7. If the input parameter lpETable is NULL, the server MUST use the table specified by the input parameter pStat when constructing the return parameter ppRows.

  8. If the input parameter lpETable contains an Explicit Table, the server MUST use that table when constructing the return parameter ppRows.

  9. If the SortType field in the input parameter pStat has any value other than SortTypeDisplayName, the server MUST return the value GeneralFailure.

  10. If the SortType field in the input parameter pStat is SortTypeDisplayName and the property specified in the input parameter pTarget is anything other than PidTagDisplayName (with either the Property Type PtypString8 or PtypString), the server MUST return the value GeneralFailure.

  11. The server MUST locate the first row in the specified table that has a value equal to or greater than the value specified in the input parameter pTarget. If no such row exists, the server MUST return the value NotFound.

  12. If a qualifying row was found, the server MUST update the position information in the parameter pStat.

    • The server MUST set CurrentRec field of the parameter pStat to the Minimal Entry ID of the qualifying row.

    • If the server is using the table specified by the input parameter lpETable, the server MUST set the NumPos field of the parameter pStat to the accurate numeric position of the qualifying row in the table.

    • If the server is using the table specified by the input parameter pStat, the server MUST set the NumPos field of the parameter pStat to the approximate numeric position of the qualifying row in the table.

    • The TotalRecs field of the parameter pStat MUST be set to the accurate number of records in the table used.

    • The server MUST NOT modify any other fields of the parameter pStat.

  13. If the input parameter pPropTags is not NULL, the client is requesting the server to return an PropertyRowSet_r. Subject to the prior constraints, the server MUST construct an PropertyRowSet_r to return to the client in the output parameter ppRows. The server MUST return the same PropertyRowSet_r for the NspiSeekEntries method after the NspiQueryRows method is called using the input parameters. This PropertyRowSet_r MUST be exactly the same PropertyRowSet_r that would be returned in the ppRows parameter of a call to the NspiQueryRows method with the following parameters:

    • The NspiSeekEntries parameter hRpc is used as the NspiQueryRows parameter hRpc.

    • The value fEphID is used as the NspiQueryRows parameter dwFlags.

    • The NspiSeekEntries output parameter pStat (as modified by the prior constraints) is used as the NspiQueryRows parameter pStat.

    • If the NspiSeekEntries input parameter lpETable is NULL, the value 0 is used as the NspiQueryRows parameter dwETableCount, and the value NULL is used as the NspiQueryRows parameter lpETable.

    • If the NspiSeekEntries input parameter lpETable is not NULL, the server constructs an explicit table from the table specified by lpETable by copying rows in order from lpETable to the new explicit table. The server begins copying from the row specified by the NumPos field of the pStat parameter (as modified by the prior constraints), and continues until all remaining rows are added to the new table. The number of rows in this new table is used as the NspiQueryRows parameter dwETableCount, and the new table is used as the NspiQueryRows lpETable parameter.

    • The list of Minimal Entry IDs in the input parameter lpETable starting with the qualifying row is used as the NspiQueryRows parameter lpETable. These Minimal Entry IDs are expressed as a simple array of DWORD values rather than as a PropertyTagArray_r value. Note that the qualifying row is included in this list, and that the order of the Minimal Entry IDs from the input parameter lpETable is preserved in this list.

    • If the NspiSeekEntries input parameter lpETable is NULL, the server MUST choose a value for the NspiQueryRows parameter Count. The Exchange Server NSPI Protocol does not prescribe any particular algorithm. The server MUST use a value greater than 0.

    • If the NspiSeekEntries input parameter lpETable is not NULL, the value used for the NspiQueryRows parameter dwETableCount is used for the NspiQueryRows parameter Count.

    • The NspiSeekEntries parameter pPropTags is used as the NspiQueryRows parameter pPropTags.

    • Note that the server MUST NOT modify the return value of the NspiSeekEntries output parameter pStat in any way in the process of constructing the output PropertyRowSet_r.

  14. If no other return values have been specified by these constraints, the server MUST return the return value "Success".