his section provides information to set up the SDK on your development platform. Read about the requirements, necessary to start your development, the details on the distribution package as well as the SDK architectural design.

Requirements for C++/C#

To start with the HDM SDK you need: 

  • Supported Environments: Windows 7 SP1 and later
  • Microsoft .NET Framework 4.6 
  • C++ MS VS 14.0 runtime, however using VS 15 runtime and higher is possible
  • 2 GB RAM, 4 GB RAM of free space, 1.5 GHz CPU

Installing the SDK

To get the distribution package use the inquiry form below: 

Once you have the SDK, you can start using it for your project

  1. Unpack it to the designated folder on your machine.
  2. Open the project in Visual Studio.

Delivery Package

This section contains the description of the components of the SDK

Sources

  • hdmclientlib – C++ wrapper for HDM SDK (a library with partitioning management functionality demonstration)
  • hdmclientapp – C++ console application. Find the examples here for the C++ interface
  • hdmclientinteroplib – C# hdmclientlib wrapper. This is the library with the partitioning management functionality for C# interface
  • hdmclientinteropapp – C# console application. Find the implementation examples here for the C# interface

Binary Files

program – compiled .dll libraries + CLI for testing purposes: 

  • biontdrv_wink.sys – low-level I/O driver for Windows Desktop mode
  • biontdrv_winbs.sys – low-level I/O driver for Windows Bluescreen mode
  • hdmengine_biont.dll – HDM SDK I/O helper (dynamic library)
  • hdmengine_hdmsdk.dll – HDM SDK (dynamic library)
  • hdmengine_hdmsdk.lib – HDM SDK (static library)
  • hdmengine_resmsg.dll – HDM SDK string translation resources (dynamic library)
  • hdmengine_resmsg.lib – HDM SDK string translation resources (static library)
  • hdmengine_bluescrn.exe – HDM SDK execution application for Windows Bluescreen mode
  • hdmclient_hdmclientlib.dll – HDM SDK client C++ API for user application (dynamic library)
  • hdmclient_hdmclientapp.exe – HDM SDK client C++ API sample (execution file)
  • hdmclient_hdmclientinteroplib.dll – HDM SDK client C# API for User application (dynamic library)
  • hdmclient_hdmclientinteropapp.exe – HDM SDK client C# API sample (execution file)

Header Files

  • hdmengine headers – contains drivers for low-level HDM SDK
  • hdmclient headers – contains drivers for high-level C++ wrapper for HDM SDK

Documentation

  • hdmclientlib – C++ API Reference for the HDM SDK
  • hdmclientinteroplib – C# API Reference for HDM SDK for user application

SDK Architecture

This section contains the description of the HDM SDK components. C# wrapper design provides the same capabilities as the C++ design. Below is the C# version of the architecture’s scheme.

C++ HDM SDK Architecthure

hdmengine_hdmclientinterpolib.dll

C# wrapper is built around Hdmengine core functionality:

  • Loads C/C++ native libraries, calls their methods.
  • Contains C# declarations of C methods. 
  • Provides in-process implementation of Hdmengine API, a simple wrapper around native calls.
  • Uses full native structures and classes, and C++ arrays are extracted to C# arrays.
  • Contains C# structures of C/C++ side structures in native libraries.
  • Contains C++ pointers to arrays, to UTF-8 strings.
  • C++ components use UTF-8 strings encoding, so native strings returned to C# as Byte arrays, but converted later to C# String classes from UTF-8 encoding.

hdmengine_hdmclientinteropapp.exe

The sample C# application contains main() entry point. It is responsible for operation parameters collection, operation status output, task scheduling in thread pool and task scenario implementation. 

In this example application arguments are collected from command prompt in the form of <command1> <arg1> … ; <command2> <arg2> and commands are separated with the semicolon.

A task scenario is the subroutine with calls to Hdmengine API methods using the IHdmengineApi interface. As an example you can get current disks and partitions list, copy a partition, wipe disk and so on. Task scenario uses command parameters, obtained from the command line.

For demonstration purposes the output is done in command prompt, it shows messages from Hdmengine, report operation progress, it can ask for user confirmation. Implementation of report interface should be passed to Hdmengine.

hdmclient_hdmclientlib.dll

C++ dynamic library for the HDM SDK client API for user application.

  • Loads C/C++ native libraries, calls their methods.
  • Provides in-process implementation of Hdmengine API, a simple C++ wrapper around native calls.
  • Uses full native structures and classes, and C++ arrays.
  • Contains C++ pointers to arrays, to UTF-8 strings.

hdmengine_hdmclientapp.exe

The sample C++ application contains main() entry point. It is responsible for operation parameters collection, operation status output, and task scenario implementation. 

In the sample application arguments are collected from command prompt in the form of <command1> <arg1> …  <command2> <arg2>, and the commands are separated with the space. 

A task scenario is the subroutine with calls to Hdmengine API methods using the Hdmclient_IProgress interface. As an example you can get current disks and partitions list, copy a partition, wipe disk and so on. Task scenario uses command parameters, obtained from the command line.

For demonstration purposes the output is done in command prompt, it shows messages from Hdmengine, report operation progress, it can ask for user confirmation. The implementation of the report interface should be passed to Hdmengine.

hdmengine native C/C++ libraries 

These modules implement Hdmengine core functionality.

They can be used directly from C/C++ applications along with C# wrapper.

During most operations on volumes and disks, they are locked and sometimes snapshot with Volume Shadow Copy Service (VSS) Windows subsystem. So it is not possible to access a locked drive from another application or another Hdmengine instance until the job is done.

Engine uses callbacks for the reports state, there are no methods for asking the state of operation. State is returned in callbacks along with critical operations confirmation requests.

hdmengine_bluescrn.exe

C++ execution application for the Windows Bluescreen mode.

It is used when operation cannot be handled in the Windows desktop mode, for example, a C volume split, or wiping C volume disk.

A system volume can be destroyed, extended or restored from backup only in the Bluescreen mode. For such tasks Hdmengine must be launched with reboot allow flag, reboot request status must be processed and Bluesreen module must be set up. After a reboot, it will safely perform tasks on system volume. You can find examples in the source code, available with the distribution package and code samples.

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Summary
Article Name
Getting Started with HDM SDK C++/C#
Description
In this guide, you'll learn how to properly get started with Paragon HDM SDK in C++ and C# programming languages.
Author
Publisher Name
Paragon Software
Publisher Logo