Skip to content
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

Usability improvements #119

Open
Unkorunk opened this issue Mar 3, 2024 · 0 comments
Open

Usability improvements #119

Unkorunk opened this issue Mar 3, 2024 · 0 comments

Comments

@Unkorunk
Copy link

Unkorunk commented Mar 3, 2024

  1. Define the CTL_CODE macro and the IoGetCurrentIrpStackLocation function.

  2. Move constants and macros (such as FILE_DEVICE_UNKNOWN, METHOD_BUFFERED, and others) from this crate and windows-rs to a shared crate.
    Motivation: This enables the definition of IOCTL codes in a shared crate that can be linked to both the driver and application sides.

  3. Change the types of some constants, like IRP_MJ_* to usize, and IO_NO_INCREMENT to CCHAR. It would also be beneficial to define TRUE and FALSE as pub const TRUE: BOOLEAN = 1; and pub const FALSE: BOOLEAN = 0; respectively, or even better, eliminate all BOOLEAN types from the API and replace them with the plain Rust bool, although I understand that this might be nearly impossible.
    Motivation: To eliminate unnecessary type casting where it logically should not exist.

  4. Do something with __bindgen_anon_*.
    Motivation: The statement (*irp).IoStatus.__bindgen_anon_1.Status = status; looks very awkward, and it's also challenging to locate the needed field in more complex cases like (*irp).Tail.Overlay.__bindgen_anon_2.__bindgen_anon_1.CurrentStackLocation.

  5. In general, it would be beneficial if constants in constants.rs had types from types.rs.

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

No branches or pull requests

1 participant