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.

258 lines
7.4 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 [_MAX_PATH];
  52. WCHAR m_szPackageName [_MAX_PATH];
  53. WCHAR m_szCategoryName [_MAX_PATH];
  54. BOOL m_fOpen;
  55. IADsContainer * m_ADsContainer;
  56. IADs * m_pADsClassStore;
  57. IADsContainer * m_ADsClassContainer;
  58. IADsContainer * m_ADsPackageContainer;
  59. IADsContainer * m_ADsCategoryContainer;
  60. IDBCreateCommand * m_pIDBCreateCommand;
  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 AddPackage(
  77. LPOLESTR pszPackageName,
  78. PACKAGEDETAIL *pPackageDetail
  79. );
  80. HRESULT __stdcall RemovePackage(
  81. LPOLESTR pszPackageName
  82. );
  83. HRESULT __stdcall SetPriorityByFileExt(
  84. LPOLESTR pszPackageName,
  85. LPOLESTR pszFileExt,
  86. UINT Priority
  87. );
  88. HRESULT __stdcall ChangePackageProperties(
  89. LPOLESTR pszPackageName,
  90. LPOLESTR pszNewName,
  91. DWORD *pdwFlags,
  92. LPOLESTR pszUrl,
  93. LPOLESTR pszScriptPath,
  94. DWORD *pInstallUiLevel
  95. );
  96. HRESULT __stdcall ChangePackageCategories(
  97. LPOLESTR szPackageName,
  98. UINT cCategories,
  99. GUID *rpCategory
  100. );
  101. HRESULT __stdcall EnumPackages(
  102. LPOLESTR pszFileExt,
  103. GUID *pCategory,
  104. DWORD dwAppFlags,
  105. DWORD *pdwLocale,
  106. CSPLATFORM *pPlatform,
  107. IEnumPackage **ppIEnumPackage
  108. );
  109. HRESULT __stdcall GetPackageDetails (
  110. LPOLESTR pszPackageName,
  111. PACKAGEDETAIL *pPackageDetail
  112. );
  113. HRESULT __stdcall GetAppCategories (
  114. LCID Locale,
  115. APPCATEGORYINFOLIST *pAppCategoryList
  116. );
  117. HRESULT __stdcall RegisterAppCategory (
  118. APPCATEGORYINFO *pAppCategory
  119. );
  120. HRESULT __stdcall UnregisterAppCategory (
  121. GUID *pAppCategoryId
  122. );
  123. // helper functions.
  124. HRESULT __stdcall DeleteClass (
  125. LPOLESTR szClsid
  126. );
  127. HRESULT __stdcall NewClass (
  128. CLASSDETAIL *pClassDetail
  129. );
  130. //
  131. // ICatRegister
  132. //
  133. HRESULT __stdcall RegisterCategories(
  134. ULONG cCategories,
  135. CATEGORYINFO __RPC_FAR rgCategoryInfo[ ]);
  136. HRESULT __stdcall UnRegisterCategories(
  137. ULONG cCategories,
  138. CATID __RPC_FAR rgcatid[ ]);
  139. HRESULT __stdcall RegisterClassImplCategories(
  140. REFCLSID rclsid,
  141. ULONG cCategories,
  142. CATID __RPC_FAR rgcatid[ ]);
  143. HRESULT __stdcall UnRegisterClassImplCategories(
  144. REFCLSID rclsid,
  145. ULONG cCategories,
  146. CATID __RPC_FAR rgcatid[ ]);
  147. HRESULT __stdcall RegisterClassReqCategories(
  148. REFCLSID rclsid,
  149. ULONG cCategories,
  150. CATID __RPC_FAR rgcatid[ ]);
  151. HRESULT __stdcall UnRegisterClassReqCategories(
  152. REFCLSID rclsid,
  153. ULONG cCategories,
  154. CATID __RPC_FAR rgcatid[ ]);
  155. //
  156. // utility functions
  157. //
  158. HRESULT __stdcall RegisterClassXXXCategories(
  159. REFCLSID rclsid,
  160. ULONG cCategories,
  161. CATID __RPC_FAR rgcatid[ ],
  162. BSTR impl_or_req);
  163. HRESULT __stdcall UnRegisterClassXXXCategories(
  164. REFCLSID rclsid,
  165. ULONG cCategories,
  166. CATID __RPC_FAR rgcatid[ ],
  167. BSTR impl_or_req);
  168. // this is the largely hidden interface which does the
  169. // actual work.
  170. //
  171. // ICatInformation
  172. //
  173. HRESULT __stdcall EnumCategories(
  174. LCID lcid,
  175. IEnumCATEGORYINFO __RPC_FAR *__RPC_FAR *ppenumCategoryInfo);
  176. HRESULT __stdcall GetCategoryDesc(
  177. REFCATID rcatid,
  178. LCID lcid,
  179. LPWSTR __RPC_FAR *pszDesc);
  180. HRESULT __stdcall EnumClassesOfCategories(
  181. ULONG cImplemented,
  182. CATID __RPC_FAR rgcatidImpl[ ],
  183. ULONG cRequired,
  184. CATID __RPC_FAR rgcatidReq[ ],
  185. IEnumGUID __RPC_FAR *__RPC_FAR *ppenumClsid);
  186. HRESULT __stdcall IsClassOfCategories(
  187. REFCLSID rclsid,
  188. ULONG cImplemented,
  189. CATID __RPC_FAR rgcatidImpl[ ],
  190. ULONG cRequired,
  191. CATID __RPC_FAR rgcatidReq[ ]);
  192. HRESULT __stdcall EnumImplCategoriesOfClass(
  193. REFCLSID rclsid,
  194. IEnumGUID __RPC_FAR *__RPC_FAR *ppenumCatid);
  195. HRESULT __stdcall EnumReqCategoriesOfClass(
  196. REFCLSID rclsid,
  197. IEnumGUID __RPC_FAR *__RPC_FAR *ppenumCatid);
  198. //
  199. // Utility functions
  200. //
  201. HRESULT EnumCategoriesOfClass(
  202. REFCLSID rclsid,
  203. BSTR impl_or_req,
  204. IEnumGUID **ppenumCatid);
  205. //----------------------------------------------------------------------
  206. protected:
  207. unsigned long m_uRefs;
  208. };
  209.