|
-
Oct 6th, 2009, 10:16 AM
#4
Re: Bypass TimeGetTime 49.7 limit
Fazi, two things
1. You cannot use Abs() and get a valid result. Let's say the API returned -2128334000, ok? You can see from the calcs below the results are vastly different.
Abs(-2128334000) = 2128334000 which is incorrect
-2128334000 + 4294967296@ = 2166633296 which is correct
Once a positive long hits 2147483647 or &H7FFFFFFF (max value), you cannot add more to it and keep it positive. The next bit that would get set would be &H8000000 or -2147483648 which is now a negative value for a Long. Abs() works on that value only. Add one more &H80000001 or -2147483647, using Abs() on that returns the wrong value because 2147483649 is correct, not Abs(-2147483647). Understand?
For the maximum difference, look at the value -1& which would be the value of the API the millisecond before it gets reset. If using Abs() on it, obviousy you get 1, but the correct value is 4294967295.
2. You cannot use the API to determine when the pc was last rebooted if it has been running longer than 50 days unless you were caching something before it reset to zero. It would be nice if there was something saved by the system that did not get reset. I don't know of any registry entry or system setting that can be returned via APIs. Maybe a system file can be queried? And if so, does that file exist and is it created the same for all operating systems?
Last edited by LaVolpe; Oct 6th, 2009 at 10:19 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|