CmGetRemoteContextBuffer
Description
This function operates like CmGetRemoteContext() but uses a pre-allocated memory buffer instead of a file pointer.
|
This function is not supported for Firm Codes larger than 6,000,000. |
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
int CMAPIENTRY CmGetRemoteContextBuffer(HCMSysEntry hcmBox, CMUINT flCtrl, CMUINT *pulFirmCodes, CMUINT cbFirmCodes, void* pvMemBuffer, CMUINT cbMemBuffer, CMUINT* pcbWritten);
Parameter
hcmBox contains a handle opened by CmAccess / CmAccess2.
flCtrl reserved for future purposes.
pulFirmCodes points to a set of Firm Codes to reserve.
cbFirmCodes holds the number of Firm Codes in pulFirmCodes.
pvMemBuffer pointer to memory to hold the data.
cbMemBuffer holds the size of pvMemBuffer.
pcbWritten receives the number of bytes written to pvMemBuffer. If the number of bytes given in cbMemBuffer is too small to receive the complete context, the number of necessary bytes is written to pcbWritten.
Return
Returns the number of Firm Items stored in the Context File *.WibuCmRaC memory buffer. If pvDest does not contain enough memory, the number of needed bytes will be written to pcbWritten. In this case the return value is 0 and error code CMERROR_BUFFER_OVERFLOW is set.
Notes
If a Firm Item with the specified Firm Code does not exist in the CmDongle, CmReserveFirmItem() will be called implicitly. The result will then be stored in the Context File *.WibuCmRaC memory buffer.
Syntax
bool CmGetRemoteContextBuffer(HCMSysEntry hcmBox, CmGetContextFileOption Ctrl, uint[] FirmCodes, out string Buffer)
|
Parameter
hcmBox contains a handle opened by CmAccess / CmAccess2.
CmGetContextFileOption contains one of the following flags:
Overwrite overwrites the Context File *.WibuCmRaC / Modified Context File *.WibuCmRaM, if it already exists.
Append appends the context data to the Context File *.WibuCmRaC / Modified Context File *.WibuCmRaM, if it already exists.
FirmCodes contains a set of Firm Codes to reserve.
Buffer receives the data.
Return
Returns true, if the operation has been successful, otherwise false.
Notes
If a Firm Item with the specified Firm Code does not exist in the CmDongle, CmReserveFirmItem() will be called implicitly. The result will then be stored in the Context File *.WibuCmRaC memory buffer.
Syntax
import cmapi
handle.CmGetRemoteContextBuffer(pulFirmCodes: List[int]) -> bytes
throws CodeMeterApiFailedException()
Parameter
handle is the handle opened by CmAccess2.
pulFirmCodes is a set of Firm Codes to reserve.
Return
Returns the buffer holding the data. If an error occurs, an exception is thrown.
Notes
If a Firm Item with the specified Firm Code does not exist in the CmDongle, CmReserveFirmItem() will be called implicitly. The result will then be stored in the Context File *.WibuCmRaC memory buffer.