mirror of
https://github.com/reactos/reactos.git
synced 2026-09-08 18:30:51 +08:00
Debug more members of PCFILTER_DESCRIPTOR and its sub-items (PCPIN_DESCRIPTOR, PCNODE_DESCRIPTOR and PCCONNECTION_DESCRIPTOR). This allows to achieve the following things: 1) Actually debug more contents from the internal Filter Descriptor's definition of any audio miniport driver, including proprietary ones (e. g., Intel AC97, Realtek HD Audio codec etc.), and therefore to learn better how the Filters, Pins, Nodes and Connections are organized inside it. 2) Hence the proper debugging of them is also very useful and helpful for developing new audio miniport drivers both for Windows and ReactOS as well (as an example, it helps a lot to develop a new generic HD audio miniport driver for ReactOS personally for me). Proposed changes: - Debug DataFlow, Communication, Category and Name fields of all Pins and Nodes inside Filter Descriptor in particular. This allows to see the actual names and types for the audio-related items, to know whether the Pin or Node is of an input, output or bridge type and which is its actual purpose (for example, which thing the Node should do: Volume, Mute, Mux etc. and with which extental physical or virtual device the Pin is associated: WaveOut, WaveIn, Topology Speaker, Microphone, Headphones etc.). - Reorganize debug output of the Connections list: first debug FromNode and ToNode, and only then FromPin and ToPin fields of PCCONNECTION_DESCRIPTOR. This follows the original sequence of the members in the structure as it's defined at MSDN and improves readability and understandability of the Connections list in general (at least personally for me). - Wrap debug-only functions into #if DBG condition, to ensure they are enabled only for debug builds, but not for release ones. - Enable the call of the main DumpFilterDescriptor() debug routine inside PcCreateSubdeviceDescriptor() (which actually converts audio miniport's Filter Descriptor to the understandable format for the system PortCls driver), to make it possible to debug it at all. Mute some DPTINTs (debug prints) appropriately, so now debug output is printed ONLY in case when NDEBUG is NOT defined (so hence it's possible to get it by either disabling #define NDEBUG line at the top, or modifying it to #define YDEBUG instead). Since no any other debug prints are currently added in this source file (undoc.cpp), nothing else will be printed except Filter Descriptor debugging. - Fix code formatting for all related "for()" loops a little bit. Add one space between the for keyword and the condition of the loop iteration.