Using SDK
The kernel of Disk Password Protection is a functional library (diskpp_kernel.dll) containing all functions necessary to control boot and partitions protection from other software. To use the library separately from Disk Password Protection and distribute it within other products, you need to have a commercial license giving you the right to distribute the DLL library as a part of another product.
You can use the library free of charge for 30 days since the first launch. When this period expires, it will be impossible to enable protection or change the password.
Unregistered version limitations:
• The only password you can set is "demo". If you use other passwords, protection will not be enabled.
• The trial period is 30 days.
Using the library
To use the functional library in another application, you should include SDK files from the Disk Password Protection distribution package into the project of the application. The file diskpp_kernel.dll should be located in one folder with the compiled file of the application.
Before using the library, you should load it (LoadLibrary) and pass the descriptor you get to the LoadDPPLibraryFunctions function from the SDK to load pointers to functions (if you use the SDK for C#, the library is loaded automatically).
#include "diskpp_sdk.h"
...
HINSTANCE hLib;
...
TCHAR strFileName[ 2048 ] = { 0 };
GetModuleFileName( m_hInstance, strFileName, 2048 );
while ( strFileName[ lstrlen( strFileName ) - 1 ] != _T('\\') )
{
strFileName[ lstrlen( strFileName ) - 1 ] = 0;
}
lstrcat( strFileName, _T("diskpp_kernel.dll") );
hLib = LoadLibrary( strFileName );
if ( m_hLib == NULL )
{
// Exit;
}
LoadDPPLibraryFunctions( hLib );
|
Loading.
When the library is loaded, the process of detecting devices and initializing internal data starts.
Loading two copies of the library simultaneously is forbidden.
After the library is loaded, you should call the DetectDevices function and get the code of the last error using the GetLastErrorDll function. If the code is HDPC_ERROR_SUCCESS, the library is loaded successfully, otherwise it is impossible to continue working with the library.
During the work of your application, you can add new disks and partitions to the system or disconnect old ones. After that you should call the function from the library that detects new devices (DetectDevices).
After the configuration of disks changes, the system sends the WM_DEVICECHANGE message to all windowed applications. Your application should intercept it and call the DeviceChange function from the SDK. It will check if the disk configuration has really changed and, if necessary, will call the DetectDevices function to update the internal data in the library.
Licensing.
To use the library in other applications, you must have a commercial license that gives you the right to the special support and maintenance of the SDK. When a customer purchases a commercial license, he gets a special copy of the Disk Password Protection library (diskpp_kernel.dll) with the function for product registration (SetRegistrationData).
The following functions are used to control licensing:
IsRegistered,
GetRegisteredName,
GetTypeOfLicense,
SetRegistrationData
Device configuration.
After the library is loaded, you should get the configuration of disks (their number and parameters) and partitions for each disk.
You can use the following functions to get device configuration:
GetDisksCount,
GetDiskModelNumber,
GetDiskSerialNumber,
GetDiskSpace,
GetDiskIsReadOnly,
GetDiskIsRemoveable,
GetDiskIsProtected,
GetDiskIsSupport,
GetPartitionsCount,
GetPartitionSpace,
GetLetterByPartitionData,
GetPartitionDataByLetter,
GetPartitionFSName,
GetPartitionFSType,
GetPartitionIsActive,
GetPartitionIsBoot,
GetPartitionIsPrimary,
GetPartitionIsProtected.
Controlling protection.
This section contains functions for enabling protection, changing the password, disabling protection and getting the password hint.
ProtectionBootChangePassword,
ProtectionBootGetPasswordHint,
ProtectionBootSet,
ProtectionBootUnset,
ProtectionPartitionChangePassword,
ProtectionPartitionGetPasswordHint,
ProtectionPartitionSet,
ProtectionPartitionSetSafely,
ProtectionPartitionUnset,
SetRegistrationData.
SDK functions
|