diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-04 12:37:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-04 12:37:38 +0000 |
commit | 88ec2ae53ddc811d08763b2fb3a0073b571a321c (patch) | |
tree | 8a2048209c9494d55ca8d565d1942833e8bff230 | |
parent | fd97f5275ed5f18651c4cb7d7de397fbd5edf226 (diff) |
these fixes aren't needed anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@755 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Db3x/dbsettings.cpp | 10 | ||||
-rw-r--r-- | plugins/Db3x_mmap/dbsettings.cpp | 8 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/dbsettings.cpp | 48 | ||||
-rw-r--r-- | plugins/Dbx_tree/Compatibility.cpp | 20 |
4 files changed, 25 insertions, 61 deletions
diff --git a/plugins/Db3x/dbsettings.cpp b/plugins/Db3x/dbsettings.cpp index c8eb18c208..209b7a13ab 100644 --- a/plugins/Db3x/dbsettings.cpp +++ b/plugins/Db3x/dbsettings.cpp @@ -941,13 +941,6 @@ static int stringCompare2( DBCachedGlobalValue* p1, DBCachedGlobalValue* p2 ) return strcmp( p1->name, p2->name );
}
-static int OnPreShutdown(WPARAM, LPARAM)
-{
- DestroyHookableEvent(hSettingChangeEvent);
- hSettingChangeEvent = 0;
- return 0;
-}
-
int InitSettings(void)
{
CreateServiceFunction(MS_DB_CONTACT_GETSETTING,GetContactSetting);
@@ -958,9 +951,8 @@ int InitSettings(void) CreateServiceFunction(MS_DB_CONTACT_DELETESETTING,DeleteContactSetting);
CreateServiceFunction(MS_DB_CONTACT_ENUMSETTINGS,EnumContactSettings);
CreateServiceFunction(MS_DB_SETSETTINGRESIDENT,SetSettingResident);
-
+
hSettingChangeEvent = CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
mirCp = CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 );
diff --git a/plugins/Db3x_mmap/dbsettings.cpp b/plugins/Db3x_mmap/dbsettings.cpp index c569357567..5bdc0707f6 100644 --- a/plugins/Db3x_mmap/dbsettings.cpp +++ b/plugins/Db3x_mmap/dbsettings.cpp @@ -975,13 +975,6 @@ static int stringCompare2( char* p1, char* p2 ) return strcmp( p1, p2);
}
-static int OnPreShutdown(WPARAM, LPARAM)
-{
- DestroyHookableEvent(hSettingChangeEvent);
- hSettingChangeEvent = 0;
- return 0;
-}
-
int InitSettings(void)
{
CreateServiceFunction(MS_DB_CONTACT_GETSETTING,GetContactSetting);
@@ -995,7 +988,6 @@ int InitSettings(void) CreateServiceFunction("DB/ResidentSettings/Enum",EnumResidentSettings);
hSettingChangeEvent = CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
hCacheHeap = HeapCreate(0, 0, 0);
lSettings.sortFunc = (FSortFunc)stringCompare;
diff --git a/plugins/Dbx_mmap_SA/dbsettings.cpp b/plugins/Dbx_mmap_SA/dbsettings.cpp index fd839ab258..469abc97fd 100644 --- a/plugins/Dbx_mmap_SA/dbsettings.cpp +++ b/plugins/Dbx_mmap_SA/dbsettings.cpp @@ -991,7 +991,7 @@ void EncodeContactSettings(HANDLE hContact) if(contact -> ofsFirstSettings){
setting = (struct DBContactSettings *)DBRead(contact -> ofsFirstSettings, sizeof(struct DBContactSettings), NULL);
offset = contact -> ofsFirstSettings;
- do{
+ do{
DWORD ofsBlobPtr;
PBYTE pBlob;
int bytesRemaining;
@@ -1009,21 +1009,21 @@ void EncodeContactSettings(HANDLE hContact) NeedBytes(1+pBlob[0]);
//CopyMemory(szSetting,pBlob+1,pBlob[0]); szSetting[pBlob[0]]=0;
MoveAlong(1+pBlob[0]);
-
+
NeedBytes(5);
-
+
switch(pBlob[0]) {
case DBVT_DELETED: break;
case DBVT_BYTE: break;
- case DBVT_WORD:
- {
+ case DBVT_WORD:
+ {
CryptoEngine->EncryptMem(pBlob+1, 2, key);
break;
}
- case DBVT_DWORD:
- {
+ case DBVT_DWORD:
+ {
CryptoEngine->EncryptMem(pBlob+1, 4, key);
- break;
+ break;
}
case DBVT_UTF8:
case DBVT_ASCIIZ:
@@ -1035,7 +1035,7 @@ void EncodeContactSettings(HANDLE hContact) CryptoEngine->EncryptMem(pBlob+3, len, key);
break;
}
- }
+ }
NeedBytes(3);
MoveAlong(1+GetSettingValueLength(pBlob));
NeedBytes(1);
@@ -1050,21 +1050,21 @@ void EncodeContactSettings(HANDLE hContact) }while(1);
}
-
+
}
void DecodeContactSettings(HANDLE hContact)
{
struct DBContact * contact;
struct DBContactSettings * setting;
DWORD offset;
-
+
if (!hContact) hContact = (HANDLE)dbHeader.ofsUser;
contact = (struct DBContact *)DBRead((DWORD)hContact, sizeof(struct DBContact), NULL);
if(contact -> ofsFirstSettings){
setting = (struct DBContactSettings *)DBRead(contact -> ofsFirstSettings, sizeof(struct DBContactSettings), NULL);
offset = contact -> ofsFirstSettings;
- do{
+ do{
DWORD ofsBlobPtr;
PBYTE pBlob;
int bytesRemaining;
@@ -1076,21 +1076,21 @@ void DecodeContactSettings(HANDLE hContact) NeedBytes(1+pBlob[0]);
//CopyMemory(szSetting,pBlob+1,pBlob[0]); szSetting[pBlob[0]]=0;
MoveAlong(1+pBlob[0]);
-
+
NeedBytes(5);
-
+
switch(pBlob[0]) {
case DBVT_DELETED: break;
case DBVT_BYTE: break;
- case DBVT_WORD:
- {
+ case DBVT_WORD:
+ {
CryptoEngine->DecryptMem(pBlob+1, 2, key);
break;
}
- case DBVT_DWORD:
- {
+ case DBVT_DWORD:
+ {
CryptoEngine->DecryptMem(pBlob+1, 4, key);
- break;
+ break;
}
case DBVT_UTF8:
case DBVT_ASCIIZ:
@@ -1102,7 +1102,7 @@ void DecodeContactSettings(HANDLE hContact) CryptoEngine->DecryptMem(pBlob+3, len, key);
break;
}
- }
+ }
NeedBytes(3);
MoveAlong(1+GetSettingValueLength(pBlob));
NeedBytes(1);
@@ -1132,13 +1132,6 @@ static int stringCompare2( char* p1, char* p2 ) return strcmp( p1, p2);
}
-static int OnPreShutdown(WPARAM, LPARAM)
-{
- DestroyHookableEvent(hSettingChangeEvent);
- hSettingChangeEvent = 0;
- return 0;
-}
-
int InitSettings(void)
{
CreateServiceFunction(MS_DB_CONTACT_GETSETTING, GetContactSetting);
@@ -1152,7 +1145,6 @@ int InitSettings(void) CreateServiceFunction("DB/ResidentSettings/Enum", EnumResidentSettings);
hSettingChangeEvent = CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
hCacheHeap = HeapCreate(0, 0, 0);
lSettings.sortFunc = (FSortFunc)stringCompare;
diff --git a/plugins/Dbx_tree/Compatibility.cpp b/plugins/Dbx_tree/Compatibility.cpp index e0c34c8feb..38b8f92383 100644 --- a/plugins/Dbx_tree/Compatibility.cpp +++ b/plugins/Dbx_tree/Compatibility.cpp @@ -807,21 +807,8 @@ INT_PTR CompGetProfilePath(WPARAM cbBytes, LPARAM pszName) return gDataBase->getProfilePath(cbBytes, reinterpret_cast<char*>(pszName));
}
-int OnPreShutdown(WPARAM, LPARAM)
-{
- DestroyHookableEvent(hEventDeletedEvent);
- DestroyHookableEvent(hEventAddedEvent);
- DestroyHookableEvent(hEventFilterAddedEvent);
- DestroyHookableEvent(hSettingChangeEvent);
- DestroyHookableEvent(hContactDeletedEvent);
- DestroyHookableEvent(hContactAddedEvent);
- return 0;
-}
-
bool CompatibilityRegister()
{
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
-
gCompServices[ 0] = CreateServiceFunction(MS_DB_CONTACT_GETCOUNT, CompGetContactCount);
gCompServices[ 1] = CreateServiceFunction(MS_DB_CONTACT_FINDFIRST, CompFindFirstContact);
gCompServices[ 2] = CreateServiceFunction(MS_DB_CONTACT_FINDNEXT, CompFindNextContact);
@@ -868,11 +855,12 @@ bool CompatibilityRegister() hContactAddedEvent = CreateHookableEvent(ME_DB_CONTACT_ADDED);
return true;
}
-
bool CompatibilityUnRegister()
{
- for (int i = 0; i < SIZEOF(gCompServices); ++i)
+ int i;
+ for (i = 0; i < sizeof(gCompServices) / sizeof(gCompServices[0]); ++i)
+ {
DestroyServiceFunction(gCompServices[i]);
-
+ }
return true;
}
|