All SMS API functions return a value of type SMS_STATUS. The functions can return the following values:
An action was attempted on a container before the container was populated. The container must be populated before this action can be processed.
An action was attempted on a container after the container was populated. The action must be taken before the container is populated.
For SmsSetFilter, the application did not call SmsAddToken to add tokens to the filter.
Note that an insufficient size for the tempdb on the SQL Server containing the site database can cause this error to occur.
To size the tempdb, you should allocate 2K per machine (that is, 2K for each inventoried object, including objects of all architectures such as Personal Computer, SMSEvent, UserGroups, and so on). The log device should be at least 20 percent of the size of the data device. For example, if you have 50,000 machines in your SMS database, you should allocate at least 100 MB total for the tempdb and at least 20 MB for the tempdb log.
In order to set a scalar or commit a folder, the parent folder or container of the scalar or folder must also have ACCESS_MODIFY or ACCESS_CREATE permissions.
For SmsCommitFilter, the filter type is not valid. Currently, only machine filters can be committed.
For SmsGetFilterByID, no filters of the specified filter type were found in the filter container.
For SmsDescribeFolder, the specified folder type tag is for an unknown folder type. If an F_GROUP folder is specified, this status code is returned. The set of attributes for an F_GROUP folder is dependent on the instance of the group itself within a specific machine folder—there is no generic set of attributes for all F_GROUP folders.
For SmsDataSourceConnect, the database connection could not be made because of a memory allocation failure.
For SmsOpenFilterContainer, the attempt to open the filter container failed.
For SmsCommitFolder, one of the folder's scalars does not contain a valid value.
For SmsLinkFolder, the specified folder contains one or more scalars that have not been set properly.
For SmsGetFolderCount, if SmsPopulate is used in asynchronous mode, the function is still retrieving folders from the site database, that is, not all folders have been retrieved yet.
For SmsGetNextScalar and SmsGetScalarByName, the dwLen member of the pScalarStruct structure was set to NULL. If dwLen is NULL, these functions will set the dwLen member to the size of the SCALAR_STRING or SCALAR_BINARY scalar value.
For SmsGetAllFilters, this status code can be caused by one of the following conditions:
For SmsGetFilterType, the pszTag parameter is NULL.
For SmsEnumContainers, the buffer specified by ppData is not big enough and the function returns the count of container types in the DWORD specified by pCount. Or either ppData or pCount was set to NULL and the count of container types was returned to the pCount.
For SmsEnumFilters, the buffer specified by paFI is not big enough and the function returns the count of container types in the DWORD specified by pCount. Or either paFI or pCount was set to NULL and the count of container types was returned to pCount.
For SmsEnumFolders, the buffer specified by ppData is not big enough, and the function returns the count of folder types in the DWORD specified by pCount. Or either ppData or pCount was set to NULL and the count of folder types was returned to the pCount.
For SmsEnumObjects, the entry value of pCtObjects is less than the number of objects known to the system. The function returns this value but does not copy any information to the pObjects array.
For SmsEnumObjectTypes, the entry value of pCtObjects is less than the number of first-class objects known to the system. The function returns this value but does not copy any information to the pObjects array.
For SmsDupFolder, the specified parent handle is not valid for this type of folder.
For SmsGetNextFolder, no folder was retrieved because the end of the folder list was reached.
For SmsGetNextScalar, no scalar was returned because the end of the scalar list was reached.
For SmsGetScalarByName, the specified folder does not contain any scalars.
For SmsGetNextFilter, no filter was retrieved because the end of the filter list was reached.
For SmsSetScalar and SmsGetScalarByName, the specified folder does not contain the specified scalar.
For SmsGetFilterByID, the filter with the specified identifier could not be found in the filter container.
For SmsEnumObjects, either the object type pointed to by pszObjectType or the predecessor objects pointed to by pPredecessors were not found.
For SmsGetFolderCount, the function has not retrieved any folders from the site database yet.
For SmsGetNextFolder, the SMS API engine has returned a "not ready" status while retrieving the next folder from the site database.
For SmsSetScalar, a scalar of type SCALAR_TIME has an invalid time value specified.
For SmsGetFilterID, your application attempted to get the filter identifier for a transient filter. SmsGetFilterID applies only to persistent filters in a filter container; transient filters have no identifier.
For SmsAddToken, one or more of the parameters in the TOKEN structure is invalid, or the pointer to the TOKEN structure is NULL. If your application attempted to add a token to an inventory rules folder and the szTokenString member of the TOKEN structure also uses the retrieve keyword, the szTokenString member may contain a file name that specifies an incorrect location for the file. SmsAddToken will not add the token to the inventory rules folder and will return a status of SMS_PARAMETER_ERROR. If your application passes OP_AND for the opAndOr parameter for an attribute filter, group filter, site filter, or architecture filter, a status of SMS_PARAMETER_ERROR is also returned.
For SmsGetFilterType, the pfilterType parameter is NULL.
For SmsManipulateTokens, value set for dwFlags is an unrecognized value.
For SmsEnumObjects, the value of pszObjectType is NULL.
For SmsUnlinkFolder, the handle to the parent folder or container has already been closed and it is not possible to remove the child folder from it.
For SmsManipulateTokens, the specified token indexes are outside of the range of tokens in the filter or inventory rules folder. Or the operation specified by dwFlags cannot be performed on the specified range of tokens.
In order to update a scalar, the parent folder or container must support the operation as well as the scalar to set and the folder to commit.