CmLtCreateReceipt
Description
This function creates and returns a signature of the data of a Firm Item. Here all necessary data is collected and is established in the format of a Receipt File *.WibuCmRaR.
For more details see the respective knowledge base article on license transfer.
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
int CMAPIENTRY CmLtCreateReceipt(
HCMSysEntry hcmse, CMULONG flCtrl, const CMLTREQUEST* pcmltRequest, void* pReceipt, CMUINT cbReceipt);
Parameter
hcmse contains a handle opened by CmAccess / CmAccess2 as a Box Access.
flCtrl currently contains a value of 0.
pcmltRequest receives the data of the structure CMLTREQUEST and at first is set to the value of mulFirmCode allowing to create a receipt for this Firm Code. Generally, this structure and consequently the Firm Code are already known by the call of CmLtCreateContext() (see structure
CMLTREQUEST).
|
CMLTREQUEST contains all needed information for creating the desired license transfer context. Syntax
Parameter mflCtrl currently contains a value of 0. If no license transfer context is required, for example on initial programming using a Firm Security Box (FSB), the following flag must be set:
mulFirmCode contains the Firm Code for creating the license transfer request. mabReserved[248] is reserved for future purposes.
|
pReceipt points to a byte buffer to which the return data of the receipt are copied. Here the created data is one-to-one copied in format Receipt File *.WibuCmRaR to the memory.
cbReceipt holds the size of the allocated memory in pReceipt.
Return
The exact number of bytes copied to pReceipt is returned.
•If the number of bytes is smaller of equal to cbReceipt, no error occurred and the data has been copied to Receipt.
•If the number is larger than cbReceipt, no data has been returned and the error code CMERROR_BUFFER_OVERFLOW (--> CmGetLastErrorCode () or CmGetLastErrorText () / CmGetLastErrorText2 ()) is set, because the buffer size was too small. Then the call can be repeated using a buffer pReceipt having enough memory allocated.
•If a value of 0 is returned, another error has occurred. The exact reason can be detected using CmGetLastErrorCode () or CmGetLastErrorText () / CmGetLastErrorText2 ().
Notes
Available with CodeMeter Version 6.00 and higher.
Syntax
public bool CmLtCreateReceipt(HCMSysEntry hcmse, CmLtFlags Ctrl, CmLtRequest LtRequest, out byte[] Acknowledge) |
Parameter
hcmse contains a handle opened by CmAccess / CmAccess2 (can be Box Access, Entry Access or Firm Item Access). Principally, a Box Access handle is set.
Ctrl of CmLtFlags currently contains a value of 0.
CmLtRequest LtRequest currently contains a value of 0. If no license transfer context is required, for example on initial programming using a Firm Security Box (FSB), the following flag must be set:
Noreceipt specifies that no receipt is created.
Acknowledge contains the returned data of the receipt one-to-one copied in format Receipt File *.WibuCmRaR to the memory.
Return
This function returns true. If an error occurred, false will be returned. The exact reason can be queried using CmGetLastErrorCode2 () or CmGetLastErrorText () / CmGetLastErrorText2 ().
Notes
Available with CodeMeter Version 6.00 and higher.
Syntax
import cmapi
receipt = handleOfReceiver.CmLtCreateReceipt(cmltRequest: cmapi.CMLTREQUEST) -> bytes:
throws CodeMeterApiFailedException()
Parameter
handleOfReceiver is the handle opened by CmAccess2 as a Box Access.
cmltRequest receives the data of the structure CMLTREQUEST and at first is set to the value of mulFirmCode allowing to create a receipt for this Firm Code. Generally, this structure and consequently the Firm Code are already known by the call of CmLtCreateContext() (see
cmapi.CMLTREQUEST).
Class cmapi.CMLTREQUEST CMLTREQUEST contains all needed information for creating the desired license transfer context. Syntax
Parameter mflCtrl currently contains a value of 0. If no license transfer context is required, for example on initial programming using a Firm Security Box (FSB), the following flag must be set:
mulFirmCode contains the Firm Code for creating the license transfer request. mabReserved[248] is reserved for future purposes.
|
receipt will be the byte buffer to which the return data of the receipt are copied. Here the created data is one-to-one copied in format Receipt File *.WibuCmRaR to the memory.
Return
The buffer containing the receipt.
•The function tries to allocate a buffer big enough to contain the data. If it fails, a CodeMeterApiFailedException is thrown. The exact reason can be detected using CmGetLastErrorCode () or CmGetLastErrorText ().
Notes
Available with CodeMeter Version 6.00 and higher.