diff options
Diffstat (limited to 'plugins/Db3x_mmap/dbevents.cpp')
-rw-r--r-- | plugins/Db3x_mmap/dbevents.cpp | 67 |
1 files changed, 30 insertions, 37 deletions
diff --git a/plugins/Db3x_mmap/dbevents.cpp b/plugins/Db3x_mmap/dbevents.cpp index 5576455daf..76d1cd4a28 100644 --- a/plugins/Db3x_mmap/dbevents.cpp +++ b/plugins/Db3x_mmap/dbevents.cpp @@ -28,45 +28,8 @@ extern BOOL safetyMode; 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;
@@ -447,3 +410,33 @@ 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);
+
+ hEventAddedEvent = CreateHookableEvent(ME_DB_EVENT_ADDED);
+ hEventDeletedEvent = CreateHookableEvent(ME_DB_EVENT_DELETED);
+ hEventFilterAddedEvent = CreateHookableEvent(ME_DB_EVENT_FILTER_ADD);
+ return 0;
+}
+
+void UninitEvents(void)
+{
+ DestroyHookableEvent(hEventAddedEvent); hEventAddedEvent = 0;
+ DestroyHookableEvent(hEventDeletedEvent); hEventDeletedEvent = 0;
+ DestroyHookableEvent(hEventFilterAddedEvent); hEventFilterAddedEvent = 0;
+}
|