2.2.4 Errors

Windows Search Protocol (WSP) messages indicate success two ways:

  •  A zero value (0x00000000).

  •  An HRESULT success value, such as DB_S_ENDOFROWSET, in which the thirty-first bit is not set.

Otherwise, WSP messages return a 32-bit error code that can either be an HRESULT or an NTSTATUS value (see section 1.8). If a buffer is too small to fit a result, a status code of STATUS_INSUFFICIENT_RESOURCES (0xC0000009A) MUST be returned, and the failing operation can be retried with a larger buffer.

All other error values are treated the same; the error is considered fatal and reported to the higher-level caller. Future messages MAY be sent over the same pipe as if no error had occurred.<23>

The following are common error codes:

  • E_OUTOFMEMORY (0x8007000e)

  • STATUS_INVALID_PARAMETER (0xc000000d)

  • STATUS_NO_MEMORY (0xc0000017)

  • STATUS_INSUFFICIENT_RESOURCES (0xc000009a)

  • CI_E_NOT_FOUND (0x80041815)

  • STATUS_INVALID_PARAMETER_MIX (0xc0000030)

  • ERROR_INVALID_PARAMETER (0x80070057)

  • CI_E_TIMEOUT (0x8004181F)

  • E_ACCESSDENIED (0x80070005)

  • CI_E_BUFFERTOOSMALL (0x8004180c)

  • DB_S_ENDOFROWSET (0x00040EC6)

  • CI_E_SHUTDOWN (0x80041812)

  • CI_E_NOT_INITIALIZED (0x8004180B)

  • DB_E_BADBINDINFO (0x80040E08)

  • MSS_E_CATALOGNOTFOUND (0x80042103)

The HRESULT and NTSTATUS numbering spaces do not currently overlap—except with values of identical meaning. However, even if there are conflicts in the future, they would not cause protocol issues as long as the value for STATUS_INSUFFICIENT_RESOURCES remains unique, because all other error values are treated the same.