Add Original SDK
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
Sample code to call Runtime modules in Visual Studio 2008
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This project is written in Visual Studio 2008 but will work in more recent versions of
|
||||
Visual Studio (they will upgrade the Project to the latest version).
|
||||
|
||||
The source files in the project are:
|
||||
|
||||
File name Folder Description
|
||||
apitest.c Samples\c main source code file for C
|
||||
dris.h Samples\c contains the DRIS structure
|
||||
dpwin32.lib Samples\c\import_libs contains the function definitions for dpwin32.dll
|
||||
dpwin64.lib Samples\c\import_libs contains the function definitions for dpwin64.dll
|
||||
dpwin32_coff.obj Samples\c\object_modules static object module
|
||||
dpwin64.obj Samples\c\object_modules static object module
|
||||
|
||||
Note that the source paths are structured to minimise files. If you want to move this
|
||||
project the references to these files will probably be no longer valid.
|
||||
|
||||
The ObjTest project links to the static runtime library module (e.g dpwin32_coff.obj or dpwin64.obj)
|
||||
|
||||
The DllTest project uses the dynamic runtime library (e.g. dpwin32.dll or dpwin64.obj).
|
||||
|
||||
The solutions have been modified to assume Unicode characters are not the default
|
||||
(this sample uses ascii characters because that is what the Dinkey dongle SDK requires).
|
||||
|
||||
The DllTest solution has been modified to link in the correct library file (dpwin32.lib, dpwin64.lib)
|
||||
depending on whether the output is 32-bit or 64-bit.
|
||||
|
||||
The sample code contains 10 functions. You will not need to use all these functions in your
|
||||
code. Just use which ever functions are most appropriate and customise in your own way.
|
||||
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 Product Code in the dongle
|
||||
* 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.
|
||||
|
||||
Note - if you are link the static module dpwin32_coff.obj (dpwin64.obj) then you should protect
|
||||
your program. If you are linking to dpwin32.dll (dpwin64.dll) then you need to protect dpwin32.dll
|
||||
(dpwin64.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 - once your program (or dpwin32.dll / dpwin64.dll) is protected you will not be able to debug
|
||||
your program - after our API has been called. Our strong anti-debug code will cause the debugger
|
||||
to throw an exception. If you do want to debug your code then you can use our debug module:
|
||||
dpwin32_coff_debug.obj or dpwin32debug.dll (or 64-bit equivalents), but these should not be used
|
||||
for release. See readme.txt in samples\c for restrictions concerning the debug module.
|
||||
|
||||
Note - If you are using Visual Studio 2012 or higher then you may get the linker error
|
||||
"LNK2026: module unsafe for SAFESEH image". To stop this please turn off SAFESEH by
|
||||
going to your project properties > Linker > Advanced and setting
|
||||
"Image Has Safe Exception Handlers" to "No".
|
||||
|
||||
Important Note for Windows Store App Developers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Windows Store Apps (Metro Apps) are not compatible with Lite or Plus dongles because the restrictions
|
||||
imposed by these applications. However, you can protect these Apps with network dongles (because the
|
||||
restrictive access is performed by the non-Metro DinkeyServer process). If you do this you will need
|
||||
to enable the "Private Networks (Client and Server)" Capability in your package manifest.
|
||||
Reference in New Issue
Block a user