summaryrefslogtreecommitdiff
path: root/plugins/!Deprecated/Db3x/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/!Deprecated/Db3x/src')
-rw-r--r--plugins/!Deprecated/Db3x/src/commonheaders.h53
-rw-r--r--plugins/!Deprecated/Db3x/src/dbcache3x.cpp198
-rw-r--r--plugins/!Deprecated/Db3x/src/dbintf3x.cpp77
-rw-r--r--plugins/!Deprecated/Db3x/src/dbintf3x.h74
-rw-r--r--plugins/!Deprecated/Db3x/src/init.cpp145
-rw-r--r--plugins/!Deprecated/Db3x/src/resource.h30
-rw-r--r--plugins/!Deprecated/Db3x/src/stdafx.cpp18
-rw-r--r--plugins/!Deprecated/Db3x/src/version.h14
8 files changed, 609 insertions, 0 deletions
diff --git a/plugins/!Deprecated/Db3x/src/commonheaders.h b/plugins/!Deprecated/Db3x/src/commonheaders.h
new file mode 100644
index 0000000000..562cea5b7f
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/commonheaders.h
@@ -0,0 +1,53 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#define _CRT_SECURE_NO_WARNINGS
+
+#define _WIN32_WINNT 0x0501
+
+#include <windows.h>
+#include <process.h>
+#include <memory>
+
+#include <newpluginapi.h>
+#include <win2k.h>
+#include <m_system_cpp.h>
+#include <m_database.h>
+#include <m_langpack.h>
+
+#include "version.h"
+#include "dbintf3x.h"
+#include "resource.h"
+
+#ifdef __GNUC__
+#define mir_i64(x) (x##LL)
+#else
+#define mir_i64(x) (x##i64)
+#endif
+
+#ifndef MODULAR
+void Encrypt(char*msg,BOOL up);
+#endif
+
+extern LIST<CDb3x> g_Dbs;
+extern DBSignature dbSignature; \ No newline at end of file
diff --git a/plugins/!Deprecated/Db3x/src/dbcache3x.cpp b/plugins/!Deprecated/Db3x/src/dbcache3x.cpp
new file mode 100644
index 0000000000..5688ce0a53
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/dbcache3x.cpp
@@ -0,0 +1,198 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+int CDb3x::FindSectionForOffset(const DWORD ofs)
+{
+ for (int i = 0; i < CACHESECTIONCOUNT; i++)
+ if (ofs >= cacheSectionInfo[i].ofsBase && ofs<cacheSectionInfo[i].ofsBase + CACHESECTIONSIZE)
+ return i;
+ return -1;
+}
+
+int CDb3x::FindLRUSection(void)
+{
+ int lru = 0;
+ DWORD lowestLastUse = cacheSectionInfo[0].lastUsed;
+ for (int i = 1; i < CACHESECTIONCOUNT; i++)
+ if (cacheSectionInfo[i].lastUsed < lowestLastUse) {
+ lru = i;
+ lowestLastUse = cacheSectionInfo[i].lastUsed;
+ }
+ return lru;
+}
+
+void CDb3x::LoadSection(const int i,DWORD ofs)
+{
+ cacheSectionInfo[i].ofsBase = ofs - ofs%CACHESECTIONSIZE;
+ log1("readsect %08x",ofs);
+ SetFilePointer(m_hDbFile,cacheSectionInfo[i].ofsBase,NULL,FILE_BEGIN);
+ ReadFile(m_hDbFile,m_pDbCache+i*CACHESECTIONSIZE,CACHESECTIONSIZE,&ofs,NULL);
+}
+
+void CDb3x::MoveSection(int *sectId,int dest)
+{
+ CopyMemory(m_pDbCache+dest*CACHESECTIONSIZE,m_pDbCache+(*sectId)*CACHESECTIONSIZE,CACHESECTIONSIZE);
+ cacheSectionInfo[dest].ofsBase = cacheSectionInfo[*sectId].ofsBase;
+ *sectId = dest;
+}
+
+//we are assumed to be in a mutex here
+PBYTE CDb3x::DBRead(DWORD ofs,int bytesRequired,int *bytesAvail)
+{
+ int part1sect = FindSectionForOffset(ofs);
+ if (ofs%CACHESECTIONSIZE+bytesRequired<CACHESECTIONSIZE) {
+ //only one section required
+ if (part1sect == -1) {
+ part1sect = FindLRUSection();
+ LoadSection(part1sect,ofs);
+ }
+ cacheSectionInfo[part1sect].lastUsed = ++m_lastUseCounter;
+ if (bytesAvail!= NULL) *bytesAvail = cacheSectionInfo[part1sect].ofsBase+CACHESECTIONSIZE-ofs;
+ return m_pDbCache+part1sect*CACHESECTIONSIZE+(ofs-cacheSectionInfo[part1sect].ofsBase);
+ }
+ //two sections are required
+ int part2sect = FindSectionForOffset(ofs+CACHESECTIONSIZE);
+ if (part1sect != -1) {
+ if (part2sect == -1) { //first part in cache, but not second part
+ if (part1sect == CACHESECTIONCOUNT-1) MoveSection(&part1sect,0);
+ LoadSection(part1sect+1,ofs+CACHESECTIONSIZE);
+ }
+ else if (part2sect!= part1sect+1) { //both parts are in cache, but not already consecutive
+ if (part1sect == CACHESECTIONCOUNT-1) {
+ //first part is at end, move to before second part
+ if (part2sect == 0) //second part is at start: need to move both
+ MoveSection(&part2sect,1);
+ MoveSection(&part1sect,part2sect-1);
+ }
+ else //move second part to after first part
+ MoveSection(&part2sect,part1sect+1);
+ }
+ }
+ else {
+ if (part2sect == -1) { //neither section is in cache
+ part1sect = 0; part2sect = 1;
+ LoadSection(part1sect,ofs); LoadSection(part2sect,ofs+CACHESECTIONSIZE);
+ }
+ else { //part 2 is in cache, but not part 1
+ if (part2sect == 0) MoveSection(&part2sect,1);
+ part1sect = part2sect-1;
+ LoadSection(part1sect,ofs);
+ }
+ }
+
+ //both sections are now consecutive, starting at part1sect
+ cacheSectionInfo[part1sect].lastUsed = ++m_lastUseCounter;
+ cacheSectionInfo[part1sect+1].lastUsed = ++m_lastUseCounter;
+ if (bytesAvail!= NULL)
+ *bytesAvail = cacheSectionInfo[part1sect+1].ofsBase+CACHESECTIONSIZE-ofs;
+ return m_pDbCache+part1sect*CACHESECTIONSIZE+(ofs-cacheSectionInfo[part1sect].ofsBase);
+}
+
+//we are assumed to be in a mutex here
+void CDb3x::DBWrite(DWORD ofs,PVOID pData,int bytes)
+{
+ //write direct, and rely on Windows' write caching
+ log2("write %d@%08x", bytes, ofs);
+ SetFilePointer(m_hDbFile, ofs, NULL, FILE_BEGIN);
+
+ DWORD bytesWritten;
+ if ( WriteFile(m_hDbFile, pData, bytes, &bytesWritten, NULL) == 0)
+ DatabaseCorruption( _T("%s (Write error)"));
+
+ logg();
+
+ //check if any of the cache sections contain this bit
+ for(int i = 0; i < CACHESECTIONCOUNT; i++) {
+ if (ofs+bytes >= cacheSectionInfo[i].ofsBase && ofs<cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE) {
+ if (ofs<cacheSectionInfo[i].ofsBase) { //don't start at beginning
+ if (ofs+bytes >= cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE) //don't finish at end
+ CopyMemory(m_pDbCache+i*CACHESECTIONSIZE,(PBYTE)pData+cacheSectionInfo[i].ofsBase-ofs,CACHESECTIONSIZE);
+ else CopyMemory(m_pDbCache+i*CACHESECTIONSIZE,(PBYTE)pData+cacheSectionInfo[i].ofsBase-ofs,bytes-(cacheSectionInfo[i].ofsBase-ofs));
+ }
+ else { //start at beginning
+ if (ofs+bytes >= cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE) //don't finish at end
+ CopyMemory(m_pDbCache+i*CACHESECTIONSIZE+ofs-cacheSectionInfo[i].ofsBase,pData,cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE-ofs);
+ else CopyMemory(m_pDbCache+i*CACHESECTIONSIZE+ofs-cacheSectionInfo[i].ofsBase,pData,bytes);
+ }
+ }
+ }
+}
+
+void CDb3x::DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes)
+{
+ DWORD bytesRead;
+ PBYTE buf;
+
+ log3("move %d %08x->%08x",bytes,ofsSource,ofsDest);
+ buf = (PBYTE)mir_alloc(bytes);
+ SetFilePointer(m_hDbFile,ofsSource,NULL,FILE_BEGIN);
+ ReadFile(m_hDbFile,buf,bytes,&bytesRead,NULL);
+ DBWrite(ofsDest,buf,bytes);
+ mir_free(buf);
+ logg();
+}
+
+static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD dwTime)
+{
+ for (int i=0; i < g_Dbs.getCount(); i++) {
+ CDb3x* db = g_Dbs[i];
+
+ KillTimer(NULL, db->m_flushBuffersTimerId);
+ log0("tflush1");
+ FlushFileBuffers(db->getFile());
+ log0("tflush2");
+ }
+}
+
+void CDb3x::DBFlush(int setting)
+{
+ if (!setting) {
+ log0("nflush1");
+ if (m_safetyMode) FlushFileBuffers(m_hDbFile);
+ log0("nflush2");
+ return;
+ }
+ KillTimer(NULL,m_flushBuffersTimerId);
+ m_flushBuffersTimerId = SetTimer(NULL,m_flushBuffersTimerId,50,DoBufferFlushTimerProc);
+}
+
+void CDb3x::DBFill(DWORD ofs,int bytes)
+{
+}
+
+int CDb3x::InitCache(void)
+{
+ m_pDbCache = (PBYTE)mir_alloc(CACHESECTIONSIZE*CACHESECTIONCOUNT);
+ m_lastUseCounter = CACHESECTIONCOUNT;
+ for(int i = 0; i < CACHESECTIONCOUNT; i++) {
+ cacheSectionInfo[i].ofsBase = 0;
+ cacheSectionInfo[i].lastUsed = i;
+ SetFilePointer(m_hDbFile,cacheSectionInfo[i].ofsBase,NULL,FILE_BEGIN);
+
+ DWORD bytesRead;
+ ReadFile(m_hDbFile,m_pDbCache+i*CACHESECTIONSIZE,CACHESECTIONSIZE,&bytesRead,NULL);
+ }
+ return 0;
+}
diff --git a/plugins/!Deprecated/Db3x/src/dbintf3x.cpp b/plugins/!Deprecated/Db3x/src/dbintf3x.cpp
new file mode 100644
index 0000000000..4deeed332a
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/dbintf3x.cpp
@@ -0,0 +1,77 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+extern BOOL safetyMode;
+
+CDb3x::CDb3x(const TCHAR* tszFileName) :
+ CDb3Base(tszFileName)
+{
+}
+
+CDb3x::~CDb3x()
+{
+ if (m_pDbCache) {
+ mir_free(m_pDbCache);
+ KillTimer(NULL,m_flushBuffersTimerId);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+//this function caches results
+DWORD CDb3x::GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName)
+{
+ DBContactSettings *dbcs;
+ DWORD ofsThis;
+
+ for ( int i=0; i < SETTINGSGROUPOFSCOUNT; i++)
+ if (settingsGroupOfsCache[i].ofsContact == ofsContact && settingsGroupOfsCache[i].ofsModuleName == ofsModuleName)
+ return settingsGroupOfsCache[i].ofsSettingsGroup;
+
+ ofsThis = dbc->ofsFirstSettings;
+ while(ofsThis) {
+ dbcs = (struct DBContactSettings*)DBRead(ofsThis,sizeof(struct DBContactSettings),NULL);
+ if (dbcs->signature != DBCONTACTSETTINGS_SIGNATURE) DatabaseCorruption( _T("Invalid database module"));
+ if (dbcs->ofsModuleName == ofsModuleName) {
+ settingsGroupOfsCache[nextSGOCacheEntry].ofsContact = ofsContact;
+ settingsGroupOfsCache[nextSGOCacheEntry].ofsModuleName = ofsModuleName;
+ settingsGroupOfsCache[nextSGOCacheEntry].ofsSettingsGroup = ofsThis;
+ if (++nextSGOCacheEntry==SETTINGSGROUPOFSCOUNT) nextSGOCacheEntry = 0;
+ return ofsThis;
+ }
+ ofsThis = dbcs->ofsNext;
+ }
+ return 0;
+}
+
+void CDb3x::InvalidateSettingsGroupOfsCacheEntry(DWORD ofsSettingsGroup)
+{
+ for (int i=0; i < SETTINGSGROUPOFSCOUNT; i++) {
+ if (settingsGroupOfsCache[i].ofsSettingsGroup == ofsSettingsGroup) {
+ settingsGroupOfsCache[i].ofsContact = 0;
+ settingsGroupOfsCache[i].ofsModuleName = 0;
+ settingsGroupOfsCache[i].ofsSettingsGroup = 0;
+ break;
+} } }
diff --git a/plugins/!Deprecated/Db3x/src/dbintf3x.h b/plugins/!Deprecated/Db3x/src/dbintf3x.h
new file mode 100644
index 0000000000..eaeb80b167
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/dbintf3x.h
@@ -0,0 +1,74 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <m_db_int.h>
+
+#include "..\..\Db3x_mmap\src\database.h"
+#include "..\..\Db3x_mmap\src\dbintf.h"
+
+#define CACHESECTIONSIZE 4096
+#define CACHESECTIONCOUNT 32
+
+#define SETTINGSGROUPOFSCOUNT 32
+
+struct CDb3x : public CDb3Base
+{
+ CDb3x(const TCHAR* tszFileName);
+ ~CDb3x();
+
+ __inline HANDLE getFile() const { return m_hDbFile; }
+
+protected:
+ virtual DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName);
+ virtual void InvalidateSettingsGroupOfsCacheEntry(DWORD ofsSettingsGroup);
+
+ virtual void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes);
+ virtual PBYTE DBRead(DWORD ofs, int bytesRequired, int *bytesAvail);
+ virtual void DBWrite(DWORD ofs, PVOID pData, int bytes);
+ virtual void DBFill(DWORD ofs, int bytes);
+ virtual void DBFlush(int setting);
+ virtual int InitCache(void);
+
+ PBYTE m_pDbCache;
+ DWORD m_lastUseCounter;
+
+ struct DBCacheSectionInfo
+ {
+ DWORD ofsBase;
+ DWORD lastUsed;
+ }
+ cacheSectionInfo[CACHESECTIONCOUNT];
+
+ int nextSGOCacheEntry;
+ struct SettingsGroupOfsCacheEntry {
+ DWORD ofsContact;
+ DWORD ofsModuleName;
+ DWORD ofsSettingsGroup;
+ }
+ settingsGroupOfsCache[SETTINGSGROUPOFSCOUNT];
+
+ int FindSectionForOffset(const DWORD ofs);
+ int FindLRUSection(void);
+ void LoadSection(const int i,DWORD ofs);
+ void MoveSection(int *sectId,int dest);
+};
diff --git a/plugins/!Deprecated/Db3x/src/init.cpp b/plugins/!Deprecated/Db3x/src/init.cpp
new file mode 100644
index 0000000000..9b0e5d81be
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/init.cpp
@@ -0,0 +1,145 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+int hLangpack;
+
+static PLUGININFOEX pluginInfo =
+{
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE | STATIC_PLUGIN,
+ //{1394A3AB-2585-4196-8F72-0EAEC2450E11}
+ {0x1394a3ab, 0x2585, 0x4196, {0x8f, 0x72, 0xe, 0xae, 0xc2, 0x45, 0xe, 0x11}}
+};
+
+HINSTANCE g_hInst = NULL;
+
+LIST<CDb3x> g_Dbs(1, HandleKeySortT);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+// returns 0 if the profile is created, EMKPRF*
+static int makeDatabase(const TCHAR *profile)
+{
+ std::auto_ptr<CDb3x> db(new CDb3x(profile));
+ if (db->Create() != ERROR_SUCCESS)
+ return EMKPRF_CREATEFAILED;
+
+ return db->CreateDbHeaders(dbSignature);
+}
+
+// returns 0 if the given profile has a valid header
+static int grokHeader(const TCHAR *profile)
+{
+ std::auto_ptr<CDb3x> db(new CDb3x(profile));
+ if (db->Load(true) != ERROR_SUCCESS)
+ return EGROKPRF_CANTREAD;
+
+ return db->CheckDbHeaders();
+}
+
+// returns 0 if all the APIs are injected otherwise, 1
+static MIDatabase* LoadDatabase(const TCHAR *profile)
+{
+ // set the memory, lists & UTF8 manager
+ mir_getLP( &pluginInfo );
+
+ std::auto_ptr<CDb3x> db(new CDb3x(profile));
+ if (db->Load(false) != ERROR_SUCCESS)
+ return NULL;
+
+ g_Dbs.insert(db.get());
+ return db.release();
+}
+
+static int UnloadDatabase(MIDatabase* db)
+{
+ g_Dbs.remove((CDb3x*)db);
+ delete (CDb3x*)db;
+ return 0;
+}
+
+MIDatabaseChecker* CheckDb(const TCHAR* profile, int *error)
+{
+ std::auto_ptr<CDb3x> db(new CDb3x(profile));
+ if (db->Load(true) != ERROR_SUCCESS) {
+ if (error != NULL) *error = EGROKPRF_CANTREAD;
+ return NULL;
+ }
+
+ int chk = db->CheckDbHeaders();
+ if (chk != ERROR_SUCCESS) {
+ *error = chk;
+ return NULL;
+ }
+
+ *error = 0;
+ return db.release();
+}
+
+static DATABASELINK dblink =
+{
+ sizeof(DATABASELINK),
+ "db3x",
+ _T("db3x driver"),
+ makeDatabase,
+ grokHeader,
+ LoadDatabase,
+ UnloadDatabase,
+ CheckDb
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_DATABASE, MIID_LAST};
+
+extern "C" __declspec(dllexport) int Load(void)
+{
+ RegisterDatabasePlugin(&dblink);
+ return 0;
+}
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ g_Dbs.destroy();
+ return 0;
+}
+
+BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved)
+{
+ g_hInst = hInstDLL;
+ return TRUE;
+}
diff --git a/plugins/!Deprecated/Db3x/src/resource.h b/plugins/!Deprecated/Db3x/src/resource.h
new file mode 100644
index 0000000000..96abbfff99
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/resource.h
@@ -0,0 +1,30 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define IDC_NOTOALL 3
+#define IDD_INSTALLINI 235
+#define IDD_WARNINICHANGE 236
+#define IDD_INIIMPORTDONE 237
+#define IDC_ININAME 1333
+#define IDC_VIEWINI 1334
+#define IDC_SECURITYINFO 1335
+#define IDC_SETTINGNAME 1336
+#define IDC_NEWVALUE 1337
+#define IDC_WARNNOMORE 1338
+#define IDC_DELETE 1339
+#define IDC_RECYCLE 1340
+#define IDC_NEWNAME 1341
+#define IDC_MOVE 1342
+#define IDC_LEAVE 1343
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 269
+#define _APS_NEXT_COMMAND_VALUE 40018
+#define _APS_NEXT_CONTROL_VALUE 1657
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/!Deprecated/Db3x/src/stdafx.cpp b/plugins/!Deprecated/Db3x/src/stdafx.cpp
new file mode 100644
index 0000000000..e7e41dae3c
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/stdafx.cpp
@@ -0,0 +1,18 @@
+/*
+Copyright (C) 2012-13 Miranda NG Project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "commonheaders.h" \ No newline at end of file
diff --git a/plugins/!Deprecated/Db3x/src/version.h b/plugins/!Deprecated/Db3x/src/version.h
new file mode 100644
index 0000000000..3c8bef20fa
--- /dev/null
+++ b/plugins/!Deprecated/Db3x/src/version.h
@@ -0,0 +1,14 @@
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 11
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 1
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+
+#define __PLUGIN_NAME "Miranda NG database driver"
+#define __FILENAME "Dbx_3x.dll"
+#define __DESCRIPTION "Provides Miranda database support: global settings, contacts, history, settings per contact."
+#define __AUTHOR "Miranda NG project"
+#define __AUTHOREMAIL "ghazan@miranda.im"
+#define __AUTHORWEB "http://miranda-ng.org/p/Dbx_3x/"
+#define __COPYRIGHT "© 2012-13 Miranda NG project"