Displaying 1 result from an estimated 1 matches for "performancecount2".
Did you mean:
performancecount1
2012 Jan 22
1
Timing related application crash
...a
debugger (ollydbg) I found the following sequence seems to be the
culprit (simplified to Cish code):
(start @ 0x0041AF35)
CPUID, RDTSC func
CPUID, RDTSC func
QueryPerformanceFrequency(&Frequency);
QueryPerformanceCounter(&PerformanceCount1)
CPUID, RDTSC func
QueryPerformanceCounter(&PerformanceCount2)
CPUID, RDTSC func
do some math related to something
blah = something * Frequency / (PerformanceCount2 - PerformanceCount1);
The key issue being that PerformanceCount2 == PerformanceCount1 and so
things blow up. Note that the actual exception occurs in __alldiv() @
0x00469CA0 because it got bad...