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.

488 lines
15 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation 1998.
  5. //
  6. // cs.idl
  7. //
  8. // Methods for the class store
  9. //
  10. //--------------------------------------------------------------------------
  11. import "unknwn.idl";
  12. import "wtypes.idl";
  13. import "appmgmt.h";
  14. //
  15. // Package Information consists of one or more
  16. // PACKAGEDETAIL - Info about an implemetation code package
  17. //
  18. //
  19. // Package Flag Values returned in PACKAGEDETAIL
  20. //
  21. // Please note that the ACTFLG_ExcludeX86OnWin64 flag's value is not arbitrary. This value was
  22. // chosen for NT 5.1 because NT 5.0 preserves this value in class store operations. In NT 5.0,
  23. // this value was assigned to ACTFLG_X86OnAlpha. Since alpha support was removed later on in
  24. // NT 5.0, this flag has no meaning for NT 5.0. We want to re-use it though since if we used
  25. // some value that NT 5.0 didn't use, NT 5.0 class store tools called by admin components
  26. // would not preserve the value (they would reset it). Using a value that NT 5.0 thinks it owns
  27. // means that it will be preserved even when NT 5.0 tools are used to manage NT 5.1 deployments
  28. // with this flag set.
  29. //
  30. // special activation flags
  31. // const DWORD UNUSED = 0x1;
  32. // const DWORD UNUSED = 0x2;
  33. const DWORD ACTFLG_UninstallUnmanaged = 0x4; // no longer used by clients as of xpsp1, still set by the ui to clear flags for backwards compat reasons -- uninstall unmanaged version before assigning
  34. const DWORD ACTFLG_Published = 0x8; // this is a Published app
  35. const DWORD ACTFLG_POSTBETA3 = 0x10; // this package was deployed after Beta 3 of Win2k
  36. const DWORD ACTFLG_UserInstall = 0x20; // this app may be installed via Add/Remove programs
  37. const DWORD ACTFLG_OnDemandInstall = 0x40; // this app may be auto installed OnDemand
  38. const DWORD ACTFLG_Orphan = 0x80; // this app is Orphaned
  39. const DWORD ACTFLG_Uninstall = 0x100; // this app is to be treated as Uninstalled
  40. const DWORD ACTFLG_Pilot = 0x200; // this app is available as a Pilot Only.
  41. const DWORD ACTFLG_Assigned = 0x400; // this is an Assigned app
  42. const DWORD ACTFLG_OrphanOnPolicyRemoval = 0x800; // Orphaned when Policy is Removed
  43. const DWORD ACTFLG_UninstallOnPolicyRemoval = 0x1000; // Uninstall when Policy is Removed
  44. const DWORD ACTFLG_InstallUserAssign = 0x2000; // do full install for user assigned app
  45. const DWORD ACTFLG_ForceUpgrade = 0x4000; // require older versions to be upgraded to this version
  46. const DWORD ACTFLG_MinimalInstallUI = 0x8000; // this package only supports minimal UI
  47. const DWORD ACTFLG_ExcludeX86OnWin64 = 0x10000; // this is an x86 package that should not be executed on Win64
  48. const DWORD ACTFLG_IgnoreLanguage = 0x20000; // this package is suitable for any language
  49. const DWORD ACTFLG_HasUpgrades = 0x40000; // this package has upgrades
  50. const DWORD ACTFLG_FullInstallUI = 0x80000; // this package has full install ui instead of basic
  51. const DWORD ACTFLG_PreserveClasses = 0x100000; // preserves classes during a redeploy operation during a redeploy in a domain rename
  52. //
  53. // APPQUERY flags
  54. //
  55. const DWORD APPQUERY_ALL = 1; // retrieves every app object in the class store
  56. const DWORD APPQUERY_ADMINISTRATIVE = 2; // retrieves apps suitable for administration
  57. const DWORD APPQUERY_POLICY = 3; // retrieves apps suitable for policy
  58. const DWORD APPQUERY_USERDISPLAY = 4; // retrieves apps suitable for display to the user
  59. const DWORD APPQUERY_RSOP_LOGGING = 5; // retrieves apps to be logged by RSOP
  60. const DWORD APPQUERY_RSOP_ARP = 6; // retrieves apps to be logged by RSOP
  61. // upgrade type flags
  62. const DWORD UPGFLG_Uninstall = 0x1; // The app upgrades this script and requires an Uninstall
  63. const DWORD UPGFLG_NoUninstall = 0x2; // The app upgrades this script and does not require an Uninstall
  64. const DWORD UPGFLG_UpgradedBy = 0x4; // This is an UpgradedBy relationship. The application is upgraded
  65. const DWORD UPGFLG_Enforced = 0x8; // autodetected upgrades.
  66. // types of package formats
  67. typedef [v1_enum] enum _CLASSPATHTYPE {
  68. ExeNamePath,
  69. DllNamePath,
  70. TlbNamePath,
  71. CabFilePath,
  72. InfFilePath,
  73. DrwFilePath,
  74. SetupNamePath
  75. } CLASSPATHTYPE;
  76. typedef struct tagUPGRADEINFO {
  77. LPOLESTR szClassStore;
  78. GUID PackageGuid;
  79. GUID GpoId;
  80. DWORD Flag;
  81. } UPGRADEINFO;
  82. const DWORD CLSCTX64_INPROC_SERVER = 0x10000000;
  83. const DWORD CLSCTX64_INPROC_HANDLER = 0x20000000;
  84. typedef struct tagCLASSDETAIL {
  85. CLSID Clsid;
  86. CLSID TreatAs;
  87. DWORD dwComClassContext;
  88. DWORD cProgId;
  89. DWORD cMaxProgId;
  90. [size_is(cProgId)] LPOLESTR *prgProgId;
  91. } CLASSDETAIL;
  92. //
  93. // PACKAGEDETAIL structure
  94. //
  95. typedef struct tagACTVATIONINFO
  96. {
  97. UINT cClasses;
  98. [size_is(cClasses)] CLASSDETAIL *pClasses;
  99. UINT cShellFileExt;
  100. [size_is(cShellFileExt)] LPOLESTR *prgShellFileExt;
  101. [size_is(cShellFileExt)] UINT *prgPriority;
  102. UINT cInterfaces;
  103. [size_is(cInterfaces)] IID *prgInterfaceId;
  104. UINT cTypeLib;
  105. [size_is(cTypeLib)] GUID *prgTlbId;
  106. BOOL bHasClasses;
  107. } ACTIVATIONINFO;
  108. typedef struct tagINSTALLINFO
  109. {
  110. DWORD dwActFlags;
  111. CLASSPATHTYPE PathType;
  112. LPOLESTR pszScriptPath;
  113. LPOLESTR pszSetupCommand;
  114. LPOLESTR pszUrl;
  115. ULONGLONG Usn;
  116. UINT InstallUiLevel;
  117. GUID *pClsid;
  118. GUID ProductCode;
  119. GUID PackageGuid;
  120. GUID Mvipc;
  121. DWORD dwVersionHi;
  122. DWORD dwVersionLo;
  123. DWORD dwRevision;
  124. UINT cUpgrades;
  125. [size_is(cUpgrades)] UPGRADEINFO *prgUpgradeInfoList;
  126. ULONG cScriptLen;
  127. } INSTALLINFO;
  128. typedef struct tagPLATFORMINFO
  129. {
  130. UINT cPlatforms;
  131. [size_is(cPlatforms)] CSPLATFORM *prgPlatform;
  132. UINT cLocales;
  133. [size_is(cLocales)] LCID *prgLocale;
  134. } PLATFORMINFO;
  135. typedef struct tagPACKAGEDETAIL
  136. {
  137. LPOLESTR pszPackageName;
  138. LPOLESTR pszPublisher;
  139. UINT cSources;
  140. [size_is(cSources)] LPOLESTR *pszSourceList;
  141. UINT cCategories;
  142. [size_is(cCategories)] GUID *rpCategory;
  143. ACTIVATIONINFO *pActInfo;
  144. PLATFORMINFO *pPlatformInfo;
  145. INSTALLINFO *pInstallInfo;
  146. } PACKAGEDETAIL;
  147. //+---------------------------------------------------------------------------
  148. // Contents: Enum Interfaces for Class Store
  149. //----------------------------------------------------------------------------
  150. cpp_quote("#ifndef _LPCSADMNENUM_DEFINED")
  151. cpp_quote("#define _LPCSADMNENUM_DEFINED")
  152. typedef struct tagPACKAGEDISPINFO
  153. {
  154. LPOLESTR pszPackageName;
  155. DWORD dwActFlags;
  156. CLASSPATHTYPE PathType;
  157. LPOLESTR pszScriptPath;
  158. LPOLESTR pszPublisher;
  159. LPOLESTR pszUrl;
  160. UINT InstallUiLevel;
  161. GUID ProductCode;
  162. GUID PackageGuid;
  163. ULONGLONG Usn;
  164. DWORD dwVersionHi;
  165. DWORD dwVersionLo;
  166. DWORD dwRevision;
  167. GUID GpoId;
  168. UINT cUpgrades;
  169. [size_is(cUpgrades)] UPGRADEINFO *prgUpgradeInfoList;
  170. LANGID LangId;
  171. BYTE* rgSecurityDescriptor;
  172. UINT cbSecurityDescriptor;
  173. WCHAR* pszGpoPath;
  174. DWORD MatchedArchitecture;
  175. UINT cArchitectures;
  176. [size_is(cArchitectures)] DWORD* prgArchitectures;
  177. UINT cTransforms;
  178. [size_is(cTransforms)] LPOLESTR* prgTransforms;
  179. UINT cCategories;
  180. [size_is(cTransforms)] LPOLESTR* prgCategories;
  181. } PACKAGEDISPINFO;
  182. //
  183. // IEnumPackage
  184. // ============
  185. //
  186. [
  187. local,
  188. object,
  189. uuid(00000193-0000-0000-C000-000000000046)
  190. ]
  191. interface IEnumPackage : IUnknown
  192. {
  193. //---- Next()
  194. //
  195. // Arguments: celt number of elements to fetch
  196. // pceltFetched number fetched
  197. // rgelt contents of fetch
  198. //
  199. // Returns: S_OK
  200. // S_FALSE (Not enough elements fetched.)
  201. HRESULT Next(
  202. [in] ULONG celt,
  203. [out, size_is(celt), length_is(*pceltFetched)] PACKAGEDISPINFO *rgelt,
  204. [out] ULONG *pceltFetched);
  205. //---- Skip()
  206. //
  207. // Arguments: celt number of elements to skip.
  208. //
  209. // Returns: S_OK
  210. // S_FALSE (Not enough elements skipped.)
  211. HRESULT Skip(
  212. [in] ULONG celt);
  213. //---- Reset()
  214. HRESULT Reset();
  215. // The clone method is unneeded and thus not implemented
  216. // HRESULT Clone(
  217. // [out] IEnumPackage **ppenum);
  218. }
  219. cpp_quote("#endif")
  220. //----------------------------------------------------------------------------
  221. // The Class Store Access Interface.
  222. //----------------------------------------------------------------------------
  223. [
  224. local,
  225. object,
  226. uuid(00000190-0000-0000-C000-000000000046)
  227. ]
  228. interface IClassAccess : IUnknown
  229. {
  230. // GetAppInfo
  231. //
  232. // Class Store look up method used by OLE and Shell for auto install of missing
  233. // apps and components.
  234. //
  235. HRESULT GetAppInfo(
  236. [in] uCLSSPEC * pClassSpec, // Class Spec (CLSID/Ext/MIME)
  237. [in] QUERYCONTEXT * pQryContext, // Query Attributes
  238. [out] PACKAGEDISPINFO * pPackageInfo
  239. );
  240. //
  241. // EnumPackages
  242. //
  243. // Class Store package enumeration.
  244. // This method returns an Enumerator for the list of application
  245. // packages in the class store.
  246. //
  247. HRESULT EnumPackages (
  248. [in, unique] LPOLESTR pszPackageName,
  249. [in, unique] GUID *pCategory,
  250. [in, unique] ULONGLONG *pLastUsn,
  251. [in] DWORD dwAppFlags,
  252. [out] IEnumPackage **ppIEnumPackage
  253. );
  254. HRESULT SetClassStorePath (
  255. [in, unique] LPOLESTR pszClassStorePath,
  256. [in, unique] void* pRsopUserToken
  257. );
  258. }
  259. //----------------------------------------------------------------------------
  260. // The Class Store Admin Interface.
  261. //----------------------------------------------------------------------------
  262. //
  263. // IClassAdmin
  264. // ===========
  265. //
  266. [
  267. local,
  268. object,
  269. uuid(00000191-0000-0000-C000-000000000046)
  270. ]
  271. interface IClassAdmin : IUnknown
  272. {
  273. HRESULT GetGPOInfo(
  274. [out] GUID *pGPOId,
  275. [out] LPOLESTR *pszPolicyName
  276. );
  277. HRESULT AddPackage(
  278. [in] PACKAGEDETAIL *pPackageDetail,
  279. [out] GUID *pPkgGuid
  280. );
  281. HRESULT RemovePackage(
  282. [in] LPOLESTR pszPackageName,
  283. [in] DWORD dwFlags
  284. );
  285. HRESULT ChangePackageProperties(
  286. [in] LPOLESTR pszPackageName,
  287. [in, unique] LPOLESTR pszNewName,
  288. [in, unique] DWORD *pdwFlags,
  289. [in, unique] LPOLESTR pszUrl,
  290. [in, unique] LPOLESTR pszScriptPath,
  291. [in, unique] UINT *pInstallUiLevel,
  292. [in, unique] DWORD *pdwRevision
  293. );
  294. HRESULT ChangePackageCategories(
  295. [in] LPOLESTR pszPackageName,
  296. [in] UINT cCategories,
  297. [in, size_is(cCategories), unique] GUID *rpCategory
  298. );
  299. HRESULT ChangePackageSourceList(
  300. [in] LPOLESTR pszPackageName,
  301. [in] UINT cSources,
  302. [in, size_is(cSources), unique] LPOLESTR *pszSourceList
  303. );
  304. HRESULT ChangePackageUpgradeList(
  305. [in] LPOLESTR pszPackageName,
  306. [in] UINT cUpgrades,
  307. [in, size_is(cUpgrades), unique] UPGRADEINFO *prgUpgradeInfoList
  308. );
  309. HRESULT ChangePackageUpgradeInfoIncremental(
  310. [in] GUID PkgGuid,
  311. [in] UPGRADEINFO UpgradeInfo,
  312. [in] DWORD OpFlags
  313. );
  314. HRESULT SetPriorityByFileExt(
  315. [in] LPOLESTR pszPackageName,
  316. [in] LPOLESTR pszFileExt,
  317. [in] UINT Priority
  318. );
  319. HRESULT EnumPackages(
  320. [in, unique] LPOLESTR pszFileExt,
  321. [in, unique] GUID *pCategory,
  322. [in] DWORD dwAppFlags,
  323. [in, unique] DWORD *pdwLocale,
  324. [in, unique] CSPLATFORM *pPlatform,
  325. [out] IEnumPackage **ppIEnumPackage
  326. );
  327. HRESULT GetPackageDetails (
  328. [in] LPOLESTR pszPackageName,
  329. [out] PACKAGEDETAIL *pPackageDetail
  330. );
  331. HRESULT GetPackageDetailsFromGuid (
  332. [in] GUID PkgGuid,
  333. [out] PACKAGEDETAIL *pPackageDetail
  334. );
  335. HRESULT GetAppCategories (
  336. [in] LCID Locale,
  337. [out] APPCATEGORYINFOLIST *pAppCategoryList
  338. );
  339. HRESULT RegisterAppCategory (
  340. [in] APPCATEGORYINFO *pAppCategory
  341. );
  342. HRESULT UnregisterAppCategory (
  343. [in] GUID *pAppCategoryId
  344. );
  345. HRESULT Cleanup (
  346. [in] FILETIME *pTimeBefore
  347. );
  348. HRESULT GetDNFromPackageName(
  349. [in] LPOLESTR pszPackageName,
  350. [out] LPOLESTR *szDN
  351. );
  352. HRESULT RedeployPackage(
  353. [in] GUID *pPackageGuid,
  354. [in] PACKAGEDETAIL *pPackageDetail
  355. );
  356. }
  357. cpp_quote("//------------------------- Priorities and weights")
  358. cpp_quote("")
  359. cpp_quote("// ")
  360. cpp_quote("// File Extension priority")
  361. cpp_quote("// ")
  362. cpp_quote("// 1 bit (0)")
  363. cpp_quote("//")
  364. cpp_quote("#define PRI_EXTN_FACTOR (1 << 0)")
  365. cpp_quote("")
  366. cpp_quote("//")
  367. cpp_quote("// CLSCTX priority")
  368. cpp_quote("//")
  369. cpp_quote("// 2 bits (7:8)")
  370. cpp_quote("//")
  371. cpp_quote("#define PRI_CLSID_INPSVR (3 << 7)")
  372. cpp_quote("#define PRI_CLSID_LCLSVR (2 << 7)")
  373. cpp_quote("#define PRI_CLSID_REMSVR (1 << 7)")
  374. cpp_quote("")
  375. cpp_quote("//")
  376. cpp_quote("// UI Language priority")
  377. cpp_quote("//")
  378. cpp_quote("// 3 bits (9:11)")
  379. cpp_quote("//")
  380. cpp_quote("#define PRI_LANG_ALWAYSMATCH (4 << 9)")
  381. cpp_quote("#define PRI_LANG_SYSTEMLOCALE (3 << 9)")
  382. cpp_quote("#define PRI_LANG_ENGLISH (2 << 9)")
  383. cpp_quote("#define PRI_LANG_NEUTRAL (1 << 9)")
  384. cpp_quote("")
  385. cpp_quote("//")
  386. cpp_quote("// Architecture priority")
  387. cpp_quote("//")
  388. cpp_quote("// 2 bits (12:13)")
  389. cpp_quote("//")
  390. cpp_quote("#define PRI_ARCH_PREF1 (2 << 12)")
  391. cpp_quote("#define PRI_ARCH_PREF2 (1 << 12)")