summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-07-12 13:10:56 +0000
committerRobert Pösel <robyer@seznam.cz>2012-07-12 13:10:56 +0000
commitea0f78b397cc5acc88d286ef0c78e9aeafbf242d (patch)
treeacbea0a18a2eb9a9a0115f8116c34ec0a0725666
parentf53121766f887f34a489c06669735ccbd2a859ab (diff)
WUMF: don't block whole plugin without admin privileges, but only monitoring.
git-svn-id: http://svn.miranda-ng.org/main/trunk@921 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/WhoUsesMyFiles/wumf.c6
-rw-r--r--plugins/WhoUsesMyFiles/wumfplug.c14
2 files changed, 12 insertions, 8 deletions
diff --git a/plugins/WhoUsesMyFiles/wumf.c b/plugins/WhoUsesMyFiles/wumf.c
index 524648185e..03aa576d38 100644
--- a/plugins/WhoUsesMyFiles/wumf.c
+++ b/plugins/WhoUsesMyFiles/wumf.c
@@ -109,7 +109,11 @@ int CALLBACK ConnDlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
ListView_InsertColumn(hList, 3, &lvc);
KillTimer(NULL, 777);
lst = cpy_list(&list);
- SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
+ if (IsUserAnAdmin()) {
+ SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
+ } else {
+ MessageBox(NULL, "Plugin WhoUsesMyFiles requires admin privileges in order to work.", "Miranda IM", MB_OK);
+ }
ShowList(lst, hList);
Utils_RestoreWindowPosition(hWnd, NULL, ModuleName,"conn");
break;
diff --git a/plugins/WhoUsesMyFiles/wumfplug.c b/plugins/WhoUsesMyFiles/wumfplug.c
index 9bcb59540b..8c54f36990 100644
--- a/plugins/WhoUsesMyFiles/wumfplug.c
+++ b/plugins/WhoUsesMyFiles/wumfplug.c
@@ -294,11 +294,6 @@ static INT_PTR WumfMenuCommand(WPARAM wParam,LPARAM lParam)
__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
- if (!IsUserAnAdmin()) {
- MessageBox(NULL, "Plugin WhoUsesMyFiles cannot be loaded. It requires admin privileges.", "Miranda IM", MB_OK);
- return NULL;
- }
-
return &pluginInfo;
}
@@ -622,9 +617,14 @@ __declspec(dllexport) int Load(void)
HookEvent(ME_TTB_MODULELOADED, InitTopToolbar);
setlocale( LC_ALL, ".ACP");
// _setmbcp(_MB_CP_ANSI);
- SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
- return 0;
+ if (IsUserAnAdmin()) {
+ SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
+ } else {
+ MessageBox(NULL, "Plugin WhoUsesMyFiles requires admin privileges in order to work.", "Miranda IM", MB_OK);
+ }
+
+ return 0;
}
__declspec(dllexport) int Unload(void)