summaryrefslogtreecommitdiff
path: root/plugins/Db3x/dbevents.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-28 15:05:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-28 15:05:21 +0000
commita1b54aadf426b4ce2ce3c900a889f53f1eec6bce (patch)
tree44fa2c5f6ecff873ccf332dd3bf0fd4ccff2ebe5 /plugins/Db3x/dbevents.cpp
parentb91e3f8d37797d53b115dd5dd862953a2c595e5f (diff)
patch for crash on exit
git-svn-id: http://svn.miranda-ng.org/main/trunk@668 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x/dbevents.cpp')
-rw-r--r--plugins/Db3x/dbevents.cpp64
1 files changed, 27 insertions, 37 deletions
diff --git a/plugins/Db3x/dbevents.cpp b/plugins/Db3x/dbevents.cpp
index 10d04c180e..be50babe57 100644
--- a/plugins/Db3x/dbevents.cpp
+++ b/plugins/Db3x/dbevents.cpp
@@ -26,45 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
DWORD GetModuleNameOfs(const char *szName);
char *GetModuleNameByOfs(DWORD ofs);
-static INT_PTR GetEventCount(WPARAM wParam,LPARAM lParam);
-static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR GetBlobSize(WPARAM wParam,LPARAM lParam);
-static INT_PTR GetEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam);
-static INT_PTR GetEventContact(WPARAM wParam,LPARAM lParam);
-static INT_PTR FindFirstEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR FindFirstUnreadEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR FindLastEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR FindNextEvent(WPARAM wParam,LPARAM lParam);
-static INT_PTR FindPrevEvent(WPARAM wParam,LPARAM lParam);
-
static HANDLE hEventDeletedEvent,hEventAddedEvent,hEventFilterAddedEvent;
-int InitEvents(void)
-{
- CreateServiceFunction(MS_DB_EVENT_GETCOUNT,GetEventCount);
- CreateServiceFunction(MS_DB_EVENT_ADD,AddEvent);
- CreateServiceFunction(MS_DB_EVENT_DELETE,DeleteEvent);
- CreateServiceFunction(MS_DB_EVENT_GETBLOBSIZE,GetBlobSize);
- CreateServiceFunction(MS_DB_EVENT_GET,GetEvent);
- CreateServiceFunction(MS_DB_EVENT_MARKREAD,MarkEventRead);
- CreateServiceFunction(MS_DB_EVENT_GETCONTACT,GetEventContact);
- CreateServiceFunction(MS_DB_EVENT_FINDFIRST,FindFirstEvent);
- CreateServiceFunction(MS_DB_EVENT_FINDFIRSTUNREAD,FindFirstUnreadEvent);
- CreateServiceFunction(MS_DB_EVENT_FINDLAST,FindLastEvent);
- CreateServiceFunction(MS_DB_EVENT_FINDNEXT,FindNextEvent);
- CreateServiceFunction(MS_DB_EVENT_FINDPREV,FindPrevEvent);
- hEventDeletedEvent=CreateHookableEvent(ME_DB_EVENT_DELETED);
- hEventAddedEvent=CreateHookableEvent(ME_DB_EVENT_ADDED);
- hEventFilterAddedEvent=CreateHookableEvent(ME_DB_EVENT_FILTER_ADD);
- return 0;
-}
-
-void UninitEvents(void)
-{
-}
-
static INT_PTR GetEventCount(WPARAM wParam,LPARAM lParam)
{
INT_PTR ret;
@@ -433,3 +396,30 @@ static INT_PTR FindPrevEvent(WPARAM wParam,LPARAM lParam)
LeaveCriticalSection(&csDbAccess);
return ret;
}
+
+int InitEvents(void)
+{
+ CreateServiceFunction(MS_DB_EVENT_GETCOUNT,GetEventCount);
+ CreateServiceFunction(MS_DB_EVENT_ADD,AddEvent);
+ CreateServiceFunction(MS_DB_EVENT_DELETE,DeleteEvent);
+ CreateServiceFunction(MS_DB_EVENT_GETBLOBSIZE,GetBlobSize);
+ CreateServiceFunction(MS_DB_EVENT_GET,GetEvent);
+ CreateServiceFunction(MS_DB_EVENT_MARKREAD,MarkEventRead);
+ CreateServiceFunction(MS_DB_EVENT_GETCONTACT,GetEventContact);
+ CreateServiceFunction(MS_DB_EVENT_FINDFIRST,FindFirstEvent);
+ CreateServiceFunction(MS_DB_EVENT_FINDFIRSTUNREAD,FindFirstUnreadEvent);
+ CreateServiceFunction(MS_DB_EVENT_FINDLAST,FindLastEvent);
+ CreateServiceFunction(MS_DB_EVENT_FINDNEXT,FindNextEvent);
+ CreateServiceFunction(MS_DB_EVENT_FINDPREV,FindPrevEvent);
+ hEventDeletedEvent=CreateHookableEvent(ME_DB_EVENT_DELETED);
+ hEventAddedEvent=CreateHookableEvent(ME_DB_EVENT_ADDED);
+ hEventFilterAddedEvent=CreateHookableEvent(ME_DB_EVENT_FILTER_ADD);
+ return 0;
+}
+
+void UninitEvents(void)
+{
+ DestroyHookableEvent(hEventAddedEvent); hEventAddedEvent = 0;
+ DestroyHookableEvent(hEventDeletedEvent); hEventDeletedEvent = 0;
+ DestroyHookableEvent(hEventFilterAddedEvent); hEventFilterAddedEvent = 0;
+}