The SmsEnumObjects function enumerates objects.
SMS_STATUS SmsEnumObjects(
HANDLE hConn, // Handle to a connection that has been
// established via SmsDataSourceConnect.
char *pszObjectType, // Pointer to the object type you want to
// enumerate.
SMSBUFF *pPredecessors, // Pointer to an array of predecessor
// objects required for locating the
// requested object.
DWORD ctPredecessors, // Size of the pPredecessors array.
OJBDESCRIPTOR *pObjects, // Pointer to an array containing the
// details of the requested object type.
DWORD *pCtObjects // On entry, points to the size of the
// pObjects array; on exit, points to the
// actual number of requested objects known to
// the system.
);
The SmsEnumObjects function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns one of the following manifest constants:
The pPredecessor parameter is not used for first-class objects (that is, objects that are known directly by the API without any additional information). In this case, pPredecessor may be set to NULL.
To get the correct size for the pObjects array, call the SmsEnumObjects function with pObjects set to NULL or with pCtObjects set to zero. SmsEnumObjects will assign the count of the requested objects to pCtObjects and return a status of SMS_MORE_DATA. After getting the correct value for pCtObjects, call the SmsEnumObjects function again using the correct value for pCtObjects and a pObjects array with a size that matches the count specified by pCtObjects.
If the entry value of pCtObjects is less than the number of the requested objects known to the system, the function does not copy any information to the pObjects array and returns a status of SMS_MORE_DATA.
If the entry value of pCtObjects is greater than the number of the requested objects known to the system, the function writes all requested objects to the pObjects array and returns a status of SMS_OK.
SmsDataSourceConnect, SmsEnumObjectTypes