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 / smsapi / testall / readme.txt < prev    next >
Text File  |  1996-10-15  |  3KB  |  96 lines

  1.  
  2. Sample: testall
  3. ===============
  4.  
  5. DESCRIPTION:
  6.  
  7.     This program illustrates the use of the SMS APIs to examine either
  8.     a site container, a jobs container, or a package container. The
  9.     only difference in code between them is the setting of filters.
  10.  
  11.     For the specified container, this program will set a standard set of
  12.     filters for that container type, and then begin enumeration of that
  13.     container and all the folders within it.
  14.  
  15.     After the preliminary work of soliciting from the user the datasource
  16.     information and making a connection to that datasource, the program
  17.     then solicits the container type to enumerate and sets appropriate
  18.     filters (see below). A loop is then entered which retrieves and
  19.     stores the handles of all folders in that container. The container
  20.     is then closed. Closing a container as soon as possible has a space
  21.     advantage in that an open parent causes a folder's reference count to
  22.     be incremented. The folder will not be closed until this count reaches
  23.     zero. If the container is left open then no folders at all will be
  24.     removed from memory.
  25.  
  26.     We then loop through the list of folders and display them one at a time,
  27.     after which the program either terminates or restarts (using the same
  28.     datasource), according to the user's request.
  29.  
  30.     Displaying folders.
  31.     This is accomplished in the DisplayFolder() function.
  32.  
  33. API USAGE:
  34.     The following APIs are used in this program:
  35.  
  36.       SmsAPIVer
  37.  
  38.       SmsDataSourceConnect
  39.       SmsDataSourceDisconnect
  40.  
  41.       SmsOpenContainer
  42.       SmsSetFilter
  43.       SmsPopulate
  44.       SmsGetFolderCount
  45.       SmsCloseContainer
  46.  
  47.       SmsCreateFilter
  48.       SmsGetToken
  49.       SmsGetTokenCount
  50.       SmsAddToken
  51.       SmsCloseFilter
  52.  
  53.       SmsGetFolderID
  54.       SmsGetFolderType
  55.       SmsGetNextFolder
  56.       SmsGetScalarCount
  57.       SmsGetNextScalar
  58.       SmsCloseFolder
  59.  
  60.  
  61. 1. Site hierarchy
  62. -----------------
  63. This program will display the site/domain/machine/MIF group
  64. tree for the associated datasource according to certain filter
  65. conditions.
  66. o site filter:         select either root site or specific site.
  67. o architecture filter: select machines of architecture Personal Computer.
  68. o machine filter:      only machines with SystemRole=Server.
  69. o group filter:        select the identification group.
  70. o greoup filter:       select the netcard group.
  71.  
  72. 2. Jobs
  73. -------
  74. The user can select from the following types of jobs: workstation
  75. install, server share, remove package, system. Selections are
  76. ORed together, thus it is possible to select both workstation
  77. install and remove package jobs. It is also possible to select
  78. none of the above in which case the system defaults to selecting
  79. all of them.
  80. This might sound illogical, quite the contrary. A filter is a
  81. restriction, if there are no restrictions then none are disallowed.
  82.  
  83. 3. Packages
  84. -----------
  85. This uses the package filter to allow selection of any or all of the
  86. following types of packages:
  87. o Workstation
  88. o Server
  89. o Inventory
  90.  
  91.  
  92. The program will enumerate all folders in the specified container,
  93. for each folder it will display all scalars and then enumerate
  94. all sub-folders.
  95.  
  96.