home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sysmgmt / sms / vbsmsapi / common / smsapi.bas < prev    next >
Encoding:
BASIC Source File  |  1996-10-15  |  22.8 KB  |  582 lines

  1. Option Explicit
  2. '// **************************************************************************
  3. '//
  4. '//  File: SMSAPI.H
  5. '//
  6. '//  Copyright (c) 1994, 1995 Microsoft Corp.
  7. '//
  8. '//  This is the header file for the SMS API.
  9. '//
  10. '//  This file contains all data definitions, manifests, return codes and
  11. '//  API declarations that constitute the API set.
  12. '//
  13. '//
  14. '// **************************************************************************
  15. '
  16. '
  17. '
  18. '// **************************************************************************
  19. '//
  20. '//  The SMS API set provides a set of interfaces to enable querying and,
  21. '//  in some cases creation and deletion, of data from an SMS database.
  22. '//
  23. '//  SMS contains numerous objects to which an ISV needs access. These objects
  24. '//  are (not in any particular order): packages, jobs, workstation command
  25. '//  lines, program items, sites, domains, machines, machine groups.
  26. '//
  27. '//  The SMS API is built using a technology known as the objectity technique.
  28. '//  This technique expresses all objects in terms of containers, folders,
  29. '//  and scalars. All SMS objects are thus expressed in these terms.
  30. '//  The advantage of this is that we have a standard interface to all
  31. '//  objects. That is, the API does not distinguish between, say, a job and
  32. '//  a machine.
  33. '//
  34. '//  The starting point is the container. There are certain types of container
  35. '//  defined (container types below). A container is opened and then
  36. '//  populated. The act of populating a container causes it to be filled with
  37. '//  folders of defned types. A folder can contain sub-folders and scalars.
  38. '//  Scalars are akin to leaf nodes in a hierarchy graph. The contain a
  39. '//  name, type, and value.
  40. '//
  41. '//  Much of the power to the objectity technique is provided by filters.
  42. '//  These are objects which specify selection criteria. Filters are applied
  43. '//  by the user at the container level, at which point the implementation of
  44. '//  the API will assume ownership of the filter. It is guaranteed that only
  45. '//  folders matching the filters will be included in the container hierarchy.
  46. '//
  47. '//  Every folder can contain a set of scalars. Not all folders do, for
  48. '//  example a machine folder does not. In some cases a folder contains a
  49. '//  defined set of scalars, in other cases the scalar set can only be
  50. '//  determined at run time. In cases where the scalar set is predetermined
  51. '//  it will be documented in supporting documentation.
  52. '//
  53. '//  The APIs behave in an uniform manner.
  54. '//  1. They all return a status code (SMS_STATUS).
  55. '//  2. Where a value needs to be returned, it is done via a reference
  56. '//     parameter.
  57. '//
  58. '//  An API is provided to determine the API version. Any problems involving
  59. '//  the SMS API should include the information provided by this API.
  60. '//
  61. '//  The first step in using the APIs to to establish a connection to a
  62. '//  datasource. Currently the only datasource supported in SQL, but the
  63. '//  API is designed in such a way that additional datasources can be
  64. '//  added. Two APIs are provided for dealing with datasources:
  65. '//  DataSourceConnect and DataSourceDisonnect. The connect API returns a
  66. '//  connection handle, this is used in subsequent calls to open containers.
  67. '//
  68. '//  Apart from these APIs, the rest of the API set is divided into four
  69. '//  groups:
  70. '//  1. Container APIs.
  71. '//  2. Folder APIs.
  72. '//  3. Scalar APIs.
  73. '//  4. Filter APIs.
  74. '//
  75. '//  1. Container APIs.
  76. '//  These allow a container to be opened, a filter to be applied to a
  77. '//  container, a container to be populated with folders, a folder to be
  78. '//  retrieved, and the container to be closed. An API also exists to
  79. '//  return the number of folders currently contained in a container.
  80. '//
  81. '//  2. Folder APIs.
  82. '//  These allow a for retrieval of various types of information about a
  83. '//  folder (its ID or name, its type, the number of sub-folders, the number
  84. '//  of scalars). Retrieval of sub-folders within a folder in both a
  85. '//  sequential fashion and by name. Retrieval of scalars (sequential and by
  86. '//  name. And closure of the folder.
  87. '//  An API exists to allow folder creation. However, this is implementation
  88. '//  dependant. That is, most folders do not permit creation, some (eg
  89. '//  ceratin types of jobs) do.
  90. '//
  91. '//  3. Scalar APIs.
  92. '//  There is a bit of overlap between this and the previous group. Although
  93. '//  scalar retrieval is included in the Folder API group, it can also be
  94. '//  considered a scalar API.
  95. '//  An API is provided to set/update the value of a scalar. This can
  96. '//  currently only be done in a folder that is being newly created.
  97. '//
  98. '//  4. Filter APIs.
  99. '//  APIs for opening and closing a filter, and adding tokens into a filter.
  100. '//  Filters are composed of one or more tokens of the same type. Some filters
  101. '//  permit grouping of tokens within the filter (ie machine filter). This
  102. '//  allows for complex boolean expressions.
  103. '//  Tokens differ between different filters, but have a common interface.
  104. '//  Tokens are contructed via the SmsAddToken API.
  105. '//
  106. '//  5. Filter container APIs
  107. '//  Certain filters can be persistent, that is they are saved in the database
  108. '//  and can be reloaded by separate processes. These filters can be created
  109. '//  either the APIs, or via the SMS Admin.
  110. '//   These APIs enable the retrieval of these filters from the datasource
  111. '//  and the commital of new filters into the datasource.
  112. '//  Currently machine filters are the only filters capable of exhibiting
  113. '//  persistence.
  114. '//
  115. '// **************************************************************************
  116. '
  117. '// ====================================================================
  118. '//
  119. '//  Includes
  120. '//
  121. '// ====================================================================
  122. '
  123. '/* VB: These includes must be explicitly listed in the VB makefile   */
  124. '
  125. 'include qrycodes.bas         // The query codes for Machine queries.
  126. '
  127. 'include smsinfo.bas          // Manifests related to scalar settings.
  128. '
  129. 'include objectty.bas         // Objectity engine.
  130. '
  131. '
  132. '// ====================================================================
  133. '//
  134. '//  Datasource definition information.
  135. '//
  136. '// ====================================================================
  137. '
  138. '//
  139. '// Supported datasources.
  140. '// (NOTE: only sql supported currently).
  141. '//
  142.  Type DATASOURCE_TYPE
  143.      enum As Long
  144.  End Type
  145.  
  146.  ' These are initialized in Init_DATASOURCE_TYPE_enums()
  147.  Global DB_SQL As DATASOURCE_TYPE
  148.  Global DB_SQL_CONNECTED As DATASOURCE_TYPE
  149.  Global DB_OTHER As DATASOURCE_TYPE
  150. '
  151. '
  152. '//
  153. '// Prototype for a decryption function. This is the last parameter
  154. '// to the SQL_CONNECT_PARAMS structure.
  155. '// When a user calls the DataSourceConnect API he can pass in the
  156. '// user name and password in encrypted form. If the decryption function
  157. '// pointer is non-null the the API will attempt to call this function
  158. '// both for the user name and password.
  159. '// The decryption function is user-supplied, it is expected to return
  160. '// the decrypted data in the first parameter.
  161. '//
  162. '
  163. 'typedef void (*PDECRYPTFUNC)(char *pszBuffer, char *pszDecryptMe, char *pszKey);
  164. '/* VB: This can not be done this way in VB  */
  165. '
  166. '
  167. '//
  168. '//  The information block needed for the DataSourceConnect API.
  169. '//  1. SQL datasource.
  170. '//
  171. '
  172.  Type SQL_CONNECT_PARAMS
  173.      ds As DATASOURCE_TYPE
  174.      pszServer As String                 '// SQL Server name.
  175.      pszUserName As String               '// User name (possibly encrypted).
  176.      pszPasswd As String                 '// Password (possibly encrypted).
  177.      pszDbName As String                 '// Database name.
  178.      pszKey As String                    '// Decryption key.
  179.      pFunc As Long                       '// Pointer to a decryption function.
  180.  End Type
  181. '
  182. '
  183. '//
  184. '//  2. RESERVED DO NOT USE
  185. '//
  186. '
  187. 'typedef struct _SQL_CONNECT_CONNECTED_PARAMS {
  188. '    DATASOURCE_TYPE ds;
  189. '    HANDLE hDataSource;
  190. '    const char *pszAccessType;
  191. '} SQL_CONNECT_CONNECTED_PARAMS;
  192. '
  193. '
  194. '
  195. '//
  196. '// This only has the type field. It is used for extracting the type
  197. '// in such a fashion that user code doesn't have to imply any
  198. '// particular data source. It has no use other than that.
  199. '//
  200. '
  201.  Type GENERIC
  202.      ds As DATASOURCE_TYPE
  203.  End Type
  204. '
  205. '
  206. '
  207. '// We can now define the DATASOURCE. It is a union of the structs above.
  208. 'typedef union {
  209. '    GENERIC             type;
  210. '    SQL_CONNECT_PARAMS  sqlParams;
  211. '    SQL_CONNECT_CONNECTED_PARAMS sqlConnectedParams;
  212. '} DATASOURCE;
  213. '
  214. '/* VB: Unions can not be done in VB  */
  215. '
  216. '
  217. '
  218. '// ====================================================================
  219. '//
  220. '//  Return codes. See also objectty.h.
  221. '//
  222. '// ====================================================================
  223. 'typedef DWORD SMS_STATUS;           // All APIs return an SMS_STATUS.
  224. '/* VB: All API's return Long  */
  225. '
  226.  Global Const SMS_OK = OTT_OK
  227.  Global Const SMS_MORE_DATA = OTT_MORE_DATA
  228.  Global Const SMS_NO_MORE_DATA = OTT_NO_MORE_DATA
  229.  Global Const SMS_FOLDER_NO_UPDATE = OTT_FOLDER_NO_UPDATE
  230. '
  231. '// Error codes when registering (and accessing) containers and filters
  232.  Global Const SMS_DUPLICATE_CONTAINER_ID = OTT_DUPLICATE_CONTAINER_ID
  233.  Global Const SMS_DUPLICATE_FOLDER_ID = OTT_DUPLICATE_FOLDER_ID
  234.  Global Const SMS_DUPLICATE_FILTER_ID = OTT_DUPLICATE_FILTER_ID
  235. '
  236.  Global Const SMS_DUPLICATE_FILTER = OTT_DUPLICATE_FILTER
  237. '
  238.  Global Const SMS_SCALAR_NO_UPDATE = OTT_SCALAR_NO_UPDATE
  239.  Global Const SMS_SCALAR_WRONG_TYPE = OTT_SCALAR_WRONG_TYPE
  240.  Global Const SMS_INVALID_CONTAINER_ID = OTT_INVALID_CONTAINER_ID
  241.  Global Const SMS_INVALID_FOLDER_ID = OTT_INVALID_FOLDER_ID
  242.  Global Const SMS_INVALID_FILTER_ID = OTT_INVALID_FILTER_ID
  243. '
  244.  Global Const SMS_CONTAINER_NO_UPDATE = OTT_CONTAINER_NO_UPDATE
  245. '
  246.  Global Const SMS_PARAMETER_ERROR = OTT_PARAMETER_ERROR
  247.  Global Const SMS_UNSUPPORTED = OTT_UNSUPPORTED
  248. '
  249. '// This is returned when a specific object (folder or scalar) is
  250. '// requested and not found. APIs returning this are GetFolderByID
  251. '// and GetScalarByName.
  252.  Global Const SMS_NOT_FOUND = OTT_NOT_FOUND
  253. '
  254.  Global Const SMS_PARENT_NOT_FOUND = OTT_PARENT_NOT_FOUND
  255. '
  256.  Global Const SMS_CANT_DELETE = OTT_CANT_DELETE
  257. '
  258.  Global Const SMS_NEW_FOLDER = OTT_NEW_FOLDER
  259. '
  260. '// Error when attempting to multiply link a folder.
  261.  Global Const SMS_FOLDER_LINKED = OTT_FOLDER_LINKED
  262. '
  263. '// Filter operations.
  264.  Global Const SMS_RANGE_ERROR = OTT_RANGE_ERROR
  265. '
  266. '// These are returned when a container operation is tried
  267. '// when it shouldn't be.
  268.  Global Const SMS_CONTAINER_NOT_POPULATED = OTT_CONTAINER_NOT_POPULATED
  269.  Global Const SMS_CONTAINER_POPULATED = OTT_CONTAINER_POPULATED
  270. '
  271. '
  272. '// Attempt to perform persistent operation on a non-persistent filter.
  273.  Global Const SMS_FILTER_NOT_PERSISTENT = OTT_FILTER_NOT_PERSISTENT
  274. '
  275. '// Error return if the connection handle of a filter doesn't match
  276. '// that of a container to which the filter is being applied.
  277.  Global Const SMS_INVALID_CONNECTION_HANDLE = OTT_INVALID_CONNECTION_HANDLE
  278.  Global Const SMS_INVALID_FILTER_TYPE = OTT_INVALID_FILTER_TYPE
  279.  
  280. '// Folder's can't be unlinked if there are multiple handles
  281. '// to the same object.
  282.  Global Const SMS_IN_USE_BY_OTHER = OTT_IN_USE_BY_OTHER
  283. '
  284. '
  285. '// User (ie non-engine) codes begin here.
  286.  Global Const SMS_ERROR = OTT_END + 1
  287.  Global Const SMS_SQL_ERROR = OTT_END + 2
  288.  Global Const SMS_INVALID_DATASOURCE = OTT_END + 3
  289.  Global Const SMS_INVALID_HANDLE = OTT_END + 4
  290.  Global Const SMS_INVALID_FOLDER_TYPE = OTT_END + 6
  291. '
  292.  Global Const SMS_CONNECT_FAILED = OTT_END + 7
  293.  Global Const SMS_NO_CREATE = OTT_END + 8
  294.  Global Const SMS_FOLDER_NOT_MODIFIED = OTT_END + 9
  295.  Global Const SMS_INCORRECT_FOLDER_TYPE = OTT_END + 10 'Unused.
  296.  Global Const SMS_INVALID_PARAMETER = OTT_END + 11
  297.  Global Const SMS_EMPTY = OTT_END + 12
  298. '
  299. '// Error when attempting to commit a child folder when the
  300. '// parent folder must be committed.
  301.  Global Const SMS_PARENT_NEEDS_COMMIT = OTT_END + 13
  302.  Global Const SMS_PARENT_ALREADY_COMMITTED = OTT_END + 14
  303. '
  304. '// Used in asynchronous folder retrieval. Indicates that there
  305. '// might be more data but it isn't available yet.
  306.  Global Const SMS_NOT_READY = OTT_END + 15
  307. '
  308.  Global Const SMS_FILTER_NO_MODIFY = OTT_END + 16
  309.  Global Const SMS_FOLDER_ALREADY_DELETED = OTT_END + 17
  310. '
  311. '// Only allow one active connection. This is an SMS restriction.
  312.  Global Const SMS_ALREADY_CONNECTED = OTT_END + 18
  313.  
  314. '// Some failure in committing a folder
  315.  Global Const SMS_COMMIT_FAILED = OTT_END + 19
  316.  
  317.  
  318. '// Specific failure in linking a folder
  319.  Global Const SMS_DUPLICATE_FOLDER = OTT_END + 20
  320.  
  321.  Global Const SMS_ERROR_LAST = OTT_END + 20
  322.  
  323.  
  324. 'Error strings
  325. 'This array is initialized in Init_SMSError_array()
  326. Global SMSError$(0 To SMS_ERROR_LAST)
  327.  
  328. '
  329. '// ====================================================================
  330. '//
  331. '//  Various manifests.
  332. '//
  333. '// ====================================================================
  334. '
  335. '// The location of the SMS registry root.
  336.  Global Const SMS_REG_ROOT = "SOFTWARE\Microsoft\SMS\"
  337. '
  338. '// The max size of character (string) data that we return.
  339.  Global Const SMS_DATA_BUFF_SIZE = 255
  340. '
  341. '
  342. '// 'SMSBUFF' and 'OBJDESCRIPTOR' used in object type enumeration APIs.
  343. '// ===================================================================
  344.  
  345. '// A character buffer.
  346. '// -------------------
  347. 'typedef char SMSBUFF[SMS_DATA_BUFF_SIZE+1];
  348.  
  349. '// Describes an object returned from SmsEnumObjects.
  350. '// -------------------------------------------------
  351.  Type OBJDESCRIPTOR
  352.      objType As Long                   '// Type of this object.
  353.      szName As String                  '// Object name (eg 'Personal Computer')
  354.      szFriendlyName As String          '// Friendly name. Only used in groups
  355.                                        '// where szName would be, eg,
  356.                                        '// 'MICROSOFT|IDENTIFICATION|1.0', the
  357.                                        '// friendly name would be 'Identification'.
  358.      bGotFriendlyName As Long          '// TRUE if we have a friendly name.
  359.  
  360.      dwRelopMin As Long                '// For attributes, indicates range of
  361.      dwRelopMax As Long                '// relational operators that can be used
  362.                                        '// for this attribute.
  363.      bGotRelops As Long                '// TRUE if we have the relops fields set.
  364.  
  365.  End Type
  366.  
  367.  
  368. '// Object types.
  369. '// =============
  370. '// This is the value that is inserted by the object
  371. '// enumeration APIs into the OBJDESCRIPTOR structure.
  372. '// --------------------------------------------------
  373.  Global Const OT_ARCHLIST = 1
  374.  Global Const OT_ARCH = 2
  375.  Global Const OT_GROUP = 3
  376.  Global Const OT_ATTRIBUTE = 4
  377.  
  378.  Global Const OT_PLATFORMS = 5
  379.  Global Const OT_PLATFORM_PDF = 6
  380.  Global Const OT_PLATFORM_WINST = 7
  381.  Global Const OT_PLATFORM_NAD = 8
  382.  
  383.  Global Const OT_UNKNOWN = 100
  384.  
  385.  
  386.  
  387. '// --------------------------------------------------------------------
  388. '// Flags for Populate options.
  389. '// --------------------------------------------------------------------
  390.  Global Const POP_SYNC = &H0&
  391.  Global Const POP_ASYNC = &H1&
  392.  Global Const POP_EVENT = &H10&
  393.  Global Const POP_WINDOW = &H20&
  394. '
  395. '
  396. '// --------------------------------------------------------------------
  397. '// Folder types supported by smsapi (MUST NOT BEGIN AT ZERO).
  398. '// --------------------------------------------------------------------
  399.  Global Const F_SITE = 1                 'Site folder
  400.  Global Const F_MACHINE = 2              'Machine folder
  401.  Global Const F_GROUP = 3                'Subfolder of machine
  402.  Global Const F_DOMAIN = 4               'Domain folder, subfolder of a site
  403.  
  404. '// Jobs
  405.  Global Const F_SYSTEMJOB = 5            'System (NAD/Site) job folder
  406. 'Global Const F_MINIJOB = 6              'Mini-job folder
  407.  Global Const F_INSTALLJOB = 7           'Job folder (wksta install)
  408.  Global Const F_SRVINSTALLJOB = 8        'Job folder (server install)
  409.  Global Const F_REMPKGJOB = 9            'Remove package Job folder
  410. '
  411.  Global Const F_PACKAGE = 10             'Packages
  412.  Global Const F_WCL = 11                 'Workstation command lines
  413.  Global Const F_PROGITEM = 12            'Program items
  414.  Global Const F_INVENTORY = 13           'Inventory rules.
  415. '
  416.  Global Const F_MACHINEGROUP = 14        'Machine group
  417.  Global Const F_SITEGROUP = 15           'Site group folder
  418. '
  419. '// --------------------------------------------------------------------
  420. '// Container types supported by smsapi (MUST NOT BEGIN AT ZERO).
  421. '// --------------------------------------------------------------------
  422.  Global Const C_SITE = 1                 'Site container
  423.  Global Const C_JOB = 2                  'Job container
  424.  Global Const C_MACHINE = 3              'Machine container
  425.  Global Const C_PACKAGE = 4              'Package container
  426.  Global Const C_MACHINEGROUP = 5         'Machine group
  427.  Global Const C_SITEGROUP = 6            'Site group
  428. '
  429. '
  430. '// ====================================================================
  431. '//
  432. '//      Filter information.
  433. '//
  434. '// ====================================================================
  435. '
  436. '
  437. '// --------------------------------------------------------------------
  438. '//  Filter types
  439. '// --------------------------------------------------------------------
  440.  Global Const SITE_FILTER = 1
  441.  Global Const MACHINE_FILTER = 2
  442.  Global Const GROUP_FILTER = 3
  443.  Global Const JOB_FILTER = 4
  444.  Global Const ARCHITECTURE_FILTER = 5
  445.  Global Const PACKAGE_FILTER = 6
  446.  Global Const ATTRIBUTE_FILTER = 7
  447.  Global Const SITELIMIT_FILTER = 8
  448. '
  449. '
  450. '// --------------------------------------------------------------------
  451. '// Token types.
  452. '// --------------------------------------------------------------------
  453.  Global Const TOKEN_USER = &H8      '1000 bit 3 always set for user-token
  454.  Global Const TOKEN_OR = &H2        '0010 bit 1 always set for AND/OR
  455.  Global Const TOKEN_AND = &H3       '0011 bit 1 always set for AND/OR
  456.  Global Const TOKEN_OPENPAREN = &H4 '0100 bit 2 always set for PAREN
  457.  Global Const TOKEN_CLOSEPAREN = &H5'0101 bit 2 always set for PAREN
  458.  Global Const TOKEN_NOTIN = &H20    '10100 bit 2 set for a PAREN plus bit 4 for an extra indicator.
  459.  Global Const TOKEN_OPERATOR = &H2  'Detects both AND or OR
  460.  Global Const TOKEN_PAREN = &H4     'Detects either open or close paren
  461. '
  462. '
  463. '// --------------------------------------------------------------------
  464. '// Manifests used in filter token APIs.
  465. '// --------------------------------------------------------------------
  466.  Global Const AT_START = OTT_AT_START 'Token will be inserted at start of expression
  467.  Global Const AT_END = OTT_AT_END     'Token will be appended to end of expression
  468. '
  469. '//
  470. '// Flags fields in SmsManipulateTokens.
  471. '//
  472.  Global Const TOK_GROUP = 1          'Flags field in SmsManipulateTokens
  473.  Global Const TOK_UNGROUP = 2
  474.  Global Const TOK_DELETE = 3
  475.  Global Const TOK_GROUP_NOT = 4
  476. '
  477. '
  478.  Sub Init_DATASOURCE_TYPE_enums ()
  479.      DB_SQL.enum = 0
  480.      DB_SQL_CONNECTED.enum = 1
  481.      DB_OTHER.enum = 2
  482.  End Sub
  483.  
  484.  Function Init_SMSAPI% ()
  485.      'Default return value True (DLL loaded)
  486.      Init_SMSAPI% = True
  487.  
  488.      'Initialize "included" modules
  489.      Init_OBJECTTY
  490.      Init_QRYCODES
  491.  
  492.      'Initialize this module
  493.      Init_DATASOURCE_TYPE_enums
  494.  
  495.      'Initialize error string array
  496.      Init_SMSError_array
  497.  End Function
  498.  
  499.  Sub Init_SMSError_array ()
  500.      SMSError$(SMS_OK) = "SMS_OK"
  501.      SMSError$(SMS_MORE_DATA) = "SMS_MORE_DATA"
  502.      SMSError$(SMS_NO_MORE_DATA) = "SMS_NO_MORE_DATA"
  503.      SMSError$(SMS_FOLDER_NO_UPDATE) = "SMS_FOLDER_NO_UPDATE"
  504.  
  505. '// Error codes when registering (and accessing) containers and filters
  506.      SMSError$(SMS_DUPLICATE_CONTAINER_ID) = "SMS_DUPLICATE_CONTAINER_ID"
  507.      SMSError$(SMS_DUPLICATE_FOLDER_ID) = "SMS_DUPLICATE_FOLDER_ID"
  508.      SMSError$(SMS_DUPLICATE_FILTER_ID) = "SMS_DUPLICATE_FILTER_ID"
  509.      SMSError$(SMS_DUPLICATE_FILTER) = "SMS_DUPLICATE_FILTER"
  510.      
  511.      SMSError$(SMS_SCALAR_NO_UPDATE) = "SMS_SCALAR_NO_UPDATE"
  512.      SMSError$(SMS_SCALAR_WRONG_TYPE) = "SMS_SCALAR_WRONG_TYPE"
  513.      SMSError$(SMS_INVALID_CONTAINER_ID) = "SMS_INVALID_CONTAINER_ID"
  514.      SMSError$(SMS_INVALID_FOLDER_ID) = "SMS_INVALID_FOLDER_ID"
  515.      SMSError$(SMS_INVALID_FILTER_ID) = "SMS_INVALID_FILTER_ID"
  516.  
  517.      SMSError$(SMS_CONTAINER_NO_UPDATE) = "SMS_CONTAINER_NO_UPDATE"
  518.  
  519.      SMSError$(SMS_PARAMETER_ERROR) = "SMS_PARAMETER_ERROR"
  520.      SMSError$(SMS_UNSUPPORTED) = "SMS_UNSUPPORTED"
  521.  
  522. '// This is returned when a specific object (folder or scalar) is
  523. '// requested and not found. APIs returning this are GetFolderByID
  524. '// and GetScalarByName.
  525.      SMSError$(SMS_NOT_FOUND) = "SMS_NOT_FOUND"
  526.  
  527.      SMSError$(SMS_PARENT_NOT_FOUND) = "SMS_PARENT_NOT_FOUND"
  528.      
  529.      SMSError$(SMS_CANT_DELETE) = "SMS_CANT_DELETE"
  530.      
  531.      SMSError$(SMS_NEW_FOLDER) = "SMS_NEW_FOLDER"
  532.  
  533. '// Error when attempting to multiply link a folder.
  534.      SMSError$(SMS_FOLDER_LINKED) = "SMS_FOLDER_LINKED"
  535.      
  536. '// Filter operations.
  537.      SMSError$(SMS_RANGE_ERROR) = "SMS_RANGE_ERROR"
  538.      
  539. '// These are returned when a container operation is tried
  540. '// when it shouldn't be.
  541.      SMSError$(SMS_CONTAINER_NOT_POPULATED) = "SMS_CONTAINER_NOT_POPULATED"
  542.      SMSError$(SMS_CONTAINER_POPULATED) = "SMS_CONTAINER_POPULATED"
  543.  
  544. '// Attempt to perform persistent operation on a non-persistent filter.
  545.      SMSError$(SMS_FILTER_NOT_PERSISTENT) = "SMS_FILTER_NOT_PERSISTENT"
  546.  
  547. '// Error return if the connection handle of a filter doesn't match
  548. '// that of a container to which the filter is being applied.
  549.      SMSError$(SMS_INVALID_CONNECTION_HANDLE) = "SMS_INVALID_CONNECTION_HANDLE"
  550.  
  551. '// User (ie non-engine) codes begin here.
  552.      SMSError$(SMS_ERROR) = "SMS_ERROR"
  553.      SMSError$(SMS_SQL_ERROR) = "SMS_SQL_ERROR"
  554.      SMSError$(SMS_INVALID_DATASOURCE) = "SMS_INVALID_DATASOURCE"
  555.      SMSError$(SMS_INVALID_HANDLE) = "SMS_INVALID_HANDLE"
  556.      SMSError$(SMS_INVALID_FILTER_TYPE) = "SMS_INVALID_FILTER_TYPE"
  557.      SMSError$(SMS_INVALID_FOLDER_TYPE) = "SMS_INVALID_FOLDER_TYPE"
  558.  
  559.      SMSError$(SMS_CONNECT_FAILED) = "SMS_CONNECT_FAILED"
  560.      SMSError$(SMS_NO_CREATE) = "SMS_NO_CREATE"
  561.      SMSError$(SMS_FOLDER_NOT_MODIFIED) = "SMS_FOLDER_NOT_MODIFIED"
  562.      SMSError$(SMS_INCORRECT_FOLDER_TYPE) = "SMS_INCORRECT_FOLDER_TYPE"
  563.      SMSError$(SMS_INVALID_PARAMETER) = "SMS_INVALID_PARAMETER"
  564.      SMSError$(SMS_EMPTY) = "SMS_EMPTY"
  565.  
  566. '// Error when attempting to commit a child folder when the
  567. '// parent folder must be committed.
  568.      SMSError$(SMS_PARENT_NEEDS_COMMIT) = "SMS_PARENT_NEEDS_COMMIT"
  569.      SMSError$(SMS_PARENT_ALREADY_COMMITTED) = "SMS_PARENT_ALREADY_COMMITTED"
  570.  
  571. '// Used in asynchronous folder retrieval. Indicates that there
  572. '// might be more data but it isn't available yet.
  573.      SMSError$(SMS_NOT_READY) = "SMS_NOT_READY"
  574.      
  575.      SMSError$(SMS_FILTER_NO_MODIFY) = "SMS_FILTER_NO_MODIFY"
  576.      SMSError$(SMS_FOLDER_ALREADY_DELETED) = "SMS_FOLDER_ALREADY_DELETED"
  577.  
  578. '// Only allow one active connection (SMS restriction).
  579.      SMSError$(SMS_ALREADY_CONNECTED) = "SMS_ALREADY_CONNECTED"
  580.  End Sub
  581.  
  582.