From 90ac51de59d343ab1fc1c882a1888d6d41e166e9 Mon Sep 17 00:00:00 2001 From: Brady McDermott Date: Sat, 27 Jul 2024 21:39:55 -0600 Subject: [PATCH] rollin broadway --- CscdSvc/export.def | 4 ++-- CscdSvc/hook.c | 18 +++--------------- CscdSvc/svc.c | 2 -- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/CscdSvc/export.def b/CscdSvc/export.def index e4dbe66..428c4bf 100644 --- a/CscdSvc/export.def +++ b/CscdSvc/export.def @@ -1,5 +1,5 @@ LIBRARY CSCDSVC EXPORTS - InstallUserHook @1 - InitUserHook @2 + InitUserHook @1 + InstallUserHook @2 RemoveUserHook @3 diff --git a/CscdSvc/hook.c b/CscdSvc/hook.c index 92efcbd..24a7540 100644 --- a/CscdSvc/hook.c +++ b/CscdSvc/hook.c @@ -40,7 +40,6 @@ BOOL g_bThemeHooksActive = FALSE; __declspec(dllexport) BOOL CALLBACK InstallUserHook() { WCHAR szFullPath[MAX_PATH]; - WCHAR szQuotedPath[MAX_PATH + 2]; // + 2 for the quotation marks USERAPIHOOKINFO uah; OutputDebugString(TEXT("InstallUserHook called\n")); @@ -55,20 +54,13 @@ __declspec(dllexport) BOOL CALLBACK InstallUserHook() // Get our current directory and filename GetModuleFileName(g_hModule, szFullPath, ARRAYSIZE(szFullPath)); - // In case the path contains a space, it must be quoted so that - // it is correctly interpreted. For example, - // "d:\my share\myservice.exe" should be specified as - // ""d:\my share\myservice.exe"". - StringCbPrintf(szQuotedPath, MAX_PATH, TEXT("\"%s\""), szFullPath); - - SvcMessageEvent(szQuotedPath); // Fill out the ApiHookInfo structure uah.m_size = sizeof(uah); uah.m_funname1 = L"InitUserHook"; - uah.m_dllname1 = szQuotedPath; - uah.m_funname2 = NULL; - uah.m_dllname2 = NULL; + uah.m_dllname1 = szFullPath; + uah.m_funname2 = L"InitUserHook"; + uah.m_dllname2 = szFullPath; // ApiHook is not support on Windows // 2000 or below! @@ -83,8 +75,6 @@ __declspec(dllexport) BOOL CALLBACK InitUserHook(UAPIHK State, PUSERAPIHOOK puah { OutputDebugString(TEXT("InitUserHook called\n")); - SvcMessageEvent(TEXT("InitUserHook called")); - // Don't initialize if the state isn't appropriate. if (!puah || State != uahLoadInit) { @@ -94,8 +84,6 @@ __declspec(dllexport) BOOL CALLBACK InitUserHook(UAPIHK State, PUSERAPIHOOK puah OutputDebugString(TEXT("InitUserHook initializing\n")); - SvcMessageEvent(TEXT("InitUserHook initializing")); - /* Store the original functions from user32 */ g_user32ApiHook = *puah; diff --git a/CscdSvc/svc.c b/CscdSvc/svc.c index 340d0c0..e4715b4 100644 --- a/CscdSvc/svc.c +++ b/CscdSvc/svc.c @@ -289,8 +289,6 @@ VOID SvcInit(DWORD dwArgc, LPTSTR* lpszArgv) return; } - SvcMessageEvent(TEXT("InstallUserHook")); - while (TRUE) { // Check whether to stop the service.