From f257ef8eebbf564d5baac5b86b8894f1532b2872 Mon Sep 17 00:00:00 2001 From: Brady McDermott Date: Sun, 28 Jul 2024 01:16:20 -0600 Subject: [PATCH] uxtheme go away come again another day --- CscdSvc/hook.c | 23 ++++++++++++++++++++++- CscdSvc/hook.h | 2 ++ CscdSvc/svc.c | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CscdSvc/hook.c b/CscdSvc/hook.c index 91d749a..2c5bf43 100644 --- a/CscdSvc/hook.c +++ b/CscdSvc/hook.c @@ -55,7 +55,6 @@ __declspec(dllexport) BOOL CALLBACK InstallUserHook() // Get our current directory and filename GetModuleFileName(g_hModule, szFullPath, ARRAYSIZE(szFullPath)); - // Fill out the ApiHookInfo structure uah.m_size = sizeof(uah); uah.m_funname1 = L"InitUserHook"; @@ -334,3 +333,25 @@ static BOOL WINAPI UnregisterUserApiHookRemote(VOID) return TRUE; } + +/* * * *\ + ExternUnregisterUserApiHookDelay - + Forward function + RETURNS - + TRUE if successful. +\* * * */ +BOOL WINAPI ExternUnregisterUserApiHookDelay(VOID) +{ + UnregisterUserApiHookDelay(); +} + +/* * * *\ + ExternUnregisterUserApiHookRemote - + Forward function + RETURNS - + TRUE if successful. +\* * * */ +BOOL WINAPI ExternUnregisterUserApiHookRemote(VOID) +{ + return UnregisterUserApiHookRemote(); +} diff --git a/CscdSvc/hook.h b/CscdSvc/hook.h index ee25ace..b123cdb 100644 --- a/CscdSvc/hook.h +++ b/CscdSvc/hook.h @@ -31,3 +31,5 @@ __declspec(dllexport) BOOL CALLBACK RemoveUserHook(VOID); BOOL WINAPI RegisterUserApiHookDelay(HINSTANCE hInstance, PUSERAPIHOOKINFO ApiHookInfo); static BOOL WINAPI UnregisterUserApiHookDelay(VOID); static BOOL WINAPI UnregisterUserApiHookRemote(VOID); +BOOL WINAPI ExternUnregisterUserApiHookDelay(VOID); +BOOL WINAPI ExternUnregisterUserApiHookRemote(VOID); diff --git a/CscdSvc/svc.c b/CscdSvc/svc.c index e4715b4..534e3ed 100644 --- a/CscdSvc/svc.c +++ b/CscdSvc/svc.c @@ -278,7 +278,8 @@ VOID SvcInit(DWORD dwArgc, LPTSTR* lpszArgv) // Report running status when initialization is complete. ReportSvcStatus(SERVICE_RUNNING, NO_ERROR, 0); - // TO_DO: Perform work until service stops. + // Kill UxTheme for good + ExternUnregisterUserApiHookRemote(); // Install our user hook, if FALSE then fail. if (!InstallUserHook())