Skip to content

Commit

Permalink
[ACLAYERS] Add shim to force "Aero" theme name
Browse files Browse the repository at this point in the history
Some programs designed to run on Windows Vista and later assume
that the theme is always named "Aero". On ReactOS the theme name
can be anything. One example of such a program is WPF (both the .NET
Framework and .NET 8/9 versions). Without a shim like this one,
WPF would not be able to determine its default resources and programs
that use it would suffer visual issues, if not outright crash.
  • Loading branch information
wjk committed Sep 13, 2024
1 parent bc76250 commit 5e9811a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions dll/appcompat/shims/layer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include_directories(${SHIMLIB_DIR})
spec2def(aclayers.dll layer.spec)

list(APPEND SOURCE
aero.c
dispmode.c
forcedxsetupsuccess.c
ignoreloadlibrary.c
Expand Down
34 changes: 34 additions & 0 deletions dll/appcompat/shims/layer/aero.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* PROJECT: ReactOS 'Layers' Shim library
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Display settings related shims
* COPYRIGHT: Copyright 2024 William Kent (wjk011@gmail.com)
*/

#include "string.h"
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <shimlib.h>
#include <strsafe.h>

#define SHIM_NS AeroThemeName
#include <setup_shim.inl>

HRESULT WINAPI SHIM_OBJ_NAME(GetCurrentThemeNameRedirect)(
LPWSTR pszThemeName, int cchThemeName,
LPWSTR pszColor, int cchColor,
LPWSTR pszSize, int cchSize)
{
StringCbCopyW(pszThemeName, cchThemeName, L"Aero");
if (pszColor != NULL) StringCbCopyW(pszColor, cchColor, L"NormalColor");
if (pszSize != NULL) StringCbCopyW(pszSize, cchSize, L"Normal");

return S_OK;
}

#define SHIM_NUM_HOOKS 1
#define SHIM_SETUP_HOOKS \
SHIM_HOOK(0, "UXTHEME.DLL", "GetCurrentThemeName", SHIM_OBJ_NAME(GetCurrentThemeNameRedirect))

#include <implement_shim.inl>

0 comments on commit 5e9811a

Please sign in to comment.