SmsEnumObjectTypes

The SmsEnumObjectTypes function returns a list of first-class objects that are known to the API.

SMS_STATUS SmsEnumObjectTypes(
  HANDLE hConnection, // Handle to a connection that has been 
                      // established via SmsDataSourceConnect.
  SMSBUFF *pObjects,  // Pointer to an array of first-class objects 
                      // known to the system.
  DWORD *pCtObjects   // On entry, points to the size of the 
                      // pObjects array; on exit, points to the actual 
                      // number of first-class objects known to the 
                      // system.
);
 

Parameters

hConnection
Handle to a connection that has been established via the SmsDataSourceConnect function
*pObjects
Upon successful completion, points to an array containing the names of each first-class object known to the system. Your application must ensure that the array specified by pObjects is large enough to contain the number of first-class objects known to the system. See the following remarks.
*pCtObjects
On entry, this parameter points to a DWORD value that specifies the size of the pObjects array. On exit, this parameter points to a DWORD value that contains the actual number of first-class objects known to the system.

Return Values

The SmsEnumObjectTypes 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:

SMS_MORE_DATA
The entry value of pCtObjects is less than the number of first-class objects known to the system. The function returns this value in pCtObjects, but does not copy any information to the pObjects array.
SMS_ERROR
The internal object list could not be found. This indicates a fundamental error related to the connection to the SMS database.

Remarks

A first-class object is one that is known directly to the API and does not require any additional information. For example, the system knows directly about architectures and platforms, but cannot know about attributes without first knowing about an architecture and a groupclass.

To get the correct size for the pObjects array, call the SmsEnumObjectTypes function with pObjects set to NULL or with pCtObjects set to zero. SmsEnumObjectTypes will assign the count of the first-class objects to pCtObjects and return a status of SMS_MORE_DATA. After getting the correct value for pCtObjects, call the SmsEnumObjectTypes 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 first-class 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 first-class objects known to the system, the function writes all first-class objects to the pObjects array and returns a status of SMS_OK.

See Also

SmsDataSourceConnect, SmsEnumObjects