From 25ec54ea27a7099f33573b260a620ed7273176fe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Jun 2013 12:16:44 +0000 Subject: - 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 --- plugins/AssocMgr/src/reg.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'plugins/AssocMgr') 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 -- cgit v1.2.3