| 296 | |
| 297 | |
| 298 | __int64 FileTimeSecondsUntil(FILETIME *pftStart, FILETIME *pftEnd) |
| 299 | // Returns the number of seconds from pftStart until pftEnd. |
| 300 | { |
| 301 | if (!pftStart || !pftEnd) return 0; |
| 302 | |
| 303 | // The calculation is done this way for compilers that don't support 64-bit math operations (not sure which): |
| 304 | // Note: This must be LARGE vs. ULARGE because we want the calculation to be signed for cases where |
| 305 | // pftStart is greater than pftEnd: |
| 306 | ULARGE_INTEGER uiStart, uiEnd; |
| 307 | uiStart.LowPart = pftStart->dwLowDateTime; |
| 308 | uiStart.HighPart = pftStart->dwHighDateTime; |
| 309 | uiEnd.LowPart = pftEnd->dwLowDateTime; |
| 310 | uiEnd.HighPart = pftEnd->dwHighDateTime; |
| 311 | // Must do at least the inner cast to avoid losing negative results: |
| 312 | return (__int64)((__int64)(uiEnd.QuadPart - uiStart.QuadPart) / 10000000); // Convert from tenths-of-microsecond. |
| 313 | } |
| 314 | |
| 315 | |
| 316 |
no outgoing calls
no test coverage detected