Protecting Windev applications with Dinkey Dongle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You should copy all the code in the file "global variables and functions.txt".
These data structures and functions are used by the API sample code. Then copy
the appropriate function(s) from the "protection check functions.txt" file. These
functions implement all the various features of the DInkey Dongle SDK.

Note that the sample code is just a guide. You should implement the protection in
a stronger way using the techniques described in the "Increasing your Protection"
chapter of the manual.

Code marked with !!!! are places where you should customise the sample code so
that it will work properly:

* Change the MY_SDSN value to the value of your SDSN
* Change the MY_PRODCODE value to the value of your Product Code
* Change the MyAlgorithm code (if you call a user algorithm)
* Change the CryptDRIS code (if you encrypt the DRIS)
* Change the CryptApiData (if you encrypt Data you send to our API)
* Change the MyRWAlgorithm code (if encrypt Data you send to our API using the R/W algorithm)

You will also probably want to replace our error messages with your own. However, you should
still display or log any error codes returned by the protection check otherwise you will not
be able to identify the cause of the error. (You can look up error codes in our knowledge
base: microcosm.com/kb).

Note - you should protect dpwin32.dll and not your program. Because your program
is linked to the DLL it is protected. The protected DLL will need to be in the
same folder as your compiled program for it to run correctly.

Note - if you are producing a 64-bit Windows executable you need to protect dpwin64.dll
(instead of dpwin32.dll) and change the "protectdllname" to be "dpwin64.dll"
(this is found in the global variables and functions.txt).
Similarly for Linux you will need to use dplin32.so (32-bit Linux) or dplin64.so (64-bit Linux).

Note - you can also use the Shell Method of protection on WinDev executables.

Note - we have had reports of a bug in early releases of Windev 19 which causes the "Length" ("Taille")
function to return in incorrect value. This bug has been fixed in the February 2014 release of Windev 19.

Tested under Windev Express v12

