Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
IoGetCurrentIrpStackLocation
function in ntddk.rs
This commit adds the `IoGetCurrentIrpStackLocation` function, which retrieves a pointer to the caller's I/O stack location from a given IRP. - The function is implemented to access raw pointers and union fields. - Documentation has been added to describe the parameters, return value, and safety considerations. - The function includes an `assert!` to ensure `CurrentLocation` is valid, guarding against invalid IRPs. This was implemented as per the original C implementation. ## Safety This function requires the caller to guarantee that the provided IRP pointer is valid and properly initialised, as it operates on raw memory. Future improvements could include replacing the `assert!` with proper error handling or returning an `Option` to handle invalid IRPs gracefully. Given that the original implementation in the C libraries does not implement this behaviour, I have not added it to this commit, but can amend if required.
- Loading branch information