logo_wupi_64x64px WupiQueryInfo

WupiQueryInfo returns some information of the used license of a License List.

  • C, C++
  • C#

Syntax

int WupiQueryInfo(int iLicenseList, int iCmd);

Parameters

•iLicenseList refers to the license list index.

•iCmd is a flag that describes the desired information:

•WupiQIUnitCounter returns the current value of the Unit Counter (respectively Limit Counter for WibuKey).

•WupiQIExpTime returns the Expiration Time (respectively Expiration Date for WibuKey) in seconds from 2000-01-01.

•WupiQIActTime returns the Activation Time in seconds from 2000-01-01 (CodeMeter® only).

•WupiQIUsagePeriod returns the number of seconds until the end of the Usage Period; if the Usage Period is expired, the request returns 0 (CodeMeter® only).

•WupiQIFirmCode returns the Firm Code of the used license.

•WupiQIProductCode returns the Product Code (respectively User Code for WibuKey) of the used license.

•WupiQIFeatureMap returns the Feature Map of the used license (CodeMeter® only).

•WupiQIBoxMask returns the Box Mask of the license container that contains the used license.

•WupiQIBoxSerial returns the Serial Number of the license container that contains the used license.

information_weiss_klein26

Please note that in the case of CmActLicenses with a BoxMask greater than 130 the call will return a negative serial number you then must recalculate to obtain an unsigned integer.

•WupiQICopyProtectionSystem returns the type of the license container:

•UpiLicenseNone: License type is set internally.

•UpiLicenseWibuKey: License type is WibuKey.

•UpiLicenseCodeMeter: License type is CodeMeter®.

•UpiLicenseCodeMeterAct: License type is CmActLicense.
This option replaces the obsolete function WupiGetLicenseType. It does not automatically allocate a license.

•WupiQIMaintenancePeriodStart returns the start point of the Maintenance Period in seconds from 2000-01-01 (CodeMeter® only).

•WupiQIMaintenancePeriodEnd returns the end point of the Maintenance Period in seconds from 2000-01-01 (CodeMeter® only).

•WupiQIFeatureCode returns the Feature Code of the used license (CodeMeter® only).

•WupiQIReleaseDate returns the Release Date of the used license (CodeMeter® only).

Return

This function returns UpiErrorInfoNotAvailable (-7) if the desired information is not available.

The return value range of both Feature Map and Unit Counter covers the complete value range of the return value.

That means a return value of -1 or UpiErrorInfoNotAvailable does not necessarily indicate an error. Therefore, for both values that go into the error code value range, you must also check whether an error code has been set (WupiGetLastError).

Syntax

public static int QueryInfo(int LicenseList, QueryInfoOption Ctrl)

Parameters

•LicenseList refers to the license list index.

•QueryInfoOption is filled with the enum:

•UnitCounter returns the current value of the Unit Counter (respectively Limit Counter for WibuKey).

•ExpirationTime returns the Expiration Time (respectively Expiration Date for WibuKey) in seconds from 2000-01-01.

•ActivationTime returns the Activation Time in seconds from 2000-01-01 (CodeMeter® only).

•UsagePeriod returns the number of seconds until the end of the Usage Period; if the Usage Period is expired, the request returns 0 (CodeMeter® only).

•FirmCode returns the Firm Code of the used license.

•ProductCode returns the Product Code (respectively User Code for WibuKey) of the used license.

•FeatureMap returns the Feature Map of the used license (CodeMeter® only).

•BoxMask returns the Box Mask of the license container that contains the used license.

•Serial returns the Serial Number of the license container that contains the used license.

information_weiss_klein26

Please note that in the case of CmActLicenses with a BoxMask greater than 130 the call will return a negative serial number you then must recalculate to obtain an unsigned integer.

•CopyProtectionSystem returns the enum WupiEngine.LicenseType:

•None         = 0x0000,

•WibuKey      = 0x0100,

•CodeMeter    = 0x0200,

•CodeMeterAct = 0x0400

•MaintenancePeriodStart returns the start point of the Maintenance Period in seconds from 2000-01-01 (CodeMeter® only).

•MaintenancePeriodEnd returns the end point of the Maintenance Period in seconds from 2000-01-01 (CodeMeter® only).

•FeatureCode returns the Feature Code of the used license (CodeMeter® only).

•Release Date returns the Release Date of the used license (CodeMeter® only).

Return

This function returns UpiErrorInfoNotAvailable (-7) if the desired information is not available.

The return value range of both Feature Map and Unit Counter covers the complete value range of the return value. That means a return value of -1 or UpiErrorInfoNotAvailable does not necessarily indicate an error. Therefore, for both values that go into the error code value range, you must also check whether an error code has been set (WupiGetLastError).