cookie CmCreateProductItemOption

Description

CmCreateProductItemOption() concatenates a security sequence for adding or updating a Product Item Option. This function must be called once or more before a CmCreateSequence() call to add or update one or more Product Item Options.

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

Syntax

int CMAPIENTRY CmCreateProductItemOption(HCMSysEntry hcmse, CMULONG flCtrl, void *pvPio, CMUINT cbPio)

Parameter

hcmse contains a handle opened by CmAccess / CmAccess2. The access mode must be Entry Access to a FSB Entry. The handle is related to a CmLocal or a CmLAN subsystem with a connected CmDongle.

flCtrl contains one of the following commands:

nav_open CM_CPIO_PRODUCTCODE adds a Product Code to the internally created structure to create a Product Item. pvPio is pointing to a hmtoggle_plus1 CMCPIO_PRODUCTCODE structure.

nav_open CM_CPIO_FEATUREMAP adds a Feature Map to the internally created structure to create a Product Item. pvPio is pointing to a CMULONG value describing this Product Item Option.

nav_open CM_CPIO_MAINTENANCEPERIOD adds a Feature Map to the internally created structure to create a Product Item. pvPio is pointing to a (see structure hmtoggle_plus1 CMCPIO_MAINTENANCEPERIOD).

nav_open CM_CPIO_EXPTIME adds an Expiration Time to the internally created structure to create a Product Item. pvPio is pointing to a CMTIME structure describing this Product Item Option.

nav_open CM_CPIO_USAGEPERIOD adds a Usage Period to the internally created structure to create a Product Item. pvPio is pointing to a CMUINT value describing the value (in seconds) of the usage period once the Usage Period was activated by CmCrypt(). Knowledge Base article

nav_open CM_CPIO_ACTTIME adds an Activation Time to the internally created structure to create a Product Item. pvPio is pointing to a CMTIME structure describing this Product Item Option.

nav_open CM_CPIO_UNITCOUNTER adds a Unit Counter to the internally created structure to create a Product Item. pvPio is pointing to a CMULONG value describing this Product Item Option.

nav_open CM_CPIO_PROTDATA adds a Protected Data to the internally created structure to create a Product Item. pvPio is pointing to a hmtoggle_plus1 CMCPIO_PROTDATA structure describing this Product Item Option.

nav_open CM_CPIO_EXTPROTDATA adds an Extended Protected Data to the internally created structure to create a Product Item. pvPio is pointing to a hmtoggle_plus1 CMCPIO_EXTPROTDATA structure value describing this Product Item Option.

nav_open CM_CPIO_HIDDENDATA adds a Hidden Data to the internally created structure to create a Product Item. pvPio is pointing to a hmtoggle_plus1 CMCPIO_HIDDENDATA structure describing this Product Item Option.

nav_open CM_CPIO_SECRETDATA adds a Secret Data to the internally created structure to create a Product Item. pvPio is pointing to a hmtoggle_plus1 CMCPIO_SECRETDATA structure describing this Product Item Option.

nav_open CM_CPIO_USERDATA adds User Data to the internally created structure to create a Product Item. pvPio is pointing to a hmtoggle_plus1 CMCPIO_USERDATA structure describing this Product Item Option.

nav_open CM_CPIO_TEXT adds Text to the internally created structure to create a Product Item. pvPio is pointing to a (see structure hmtoggle_plus1 CMCPIO_TEXT).

nav_open CM_CPIO_DELETEALL deletes all Product Item Options of the currently accessed Product Item. The Product Code is the only option available after this task. In this case pvPio can be NULL and cbPio can be 0.

nav_open CM_CPIO_CHANGEDEPENDENCY changes the dependency flags of the Product Item Options created after this command. pvPio is pointing to a CMULONG value value describing this Product Item Option. The CMULONG value contains an or'ed combination of the flags CM_PIOPC_DATA (data dependency), CM_PIOPC_FUC (Firm Update Counter dependency) and CM_PIOPC_SERIAL (Serial Number dependency).

The following flags must be or'ed with the flags above in special situations.

nav_open CM_CPIO_ADD: The first call of CmCreateProductItemOption to concatenate a programming sequence must have this flag set, if the programming sequence is intended to add a Product Item. This flag sets the add mode for creating the PIO. This flag can also be set to switch from update mode to add mode. The first call must always be the addition of a Product Code (CM_CPIO_PRODUCTCODE).

nav_open CM_CPIO_UPDATE: The first call of CmCreateProductItemOption to concatenate a programming sequence must have this flag set, if the programming sequence is intended to update a Product Item. This flag sets the update mode for creating the PIO. This flag can also be set to switch from add mode to update mode. The first call must always be the addition of a Product Code (CM_CPIO_PRODUCTCODE).

nav_open CM_CPIO_RELATIVE: This option specifies that the updated value should be modified relatively. It can only be combined with CM_CPIO_ACTTIME, CM_CPIO_EXPTIME or CM_CPIO_UNITCOUNTER. In these cases the set value is always an unsigned long value, specifying therelative value. The value can also be negative.

