Encrypted Disk Software Development Kit v2.0

Encrypted Disk SDK allows to create special encrypted image files on hard disks and mount such images as virtual partitions, which is accessible for operating system and applications like a native, real partition.


ED SDK environment

System Requirements:

Applications that uses ED SDK could be run under Windows 98, Windows ME, Windows 2000 or Windows XP

Build requirements:

Microsoft Visual Studio 6.0 or higher are recommended to build ED SDK Applications, but it is possible to call ED SDK Dll Functions from other programming languages such as VisualBasic or Perl.

Supported features:

  • Create encrypted image files and mount it as partitions
  • Up to 32 Gb disk images creation support
  • Plain and Encrypted Storage features
  • Encryption, Hash Calculation, Random number generation functions
  • Extra crypto algorithm installing support
  • Legacy Encrypted Disk Images mount and conversion support

    • Preinstalled cryptoalgorithms

  • Advanced Encryption Standard (AES) Block Encryption
  • Secure Hashing Algorithm 1 (SHA-1) Hash calculation
  • SHA-1 based random number generation

    • Legacy cryptoalgorithms included in SDK

  • TripleDes Block Encryption
  • Blowifsh 448 Block Encryption
  • MD5 Message Digest hash calculation


ED SDK Layout

ED SDK consist with the following files and directories

  • Doc - Directory with this help file
  • Drivers - Directory with drivers and Drivers Installation program
  • InstallNT.bat - bat file to install drivers for Windows 2000/XP
  • Install9x.bat - bat file to install drivers for Windows 98/Me
  • InstallLegacy.bat - bat file to install legacy cryptoalgorithms required to support old images
  • Include - Directory with ED SDK include files
  • ed_sdk.h - Header File for the ED SDK
  • Lib - Directory with ED SDK dll and import lib to link with ED SDK C++ Applications
  • ed_sdk.dll - ED SDK redistributable (Dynamic Link Library)
  • ed_sdk.lib - ED SDK import library
  • uiminst.dll - ED SDK drivers installation dll redistributable (Dynamic Link Library)
  • uiminst.lib - ED SDK drivers installation import library

  • Samples - Directory with samples for ED SDK
  • bin\ - directory with prebuilded samples
  • General - Directory with general samples
    • build_samples.dsw - workspace for samples
  • build_samples.dsp - project for samples
  • Makefile - makefile for buildinf samples
  • common.h - common header
  • common.cpp - file with common for samples functions and definitions
  • enum_algs.cpp - samples demonstrating algorithms enumeration
  • generate_random.cpp - generating random numbers using ED SDK
  • create_image.cpp - creating image file
  • reencrypt.cpp - reencrypt image sample
  • mount.cpp - mount image sample
  • unmount.cpp - unmount mounted image sample
  • opened_info.cpp - list opened images
  • handle_for_drv.cpp - obtaining handle for mounted image
  • close_all.cpp - close all opened handles
  • storages.cpp - create and sign storages
  • check_storage.cpp - reading from storages
  • SampleGui - Directory with simple GUI for ED SDK demonstrating how image can be created, mounted and unmounted in the ED SDK application
  • Install - Directory sources of the installation program instDrv.exe


Getting started

Installing drivers

To install drivers execute

  • InstallNT.bat for Window 2000/XP
  • Install9x.bat for Windows 98/Me

    • from the ED_SDK\Drivers directory.

  • Optionaly legacy EncryptedDisk algorithms could be installed by calling InstallLegacy.bat

    • Scripts demonstrates how ED_SDK drivers could be installed. Drivers installation is made by calling InstDrv.exe that wraps call to the functions from UimInst.dll Return values are as follows:

    0 | Requested driver was successfully installed. It is not required to reboot computer.
1 | Driver was installed or updated but is is required to reboot computer. This code is returned when some program has opened HANDLES of ED SDK or some image is opened in the time of calling installation. Note: it is possible to call update procedure again after closing handles and installation will be successfully made without rebooting
2 | Driver is not present. This error code is returned on request to uninstall driver or check whether driver is installed
10 | Driver or Inf-file was not found at specified path or invalid parameters specified to installation program
255 | Windows 98/Me specific error. Unable to find required 16-bit installation module uimins16.exe

    Refer to the UimInst.dll interface and How to install drivers from program topics

    Building ED SDK Samples

    Building general samples

    To build ED SDK Samples open in Visual Studio build_samples.dsw workspace and do "Rebuild all". It is also possible to build sample from command line: type nmake all from command line in the ED SDK Samples directory. Make sure that Visual C 6.0 environment variables are registered

    Building sample GUI

    To build sample GUI application open in Visual Studio SampleGui.dsw workspace and do rebuild all. Don't forget to add ed_sdk.dll to the directory with builded sample.

    Building ED SDK Applications

    To build ED SDK Application make sure that ED_SDK\include directory is added to Include Search Path and ED_SDK\Lib is added to the Library search path.

    Just include ed_sdk.h and link application with ed_sdk.lib

    Note: To run application ed_sdk.dll must be located in the Dll search Path. Prefferably in the directory where application is located


Uninstalling drivers

Installing drivers

To Uninstall drivers execute Uninstall.bat from the ED_SDK\Drivers directory.

Uninstall.bat script demonstrates how ED_SDK drivers could be uninstalled. Drivers uninstallation is made by calling InstDrv.exe that wraps call to the functions from UimInst.dll Return values are as follows:

0 | Requested driver was successfully uninstalled. It is not required to reboot computer.
1 | Driver was uninstalled but it is is required to reboot computer. This code is returned when some program has opened HANDLES of ED SDK or some image is opened in the time of calling uninstallation. NOTE: It is possible to call uninstall again after closing handles and uninstallation will be succesfully made without rebooting
2 | Driver was not installed at the time of calling uninstall
10 | Error in parameters
255 | Windows 98/Me specific error. Unable to find required 16-bit installation module uimins16.exe

Refer to the UimInst.dll interface and How to install drivers from program topics


How to install drivers from program

Installation is done simply by calling uiminst.dll functions. (see UimInst.dll interface topic)

Below is sources of the instDrv.exe program

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <direct.h>
#include "uiminst.h"
int __cdecl main(int argc, char* argv[])
{
    char    path[MAX_PATH];
    char     inf[MAX_PATH];
    if( argc < 2 )
    {
        printf("Wrapper requirs option\n");
        return UIMINST_INVALID_PARAMETER;
    }
    if( strchr(argv[0], ':') )
    {
        strcpy(path, argv[0]);
        char *cp = strrchr(path, '\\');
        cp[1] = 0;
    }
    else
    {
        if( !_getcwd(path, MAX_PATH) )
        {
            printf("Unable to determine path\n");
            return UIMINST_INVALID_PARAMETER;
        }
        if( path[strlen(path)-1] != '\\' )
            strcat(path, "\\");
    }
    printf("path is %s\n", path);

    if( !strcmp(argv[1], "-update") )
    {
        if( argc<4 )
        {
            printf("not ehough parameters\n");
            return UIMINST_INVALID_PARAMETER;
        }
        if( !strchr(argv[3], ':') )
        {
            strcpy(inf, path);
            strcat(inf, argv[3]);
        }
        else
        {
            strcpy(inf, argv[3]);
        }
        DWORD err = UimInstall(inf, argv[2], path);
        return err;
    }
    else if( !strcmp(argv[1], "-uninstall") )
    {
        if( argc < 3)
        {
            printf("not enough parameters\n");
            return UIMINST_INVALID_PARAMETER;
        }

        DWORD err = UimRemove(argv[2], path);
        return err;
    }
    else if( !strcmp(argv[1], "-check") )
    {
        if( argc < 3)
        {
            printf("not enough parameters\n");
            return UIMINST_INVALID_PARAMETER;
        }

        DWORD err = UimCheck(argv[2], path);
        return err;
    }
    printf("unknown option for 32-x wrapper\n");

    return UIMINST_INVALID_PARAMETER;
}

See also

UimInst.dll interface


UimInst.dll interface

UimInst.dll provides interface to the ED SDK drivers installation/uninstallation.

UimInstall

Install specified driver

UIMINST_API DWORD _stdcall
UimInstall(char *infFile, char *hardwareId, char *inst16Dir );

Arguments:

infFile
name of the inf-file of the driver to install
hardwareId
ID of the driver to install
inst16Dir
directory where uimins16.exe is located

UimCheck

Check whether specified driver is installed

UIMINST_API DWORD _stdcall
UimCheck(char *hardwareId, char *inst16Dir );

Arguments:

hardwareId
ID of the driver to check installation
inst16Dir
directory where uimins16.exe is located

UimRemove

Uninstall specified driver

UIMINST_API DWORD _stdcall
UimRemove(char *hardwareId, char *inst16Dir );

Arguments:

hardwareId
ID of the driver to uninstall
inst16Dir
directory where uimins16.exe is located

Return values:

Return values of the functions are as follows:

UIMINST_SUCCESS
(0)
Operation success
Operation completed Ok. Reboot not required
UIMINST_REBOOT_REQUIRED
(1)
Operation success, reboot required
Operation completed success, but it is required to reboot
UIMINST_UNSUCCESSFUL
(2)
Driver is not installed
This error code is returned in call to check or uninstall driver and means that specified driver is not installed
UIMINST_INVALID_PARAMETER
(10)
Invalid parameter
Invalid parameter passed to function
UIMINST_NO_INST16_EXE
(255)
Unable to locate uimins16.exe
unable to find uimins16.exe in the inst16Dir

See also

How to install drivers from program


Enumerating installed cryptoalgorithms

This sample shows how to enumerate all installed in system cryptoalgorithms. It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

// helper functions to print GUID

void PrintGuid( LPGUID pGuid )
{
    printf("{%08X-%04X-%04X-%04X-%02X%02X%02X%02X%02X%02X}",
        *(PULONG)pGuid,
        *(PUSHORT)(((PUCHAR)pGuid)+4),
        *(PUSHORT)(((PUCHAR)pGuid)+6),
        *(PUSHORT)(((PUCHAR)pGuid)+8),
        *(((PUCHAR)pGuid)+10),
        *(((PUCHAR)pGuid)+11),
        *(((PUCHAR)pGuid)+12),
        *(((PUCHAR)pGuid)+13),
        *(((PUCHAR)pGuid)+14),
        *(((PUCHAR)pGuid)+15)
        );
}

// Print all installed algorithms

