diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-21 20:51:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-21 20:51:00 +0000 |
commit | 84be8cac6b77c52ddf451b7634c8466cce1f4671 (patch) | |
tree | c9b109a46fa5696f74c9c4b4d4d04632a4e6f56b /src | |
parent | 932f5569c467683d3b95c45772da903d3117dc11 (diff) |
MS_SYSTEM_RESTART moved to mir_core
git-svn-id: http://svn.miranda-ng.org/main/trunk@14312 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-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");
}
|