CmAccess2
Description
CmAccess() opens the access to a:
•computer (SubSystem Access)
•CmContainer (Box Access)
•single Firm Item (FC, Firm Item Access) or a
•CmContainer entry (FC:PC, Entry Access) in a given subsystem.
Please note the detailed description of the Access Modes.
|
Please note that CmAccess2() provides enhanced functionality to access a CmContainer. This function is implemented since CodeMeter Version 3.30. |
A SubSystem Access represents a superset of Box Access. A Box Access is a superset of Firm Item Access. A Firm Item Access is a superset of an Entry Access. Anything that can be done with a SubSystem Access can also be done with Box Access, but not vice versa!
|
Please note that on a Box Access the mask m and serial number s may change anytime depending on CodeMeter chip versions. Please consider these possible changes for future CmContainer generations on programming accesses for CmContainer. |
The subsystem is the local computer (CmLocal) or a local or wide area network system (CmLAN, CmWAN). For CmWAN please consult the CodeMeter Developer Guide. This implies that a CodeMeter License Server process must be started with a CmContainer connected on an other system in the network.
The communication between protected applications and CodeMeter License Server bases on the Transmission Control Protocol/Internet Protocol (TCP/IP). This is valid not only for locally existing licenses, but also for licenses which are provided via a network.
By default, CodeMeter uses the port 22350 registered by Wibu-Systems at IANA (Internet Assigned Numbers Authority) and uniquely assigned for the CodeMeter communication. The list of assigned ports can be viewed at www.iana.org/assignments/port-numbers.
In order to make available a client access to a CodeMeter License Server on the network, a communication using the CodeMeter port must be supported. If the server should locate in another network area, eventually the port must be made known and accessible as part of the infrastructure (router, firewall, etc.).
For the direct access to CodeMeter License Server on the network, the communication bases on TCP. For an automatic search of servers on the network, additionally a broadcast via UDP (User Datagram Protocol) is performed.
|
The access using the CodeMeter port is performed only for the access to CodeMeter License Servers and this only within the organization which runs the network server. In particular, using this port no communication into the internet is performed. |
In CodeMeter settings of CodeMeter WebAdmin an option exist to configure the CodeMeter port to a value other than the default of 22350. However, such a change should have plausible reasons, e.g. in the case of parallel test environments on the same network. In addition, such a change requires the same configuration of all affected CodeMeter License Servers.
The desired subsystem and the search order can be set in the special flags.
If a network access to another computer is performed, it will be available until the access is closed with CmRelease(). If more than one connection between two instances should be required, CmAccess() will open only one connection which is the medium for all communication between the two clients.
Note
CmAccess2() provides enhanced functionality to access a CmContainer by using the
CMCREDENTIAL feature.
It is available since CodeMeter Version 3.30 and offers a user-defined timing to release licenses that were allocated locally or in the network.
This release interval overwrites the default timing value CleanUpTimeOut of the CodeMeter profiling. The benefit is that the user cannot influence this timing anymore.
Additionally, the validity period of the handle returned by CmAccess2() can be determined. This feature can be used to limit the usage period of an application that allocates a license using CmAccess2().
The mapping of the licenses on a CodeMeter server can be simplified by giving an user-defined string or number (session-ID) that is displayed on the server once the license was allocated.
Syntax
HCMSysEntry CMAPIENTRY CmAccess2(CMULONG flCtrl, CMACCESS *pcmAcc)
Parameter
|
Please note, that if your module configuration includes Module Runtime Bridge but without Module LAN, then the flag CM_ACCESS_LAN cannot be used and the error code CM_ERROR_FUNCTION_NOT_SUPPORTED is set. The flag CM_ACCESS_LOCAL_LAN tries to access first the local subsystem and subsequently cannot find the LAN subsystem. Here the error code CM_ERROR_FUNCTION_NOT_SUPPORTED is set. |
flCtrl specifies one of the following commands to set the desired subsystems. Only one of these constants can be set:
CM_ACCESS_LOCAL only searches in CmLocal for a CmContainer with a matching entry.
CM_ACCESS_LAN only searches in CmLAN for a CmContainer with a matching entry.
CM_ACCESS_LOCAL_LAN searches CmLocal first for a CmContainer with a matching entry and after that in CmLAN, if no CmContainer was found locally.
CM_ACCESS_LAN_LOCAL searches CmLAN first for a CmContainer with a matching entry and after that in CmLocal, if no CmContainer was found in the network.
CM_ACCESS_LANWAN searches in CmLAN and CmWAN for a CmContainer with a matching entry.
CM_ACCESS_LOCAL_LANWAN searches CmLocal first after that in CmLAN and CmWAN for a CmContainer with a matching entry.
CM_ACCESS_LANWAN_LOCAL searches first in CmLAN and CmWAN and after that in CmLocal for a CmContainer with a matching entry.
pcmAcc sets the needed data for the desired access (see structure
CMACCESS2).
|
CMACCESS2 specifies additional data for the Access Modes to a computer (Subsystem Access), to a CmContainer (Box Access), to a single Firm Item (FC, Firm Item Access) or a CmContainer entry (FC:PC, Entry Access) in a given subsystem. Syntax
Parameter mflCtrl:specifies the kind of the subsystem access by setting one of the following flags.
These flags can be or'ed with the following flags:
mulFirmCode contains the Firm Code of the access mode. Which Firm Code must be set for the different access modes you can see at the description of the CmAccess2 () function mulProductCode contains the Product Code of the access mode. Which Product Code must be set for the different access modes you can see at the description of the CmAccess2 () function mulFeatureCode contains the Feature Code, which must map a given Feature Map. If the Feature Code is 0, there is no search for a matching Feature Map. mulUsedRuntimeVersion contains the minimum runtime version of CodeMeter. To calculate the version you may want to use the macro (see
mulReserved1 is reserved for future purposes. musProductItemReference Product Item Reference of the Product Item to access. mbMinBoxMajorVersion contains the minimum major Firmware version of the CmContainer to access. mbMinBoxMinorVersion contains the minimum minor Firmware version of the CmContainer to access. musBoxMask contains the box mask of the CmContainer to access. mulSerialNumber contains the serial number of the CmContainer to access. mulLicenseQuantity contains the requested number of licenses to be allocated using a single handle.
mszServername contains the name or IP-address of the CodeMeter server to access. The type is detected automatically. mcmReleaseDate contains a structure where the Release Date can be set that is checked against the Maintenance Period of the license (see
mabCmActId allows to specify a CmAct-ID using the following ranges: 1**** for CmDongle, 2****for CmActLicense, 3**** for CmCloud (not yet implemented).
mabReserved is reserved for future purposes. mcmBorrowData contains a
mcmCredential contains a
|
Return
The handle to the desired CmContainer entry or CmContainer in the desired subsystem is returned. If no matching CmContainer entry or CmContainer is found, NULL is returned.
Notes
Access to Firm Item 0 can only be performed locally. If tried using CmLAN, CmAccess2 will trigger Error 200 (Entry not found).
CmAccess2() is supported since CodeMeter Version 3.30.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 5.0:
•CM_ACCESS_LANWAN
•CM_ACCESS_LOCAL_LANWAN
•CM_ACCESS_LANWAN_LOCAL