diff options
-rw-r--r-- | src/mir_app/src/utils.cpp | 21 | ||||
-rw-r--r-- | 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 @@ -47,6 +47,26 @@ 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
static LRESULT CALLBACK APCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -92,6 +112,8 @@ static void LoadCoreModule(void) InitialiseModularEngine();
InitMetaContacts();
+ CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda);
+
pfnRtlGenRandom = (PGENRANDOM)GetProcAddress(GetModuleHandleA("advapi32"), "SystemFunction036");
}
|