From: Mark Jansen Date: Fri, 16 Dec 2016 22:05:58 +0000 (+0000) Subject: [ACGENRAL] Implement the DisableThemes shim. CORE-11927 X-Git-Tag: ReactOS-0.4.4-FOSDEM2017~73 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f3f43843fe5a102367bd581b90f28323bf271ff3 [ACGENRAL] Implement the DisableThemes shim. CORE-11927 svn path=/trunk/; revision=73463 --- diff --git a/reactos/dll/appcompat/shims/CMakeLists.txt b/reactos/dll/appcompat/shims/CMakeLists.txt index 354ff57baf7..86b4326a2d1 100644 --- a/reactos/dll/appcompat/shims/CMakeLists.txt +++ b/reactos/dll/appcompat/shims/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(shimlib) +add_subdirectory(genral) add_subdirectory(layer) diff --git a/reactos/dll/appcompat/shims/genral/CMakeLists.txt b/reactos/dll/appcompat/shims/genral/CMakeLists.txt new file mode 100644 index 00000000000..196488fd13b --- /dev/null +++ b/reactos/dll/appcompat/shims/genral/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${SHIMLIB_DIR}) + +spec2def(acgenral.dll genral.spec) + +list(APPEND SOURCE + main.c + themes.c + genral.spec) + +add_library(acgenral SHARED + ${SOURCE} + ${CMAKE_CURRENT_BINARY_DIR}/acgenral.def) + +set_module_type(acgenral win32dll) +target_link_libraries(acgenral shimlib) +add_importlibs(acgenral uxtheme msvcrt kernel32 ntdll) +add_cd_file(TARGET acgenral DESTINATION reactos/AppPatch FOR all) diff --git a/reactos/dll/appcompat/shims/genral/genral.spec b/reactos/dll/appcompat/shims/genral/genral.spec new file mode 100644 index 00000000000..6399d72ab09 --- /dev/null +++ b/reactos/dll/appcompat/shims/genral/genral.spec @@ -0,0 +1,3 @@ + +@ stdcall GetHookAPIs(str wstr ptr) +@ stdcall NotifyShims(long ptr) diff --git a/reactos/dll/appcompat/shims/genral/main.c b/reactos/dll/appcompat/shims/genral/main.c new file mode 100644 index 00000000000..37bd1251592 --- /dev/null +++ b/reactos/dll/appcompat/shims/genral/main.c @@ -0,0 +1,37 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Shim library + * FILE: dll/appcompat/shims/genral/main.c + * PURPOSE: Shim entrypoint + * PROGRAMMER: Mark Jansen + */ + +#include +#include +#include + +/* Forward to the generic implementation */ +PHOOKAPI WINAPI GetHookAPIs(IN LPCSTR szCommandLine, IN LPCWSTR wszShimName, OUT PDWORD pdwHookCount) +{ + return ShimLib_GetHookAPIs(szCommandLine, wszShimName, pdwHookCount); +} + +/* Forward to the generic implementation */ +BOOL WINAPI NotifyShims(DWORD fdwReason, PVOID ptr) +{ + return ShimLib_NotifyShims(fdwReason, ptr); +} + +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) +{ + switch(dwReason) + { + case DLL_PROCESS_ATTACH: + ShimLib_Init(hInstance); + break; + case DLL_PROCESS_DETACH: + ShimLib_Deinit(); + break; + } + return TRUE; +} diff --git a/reactos/dll/appcompat/shims/genral/themes.c b/reactos/dll/appcompat/shims/genral/themes.c new file mode 100644 index 00000000000..73d258795d0 --- /dev/null +++ b/reactos/dll/appcompat/shims/genral/themes.c @@ -0,0 +1,31 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Shim library + * FILE: dll/appcompat/shims/genral/themes.c + * PURPOSE: Theme related shims + * PROGRAMMER: Mark Jansen + */ + +#include +#include +#include +#include + + +#define SHIM_NS DisableThemes +#include + +#define SHIM_NUM_HOOKS 0 +#define SHIM_NOTIFY_FN SHIM_OBJ_NAME(Notify) + +BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason, PVOID ptr) +{ + if (fdwReason == SHIM_REASON_INIT) + { + SetThemeAppProperties(0); + } + return TRUE; +} + +#include +