CmExecuteRemoteUpdate
Description
CmExecuteRemoteUpdate executes the given updates and applies them as specified. This function allows the same handling for CmDongles and CmActLicenses regarding the update process. It allows also to apply several updates in one step but getting feedback for each update.
With CmExecuteRemoteUpdate you can execute the contents of Update Files (*.WibuCmRaU) and of license information files (*.wbb). If you have files you need to read, the files by yourself and store the contents in the memory buffer.
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
int CMAPIENTRY CmExecuteRemoteUpdate(HCMSysEntry hcmse, CMULONG flCtrl, void* pMemBuffer, CMUINT cbMemBuffer, CMFAS *pCmFasSelect, CMUINT cbCmFasSelect, CMFAS *pCmFasResult, CMUINT cbCmFasResult, CMUINT *pcbCmFasResultCount)
Parameter
hcmse contains the handle opened by CmAccess / CmAccess2 (must be Subsystem Access).
flCtrl contains one of the following commands:
CMFAS_CTL_CMD_LIST lists all updates and simulates the execution without any change on the licenses. The input structure pCmFasSelect has to be null. This flag cannot be combined with any other flag. The simulated result can be found in pCmFasResult.mulResult.
CMFAS_CTL_CMD_UPDATE all updates are executed. Any set restriction in pCmFasSelect is respected.
CMFAS_CTL_CMD_UPDATE_EXISTING only updates for existing CmContainer are executed. Any set restriction in pCmFasSelect is respected. If the additional option CMFAS_CTL_OPT_ABORT_ON_ERROR is set, the command only aborts, if an update of an existing CmContainer fails.
CMFAS_CTL_CMD_GET_COUNT returns the count of needed structures of structure
CMFAS for pCmFasResult. All other parameters can be null resp. 0.
|
CMFAS specifies additional data for CmExecuteRemoteUpdate or retrieves detailed results of this command. Syntax
Parameter mflSelect specifies the restrictions of updates by setting one of the following flags:
mulItemType retrieves the type of update as a result of the update execution:
mulSerial contains the serial number of the update either as restriction (input) or as result (list or update). musMask contains the serial mask of the update either as restriction (input) or as result (list or update). musReserved1 is reserved for future purposes. mulFirmCode contains the Firm Code of the update either as restriction (input) or as result (list or update). maulReserved3[20] is reserved for future purposes. mulResult contains the error codes of the single updates. If the error code CMERROR_UPDATE_FAILED is set, more than one update was specified and at least one failed; detailed information can be found here. maulReserved4[10] is reserved for future purposes.
|
To retrieve all the command options you can use CMFAS_CTL_CMD_MASK.
These flags can be or'ed with one of the following flags:
•CMFAS_CTL_OPT_ABORT_ON_ERROR: If more than one update is specified, the command aborts at the first error.
To retrieve all the command options you can use CMFAS_CTL_OPT_MASK specifies all flags of the optional command options.
pMemBuffer contains the data of the update.
cbMemBuffer contains the length of pMemBuffer.
pCmFasSelect contains an array of structures with input data, e.g. the definition which updates should be applied.
cbCmFasSelect contains the count of CMFAS structures contained in pCmFasSelect.
pCmFasResult contains an array of CMFAS structures with output data, e.g. which updates were successful.
cbCmFasResult contains the count of CMFAS structures contained in pCmFasResult.
pcbCmFasResultCount retrieves the count of filled CMFAS structures in pCmFasResult.
Return
Returns TRUE, if all specified updates were successful, FALSE otherwise.
If the error code CMERROR_BUFFER_OVERFLOW is set, the count of CMFAS structures in pCmFasResult was too small; the needed count can be found in pcbCmFasResultCount.
If the option CMFAS_CTL_OPT_ABORT_ON_ERROR was set and the command aborted due to an error, the error code is set to the specific error code of the update that has failed.
If the error code CMERROR_UPDATE_FAILED is set, more than one update was specified and at least one failed; detailed information can be found in pCmFasResult.
Notes
Detailed information about the results of the update execution can be found in pCmFasResult.
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 CmExecuteRemoteUpdate(HCMSysEntry hcmSubSystem, CmExecuteRemoteUpdateOption Ctrl, string Buffer, CmFas[] CmFasSelect, out CmFas[] CmFasResult)
|
This method overload returns true or false.
Method 2:
public bool CmExecuteRemoteUpdate(HCMSysEntry hcmSubSystem, CmExecuteRemoteUpdateOption Ctrl, byte[] Buffer, CmFas[] CmFasSelect, out CmFas[] CmFasResult)
|
This method overload returns true or false.
Parameter
hcmse contains the handle opened by CmAccess / CmAccess2 (must be Subsystem Access).
CmExecuteRemoteUpdateOption contains one of the following commands:
CmdList: lists all updates and simulates the execution without any change on the licenses. The input structure CmFasSelect has to be null. This flag cannot be combined with any other flag. The simulated result can be found in CmFasResult.Result.
CmdUpdate: all updates are executed. Any set restriction in CmFasSelect is respected.
CmdUpdateExisting: only updates for existing CmContainer are executed. Any set restriction in CmFasSelect is respected. If the additional option OptAbortOnError is set, the command only aborts, if an update of an existing CmContainer fails.
CmdGetCount: returns the count of needed structures of class
CmFas for CmFasResult. All other parameters can be null resp. 0.
|
CmFas specifies additional data for CmExecuteRemoteUpdate or retrieves detailed results of this command. Syntax
Parameter OptionSelect specifies the restrictions of updates by setting one of the following flags:
To retrieve the select options you can use SelectMask.
To retrieve the additional options you can use OptMask. OptionItemType retrieves the type of update as a result of the update execution:
Serial contains the serial number of the update either as restriction (input) or as result (list or update). Mask contains the serial mask of the update either as restriction (input) or as result (list or update). FirmCode contains the Firm Code of the update either as restriction (input) or as result (list or update). Result contains the error codes of the single updates. If the error code UpdateFailed is set, more than one update was specified and at least one failed; detailed information can be found here.
|
These flags can be or'ed with one of the following flags of the enum CmExecuteRemoteUpdateOption:
OptAbortOnError If more than one update is specified, the command aborts at the first error.
To retrieve all the command options you can use OptMask specifies all flags of the optional command options.
Buffer contains the data of the update.
CmFasSelect contains an array of structures with input data, e.g. the definition which updates should be applied.
CmFasResult contains an array of CmFas classes with output data, e.g. which updates were successful.
Return
Returns true, if all specified updates were successful, false otherwise.
If the option OptAbortOnError was set and the command aborted due to an error, the error code is set to the specific error code of the update that has failed.
If the error CMERROR_UPDATE_FAILED is set, more than one update was specified and at least one failed; detailed information can be found in CmFasResult.
Notes
Detailed information about the results of the update execution can be found in CmFasResult.
Syntax
import cmapi
handle.CmExecuteRemoteUpdate(flCtrl: int, pMemBuffer: bytes,
pCmFasSelect: cmapi.CMFAS) -> List[cmapi.CMFAS]
Parameter
handle is the the handle opened by CmAccess2 (must be Subsystem Access).
flCtrl contains one of the following commands:
cmapi.CMFAS_CTL_CMD_LIST lists all updates and simulates the execution without any change on the licenses. The input structure pCmFasSelect has to be null. This flag cannot be combined with any other flag. The simulated result can be found in pCmFasResult.mulResult.
cmapi.CMFAS_CTL_CMD_UPDATE all updates are executed. Any set restriction in pCmFasSelect is respected.
cmapi.CMFAS_CTL_CMD_UPDATE_EXISTING only updates for existing CmContainer are executed. Any set restriction in pCmFasSelect is respected. If the additional option cmapi.CMFAS_CTL_OPT_ABORT_ON_ERROR is set, the command only aborts, if an update of an existing CmContainer fails.
cmapi.CMFAS_CTL_CMD_GET_COUNT returns the count of needed structures of structure
cmapi.CMFAS for pCmFasResult. All other parameters can be null resp. 0.
|
CMFAS specifies additional data for CmExecuteRemoteUpdate or retrieves detailed results of this command. Syntax
Parameter mflSelect specifies the restrictions of updates by setting one of the following flags:
mulItemType retrieves the type of update as a result of the update execution:
mulSerial contains the serial number of the update either as restriction (input) or as result (list or update). musMask contains the serial mask of the update either as restriction (input) or as result (list or update). musReserved1 is reserved for future purposes. mulFirmCode contains the Firm Code of the update either as restriction (input) or as result (list or update). maulReserved3[20] is reserved for future purposes. mulResult contains the error codes of the single updates. If the error code cmapi.CMERROR_UPDATE_FAILED is set, more than one update was specified and at least one failed; detailed information can be found here. maulReserved4[10] is reserved for future purposes.
|
To retrieve all the command options you can use cmapi.CMFAS_CTL_CMD_MASK.
These flags can be or'ed with one of the following flags:
•cmapi.CMFAS_CTL_OPT_ABORT_ON_ERROR: If more than one update is specified, the command aborts at the first error.
To retrieve all the command options you can use cmapi.CMFAS_CTL_OPT_MASK specifies all flags of the optional command options.
pMemBuffer contains the data of the update.
cbMemBuffer contains the length of pMemBuffer.
pCmFasSelect contains an array of structures with input data, e.g. the definition which updates should be applied.
Return
Returns an array of cmapi.CMFAS classes with output data, e.g. which updates were successful.
If the option cmapi.CMFAS_CTL_OPT_ABORT_ON_ERROR was set and the command aborted due to an error, the error code is set to the specific error code of the update that has failed.
If the error code CMERROR_UPDATE_FAILED is set, more than one update was specified and at least one failed.