Mirek: I would expect ">= 0x80000000", not sharp ">", if it is supposed to handle wrap of dword.
Edit: wait a second, too early in morning for me . This does not make sense too... ">" vs ">=" would make sense only if there were also some signed/unsigned problem elsewhere.
1000000000 = 0x3B9ACA00
so it means it thinks about "wrap" sooner, but I don't get the rest of the code, so I have no overall idea.
Yes, I was thinking about signed/unsinged too... But IMO it should be OK.