perfview
perfview copied to clipboard
Fix for issue #1767
This change updates GetActiveSessionNames to check for ERROR_MORE_DATA and retry once when calling QueryAllTraces.
I chose to implement this by modifying the current function as little as possible. To do that, I wrapped the core logic and made a recursive call to it for the retry, with a depth counter that maxes out at 1.
This change also has a unit test, but I don't think it is ready to be committed. I am including it so a discussion can be had about it.
In general it seems hard to reliably simulate this condition on a broad set of machines that will run this test suite (65+ active etw sessions while EtwMaxLoggers registry key is not set.) Just between my two developer machines I couldn't do it 🤣
I'm open to ideas here on how the test can be improved to be more reliable, otherwise it probably needs to be removed.