Inventory

This category covers the calls to build the inventory and hash the optical media.

Enumerations

enum HSDCInventoryStatus : DWORD { HSDCInventoryStatusAll = 0, HSDCInventoryStatusOnline }

Functions

HSDCError HSDCAPI HSDCGetInventory (DWORD status, char **pJstr)

Obtains a JSON representation of devices attached (or previously attached) to the agent machine.

HSDCError HSDCAPI HSDCHashOpticalDisk (const wchar_t *path, char **pJstr)

Computes an optical disk hash that can be used to identify it and then set a policy tied to this specific optical disk.

Enumeration Type Documentation

HSDCInventoryStatus

enum HSDCInventoryStatus : DWORD

Enumerators

HSDCInventoryStatusAll

Inventory of devices plugged into this machine since Device Control was installed.

HSDCInventoryStatusOnline

Inventory of devices plugged into this machine now.

Function Documentation

HSDCGetInventory()

HSDCError HSDCAPI HSDCGetInventory ( DWORD status, char ** pJstr )

Obtains a JSON representation of devices attached (or previously attached) to the agent machine.

  • Class, hardwareid, and instances can be used to identify a device, the rest is just for information.
  • In case of bad categorization of a device, this information can be used by support to provide device identity customization.
  • Type and characteristics are described in the Windows Driver Kit documentation.
Parameters

status

One of the HSDCInventoryStatus values. This selects whether or not the devices list is filtered to include only currently attached devices or not.

pJstr

[out] A non-null pointer to an output buffer. On success it will contain a JSON representing the devices formatted as below:

Copy
{
   "devices" : [
      {
         "bus" : "1",
         "class" : "100",
         "classguid" : "{4D36E972-E325-11CE-BFC1-08002BE10318}",
         "devicename" : "\\Device\\NDMP618",
         "drivername" : "\\Driver\\tunnel",
         "fdocharacteristics" : "256",
         "fdotype" : "23",
         "hardwareid" : "*ISATAP",
         "instances" : [ "ISATAP_0", "ISATAP_1" ],
         "name" : "Microsoft ISATAP Adapter, Microsoft ISATAP Adapter, Microsoft",
         "pdocharacteristics" : "384",
         "pdotype" : "34",
         "timestamp" : "2015-03-02T11:57:46Z"
      }
   ]
}
Returns

HSDCErrorSuccess

The operation succeeded

HSDCErrorInvalidArg

Input was nullptr

HSDCErrorUnexpected

Unexpected error

HSDCHashOpticalDisk()

HSDCError HSDCAPI HSDCHashOpticalDisk ( const wchar_t * path, char ** pJstr )

Computes an optical disk hash that can be used to identify it and then set a policy tied to this specific optical disk.

Parameters

path

The path to the optical drive in which the optical disk is located.

pJstr

[out] A non-null pointer which will be re-seated to point to a string of JSON information formatted as below:

Copy
{
    "path": "E:\\",
    "label" : "OFFICE14",
    "sha1" : "0d0139aa6a95dc5a30ef07876aae74e8f7260842",
    "sha256" : "5c1d697466f5371f340c47ec3113fcf0367bf6afa1a09e462294b7260898a840"
}
Returns

HSDCErrorInvalidVolume

Cannot retrieve volume information for this drive

HSDCErrorAccessDenied

Unable to access device

HSDCErrorVolumeNotSupported

Unsupported format, it cannot be hashed

HSDCErrorAgentNotInstalled

Agent not installed and required for multiple sessions disk

HSDCErrorUnexpected

Unexpected error