Configuration Manager
4-14
Set Service Callback Function for Configuration Tag
CfgSetService
Syntax
int CfgSetService( HANDLE hCfg, uint Tag, int (*pCb) (HANDLE, uint, uint,
uint, HANDLE) );
Parameter(s)
hCfg
Handle to configuration
Tag
Tag value to change
pCb
Pointer to service callback function
Return Value
Returns 0 on success, or less than 0 on error. The possible errors are:
CFGERROR_BADHANDLE
Invalid hCfg handle
CFGERROR_BADPARAM
Invalid function parameter
Description
In order to give the configuration the ability to be “active” – i.e., to make real-
time changes to the system as the configuration changes, the configuration
manager must have the ability to make changes to the system. To enable this
in a generic fashion, the configuration manager allows for the installation of
service callback functions for each configuration tag value.
This function sets the service function for a particular configuration tag. Ser-
vice function pointers default to NULL, and when they are NULL, no service
is performed for the configuration entry (it becomes information data only).
When invoked, the service callback function is passed back information about
the affected entry. The callback function is defined as:
int CbSrv( HANDLE hCfg, uint Tag, uint Item, uint Op,
HANDLE hCfgEntry );
hCfg
HANDLE to Config
Tag
Tag value of entry changed
Item
Item value of entry changed
Op
Operation (CFGOP_ADD or CFGOP_REMOVE)
hCfgEntry
Non-Referenced HANDLE to entry added or removed
The callback should return 1 on success, 0 on “pass”, and <0 on error.
Note: The configuration entry handle passed to the callback function is NOT
referenced in that its scope expires when the callback function returns.
Set the Tag Initialization and Shutdown Order on Execute
CfgSetExecuteOrder
Syntax
int CfgSetExecuteOrder( HANDLE hCfg, uint Tags, uint *pOpenOrder, uint
*pCloseOrder );
Parameter(s)
hCfg
Handle to configuration
Tags
Number of tag values in pOpenOrder and pCloseOrder