The LMX_GetLicenseInfo function retrieves license information from one or more license servers or from a local path.
Prototype
Code Block | ||
---|---|---|
| ||
LMX_STATUS LMX_GetLicenseInfo ( LMX_HANDLE LmxHandle, LMX_LICENSE_INFO **ppLicenseInfo ); |
Parameters
LmxHandle
[in/out] LM-X handle.
ppLicenseInfo
[out] Address of LMX_LICENSE_INFO structure pointer.
Return values
On success, this function returns the status code LMX_SUCCESS.
On failure, this function returns an error code in the format described in Return codes.
Remarks
This function is used to retrieve information about both network and local licenses. This function will query one or more license servers to determine the server's status and other license information, and retrieve license information from local paths (a local .lic file or all .lic files in a specified local directory).
...
Code Block | ||
---|---|---|
| ||
#include <lmx.h>
#include <stdio.h>
LMX_HANDLE h;
int main()
{
LMX_STATUS s;
LMX_LICENSE_INFO *pLicenseInfo;
LMX_FEATURE_INFO *pFI;
exit_on_error(LMX_Init(&h));
if ((s = LMX_GetLicenseInfo(h, &pLicenseInfo)) != LMX_SUCCESS)
exit_on_error(s);
for (; pLicenseInfo != NULL; pLicenseInfo = pLicenseInfo->pNext)
{
printf("LicencePath : %s\n", pLicenseInfo->szPath);
printf("Port : %d\n", pLicenseInfo->nPort);
printf("Type : ");
if (pLicenseInfo->eLicenseType == LMX_TYPE_LOCAL)
printf("Locale\n");
else if (pLicenseInfo->eLicenseType == LMX_TYPE_NETWORK)
printf("Network\n");
printf("Features:\n\n");
for (pFI = pLicenseInfo->pFeature; pFI != NULL; pFI = pFI->pNext)
{
printf("FeatureName : %s\n", pFI->szFeatureName);
printf("VendorName : %s\n", pFI->szVendorName);
}
}
return 0;
}
|
...