CmAccess
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.
|
Please select a tab for your desired programming language. This selection will remain valid throughout the session unless you switch to another programming language tab. |
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
HCMSysEntry CMAPIENTRY CmAccess(CMULONG flCtrl, CMACCESS *pcmAcc)
Parameter
flCtrl specifies one of the following commands to set the desired subsystems. Please note that 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
CMACCESS).
|
CMACCESS 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.
Parameter mflCtrl:contains the process ID that is set by the CodeMeter library (read only).
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 CmAccess() 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 CmAccess() 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 CM_SET_VERSION. midProcess is used for internal purposes and will be set by the calling driver automatically. musProductItemReference Product Item Reference of the Product Item to access. musSession is used for internal purposes and will be set by the calling runtime automatically. mabIPv4Address[4] contains an IPv4 address for an explicit access to a target machine that runs a CodeMeter Server. mcmBoxInfo contains the CmContainer information (see structure
|
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
Syntax
public HCMSysEntry CmAccess(CmAccessOption Ctrl, CmAccess Acc);
public enum CmAccessOption : int // UInt32 { Local = 0x0000, Lan = 0x0001, LocalLan = 0x0002, LanLocal = 0x0003, LanWan = 0x0011, LocalLanWan = 0x0012, LanWanLocal = 0x0013, CmdMask = 0x0013 } |
Parameter
CmAccessOption Ctrl specifies one of the following commands to set the desired subsystems. Only one of these constants can be set.
Local only searches in CmLocal for a CmContainer with a matching entry.
Lan only searches in CmLAN for a CmContainer with a matching entry.
LocalLan searches CmLocal first for a CmContainer with a matching entry and after that in CmLAN, if no CmContainer was found locally.
LanLocal searches CmLAN first for a CmContainer with a matching entry and after that in CmLocal, if no CmContainer was found in the network.
LanWan searches in CmLAN and CmWAN for a CmContainer with a matching entry.
LocalLanWan searches CmLocal first after that in CmLAN and CmWAN for a CmContainer with a matching entry.
LanWanLocal searches first in CmLAN and CmWAN and after that in CmLocal for a CmContainer with a matching entry.
Acc sets the needed data for the desired access (see public class
CmAccess).
Parameter CmAccess.Option:
These flags can be or'ed with the following flags:
FirmCode 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 CmAccess() function. ProductCode 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 CmAccess() function. FeatureCode 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. UsedRuntimeVersion contains the minimum runtime version of CodeMeter. ProcessId is used for internal purposes and will be automatically set by the calling runtime. ProductItemReference Product Item Reference of the Product Item to access. Session is used for internal purposes and will be automatically set by the calling runtime. IPv4Address contains an IPv4 address for an explicit access to a target machine that runs a CodeMeter Server. BoxInfo contains the CmContainer information (see public class
|
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:
•LanWan
•LocalLanWan
•LanWanLocal
Not implemented.