mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 13:05:38 +02:00
disable auto restore from db if system is up more than 5 min
This commit is contained in:
parent
cce0f7f52d
commit
f34fffa574
2 changed files with 6 additions and 0 deletions
|
@ -1082,6 +1082,9 @@ namespace PersistentWindows.Common
|
||||||
}
|
}
|
||||||
else if (db_exist && autoRestoreLiveWindowsFromDb)
|
else if (db_exist && autoRestoreLiveWindowsFromDb)
|
||||||
{
|
{
|
||||||
|
var ticks = Kernel32.GetTickCount64();
|
||||||
|
if (ticks > 600000) //system up 5min
|
||||||
|
return true;
|
||||||
Log.Event("auto restore from db");
|
Log.Event("auto restore from db");
|
||||||
restoringFromDB = true;
|
restoringFromDB = true;
|
||||||
autoInitialRestoreFromDB = true;
|
autoInitialRestoreFromDB = true;
|
||||||
|
|
|
@ -624,6 +624,9 @@ namespace PersistentWindows.Common.WinApiBridge
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
public static extern bool CloseHandle(IntPtr hHandle);
|
public static extern bool CloseHandle(IntPtr hHandle);
|
||||||
|
|
||||||
|
[DllImport("kernel32")]
|
||||||
|
public static extern UInt64 GetTickCount64();
|
||||||
|
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
public static extern IntPtr OpenProcess(
|
public static extern IntPtr OpenProcess(
|
||||||
ProcessAccessFlags processAccess,
|
ProcessAccessFlags processAccess,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue