DrtStartSearch function (drt.h)

The DrtStartSearch function searches the DRT for a key using criteria specified in the DRT_SEARCH_INFO structure.

Syntax

HRESULT DrtStartSearch(
  [in]           HDRT                  hDrt,
  [in]           DRT_DATA              *pKey,
  [in, optional] const DRT_SEARCH_INFO *pInfo,
                 ULONG                 timeout,
  [in]           HANDLE                hEvent,
  [in, optional] const PVOID           pvContext,
  [out]          HDRT_SEARCH_CONTEXT   *hSearchContext
);

Parameters

[in] hDrt

The DRT handle returned by the DrtOpen function.

[in] pKey

Pointer to the DRT_DATA structure containing the key.

[in, optional] pInfo

Pointer to the DRT_SEARCH_INFO structure that specifies the properties of the search.

timeout

Specifies the milliseconds until the search is stopped.

[in] hEvent

Handle to the event that is signaled when the DrtStartSearch API finishes or an intermediate node is found.

[in, optional] pvContext

Pointer to the context data passed to the application through the event.

[out] hSearchContext

Handle used in the call to DrtEndSearch.

Return value

This function returns S_OK on success. Other possible values include:

Return code Description
E_HANDLE
hDrt is an invalid handle or phKeyRegistration is an invalid handle
E_INVALIDARG
  • hSearchContext is NULL.
  • pKey is NULL
  • The pb member of the DRT_DATA structure of pKey is NULL.
  • pInfo was passed in, the minimum key is set inside pInfo for range search, but the maximum key is NULL.
  • pInfo was passed in, the maximum key is set inside pInfo for range search, but the minimum key is NULL.
DRT_E_INVALID_KEY_SIZE
  • The cb member of the DRT_DATA structure of pKey is not equal to 256 bits.
  • pInfo was passed in, but the key size of the minimum key set inside pInfo is not equal to 256 bits.
  • pInfo was passed in, but the key size of the maximum key set inside pInfo is not equal to 256 bits.
DRT_E_INVALID_SEARCH_INFO
pInfo was passed in but the dwSize of pInfo is not equal to size of the DRT_SEARCH_INFO structure.
DRT_E_INVALID_MAX_ENDPOINTS
pInfo was passed in but max endpoints (cMaxEndpoints) is set to 0 inside pInfo or pInfo was passed in but cMaxEndpoints is greater than 1 with fAnyMatchInRange set to TRUE
DRT_E_INVALID_SEARCH_RANGE
Min and max key values are equal, but target is different.
DRT_E_FAULTED
The DRT cloud is in the faulted state.
E_OUTOFMEMORY
The system is out of memory.
E_UNEXPECTED
The DRT is shutting down.
E_FAIL
An unexpected fatal error has occurred.

Requirements

Requirement Value
Minimum supported client Windows 7 Professional [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header drt.h
Library Drt.lib
DLL Drt.dll

See also

DRT_SEARCH_INFO

DrtContinueSearch

DrtEndSearch

DrtOpen