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.

451 lines
15 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998.
  5. //
  6. // File:
  7. // activate.idl
  8. //
  9. // Contents:
  10. // Definition of (currently) private COM system activation interfaces.
  11. //
  12. // History:
  13. // VinayKr 01-16-98 Created
  14. // SatishT 01-23-98 Added property interfaces
  15. // SatishT 02-03-98 Separated
  16. // JimLyon 02-18-98 Reworked and joined
  17. //
  18. //--------------------------------------------------------------------------
  19. #ifndef DO_NO_IMPORTS
  20. import "obase.idl";
  21. import "wtypes.idl";
  22. import "objidl.idl";
  23. import "contxt.idl";
  24. #endif
  25. //--------------------------------------------------------------------------
  26. // A custom activator supports:
  27. // ISystemActivator
  28. //
  29. // The activation properties object passed to an activator supports:
  30. // IInitActivationPropertiesIn
  31. // IActivationPropertiesIn
  32. // IServerLocationInfo
  33. // IActivationContextInfo
  34. // IActivationSecurityInfo
  35. // IActivationAgentInfo
  36. // IActivationStageInfo
  37. // IOpaqueDataInfo
  38. //
  39. // The activation properties object returned by an activator supports:
  40. // IActivationPropertiesOut
  41. // IOpaqueDataInfo
  42. //--------------------------------------------------------------------------
  43. //--------------------------------------------------------------------------
  44. //
  45. // Memory Management notes:
  46. //
  47. // 1. Whenever any of the methods defined here return interface pointers,
  48. // they return counted references. The caller must eventually call Release ().
  49. //
  50. // 2. Whenever any of the methods defined here have [out] parameters whose
  51. // type is something**, the method will set the caller's pointer to point to
  52. // data owned by the called object. The caller MUST NOT alter or free this data.
  53. // For example, IActivationPropertiesIn::GetActivationID returns a pointer to
  54. // a GUID. The actual GUID is in memory owned by the ActivationPropertiesIn
  55. // object; the caller must not alter the GUID or free the memory it occupies.
  56. //
  57. // 3. Whenever any of these methods accept pointers to data structures from
  58. // their caller, they perform a deap copy of the data. The activation properties
  59. // objects NEVER retain pointers to data structures owned by their callers.
  60. //
  61. //--------------------------------------------------------------------------
  62. // forward references:
  63. interface IActivationPropertiesIn;
  64. interface IActivationPropertiesOut;
  65. [
  66. object,
  67. uuid(000001A0-0000-0000-C000-000000000046),
  68. pointer_default(unique)
  69. ]
  70. interface ISystemActivator : IUnknown
  71. {
  72. HRESULT GetClassObject(
  73. [in,unique] IActivationPropertiesIn *pActProperties,
  74. [out] IActivationPropertiesOut **ppActProperties
  75. );
  76. HRESULT CreateInstance(
  77. [in,unique] IUnknown *pUnkOuter,
  78. [in,unique] IActivationPropertiesIn *pActProperties,
  79. [out] IActivationPropertiesOut **ppActProperties
  80. );
  81. }
  82. // These flags are used to indicate special activation requirements.
  83. typedef enum tagACTIVATION_FLAGS {
  84. ACTVFLAGS_NONE = 0,
  85. ACTVFLAGS_WX86_CALLER = 1,
  86. ACTVFLAGS_DISABLE_AAA = 2
  87. } ACTIVATION_FLAGS;
  88. [
  89. object,
  90. local,
  91. uuid(000001A1-0000-0000-C000-000000000046),
  92. pointer_default(unique)
  93. ]
  94. interface IInitActivationPropertiesIn : IUnknown
  95. {
  96. // These methods are legal only if IActivationPropertiesIn::Delegate...
  97. // has never been called.
  98. HRESULT SetClsctx ([in] DWORD clsctx);
  99. HRESULT SetActivationFlags([in] DWORD actvflags);
  100. HRESULT SetClassInfo ([in,unique] IUnknown* pUnkClassInfo);
  101. HRESULT SetContextInfo ([in,unique] IContext* pClientContext,
  102. [in] IContext* pPrototypeContext);
  103. HRESULT SetConstructFromStorage ([in,unique] IStorage* pStorage);
  104. HRESULT SetConstructFromFile ([in] WCHAR* wszFileName, [in] DWORD dwMode);
  105. }
  106. [
  107. object,
  108. local,
  109. uuid(000001A2-0000-0000-C000-000000000046),
  110. pointer_default(unique)
  111. ]
  112. interface IActivationPropertiesIn : IUnknown
  113. {
  114. HRESULT GetActivationID([out] GUID *pActivationID);
  115. HRESULT GetClassInfo([in] REFIID riid, [out,iid_is(riid)] void** ppv);
  116. HRESULT GetClsctx([out] DWORD *pclsctx);
  117. HRESULT GetActivationFlags([out] DWORD *pactvflags);
  118. HRESULT AddRequestedIIDs([in] DWORD cIfs,
  119. [in, size_is(cIfs)] IID *rgIID);
  120. HRESULT GetRequestedIIDs ([out] ULONG* pulCount, [out] IID** prgIID);
  121. // The following three methods are for activators who delegate onward.
  122. HRESULT DelegateGetClassObject([out] IActivationPropertiesOut **pActPropsOut);
  123. HRESULT DelegateCreateInstance([in] IUnknown *pUnkOuter,
  124. [out] IActivationPropertiesOut **pActPropsOut);
  125. // Following can only be used in Server Context Stage
  126. // and returns ClassFactory used in the Create Instance
  127. HRESULT DelegateCIAndGetCF([in] IUnknown *pUnkOuter,
  128. [out] IActivationPropertiesOut **pActPropsOut,
  129. [out] IClassFactory **ppCf);
  130. // The following method is for activators who do NOT delegate onward.
  131. HRESULT GetReturnActivationProperties([in] IUnknown *pUnk,
  132. [out] IActivationPropertiesOut **ppActOut);
  133. }
  134. [
  135. object,
  136. local,
  137. uuid(000001A3-0000-0000-C000-000000000046),
  138. pointer_default(unique)
  139. ]
  140. interface IActivationPropertiesOut : IUnknown
  141. {
  142. HRESULT GetActivationID([out] GUID *pActivationID);
  143. HRESULT GetObjectInterface([in] REFIID riid,
  144. [in] DWORD actvflags,
  145. [out, iid_is(riid)] void **ppv);
  146. HRESULT GetObjectInterfaces([in] DWORD cIfs,
  147. [in] DWORD actvflags,
  148. [in, size_is(cIfs)] MULTI_QI *multiQi);
  149. HRESULT RemoveRequestedIIDs([in] DWORD cIfs,
  150. [in, size_is(cIfs)] IID *rgIID);
  151. }
  152. // Enumeration of activation stage constants
  153. typedef enum tagACTIVATION_STAGE {
  154. CLIENT_CONTEXT_STAGE = 1,
  155. CLIENT_MACHINE_STAGE = 2,
  156. SERVER_MACHINE_STAGE = 3,
  157. SERVER_PROCESS_STAGE = 4,
  158. SERVER_CONTEXT_STAGE = 5
  159. } ACTIVATION_STAGE;
  160. [
  161. object,
  162. uuid (000001A8-0000-0000-C000-000000000046),
  163. pointer_default (unique)
  164. ]
  165. interface IActivationStageInfo : IUnknown
  166. {
  167. HRESULT SetStageAndIndex ([in] ACTIVATION_STAGE stage, [in] int index);
  168. HRESULT GetStage ([out] ACTIVATION_STAGE* pstage);
  169. HRESULT GetIndex ([out] int* pindex);
  170. }
  171. //
  172. // Flags for the dwPRT parameter of Set/GetProcess
  173. //
  174. typedef enum _PRT
  175. {
  176. PRT_IGNORE = 0,
  177. PRT_CREATE_NEW = 1,
  178. PRT_USE_THIS = 2,
  179. PRT_USE_THIS_ONLY = 3
  180. } PROCESS_REQUEST_TYPE;
  181. [
  182. object,
  183. local,
  184. uuid(000001A4-0000-0000-C000-000000000046),
  185. pointer_default(unique)
  186. ]
  187. interface IServerLocationInfo : IUnknown
  188. {
  189. // SetRemoteServerName is allowed only prior to the server Machine stage.
  190. HRESULT SetRemoteServerName([in, string, unique] WCHAR *pswzMachineName);
  191. HRESULT GetRemoteServerName([out, string] WCHAR **pswzMachineName);
  192. // SetProcess
  193. HRESULT SetProcess([in] DWORD pid, DWORD dwPRT);
  194. HRESULT GetProcess([out] DWORD* ppid, DWORD* pdwPRT);
  195. // SetApartment is allowed only in server process stage.
  196. HRESULT SetApartment([in] APTID apartmentId);
  197. HRESULT GetApartment([out] APTID *pApartmentId);
  198. // SetContext is allowed only in server process and server apartment stages.
  199. HRESULT SetContext([in] IObjContext* pContext);
  200. HRESULT GetContext([out] IObjContext** ppContext);
  201. }
  202. [
  203. object,
  204. local,
  205. uuid(000001A5-0000-0000-C000-000000000046),
  206. pointer_default(unique)
  207. ]
  208. interface IActivationContextInfo : IUnknown
  209. {
  210. // None of these methods is allowed in the server context stage.
  211. HRESULT GetClientContext([out] IContext **ppClientContext);
  212. HRESULT GetPrototypeContext([out] IContext **ppContext);
  213. HRESULT IsClientContextOK([out] BOOL *fYes);
  214. HRESULT SetClientContextNotOK();
  215. }
  216. [
  217. object,
  218. local,
  219. uuid(000001BA-0000-0000-C000-000000000046),
  220. pointer_default(unique)
  221. ]
  222. interface IOverrideTargetContext : IUnknown
  223. {
  224. HRESULT OverrideTargetContext([in] REFGUID guidTargetCtxtId);
  225. }
  226. [
  227. object,
  228. local,
  229. uuid(000001A6-0000-0000-C000-000000000046),
  230. pointer_default(unique)
  231. ]
  232. interface IActivationSecurityInfo : IUnknown
  233. {
  234. // These methods are only allowed prior to the server process stage.
  235. HRESULT SetAuthnFlags([in] DWORD dwAuthnFlags); // e.g., static/dynamic
  236. HRESULT GetAuthnFlags([out] DWORD *pdwAuthnFlags);
  237. HRESULT SetAuthnSvc([in] DWORD dwAuthnSvc);
  238. HRESULT GetAuthnSvc([out] DWORD *pdwAuthnSvc);
  239. HRESULT SetAuthzSvc([in] DWORD dwAuthzSvc);
  240. HRESULT GetAuthzSvc([out] DWORD *pdwAuthzSvc);
  241. HRESULT SetAuthnLevel([in] DWORD dwAuthnLevel);
  242. HRESULT GetAuthnLevel([out] DWORD *pdwAuthnLevel);
  243. HRESULT SetImpLevel([in] DWORD dwImpLevel);
  244. HRESULT GetImpLevel([out] DWORD *pdwImpLevel);
  245. HRESULT SetCapabilities([in] DWORD dwCapabilities);
  246. HRESULT GetCapabilities([out] DWORD *pdwCapabilities);
  247. HRESULT SetAuthIdentity([in, unique] COAUTHIDENTITY *pAuthIdentityData);
  248. HRESULT GetAuthIdentity([out] COAUTHIDENTITY **pAuthIdentityData);
  249. HRESULT SetServerPrincipalName([in, unique] WCHAR* pwszServerPrincName);
  250. HRESULT GetServerPrincipalName([out] WCHAR** pwszServerPrincName);
  251. }
  252. // A SIDLIST is a buffer composed as follows:
  253. // ULONG number of SIDs in the list
  254. // For each SID, the following:
  255. // ULONG number of bytes for the SID
  256. // contents of the SID
  257. // The first SID in a SIDLIST is a user SID; the rest are GROUP SIDs.
  258. //BUGBUG: needs definition
  259. typedef LONG* PSIDLIST; // pointer to a SIDLIST
  260. [
  261. object,
  262. uuid (000001A7-0000-0000-C000-000000000046),
  263. pointer_default (unique)
  264. ]
  265. interface IActivationAgentInfo : IUnknown
  266. {
  267. HRESULT AddActivationAgent ([in] PSIDLIST pSidList);
  268. HRESULT GetActivationAgentCount ([out] ULONG* pulCount);
  269. HRESULT GetActivationAgents ([out] PSIDLIST** prgSidList);
  270. }
  271. //
  272. // ServerType -- an enumeration describing the various
  273. // types of servers that can be registered with the scm
  274. //
  275. typedef enum
  276. {
  277. ST_SERVER = 1, // normal server
  278. ST_OLDSURROGATE, // legacy surrogate-style application
  279. ST_COMPLUSAPP, // new COM+ application
  280. ST_SERVICE // server implemented as an NT service
  281. } ServerType;
  282. //
  283. // ServerIDType -- an enumeration to differentiate
  284. // between run-as-a-specific-user server and a run-as-
  285. // interactive-user server. Does not apply to servers
  286. // implemented as NT services.
  287. //
  288. typedef enum
  289. {
  290. SIT_RUNAS_SPECIFIC_USER = 1,
  291. SIT_RUNAS_INTERACTIVE
  292. } ServerIDType;
  293. //
  294. // SCMProcessInfoFlags -- an enumeration containing various
  295. // state bits for the dwState member of the SCMProcessInfo
  296. // struct.
  297. //
  298. typedef enum
  299. {
  300. SPIF_COMPLUS = 1, // process is a com+ server
  301. SPIF_SUSPENDED = 2, // process has been suspended by an activator
  302. SPIF_RETIRED = 4, // process has been retired by an activator
  303. SPIF_READY = 8, // process is started and is ready for activations (if not set
  304. // the process is in a sort-of "started-but-suspended" state)
  305. SPIF_PAUSED = 16 // the process has paused itself (due to user action)
  306. } SCMProcessInfoFlags;
  307. //
  308. // SCMProcessInfo -- describes a server process registered with
  309. // the scm.
  310. //
  311. typedef struct
  312. {
  313. ULONG ulNumClasses;
  314. GUID* pCLSIDs;
  315. DWORD pidProcess;
  316. HANDLE hProcess; // will almost never be NULL, but caller should check anyway
  317. HANDLE hImpersonationToken;
  318. WCHAR* pwszWinstaDesktop;
  319. DWORD dwState; // see SCMProcessInfoFlags
  320. GUID AppId; // valid only if SPIF_COMPLUS bit is set
  321. ServerType ServerType;
  322. ServerIDType ServerID;
  323. FILETIME ftCreated;
  324. } SCMProcessInfo, *PSCMProcessInfo;
  325. //
  326. // IEnumSCMProcessInfo
  327. //
  328. // Interface for walking through a view of the SCM's server tables
  329. //
  330. [
  331. local,
  332. object,
  333. uuid(8bbbd026-de4d-46b7-8a90-72c66eb64ad6),
  334. pointer_default(unique)
  335. ]
  336. interface IEnumSCMProcessInfo : IUnknown
  337. {
  338. // Fetch process info for next cElems processes
  339. HRESULT Next([in] ULONG cElems,
  340. [out, size_is (cElems), length_is (*pcFetched)] SCMProcessInfo** ppSCMProcessInfo,
  341. [out] ULONG *pcFetched);
  342. // advance cursor past cElems elements
  343. HRESULT Skip([in]ULONG cElems);
  344. // reset cursor to first element
  345. HRESULT Reset();
  346. // duplicate this enumerator
  347. HRESULT Clone([out]IEnumSCMProcessInfo **ppESPI);
  348. }
  349. //
  350. // ISCMProcessControl
  351. //
  352. // Interface for querying & changing the SCM's server tables
  353. //
  354. [
  355. local,
  356. object,
  357. uuid(7629798c-f1e6-4ef0-b521-dc466fded209),
  358. pointer_default(unique)
  359. ]
  360. interface ISCMProcessControl : IUnknown
  361. {
  362. // Find info for processes implementing an application
  363. HRESULT FindApplication ([in] REFGUID rappid, [out] IEnumSCMProcessInfo **ppESPI);
  364. // Find info for processes implementing a class
  365. HRESULT FindClass ([in] REFCLSID rclsid, [out] IEnumSCMProcessInfo **ppESPI);
  366. // Find info for a particular PID.
  367. HRESULT FindProcess ([in] DWORD pid, [out] SCMProcessInfo** pSCMProcessInfo);
  368. // Send no activations to COM+ applications implementing this APPID.
  369. HRESULT SuspendApplication ([in] REFGUID rappid);
  370. // Send no activations to processes implementing this CLSID.
  371. HRESULT SuspendClass ([in] REFCLSID rclsid);
  372. // Send no activations to this process.
  373. HRESULT SuspendProcess ([in] DWORD ppid);
  374. // Resume sending activations to COM+ applications implementing this APPID
  375. HRESULT ResumeApplication([in] REFGUID rappid);
  376. // Resume sending activations to processes implementing this CLSID
  377. HRESULT ResumeClass([in] REFCLSID rclsid);
  378. // Resumt sending activations to this process
  379. HRESULT ResumeProcess([in] DWORD pid);
  380. // Send no more activations to COM+ applications implementing this APPID.
  381. HRESULT RetireApplication ([in] REFGUID rappid);
  382. // Send no more activations to processes implementing this CLSID.
  383. HRESULT RetireClass ([in] REFCLSID rclsid);
  384. // Send no more activations to this process.
  385. HRESULT RetireProcess ([in] DWORD pid);
  386. // Free a SCMProcessInfo structure
  387. HRESULT FreeSCMProcessInfo(SCMProcessInfo** ppSCMProcessInfo);
  388. }
  389. // This clsid gets defined in prvidl.lib
  390. cpp_quote("")
  391. cpp_quote("EXTERN_C const CLSID CLSID_RPCSSInfo;")
  392. cpp_quote("")
  393. cpp_quote("")
  394. cpp_quote("////////////////////////////////////////////////////////////////////////")
  395. cpp_quote("//")
  396. cpp_quote("// API for accessing SCM's objects (exported from rpcss.dll)")
  397. cpp_quote("//")
  398. cpp_quote("typedef HRESULT (__stdcall *PFNGETRPCSSINFO)(REFCLSID, REFIID, void**);")
  399. cpp_quote("//")
  400. cpp_quote("////////////////////////////////////////////////////////////////////////")
  401. cpp_quote("")