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.

124 lines
3.6 KiB

  1. #ifndef _IAS_H_
  2. #define _IAS_H_
  3. typedef UINT IAS_GCC_ID;
  4. // GetPersonStatus()
  5. #define IAS_SHARING_NOTHING 0x0000
  6. #define IAS_SHARING_DESKTOP 0x0001
  7. typedef enum
  8. {
  9. IAS_VERSION_10 = 1,
  10. }
  11. IAS_VERSION;
  12. typedef struct
  13. {
  14. UINT cbSize;
  15. BOOL InShare; // Participating in share
  16. IAS_VERSION Version; // AS protocol version
  17. UINT AreSharing; // What person is sharing (IAS_SHARING_)
  18. BOOL Controllable; // Is person controllable
  19. IAS_GCC_ID InControlOfPending; // Whom we are waiting to control
  20. IAS_GCC_ID InControlOf; // Whom is controlled by person
  21. IAS_GCC_ID ControlledByPending;// Whom we are waiting to be controlled by
  22. IAS_GCC_ID ControlledBy; // Who is controlling person
  23. }
  24. IAS_PERSON_STATUS;
  25. // lonchanc
  26. // In general, S_OK means success, E_*** means failure
  27. // For boolean values, S_OK means TRUE, S_FALSE means FALSE, and E_*** means failure.
  28. #undef INTERFACE
  29. #define INTERFACE IAppSharing
  30. // lonchanc: the idea of this IAppSharing is per call interface
  31. DECLARE_INTERFACE_(IAppSharing, IUnknown)
  32. {
  33. STDMETHOD(QueryInterface)(THIS_ REFIID, void **) PURE;
  34. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  35. STDMETHOD_(ULONG, Release)(THIS) PURE;
  36. //
  37. // INFORMATION
  38. //
  39. STDMETHOD_(BOOL, IsSharingAvailable)(THIS) PURE;
  40. STDMETHOD_(BOOL, CanShareNow)(THIS) PURE;
  41. STDMETHOD_(BOOL, IsInShare)(THIS) PURE;
  42. STDMETHOD_(BOOL, IsSharing)(THIS) PURE;
  43. STDMETHOD_(BOOL, CanAllowControl)(THIS) PURE;
  44. STDMETHOD_(BOOL, IsControllable)(THIS) PURE;
  45. STDMETHOD(GetPersonStatus)(THIS_ IAS_GCC_ID Person, IAS_PERSON_STATUS *pStatus) PURE;
  46. //
  47. // SHARING
  48. //
  49. STDMETHOD(ShareDesktop)(THIS) PURE;
  50. STDMETHOD(UnshareDesktop)(THIS) PURE;
  51. //
  52. // CONTROL
  53. //
  54. // On host
  55. STDMETHOD(AllowControl)(THIS_ BOOL fAllowed) PURE;
  56. // From person controlling to person controlled
  57. STDMETHOD(TakeControl)(THIS_ IAS_GCC_ID PersonOf) PURE;
  58. STDMETHOD(CancelTakeControl)(THIS_ IAS_GCC_ID PersonOf) PURE;
  59. STDMETHOD(ReleaseControl)(THIS_ IAS_GCC_ID PersonOf) PURE;
  60. STDMETHOD(PassControl)(THIS_ IAS_GCC_ID PersonOf, IAS_GCC_ID PersonTo) PURE;
  61. // From person controlled
  62. STDMETHOD(GiveControl)(THIS_ IAS_GCC_ID PersonTo) PURE;
  63. STDMETHOD(CancelGiveControl)(THIS_ IAS_GCC_ID PersonTo) PURE;
  64. STDMETHOD(RevokeControl)(THIS_ IAS_GCC_ID PersonFrom) PURE;
  65. };
  66. // IAppSharingNotify interface
  67. DECLARE_INTERFACE_(IAppSharingNotify, IUnknown)
  68. {
  69. STDMETHOD(QueryInterface)(THIS_ REFIID, void**) PURE;
  70. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  71. STDMETHOD_(ULONG, Release)(THIS) PURE;
  72. STDMETHOD(OnReadyToShare)(THIS_ BOOL fReady) PURE;
  73. STDMETHOD(OnShareStarted)(THIS) PURE;
  74. STDMETHOD(OnSharingStarted)(THIS) PURE;
  75. STDMETHOD(OnShareEnded)(THIS) PURE;
  76. STDMETHOD(OnPersonJoined)(THIS_ IAS_GCC_ID gccID) PURE;
  77. STDMETHOD(OnPersonLeft)(THIS_ IAS_GCC_ID gccID) PURE;
  78. STDMETHOD(OnStartInControl)(THIS_ IAS_GCC_ID gccOf) PURE;
  79. STDMETHOD(OnStopInControl)(THIS_ IAS_GCC_ID gccOf) PURE;
  80. STDMETHOD(OnControllable)(THIS_ BOOL fControllable) PURE;
  81. STDMETHOD(OnStartControlled)(THIS_ IAS_GCC_ID gccBy) PURE;
  82. STDMETHOD(OnStopControlled)(THIS_ IAS_GCC_ID gccBy) PURE;
  83. };
  84. //
  85. // AS flags:
  86. //
  87. #define AS_SERVICE 0x0001 // Is this service context?
  88. #define AS_UNATTENDED 0x0002 // Is this unattended (no end user)?
  89. HRESULT WINAPI CreateASObject(IAppSharingNotify * pNotify, UINT flags, IAppSharing** ppAS);
  90. #endif // _IAS_H_