summaryrefslogtreecommitdiff
path: root/other-licenses/7zstub/src/Windows/Time.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-03-25 17:53:14 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-25 17:53:14 +0100
commit355245caf4e5ca8dea1de541fcdeccef103b308d (patch)
tree0156a6db6aa8b4d87bf041ece5cf5229c59fe9de /other-licenses/7zstub/src/Windows/Time.h
parent2332eebf1cf103365181ae9f8fb45c35b4f24016 (diff)
downloaduxp-355245caf4e5ca8dea1de541fcdeccef103b308d.tar.gz
Update the 7z installer stub source to 18.05.
Tag mcp-graveyard/UXP#1022
Diffstat (limited to 'other-licenses/7zstub/src/Windows/Time.h')
-rw-r--r--other-licenses/7zstub/src/Windows/Time.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/other-licenses/7zstub/src/Windows/Time.h b/other-licenses/7zstub/src/Windows/Time.h
deleted file mode 100644
index b16602aa18..0000000000
--- a/other-licenses/7zstub/src/Windows/Time.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Windows/Time.h
-
-#ifndef __WINDOWS_TIME_H
-#define __WINDOWS_TIME_H
-
-#include "Common/Types.h"
-#include "Windows/Defs.h"
-
-namespace NWindows {
-namespace NTime {
-
-inline bool DosTimeToFileTime(UInt32 dosTime, FILETIME &fileTime)
-{
- return BOOLToBool(::DosDateTimeToFileTime(UInt16(dosTime >> 16),
- UInt16(dosTime & 0xFFFF), &fileTime));
-}
-
-const UInt32 kHighDosTime = 0xFF9FBF7D;
-const UInt32 kLowDosTime = 0x210000;
-
-inline bool FileTimeToDosTime(const FILETIME &fileTime, UInt32 &dosTime)
-{
- WORD datePart, timePart;
- if (!::FileTimeToDosDateTime(&fileTime, &datePart, &timePart))
- {
- if (fileTime.dwHighDateTime >= 0x01C00000) // 2000
- dosTime = kHighDosTime;
- else
- dosTime = kLowDosTime;
- return false;
- }
- dosTime = (((UInt32)datePart) << 16) + timePart;
- return true;
-}
-
-const UInt32 kNumTimeQuantumsInSecond = 10000000;
-const UInt64 kUnixTimeStartValue = ((UInt64)kNumTimeQuantumsInSecond) * 60 * 60 * 24 * 134774;
-
-inline void UnixTimeToFileTime(UInt32 unixTime, FILETIME &fileTime)
-{
- UInt64 v = kUnixTimeStartValue + ((UInt64)unixTime) * kNumTimeQuantumsInSecond;
- fileTime.dwLowDateTime = (DWORD)v;
- fileTime.dwHighDateTime = (DWORD)(v >> 32);
-}
-
-inline bool FileTimeToUnixTime(const FILETIME &fileTime, UInt32 &unixTime)
-{
- UInt64 winTime = (((UInt64)fileTime.dwHighDateTime) << 32) + fileTime.dwLowDateTime;
- if (winTime < kUnixTimeStartValue)
- {
- unixTime = 0;
- return false;
- }
- winTime = (winTime - kUnixTimeStartValue) / kNumTimeQuantumsInSecond;
- if (winTime > 0xFFFFFFFF)
- {
- unixTime = 0xFFFFFFFF;
- return false;
- }
- unixTime = (UInt32)winTime;
- return true;
-}
-
-}}
-
-#endif