Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

295 lines
12 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: SchemaKeys.cpp
  6. //
  7. // Author: Charles Ma
  8. // 2000.12.4
  9. //
  10. // Description:
  11. //
  12. // implementation of CSchemaKeys class
  13. //
  14. //=======================================================================
  15. //#include <iuengine.h>
  16. #include "schemakeys.h"
  17. const TCHAR CKEY_REGKEYEXISTS[] = _T("regKeyExists");
  18. const TCHAR CKEY_REGKEYVALUE[] = _T("regKeyValue");
  19. const TCHAR CKEY_REGKEYSUBSTR[] = _T("regKeySubstring");
  20. const TCHAR CKEY_REGKEYVERSION[] = _T("regKeyVersion");
  21. const TCHAR CKEY_FILEVERSION[] = _T("fileVersion");
  22. const TCHAR CKEY_FILEEXISTS[] = _T("fileExists");
  23. const TCHAR CKEY_AND[] = _T("and");
  24. const TCHAR CKEY_OR[] = _T("or");
  25. const TCHAR CKEY_NOT[] = _T("not");
  26. // ---------------------------------------------------------------------
  27. //
  28. // constructor
  29. //
  30. // ---------------------------------------------------------------------
  31. CSchemaKeys::CSchemaKeys()
  32. {
  33. //
  34. // create these BSTRs
  35. //
  36. SCHEMA_KEY_XML_NAMESPACE = SysAllocString(L"xmlns");
  37. SCHEMA_KEY_XML = SysAllocString(L"xml");
  38. SCHEMA_KEY_SYSTEMINFO = SysAllocString(L"systemInfo");
  39. SCHEMA_KEY_COMPUTERSYSTEM = SysAllocString(L"computerSystem");
  40. SCHEMA_KEY_MANUFACTURER = SysAllocString(L"manufacturer");
  41. SCHEMA_KEY_MODEL = SysAllocString(L"model");
  42. SCHEMA_KEY_SUPPORTSITE = SysAllocString(L"supportSite");
  43. SCHEMA_KEY_ADMINISTRATOR = SysAllocString(L"administrator");
  44. SCHEMA_KEY_WU_DISABLED = SysAllocString(L"windowsUpdateDisabled");
  45. SCHEMA_KEY_AU_ENABLED = SysAllocString(L"autoUpdateEnabled");
  46. SCHEMA_KEY_DRIVESPACE = SysAllocString(L"driveSpace");
  47. SCHEMA_KEY_DRIVE = SysAllocString(L"drive");
  48. SCHEMA_KEY_KBYTES = SysAllocString(L"kbytes");
  49. SCHEMA_KEY_REGKEYS = SysAllocString(L"regKeys");
  50. SCHEMA_KEY_REG_HKLM = SysAllocString(L"HKEY_LOCAL_MACHINE");
  51. SCHEMA_KEY_REG_SW = SysAllocString(L"SOFTWARE");
  52. SCHEMA_KEY_NAME = SysAllocString(L"name");
  53. SCHEMA_KEY_COMSERVER = SysAllocString(L"comserverID");
  54. SCHEMA_KEY_KEY = SysAllocString(L"key");
  55. SCHEMA_KEY_ENTRY = SysAllocString(L"entry");
  56. SCHEMA_KEY_VALUE = SysAllocString(L"value");
  57. SCHEMA_KEY_VERSION = SysAllocString(L"version");
  58. SCHEMA_KEY_VERSIONSTATUS = SysAllocString(L"versionStatus");
  59. SCHEMA_KEY_FILEPATH = SysAllocString(L"filePath");
  60. SCHEMA_KEY_TIMESTAMP = SysAllocString(L"timestamp");
  61. SCHEMA_KEY_GUID = SysAllocString(L"guid");
  62. SCHEMA_KEY_CATALOG_PROVIDER = SysAllocString(L"catalog/provider");
  63. SCHEMA_KEY_ITEMS = SysAllocString(L"items");
  64. SCHEMA_KEY_ITEM_SEARCH = SysAllocString(L"catalog/provider/item");
  65. SCHEMA_KEY_ITEM = SysAllocString(L"item");
  66. SCHEMA_KEY_ITEM_ITEMSTATUS = SysAllocString(L"items/itemStatus");
  67. SCHEMA_KEY_ITEMSTATUS = SysAllocString(L"itemStatus");
  68. SCHEMA_KEY_DETECTION = SysAllocString(L"detection");
  69. SCHEMA_KEY_INSTALLATION = SysAllocString(L"installation");
  70. SCHEMA_KEY_INSTALLSTATUS = SysAllocString(L"installStatus");
  71. SCHEMA_KEY_INSTALLERTYPE = SysAllocString(L"installerType");
  72. SCHEMA_KEY_EXCLUSIVE = SysAllocString(L"exclusive");
  73. SCHEMA_KEY_NEEDSREBOOT = SysAllocString(L"needsReboot");
  74. SCHEMA_KEY_COMMAND = SysAllocString(L"command");
  75. SCHEMA_KEY_SWITCHES = SysAllocString(L"switches");
  76. SCHEMA_KEY_COMMANDTYPE = SysAllocString(L"commandType");
  77. SCHEMA_KEY_INFINSTALL = SysAllocString(L"infInstallSection");
  78. SCHEMA_KEY_CODEBASE = SysAllocString(L"codeBase");
  79. SCHEMA_KEY_CRC = SysAllocString(L"crc");
  80. SCHEMA_KEY_PATCHAVAILABLE = SysAllocString(L"patchAvailable");
  81. SCHEMA_KEY_SIZE = SysAllocString(L"size");
  82. SCHEMA_KEY_DOWNLOADPATH = SysAllocString(L"downloadPath");
  83. SCHEMA_KEY_DOWNLOADSTATUS = SysAllocString(L"downloadStatus");
  84. SCHEMA_KEY_DEPENDENCIES = SysAllocString(L"dependencies");
  85. SCHEMA_KEY_DESCRIPTION = SysAllocString(L"description");
  86. SCHEMA_KEY_HREF = SysAllocString(L"href");
  87. SCHEMA_KEY_LANGUAGE = SysAllocString(L"language");
  88. SCHEMA_KEY_PLATFORM = SysAllocString(L"platform");
  89. SCHEMA_KEY_PROCESSORARCHITECTURE = SysAllocString(L"processorArchitecture");
  90. SCHEMA_KEY_SUITE = SysAllocString(L"suite");
  91. SCHEMA_KEY_PRODUCTTYPE = SysAllocString(L"productType");
  92. SCHEMA_KEY_LOCALE = SysAllocString(L"locale");
  93. SCHEMA_KEY_CONTEXT = SysAllocString(L"context");
  94. SCHEMA_KEY_MAJOR = SysAllocString(L"major");
  95. SCHEMA_KEY_MINOR = SysAllocString(L"minor");
  96. SCHEMA_KEY_BUILD = SysAllocString(L"build");
  97. SCHEMA_KEY_SERVICEPACKMAJOR = SysAllocString(L"servicePackMajor");
  98. SCHEMA_KEY_SERVICEPACKMINOR = SysAllocString(L"servicePackMinor");
  99. SCHEMA_KEY_COMPATIBLEHARDWARE = SysAllocString(L"compatibleHardware");
  100. SCHEMA_KEY_DEVICES = SysAllocString(L"devices");
  101. SCHEMA_KEY_DEVICE = SysAllocString(L"device");
  102. SCHEMA_KEY_PRINTERINFO = SysAllocString(L"printerInfo");
  103. SCHEMA_KEY_CDM_PINFO = SysAllocString(L"device/printerInfo");
  104. SCHEMA_KEY_DRIVERNAME = SysAllocString(L"driverName");
  105. SCHEMA_KEY_HWID = SysAllocString(L"hwid");
  106. SCHEMA_KEY_CDM_HWIDPATH = SysAllocString(L"device/hwid");
  107. SCHEMA_KEY_DESCRIPTIONTEXT = SysAllocString(L"descriptionText");
  108. SCHEMA_KEY_TITLE = SysAllocString(L"title");
  109. SCHEMA_KEY_ITEMID = SysAllocString(L"itemID");
  110. SCHEMA_KEY_HIDDEN = SysAllocString(L"hidden");
  111. SCHEMA_KEY_ISPRINTER = SysAllocString(L"isPrinter");
  112. SCHEMA_KEY_DEVICEINSTANCE = SysAllocString(L"deviceInstance");
  113. SCHEMA_KEY_DRIVERPROVIDER = SysAllocString(L"driverProvider");
  114. SCHEMA_KEY_MFGNAME = SysAllocString(L"mfgName");
  115. SCHEMA_KEY_DRIVERVER = SysAllocString(L"driverVer");
  116. SCHEMA_KEY_RANK = SysAllocString(L"rank");
  117. SCHEMA_KEY_READMORE = SysAllocString(L"description/descriptionText/details");
  118. SCHEMA_KEY_ERRORCODE = SysAllocString(L"errorCode");
  119. SCHEMA_KEY_CATALOGSTATUS = SysAllocString(L"catalogStatus");
  120. SCHEMA_KEY_PID = SysAllocString(L"pid");
  121. SCHEMA_KEY_DETECTRESULT = SysAllocString(L"detectResult");
  122. SCHEMA_KEY_INSTALLED = SysAllocString(L"installed");
  123. SCHEMA_KEY_UPTODATE = SysAllocString(L"upToDate");
  124. SCHEMA_KEY_NEWERVERSION = SysAllocString(L"newerVersion");
  125. SCHEMA_KEY_EXCLUDED = SysAllocString(L"excluded");
  126. SCHEMA_KEY_FORCE = SysAllocString(L"force");
  127. SCHEMA_KEY_VERSTATUS_HI = SysAllocString(L"HIGHER");
  128. SCHEMA_KEY_VERSTATUS_HE = SysAllocString(L"HIGHER_OR_SAME");
  129. SCHEMA_KEY_VERSTATUS_EQ = SysAllocString(L"SAME");
  130. SCHEMA_KEY_VERSTATUS_LE = SysAllocString(L"LOWER_OR_SAME");
  131. SCHEMA_KEY_VERSTATUS_LO = SysAllocString(L"LOWER");
  132. SCHEMA_KEY_IDENTITY = SysAllocString(L"identity");
  133. SCHEMA_KEY_PUBLISHERNAME = SysAllocString(L"publisherName");
  134. SCHEMA_KEY_FILE = SysAllocString(L"path");
  135. SCHEMA_KEY_REGKEY = SysAllocString(L"regKey");
  136. SCHEMA_KEY_PATH = SysAllocString(L"path");
  137. SCHEMA_KEY_STATUS_COMPLETE = SysAllocString(L"COMPLETE");
  138. SCHEMA_KEY_STATUS_FAILED = SysAllocString(L"FAILED");
  139. SCHEMA_KEY_CLIENT = SysAllocString(L"client");
  140. SCHEMA_KEY_CLIENTINFO = SysAllocString(L"clientInfo");
  141. SCHEMA_KEY_CLIENTNAME = SysAllocString(L"clientName");
  142. SCHEMA_KEY_REGKEYEXISTS = CKEY_REGKEYEXISTS ;
  143. SCHEMA_KEY_REGKEYVALUE = CKEY_REGKEYVALUE ;
  144. SCHEMA_KEY_REGKEYSUBSTR = CKEY_REGKEYSUBSTR ;
  145. SCHEMA_KEY_REGKEYVERSION = CKEY_REGKEYVERSION ;
  146. SCHEMA_KEY_FILEVERSION = CKEY_FILEVERSION ;
  147. SCHEMA_KEY_FILEEXISTS = CKEY_FILEEXISTS ;
  148. SCHEMA_KEY_AND = CKEY_AND ;
  149. SCHEMA_KEY_OR = CKEY_OR ;
  150. SCHEMA_KEY_NOT = CKEY_NOT ;
  151. }
  152. // ---------------------------------------------------------------------
  153. //
  154. // destructor
  155. //
  156. // ---------------------------------------------------------------------
  157. CSchemaKeys::~CSchemaKeys()
  158. {
  159. //
  160. // release BSTRs
  161. //
  162. SysFreeString(SCHEMA_KEY_XML_NAMESPACE);
  163. SysFreeString(SCHEMA_KEY_XML);
  164. SysFreeString(SCHEMA_KEY_SYSTEMINFO);
  165. SysFreeString(SCHEMA_KEY_COMPUTERSYSTEM);
  166. SysFreeString(SCHEMA_KEY_MANUFACTURER);
  167. SysFreeString(SCHEMA_KEY_MODEL);
  168. SysFreeString(SCHEMA_KEY_SUPPORTSITE);
  169. SysFreeString(SCHEMA_KEY_ADMINISTRATOR);
  170. SysFreeString(SCHEMA_KEY_WU_DISABLED);
  171. SysFreeString(SCHEMA_KEY_AU_ENABLED);
  172. SysFreeString(SCHEMA_KEY_DRIVESPACE);
  173. SysFreeString(SCHEMA_KEY_DRIVE);
  174. SysFreeString(SCHEMA_KEY_KBYTES);
  175. SysFreeString(SCHEMA_KEY_REGKEYS);
  176. SysFreeString(SCHEMA_KEY_REG_HKLM);
  177. SysFreeString(SCHEMA_KEY_REG_SW);
  178. SysFreeString(SCHEMA_KEY_NAME);
  179. SysFreeString(SCHEMA_KEY_COMSERVER);
  180. SysFreeString(SCHEMA_KEY_KEY);
  181. SysFreeString(SCHEMA_KEY_ENTRY);
  182. SysFreeString(SCHEMA_KEY_VALUE);
  183. SysFreeString(SCHEMA_KEY_VERSION);
  184. SysFreeString(SCHEMA_KEY_VERSIONSTATUS);
  185. SysFreeString(SCHEMA_KEY_FILEPATH);
  186. SysFreeString(SCHEMA_KEY_TIMESTAMP);
  187. SysFreeString(SCHEMA_KEY_GUID);
  188. SysFreeString(SCHEMA_KEY_CATALOG_PROVIDER);
  189. SysFreeString(SCHEMA_KEY_ITEMS);
  190. SysFreeString(SCHEMA_KEY_ITEM_SEARCH);
  191. SysFreeString(SCHEMA_KEY_ITEM);
  192. SysFreeString(SCHEMA_KEY_ITEM_ITEMSTATUS);
  193. SysFreeString(SCHEMA_KEY_ITEMSTATUS);
  194. SysFreeString(SCHEMA_KEY_DETECTION);
  195. SysFreeString(SCHEMA_KEY_INSTALLATION);
  196. SysFreeString(SCHEMA_KEY_INSTALLSTATUS);
  197. SysFreeString(SCHEMA_KEY_INSTALLERTYPE);
  198. SysFreeString(SCHEMA_KEY_EXCLUSIVE);
  199. SysFreeString(SCHEMA_KEY_NEEDSREBOOT);
  200. SysFreeString(SCHEMA_KEY_COMMAND);
  201. SysFreeString(SCHEMA_KEY_SWITCHES);
  202. SysFreeString(SCHEMA_KEY_COMMANDTYPE);
  203. SysFreeString(SCHEMA_KEY_INFINSTALL);
  204. SysFreeString(SCHEMA_KEY_CODEBASE);
  205. SysFreeString(SCHEMA_KEY_CRC);
  206. SysFreeString(SCHEMA_KEY_PATCHAVAILABLE);
  207. SysFreeString(SCHEMA_KEY_SIZE);
  208. SysFreeString(SCHEMA_KEY_DOWNLOADPATH);
  209. SysFreeString(SCHEMA_KEY_DOWNLOADSTATUS);
  210. SysFreeString(SCHEMA_KEY_DEPENDENCIES);
  211. SysFreeString(SCHEMA_KEY_DESCRIPTION);
  212. SysFreeString(SCHEMA_KEY_HREF);
  213. SysFreeString(SCHEMA_KEY_LANGUAGE);
  214. SysFreeString(SCHEMA_KEY_PLATFORM);
  215. SysFreeString(SCHEMA_KEY_PROCESSORARCHITECTURE);
  216. SysFreeString(SCHEMA_KEY_SUITE);
  217. SysFreeString(SCHEMA_KEY_PRODUCTTYPE);
  218. SysFreeString(SCHEMA_KEY_LOCALE);
  219. SysFreeString(SCHEMA_KEY_CONTEXT);
  220. SysFreeString(SCHEMA_KEY_MAJOR);
  221. SysFreeString(SCHEMA_KEY_MINOR);
  222. SysFreeString(SCHEMA_KEY_BUILD);
  223. SysFreeString(SCHEMA_KEY_SERVICEPACKMAJOR);
  224. SysFreeString(SCHEMA_KEY_SERVICEPACKMINOR);
  225. SysFreeString(SCHEMA_KEY_COMPATIBLEHARDWARE);
  226. SysFreeString(SCHEMA_KEY_DEVICES);
  227. SysFreeString(SCHEMA_KEY_DEVICE);
  228. SysFreeString(SCHEMA_KEY_PRINTERINFO);
  229. SysFreeString(SCHEMA_KEY_CDM_PINFO);
  230. SysFreeString(SCHEMA_KEY_DRIVERNAME);
  231. SysFreeString(SCHEMA_KEY_HWID);
  232. SysFreeString(SCHEMA_KEY_CDM_HWIDPATH);
  233. SysFreeString(SCHEMA_KEY_DESCRIPTIONTEXT);
  234. SysFreeString(SCHEMA_KEY_TITLE);
  235. SysFreeString(SCHEMA_KEY_ITEMID);
  236. SysFreeString(SCHEMA_KEY_HIDDEN);
  237. SysFreeString(SCHEMA_KEY_ISPRINTER);
  238. SysFreeString(SCHEMA_KEY_DEVICEINSTANCE);
  239. SysFreeString(SCHEMA_KEY_DRIVERPROVIDER);
  240. SysFreeString(SCHEMA_KEY_MFGNAME);
  241. SysFreeString(SCHEMA_KEY_DRIVERVER);
  242. SysFreeString(SCHEMA_KEY_RANK);
  243. SysFreeString(SCHEMA_KEY_READMORE);
  244. SysFreeString(SCHEMA_KEY_ERRORCODE);
  245. SysFreeString(SCHEMA_KEY_CATALOGSTATUS);
  246. SysFreeString(SCHEMA_KEY_PID);
  247. SysFreeString(SCHEMA_KEY_DETECTRESULT);
  248. SysFreeString(SCHEMA_KEY_INSTALLED);
  249. SysFreeString(SCHEMA_KEY_UPTODATE);
  250. SysFreeString(SCHEMA_KEY_NEWERVERSION);
  251. SysFreeString(SCHEMA_KEY_EXCLUDED);
  252. SysFreeString(SCHEMA_KEY_FORCE);
  253. SysFreeString(SCHEMA_KEY_VERSTATUS_HI);
  254. SysFreeString(SCHEMA_KEY_VERSTATUS_HE);
  255. SysFreeString(SCHEMA_KEY_VERSTATUS_EQ);
  256. SysFreeString(SCHEMA_KEY_VERSTATUS_LE);
  257. SysFreeString(SCHEMA_KEY_VERSTATUS_LO);
  258. SysFreeString(SCHEMA_KEY_CLIENT);
  259. SysFreeString(SCHEMA_KEY_CLIENTINFO);
  260. SysFreeString(SCHEMA_KEY_CLIENTNAME);
  261. SysFreeString(SCHEMA_KEY_IDENTITY);
  262. SysFreeString(SCHEMA_KEY_PUBLISHERNAME);
  263. SysFreeString(SCHEMA_KEY_FILE);
  264. SysFreeString(SCHEMA_KEY_REGKEY);
  265. SysFreeString(SCHEMA_KEY_PATH);
  266. SysFreeString(SCHEMA_KEY_STATUS_COMPLETE);
  267. SysFreeString(SCHEMA_KEY_STATUS_FAILED);
  268. }