On Wed Jan 25 19:42:17 2023 +0000, Mohamad Al-Jaf wrote:
RtlGetInterruptTimePrecise is undocumented, but I was able to find a header that has a prototype. I also ran some tests and the function itself returns a value in addition to the pointer passed in the parameters. The value of the parameter appears to always be greater than the return value of the function. I'm not sure how to implement that without knowing more about the function.
I've confirmed that the parameter is just a performance counter and is exactly the same as QueryPerformanceCounter(), depending on the timing, sometimes +/- 1. So the function itself is what returns the interrupt time.
However, QueryUnbiasedInterruptTime is still needed in the kernelbase function to subtract the unbiased time after getting the interrupt time from RtlGetInterruptTimePrecise. I have a partial implementation of RtlGetInterruptTimePrecise, but I don't know how to make it read the timer hardware directly, so it's not precise. Though it's very close to what Windows reports.
Based on the differences between Wine and Windows, I don't think it matters in this case if the function returns an approximate value.
Should I submit my current revision for review or is there a way to get precise time feasibly?