nav_open CM_CPIO_TERMINATE: The last call of CmCreateProductItemOption to concatenate a programming sequence must have this flag set to terminate the internal process.

nav_open CM_CPIO_DELETE_PIO: This flag can be combined with all CM_CPIO_...… commands and implies that the set Product Item Option will be deleted. In this case pvPio can be NULL and cbPio can be 0.

pvPio contains a structure depending on the flCtrl flag (see above).

cbPio contains the length of the structure stored in pvPio.

Return

TRUE, if the entry was added to the security sequence - FALSE, if not.

Notes

This function is only for Licensor side because a FSB is needed.

The following flags (and the corresponding functionality) are only available since CodeMeter Version 4.30:

•CM_CPIO_MAINTENANCEPERIOD

Syntax

public bool CmCreateProductItemOption(HCMSysEntry hcmse, CmCreateProductItemOptionOption Ctrl , object Pio)

 

Parameter

hcmse contains a handle opened by CmAccess / CmAccess2. Access Mode must be Entry Access to the FSB entry of the desired Firm Code. If the Firm Code is an evaluation Firm Code the access can be SubSystem Access. A matching entry in the CmLicensor/CmFirm.wbc file has to exist in both cases.

Ctrl covers the following fields:

nav_open ProductCode adds a Product Code to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioProductCode class.

nav_open FeatureMap adds a Feature Map to the internally created structure to create a Product Item. Pio is a uint value describing this Product Item Option.

nav_open ExpirationTime adds an Expiration Time to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmTime class describing this Product Item Option.

nav_open ActivationTime adds an Activation Time to the internally created structure to create a Product Item. Pio is a CmTime class describing this Product Item Option.

nav_open UnitCounter adds a Unit Counter to the internally created structure to create a Product Item.Pio is a uint value describing this Product Item Option.

nav_open ProtectedData adds a Protected Data to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioProtectedData class describing this Product Item Option.

nav_open ExtendedProtectedData adds an Extended Protected Data to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioExtendedProtectedData class value describing this Product Item Option.

nav_open HiddenData adds a Hidden Data to the internally created structure to create a Product Item.Pio is a hmtoggle_plus1 CmCreatePioHiddenData structure describing this Product Item Option.

nav_open SecretData adds a Secret Data to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioSecretData class describing this Product Item Option.

nav_open UserData adds User Data to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioUserData class describing this Product Item Option.

nav_open Text adds Text to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioText class describing this Product Item Option.

nav_open DeleteAll deletes all Product Item Options of the currently accessed Product Item. The Product Code is the only option available after this task. In this case, Pio can be null.

nav_open ChangeDependency changes the Dependency contains the dependency of the dynamic added entry from the enum GlobalProductCodeOption. It can be have one or more of the following flags:

nav_open Data specifies that the parameter depends on the contents of the data of the Firm Item.

nav_openFuc specifies that the parameter depends on the Firm Update Counter of the Firm Item.

nav_openSerial specifies that the parameter depends on the Serial Number of the CmContainer.

nav_openUsagePeriod adds a Usage Period to the internally created structure to create a Product Item. Pio is a uint describing the value (in seconds) of the usage period once the Usage Period was activated by CmCrypt(). Knowledge Base article

nav_open MaintenancePeriod adds a Feature Map to the internally created structure to create a Product Item. Pio is a hmtoggle_plus1 CmCreatePioMaintenancePeriod class describing this Product Item Option. The Firmware version has to be at minimum 1.18.

nav_open CmdMask specifies mask bit values for creating Product Item Options.

nav_open Add The first call of CmCreateProductItemOption to concatenate a programming sequence must have this flag set, if the programming sequence is intended to add a Product Item. This flag sets the add mode for creating the PIO. This flag can also be set to switch from update mode to add mode. The first call must always be the addition of a Product Code (ProductCode).

nav_open Update The first call of CmCreateProductItemOption to concatenate a programming sequence must have this flag set, if the programming sequence is intended to update a Product Item. This flag sets the update mode for creating the PIO. This flag can also be set to switch from add mode to update mode. The first call must always be the addition of a Product Code (ProductCode).

nav_open DeletePio This flag can be combined with all CmCreateProductItemOption... commands and implies that the set Product Item Option will be deleted. In this case Pio can be null.

nav_open Relative This option specifies that the updated value should be modified relatively. It can only be combined with ActivationTime, ExpirationTime or UnitCounter. In these cases the set value is always an unsigned long value, specifying the relative value. The value can also be negative.

nav_open Terminate The last call of CmCreateProductItemOption to concatenate a programming sequence must have this flag set to terminate the internal process.

pio contains a class depending on the Ctrl flag (see above).

Return

true, if the entry was added to the security sequence - false, if not.

 

Notes

This function is only for Licensor side because a FSB is needed.

The following flag (and the corresponding functionality) is only available since CodeMeter Version 4.30:

•MaintenancePeriod

 

Not implemented.