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.

360 lines
16 KiB

  1. //////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 1998, 1999, 2000 Microsoft Corporation. All rights reserved.
  4. //
  5. // File : AppMan.h
  6. //
  7. // Content : Include file containing the IApplicationManager and IApplicationEntry
  8. // interfaces needed to use the Windows Application Manager
  9. //
  10. //////////////////////////////////////////////////////////////////////////////////////////////
  11. #ifndef __IAPPMAN_
  12. #define __IAPPMAN_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // _cplusplus
  16. //
  17. // Get a few important things defined properly before proceeding
  18. //
  19. #undef EXPORT
  20. #ifdef WIN32
  21. #define EXPORT __declspec(dllexport)
  22. #else // WIN32
  23. #define EXPORT __export
  24. #endif // WIN32
  25. #if defined( _WIN32 ) && !defined( _NO_COM )
  26. #define COM_NO_WINDOWS_H
  27. #include <objbase.h>
  28. #else // defined( _WIN32 ) && !defined( _NO_COM )
  29. #include "windows.h"
  30. #include "ole2.h"
  31. #define IUnknown void
  32. #endif // defined( _WIN32 ) && !defined( _NO_COM )
  33. //
  34. // GUID definition for the IApplicationManager interface
  35. //
  36. // CLSID_ApplicationManager = {553C75D7-C0B6-480d-92CC-F936D75FD87C}
  37. // IID_ApplicationManager = {6084A2E8-3FB7-4d1c-B14B-6ADBAAF7CECE}
  38. // IID_ApplicationEntry = {7BA2201F-4DE7-4ef7-BBA3-C69A716B8CD9}
  39. //
  40. DEFINE_GUID(CLSID_ApplicationManager, 0x553c75d7, 0xc0b6, 0x480d, 0x92, 0xcc, 0xf9, 0x36, 0xd7, 0x5f, 0xd8, 0x7c);
  41. DEFINE_GUID(IID_ApplicationManager, 0x6084a2e8, 0x3fb7, 0x4d1c, 0xb1, 0x4b, 0x6a, 0xdb, 0xaa, 0xf7, 0xce, 0xce);
  42. DEFINE_GUID(IID_ApplicationEntry, 0x7ba2201f, 0x4de7, 0x4ef7, 0xbb, 0xa3, 0xc6, 0x9a, 0x71, 0x6b, 0x8c, 0xd9);
  43. //
  44. // These defines are used in conjunction with the APP_PROPERTY_STATE and the
  45. // IApplicationEntry->SetProperty() and IApplicationEntry->GetProperty() methods
  46. //
  47. #define APP_STATE_INSTALLING 0x00000001
  48. #define APP_STATE_READY 0x00000002
  49. #define APP_STATE_DOWNSIZING 0x00000004
  50. #define APP_STATE_DOWNSIZED 0x00000008
  51. #define APP_STATE_REINSTALLING 0x00000010
  52. #define APP_STATE_UNINSTALLING 0x00000020
  53. #define APP_STATE_UNINSTALLED 0x00000040
  54. #define APP_STATE_SELFTESTING 0x00000080
  55. #define APP_STATE_UNSTABLE 0x00000100
  56. #define APP_STATE_MASK 0x000001ff
  57. //
  58. // These defines are used in conjunction with the APP_PROPERTY_CATEGORY and the
  59. // IApplicationEntry->SetProperty() and IApplicationEntry->GetProperty() methods. More
  60. // categories will be supported in version 2.
  61. //
  62. #define APP_CATEGORY_NONE 0x00000000
  63. #define APP_CATEGORY_ENTERTAINMENT 0x00000001
  64. #define APP_CATEGORY_DEMO 0x01000000
  65. #define APP_CATEGORY_PATCH 0x02000000
  66. #define APP_CATEGORY_DATA 0x04000000
  67. #define APP_CATEGORY_ALL 0x0700ffff
  68. //
  69. // These defines are used as the dwPropertyDefine parameter of the
  70. // IApplicationEntry->SetProperty() and IApplicationEntry->GetProperty() methods
  71. //
  72. #define APP_PROPERTY_GUID 0x00000001
  73. #define APP_PROPERTY_COMPANYNAME 0x00000002
  74. #define APP_PROPERTY_SIGNATURE 0x00000003
  75. #define APP_PROPERTY_VERSIONSTRING 0x00000004
  76. #define APP_PROPERTY_ROOTPATH 0x00000005
  77. #define APP_PROPERTY_SETUPROOTPATH 0x00000006
  78. #define APP_PROPERTY_STATE 0x00000007
  79. #define APP_PROPERTY_CATEGORY 0x00000008
  80. #define APP_PROPERTY_ESTIMATEDINSTALLKILOBYTES 0x00000009
  81. #define APP_PROPERTY_EXECUTECMDLINE 0x0000000c
  82. #define APP_PROPERTY_DEFAULTSETUPEXECMDLINE 0x0000001a
  83. #define APP_PROPERTY_DOWNSIZECMDLINE 0x0000000d
  84. #define APP_PROPERTY_REINSTALLCMDLINE 0x0000000e
  85. #define APP_PROPERTY_UNINSTALLCMDLINE 0x0000000f
  86. #define APP_PROPERTY_SELFTESTCMDLINE 0x00000010
  87. #define APP_PROPERTY_INSTALLDATE 0x00000013
  88. #define APP_PROPERTY_LASTUSEDDATE 0x00000014
  89. #define APP_PROPERTY_TITLEURL 0x00000015
  90. #define APP_PROPERTY_PUBLISHERURL 0x00000016
  91. #define APP_PROPERTY_DEVELOPERURL 0x00000017
  92. #define APP_PROPERTY_XMLINFOFILE 0x00000019
  93. //
  94. // Defines used as OR mask modifiers for the APP_PROPERTY_xxx string based properties.
  95. // The default is APP_PROPERTY_STR_UNICODE.
  96. //
  97. // Used as OR masks for the dwPropertyDefines parameter of:
  98. // IApplicationEntry->GetProperty()
  99. // IApplicationEntry->SetProperty()
  100. //
  101. // Used alone for the dwStringDefine parameters of:
  102. // IApplicationManager->EnumDevices()
  103. // IApplicationEntry->GetTemporarySpace()
  104. // IApplicationEntry->RemoveTemporarySpace()
  105. // IApplicationEntry->EnumTemporarySpaces()
  106. //
  107. #define APP_PROPERTY_STR_ANSI 0x40000000
  108. #define APP_PROPERTY_STR_UNICODE 0x80000000
  109. #ifndef _UNICODE
  110. #define APP_PROPERTY_TSTR APP_PROPERTY_STR_UNICODE
  111. #else // _UNICODE
  112. #define APP_PROPERTY_TSTR APP_PROPERTY_STR_ANSI
  113. #endif // _UNICODE
  114. //
  115. // Association specific defines. Associations are used to inherit root paths from
  116. // existing applications.
  117. //
  118. // APP_ASSOCIATION_CHILD : OR mask used only in the dwAssociationType
  119. // parameter of the
  120. // IApplicationEntry->EnumAssociations(...) method.
  121. // This bit means that the IApplicationEntry object
  122. // is a child in the relationship
  123. // APP_ASSOCIATION_PARENT : OR mask used obly in the dwAssociationType
  124. // parameter of the
  125. // IApplicationEntry->EnumAssociations(...) method.
  126. // This bit means that the IApplicationEntry object
  127. // is the parent in the relationship
  128. // APP_ASSOCIATION_INHERITBOTHPATHS : Inherit both the APP_PROPERTY_ROOTPATH and
  129. // APP_PROPERTYSETUPROOTPATH of the parent
  130. // application.
  131. // APP_ASSOCIATION_INHERITAPPROOTPATH : Inherit the APP_PROPERTY_ROOTPATH of the parent
  132. // application. Get a unique
  133. // APP_PROPERTY_SETUPROOTPATH.
  134. // APP_ASSOCIATION_INHERITSETUPROOTPATH : Inherit the APP_PROPERTY_SETUPROOTPATH of the
  135. // parent application. Get a unique
  136. // APP_PROPERTY_ROOTPATH.
  137. //
  138. #define APP_ASSOCIATION_CHILD 0x40000000
  139. #define APP_ASSOCIATION_PARENT 0x80000000
  140. #define APP_ASSOCIATION_INHERITBOTHPATHS 0x00000001
  141. #define APP_ASSOCIATION_INHERITAPPROOTPATH 0x00000002
  142. #define APP_ASSOCIATION_INHERITSETUPROOTPATH 0x00000004
  143. //
  144. // Defines used for the dwRunFlags parameter of the IApplicationEntry->Run(...) method. These
  145. // defines determine whether the Run(...) method should wait for the application to terminate
  146. // before returning.
  147. //
  148. #define APP_RUN_NOBLOCK 0x00000000
  149. #define APP_RUN_BLOCK 0x00000001
  150. //
  151. // String lenght defines (in characters, not bytes)
  152. //
  153. // MAX_COMPANYNAME_CHARCOUNT --> APP_PROPERTY_COMPANYNAME
  154. // MAX_SIGNATYRE_CHARCOUNT --> APP_PROPERTY_SIGNATURE
  155. // MAX_VERSIONSTRING_CHARCOUNT --> APP_PROPERTY_VERSIONSTRING
  156. // MAX_PATH_CHARCOUNT --> APP_PROPERTY_ROOTPATH
  157. // APP_PROPERTY_SETUPROOTPATH
  158. // APP_PROPERTY_XMLINFOFILE
  159. // APP_PROPERTY_TITLEURL
  160. // APP_PROPERTY_PUBLISHERURL
  161. // APP_PROPERTY_DEVELOPERURL
  162. // MAX_CMDLINE_CHARCOUNT --> APP_PROPERTY_EXECUTECMDLINE
  163. // APP_PROPERTY_DEFAULTSETUPEXECMDLINE
  164. // APP_PROPERTY_DOWNSIZECMDLINE
  165. // APP_PROPERTY_REINSTALLCMDLINE
  166. // APP_PROPERTY_UNINSTALLCMDLINE
  167. // APP_PROPERTY_SELFTESTCMDLINE
  168. //
  169. //
  170. #define MAX_COMPANYNAME_CHARCOUNT 64
  171. #define MAX_SIGNATURE_CHARCOUNT 64
  172. #define MAX_VERSIONSTRING_CHARCOUNT 16
  173. #define MAX_PATH_CHARCOUNT 255
  174. #define MAX_CMDLINE_CHARCOUNT 255
  175. //
  176. // Application Manager specific COM error codes
  177. //
  178. #define APPMAN_E_NOTINITIALIZED 0x85670001
  179. #define APPMAN_E_INVALIDPROPERTYSIZE 0x85670005
  180. #define APPMAN_E_INVALIDDATA 0x85670006
  181. #define APPMAN_E_INVALIDPROPERTY 0x85670007
  182. #define APPMAN_E_READONLYPROPERTY 0x85670008
  183. #define APPMAN_E_PROPERTYNOTSET 0x85670009
  184. #define APPMAN_E_OVERFLOW 0x8567000a
  185. #define APPMAN_E_INVALIDPROPERTYVALUE 0x8567000c
  186. #define APPMAN_E_ACTIONINPROGRESS 0x8567000d
  187. #define APPMAN_E_ACTIONNOTINITIALIZED 0x8567000e
  188. #define APPMAN_E_REQUIREDPROPERTIESMISSING 0x8567000f
  189. #define APPMAN_E_APPLICATIONALREADYEXISTS 0x85670010
  190. #define APPMAN_E_APPLICATIONALREADYLOCKED 0x85670011
  191. #define APPMAN_E_NODISKSPACEAVAILABLE 0x85670012
  192. #define APPMAN_E_UNKNOWNAPPLICATION 0x85670014
  193. #define APPMAN_E_INVALIDPARAMETERS 0x85670015
  194. #define APPMAN_E_OBJECTLOCKED 0x85670017
  195. #define APPMAN_E_INVALIDINDEX 0x85670018
  196. #define APPMAN_E_REGISTRYCORRUPT 0x85670019
  197. #define APPMAN_E_CANNOTASSOCIATE 0x8567001a
  198. #define APPMAN_E_INVALIDASSOCIATION 0x8567001b
  199. #define APPMAN_E_ALREADYASSOCIATED 0x8567001c
  200. #define APPMAN_E_APPLICATIONREQUIRED 0x8567001d
  201. #define APPMAN_E_INVALIDEXECUTECMDLINE 0x8567001e
  202. #define APPMAN_E_INVALIDDOWNSIZECMDLINE 0x8567001f
  203. #define APPMAN_E_INVALIDREINSTALLCMDLINE 0x85670020
  204. #define APPMAN_E_INVALIDUNINSTALLCMDLINE 0x85670021
  205. #define APPMAN_E_INVALIDSELFTESTCMDLINE 0x85670022
  206. #define APPMAN_E_PARENTAPPNOTREADY 0x85670023
  207. #define APPMAN_E_INVALIDSTATE 0x85670024
  208. #define APPMAN_E_INVALIDROOTPATH 0x85670025
  209. #define APPMAN_E_CACHEOVERRUN 0x85670026
  210. #define APPMAN_E_REINSTALLDX 0x85670028
  211. #define APPMAN_E_APPNOTEXECUTABLE 0x85670029
  212. //////////////////////////////////////////////////////////////////////////////////////////////
  213. //
  214. // Interface definitions
  215. //
  216. //////////////////////////////////////////////////////////////////////////////////////////////
  217. #if defined( _WIN32 ) && !defined( _NO_COM )
  218. //
  219. // IApplicationEntry Interface
  220. //
  221. // STDMETHOD (QueryInterface) (REFIID RefIID, LPVOID * lppVoidObject);
  222. // STDMETHOD_(ULONG, AddRef) (void);
  223. // STDMETHOD_(ULONG, Release) (void);
  224. // STDMETHOD (Clear) (void);
  225. // STDMETHOD (GetProperty) (const DWORD dwPropertyDefine, LPVOID lpData, const DWORD dwDataLenInBytes);
  226. // STDMETHOD (SetProperty) (const DWORD dwPropertyDefine, LPCVOID lpData, const DWORD dwDataLenInBytes);
  227. // STDMETHOD (InitializeInstall) (void);
  228. // STDMETHOD (FinalizeInstall) (void);
  229. // STDMETHOD (InitializeDownsize) (void);
  230. // STDMETHOD (FinalizeDownsize) (void);
  231. // STDMETHOD (InitializeReInstall) (void);
  232. // STDMETHOD (FinalizeReInstall) (void);
  233. // STDMETHOD (InitializeUnInstall) (void);
  234. // STDMETHOD (FinalizeUnInstall) (void);
  235. // STDMETHOD (InitializeSelfTest) (void);
  236. // STDMETHOD (FinalizeSelfTest) (void);
  237. // STDMETHOD (Abort) (void);
  238. // STDMETHOD (Run) (const DWORD dwRunFlags, const DWORD dwStringMask, LPVOID lpData, const DWORD dwDataLenInBytes);
  239. // STDMETHOD (AddAssociation) (const DWORD dwAssociationDefine, const IApplicationEntry * lpApplicationEntry);
  240. // STDMETHOD (RemoveAssociation) (const DWORD dwAssociationDefine, const IApplicationEntry * lpApplicationEntry);
  241. // STDMETHOD (EnumAssociations) (const DWORD dwZeroBasedIndex, LPDWORD lpdwAssociationDefineMask, IApplicationEntry * lpApplicationEntry);
  242. // STDMETHOD (GetTemporarySpace) (const DWORD dwSpaceInKilobytes, const DWORD dwStringDefine, LPVOID lpData, const DWORD dwDataLen);
  243. // STDMETHOD (RemoveTemporarySpace) (const DWORD dwStringDefine, LPVOID lpData, const DWORD dwDataLen);
  244. // STDMETHOD (EnumTemporarySpaces) (const DWORD dwZeroBasedIndex, LPDWORD lpdwSpaceInKilobytes, const DWORD dwStringDefine, LPVOID lpData, const DWORD dwDataLen);
  245. //
  246. #undef INTERFACE
  247. #define INTERFACE IApplicationEntry
  248. DECLARE_INTERFACE_( IApplicationEntry, IUnknown )
  249. {
  250. //
  251. // IUnknown interfaces
  252. //
  253. STDMETHOD (QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
  254. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  255. STDMETHOD_(ULONG, Release) (THIS) PURE;
  256. //
  257. // IApplicationEntry interface methods
  258. //
  259. STDMETHOD (Clear) (THIS) PURE;
  260. STDMETHOD (GetProperty) (THIS_ const DWORD, LPVOID, const DWORD) PURE;
  261. STDMETHOD (SetProperty) (THIS_ const DWORD, LPCVOID, const DWORD) PURE;
  262. STDMETHOD (InitializeInstall) (THIS) PURE;
  263. STDMETHOD (FinalizeInstall) (THIS) PURE;
  264. STDMETHOD (InitializeDownsize) (THIS) PURE;
  265. STDMETHOD (FinalizeDownsize) (THIS) PURE;
  266. STDMETHOD (InitializeReInstall) (THIS) PURE;
  267. STDMETHOD (FinalizeReInstall) (THIS) PURE;
  268. STDMETHOD (InitializeUnInstall) (THIS) PURE;
  269. STDMETHOD (FinalizeUnInstall) (THIS) PURE;
  270. STDMETHOD (InitializeSelfTest) (THIS) PURE;
  271. STDMETHOD (FinalizeSelfTest) (THIS) PURE;
  272. STDMETHOD (Abort) (THIS) PURE;
  273. STDMETHOD (Run) (THIS_ const DWORD, const DWORD, LPVOID, const DWORD) PURE;
  274. STDMETHOD (AddAssociation) (THIS_ const DWORD, const IApplicationEntry *) PURE;
  275. STDMETHOD (RemoveAssociation) (THIS_ const DWORD, const IApplicationEntry *) PURE;
  276. STDMETHOD (EnumAssociations) (THIS_ const DWORD, LPDWORD, IApplicationEntry *) PURE;
  277. STDMETHOD (GetTemporarySpace) (THIS_ const DWORD, const DWORD, LPVOID, const DWORD) PURE;
  278. STDMETHOD (RemoveTemporarySpace) (THIS_ const DWORD, LPVOID, const DWORD) PURE;
  279. STDMETHOD (EnumTemporarySpaces) (THIS_ const DWORD, LPDWORD, const DWORD, LPVOID, const DWORD ) PURE;
  280. };
  281. //
  282. // IApplicationManager Interface
  283. //
  284. // STDMETHOD (QueryInterface) (REFIID RefIID, LPVOID * lppVoidObject);
  285. // STDMETHOD_(ULONG, AddRef) (void);
  286. // STDMETHOD_(ULONG, Release) (void);
  287. // STDMETHOD (GetAdvancedMode) (LPDWORD lpdwAdvancedMode);
  288. // STDMETHOD (GetAvailableSpace) (const DWORD dwCategoryDefine, LPDWORD lpdwMaximumSpaceInKilobytes, LPDWORD lpdwOptimalSpaceInKilobytes);
  289. // STDMETHOD (CreateApplicationEntry) (IApplicationEntry ** lppObject);
  290. // STDMETHOD (GetApplicationInfo) (IApplicationEntry * lpObject);
  291. // STDMETHOD (EnumApplications) (const DWORD dwZeroBasedIndex, IApplicationEntry * lpObject);
  292. // STDMETHOD (EnumDevices) (const DWORD dwZeroBasedIndex, LPDWORD lpdwAvailableSpaceInKilobytes, LPDWORD lpdwCategoryDefineExclusionMask, const DWORD dwStringDefine, LPVOID lpData, const DWORD dwDataLen);
  293. //
  294. #undef INTERFACE
  295. #define INTERFACE IApplicationManager
  296. DECLARE_INTERFACE_( IApplicationManager, IUnknown )
  297. {
  298. //
  299. // IUnknown Interfaces
  300. //
  301. STDMETHOD (QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
  302. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  303. STDMETHOD_(ULONG, Release) (THIS) PURE;
  304. //
  305. // IApplicationManager interface methods
  306. //
  307. STDMETHOD (GetAdvancedMode) (THIS_ LPDWORD) PURE;
  308. STDMETHOD (GetAvailableSpace) (THIS_ const DWORD, LPDWORD, LPDWORD) PURE;
  309. STDMETHOD (CreateApplicationEntry) (THIS_ IApplicationEntry **) PURE;
  310. STDMETHOD (GetApplicationInfo) (THIS_ IApplicationEntry *) PURE;
  311. STDMETHOD (EnumApplications) (THIS_ const DWORD, IApplicationEntry *) PURE;
  312. STDMETHOD (EnumDevices) (THIS_ const DWORD, LPDWORD, LPDWORD, const DWORD, LPVOID, const DWORD) PURE;
  313. };
  314. #endif // defined( _WIN32 ) && !defined( _NO_COM )
  315. #ifdef __cplusplus
  316. }
  317. #endif // _cplusplus
  318. #endif // __IAPPMAN_