about:startup - Windows implementation of nsXULAppInfo::GetLaunchTimestamp

This commit is contained in:
Daniel Brooks 2010-09-03 15:55:27 -04:00
parent f681241ef1
commit 375c183104

View File

@ -869,6 +869,21 @@ NS_IMETHODIMP nsXULAppInfo::GetLaunchTimestamp(PRUint64 *aTimestamp)
*aTimestamp = boottime + ((starttime / tickspersecond) * PR_USEC_PER_SEC);
return NS_OK;
#elif XP_WIN
FILETIME start, foo, bar, baz;
bool success = GetProcessTimes(GetCurrentProcess(), &start, &foo, &bar, &baz);
if (success)
{
// copied from NSPR _PR_FileTimeToPRTime
CopyMemory(aTimestamp, &start, sizeof(PRTime));
#ifdef __GNUC__
*aTimestamp = (*aTimestamp - 116444736000000000LL) / 10LL;
#else
*aTimestamp = (*aTimestamp - 116444736000000000i64) / 10i64;
#endif
return NS_OK;
}
return NS_ERROR_FAILURE;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif