cookie CmActLicenseControl

Description

CmActLicenseControl is a helper function that provides all activation essentials and handles CmActLicense files.

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

Syntax

int CMAPIENTRY CmActLicenseControl(HCMSysEntry hcmse, CMULONG flCtrl, const void *pvData, CMUINT cbData, void *pvReturn, CMUINT cbReturn)

Parameter

hcmse contains a handle opened by CmAccess / CmAccess2. The required access mode depends on the operation set in flCtrl.

flCtrl contains one of the following flags to specify the action that is requested:

nav_open CM_GF_ACT_GETFILEINFO gets some information of a remote Context File (*.WibuCmRaC) as a CMBYTE array in pvData. It is also possible to get some information for other CmActLicense files (*.wbb, *.WibuCmRaU). pvReturn is filled with a hmtoggle_plus1 CMACTFILEINFO structure. hcmse can be Subsytem Access or any other access type.

nav_open CM_GF_ACT_GETFILEINFO2 gets some information of a remote Context File (*.WibuCmRaC) as a CMBYTE array in pvData. It is also possible to get some information for other CmActLicense files (*.wbb, *.WibuCmRaU). pvReturn is filled with a hmtoggle_plus1 CMACTFILEINFO2 structure. hcmse can be Subsytem Access or any other access type.

nav_open CM_GF_ACT_GET_INSTALLATION_ID receives the installation id needed for phone activation. pvData holds a hmtoggle_plus1 CMACTACTIVATION structure. pvReturn is filled with a CMACTACTIVATION structure. pvData and pvReturn may point to the same instance. hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open CM_GF_ACT_LICENSE_BY_CODE enables a CmActLicense (activation by phone). pvData holds an array of at maximum CMACT_MAX_LEN_ACTIVATION_CODE chars. pvReturn is not filled. hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open CM_GF_ACT_REGISTER registers a CmActLicense license file (*.wbb) or a CmActLicense Update File (*.WibuCmRaU) given as a CMBYTE array in pvData at the CodeMeter License Server. pvReturn is not filled. hcmse can be Subsytem Access or any other access type.

nav_open CM_GF_ACT_REMOVE removes the CmActLicense.

information_weiss_klein26

For CmActLicense Firm Codes the following applies:

pvData holds an CMUINT that is true (1), if the license should be removed permanently. Then the license file is deleted from the disk. Or pvData holds an CMUINT that is false (0), if the license should only be removed (unloaded) until the next start of CodeMeter License Server.

For Universal Firm Codes this distinction does not exist - the license is always permanently removed.

Starting with CodeMeter Version 6.60 the error message "CMERROR_INVALID_PARAMETER" displays, if false (0) is specified. Then the license is neither removed nor unloaded.

pvReturn is not filled. hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open CM_GF_ACT_REQUEST creates a remote Context File (*.WibuCmRaC) to request the activation of a CmActLicense. pvData holds a hmtoggle_plus1 CMACTREQUEST structure. pvReturn is filled with a CMBYTE array containing the remote Context File (.WibuCmRaC). hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open CM_GF_ACT_SPLIT_ACTIVATION_CODE gets the serial number information out of the Activation Code of a telephone activation. pvData holds the Activation Code a null-terminated ascii-string. pvReturn is filled with a CMACTACTIVATION structure, where either musBoxMask and mulSerialNumber (first activation) or mulGeneration (reactivation) are filled. hcmse can be Subsytem Access or any other access type.

pvData contains a pointer to an input buffer. The type of buffer depends on the flag set in flCtrl.

cbData contains the length of the input buffer pvData in number of bytes.

pvReturn contains a pointer to an output buffer. The type of buffer depends on the flag set in flCtrl.

cbReturn contains the length of the output buffer pvReturn in number of bytes.  

Return

This function returns the number of bytes filled in pvReturn. If the command specified in flCtrl does not fill pvReturn by design, the function returns 1. If an error occurred, 0 will be returned.

Exception:

If pvReturn does not contain enough memory, the number of required bytes will be returned in cbReturn and error code CMERROR_BUFFER_OVERFLOW is set.

Notes

This function is available since CodeMeter Version 4.0.

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

•CM_GF_ACT_GETFILEINFO2

•CM_GF_ACT_SPLIT_ACTIVATION_CODE

Syntax

This method is overloaded, i.e. the same method name is used with different type of parameters or different set of parameters.

Method 1:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, object Data, out byte[] Return)

This method overload returns a byte array.

Method 2:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, byte[] Data)

This method overload imports data.

Method 3:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, object Data)

This method overload allows the input.

Method 4:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, byte[] Data, out CmActFileInfo FileInfo)

This method overload imports data and returns FileInfo.

Method 5:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, byte[] Data, out CmActDigest Digest)

This method overload includes data and returns a digest.

Method 6:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, CmActActivation Data, out CmActActivation Return)

This method overload imports activation data and returns activation data.

Method 7:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, byte[] Data, out CmActFileInfo2 FileInfo2)

This method overload imports data and returns data in a FileInfo2 class structure.

Method 8:

public bool CmActLicenseControl(HCMSysEntry hcmse, CmActLicenseControlOption Ctrl, byte[] Data, out CmActSymKey SymKey)

This method overload imports data and return a simulated key.

Parameter

CmActLicenseControlOption contains one of the following commands:

nav_open CreateLicenseInformation tba.

nav_open SetupLicense tba.

nav_open SetupLicenseStep1 tba.

nav_open SetupLicenseStep2 tba.

nav_open Register registers a CmActLicense license file (*.wbb) or a CmActLicense Update File (*.WibuCmRaU) given as byte[] in Data at the CodeMeter License Server. hcmse can be Subsytem Access or any other access type.

nav_open UpdateLicenseData tba.

nav_open ActivationCode tba.

nav_open LicenseByCode enables a CmActLicense (activation by phone). tba. hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open Request creates a remote Context File (*.WibuCmRaC) to request the activation of a CmActLicense. pvData holds a hmtoggle_plus1 CmActRequest structure. pvReturn is filled with a CMBYTE array containing the remote Context File (*.WibuCmRaC). hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open CreateActivationStep1 tba.

nav_open CreateActivationStep2 tba.

nav_open CreateActivationStep3 tba.

nav_open Remove removes the CmActLicense.

information_weiss_klein26

For CmActLicense Firm Codes the following applies:

Data holds an uint that is true (1), if the license should be removed permanently. Then the license file is deleted from the disk. Or Data holds an uint that is false (0), if the license should only be removed (unloaded) until the next start of CodeMeter License Server.

For Universal Firm Codes this distinction does not exist - the license is always permanently removed.

Starting with CodeMeter Version 6.60 the error message "CMERROR_INVALID_PARAMETER" displays, if false (0) is specified. Then the license is neither removed nor unloaded.

hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open GetFileInfo gets some information of a remote Context File (*.WibuCmRaC) as a byte[] in Data. It is also possible to get some information for other CmActLicense files (*.wbb, *.WibuCmRaU). FileInfo is filled as hmtoggle_plus1 CmActFileInfo class. hcmse can be Subsytem Access or any other access type.

nav_open GetInstallationId receives the installation id needed for phone activation. Data holds a hmtoggle_plus1 CmActActivation class. Return is filled with a CmActActivation class. hcmse must be Box Access, Firm Item Access or Entry Access.

nav_open SplitInstallationId tba.

nav_open GetTemplateKey tba.

nav_open SplitActivationCode gets the serial number information out of the Activation Code of a telephone activation. Data holds the Activation Code a null-terminated ascii-string. Return is filled with a CmActActivation structure, where either BoxMask and SerialNumber (first activation) or Generation (reactivation) are filled. hcmse can be Subsytem Access or any other access type.

nav_open GetFileInfo2 gets some information of a remote Context File (*.WibuCmRaC) as a CMBYTE array in pvData. It is also possible to get some information for other CmActLicense files (*.wbb, *.WibuCmRaU). pvReturn is filled with a hmtoggle_plus1 CmActFileInfo2 class. hcmse can be Subsytem Access or any other access type.

Return

tba.

Notes

This function is available since CodeMeter Version 4.0.

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

•CmActGetFileInfo2

•CmActSplitActivationCode

 

Not implemented.