cookie CmBorrow

Description

CmBorrow() is a high level API call. It offers the possibility to borrow, validate or return a license from or to the borrowing server. This function is remapped on library side (WibuCmXX.dll/lib) to several other API commands.

information_weiss_klein26

Please note that borrowing in this context does not involve a license transfer. Rather it refers to borrowing using Firm Codes smaller than 6,000,000 and especially prepared CmContainer.

 

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

Syntax

int CMAPIENTRY CmBorrow(HCMSysEntry hcmse, CMULONG flCtrl, const char *pszServer);

Parameter

hcmse contains the handle opened by CmAccess / CmAccess2. This has to be the handle to the entry of the borrow client. Remember to use the force flag CM_ACCESS_FORCE in the CMACCESS / CMACCESS2 structure.

flCtrl specifies the kind of borrowing action to be done:

nav_open CM_ACCESS_BORROW_ACCESS specifies that this license should be borrowed from the server.

nav_open CM_ACCESS_BORROW_RELEASE specifies that this borrowed license should be returned to the server.

nav_open CM_ACCESS_BORROW_VALIDATE specifies that this license should be validated.

nav_open CM_ACCESS_BORROW_IGNORESTATE specifies that the state of this license should be ignored.

nav_open CM_ACCESS_IGNORE_LINGERTIME specifies that this license should ignore the linger time.

information_weiss_klein26

The defined actions above occupy the 1st Byte of the flag.

The final 3 Bytes allow client-sided to specify a desired borrowing time in minutes.

Please note first, that the time span can only be reduced but not extended and, second, that this time cannot exceed the defined server-sided maximum borrowing time.

This feature requires at least CodeMeter Version 5.20 at the client and the server.

pszServer contains a pointer to a buffer that contains the borrowing server as a name or as IP-address. This is only used for the flag CM_ACCESS_BORROW_ACCESS, in all other cases the server is read out of the stored borrowing data.

Return

The return value is TRUE, if the specified action was successful, FALSE if not.

Syntax

This method is overloaded, i.e. the same method name is used with different type of parameters or different set of parameters.

Method 1:

public bool CmBorrow(HCMSysEntry hcmse, CmAccess.Option flCtrl, UInt32 BorrowTime, string server)

Parameter

hcmse contains the handle opened by CmAccess / CmAccess2. This has to be the handle to the entry of the borrow client. Remember to use the force flag CM_ACCESS_FORCE in the CMACCESS / CMACCESS2 structure.

Option specifies the kind of borrowing action to be done:

nav_open BorrowAccess specifies that this license should be borrowed from the server.

nav_open BorrowRelease specifies that this borrowed license should be returned to the server.

nav_open BorrowValidate specifies that this license should be validated.

nav_open BorrowIgnorestate specifies that the state of this license should be ignored.

nav_open BorrowIgnoreLingerTime specifies that this license should ignore the linger time.

BorrowTime integer contains a desired borrowing time in minutes.

information_weiss_klein26

The final 3 Bytes allow client-sided to specify a desired borrowing time in minutes.

Please note first, that the time span can only be reduced but not extended and, second, that this time cannot exceed the defined server-sided maximum borrowing time.

This feature requires at least CodeMeter Version 5.20 at the client and the server.

server contains a pointer to a buffer that contains the borrowing server as a name or as IP-address. This is only used for the flag BorrowAccess, in all other cases the server is read out of the stored borrowing data.

Method2:

public bool CmBorrow(HCMSysEntry hcmse, CmAccess.Option flCtrl, TimeSpan BorrowTime, string server)

Parameter

hcmse contains the handle opened by CmAccess / CmAccess2. This has to be the handle to the entry of the borrow client. Remember to use the force flag CM_ACCESS_FORCE in the CMACCESS / CMACCESS2 structure.

Option specifies the kind of borrowing action to be done:

nav_open BorrowAccess specifies that this license should be borrowed from the server.

nav_open BorrowRelease specifies that this borrowed license should be returned to the server.

nav_open BorrowValidate specifies that this license should be validated.

nav_open BorrowIgnorestate specifies that the state of this license should be ignored.

nav_open BorrowIgnoreLingerTime specifies that this license should ignore the linger time.

BorrowTime contains a desired borrowing time in minutes considered in a TimeSpan structure.

information_weiss_klein26

The final 3 Bytes allow client-sided to specify a desired borrowing time in minutes.

Please note first, that the time span can only be reduced but not extended and, second, that this time cannot exceed the defined server-sided maximum borrowing time.

This feature requires at least CodeMeter Version 5.20 at the client and the server.

server contains a pointer to a buffer that contains the borrowing server as a name or as IP-address. This is only used for the flag BorrowAccess, in all other cases the server is read out of the stored borrowing data.

Return

The return value is true, if the specified action was successful, false if not.

 

Not implemented.