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.

372 lines
11 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright 2001 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // Contents: Messenger Session invitation interfaces
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifdef __MKTYPLIB__
  9. #define VARIANT_BOOL boolean
  10. #else // __MKTYPLIB__
  11. cpp_quote("//+-------------------------------------------------------------------------")
  12. cpp_quote("//")
  13. cpp_quote("// Microsoft Windows")
  14. cpp_quote("// Copyright 2001 Microsoft Corporation. All Rights Reserved.")
  15. cpp_quote("//")
  16. cpp_quote("// File: sessions.h")
  17. cpp_quote("//")
  18. cpp_quote("//--------------------------------------------------------------------------")
  19. import "objidl.idl";
  20. import "oleidl.idl";
  21. import "oaidl.idl";
  22. import "lock.idl";
  23. #endif // __MKTYPLIB__
  24. #include "mdispid.h"
  25. #ifdef __MKTYPLIB__
  26. //--------------------------------------------------------------------------
  27. // Type Library
  28. [
  29. uuid(53CED51D-432B-45b2-A3E0-0CE2C24235D4), // LIBID_MsgrSessionManager
  30. version(1.0),
  31. helpstring("Messenger Session Manager Type Library")
  32. ]
  33. library MsgrSessionManager
  34. {
  35. importlib("stdole32.tlb");
  36. importlib("lock.tlb");
  37. #endif // __MKTYPLIB__
  38. interface IMsgrSessionManager;
  39. interface IMsgrSession;
  40. typedef enum
  41. {
  42. SS_UNKNOWN,
  43. SS_READY,
  44. SS_INVITATION,
  45. SS_ACCEPTED,
  46. SS_CONNECTED,
  47. SS_CANCELLED,
  48. SS_DECLINED,
  49. SS_TERMINATED,
  50. } SESSION_STATE;
  51. #define SESS_E(e) (0x81000600 + (e))
  52. typedef enum
  53. {
  54. SR_APPLICATION_LAUNCH_FAILED = SESS_E(0x01),
  55. SR_INVITATION_DECLINED = SESS_E(0x02),
  56. SR_CONNECTION_FAILURE = SESS_E(0x03),
  57. SR_AUTHENTICATION_FAILED = SESS_E(0x04),
  58. SR_SESSION_NOT_READY = SESS_E(0x05),
  59. SR_SESSION_CANCELLED_LOCAL = SESS_E(0x06),
  60. SR_SESSION_CANCELLED_REMOTE = SESS_E(0x07),
  61. SR_SESSION_PROTOCOL_ERROR = SESS_E(0x08),
  62. SR_SESSION_TIMEOUT = SESS_E(0x09),
  63. SR_CANCEL_BEFORE_CONNECT = SESS_E(0x0a),
  64. SR_NOT_INVITEE = SESS_E(0x0b),
  65. SR_NOT_INVITER = SESS_E(0x0c),
  66. SR_APP_ALREADY_REGISTERED = SESS_E(0x0d),
  67. SR_APP_NOT_REGISTERED = SESS_E(0x0e),
  68. SR_NOT_VALID_FOR_APP_INVITE = SESS_E(0x0f),
  69. SR_APP_NOT_SPECIFIED = SESS_E(0x10),
  70. SR_CONTEXT_DATA_OVER_LIMIT = SESS_E(0x11),
  71. SR_NO_USER_INVITED = SESS_E(0x12),
  72. SR_INVITED_SELF = SESS_E(0x13),
  73. SR_SESSION_STATE_INVALID = SESS_E(0x14),
  74. SR_INVITATION_SEND_FAILURE = SESS_E(0x15),
  75. SR_CANCEL_SEND_FAILURE = SESS_E(0x16),
  76. SR_DECLINE_SEND_FAILURE = SESS_E(0x17),
  77. SR_ACCEPT_SEND_FAILURE = SESS_E(0x18),
  78. SR_CONTEXT_DATA_SEND_FAILURE = SESS_E(0x19),
  79. } SESSION_RESULT;
  80. typedef enum
  81. {
  82. SF_NONE = 0x0000,
  83. SF_INVITER = 0x0001,
  84. SF_INVITEE = 0x0002,
  85. SF_APP_INVITE_COMPATIBLE= 0x0004,
  86. } SESSION_FLAGS;
  87. //--------------------------------------------------------------------------
  88. // IMsgrSessionManager Interface
  89. [
  90. uuid(305D86C6-6896-4099-91F5-CB7BA7733563), // IID_IMsgrSessionManager
  91. helpstring("Messenger Session Manager Interface"),
  92. dual,
  93. oleautomation
  94. ]
  95. interface IMsgrSessionManager : IDispatch
  96. {
  97. [id(0),
  98. helpstring("Create a new Session object."), helpcontext(0)]
  99. HRESULT CreateSession(
  100. [out, retval] IDispatch **ppSession);
  101. [id(1),
  102. helpstring("Retrieves the session which launched the application."), helpcontext(0)]
  103. HRESULT GetLaunchingSession(
  104. [in] LONG lProcessID,
  105. [out, retval] IDispatch **ppSession);
  106. [id(2),
  107. helpstring("Register an app for use with Session Manager."), helpcontext(0)]
  108. HRESULT RegisterApplication(
  109. [in] BSTR bstrAppGUID,
  110. [in] BSTR bstrAppName,
  111. [in] BSTR bstrAppURL,
  112. [in] BSTR bstrPath,
  113. [in] LONG ulFlags);
  114. [id(3),
  115. helpstring("Remove an app from the list."), helpcontext(0)]
  116. HRESULT UnRegisterApplication(
  117. [in] BSTR bstrAppGUID);
  118. [propget,
  119. id(4),
  120. helpstring("Get the collection of applications."), helpcontext(0)]
  121. HRESULT Applications(
  122. [out, retval] IDispatch **ppDisp);
  123. }
  124. //--------------------------------------------------------------------------
  125. // DMsgrSessionManagerEvents Interface
  126. [
  127. uuid(52AC8B62-8F88-46ca-902A-1F9106B0A9F4), // DIID_DMsgrSessionManagerEvents
  128. helpstring("Messenger Events for Session Manager Interface")
  129. ]
  130. dispinterface DMsgrSessionManagerEvents
  131. {
  132. properties:
  133. methods:
  134. [id(DISPID_ONINVITATION),
  135. helpstring("A new session invitation has been received."), helpcontext(0)]
  136. void OnInvitation(
  137. [in] IDispatch *pSession,
  138. [in] BSTR bstrAppData,
  139. [in, out] VARIANT_BOOL *pfHandled);
  140. [id(DISPID_ONAPPREGISTERED),
  141. helpstring("A new application has been registered."), helpcontext(0)]
  142. void OnAppRegistered(
  143. [in] BSTR bstrAppGUID);
  144. [id(DISPID_ONAPPUNREGISTERED),
  145. helpstring("An application has been unregistered."), helpcontext(0)]
  146. void OnAppUnRegistered(
  147. [in] BSTR bstrAppGUID);
  148. [id(DISPID_ONLOCKCHALLENGE), helpstring("Challenge from server received."), helpcontext(0x0000)]
  149. void OnLockChallenge(
  150. [in] BSTR bstrChallenge,
  151. [in] long lCookie);
  152. [id(DISPID_ONLOCKRESULT), helpstring("Result from server lock and key service."), helpcontext(0x0000)]
  153. void OnLockResult(
  154. [in] VARIANT_BOOL fSucceed,
  155. [in] long lCookie);
  156. [id(DISPID_ONLOCKENABLE), helpstring("Enable/disable lock and key."), helpcontext(0x0000)]
  157. void OnLockEnable(
  158. [in] VARIANT_BOOL fEnable);
  159. [id(DISPID_ONAPPSHUTDOWN), helpstring("Messenger is shutting down."), helpcontext(0x0000)]
  160. void OnAppShutdown();
  161. }
  162. //--------------------------------------------------------------------------
  163. // IMsgrSession Interface
  164. [
  165. uuid(42D7CAFC-0167-4941-A5D8-9FD7F104C41A), // IID_IMsgrSession
  166. helpstring("Messenger Session Interface"),
  167. oleautomation,
  168. dual
  169. ]
  170. interface IMsgrSession : IDispatch
  171. {
  172. [propget,
  173. id(0),
  174. helpstring("Obtains the application GUID set by the inviter for this session."), helpcontext(0)]
  175. HRESULT Application(
  176. [out, retval] BSTR *pbstrAppGUID);
  177. [propput,
  178. id(0),
  179. helpstring("Sets the application GUID for the session."), helpcontext(0)]
  180. HRESULT Application(
  181. [in] BSTR bstrAppGUID);
  182. [propget,
  183. id(1),
  184. helpstring("Gets the current state of the session."), helpcontext(0)]
  185. HRESULT State(
  186. [out, retval] SESSION_STATE *pState);
  187. [id(2),
  188. helpstring("Invites user to this session."), helpcontext(0)]
  189. HRESULT Invite(
  190. [in] IDispatch *pUser,
  191. [in] BSTR bstrAppData);
  192. [id(3),
  193. helpstring("Decline an invitation."), helpcontext(0)]
  194. HRESULT Decline(
  195. [in] BSTR bstrAppData);
  196. [id(4),
  197. helpstring("Cancel an invitation."), helpcontext(0)]
  198. HRESULT Cancel(
  199. [in] long hr,
  200. [in] BSTR bstrAppData);
  201. [id(5),
  202. helpstring("Accept an invitation."), helpcontext(0)]
  203. HRESULT Accept(
  204. [in] BSTR bstrAppData);
  205. [propget,
  206. id(6),
  207. helpstring("Retrieve the IP address of the other party in the session."), helpcontext(0)]
  208. HRESULT RemoteAddress(
  209. [out, retval] BSTR *pbstrRemoteAddress);
  210. [propget,
  211. id(7),
  212. helpstring("Retrieve session ID."), helpcontext(0)]
  213. HRESULT SessionID(
  214. [out, retval] BSTR *pbstrSessionID);
  215. [propget,
  216. id(8),
  217. helpstring("Retrieve the app-specific context data."), helpcontext(0)]
  218. HRESULT ContextData(
  219. [out, retval] BSTR *pbstrData);
  220. [propget,
  221. id(9),
  222. helpstring("Retrieve the application name."), helpcontext(0)]
  223. HRESULT ApplicationName(
  224. [out, retval] BSTR *pbstrName);
  225. [propget,
  226. id(10),
  227. helpstring("Retrieve the application URL."), helpcontext(0)]
  228. HRESULT ApplicationURL(
  229. [out, retval] BSTR *pbstrURL);
  230. [propget,
  231. id(11),
  232. helpstring("Retrieve the session flags."), helpcontext(0)]
  233. HRESULT Flags(
  234. [out, retval] LONG *plFlags);
  235. [propget,
  236. id(12),
  237. helpstring("Retrieve the other user."), helpcontext(0)]
  238. HRESULT User(
  239. [out, retval] IDispatch **ppUser);
  240. [propput,
  241. id(13),
  242. helpstring("Set the local IP address of the session."), helpcontext(0)]
  243. HRESULT LocalAddress(
  244. [in] BSTR bstrLocalAddress);
  245. [propget,
  246. id(13),
  247. helpstring("Retrieve the local IP address of the session."), helpcontext(0)]
  248. HRESULT LocalAddress(
  249. [out, retval] BSTR *pbstrLocalAddress);
  250. [id(14),
  251. helpstring("Send app-specific context data."), helpcontext(0)]
  252. HRESULT SendContextData(
  253. [in] BSTR bstrData);
  254. }
  255. //--------------------------------------------------------------------------
  256. // DMsgrSessionEvents Interface
  257. [
  258. uuid(1847A74F-2E7F-43af-B7F9-55A4DE3276F5), // DIID_DMsgrSessionEvents
  259. helpstring("Messenger Events for Session Interface")
  260. ]
  261. dispinterface DMsgrSessionEvents
  262. {
  263. properties:
  264. methods:
  265. [id(DISPID_ONSTATECHANGED),
  266. helpstring("The session state has changed from prevState."), helpcontext(0)]
  267. void OnStateChanged(
  268. [in] SESSION_STATE prevState);
  269. [id(DISPID_ONAPPNOTPRESENT),
  270. helpstring("The app for the invitation is not present."), helpcontext(0)]
  271. void OnAppNotPresent(
  272. [in] BSTR bstrAppName,
  273. [in] BSTR bstrAppURL);
  274. [id(DISPID_ONACCEPTED),
  275. helpstring("The invitee has accepted the invitation."), helpcontext(0)]
  276. void OnAccepted(BSTR bstrAppData);
  277. [id(DISPID_ONDECLINED),
  278. helpstring("The invitee has declined the invitation."), helpcontext(0)]
  279. void OnDeclined(BSTR bstrAppData);
  280. [id(DISPID_ONCANCELLED),
  281. helpstring("The session has been cancelled."), helpcontext(0)]
  282. void OnCancelled(BSTR bstrAppData);
  283. [id(DISPID_ONTERMINATION),
  284. helpstring("The session has ended."), helpcontext(0)]
  285. void OnTermination(
  286. [in] long hr,
  287. [in] BSTR bstrAppData);
  288. [id(DISPID_ONREADYTOLAUNCH),
  289. helpstring("The session is approved for launch."), helpcontext(0)]
  290. void OnReadyToLaunch();
  291. [id(DISPID_ONCONTEXTDATA),
  292. helpstring("New context data has arrived."), helpcontext(0)]
  293. void OnContextData(
  294. [in] BSTR bstrContextData);
  295. [id(DISPID_ONSENDERROR),
  296. helpstring("The last operation failed when sending."), helpcontext(0)]
  297. void OnSendError(
  298. [in] long hr);
  299. }
  300. #ifndef __MKTYPLIB__
  301. //--------------------------------------------------------------------------
  302. // Type Library
  303. [
  304. uuid(53CED51D-432B-45b2-A3E0-0CE2C24235D4), // LIBID_MsgrSessionManager
  305. version(1.0),
  306. helpstring("Messenger Session Manager Type Library")
  307. ]
  308. library MsgrSessionManager
  309. {
  310. importlib("stdole32.tlb");
  311. #endif // __MKTYPLIB__
  312. //--------------------------------------------------------------------------
  313. // Messenger session manager class definition
  314. [
  315. uuid(E3A3B1D9-5675-43c0-BF04-37BE11939FB7), // CLSID_MsgrSessionManager
  316. helpstring("Messenger Session Manager Object")
  317. ]
  318. coclass MsgrSessionManager
  319. {
  320. [default] interface IMsgrSessionManager;
  321. [default, source] dispinterface DMsgrSessionManagerEvents;
  322. };
  323. };
  324. /* end */