Configuration Manager
4-10
Index
Instance index to get (1 to n)
Size
Size of buffer to receive data
pData
Pointer to data buffer to receive data
Return Value
Number of bytes copied
Description
This function is a useful shortcut when searching the configuration for well
known entries. It searches the configuration for entries matching the supplied
Tag and Item parameters and uses the item matching the supplied Index pa-
rameter. For example if Index is 1, the first instance is used, if Index is 2, the
second instance is used. The total number of instances can be found by calling
CfgGetEntryCnt().
Instead of returning a referenced handle to the configuration entry (as with the
more generic CfgGetEntry() function), this function immediately gets the entry
data for this entry and copies it to the data buffer pointed to by pData.
With simplicity comes some cost in flexibility. This function simply returns the
number of bytes copied, so it will return 0 for any of the following reasons:
-
a supplied parameter is incorrect
-
the item was not found
-
the supplied buffer size (specified by Size) was not large enough to hold
the data
Get the Next Entry Instance Matching the Supplied Entry Handle
CfgGetNextEntry
Syntax
int CfgGetNextEntry( HANDLE hCfg, HANDLE hCfgEntry, HANDLE
*phCfgEntryNext );
Parameter(s)
hCfg
Handle to configurationh
CfgEntry
Handle to last configuration entry
phCfgEntryNext
Pointer to receive handle of next configuration entry
Return Value
Returns 1 if a next entry was found
Returns 0 if a next entry was not found
Returns less than 0 on error
The possible configuration errors are:
CFGERROR_BADHANDLE
Invalid hCfg handle
CFGERROR_BADPARAM
Invalid function parameter
Note: The handle hCfgEntry is not dereferenced on the event of an error.
Description
This function serves two purposes. First, it dereferences the configuration
entry handle supplied in hCfgEntry. So after this call, the handle is invalid (un-
less there was more than 1 reference to it). Secondly, this function returns a
referenced configuration entry handle to the next instance (if any) of an entry
that matches the Tag and Item values of the supplied entry.