Leaked source code of windows server 2003
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.

247 lines
6.0 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1997
  5. //
  6. // File: admin.hxx
  7. //
  8. // Contents: Definition for Class factory and IUnknown methods
  9. // for CClassContainer
  10. //
  11. // Author: DebiM
  12. //
  13. //-------------------------------------------------------------------------
  14. #define SEARCHFLAG_PUBLISHED L'P'
  15. #define SEARCHFLAG_ASSIGNED L'A'
  16. #define SEARCHFLAG_REMOVED L'R'
  17. #define MAX_SEARCH_FLAGS 3
  18. HRESULT GetConsistentPackageFlags(
  19. HANDLE hADs,
  20. DWORD* pdwPackageFlags,
  21. UINT* pdwUpgrades,
  22. UINT* pdwInstallUiLevel,
  23. CLASSPATHTYPE* pdwPathType,
  24. DWORD* pdwNewPackageFlags);
  25. typedef struct tagCLASSCONTAINER
  26. {
  27. LPOLESTR pszClassStorePath;
  28. CServerContext ServerContext;
  29. } CLASSCONTAINER, *PCLASSCONTAINER;
  30. class CClassContainerCF : public IClassFactory
  31. {
  32. public:
  33. CClassContainerCF();
  34. ~CClassContainerCF();
  35. virtual HRESULT __stdcall QueryInterface(
  36. REFIID riid,
  37. void ** ppvObject);
  38. virtual ULONG __stdcall AddRef();
  39. virtual ULONG __stdcall Release();
  40. virtual HRESULT __stdcall CreateInstance(
  41. IUnknown * pUnkOuter,
  42. REFIID riid,
  43. void ** ppvObject);
  44. virtual HRESULT __stdcall LockServer(
  45. BOOL fLock);
  46. HRESULT __stdcall CreateConnectedInstance(
  47. CServerContext* pServerContext,
  48. LPOLESTR pszPath,
  49. void ** ppvObject);
  50. protected:
  51. unsigned long m_uRefs;
  52. };
  53. //
  54. // ClassContainer class.
  55. //
  56. class CClassContainer :
  57. public IClassAdmin
  58. {
  59. private:
  60. HRESULT GetGPOName( WCHAR** ppszPolicyName );
  61. WCHAR m_szContainerName[_MAX_PATH];
  62. WCHAR * m_szPackageName;
  63. WCHAR * m_szCategoryName;
  64. BOOL m_fOpen;
  65. HANDLE m_ADsContainer;
  66. HANDLE m_ADsPackageContainer;
  67. WCHAR * m_szPolicyName;
  68. GUID m_PolicyId;
  69. CServerContext m_ServerContext;
  70. public:
  71. CClassContainer();
  72. CClassContainer( CServerContext* pServerContext, LPOLESTR pszPath, HRESULT *phr);
  73. ~CClassContainer(void);
  74. //
  75. // IUnknown
  76. //
  77. HRESULT __stdcall QueryInterface(
  78. REFIID iid,
  79. void ** ppv );
  80. ULONG __stdcall AddRef();
  81. ULONG __stdcall Release();
  82. //
  83. // IClassAdmin Methods
  84. //
  85. HRESULT __stdcall GetGPOInfo(
  86. GUID *GPOId,
  87. LPOLESTR *pszPolicyName
  88. );
  89. HRESULT __stdcall AddPackage(
  90. PACKAGEDETAIL *pPackageDetail,
  91. GUID *PkgGuid
  92. );
  93. HRESULT __stdcall RemovePackage(
  94. LPOLESTR pszPackageName,
  95. DWORD dwFlags
  96. );
  97. HRESULT __stdcall SetPriorityByFileExt(
  98. LPOLESTR pszPackageName,
  99. LPOLESTR pszFileExt,
  100. UINT Priority
  101. );
  102. HRESULT __stdcall ChangePackageUpgradeInfoIncremental(
  103. GUID PkgGuid,
  104. UPGRADEINFO UpgradeInfo,
  105. DWORD OpFlags
  106. );
  107. HRESULT __stdcall ChangePackageProperties(
  108. LPOLESTR pszPackageName,
  109. LPOLESTR pszNewName,
  110. DWORD *pdwFlags,
  111. LPOLESTR pszUrl,
  112. LPOLESTR pszScriptPath,
  113. UINT *pInstallUiLevel,
  114. DWORD *pdwRevision
  115. );
  116. HRESULT __stdcall ChangePackageCategories(
  117. LPOLESTR pszPackageName,
  118. UINT cCategories,
  119. GUID *rpCategory
  120. );
  121. HRESULT __stdcall ChangePackageSourceList(
  122. LPOLESTR pszPackageName,
  123. UINT cSources,
  124. LPOLESTR *pszSourceList
  125. );
  126. HRESULT __stdcall ChangePackageUpgradeList(
  127. LPOLESTR pszPackageName,
  128. UINT cUpgrades,
  129. UPGRADEINFO *prgUpgradeInfoList
  130. );
  131. HRESULT __stdcall EnumPackages(
  132. LPOLESTR pszFileExt,
  133. GUID *pCategory,
  134. DWORD dwAppFlags,
  135. DWORD *pdwUserLangId,
  136. CSPLATFORM *pPlatform,
  137. IEnumPackage **ppIEnumPackage
  138. );
  139. HRESULT __stdcall GetPackageDetails (
  140. LPOLESTR pszPackageName,
  141. PACKAGEDETAIL *pPackageDetail
  142. );
  143. HRESULT __stdcall GetPackageDetailsFromGuid (
  144. GUID PkgGuid,
  145. PACKAGEDETAIL *pPackageDetail
  146. );
  147. HRESULT __stdcall GetAppCategories (
  148. LCID Locale,
  149. APPCATEGORYINFOLIST *pAppCategoryList
  150. );
  151. HRESULT __stdcall RegisterAppCategory (
  152. APPCATEGORYINFO *pAppCategory
  153. );
  154. HRESULT __stdcall UnregisterAppCategory (
  155. GUID *pAppCategoryId
  156. );
  157. HRESULT __stdcall Cleanup (
  158. FILETIME *pTimeBefore
  159. );
  160. HRESULT __stdcall GetDNFromPackageName (LPOLESTR pszPackageName, LPOLESTR *szDN);
  161. HRESULT __stdcall RedeployPackage(
  162. GUID* pPackageGuid,
  163. PACKAGEDETAIL *pPackageDetail
  164. );
  165. //
  166. // Utility functions
  167. //
  168. HRESULT BuildDNFromPackageGuid(GUID PackageGuid, LPOLESTR *szDN);
  169. HRESULT GetPackageGuid(WCHAR *szRDN, GUID *pPackageGuid);
  170. HRESULT MarkPackageUpgradeBy(
  171. LPOLESTR szClassStore,
  172. GUID PackageGuid,
  173. GUID UpgradedByPackageGuid,
  174. DWORD Flags,
  175. DWORD Add
  176. );
  177. HRESULT __stdcall DeletePackage (
  178. LPOLESTR szRDN
  179. );
  180. //----------------------------------------------------------------------
  181. protected:
  182. HRESULT __stdcall DeployPackage(
  183. HANDLE hExistingPackage,
  184. PACKAGEDETAIL *pPackageDetail,
  185. GUID *PkgGuid
  186. );
  187. unsigned long m_uRefs;
  188. };