int PrintInstalledAlgs()
{
    ULONG i;
    ED_STATUS edStatus;
    CRYPTO_ALG_INFO AlgInfoArray[ 128 ];
    ULONG    AlgCount = 128;
    ULONG   AlgsReturned;

    edStatus = EDCryptoAlgList( CryptoAlgTypeUnknown, AlgInfoArray, &AlgCount, &AlgsReturned );
    if( edStatus )
    {
        printf("Failed with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf( "Total Algorithms installed: %d; returned %d\n", AlgCount, AlgsReturned );
    if( AlgCount > AlgsReturned )
    {
        printf("Insufficient buffer for cryptoalgs! Allocate at least %d entries\n",
            AlgCount );
    }
    printf("----------------------------\n");
    for( i = 0; i < AlgsReturned; i++ )
    {
        char *szAlgType;
        switch( AlgInfoArray[i].uType )
        {
        case CryptoAlgTypeBlock:
            szAlgType = "Block";
            break;
        case CryptoAlgTypeRandom:
            szAlgType = "Random";
            break;
        case CryptoAlgTypeHash:
            szAlgType = "Hash";
            break;
        default:
            szAlgType = "Unknown";
            break;
        }
        printf("%s\n", AlgInfoArray[i].pName);
        printf("Short name:\t%s\n", AlgInfoArray[i].pShortName );
        printf("type: \t%s\n", szAlgType );
        printf("Guid: \t");
        PrintGuid(&AlgInfoArray[i].AlgorithmGUID);
        printf("\n");
        printf("----------------------------\n");
    }
    return 0;
}


Generating random numbers

This sample demonstrates random number generation using installed within SDK SHA1-based random number generation algorithm. It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

DEFINE_GUID(
    GUID_UIM_CRYPTO_ALG_RANDOMSHA,
    0x30560db0, 0x8582, 0x4a87,
    0x8b, 0x21, 0xc, 0x99, 0x0, 0xfc, 0x76, 0xe9
    );

int TestRandom()
{
    int i;
    HANDLE hRandom;
    ED_STATUS edStatus;
    edStatus = EDCryptoAlgOpen( &GUID_UIM_CRYPTO_ALG_RANDOMSHA, &hRandom );
    if( edStatus )
    {
        printf("Failed with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    ULONG Buffer[32768];
    ULONG StartTime;

    StartTime = GetTickCount();
    printf("Generating 512kb of random numbers using secure random\n");
    for( i = 0; i<16; i++ )
    {
        EDCryptoRandomGet( hRandom, Buffer, sizeof(Buffer), FALSE );
        printf("%d ", i );
    }
    printf("\n");
    printf("Time taken: %d ms\n", GetTickCount() - StartTime );
    StartTime = GetTickCount();
    printf("Generating 512kb of random numbers using fast random\n");
    for( i = 0; i<16; i++ )
    {
        EDCryptoRandomGet( hRandom, Buffer, sizeof(Buffer), TRUE );
        printf("%d ", i );
    }
    printf("\n");
    printf("Time taken: %d ms\n", GetTickCount() - StartTime );

    EDCryptoAlgClose( hRandom );
    return 0;
}


Creating image file

This sample shows how to create an image file. File is created with zero-key as C:\FirstED.crd. It has embedded plain storage and created with zero-length Encrypted Storage to make it possible to attach encrypted storage later.
Image is created with installed within SDK AES block encryptioin, SHA1 hash and SHA1 random algorithms.
It is possible to cancel image creation by pressing ESC while sample running.
It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define TEST_ED_NAME "c:\\FirstED.crd"

#define KEY_N  0x0

DEFINE_GUID(
    GUID_UIM_CRYPTO_ALG_RANDOMSHA,
    0x30560db0, 0x8582, 0x4a87,
    0x8b, 0x21, 0xc, 0x99, 0x0, 0xfc, 0x76, 0xe9
    );
DEFINE_GUID(
    GUID_UIM_CRYPTO_ALG_SHA1,
    0x8b5cba73, 0x8412, 0x419d,
    0x8c, 0x3, 0x93, 0xdb, 0xdc, 0x86, 0x41, 0x94
    );
DEFINE_GUID(
    GUID_UIM_CRYPTO_ALG_AES,
    0xe2c09e15, 0x1cb, 0x4f9d,
    0x93, 0xbe, 0x6f, 0x86, 0xb1, 0x1d, 0x33, 0xf6);

// thread for displaying progress during create
// Pressing ESC will cancel image creation
void progress_func( void *ctx )
{
    UIM_ED_PROGRESS *pProgress = (UIM_ED_PROGRESS*)ctx;
    POINT curPos = {0};
    BOOL tmp;
    HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
    tmp = GetConsoleScreenBufferInfo(hStdout, &csbiInfo);
    do {
        WaitForSingleObject( pProgress->hNewDataEvent, INFINITE );
        tmp = SetConsoleCursorPosition(hStdout, csbiInfo.dwCursorPosition);
        printf("%d ", pProgress->dwData);
        if( _kbhit() )
        {
            // check is ESC pressed
            if( 27 == getch() )
            {
                printf("     cancelled\n");
                SetEvent(pProgress->hCancelEvent);
            }
        }
    } while(pProgress->dwData <= 101);
}

int CreateDisk()
{
    HANDLE hImage = NULL;

    ED_STATUS edStatus;

    UIM_ED_CREATE_DISK_BUF CreateDiskBuf;

    memset(&CreateDiskBuf, 0, sizeof(CreateDiskBuf));
    strcpy((char *)CreateDiskBuf.FileName, TEST_ED_NAME );

    // Fill key
    memset(CreateDiskBuf.Key, KEY_N, ED_MAX_KEY_SIZE);

    // Create disk with size of 32 MB
    CreateDiskBuf.qDiskSize = 32 * ED_SDK_ONE_MB;
    CreateDiskBuf.FileSystem = UIM_ED_FAT16;

    // Create plain storage embedded;
    CreateDiskBuf.PlainStorageSize = 32762;

    // Make it possible to attach encrypted storage later
    CreateDiskBuf.EncryptedStorageSize = 0;

    CreateDiskBuf.ControlInfo.hNewDataEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    CreateDiskBuf.ControlInfo.hCancelEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

    memcpy( &CreateDiskBuf.CryptoAlgGuid, &GUID_UIM_CRYPTO_ALG_AES, sizeof(GUID) );
    memcpy( &CreateDiskBuf.HashAlgGuid, &GUID_UIM_CRYPTO_ALG_SHA1, sizeof(GUID) );
    memcpy( &CreateDiskBuf.RandomAlgGuid, &GUID_UIM_CRYPTO_ALG_RANDOMSHA, sizeof(GUID) );

    _beginthread( progress_func, 0, &CreateDiskBuf.ControlInfo );

    edStatus = EDCreateDisk( &CreateDiskBuf, &hImage );
    if( edStatus )
    {
        printf("Failed with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }

    EDCloseHandle(hImage);
    return 0;
}


Mounting image

This sample shows how an image can be mounted. Sample uses created by the 'Creating Image File' sample image. It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define TEST_ED_NAME "c:\\FirstED.crd"

#define MLETTER 'Q'

#define KEY_N  0x0

int MountDisk()
{
    HANDLE hImage = NULL;
    ED_STATUS edStatus;
    edStatus = EDOpenDisk( TEST_ED_NAME, 0, &hImage );
    if( edStatus )
    {
        printf("Failed to open image %s with ED_STATUS %d\n", TEST_ED_NAME, edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    UIM_ED_ENTER_KEY_BUF EnterKeyBuf;
    memset(&EnterKeyBuf.Key, KEY_N, ED_MAX_KEY_SIZE);
    edStatus = EDEnterKey( hImage, &EnterKeyBuf );
    if( edStatus )
    {
        printf("Failed to enter key with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    edStatus = EDMountDisk(hImage, MLETTER);
    if( edStatus )
    {
        printf("Failed to mount disk with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    EDCloseHandle(hImage);
    printf("Disk was successfuly mounted\n");
    return 0;
}


Mounting old images

This sample shows how an old image could be mounted.
It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define TEST_ED_NAME "c:\\OldED.crd"
#define MLETTER 'Q'
#define PASSWORD "TestPassword"
#define KEY_FILE "c:\KeyFile1.crk"
int MountLegacyDisk()
{
    HANDLE hImage = NULL;
    ED_STATUS edStatus;
    UIM_ED_ENTER_KEY_BUF EnterKeyBuf;
    ED_IMAGE_INFO edImageInfo;
    edStatus = EDOpenDisk( TEST_ED_NAME, 0, &hImage );
    if( edStatus )
    {
        printf("Failed to open image %s with ED_STATUS %d\n", TEST_ED_NAME, edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    //
    // Check is it an old image
    edStatus = EDGetImageInfo(hImage, &edImageInfo );
    if( edStatus )
    {
        printf("Failed to obtain image info; Status %d", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle( hImage );
        return -1;
    }
    if( !(edImageInfo.Info.Flags & ED_FLAG_OLD_IMAGE) )
    {
        printf("Image %s is not a legacy image\n", TEST_ED_NAME);
        EDCloseHandle( hImage );
        return -1;
    }

    if( edImageInfo.Info.Flags & ED_FLAG_PASSWORD )
    {
        printf("Image with password\n");
        edStatus = EDOldImage_PasswordToKey(
                            hImage,
                            PASSWORD,
                            strlen(PASSWORD),
                            EnterKeyBuf.Key );
    }
    else
    {
        printf("Image with key in file\n");
        edStatus = EDOldImage_ReadKeyFromFile(
                            hImage,
                            KEY_FILE,
                            EnterKeyBuf.Key );
    }
    if( edStatus )
    {
        printf("Failed to transform or read key with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    edStatus = EDEnterKey( hImage, &EnterKeyBuf );
    if( edStatus )
    {
        printf("Failed to enter key with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    memset( &EnterKeyBuf, 0, sizeof(EnterKeyBuf) );
    edStatus = EDMountDisk(hImage, MLETTER);
    if( edStatus )
    {
        printf("Failed to mount disk with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    EDCloseHandle(hImage);
    printf("Disk was successfuly mounted\n");
    return 0;
}


Obtaining opened images info

This sample shows how to enumerate all opened images and get info for each handle. It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

void PrintGuid( LPGUID pGuid )
{
    printf("{%08X-%04X-%04X-%04X-%02X%02X%02X%02X%02X%02X}",
        *(PULONG)pGuid,
        *(PUSHORT)(((PUCHAR)pGuid)+4),
        *(PUSHORT)(((PUCHAR)pGuid)+6),
        *(PUSHORT)(((PUCHAR)pGuid)+8),
        *(((PUCHAR)pGuid)+10),
        *(((PUCHAR)pGuid)+11),
        *(((PUCHAR)pGuid)+12),
        *(((PUCHAR)pGuid)+13),
        *(((PUCHAR)pGuid)+14),
        *(((PUCHAR)pGuid)+15)
        );
}
int PrintAlgInfoByGUID( LPGUID pGuid )
{
    CRYPTO_ALG_INFO AlgInfo;
    ED_STATUS        edStatus;
    edStatus = EDCryptoAlgInfoByGUID( pGuid, &AlgInfo );
    if( edStatus )
    {
        printf("Failed with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    char *szAlgType;
    switch( AlgInfo.uType )
    {
    case CryptoAlgTypeBlock:
        szAlgType = "Block";
        break;
    case CryptoAlgTypeRandom:
        szAlgType = "Random";
        break;
    case CryptoAlgTypeHash:
        szAlgType = "Hash";
        break;
    default:
        szAlgType = "Unknown";
        break;
    }
    printf("%s\n", AlgInfo.pName);
    printf("Short name:\t%s\n", AlgInfo.pShortName );
    printf("type: \t%s\n", szAlgType );
    printf("Guid: \t");
    PrintGuid(&AlgInfo.AlgorithmGUID);
    printf("\n");
    return 0;
}
int PrintInfoByHandle(HANDLE hImage)
{
    ED_STATUS edStatus;
    ED_IMAGE_INFO Info;
    edStatus = EDGetImageInfo( hImage, &Info );
    if( edStatus )
    {
        printf("Failed with get image info for image 0x%04x with ED_STATUS %d\n", hImage, edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf( "Image %s\n", Info.ImageName );
    printf( "Number of file-fragments of image: %d\n", Info.Info.TotalFragments );

    if( Info.NumberOfSectors )
        printf( "ImageSize: %x sectors\n", Info.NumberOfSectors);

    printf( "Storages:\n" );
    if( Info.Info.PlainStorage.MaxStorageSize )
    {
        printf( "\tPlain: embedded; MaxSize: 0x%X; CurrentSize: 0x%X\n", Info.Info.PlainStorage.MaxStorageSize, Info.Info.PlainStorage.StorageSize );
    }
    else
    {
        printf( "\tPlain: extern; file: %s; CurrentSize: 0x%X\n", Info.Info.PlainStorage.FileName, Info.Info.PlainStorage.StorageSize );
    }
    if( Info.Info.EncryptedStorage.MaxStorageSize )
    {
        printf( "\tEncrypted: embedded; MaxSize: 0x%X; CurrentSize: 0x%X\n", Info.Info.EncryptedStorage.MaxStorageSize, Info.Info.EncryptedStorage.StorageSize );
    }
    else
    {
        printf( "\tEncrypted: extern; file: %s; CurrentSize: 0x%X\n", Info.Info.EncryptedStorage.FileName, Info.Info.EncryptedStorage.StorageSize  );
    }
    printf( "Key to access image is %s\n", Info.Info.KeyEntered ? "entered" : "not entered" );

    printf( "Image is %s;", Info.bMounted ? "mounted": "not mounted" );
    if( Info.bMounted )
        printf(" Mount letter is %c", Info.MountedLetter);
    else
        printf("\n");
    printf("\n**** Algorithms info:****\n\n");
    PrintAlgInfoByGUID(&Info.Info.CryptoGuid);
    PrintAlgInfoByGUID(&Info.Info.HashGuid);
    PrintAlgInfoByGUID(&Info.Info.RandomGuid);
    return 0;
}
int PrintOpenedImages()
{
    ULONG i;
    ED_STATUS edStatus;
    HANDLE HandlesArray[128];
    ULONG NumOfImages = 128;
    edStatus = EDGetImageList( HandlesArray, &NumOfImages );
    if( edStatus )
    {
        printf("Failed with to obtain images list with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf( "There are %d opened images;\n", NumOfImages );
    for( i = 0; i<     NumOfImages; i++ )
        PrintInfoByHandle(HandlesArray[i]);
    return 0;
}


Closing all handles

This sample just gets list of opened handle and trying to close all handles. It can be useful when some error during testing is occured and it is required to close all handles.

int CloseOpenedImages()
{
    ULONG i;
    ED_STATUS edStatus;
    HANDLE HandlesArray[128];
    ULONG NumOfImages = 128;
    edStatus = EDGetImageList( HandlesArray, &NumOfImages );
    if( edStatus )
    {
        printf("Failed with to obtain images list with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf( "There are %d opened images;\n", NumOfImages );
    for( i = 0; i<     NumOfImages; i++ )
    {
        EDCloseHandle( HandlesArray[i] );
    }
    return 0;
}


Obtaining handle for mounted image

This sample shows how get info about image currently mounted to the Q:\ path. It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define MLETTER 'Q'

int DiskInfoByLetter()
{
    ED_STATUS edStatus;
    HANDLE hImage;
    edStatus = EDGetImageHandleByDrive(MLETTER, &hImage);
    if( edStatus )
    {
        printf("Failed to get image handle for drive %C: with ED_STATUS %d\n", MLETTER, edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf("Image handle is 0x%04x\n", hImage);
    PrintInfoByHandle(hImage);
    return 0;
}


Unmounting image

This sample shows how to unmount image currently mounted to path Q:\
This sample uses 'Soft' unmount (as opposite to 'Force' unmount), so image will be dismounted only when there are no opened handle on Q:\
Replace FALSE to TRUE in EDUnmountDisk( hImage, FALSE ) to do Force unmount;
It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

int DismountDisk()
{
    ED_STATUS edStatus;
    HANDLE      hImage;
    edStatus = EDGetImageHandleByDrive( MLETTER, &hImage );
    if( edStatus )
    {
        printf("Failed with get handle for drive %C with ED_STATUS %d\n", MLETTER, edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    edStatus = EDUnmountDisk( hImage, FALSE );
    if( edStatus )
    {
        printf("Failed to unmount image with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    edStatus = EDWaitUnmountComplete( hImage );
    if( edStatus )
    {
        printf("Failed to wait for unmount complete with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf("UnmountSuccess\n");
    EDCloseHandle( hImage );
    return 0;
}


Reencrypting Disk

This sample shows how to reencrypt an image and their storage. Note: this sample not only changes key used to log to the disk, but the Storage and Data keys too. If you don't need in Data or Storage reencryption replace TRUE to FALSE in lines ReencBuf.bReencryptData = TRUE;
or ReencBuf.bReencryptStorage = TRUE;
It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define TEST_ED_NAME "c:\\FirstED.crd"
#define KEY_N  0x0
#define KEY_NR 0xff

// thread for displaying progress during reencryption
// It is not possible to interrupt reencryption process.
void progress_func( void *ctx )
{
    UIM_ED_PROGRESS *pProgress = (UIM_ED_PROGRESS*)ctx;
    POINT curPos = {0};
    BOOL tmp;
    HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
    tmp = GetConsoleScreenBufferInfo(hStdout, &csbiInfo);
    do {
        WaitForSingleObject( pProgress->hNewDataEvent, INFINITE );
        tmp = SetConsoleCursorPosition(hStdout, csbiInfo.dwCursorPosition);
        printf("%d ", pProgress->dwData);
    } while(pProgress->dwData <= 101);
}

int ReencryptDisk()
{
    HANDLE hImage = NULL;
    ED_STATUS edStatus;

    edStatus = EDOpenDisk( TEST_ED_NAME, 0, &hImage );
    if( edStatus )
    {
        printf("Failed to open image %s with ED_STATUS %d\n", TEST_ED_NAME, edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }

    UIM_ED_REENCRYPT_DISK_BUF ReencBuf = {0};

    memset( &ReencBuf.Key, KEY_N, ED_MAX_KEY_SIZE);
    ReencBuf.bReencryptData = TRUE;
    ReencBuf.bReencryptStorage = TRUE;
    ReencBuf.bChangeAlgorithms = FALSE;
    memset( &ReencBuf.NewKey, KEY_NR, ED_MAX_KEY_SIZE);
    ReencBuf.ControlInfo.hNewDataEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    ReencBuf.ControlInfo.hCancelEvent = NULL;
    _beginthread( progress_func, 0, &ReencBuf.ControlInfo );

    edStatus = EDReencryptDisk(hImage, &ReencBuf);
    CloseHandle(ReencBuf.ControlInfo.hNewDataEvent);

    if( edStatus )
    {
        printf("Failed to reencrypt image with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    EDCloseHandle(hImage);
    return 0;
}


Operations with storages

Operations with storages (remove, create, read, write, sign)

This sample shows how Create, Read, Write, Sign operations with storages can be done.
Samples assumes that Plain Storage is embedded and Encrypted storage will be located in separate file.
It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define TEST_STORAGE_OFFSET 0x0
#define TEST_ED_NAME "c:\\FirstED.crd"
#define TEST_CSTORAGE_NAME "test_str2.str"
#define KEY_N  0x0
#define TEST_STORAGE_OFFSET 0x0
int WriteStorage(BOOL bPlain, HANDLE hImage)
{
    ED_STATUS edStatus;
    ULONG BytesWritten = 0;
    ULONGLONG    qOffset = TEST_STORAGE_OFFSET;
    char *string = bPlain ? "Plain Test String" : "Encrypted Test String";
    printf("WriteStorage %s\n", bPlain ? "plain" : "encrypted");
    edStatus = EDOpenStorage( hImage, bPlain );
    CHECK_ERROR(edStatus);
    edStatus = EDWriteStorage( hImage,
                               bPlain,
                               string,
                               strlen(string)+1,
                               &BytesWritten,
                               &qOffset );
    if( edStatus )
    {
        printf("Failed to write to the storage with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf("Bytes Written = %u\n", BytesWritten);
    return 0;
}
int ReadStorage(BOOL bPlain, HANDLE hImage)
{
    ED_STATUS edStatus;
    ULONG BytesRead = 0;
    ULONGLONG    qOffset = TEST_STORAGE_OFFSET;
    char buf[65538];
    buf[0] = 0;
    printf("ReadStorage %s\n", bPlain ? "plain" : "encrypted");
    edStatus = EDOpenStorage( hImage, bPlain );
    CHECK_ERROR(edStatus);
    edStatus = EDReadStorage( hImage,
                              bPlain,
                              buf,
                              65538,
                              &BytesRead,
                              &qOffset );
    if( edStatus )
    {
        printf("Failed to read from the storage with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf("BytesRead = %u; Str = %s\n", BytesRead, buf );
    return 0;
}
int ReadWriteStorages()
{
    HANDLE hImage = NULL;
    ULONG bw = 0;
    ULONGLONG    qOffset = 0;
    ED_STATUS edStatus;
    printf("ReadWriteStorages\n");
    edStatus = EDOpenDisk( TEST_ED_NAME, 0, &hImage );
    if( edStatus )
    {
        printf("Failed to open image; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }

    //
    // EnterKey
    //
    UIM_ED_ENTER_KEY_BUF EnterKeyBuf;
    memset(&EnterKeyBuf.Key, KEY_N, ED_MAX_KEY_SIZE);
    edStatus = EDEnterKey( hImage, &EnterKeyBuf );
    if( edStatus )
    {
        printf("Failed to log to the image; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    //
    // Print disk info before storage operations
    PrintInfoByHandle(hImage);
    EDRemoveStorage(hImage, FALSE, TRUE);
    edStatus = EDCreateStorage(hImage, FALSE, TEST_CSTORAGE_NAME);
    if( edStatus )
    {
        printf("Failed to create encrypted storage; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    WriteStorage(TRUE, hImage);
    ReadStorage(TRUE, hImage);
    WriteStorage(FALSE, hImage);
    ReadStorage(FALSE, hImage);
    // Sign plain storage
    edStatus = EDSignStorage(hImage, TRUE);
    if( edStatus )
    {
        printf("Failed to sign plain storage; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    // Sign Encrypted storage
    edStatus = EDSignStorage(hImage, FALSE);
    if( edStatus )
    {
        printf("Failed to sign encrypted storage; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    PrintInfoByHandle(hImage);
    EDCloseHandle(hImage);
    return 0;
}


Storages: Read and check sign

This sample shows how Read and check Sign operations with storages can be done.
It's assumed that sample function is called after library was successfully inited by the call to EDInitLibrary(..).

#define TEST_STORAGE_OFFSET 0x0
#define TEST_ED_NAME "c:\\FirstED.crd"
#define TEST_CSTORAGE_NAME "test_str2.str"
#define KEY_N  0x0
#define TEST_STORAGE_OFFSET 0x0
int ReadStorage(BOOL bPlain, HANDLE hImage)
{
    ED_STATUS edStatus;
    ULONG BytesRead = 0;
    ULONGLONG    qOffset = TEST_STORAGE_OFFSET;
    char buf[65538];
    buf[0] = 0;
    printf("ReadStorage %s\n", bPlain ? "plain" : "encrypted");
    edStatus = EDOpenStorage( hImage, bPlain );
    CHECK_ERROR(edStatus);
    edStatus = EDReadStorage( hImage,
                              bPlain,
                              buf,
                              65538,
                              &BytesRead,
                              &qOffset );
    if( edStatus )
    {
        printf("Failed to read from the storage with ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }
    printf("BytesRead = %u; Str = %s\n", BytesRead, buf );
    return 0;
}
int CheckStorages()
{
    HANDLE hImage = NULL;
    ULONG bw = 0;
    ULONGLONG    qOffset = 0;
    ED_STATUS edStatus;
    printf("CheckStorages\n");
    edStatus = EDOpenDisk( TEST_ED_NAME, 0, &hImage );
    if( edStatus )
    {
        printf("Failed to open image; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        return -1;
    }

    // Read from plain storage before key is entered
    ReadStorage(TRUE, hImage);
    //
    // EnterKey
    //
    UIM_ED_ENTER_KEY_BUF EnterKeyBuf;
    memset(&EnterKeyBuf.Key, KEY_N, ED_MAX_KEY_SIZE);
    edStatus = EDEnterKey( hImage, &EnterKeyBuf );
    if( edStatus )
    {
        printf("Failed to log to the image; ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
        EDCloseHandle(hImage);
        return -1;
    }
    //
    // Print disk info before storage operations
    PrintInfoByHandle(hImage);
    ReadStorage(TRUE, hImage);
    ReadStorage(FALSE, hImage);
    // Check plain storage sign
    edStatus = EDCheckStorageSign(hImage, TRUE);
    if( ED_STATUS_SUCCESS == edStatus )
    {
        printf("Plain storage sign check ok\n");
    }
    else if( ED_STATUS_IMAGE_HAS_NO_STORAGE == edStatus )
    {
        printf("No plain storage associated with image\n");
    }
    else if( ED_STATUS_STORAGE_NOT_SIGNED == edStatus )
    {
        printf("Plain storage is not signed. Nothing to check!\n");
    }
    else if( ED_STATUS_BAD_STORAGE_SIGN == edStatus )
    {
        printf("Bad Plain storage sign!\n" );
    }
    else
    {
        printf("Failed to check Plain storage sign! ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
    }
    // Check Encrypted storage sign
    edStatus = EDCheckStorageSign(hImage, FALSE);
    if( ED_STATUS_SUCCESS == edStatus )
    {
        printf("Encrypted storage sign check ok\n");
    }
    else if( ED_STATUS_IMAGE_HAS_NO_STORAGE == edStatus )
    {
        printf("No encrypted storage associated with image\n");
    }
    else if( ED_STATUS_STORAGE_NOT_SIGNED == edStatus )
    {
        printf("Encrypted storage is not signed. Nothing to check!\n");
    }
    else if( ED_STATUS_BAD_STORAGE_SIGN == edStatus )
    {
        printf("Bad Encrypted storage sign!\n" );
    }
    else
    {
        printf("Failed to check Encrypted storage sign! ED_STATUS %d\n", edStatus);
        if(edStatus == ED_STATUS_WIN_ERROR)
        {
            printf("\tWindows error: %d\n", GetLastError());
        }
    }
    EDCloseHandle(hImage);
    return 0;
}


Encrypted Disk SDK v2.0 Reference

This document provides reference to the functions and structures used in the Encrypted Disk Software Development Kit v2.0


CRYPTO_ALG_INFO

Crypto algorithm information structure

typedef struct _CRYPTO_ALG_INFO
{
    GUID    AlgorithmGUID;        // Algorithm GUID
    ULONG    AlgorithmID;        // Algorithm ID
    ULONG    uVendorID;            // Vendor ID
    CRYPTO_ALG_TYPE        uType;    // Algorithm type

    ULONG    uFlags;                // Algorithm flags
    ULONG    uVersion;             // Algorithm version
    char  pName[ ALG_NAME_SIZE ];     // Text info
    char  pShortName[ ALG_SHORT_NAME_SIZE ]; // Short algorithm name
    union
    {
        // Encryption parameters
        struct
        {
            ULONG uKeySize;              // Key size
            ULONG uBlockSize;             // Block size (1 for non-block)
        } encryption;
        // Hash parameters
        struct
        {
            ULONG uHashSize;             // Hash size
        } hash;
        // Sign parameters
        struct
        {
            ULONG uKeySize;                // Public and secret Key size
            ULONG uSignatureSize;        // Length of a generated signature
        } sign;
        // Random parameters
        struct
        {
            ULONG uSeedSize;             // Seed size, 0 - if isn't needed
        } random;
    } params;
} CRYPTO_ALG_INFO, *PCRYPTO_ALG_INFO;

Members:

AlgorithmGUID
Algorithm GUID
AlgorithmID
Algorithm ID. No special meaning for the client of API
uVendorID
Vendor ID
uType
Type of the algorithm see CRYPTO_ALG_TYPE for description
uFlags
Flags of the algorithm. No special meaning for the client of API
pName
Name of the algorithm
pShortName
Short name of the algorithm
Params
Union describing parameters of the algorithm
encryption
Block Encryption Algorithm parameters if type of the algorithm is CryptoAlgTypeBlock
uKeySize
Size of the Key
uBlockSize
Size of the block
hash
Hash computation Algorithm parameters if type of the algorithm is CryptoAlgTypeHash
uHashSize
Size of the resulting message digest
Sign
Not used in this version of API
random
Random number generation Algorithm parameters if type of the algorithm is CryptoAlgTypeRandom
uSeedSize
Size of the seed used


UIM_ED_FS_TYPE

Types of the common for windows file systems

typedef enum
{
    UIM_ED_FAT16 = 0x06,
    UIM_ED_FAT32 = 0x0b,
    UIM_ED_NTFS  = 0x07
} UIM_ED_FS_TYPE;

Meaning:

UIM_ED_FAT16 - FAT16 file system. This value could be used only for disks with size less or equal to 2GB.
UIM_ED_FAT32 - FAT32 file system. This value could be used only for disks with size greater then 32 MB
UIM_ED_NTFS - NTFS file system. This value could be used only for Windows 2k/XP or higher


CRYPTO_ALG_TYPE

Types of the crypto algorithms

//
// Types of crypto algorithms
//
typedef enum
{
    CryptoAlgTypeUnknown = 0,
    CryptoAlgTypeBlock,
    CryptoAlgTypeSign,
    CryptoAlgTypeHash,
    CryptoAlgTypeRandom

} CRYPTO_ALG_TYPE, *PCRYPTO_ALG_TYPE;

Meaning:

CryptoAlgTypeUnknown - used to specify to the EDCryptoAlgList(..) call that all installed cryptoalgorithms must be enumerated
CryptoAlgTypeBlock - Block encryption algorithm
CryptoAlgTypeSign - Not used in this version
CryptoAlgTypeHash - Hash computation algorithm
CryptoAlgTypeRandom - Random number generation algorithm


ED_IMAGE_INFO

General image information structure returned by the call to EDGetImageInfo(..)

typedef struct _ED_IMAGE_INFO
{
    char		ImageName[ED_MAX_PATH];
    BOOL		bMounted;
    char		MountedLetter;

    ULONG		NumberOfSectors;
    ULONG		SectorsPerTrack;
    ULONG		TracksPerCylinder;
    ULONG		Cylinders;
    BOOL		bReadOnly;
    ED_PLUGIN_SPECIFIC_IMAGE_INFO	Info;
} ED_IMAGE_INFO, *PED_IMAGE_INFO;

Members:

ImageName
Path to the image file
bMounted
Is image mounted to the system
MountedLetter
Letter to which image mounted to
NumberOfSectors
Number of sectors in image
SectorsPerTrack
Sectors per track
TracksPerCylinder
Tracks per cylinder
Cylinders
Number of cylinders
bReadOnly
TRUE If image opened in read-only mode
Info
ED_PLUGIN_SPECIFIC_IMAGE_INFO information structure.


ED_PLUGIN_SPECIFIC_IMAGE_INFO

ED Image crypto information structure

typedef struct _ED_PLUGIN_SPECIFIC_IMAGE_INFO
{
    // there must be plugin specific information about opened image;
    // for this plugin this is IMG_HDR

    //
    // Is Correct key entered and is it possible to mount image now
    // 0 - FALSE, 1 - TRUE;
    ULONG   KeyEntered;

    // Guids of the cryptoalgs
    GUID    CryptoGuid;
    GUID    HashGuid;
    GUID    RandomGuid;

    //
    // Storages
    ENCRYPTED_DISK_STORAGE PlainStorage;
    ENCRYPTED_DISK_STORAGE EncryptedStorage;

    ULONG   bReencryptionNotFinished;

    // Total number of fragments if image is splitted
    ULONG    TotalFragments;

#define ED_FLAG_PASSWORD               1
#define ED_FLAG_OLD_IMAGE              2
    // Flags is not used for now with new images;
    ULONG     Flags;
}ED_PLUGIN_SPECIFIC_IMAGE_INFO, *PED_PLUGIN_SPECIFIC_IMAGE_INFO;

Members:

KeyEntered
TRUE if key to access image is entered and image is ready to mount
CryptoGuid
Guid of the block encryption cryptoalgorithm
HashGuid
Guid of the hash calculation cryptoalgorithm
RandomGuid
Guid of the random number generation cryptoalgorithm
PlainStorage
Information about plain storage
EncryptedStorage
Information about encrypted storage
bReencryptionNotFinished
TRUE if previous reencryption operation was not finished
TotalFragments
Contains number of fragments of image file. If this value is greater then 1 then image is splitted to several files.
Flags
Could be combinations of flags ED_FLAG_OLD_IMAGE and ED_FLAG_PASSWORD
ED_FLAG_OLD_IMAGE means that image has legacy ED image format
ED_FLAG_PASSWORD means that legacy ED image is encrypted on password as opposite to key-file


ENCRYPTED_DISK_STORAGE

ED Storage information structure

//
// EncryptedDisk storages.
//
typedef struct _ENCRYPTED_DISK_STORAGE
{
    // Current storage size
    ULONG            StorageSize;

    // Max storage size if storage is embedded within image file
    ULONG            MaxStorageSize;

    ULONG            OffsetInFile;

    // TRUE if storage was signed after last write operation
    // note: it is possible to check sign only after entering key
    ULONG            Signed;

    // Place where storage is located;
    // File name is zero if storage is embedded within image file
    CHAR             FileName[ED_MAX_PATH];
}ENCRYPTED_DISK_STORAGE, *PENCRYPTED_DISK_STORAGE;

Members:

StorageSize
Current storage size. This field is changed after EDStorageWrite(..) if the offset of the last written byte is greater then previous value of this field. It could also be set by call to EDSetStorageSize(..)
MaxStorageSize
Maximum storage size of embedded (contained inside image file) storage. If value is zero then image doesn't have embedded storage.
OffsetInFile
For embedded storages offset of the storage inside image file. For storages in separate files this value means nothing in this version of API
Signed
Is storage cryptographically signed.
FileName
File where storage is located. Doesn't have any meaning for the embedded storages. If MaxStorageSize is zero and FileName[0] is zero too then image doesn't have storage.
Note: File name could be relative to the image file or it coult be absolute path to the storage. If path doesn't start drive:\ or with \\ then path is interpreted as relative to the image.


UIM_ED_CREATE_DISK_BUF

Disk creation structure

//
// Disk creation structure
typedef struct _UIM_ED_CREATE_DISK_BUF
{
    //first field is always reserved for use by EncryptedDiskAPI
    ULONG   edCommand;
    UCHAR   key[ED_MAX_KEY_SIZE];
    UCHAR   FileName[ED_MAX_PATH];
    GUID    CryptoAlgGuid;
    GUID    RandomAlgGuid;
    GUID    HashAlgGuid;

    ULONGLONG    qDiskSize;

    UIM_ED_FS_TYPE    FileSystem;

    // if 0, then image doesn't have embedded Plain storage and
    // it is possible to call CreateStorage later
    ULONG    PlainStorageSize;
    // if 0, then image doesn't have embedded Encrypted storage and
    // it is possible to call CreateStorage later
    ULONG    EncryptedStorageSize;
    //
    // Progres of creation info and CancelEvent
    UIM_ED_PROGRESS    ControlInfo;
}UIM_ED_CREATE_DISK_BUF, *PUIM_ED_CREATE_DISK_BUF;

Members:

edCommand
This fiels is reserved for use by EncryptedDisk API. Please ignore.
Key
Key that will be used for Loggin to the disk. After entering this key by the call to the EDEnterKey(..) function image becomes ready to mount.
FileName
Path to the image file to create
CryptoAlgGuid
GUID of the block encryption algorithm (with type CryptoAlgTypeBlock). Installed algorithms could be enumerated by the call to EDCryptoAlgList(..)
RandomAlgGuid
GUID of the random number generation algorithm (with type CryptoAlgTypeRandom).
HashAlgGuid
GUID of the hash calculation algorithm (with type CryptoAlgTypeHash).
qDiskSize
Size of the disk to create
FileSystem
File system value to store in MBR. This value is essential for Windows 98/ME only and has no meaning in Windows XP/2K. In Windows 98/ME disk will be formated be MS Windows in FS specified by this value. See UIM_ED_FS_TYPE for list of possible values
PlainStorageSize
If this value is not zero, then Plain(unencrypted) storage of requested size will be created inside image file. If this value is zero, then it will be possible to create storage in separate file later by call to the EDCreateStorage(..)
EncryptedStorageSize
If this value is not zero, then Encrypted storage of requested size will be created inside image file. If this value is zero, then it will be possible to create storage in separate file later by call to the EDCreateStorage(..)
ControlInfo
Progress information structure. See UIM_ED_PROGRESS structure description


UIM_ED_ENTER_KEY_BUF

Enter Key structure

//
// Enter key structure
typedef struct _UIM_ED_ENTER_KEY_BUF
{
    //first field is always reserved for use by EncryptedDiskAPI
    ULONG    edCommand;

    UCHAR Key[ED_MAX_KEY_SIZE];
}UIM_ED_ENTER_KEY_BUF, *PUIM_ED_ENTER_KEY_BUF;

Members:

edCommand
This fiels is reserved for use by EncryptedDisk API. Please ignore.
Key
Key to log to the disk.


UIM_ED_PROGRESS

Progress structure

//
// ProgressInfo Structure for disk creation and reencryption
typedef struct _UIM_ED_PROGRESS
{
    HANDLE hNewDataEvent;
    HANDLE hCancelEvent;
    ULONG  dwData;
}UIM_ED_PROGRESS, *PUIM_ED_PROGRESS;

Members:

hNewDataEvent
Handle of the event created by the call to Windows API function CreateEvent(..). This event will be set to signaled state when next portion of data was processed by requested operation such as EDCreateDisk(..) or EDReencryptDisk(..)
hCancelEvent
Handle of the event created by the call to Windows API function CreateEvent(..). This event have meaning only for EDCreateDisk(..) operation. Signal this event to cancel disk creation
dwData
Percent of completion of the operation. For EDCreateDisk(..) maximum value of this file is 101% and 201% for EDReencryptDisk(..), cause first 100% refers to the image reencryption and next 100% for the storage reencryption.


UIM_ED_REENCRYPT_DISK_BUF

Disk reencryption structure

//
// Disk reencryption structure
typedef struct _UIM_ED_REENCRYPT_DISK_BUF
{
    //first field is always reserved for use by EncryptedDiskAPI
    ULONG   edCommand;

    // TRUE if reencryption operation was not finished
    // FALSE if no need to continue reencryption;
    ULONG   bContinueReencryption;

    UCHAR   Key[ED_MAX_KEY_SIZE];

    // True if it is required to reencrypt all data;
    ULONG   bReencryptData;

    // True if it is required to reencrypt data in EncryptedStorage
    ULONG   bReencryptStorage;

    // True if it is required to reencrypt all information on new algorithms.
    ULONG   bChangeAlgorithms;

    UCHAR   NewKey[ED_MAX_KEY_SIZE];
    GUID    NewCryptoAlgGuid;
    GUID    NewRandomAlgGuid;
    GUID    NewHashAlgGuid;

    UIM_ED_PROGRESS ControlInfo;
}UIM_ED_REENCRYPT_DISK_BUF, *PUIM_ED_REENCRYPT_DISK_BUF;

Members:

edCommand
This fiels is reserved for use by EncryptedDisk API. Please ignore.
bContinueReencryption
TRUE if it is request to continue interrupted by power fault reencrypt operation. Setting this field to true will disable header reencryption and process only interrupted by power fault operations. If this field is set to TRUE then NewKey field is ignored along with NewCryptoAlgGuid, NewRandomAlgGuid, NewHashAlgGuid In most cases you set this field to FALSE and working procedure will detect need of continueing reencryption automatically
Key
Current Key that that used for Loggin to the disk.
bReencryptData
TRUE if it is required to reencrypt Data inside image, not just change Key
bReencryptStorage
TRUE if it is required to reencrypt Encrypted storage, not just change Key
bRemoveStorageWhileReencryption
TRUE if storage must be removed while reencryption; In some situations it is impossible to complete reencryption since storage file is deleted or corrupted. When such a problem is occured, then EDReencryptDisk(..) will return ED_STATUS_STORAGE_REENCRYPTION_FAILED error code
Setting this flag to TRUE will dettach storage from the image and disk will be reencrypted without storage.
bChangeAlgorithms
TRUE if it is required to reencrypt all information on new algorithms. If this flag is set to FALSE then NewCryptoAlgGuid, NewRandomAlgGuid, NewHashAlgGuid will be ignored.
Note: if request to change algorithm is made then Storage and Data will be reencrypted.
NewKey
New Key that will be used to log to the disk.
NewCryptoAlgGuid
New Block Encryption algorithm GUID. Field is ignored if bChangeAlgorithms is FALSE
NewRandomAlgGuid
New Random number generation algorithm GUID. Field is ignored if bChangeAlgorithms is FALSE
NewHashAlgGuid
New Hash calculation algorithm GUID. Field is ignored if bChangeAlgorithms is FALSE
ControlInfo
Progress information structure. See UIM_ED_PROGRESS structure description


UIM_ED_CONVERT_OLD_IMAGE

Old image conversion structure

typedef struct _UIM_ED_CONVERT_OLD_IMAGE
{
    //first field is always reserved for use by EncryptedDiskAPI
    ULONG   edCommand;
    UCHAR    OldImageKey[ED_MAX_KEY_SIZE];
    // Converted image parameters
    UCHAR   NewImageKey[ED_MAX_KEY_SIZE];
    UCHAR   NewImageFileName[ED_MAX_PATH];
    GUID    CryptoAlgGuid;
    GUID    RandomAlgGuid;
    GUID    HashAlgGuid;
    // if 0, then image doesn't have embedded Plain storage and
    // it is possible to call CreateStorage later
    ULONG   PlainStorageSize;
    // if 0, then image doesn't have embedded Encrypted storage and
    // it is possible to call CreateStorage later
    ULONG   EncryptedStorageSize;
    //
    // Progres of conversion info and CancelEvent
    UIM_ED_PROGRESS ControlInfo;
}UIM_ED_CONVERT_OLD_IMAGE, *PUIM_ED_CONVERT_OLD_IMAGE;

Members:

edCommand
This fiels is reserved for use by EncryptedDisk API. Please ignore.
OldImageKey
Current Key that used for Loggin to the old image.
NewImageKey
New Key that will be used to log to the converted disk.
NewImageFileName
Converted image file name
CryptoAlgGuid
Block Encryption algorithm GUID for converted image.
RandomAlgGuid
Random number generation algorithm GUID for converted image.
HashAlgGuid
Hash calculation algorithm GUID for converted image.
PlainStorageSize
If this value is not zero, then Plain(unencrypted) storage of requested size will be created inside converted image file. If this value is zero, then it will be possible to create storage in separate file later by call to the EDCreateStorage(..)
EncryptedStorageSize
If this value is not zero, then Encrypted storage of requested size will be created inside converted image file. If this value is zero, then it will be possible to create storage in separate file later by call to the EDCreateStorage(..)
ControlInfo
Progress information structure. See UIM_ED_PROGRESS structure description


EDCloseLibrary

Close library and free any resources allocated for ED

ED_API void ED_CALL
EDCloseLibrary();

Arguments:

DeviceHandle
handle of the opened device controller

Return value:

none

See Also:

EDInitLibrary(..)


EDGetVersion

Get Library version

ED_API ULONG ED_CALL
EDGetVersion();

Arguments:

none

Return value:

version of library


EDInitLibrary

Init Library; This function must be called before any other calls to ED functions

ED_API ED_STATUS ED_CALL
EDInitLibrary();

Arguments:

none

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of other possible values

Error codes:

ED_STATUS_CONTROLLER_OPEN_FAILED | Failed to open Kernel Component. Problem could be fixed by repairing installation.
ED_STATUS_INVALID_VERSION | Incompatible version of the Kernel Driver and User Component. Problem could be fixed by repairing installation

See Also

ED SDK Errors reference EDCloseLibrary(..)


EDCryptoAlgClose

Close opened cryptoalgorithm

ED_API ED_STATUS ED_CALL
EDCryptoAlgClose(
    HANDLE              CryptoAlgHandle );

Arguments:

CryptoAlgHandle
[in] Handle of the opened cryptoalgorithm

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgOpen(..)


EDCryptoAlgEncryptDecrypt

Encrypt/Decrypt data

ED_API ED_STATUS ED_CALL
EDCryptoAlgEncryptDecrypt(
    HANDLE              CryptoAlgHandle,
    UCHAR               pInitialVector[ED_MAX_BLOCK_SIZE],
    PVOID               pInputDataBuffer,
    ULONG               InputDataLength,
    PVOID               pOutputDataBuffer,
    ULONG               OutputDataLength,
    BOOLEAN             bDecrypt );

Arguments:

CryptoAlgHandle
[in]Handle of the opened Block Encryption cryptoalgorithm
pInitialVector
[in] Initial vector.
pInputDataBuffer
[in] Buffer with data to encrypt/decrypt
InputDataLength
[in] Size of the data buffer
pOutputDataBuffer
[out] Buffer that receices encrypted/decrypted data
OutputDataLength
[in] Size of the output data buffer
bDecrypt
TRUE - Decrypt data, FALSE - Encrypt data

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgSetKey(..)


EDCryptoAlgHashFinal

Get resulting hash

ED_API ED_STATUS ED_CALL
EDCryptoAlgHashFinal(
    HANDLE              CryptoAlgHandle,
    UCHAR               pOutputDataBuffer[32] );

Arguments:

CryptoAlgHandle
[in] Handle of the opened Hash Computation cryptoalgorithm
pOutputDataBuffer
[out] receives resultin digest of the processed message

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgHashInit(..) EDCryptoAlgHashUpdate(..)


EDCryptoAlgHashInit

Init hash algorithm to compute digest of the new message

ED_API ED_STATUS ED_CALL
EDCryptoAlgHashInit(
    HANDLE              CryptoAlgHandle );

Arguments:

CryptoAlgHandle
[in] Handle of the opened Hash Computation cryptoalgorithm

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgHashUpdate(..), EDCryptoAlgHashFinal(..)


EDCryptoAlgInfoByHandle

Obtains info about opened cryptoalgorithm

ED_API ED_STATUS ED_CALL
EDCryptoAlgInfoByHandle(
    HANDLE              CryptoAlgHandle,
    PCRYPTO_ALG_INFO    pAlgInfo );

Arguments:

CryptoAlgHandle
[in]Handle of the opened cryptoalgorithm
pAlgInfo
[out] receives info about cryptoalgorithm

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values


EDCryptoAlgHashUpdate

Update hash with next part of message

ED_API ED_STATUS ED_CALL
EDCryptoAlgHashUpdate(
    HANDLE              CryptoAlgHandle,
    LPCVOID             pInputDataBuffer,
    ULONG               InputDataLength );

Arguments:

CryptoAlgHandle
[in] Handle of the opened Hash Computation cryptoalgorithm
pInputDataBuffer
[in] Buffer with message
InputDataLength
[in] Length of the message

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgHashInit(..) EDCryptoAlgHashFinal(..)


EDCryptoAlgInfoByGUID

Obtains info about cryptoalgorithm by GUID

ED_API ED_STATUS ED_CALL
EDCryptoAlgInfoByGUID(
    const GUID          *pCryptoAlgGUID,
    PCRYPTO_ALG_INFO    pAlgInfo );

Arguments:

pCryptoAlgGUID
[in] GUID of the installed cryptoalgorithm
pAlgInfo
[out] receives info about cryptoalgorithm

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgOpen(..)


EDCryptoAlgList

Returns array of available algorithms with type CryptoAlgType;
If CryptoAlgType is 0 then all installed algorithms is returned;

ED_API ED_STATUS ED_CALL
EDCryptoAlgList(
    CRYPTO_ALG_TYPE     CryptoAlgType,
    PCRYPTO_ALG_INFO    pAlgInfoArray,
    ULONG               *pNumberOfAlgs );

Arguments:

CryptoAlgType
[in] Cryptoalgorithm types to enumerate. Specifying zero will cause enumerating all installed algorithms
pAlgInfoArray
[out] A pointer to a array that receives algorithms info
pNumberOfAlgs
[in] Number of elements allocated in pAlgInfoArray,
[out] number of algorithms of this type installed in the system

Remarks

If pAlgInfoArray is not sufficient to accept info about all algs, ED_STATUS_MORE_ALGS_PRESENT error is returned and pNumberOfAlgs contains required size . To get algorithms list rellocate pAlgInfoArray to have returned pNumberOfAlgs entries.

Return value:

ED_STATUS_SUCCESS - Success;
ED_STATUS_MORE_ALGS_PRESENT - Buffer is not big enough to receive all installed cryptoalgs information. Please reallocate pAlgInfoArray to have at least pNumberOfAlgs entries

refer to ED SDK Errors reference for other return values


EDCryptoAlgOpen

Opens cryptoalgorithm

ED_API ED_STATUS ED_CALL
EDCryptoAlgOpen(
    const GUID          *pAlgGUID,
    HANDLE              *pCryptoAlgHandle );

Arguments:

pAlgGUID
[in] GUID of the installed cryptoalgorithm
pCryptoAlgHandle
[out]receives handle of the newly opened algorithm

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgClose(..)


EDCryptoAlgSetKey

Set encryption key

ED_API ED_STATUS ED_CALL
EDCryptoAlgSetKey(
    HANDLE              CryptoAlgHandle,
    UCHAR               Key[ED_MAX_KEY_SIZE] );

Arguments:

CryptoAlgHandle
[in] Handle of the opened Block encryption cryptoalgorithm
Key
[in] Key to enter

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoAlgEncryptDecrypt(..)


EDCryptoRandomGet

Fill buffer with random values

ED_API ED_STATUS ED_CALL
EDCryptoRandomGet(
    HANDLE              CryptoAlgHandle,
    PVOID               pRandomBuffer,
    ULONG               RandomLength,
    BOOL                bFastRandom );

Arguments:

CryptoAlgHandle
[in] Handle of the opened Random Number Generation cryptoalgorithm
pRandomBuffer
[out] Receives newly generated numbers
RandomLength
[in] Number of bytes to fill with random numbers
bFastRandom
[in] Use fast random generation

Remarks

There are two options available for random number generation:

  • Use Fast random number generation
  • Use native to algorithm random number generation

    • Rate of the native random number generation could be very slow, for example - 5kBps, so for less secure data recommended to use FastRandom number generation. Fast random number generation generates Seed with native random number algorithm, initialize ISAAC RandomNumberGeneration with this seed and do generation using ISAAC

    Return value:

    ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

    See also:

    EDCryptoRandomSetSeed(..)


EDCryptoRandomSetSeed

Update seed of random number generator with Seed

ED_API ED_STATUS ED_CALL
EDCryptoRandomSetSeed(
    HANDLE              CryptoAlgHandle,
    LPCVOID             pSeedBuffer,
    ULONG               SeedLength );

Arguments:

CryptoAlgHandle
[in] Handle of the opened Random Number Generation cryptoalgorithm
pSeedBuffer
[in] Buffer with data to update seed with
SeedLength
[in] Size of the buffer

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCryptoRandomGet(..)


EDCloseHandle

Close disk handle

ED_API ED_STATUS ED_CALL
EDCloseHandle(HANDLE hImage);

Arguments:

hImage
[in] handle of the image to close

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDOpenDisk(..)


EDCreateDisk

Create disk; Disk is ready to mount (i.e Key is entered) just after disk creation.

ED_API ED_STATUS ED_CALL
EDCreateDisk(UIM_ED_CREATE_DISK_BUF *pBuf, HANDLE *pNewDiskHandle );

Arguments:

pBuf
[in] Points to buffer with disk creation info
pNewDiskHandle
[out] On success pNewDiskHandle receives handle of the newly created disk

Remarks

If requested image size is greater then 2Gb then image will be created splitted to 2Gb fragments, so it is possible to create up to 32Gb image

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of other possible codes;

Error codes:

ED_STATUS_INVALID_HANDLE | Library was not inited. Call EDInitLibrary(..) before any other ED operations.
ED_STATUS_IMAGE_OPEN_FAILED | Failed to call to Kernel Component. Probably error with size of the buffer passed to function
ED_STATUS_INSTALL_PROBLEM | Installation problem. Problem could be fixed by repairing installation
ED_STATUS_NO_MEMORY | Not enough memory
ED_STATUS_BAD_PROGRESSINFO | Progress info specified but is not valid.
ED_STATUS_UNKNOWN_CRYPTO_ALG | Some of the algorithm with GUIDs in creation buffer is not installed or is not compatible with requested operation
ED_STATUS_FILE_CREATE | Failed to create file. Probably bad file name or media is read only
ED_STATUS_FILE_WRITE | Failed to write to the file. Probably no more free space on disk
ED_STATUS_CANCELLED_BY_USER | Operation was cancelled after client signaled hCancelEvent
ED_STATUS_REOPEN_FAILED | Windows 98/Me specific error. EDCreateDisk operation is successfuly completed, but reopen failed. Image must be closed and opened by call to EDOpenDisk(..)
ED_STATUS_IMAGE_TOO_BIG | Unable to create image of requested size; Image file size must be less or equal 32Gb

See Also

ED SDK Errors reference


EDDestroyKey

Logout from disk

ED_API ED_STATUS ED_CALL
EDDestroyKey(HANDLE hImage);

Arguments:

hImage
[in] Handle of the image to log out from

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values


EDEnterKey

Enter working key (Login) to access disk

ED_API ED_STATUS ED_CALL
EDEnterKey(HANDLE hImage, UIM_ED_ENTER_KEY_BUF *pBuf);

Arguments:

hImage
[in] Handle of the opened image
pBuf
[in]Buffer with key

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of other errors

Error codes:

ED_STATUS_INVALID_IMAGE_HANDLE | Invalid handle passed to function
ED_STATUS_INVALID_PARAMETER | Error with size of the buffer passed to function
UIM_STATUS_IMAGE_IS_BUSY | Correct key to image is already entered
ED_STATUS_INVALID_HEADER | Correct key entered but info in the image header is invalid
ED_STATUS_INVALID_KEY | Invalid key entered.
ED_STATUS_PLAIN_HEADER_CORRUPTED | Plain part of the header is corrupted.
ED_STATUS_ENCRYPTED_HEADER_CORRUPTED | Encrypted part of the header is corrupted.
ED_STATUS_STORAGE_REENCRYPTION_FAILED | Failed to reencrypt storage. When storage file is missed it will be impossible to complete reencryption without dettaching storage file from image. Specify bRemoveStorageWhileReencryption=TRUE in the UIM_ED_REENCRYPT_DISK_BUF while calling EDReencryptDisk(..)
ED_STATUS_UNKNOWN_CRYPTO_ALG | Some of the algorithm with GUIDs in buffer is not installed or is not compatible with requested operation

See Also

ED SDK Errors reference


EDGetImageHandleByDrive

Obtain EcryptedDisk handle for drive letter

ED_API ED_STATUS ED_CALL
EDGetImageHandleByDrive( char letter, HANDLE *hImage );

Arguments:

letter
[in] Letter of the disk
hImage
[out] Receives on success handle of the image

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDGetImageInfo(..)


EDGetImageInfo

Obtain opened image info

ED_API ED_STATUS ED_CALL
EDGetImageInfo( HANDLE hImage, ED_IMAGE_INFO *pInfo );

Arguments:

hImage
[in] Handle of the mounted image
pInfo
[out] receives on success info about opened image

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDGetImageHandleByDrive(..)


EDGetImageList

Get images list

ED_API ED_STATUS ED_CALL
EDGetImageList( HANDLE *pHandlesArray, ULONG *pNumberOfImages );

Arguments:

pHandlesArray
[out] Receives handles of opened images
pNumberOfImages
[in] Number of elements allocated in pHandleArray, [out] - Number of handles returned

Remarks

If pHandlesArray size is not sufficient to accept all opened images handles, ED_STATUS_MORE_IMAGES_PRESENT error is returned and pNumberOfImages contains required number of entries. To get images list rellocate pHandlesArray to have returned pNumberOfImages entries.

Return value:

ED_STATUS_SUCCESS - Success;
ED_STATUS_MORE_IMAGES_PRESENT - Buffer is not big enough to receive all opened images handles. Please reallocate pHandlesArray to have newly returned value of pNumberOfImages

refer to ED SDK Errors reference for other return values


EDMountDisk

Mount opened image

ED_API ED_STATUS ED_CALL
EDMountDisk( HANDLE hImage, char Letter );

Arguments:

hImage
[in] Handle of the opened image
Letter
Letter to mount image to

Remarks

Correct key for image must be entered before image could be mounted

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values


EDOpenDisk

Open an image

// on success pDiskHandle contains handle of the opened disk

ED_API ED_STATUS ED_CALL
EDOpenDisk(char *diskPath, BOOL bReadOnly, HANDLE *pDiskHandle);

Arguments:

diskPath
[in] Path to the image file
bReadOnly
[in] Open disk as read only
pDiskHandle
[out] On success pDiskHandle receives handle of the opened disk

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCloseHandle(..)


EDReencryptDisk

Reencrypt Disk

ED_API ED_STATUS ED_CALL
EDReencryptDisk(HANDLE hImage, UIM_ED_REENCRYPT_DISK_BUF *pBuf);

Arguments:

hImage
[in] Handle of the opened image to reencrypt
pBuf
[in] Buffer with reencryption info

Remarks:

Note: disk must be opened, must not be mounted and key must not be entered;
Note2: If storage reencryption was requested then EncryptedStorage will become unsigned.

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of some other errors

Error codes:

ED_STATUS_INVALID_IMAGE_HANDLE | Invalid handle passed to function
ED_STATUS_INVALID_PARAMETER | Error with size of the buffer passed to function
UIM_STATUS_IMAGE_IS_MOUNTED | key to image is entered or disk is mounted. Unmount disk and call EDDestroyKey(..) before calling reencrypt
ED_STATUS_REENCRYPTION_NOT_FINISHED | Previously initiated reencryption operation was no finished. Restart encryption by calling EDReencryptDisk(..)
ED_STATUS_INVALID_HEADER | Correct key entered but info in the image header is invalid
ED_STATUS_INVALID_KEY | Invalid key entered.
ED_STATUS_PLAIN_HEADER_CORRUPTED | Plain part of the header is corrupted.
ED_STATUS_ENCRYPTED_HEADER_CORRUPTED | Encrypted part of the header is corrupted.

See Also

ED SDK Errors reference


EDUnmountDisk

Unmount disk

ED_API ED_STATUS ED_CALL
EDUnmountDisk( HANDLE hImage, BOOL bForceUnmount );

Arguments:

hImage
[in] Handle of the mounted image
bForceUnmount
[in] Force unmount disk even if Windows has opened handles on this drive

Remarks:

This operation works asynchronously ie function will return before actual unmount will be completed. To wait till unmount of disk will be completed use EDWaitUnmountComplete(..)

Return values:

ED_STATUS_IMAGE_HAS_OPENED_HANDLES | Returned in attempt to soft unmount image which has opened handles. Close all handles and try again or call with bForceUnmount set to TRUE if it is required to unmount disk immediately.
ED_STATUS_SUCCESS | Success

See also:

EDWaitUnmountComplete(..) ED SDK Errors reference


EDWaitUnmountComplete

Wait until unmount will be completed

ED_API ED_STATUS ED_CALL
EDWaitUnmountComplete( HANDLE hImage );

Arguments:

hImage
[in] Handle of the mounted image

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDUnmountDisk(..)


EDOldImage_PasswordToKey

Convert password for legacy image to key

ED_API ED_STATUS ED_CALL
EDOldImage_PasswordToKey(
    HANDLE hOldImage,
    const char   *szPassword,
    ULONG PasswordLength,
    UCHAR Key[ED_MAX_KEY_SIZE]
    );

Arguments:

hOldImage
[in] handle of the image to use password and converted key with
szPassword
[in] password for image
PasswordLength
[in] length of the password. Usualy this is just strlen(szPassword)
Key
[out] Transformed from password key. This key would be used to pass to EDEnterKey(..) or to EDOldImage_Convert(..)

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDEnterKey(..), EDOldImage_Convert(..)


EDOldImage_ReadKeyFromFile

EDOldImage_ReadKeyFromFile

ED_API ED_STATUS ED_CALL
EDOldImage_ReadKeyFromFile(
    HANDLE hOldImage,
    const char* szKeyFileName,
    UCHAR  Key[ED_MAX_KEY_SIZE]
    );

Arguments:

hOldImage
[in] handle of the image to use password and converted key with
szKeyFileName
[in] Name of the file with legacy key for image
Key
[out] Transformed from password key. This key would be used to pass to EDEnterKey(..) or to EDOldImage_Convert(..)

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDEnterKey(..), EDOldImage_Convert(..)


EDOldImage_Convert

Convert legacy image to the new format

ED_API ED_STATUS ED_CALL
EDOldImage_Convert(
    HANDLE	hOldImage,
    PUIM_ED_CONVERT_OLD_IMAGE ConvertInfo);

Arguments:

hOldImage
[in] handle of the old image to convert
ConvertInfo
[in] Pointer to the convert structure describing keys and Algorithms to use with the converted image

Remarks

Legacy cryptoalgorothms such as TripleDes must be installed in order to work with legacy images

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of some other possible codes;

Error codes:

ED_STATUS_NOT_AN_OLD_IMAGE | Handle passed to function is not a handle for the legacy image
ED_STATUS_UNKNOWN_CRYPTO_ALG | Block encryption algorithm specified for the converted image is not installed
ED_STATUS_UNKNOWN_HASH_ALG | Hash calculation algorithm specified for the converted image is not installed
ED_STATUS_UNKNOWN_RANDOM_ALG | Random number generation algorithm specified for the converted image is not installed

See Also

EDCreateDisk(..), EDOldImage_PasswordToKey(..), EDOldImage_ReadKeyFromFile(..), ED SDK Errors reference


EDCheckStorageSign

Check sign of the opened storage (could take a few minutes)

ED_API ED_STATUS ED_CALL
EDCheckStorageSign(
    HANDLE hImage,
    BOOL bPlainStorage );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of some other errors

Error codes:

ED_STATUS_IMAGE_HAS_NO_STORAGE | Image has no storage. Nothing to check
ED_STATUS_STORAGE_NOT_SIGNED | Storage is not signed
ED_STATUS_BAD_STORAGE_SIGN | Storage sign flag is set but sign of the storage is invalid

See Also

ED SDK Errors reference EDSignStorage(..)


EDCloseStorage

Close opened storage

ED_API ED_STATUS ED_CALL
EDCloseStorage(
    HANDLE              hImage,
    BOOL                bPlainStorage );

Arguments:

hImage
[in] Handle of the opened image
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDOpenStorage(..)


EDCreateStorage

Create Storage

ED_API ED_STATUS ED_CALL
EDCreateStorage(
    HANDLE              hImage,
    BOOL                bPlainStorage,
    const char          *fileName );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage
fileName
[in] name of the storage to create. Note: there are two options with file names

Remarks

When image was created with size of the storage set to zero then it is possible to create storage in separate file. Initially created storage has size zero.

File name could be relative to the image file or it coult be absolute path to the storage. If path doesn't start drive:\ or with \\ then path is interpreted as relative to the image.

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of some other errors

Error codes:

ED_STATUS_IMAGE_HAS_STORAGE | Image already has storage of this type.
ED_STATUS_IMAGE_HAS_EMBEDDED_STORAGE | Image has embedded storage of this type.
ED_STATUS_FILE_CREATE | Failed to create file for storage.

See Also

ED SDK Errors reference


EDOpenStorage

Open Storage

ED_API ED_STATUS ED_CALL
EDOpenStorage(
    HANDLE              hImage,
    BOOL                bPlainStorage );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage

Return value:

ED_STATUS_SUCCESS - Success; See table below for the list of some other errors

Error codes:

ED_STATUS_NOT_LOGGED_IN | Operation with encrypted storage requested but key for image is not entered.
ED_STATUS_FILE_OPEN | Failed to open storage file

See Also

ED SDK Errors reference


EDReadStorage

Read data from storage

ED_API ED_STATUS ED_CALL
EDReadStorage(
    HANDLE hImage,
    BOOL bPlainStorage,
    PVOID pBuf,
    ULONG BytesToRead,
    ULONG *pBytesRead,
    ULONGLONG *qOffset );

Arguments:

hImage
[in] Handle of the opened image. If operation with encrypted storage then key must be entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage
pBuf
[out] receives readen data
BytesToRead
[in] Number of bytes to read
pBytesRead
[out] Number of bytes read
qOffset
Offset at which read data

Remarks:

Note: if storage is located in separate file, EDOpenStorage(..) must be called before storage I/O operation could occur

Note also that read from plain storage can be done without logging to the disk

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDWriteStorage(..)


EDRemoveStorage

Remove storage from image

ED_API ED_STATUS ED_CALL
EDRemoveStorage(
    HANDLE              hImage,
    BOOL                bPlainStorage,
    BOOL                bDeleteFromDisk );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage
bDeleteFromDisk
Also delete storage file from disk

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values


EDSetStorageSize

Set storage size

ED_API ED_STATUS ED_CALL
EDSetStorageSize(
    HANDLE hImage,
    BOOL bPlainStorage,
    ULONGLONG StorageSize );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage
StorageSize
[in] Storage size to set

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values


EDSignStorage

Sign opened storage (could take a few minutes)

ED_API ED_STATUS ED_CALL
EDSignStorage(
    HANDLE hImage,
    BOOL bPlainStorage );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in]TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDCheckStorageSign(..)


EDWriteStorage

Write data to the storage

ED_API ED_STATUS ED_CALL
EDWriteStorage(
    HANDLE  hImage,
    BOOL    bPlainStorage,
    LPCVOID pBuf,
    ULONG   BytesToWrite,
    ULONG   *pBytesWritten,
    ULONGLONG *qOffset );

Arguments:

hImage
[in] Handle of the opened image with key entered
bPlainStorage
[in] TRUE - operation with Plain (unencrypted) storage, FALSE - operation with encrypted storage
pBuf
[in] Buffer with data to write to storage
BytesToWrite
[in] Number of bytes to write
pBytesWritten
[out] Number of bytes written
qOffset
[in] Offset to write at

Remarks:

Note: if storage is located in separate file, EDOpenStorage(..) must be called before storage I/O operation could occur

Return value:

ED_STATUS_SUCCESS - Success; refer to ED SDK Errors reference for other return values

See also:

EDReadStorage(..)


ED SDK Errors reference

EncryptedDisk errors

The following is a list of possible error codes returned by the call to the ED functions, along with their extended explanations.

ED_STATUS_WIN_ERROR means that actual error value came from Microsoft Windows and must be obtained through the call to GetLastError().

ED_STATUS_SUCCESS
(0)
Operation success
Operation was successfuly completed
ED_STATUS_REENCRYPTION_NOT_FINISHED
(1)
Reencryption is not finished
This error returned when previously initiated reencryption was not successfully finished due to power break. After returning this error, application must complete reencryption making the call to EDReencryptDisk(..) with bContinueReencryption parameter set to TRUE
ED_STATUS_INVALID_KEY
(2)
Key is invalid
Specified key is not valid for the target image
ED_STATUS_BAD_PROGRESSINFO
(3)
Invalid progress info
Some fields in the passed to function UIM_ED_PROGRESS structure are not valid
ED_STATUS_CANCELLED_BY_USER
(4)
Operation cancelled
Operation was interrupted by the application
ED_STATUS_UNKNOWN_RANDOM_ALG
(5)
Random alg is unknown
Specified by GUID random alg is not installed in system
ED_STATUS_UNKNOWN_HASH_ALG
(6)
Hash alg is unknown
pecified by GUID hash alg is not installed in system
ED_STATUS_UNKNOWN_CRYPTO_ALG
(7)
Block encryption slg is unknown
pecified by GUID block encryption alg is not installed in system
ED_STATUS_DISK_IS_PLAIN
(8)
Disk has no MBR
Disk is inserted to the system, but it has no MBR
ED_STATUS_HEADER_CORRUPTED
(9)
Header corrupted
Header of the disk is corrupted
ED_STATUS_PLAIN_HEADER_CORRUPTED
(10)
Plain (unencrypted) header of the image is corrupted
No ED Signature in the image file or sign of the header is invalid
ED_STATUS_ENCRYPTED_HEADER_CORRUPTED
(11)
Encrypted header of the images is corrupted
Sign of the encrypted header of the image file is corrupted
ED_STATUS_IMAGE_FATAL_ERROR
(12)
Unable to process operation
Some error during operation occured; Image must be reopened.
ED_STATUS_CRYPTO_ERROR
(13)
Error during block encryption
Error during block encryption occured. Error in the cryptoalgorithm or bad pointers to memory specified
ED_STATUS_RESTART_BUFFER_INIT_FAILED 1
(14)
Unable to init restart buffer
Unable to init restart buffer for the reencryption operation. Probably disk is read only
ED_STATUS_RESTART_BUFFER_FAIL
(15)
Error during accessing restart buffer
Error during accessing restart buffer. Probably restart buffer is corrupted or disk is read only
ED_STATUS_UNKNOWN_IMAGE
(16)
Image unknown
Handle of the image points to the unknown for the ED image type
ED_STATUS_NO_MEMORY
(17)
Not enough memory
Not enough memory to complete operation
ED_STATUS_UNMOUNT_IMPOSSIBLE
(18)
Unable to proceed with image unmount
Image is in use by operation system and it is impossible to unmount image at this moment
ED_STATUS_FILE_CREATE
(19)
Unable to create file
File creation failed. Probably disk is read only or file is already exists
ED_STATUS_FILE_OPEN
(20)
Unable to open file
Unable to open file. Probably there is no such file in the path specified
ED_STATUS_FILE_WRITE
(21)
File write failed
File write failed. Probably disk is read only or no free space on path specified
ED_STATUS_FILE_READ
(22)
File read operation failed
File read operation failed.
ED_STATUS_FILE_IO
(23)
File i/o failed
Unknown error while accessing file
ED_STATUS_NOT_ENOUGH_STORAGE_SPACE
(24)
No free space in storage
Storage write operation couldn't be completed cause maximum storage size exceeded. This error most likely could occur during writing to the embedded storage
ED_STATUS_NOT_LOGGED_IN
(25)
Key for accessing image is not entered
Specified operation couldn't be done without entering correct key for the image. Key could be entered by the call to EDEnterKey(..)
ED_STATUS_IMAGE_HAS_NO_STORAGE
(26)
Image has no storage
Some operation with storage was initiated, but image has no storage of this type
ED_STATUS_STORAGE_IS_NOT_OPENED
(27)
Storage of the image is not opened
Requested operation couldn' be done without opening attached storage
ED_STATUS_STORAGE_NOT_SIGNED
(28)
Storage is not signed
Storage sign check requested but storage was not signed
ED_STATUS_BAD_STORAGE_SIGN
(29)
Invalid storage sign
Storage content corrupted
ED_STATUS_IMAGE_HAS_STORAGE
(30)
Image already have storage
EDCreateStorage(..) operation couldn't be done cause image already has storage of this type
ED_STATUS_IMAGE_HAS_EMBEDDED_STORAGE
(31)
Image has embedded storage
EDCreateStorage(..) operation couldn't be done cause image has embedded storage.
ED_STATUS_INVALID_OFFSET
(32)
Offset invalid
Offset specified in call to EDReadStorage(..) or EDWriteStorage(..) is beyond the storage range
ED_STATUS_READ_ONLY
(33)
File is read only
File is read only and write is impossible
ED_STATUS_REOPEN_FAILED
(34)
Image reopen failed.
Windows 98/Me specific error. EDCreateDisk(..) operation is successfuly completed, but reopen failed.
ED_STATUS_STORAGE_RESTART_BUFFER_FAIL
(35)
Restart buffer for storage reencryption initialization failed
Restart buffer for storage reencryption initialization failed. Probably, disk is read only
ED_STATUS_STORAGE_FILE_READ
(36)
Failed to read storage
Failed to read storage. When storage file is missed it will be impossible to complete reencryption without dettaching storage file from image. Specify bRemoveStorageWhileReencryption=TRUE in the UIM_ED_REENCRYPT_DISK_BUF while calling EDReencryptDisk(..)
ED_STATUS_STORAGE_FILE_WRITE
(37)
Failed to write to the storage
Failed to write to the storage. Probably storage file is read only
ED_STATUS_STORAGE_REENCRYPTION_FAILED
(38)
Storage reencryption failed
Failed to reencrypt storage. When storage file is missed it will be impossible to complete reencryption without dettaching storage file from image. Specify bRemoveStorageWhileReencryption=TRUE in the UIM_ED_REENCRYPT_DISK_BUF while calling EDReencryptDisk(..)
ED_STATUS_BAD_SIZE
(39)
Bad size
Bad parameter size specified
ED_STATUS_CONTROLLER_OPEN_FAILED
(40)
Failed to open Kernel Controller
Failed to open Kernel Controller! Repairing installatioin will probably fix problem
ED_STATUS_CONTROLLER_CLOSE_FAILED
(41)
Failed to close handle to the Kernel controller.
Failed to close Controller handle. Probably handle is invalid
ED_STATUS_INVALID_HANDLE
(42)
Invalid handle
Handle is not valid.
ED_STATUS_INVALID_VERSION
(43)
Invalid version
Version of the API is not compatible with version of the driver
ED_STATUS_OPERATION_FAILED
(44)
Operation failed
Unknown error was occured during operation
ED_STATUS_INVALID_PARAMETER
(45)
Invalid parameter
Invalid function parameter.
ED_STATUS_IMAGE_OPEN_FAILED
(46)
Open image failed
Open image failed. May be file doesn't exist or image is already opened.
ED_STATUS_MORE_IMAGES_PRESENT
(47)
More images is present.
Insufficient buffer size specified to accept all available images
ED_STATUS_DRIVE_LETTER_IS_BUSY
(48)
Drive letter is in use
Specifed drive letter is in use by operating system.
ED_STATUS_INVALID_DRIVE_LETTER
(49)
Invalid drive mask specified
Specifed drive letter is invalid
ED_STATUS_INVALID_DRIVE
(50)
No such drive letter
No such drive letter in system
ED_STATUS_INVALID_REQUEST
(51)
Invalid request to the driver
Invalid opearation request to the controller
ED_STATUS_IOCTL_INPUT_BUFFER_TOO_SMALL
(52)
Buffer is too small
Input buffer is too small
ED_STATUS_IOCTL_OUTPUT_BUFFER_TOO_SMALL
(53)
Output buffer is too small
Output buffer is too small
ED_STATUS_INVALID_REQUEST_SIGNATURE
(54)
Invalid request
Bad-formed request to the Controller
ED_STATUS_INSTALL_PROBLEM
(55)
Installation problem
Installation problem. Repair installation could fix the problem
ED_STATUS_IMAGE_IS_MOUNTED
(56)
Image is mounted
Mount failed cause image is already mounted.
ED_STATUS_IMAGE_MOUNT_DISABLED
(57)
Mount disabled
Image is opened for internal purposes and mount is disabled
ED_STATUS_SYSTEM_ERROR
(58)
System error
System error.
ED_STATUS_IMAGE_IS_BUSY
(59)
Image is busy
Image is in use or image open operation was not completed
ED_STATUS_IMAGE_IS_NOT_READY
(60)
Image is not ready
Image is not ready to mount. Probably key is not entered.
ED_STATUS_NOT_IMPLEMENTED
(61)
Operation is not implemented
Requested operation is not implemented in this version
ED_STATUS_UNRECOGNIZED_MEDIA
(62)
Unrecognized media
Media of the image is not recognized
ED_STATUS_NONEXISTENT_SECTOR
(63)
Sectors doesn't exist
Read/Write sector operation failed cause image has not requested sector
ED_STATUS_IMAGE_IS_NOT_OPENED
(64)
Image is not opened
Image is not opened
ED_STATUS_CRYPTO_ALG_OPEN_FAILED
(65)
Failed to open algorithm
Failed to open algorithm. Probably error in CryptoPlugin
ED_STATUS_CRYPTO_ALG_GET_INFO_FAILED
(66)
Failed to obtain algorithm info
Failed to obtain algorithm info. Probable error in CryptoPlugin or invalid parameter
ED_STATUS_KEY_TOO_SHORT
(67)
Key is too short
Specified cryptokey is too short for cryptoalgorithm
ED_STATUS_CRYPTO_ALG_SET_KEY_FAILED
(68)
Failed to enter key
Failed to enter key to the cryptoalgorithm.
ED_STATUS_CRYPTO_ALG_DECRYPT_FAILED
(69)
Decrypt operation failed
Decrypt operation failed
ED_STATUS_CRYPTO_ALG_ENCRYPT_FAILED
(70)
Encrypt operation failed
Encrypt operation failed
ED_STATUS_CRYPTO_ALG_NOT_SUPPORTED
(71)
algorithm not supported
Specified alg type is not supported
ED_STATUS_INVALID_CRYPTO_ALG_TYPE
(72)
Invalid algorithm type
Operation couldn't proceed with specified cryptoalgorithm
ED_STATUS_CRYPTO_ALG_HASH_UPDATE_FAILED
(73)
Failed to update hash
Failed to update hash
ED_STATUS_CRYPTO_ALG_HASH_GET_FAILED
(74)
Failed to get hash result
Failed to get hash result
ED_STATUS_CRYPTO_ALG_NOT_FOUND
(75)
Cryptoalgorithm not found
Cryptoalgorithm is not installed
ED_STATUS_INVALID_CRYPTO_HANDLE
(76)
Invalid algorithm handle
Cryptoalgorithm handle is not valid
ED_STATUS_PROTECTED_CRYPTO_HANDLE
(77)
Cryptoalgorithm protected
Cryptoalgorithm is opened for internal usage only
ED_STATUS_MORE_ALGS_PRESENT
(78)
More algs present
Insufficient buffer to accept requested cryptoalgorithms information. There are more algorithms available
ED_STATUS_CRYPT_NOT_SUPPORTED
(79)
Cryptooperations is not supported
Cryptooperations is not supported
ED_STATUS_CRYPT_NO_MEMORY
(80)
Not enough memory for crypto
Not enough memory for crypto operation
ED_STATUS_CRYPT_INVALID_POINTER
(81)
Invalid pointer passed to cryptooperation
Invalid pointer passed to cryptooperation
ED_STATUS_CRYPT_BAD_COMMAND
(82)
Bad cryptocommand
Bad command for specified cryptoalgorithm
ED_STATUS_INVALID_SPLIT
(83)
Fragment of the Image is not valid
Corrupted header of the fragment of image.
ED_STATUS_IMAGE_TOO_BIG
(84)
Image is too big. Unable to create
Unable to create image of requested size; Image file size must be less or equal 32Gb
ED_STATUS_NOT_FIRST_FRAGMENT
(85)
Not first fragment of splitted image is specified for open operation
Not first fragment of splitted image is specified for open operation. Image can be opened only by its main part file name
ED_STATUS_NOT_AN_OLD_IMAGE
(86)
Attempt to call some EDOldImage_XXXX function with new format of image
This error is returned in attempt to call some EDOldImage_XXXX function for new format of image
ED_STATUS_OLD_IMAGE_ON_KEY
(87)
Attempt to call some EDOldImage_XXXX function with password instead of legacy key file
This error is returned in attempt to call some EDOldImage_XXXX function with password instead of legacy key file
ED_STATUS_OLD_IMAGE_ON_PASSWORD
(88)
Attempt to call some EDOldImage_XXXX function with legacy key file instead of password
This error is returned in attempt to call some EDOldImage_XXXX function with legacy key file instead of password
ED_STATUS_IMAGE_HAS_OPENED_HANDLES
(89)
Image has opened handles while unmount
This error is returned in attempt to softly unmount drive with opened handles. Close all file handles and try call EDUnmountDisk(..) again or set bForceUnmount to TRUE if it is required to unmount disk immediately.
ED_STATUS_WIN_ERROR
(65535)
Returned error is standard Windows error
Returned error is standard Windows error. Error must be obtained by call to the GetLastError()