diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-30 12:16:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-30 12:16:44 +0000 |
commit | 25ec54ea27a7099f33573b260a620ed7273176fe (patch) | |
tree | 1810a0cb35d23deeed9ccdaf0ab276a4022f9a41 /plugins/AssocMgr | |
parent | a546606709e6bb72e01eb38b2c8c8756608fd5d6 (diff) |
- db_set_blob used everywhere for writing blobs
- DBCONTACTWRITESETTING left only in the event handlers
git-svn-id: http://svn.miranda-ng.org/main/trunk@5191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AssocMgr')
-rw-r--r-- | plugins/AssocMgr/src/reg.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 143b262533..d792a69566 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -341,17 +341,14 @@ static BOOL IsRegStrValueA(HKEY hKey,const TCHAR *pszValName,const char *pszCmpV // pData must always be Unicode data, registry supports Unicode even on Win95
static void WriteDbBackupData(const char *pszSetting,DWORD dwType,BYTE *pData,DWORD cbData)
{
- DBCONTACTWRITESETTING dbcws;
- dbcws.szModule="AssocMgr";
- dbcws.szSetting=pszSetting;
- dbcws.value.type=DBVT_BLOB;
- dbcws.value.cpbVal=(WORD)(cbData+sizeof(DWORD));
- dbcws.value.pbVal=(BYTE*)mir_alloc(cbData+sizeof(DWORD));
- if (dbcws.value.pbVal==NULL) return;
- *(DWORD*)dbcws.value.pbVal=dwType;
- CopyMemory(dbcws.value.pbVal+sizeof(DWORD),pData,cbData);
- CallService(MS_DB_CONTACT_WRITESETTING,0,(LPARAM)&dbcws);
- mir_free(dbcws.value.pbVal);
+ size_t cbLen = cbData + sizeof(DWORD);
+ PBYTE buf = (PBYTE)mir_alloc(cbLen);
+ if (buf) {
+ *(DWORD*)buf = dwType;
+ CopyMemory(buf+sizeof(DWORD), pData, cbData);
+ db_set_blob(NULL, "AssocMgr", pszSetting, buf, cbLen);
+ mir_free(buf);
+ }
}
// mir_free() the value returned in ppData
|