diff options
| author | Alexandr Miloslavskiy | 2020-10-22 13:52:29 +0000 |
|---|---|---|
| committer | Alexandr Miloslavskiy | 2020-10-22 15:22:59 +0000 |
| commit | ab8ece62ce0407305d99c0713a94461a49cf9788 (patch) | |
| tree | fb3ed724edf48f973d88b7d4977a50e1727884dd | |
| parent | 349b9b5d0d359d6f2f3875216fbec217ebbb3daa (diff) | |
| download | eclipse.platform.swt-ab8ece62ce0407305d99c0713a94461a49cf9788.tar.gz eclipse.platform.swt-ab8ece62ce0407305d99c0713a94461a49cf9788.tar.xz eclipse.platform.swt-ab8ece62ce0407305d99c0713a94461a49cf9788.zip | |
Bug 568108 - [Win32][DarkTheme] Support Windows 10 October 2020 Update
Windows update introduces small changes, causing SWT safeguards to no
longer recognize undocumented 'AllowDarkModeForWindow()' in uxtheme.dll.
The function itself is good, so only an update for safeguards is needed.
Change-Id: I867c1aad76d5a582a8cc204562471989cac0941a
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c index 20a24a54a6..9e49f8f623 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c @@ -51,11 +51,27 @@ JNIEXPORT jlong JNICALL OS_NATIVE(GetLibraryHandle) BOOL Validate_AllowDarkModeForWindow(const BYTE* functionPtr) { + /* + * 'AllowDarkModeForWindow' is rather long, but it uses + * an ATOM value of 0xA91E which is unlikely to change + */ + #ifdef _M_X64 - /* This function is rather long, but it uses an ATOM value of 0xA91E which is unlikely to change */ - return - (functionPtr[0x15] == 0xBA) && // mov edx, - (*(const DWORD*)(functionPtr + 0x16) == 0xA91E); // 0A91Eh + /* Win10 builds from 20236 */ + if ((functionPtr[0x52] == 0xBA) && // mov edx, + (*(const DWORD*)(functionPtr + 0x53) == 0xA91E)) // 0A91Eh + { + return TRUE; + } + + /* Win10 builds from 17763 to 19041 */ + if ((functionPtr[0x15] == 0xBA) && // mov edx, + (*(const DWORD*)(functionPtr + 0x16) == 0xA91E)) // 0A91Eh + { + return TRUE; + } + + return FALSE; #else #error Unsupported processor type #endif |
