Makrobeispiel zum Filtern von Fehlercodes

Wichtig

Die WSD Challenger-Funktionalität ist veraltet, und alle WSD Challenger-bezogenen Dokumentationen werden 2018 entfernt.

Das folgende Makrobeispiel filtert Kommunikationsfehlerfehlercodes.

//
// Example of a macro to filter device communication errors
//
#define WSD_COMMUNICATION_ERROR(hr) \
    ((HRESULT_FROM_WIN32(ERROR_WINHTTP_CANNOT_CONNECT)) == hr) || \
    ((HRESULT_FROM_WIN32(ERROR_WINHTTP_CONNECTION_ERROR)) == hr) || \
    ((HRESULT_FROM_WIN32(ERROR_WINHTTP_TIMEOUT)) == hr) || \
    ((HRESULT_FROM_WIN32(ERROR_TIMEOUT)) == hr) || \
    ((HRESULT_FROM_WIN32(ERROR_WINHTTP_NAME_NOT_RESOLVED)) == hr))