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.

315 lines
7.7 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1997
  5. //
  6. // File: cclstor.hxx
  7. //
  8. // Contents: Definition for Class factory and IUnknown methods
  9. // for CClassContainer
  10. //
  11. // Author: DebiM
  12. //
  13. //-------------------------------------------------------------------------
  14. class CClassContainerCF : public IClassFactory, public IParseDisplayName
  15. {
  16. public:
  17. CClassContainerCF();
  18. ~CClassContainerCF();
  19. virtual HRESULT __stdcall QueryInterface(
  20. REFIID riid,
  21. void ** ppvObject);
  22. virtual ULONG __stdcall AddRef();
  23. virtual ULONG __stdcall Release();
  24. virtual HRESULT __stdcall CreateInstance(
  25. IUnknown * pUnkOuter,
  26. REFIID riid,
  27. void ** ppvObject);
  28. virtual HRESULT __stdcall LockServer(
  29. BOOL fLock);
  30. HRESULT __stdcall ParseDisplayName(
  31. IBindCtx * pbc,
  32. LPOLESTR pszDisplayName,
  33. ULONG * pchEaten,
  34. IMoniker ** ppmkOut);
  35. HRESULT __stdcall CreateConnectedInstance(
  36. LPOLESTR pszPath,
  37. void ** ppvObject);
  38. protected:
  39. unsigned long m_uRefs;
  40. };
  41. //
  42. // ClassContainer class.
  43. //
  44. class CClassContainer :
  45. public IClassAdmin,
  46. public ICatRegister,
  47. public ICatInformation
  48. {
  49. private:
  50. WCHAR m_szContainerName[_MAX_PATH];
  51. WCHAR * m_szClassName;
  52. WCHAR * m_szPackageName;
  53. WCHAR * m_szCategoryName;
  54. BOOL m_fOpen;
  55. HANDLE m_ADsContainer;
  56. HANDLE m_ADsClassContainer;
  57. HANDLE m_ADsPackageContainer;
  58. HANDLE m_ADsCategoryContainer;
  59. WCHAR * m_szPolicyName;
  60. GUID m_PolicyId;
  61. public:
  62. CClassContainer();
  63. CClassContainer(LPOLESTR pszPath, HRESULT *phr);
  64. ~CClassContainer(void);
  65. //
  66. // IUnknown
  67. //
  68. HRESULT __stdcall QueryInterface(
  69. REFIID iid,
  70. void ** ppv );
  71. ULONG __stdcall AddRef();
  72. ULONG __stdcall Release();
  73. //
  74. // IClassAdmin Methods
  75. //
  76. HRESULT __stdcall GetGPOInfo(
  77. GUID *GPOId,
  78. LPOLESTR *pszPolicyName
  79. );
  80. HRESULT __stdcall AddPackage(
  81. PACKAGEDETAIL *pPackageDetail,
  82. GUID *PkgGuid
  83. );
  84. HRESULT __stdcall RemovePackage(
  85. LPOLESTR pszPackageName,
  86. DWORD dwFlags
  87. );
  88. HRESULT __stdcall SetPriorityByFileExt(
  89. LPOLESTR pszPackageName,
  90. LPOLESTR pszFileExt,
  91. UINT Priority
  92. );
  93. HRESULT __stdcall ChangePackageUpgradeInfoIncremental(
  94. GUID PkgGuid,
  95. UPGRADEINFO UpgradeInfo,
  96. DWORD OpFlags
  97. );
  98. HRESULT __stdcall ChangePackageProperties(
  99. LPOLESTR pszPackageName,
  100. LPOLESTR pszNewName,
  101. DWORD *pdwFlags,
  102. LPOLESTR pszUrl,
  103. LPOLESTR pszScriptPath,
  104. UINT *pInstallUiLevel,
  105. DWORD *pdwRevision
  106. );
  107. HRESULT __stdcall ChangePackageCategories(
  108. LPOLESTR pszPackageName,
  109. UINT cCategories,
  110. GUID *rpCategory
  111. );
  112. HRESULT __stdcall ChangePackageSourceList(
  113. LPOLESTR pszPackageName,
  114. UINT cSources,
  115. LPOLESTR *pszSourceList
  116. );
  117. HRESULT __stdcall ChangePackageUpgradeList(
  118. LPOLESTR pszPackageName,
  119. UINT cUpgrades,
  120. UPGRADEINFO *prgUpgradeInfoList
  121. );
  122. HRESULT __stdcall EnumPackages(
  123. LPOLESTR pszFileExt,
  124. GUID *pCategory,
  125. DWORD dwAppFlags,
  126. DWORD *pdwUserLangId,
  127. CSPLATFORM *pPlatform,
  128. IEnumPackage **ppIEnumPackage
  129. );
  130. HRESULT __stdcall GetPackageDetails (
  131. LPOLESTR pszPackageName,
  132. PACKAGEDETAIL *pPackageDetail
  133. );
  134. HRESULT __stdcall GetPackageDetailsFromGuid (
  135. GUID PkgGuid,
  136. PACKAGEDETAIL *pPackageDetail
  137. );
  138. HRESULT __stdcall GetAppCategories (
  139. LCID Locale,
  140. APPCATEGORYINFOLIST *pAppCategoryList
  141. );
  142. HRESULT __stdcall RegisterAppCategory (
  143. APPCATEGORYINFO *pAppCategory
  144. );
  145. HRESULT __stdcall UnregisterAppCategory (
  146. GUID *pAppCategoryId
  147. );
  148. HRESULT __stdcall Cleanup (
  149. FILETIME *pTimeBefore
  150. );
  151. HRESULT __stdcall GetDNFromPackageName (LPOLESTR pszPackageName, LPOLESTR *szDN);
  152. // helper functions.
  153. HRESULT __stdcall DeleteClass (
  154. LPOLESTR szClsid
  155. );
  156. HRESULT __stdcall NewClass (
  157. CLASSDETAIL *pClassDetail
  158. );
  159. //
  160. // ICatRegister
  161. //
  162. HRESULT __stdcall RegisterCategories(
  163. ULONG cCategories,
  164. CATEGORYINFO rgCategoryInfo[ ]);
  165. HRESULT __stdcall UnRegisterCategories(
  166. ULONG cCategories,
  167. CATID rgcatid[ ]);
  168. HRESULT __stdcall RegisterClassImplCategories(
  169. REFCLSID rclsid,
  170. ULONG cCategories,
  171. CATID rgcatid[ ]);
  172. HRESULT __stdcall UnRegisterClassImplCategories(
  173. REFCLSID rclsid,
  174. ULONG cCategories,
  175. CATID rgcatid[ ]);
  176. HRESULT __stdcall RegisterClassReqCategories(
  177. REFCLSID rclsid,
  178. ULONG cCategories,
  179. CATID rgcatid[ ]);
  180. HRESULT __stdcall UnRegisterClassReqCategories(
  181. REFCLSID rclsid,
  182. ULONG cCategories,
  183. CATID rgcatid[ ]);
  184. //
  185. // utility functions
  186. //
  187. HRESULT __stdcall RegisterClassXXXCategories(
  188. REFCLSID rclsid,
  189. ULONG cCategories,
  190. CATID rgcatid[ ],
  191. BSTR impl_or_req);
  192. HRESULT __stdcall UnRegisterClassXXXCategories(
  193. REFCLSID rclsid,
  194. ULONG cCategories,
  195. CATID rgcatid[ ],
  196. BSTR impl_or_req);
  197. // this is the largely hidden interface which does the
  198. // actual work.
  199. //
  200. // ICatInformation
  201. //
  202. HRESULT __stdcall EnumCategories(
  203. LCID lcid,
  204. IEnumCATEGORYINFO * *ppenumCategoryInfo);
  205. HRESULT __stdcall GetCategoryDesc(
  206. REFCATID rcatid,
  207. LCID lcid,
  208. LPWSTR *pszDesc);
  209. HRESULT __stdcall EnumClassesOfCategories(
  210. ULONG cImplemented,
  211. CATID rgcatidImpl[ ],
  212. ULONG cRequired,
  213. CATID rgcatidReq[ ],
  214. IEnumGUID * *ppenumClsid);
  215. HRESULT __stdcall IsClassOfCategories(
  216. REFCLSID rclsid,
  217. ULONG cImplemented,
  218. CATID rgcatidImpl[ ],
  219. ULONG cRequired,
  220. CATID rgcatidReq[ ]);
  221. HRESULT __stdcall EnumImplCategoriesOfClass(
  222. REFCLSID rclsid,
  223. IEnumGUID * *ppenumCatid);
  224. HRESULT __stdcall EnumReqCategoriesOfClass(
  225. REFCLSID rclsid,
  226. IEnumGUID * *ppenumCatid);
  227. //
  228. // Utility functions
  229. //
  230. HRESULT BuildDNFromPackageGuid(GUID PackageGuid, LPOLESTR *szDN);
  231. HRESULT GetPackageGuid(WCHAR *szRDN, GUID *pPackageGuid);
  232. HRESULT EnumCategoriesOfClass(
  233. REFCLSID rclsid,
  234. BSTR impl_or_req,
  235. IEnumGUID **ppenumCatid);
  236. HRESULT MarkPackageUpgradeBy(
  237. LPOLESTR szClassStore,
  238. GUID PackageGuid,
  239. GUID UpgradedByPackageGuid,
  240. DWORD Flags,
  241. DWORD Add
  242. );
  243. HRESULT __stdcall DeletePackage (
  244. LPOLESTR szRDN
  245. );
  246. //----------------------------------------------------------------------
  247. protected:
  248. unsigned long m_uRefs;
  249. };