G
Guest
Here is some code of mine for seeing if a printer job, jobs[0], is more than 5 minutes old
FILETIME syst, jobt
LARGE_INTEGER syst2, jobt2, dt
GetSystemTimeAsFileTime(&syst)
SystemTimeToFileTime(&jobs[0].Submitted, &jobt)
syst2.HighPart = syst.dwHighDateTime
syst2.LowPart = syst.dwLowDateTime
jobt2.HighPart = jobt.dwHighDateTime
jobt2.LowPart = jobt.dwLowDateTime
dt.QuadPart = syst2.QuadPart - jobt2.QuadPart
if (dt.QuadPart > (5 * 600000000)) // 5 minutes in hundreds of nanosecond
return = true
else return = false
Is this the correct way of the doing the LARGE_INTEGER arithmetic? Or am I overlooking something? Thanks in advance!
FILETIME syst, jobt
LARGE_INTEGER syst2, jobt2, dt
GetSystemTimeAsFileTime(&syst)
SystemTimeToFileTime(&jobs[0].Submitted, &jobt)
syst2.HighPart = syst.dwHighDateTime
syst2.LowPart = syst.dwLowDateTime
jobt2.HighPart = jobt.dwHighDateTime
jobt2.LowPart = jobt.dwLowDateTime
dt.QuadPart = syst2.QuadPart - jobt2.QuadPart
if (dt.QuadPart > (5 * 600000000)) // 5 minutes in hundreds of nanosecond
return = true
else return = false
Is this the correct way of the doing the LARGE_INTEGER arithmetic? Or am I overlooking something? Thanks in advance!