From cb2efce1a4fe9c89c5fef63b3aca63f3e63983fc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Aug 2019 13:41:45 +0300 Subject: obsolete services removed from core & replaced with functions --- src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + src/mir_app/src/miranda.cpp | 17 +++++------------ 3 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 2820883800..b44be34fa0 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -3,6 +3,7 @@ LIBRARY mir_app.mir EXPORTS Miranda_Close @1 NONAME CallProtoService @2 +Miranda_SetIdleCallback @3 NONAME Skin_LoadProtoIcon @4 Skin_LoadIcon @5 Button_FreeIcon_IcoLib @6 diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 6ed7f2a46a..a41e448502 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -3,6 +3,7 @@ LIBRARY mir_app.mir EXPORTS Miranda_Close @1 NONAME CallProtoService @2 +Miranda_SetIdleCallback @3 NONAME Skin_LoadProtoIcon @4 Skin_LoadIcon @5 Button_FreeIcon_IcoLib @6 diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 214a196012..8441e0ceea 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -173,15 +173,11 @@ static void __cdecl compactHeapsThread(void*) } } -void(*SetIdleCallback) (void) = nullptr; +void (*SetIdleCallback)(void) = nullptr; -static INT_PTR SystemSetIdleCallback(WPARAM, LPARAM lParam) +MIR_APP_DLL(void) Miranda_SetIdleCallback(void(__cdecl *pfnCallback)(void)) { - if (lParam && SetIdleCallback == nullptr) { - SetIdleCallback = (void(*)(void))lParam; - return 1; - } - return 0; + SetIdleCallback = pfnCallback; } static DWORD dwEventTime = 0; @@ -195,10 +191,9 @@ void checkIdle(MSG * msg) } } -static INT_PTR SystemGetIdle(WPARAM, LPARAM lParam) +MIR_APP_DLL(DWORD) Miranda_GetIdle() { - if (lParam) *(DWORD*)lParam = dwEventTime; - return 0; + return dwEventTime; } static int SystemShutdownProc(WPARAM, LPARAM) @@ -346,8 +341,6 @@ int WINAPI mir_main(LPTSTR cmdLine) HookEvent(ME_SYSTEM_SHUTDOWN, SystemShutdownProc); mir_forkthread(compactHeapsThread); - CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK, SystemSetIdleCallback); - CreateServiceFunction(MS_SYSTEM_GETIDLE, SystemGetIdle); dwEventTime = GetTickCount(); DWORD myPid = GetCurrentProcessId(); -- cgit v1.2.3