diff options
Diffstat (limited to 'plugins/Db3x/src/init.cpp')
-rw-r--r-- | plugins/Db3x/src/init.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/plugins/Db3x/src/init.cpp b/plugins/Db3x/src/init.cpp index 406db891a6..6f021aa283 100644 --- a/plugins/Db3x/src/init.cpp +++ b/plugins/Db3x/src/init.cpp @@ -121,6 +121,26 @@ static int UnloadDatabase(MIDatabase* db) return 0;
}
+MIDatabaseChecker* CheckDb(const TCHAR* ptszFileName, int *error)
+{
+ CDb3x *tmp = new CDb3x(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),
@@ -129,7 +149,8 @@ static DATABASELINK dblink = makeDatabase,
grokHeader,
LoadDatabase,
- UnloadDatabase
+ UnloadDatabase,
+ CheckDb
};
/////////////////////////////////////////////////////////////////////////////////////////
|