Closed DVSProductions closed 4 years ago
Thanks for pointing out bus and I used another way to fix. https://github.com/ysc3839/win32-darkmode/commit/1fe9d131b7d1973ffbf1f98675fd6b402b238434 https://github.com/ysc3839/win32-darkmode/commit/bb241c369fee7b56440420179654bb487f7259cd
If comctl32.dll has not been loaded for some reason,
FixDarkScrollBar
will crash the application. The changes in IatHook.h ensure that a null moduleBase is not accepted and FixDarkScrollBar returns without crashes. (This may not be immediately relevant to the demo application, but the issue may arise in derivatives)The second fix is for
reinterpret_cast<HANDLE>(dark)
. If the application is built for 64 bit systemsHANDLE
converts to avoid *
with a width of 64 Bit. ButBOOL
remains anint
. Reinterpreting the smaller type to a larger one can potentially cause fatal crashes because the new 32 bits are random data. To fix this I have added a preprocessor check, but this may be solved a bit more elegantly.