Rémi Bernon (@rbernon) commented about dlls/bluetoothapis/sdp.c:
+ SDP_ELEMENT_DATA attr = {0}; + BYTE *raw_attr_stream; + + result = BluetoothSdpGetContainerElementData( + data.data.sequence.value, data.data.sequence.length, &cursor, &attrid ); + if (result == ERROR_NO_MORE_ITEMS) return TRUE; + if (result != ERROR_SUCCESS) + { + SetLastError( ERROR_INVALID_DATA ); + return FALSE; + } + if (!SDP_ELEMENT_IS_ATTRID( &attrid )) + { + SetLastError( ERROR_INVALID_DATA ); + return FALSE; + }
if (result || !SDP_ELEMENT_IS_ATTRID( &attrid ))
{
SetLastError( ERROR_INVALID_DATA );
return FALSE;
}
What about grouping these? Note that we often prefer `!` instead of explicit comparison with ERROR_SUCCESS / STATUS_SUCCESS. Same thing goes with NULL btw, for the various pointer checks in this file. (With HRESULT it's a bit different because of SUCCEEDED/FAILED macros) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6402#note_82814