CmGetBoxes
Description
CmGetBoxes returns all connected CmContainers of the given licensing system.
Syntax
int CMAPIENTRY CmGetBoxes(HCMSysEntry hcmse, CMULONG idPort, CMBOXINFO *pcmBoxInfo, CMUINT cbBoxInfo)
Parameter
hcmse contains the handle opened by CmAccess2 (must be Subsystem Access).
idPort contains one of the following commands:
CM_GB_ALLPORTS: All CmContainers will be scanned.
CM_GB_DONGLE: All CmDongles (CodeMeter hardware) will be scanned. Old naming: CM_GB_USB.
CM_GB_ACT: All CmActLicenses will be scanned.
pcmBoxInfo contains an array of
CMBOXINFO structure.
|
CMBOXINFO contains information on a CmContainer. Syntax
Parameter mbMajorVersion contains the major version of the CmContainer. mbMinorVersion contains the minor version of the CmContainer. musBoxMask contains the box mask of the CmContainer. mulSerialNumber contains the serial number of the CmContainer. musBoxKeyId contains the ID of the used BoxKey of the CmContainer. musUserKeyId contains the ID of the used UserKey of the CmContainer. mabBoxPublicKey[CM_PUBLIC_KEY_LEN] contains the public Box Key of the CmContainer. mabSerialPublicKey[CM_PUBLIC_KEY_LEN] contains the public Serial Key of the CmContainer. mulReserve is reserved for future purposes. Notes The length of the mabBoxPublicKey and mabSerialPublicKey is 64 byte long. The used public key are currently 224 bits = 28 bytes long. In Elliptic Curve Cryptography the public key is a 2 dimensional point, so the x-value is stored in the first 28 bytes (0..27) and the y-value is store in byte 32..59.
|
cbBoxInfos contains the number of CMBOXINFO elements stored in pcmBoxInfo.
Return
The number of found CmContainers is returned. If the number is larger than cbBoxInfo, the array in pcmBoxInfo was too small. In this case, only cbBoxInfo elements were stored in pcmBoxInfo. To get the remaining call the function with the correct array length again. If the array is too small, error code CMERROR_BUFFER_OVERFLOW is set. If 0 is returned,then no entry was found and error code CMERROR_BOX_NOT_FOUND is set.
Notes
This function does not really scan all available or desired ports for connected CmDongles because of CodeMeter License Servers Plug&Play mechanism and the implementation of storing all CmContainers and their content in internal lists. The function call checks the internal lists only and returns the matching data.