The current implementation uses the buffer size as software latency for WASAPI. This is not true for shared mode stream, and a better calculation should use IAudioClock interface to get the time since last reset of stream, and use that and the current writing frame number to calculate the actual latency.
On my win10 computer, when working on 10ms time frame in callback based shared mode (total buffer size is around 22ms), latency evaluated in this way amounts to something around 38ms, which should be much more precise.
The current implementation uses the buffer size as software latency for WASAPI. This is not true for shared mode stream, and a better calculation should use IAudioClock interface to get the time since last reset of stream, and use that and the current writing frame number to calculate the actual latency.
On my win10 computer, when working on 10ms time frame in callback based shared mode (total buffer size is around 22ms), latency evaluated in this way amounts to something around 38ms, which should be much more precise.