fix: Windows native code bugs and dedup

- fix unsigned underflow in Utf8FromUtf16 when WideCharToMultiByte fails
- fix inverted freopen_s logic in console attach
- remove misleading WS_EX_APPWINDOW from GWL_STYLE mask
- close mutex handle on normal exit
- extract SetHDRStateForTarget, EnableComposition/DisableComposition, DisplayModeToMap helpers
- cache GetWindowsVersion result
This commit is contained in:
edde746
2026-04-02 15:02:07 +02:00
parent 29101c310b
commit da95901d39
8 changed files with 87 additions and 125 deletions
+1
View File
@@ -57,5 +57,6 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
}
::CoUninitialize();
CloseHandle(mutex);
return EXIT_SUCCESS;
}