summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/database/dbini.cpp8
-rw-r--r--src/modules/plugins/newplugins.cpp21
2 files changed, 23 insertions, 6 deletions
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index c065949ee4..1af0132f2d 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -480,11 +480,11 @@ static INT_PTR CheckIniImportNow(WPARAM, LPARAM)
int InitIni(void)
{
- TCHAR szMirandaDir[MAX_PATH];
-
bModuleInitialized = true;
DoAutoExec();
+
+ TCHAR szMirandaDir[MAX_PATH];
PathToAbsoluteT(_T("."), szMirandaDir, NULL);
hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
@@ -496,7 +496,9 @@ int InitIni(void)
void UninitIni(void)
{
- if ( !bModuleInitialized) return;
+ if ( !bModuleInitialized)
+ return;
+
CallService(MS_SYSTEM_REMOVEWAIT, (WPARAM)hIniChangeNotification, 0);
FindCloseChangeNotification(hIniChangeNotification);
}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index dd8c93840a..dec6102770 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -675,7 +675,7 @@ int LoadNewPluginsModule(void)
/* enable and disable as needed */
for (i=0; i < clistPlugins.getCount(); i++)
- SetPluginOnWhiteList(p->pluginname, clist != clistPlugins[i] ? 0 : 1);
+ SetPluginOnWhiteList(clistPlugins[i]->pluginname, clist != clistPlugins[i] ? 0 : 1);
/* now loop thru and load all the other plugins, do this in one pass */
for (i=0; i < pluginList.getCount(); i++) {
@@ -729,9 +729,24 @@ int LoadNewPluginsModuleInfos(void)
// look for all *.dll's
enumPlugins(scanPluginsDir, 0, 0);
// the database will select which db plugin to use, or fail if no profile is selected
- if ( LoadDatabaseModule()) return 1;
+ if ( LoadDatabaseModule())
+ return 1;
+
+ if (serviceModePlugin == NULL) {
+ LPCTSTR param = CmdLine_GetOption( _T("svc"));
+ if (param != NULL) {
+ size_t cbLen = _tcslen(param);
+ for (int i=0; i < servicePlugins.getCount(); i++) {
+ if ( !_tcsnicmp(servicePlugins[i]->pluginname, param, cbLen)) {
+ serviceModePlugin = servicePlugins[i];
+ break;
+ }
+ }
+ }
+ }
+
InitIni();
- // could validate the plugin entries here but internal modules arent loaded so can't call Load(void) in one pass
+ // could validate the plugin entries here but internal modules arent loaded so can't call Load(void) in one pass
return 0;
}