...
HostID Type | Description | Platform availability |
LMX_HOSTID_ETHERNET | Network card HostID | All |
LMX_HOSTID_USERNAME | Username HostID | All |
LMX_HOSTID_HOSTNAME | Hostname HostID | All |
LMX_HOSTID_IPADDRESS | IP address HostID | All |
LMX_HOSTID_CUSTOM | Custom HostID | All |
LMX_HOSTID_DONGLE_HASPHL | HaspHL Dongle HostID | Windows (x86 and x64) Linux (x86 and x64) Mac OS X (Universal) |
LMX_HOSTID_HARDDISK | HostID of physical harddisk | Windows XP and later (x86 and x64; not available for use with MinGW compiler); Server 2003; Server 2008 |
LMX_HOSTID_LONG | System-specific HostID | Solaris, HP-UX Mac OS X (Universal) |
LMX_HOSTID_BIOS | Bios HostID | Windows XP and later (x86 and x64; not available for use with MinGW compiler); Server 2003; Server 2008 |
LMX_HOSTID_WIN_PRODUCT_ID | Windows Product ID | Windows (x86 and x64) |
LMX_HOSTID_AWS_INSTANCE_ID | Amazon EC2 Instance ID | All within Amazon EC2 environment |
...
One way to check the dongle is by ensuring that LMX_HOSTID_DONGLE_HASPHL HostID is in use and, if so, comparing the HostID value against the last known good value, as demonstrated in the following example.
int i;
LMX_FEATURE_INFO FI;
LMX_HOSTID LmxHostid[LMX_MAX_HOSTIDS];
int nHostids;
LMX_GetFeatureInfo(LmxHandle, "my_app", &FI);
/* Go through each hostid used for this particular feature */
for (i = 0; i < FI.nClientLicenseHostids; i++)
{
/* See if the hostid is a dongle hostid */
if (FI.ClientLicenseHostid[i].nHostidType == LMX_HOSTID_DONGLE_HASPHL)
{
/* See if hostid function reports the same value as we used when checking out the license */
if (LMX_Hostid(LmxHandle, LMX_HOSTID_DONGLE_HASPHL, LmxHostid, &nHostids)!= LMX_SUCCESS)
...
return BAD_DONGLE;
if (nHostid != 1)
return BAD_DONGLE;
/* Compare if the hostid at checkout time matches the hostid at present time */
if (strcmp(FI.ClientLicenseHostid[0].szValue, LmxHostID[0].szValue) != 0)
...
return BAD_DONGLE;
}
}
This check should preferably be done every few minutes to ensure that users do not move the dongle to other workstations and overuse standalone licenses.
...