diff options
Diffstat (limited to 'plugins/Dbx_mmap_SA/src/init.cpp')
-rw-r--r-- | plugins/Dbx_mmap_SA/src/init.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/plugins/Dbx_mmap_SA/src/init.cpp b/plugins/Dbx_mmap_SA/src/init.cpp index 3112306d5e..a59ae1bc09 100644 --- a/plugins/Dbx_mmap_SA/src/init.cpp +++ b/plugins/Dbx_mmap_SA/src/init.cpp @@ -124,6 +124,26 @@ static int UnloadDatabase(MIDatabase* db) return 0;
}
+MIDatabaseChecker* CheckDb(const TCHAR* ptszFileName, int *error)
+{
+ CDdxMmapSA *tmp = new CDdxMmapSA(ptszFileName);
+ if (tmp->Load(true) != ERROR_SUCCESS) {
+ delete tmp;
+ if (error != NULL) *error = EGROKPRF_CANTREAD;
+ return NULL;
+ }
+
+ int chk = tmp->CheckDbHeaders();
+ if (chk != ERROR_SUCCESS) {
+ delete tmp;
+ *error = chk;
+ return NULL;
+ }
+
+ *error = 0;
+ return tmp;
+}
+
static DATABASELINK dblink =
{
sizeof(DATABASELINK),
@@ -132,7 +152,8 @@ static DATABASELINK dblink = makeDatabase,
grokHeader,
LoadDatabase,
- UnloadDatabase
+ UnloadDatabase,
+ CheckDb
};
/////////////////////////////////////////////////////////////////////////////////////////
|