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.

160 lines
4.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: Invoke.h
  7. //
  8. // Contents: Private Invoke interface for kicking off Synchronizations
  9. //
  10. // Classes: CSynchronizeInvoke
  11. //
  12. // Notes:
  13. //
  14. // History: 05-Nov-97 rogerg Created.
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef _SYNCINVOKE_
  18. #define _SYNCINVOKE_
  19. #ifdef _SENS
  20. #include <sensevts.h> // Review - must be real path
  21. #endif // _SENS
  22. class CSynchronizeInvoke : public IPrivSyncMgrSynchronizeInvoke
  23. {
  24. public:
  25. CSynchronizeInvoke(void);
  26. ~CSynchronizeInvoke();
  27. // default controlling unknown.
  28. class CPrivUnknown : public IUnknown
  29. {
  30. public:
  31. STDMETHOD(QueryInterface) ( REFIID riid, LPVOID FAR* ppvObj);
  32. STDMETHOD_(ULONG,AddRef) (void);
  33. STDMETHOD_(ULONG,Release) (void);
  34. inline void SetParent(CSynchronizeInvoke *pSynchInvoke) { m_pSynchInvoke = pSynchInvoke; };
  35. private:
  36. CSynchronizeInvoke *m_pSynchInvoke;
  37. };
  38. friend class CPrivUnknown;
  39. CPrivUnknown m_Unknown;
  40. //IUnknown members
  41. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  42. STDMETHODIMP_(ULONG) AddRef();
  43. STDMETHODIMP_(ULONG) Release();
  44. // IOfflineSynchronizeInvoke Methods
  45. STDMETHODIMP UpdateItems(DWORD dwInvokeFlags,REFCLSID rclsid,DWORD cbCookie,const BYTE*lpCookie);
  46. STDMETHODIMP UpdateAll(void);
  47. // private methods
  48. STDMETHODIMP Logon();
  49. STDMETHODIMP Logoff();
  50. STDMETHODIMP Schedule(WCHAR *pszTaskName);
  51. STDMETHODIMP Idle();
  52. STDMETHODIMP RasPendingDisconnect(DWORD cbConnectionName,const BYTE *lpConnectionName);
  53. #ifdef _SENS
  54. class CPrivSensNetwork : public ISensNetwork
  55. {
  56. public:
  57. STDMETHOD(QueryInterface) ( REFIID riid, LPVOID FAR* ppvObj);
  58. STDMETHOD_(ULONG,AddRef) (void);
  59. STDMETHOD_(ULONG,Release) (void);
  60. // Dispatch Methods
  61. STDMETHOD (GetTypeInfoCount) (UINT *);
  62. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo **);
  63. STDMETHOD (GetIDsOfNames) (REFIID, LPOLESTR *, UINT, LCID, DISPID *);
  64. STDMETHOD (Invoke) (DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
  65. // ISensNetwork
  66. STDMETHOD (ConnectionMade) (BSTR, ULONG, LPSENS_QOCINFO);
  67. STDMETHOD (ConnectionMadeNoQOCInfo) (BSTR, ULONG);
  68. STDMETHOD (ConnectionLost) (BSTR, ULONG);
  69. STDMETHOD (BeforeDisconnect) (BSTR, ULONG);
  70. STDMETHOD (DestinationReachable) (BSTR, BSTR, ULONG, LPSENS_QOCINFO);
  71. STDMETHOD (DestinationReachableNoQOCInfo) (BSTR, BSTR, ULONG);
  72. inline void SetParent(CSynchronizeInvoke *pSynchInvoke) { m_pSynchInvoke = pSynchInvoke; };
  73. private:
  74. CSynchronizeInvoke *m_pSynchInvoke;
  75. };
  76. friend class CPrivSensNetwork;
  77. CPrivSensNetwork m_PrivSensNetwork;
  78. class CPrivSensLogon : public ISensLogon
  79. {
  80. public:
  81. STDMETHOD(QueryInterface) ( REFIID riid, LPVOID FAR* ppvObj);
  82. STDMETHOD_(ULONG,AddRef) (void);
  83. STDMETHOD_(ULONG,Release) (void);
  84. // Dispatch Methods
  85. STDMETHOD (GetTypeInfoCount) (UINT *);
  86. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo **);
  87. STDMETHOD (GetIDsOfNames) (REFIID, LPOLESTR *, UINT, LCID, DISPID *);
  88. STDMETHOD (Invoke) (DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
  89. // ISensLogon
  90. STDMETHOD (Logon)(BSTR bstrUserName);
  91. STDMETHOD (Logoff)(BSTR bstrUserName);
  92. STDMETHOD (Startup)(BSTR bstrUserName);
  93. STDMETHOD (StartShell)(BSTR bstrUserName);
  94. STDMETHOD (Shutdown)(BSTR bstrUserName);
  95. STDMETHOD (DisplayLock)(BSTR bstrUserName);
  96. STDMETHOD (DisplayUnlock)(BSTR bstrUserName);
  97. STDMETHOD (StartScreenSaver)(BSTR bstrUserName);
  98. STDMETHOD (StopScreenSaver)(BSTR bstrUserName);
  99. inline void SetParent(CSynchronizeInvoke *pSynchInvoke) { m_pSynchInvoke = pSynchInvoke; };
  100. private:
  101. CSynchronizeInvoke *m_pSynchInvoke;
  102. };
  103. friend class CPrivSensLogon;
  104. CPrivSensLogon m_PrivSensLogon;
  105. #endif // _SENS
  106. public:
  107. STDMETHODIMP RunIdle();
  108. private:
  109. STDMETHODIMP PrivUpdateAll(DWORD dwInvokeFlags,DWORD dwSyncFlags,DWORD cbCookie,const BYTE *lpCooke,
  110. DWORD cbNumConnectionNames,TCHAR **ppConnectionNames,
  111. TCHAR *pszScheduleName,BOOL fCanMakeConnection,HANDLE hRasPendingDisconnect,
  112. ULONG ulIdleRetryMinutes,ULONG ulDelayIdleShutDownTime,BOOL fRetryEnabled);
  113. STDMETHODIMP PrivHandleAutoSync(DWORD dwSyncFlags);
  114. STDMETHODIMP PrivAutoSyncOnConnection(DWORD dwSyncFlags,DWORD cbNumConnectionNames,
  115. TCHAR **ppConnectionName,
  116. HANDLE hRasPendingEvent);
  117. STDMETHODIMP GetLogonTypeInfo();
  118. STDMETHODIMP GetNetworkTypeInfo();
  119. DWORD m_cRef;
  120. IUnknown *m_pUnkOuter; // pointer to outer unknown.
  121. ITypeInfo *m_pITypeInfoLogon; // TypeInfo for Sens Logon Event.
  122. ITypeInfo *m_pITypeInfoNetwork; // TypeInfo for Sens Network Event.
  123. };
  124. #endif // _SYNCINVOKE_