Skip to content

Unify sys impl under a trait #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xosnrdev
Copy link

@xosnrdev xosnrdev commented Aug 20, 2025

Hopefully satisfies:

//! TODO: This reminds me that the sys API should probably be a trait.

@xosnrdev
Copy link
Author

@microsoft-github-policy-service agree

@xosnrdev xosnrdev marked this pull request as draft August 20, 2025 21:00
@xosnrdev xosnrdev changed the title Refactor virtual memory implementation to use a trait Unify sys impl under a trait Aug 20, 2025
@lhecker
Copy link
Member

lhecker commented Aug 21, 2025

Thank you for working on this! Once you'd like me to review this, please feel free to unmark it as draft. 🙂

Comment on lines +131 to +134
let load_read_func = |module: *const u16| -> apperr::Result<ReadConsoleInputExW> {
get_module(module)
.and_then(|m| get_proc_address(m, c"ReadConsoleInputExW".as_ptr()))
}
}
STATE.read_console_input_ex = match load_read_func(w!("kernel32.dll")) {
Ok(func) => func,
Err(err) => match load_read_func(w!("kernelbase.dll")) {
.and_then(|m| Self::get_proc_address(m, c"ReadConsoleInputExW".as_ptr()))
};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured I should point this out.

Changed load_read_func into a closure since the nested fn couldn’t use Self and Clippy wasn’t happy tho behavior remains the same.

@xosnrdev xosnrdev marked this pull request as ready for review August 21, 2025 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants