-
Notifications
You must be signed in to change notification settings - Fork 49
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
Allocation / OS check optimization, Mingw updates #36
Conversation
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The inconsistent indentation was giving compiler warnings. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The preprocessor introduces a space between L and the string: L "abc" and GCC will fail to recognize this as one token. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Many things have improved in MinGW over the years and less special-casing is needed. Due to many DDK header files referring to each other without the ddk/ path prefix, we must tell make where to find the include/ddk folder, e.g. (Ubuntu 20.04): make host_prefix=i686-w64-mingw32 ddk=/usr/i686-w64-mingw32 driver or make host_prefix=x86_64-w64-mingw32 ddk=/usr/x86_64-w64-mingw32 driver
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Same includes for 32-bit as for 64-bit. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
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! :-) 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
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 |
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.
Thanks! |
Note that the current binaries built with GCC (MinGW on latest Debian) don't load in Windows 10 ( 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.