|The information on this page refers to LM-X v4.9 and newer, which added HostIDs for Google Compute Engine and Azure. If you are using an older version of LM-X, refer to documentation for earlier versions.|
The LMX_HostidSimple function retrieves the HostID from the computer system and returns it as a NULL-terminated string.
[in/out] LM-X handle.
[in] Value that specifies the HostID type to be retrieved.
Possible values are:
Network card HostID
IP address HostID
HaspHL Dongle HostID
Hostid of physical harddisk
Windows product ID
Amazon EC2 Instance ID
Amazon Google Compute Engine ID
Amazon Azure ID
[out] Pointer to a string that will hold the HostID(s). The length of the string can be up to LMX_MAX_LONG_STRING_LENGTH.
On success, this function returns the status code LMX_SUCCESS.
If there are no HostIDs of the requested type, the string will be empty. If there is more than one of the requested type, the HostIDs are separated by commas.
When using LMX_HOSTID_ALL, all HostIDs are returned, with the HostID type prefixing the HostID; for example:
For single HostIDs, the HostID is returned with multiple HostIDs of that type separated by commas; for example:
You can use the following code to retrieve all the HostIDs with the LMX_HOSTID_IPADDRESS type that are currently in use and display them on success.