-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New year, new cleanup - dependencies, edition 2021, etc
- Loading branch information
Showing
21 changed files
with
682 additions
and
398 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[package] | ||
name = "timerset" | ||
version = "0.4.0" | ||
version = "0.4.1" | ||
authors = ["Mathieu Amiot <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
|
||
[package.metadata.winres] | ||
OriginalFileName = "TimerSet.exe" | ||
|
@@ -14,15 +14,12 @@ default = [] | |
|
||
[dependencies] | ||
log = "0.4" | ||
paw = "1.0" | ||
winreg = "0.8" | ||
fern = { version = "0.6", features = ["colored"] } | ||
chrono = "0.4" | ||
|
||
[dependencies.structopt] | ||
version = "0.3" | ||
default-features = false | ||
features = ["paw"] | ||
clap = { version = "3.0", features = ["derive"] } | ||
thiserror = "1.0" | ||
eyre = "0.6" | ||
time = { version = "0.3", features = ["formatting"] } | ||
winreg = "0.10" | ||
|
||
[dependencies.ntapi] | ||
version = "0.3" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,39 +13,68 @@ The program should be run from an elevated (ie. cmd => run as administrator) ter | |
Obviously, it only works on Windows. Confirmed to work on Windows 10 2004, but should run on pretty much any version of Windows since the used APIs are so old. | ||
|
||
```text | ||
timerset 0.3.0 | ||
timerset 0.4.1 | ||
Mathieu Amiot <[email protected]> | ||
TimerSet allows you to change your NT Kernel system timer | ||
Also allows you to monitor Windows Standby List and clean it up when needed | ||
TimerSet allows you to change your NT Kernel system timer Also allows you to monitor Windows Standby | ||
List and clean it up when needed | ||
USAGE: | ||
timerset.exe [FLAGS] [OPTIONS] | ||
FLAGS: | ||
--islc Enables Windows Standby List periodic cleaning. It is akin to how ISLC by Wagnard works. Please | ||
note that when enabling this, the program will **NOT** be idle at all times and will periodically | ||
poll the system memory to check whether a cleanup is needed or not | ||
-h, --help Prints help information | ||
-i, --install Installs TimerSet to your system and runs it on startup | ||
-u, --uninstall Uninstalls TimerSet from your system | ||
-v, --values Prints the possible timer value range for your system. Please note that it can depend on many | ||
factors such as HPET or dynamic/synthetic timers enabled or disabled | ||
-V, --version Prints version information | ||
timerset.exe [OPTIONS] | ||
OPTIONS: | ||
--islc-timer <clean-standby-list-poll-freq> | ||
Standby List periodic cleaning poll interval. Defaults to 10 seconds which should be enough for most systems | ||
without impacting performance [default: 10] | ||
--cscm <clear-standby-cached-mem> | ||
Cached memory threshold where the Windows Standby List will be cleared (in MB) Defaults to 1024MB (1GB) | ||
--cscm <CLEAR_STANDBY_CACHED_MEM> | ||
Cached memory threshold where the Windows Standby List will be cleared (in MB) Defaults | ||
to 1024MB (1GB) | ||
[default: 1024] | ||
--csfm <clear-standby-free-mem> | ||
Free memory threshold where the Windows Standby List will be cleared (in MB) Defaults to 1024MB (1GB) | ||
--csfm <CLEAR_STANDBY_FREE_MEM> | ||
Free memory threshold where the Windows Standby List will be cleared (in MB) Defaults to | ||
1024MB (1GB) | ||
[default: 1024] | ||
-t, --timer <timer> | ||
Allows to set a custom timer value in μs. Will be clamped between the bounds of allowed timer values. Also | ||
note that sometimes, setting high timer values are rejected by the system and will be lowered down depending | ||
on which clock source your system is using (TSC tends to lower values by 5μs, HPET does not for instance) | ||
-h, --help | ||
Print help information | ||
-i, --install | ||
Installs TimerSet to your system and runs it on startup | ||
--islc | ||
Enables Windows Standby List periodic cleaning. It is akin to how ISLC by Wagnard works | ||
--islc-timer <CLEAN_STANDBY_LIST_POLL_FREQ> | ||
Standby List anti-kernel DOS throttle timer It exists because | ||
CreateMemoryResourceNotification can trigger LowMemoryResourceNotifications thousands of | ||
times per second when they happen (i.e. every system page allocation in a high memory | ||
pressure situation, often 4KB) resulting in the memory list cleaning paralyzing the | ||
system with thousands of tries per second | ||
Defaults to 10 seconds which should be enough for most systems without impacting | ||
performance. | ||
[default: 10] | ||
-p, --pretend | ||
Shows the actions taken but do not modify anything on the system; Also known as a dry | ||
run | ||
-t, --timer <TIMER> | ||
Allows to set a custom timer value in μs. Will be clamped between the bounds of allowed | ||
timer values. Also note that sometimes, setting high timer values are rejected by the | ||
system and will be lowered down depending on which clock source your system is using | ||
(TSC tends to lower values by ~5μs, HPET does not for instance) | ||
-u, --uninstall | ||
Uninstalls TimerSet from your system | ||
-v, --values | ||
Prints the possible timer value range for your system. Please note that it can depend on | ||
many factors such as HPET or dynamic/synthetic timers enabled or disabled | ||
-V, --version | ||
Print version information | ||
``` | ||
|
||
## Examples | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum TimersetError { | ||
#[error(transparent)] | ||
TaskSchedulerError(#[from] crate::task_scheduler::TaskSchedulerError), | ||
#[error(transparent)] | ||
EnvVarError(#[from] std::env::VarError), | ||
#[error(transparent)] | ||
SetLoggerError(#[from] log::SetLoggerError), | ||
#[error(transparent)] | ||
IoError(#[from] std::io::Error), | ||
#[error("WindowsError: {0}")] | ||
WindowsError(std::io::Error), | ||
#[error(transparent)] | ||
Other(#[from] eyre::Report), | ||
} | ||
|
||
impl TimersetError { | ||
pub fn windows_error() -> Self { | ||
Self::WindowsError(std::io::Error::last_os_error()) | ||
} | ||
} | ||
|
||
pub type TimersetResult<T> = Result<T, TimersetError>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.