DBDefence Encryption API
There are two DLLs in API folder of DbDefence installation.
dbencrypt.dll - for 32-bit applications
dbencrypt64.dll for 64-bit applications.
You can use API from C#, C++ or any other languages.
For further reference see code examples in API folder. C#/C++
examples available.
API consist of 1 function:
int Encrypt (TCallbackFunc *
func, int argc, wchar_t * argv[]);
TCallbackFunc * func is the pointer to the function to be
called on events during encryption: info, error and success
messages.
It can be defined as:
void WINAPI ShowMessage
(const wchar_t * msg, int code);
Info messages - msg - comes with error code 0.
Possible error codes:
0 - Success.
-777 - Encryption finished. (used only in API)
-21 - Error messages from SQL Server.
-20 - Can't connect to server.
-19 - DbDefence not installed or not started.
-18 - Database already encrypted.
-17 - No password specified.
-16 - Can't switch to select db.
-15 - Can't create dbdefence tables in database or created
incorrectly.
-14 - Unexpected error.
-13 - Can't detach database.
-12 - Can't open database files for RW access.
-11 - Can't attach database after encryption.
-10 - File with exceptions specified but its not accessible.
-4 - Can't access all files of the database.
-3 - Database too big for demo version.
-2 - Unknown command line option.
If encryption done successfully API call func with code
-777 and return 0. In case of error it returns error code used in
callback.
Next parameter argc is the number of parameters in next
parameter argv. It is the same as traditional parameters of
function main in C/C++ programming.
Parameters are the same as parameters to command line encryption tool.
|