summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-06 15:47:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-06 15:47:34 +0000
commit3d03ebefdd8f81e84275d858be1aa56aae1e12f1 (patch)
treef4a1fe6b2756a19549538125e3befc0e053306d2 /src/mir_core
parent3c86f787291fd5cdc88ea4a0ae8501b5ad413429 (diff)
parameter added to MS_SYSTEM_RESTART: a path to Miranda's binary
git-svn-id: http://svn.miranda-ng.org/main/trunk@16927 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/miranda.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp
index bc926d1c9a..f5a2997367 100644
--- a/src/mir_core/src/miranda.cpp
+++ b/src/mir_core/src/miranda.cpp
@@ -48,13 +48,14 @@ DWORD mir_tls = 0;
/////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR RestartMiranda(WPARAM wParam, LPARAM)
+static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam)
{
TCHAR mirandaPath[MAX_PATH], cmdLine[MAX_PATH];
- PROCESS_INFORMATION pi;
- STARTUPINFO startupInfo = { 0 };
- startupInfo.cb = sizeof(startupInfo);
- GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
+ if (lParam)
+ _tcsncpy_s(mirandaPath, (const TCHAR*)lParam, _TRUNCATE);
+ else
+ GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
+
if (wParam) {
VARST profilename(_T("%miranda_profilename%"));
mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
@@ -62,6 +63,10 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM)
else mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
+
+ PROCESS_INFORMATION pi;
+ STARTUPINFO startupInfo = { 0 };
+ startupInfo.cb = sizeof(startupInfo);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &pi);
return 0;
}