Closed tormodvolden closed 1 year ago
@dontech
Please review the changes when you are available. Thanks.
Take note we do not officially support MinGW for the driver building. Still please review the changes to see if the changes are good to have or not.
I think it looks great! :-) Thanks for the patches Tormod!
One question: What does the optimization do? Does it improve speed or anything else?
I guess no noticeable difference. But before, on every memory allocation the OS version was retrieved through a library function and the pool type determined. Now this is done only once when the driver is loaded, and the pool type is accessed through a simple variable.
Hi @mcuee
Take note we do not officially support MinGW for the driver building. Still please review the changes to see if the changes are good to have or not.
No, but building using other compilers (and testing) is always great as it reveals bugs and problems from a new angle.
Super work @tormodvolden
Thanks,
/pedro
No, but building using other compilers (and testing) is always great as it reveals bugs and problems from a new angle.
Indeed, GCC discovers a lot of things, mostly formal issues that might not influence the execution but sometimes they may. I reran compilation with GCC 12 now and there are many new warnings to look at.
Super work @tormodvolden
Thanks!
Note that the current binaries built with GCC (MinGW on latest Debian) don't load in Windows 10 ({Driver Entry Point Not Found} The %hs device driver could not locate the entry point %hs in driver %hs.
)
However it should be possible (as demonstrated by projects like https://github.com/utoni/mingw-w64-dpp) so I hope to figure it out one day.
The first commit was originally motivated by plans for other functions needing run-time OS version checks, but I have dropped those. It makes sense anyway.
The remaining commits are safe clean-ups and MinGW-only changes. The GUID macro changes were compile-tested on WDK by mcuee along with the rest.
The extra IRP debug printing can be omitted, but these events are relatively rare so it should not spam the debug log too much.