microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
6.75k stars 4.89k forks source link

[audio/sysvad] APO_BUFFER_FLAGS not used as flags in sample #1160

Open kurylo opened 2 months ago

kurylo commented 2 months ago

Is the APO_BUFFER_FLAGS handling implemented in the SwapAPO using switch statement correct? https://github.com/microsoft/Windows-driver-samples/blob/b968cfbed5566a3a9597f5368334beb3b6dad4d2/audio/sysvad/APO/SwapAPO/swapapomfx.cpp#L245

Name flags suggests that multiple flags can be set at once e.g.: both BUFFER_VALID and BUFFER_SILENT with a resulting value of 0x3. This would require a different handling than a switch statement.

Clarification in the document: https://learn.microsoft.com/en-us/windows/win32/api/audioapotypes/ne-audioapotypes-apo_buffer_flags is needed on whether the ppInputConnections[0]->u32BufferFlags are to be treated as flags (as the field name suggests) or as an enumeration with only one value valid at a time. The current wording in the document using both enumeration and flags is ambiguous.