From 84be8cac6b77c52ddf451b7634c8466cce1f4671 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 21 Jun 2015 20:51:00 +0000 Subject: MS_SYSTEM_RESTART moved to mir_core git-svn-id: http://svn.miranda-ng.org/main/trunk@14312 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/utils.cpp | 21 --------------------- src/mir_core/src/miranda.cpp | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/mir_app/src/utils.cpp b/src/mir_app/src/utils.cpp index 8efafe2673..f62f41f574 100644 --- a/src/mir_app/src/utils.cpp +++ b/src/mir_app/src/utils.cpp @@ -319,26 +319,6 @@ static INT_PTR GetCountryList(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// -static INT_PTR RestartMiranda(WPARAM wParam, LPARAM) -{ - TCHAR mirandaPath[MAX_PATH], cmdLine[MAX_PATH]; - PROCESS_INFORMATION pi; - STARTUPINFO si = {0}; - si.cb = sizeof(si); - GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath)); - if (wParam) { - VARST profilename( _T("%miranda_profilename%")); - mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename); - } - else mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId()); - - CallService("CloseAction", 0, 0); - CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - int LoadUtilsModule(void) { bModuleInitialized = TRUE; @@ -348,7 +328,6 @@ int LoadUtilsModule(void) CreateServiceFunction(MS_UTILS_GETCOUNTRYLIST, GetCountryList); CreateServiceFunction(MS_UTILS_ENTERSTRING, svcEnterString); - CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda); InitPathUtils(); InitCrypt(); diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index 3cbbba3086..c1c0518444 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -46,6 +46,26 @@ HINSTANCE hInst = 0; HANDLE hStackMutex, hThreadQueueEmpty; DWORD mir_tls = 0; +///////////////////////////////////////////////////////////////////////////////////////// + +static INT_PTR RestartMiranda(WPARAM wParam, LPARAM) +{ + TCHAR mirandaPath[MAX_PATH], cmdLine[MAX_PATH]; + PROCESS_INFORMATION pi; + STARTUPINFO si = { 0 }; + si.cb = sizeof(si); + GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath)); + if (wParam) { + VARST profilename(_T("%miranda_profilename%")); + mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename); + } + else mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId()); + + CallService("CloseAction", 0, 0); + CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + return 0; +} + ///////////////////////////////////////////////////////////////////////////////////////// // module init @@ -92,6 +112,8 @@ static void LoadCoreModule(void) InitialiseModularEngine(); InitMetaContacts(); + CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda); + pfnRtlGenRandom = (PGENRANDOM)GetProcAddress(GetModuleHandleA("advapi32"), "SystemFunction036"); } -- cgit v1.2.3