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.

289 lines
15 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // MSOBWEB.H - Header for the implementation of CObWebBrowser
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. //
  12. // Class which will call up an IOleSite and the WebOC
  13. // and provide external interfaces.
  14. #ifndef _MSOBCOMM_H_
  15. #define _MSOBCOMM_H_
  16. #include <ocidl.h> //For IConnectionPoint
  17. #include "cunknown.h"
  18. #include "cfactory.h"
  19. #include "obcomm.h"
  20. #include "Cntpoint.h"
  21. #include "refdial.h"
  22. #include "webgate.h"
  23. #include "icsmgr.h"
  24. #include "homenet.h"
  25. #include "connmgr.h"
  26. class CObCommunicationManager : public CUnknown,
  27. public IObCommunicationManager2,
  28. public DObCommunicationEvents,
  29. public IConnectionPointContainer
  30. {
  31. // Declare the delegating IUnknown.
  32. DECLARE_IUNKNOWN
  33. public:
  34. static HRESULT CreateInstance (IUnknown* pOuterUnknown, CUnknown** ppNewComponent);
  35. // IObCommunicationManager Members
  36. virtual HRESULT __stdcall ListenToCommunicationEvents (IUnknown* pUnk);
  37. // RAS Dialing methods
  38. virtual HRESULT __stdcall CheckDialReady(DWORD *pdwRetVal) ;
  39. virtual HRESULT __stdcall SetupForDialing(UINT nType, BSTR bstrISPFile, DWORD dwCountry, BSTR bstrAreaCode, DWORD dwFlag, DWORD dwAppMode, DWORD dwMigISPIdx);
  40. virtual HRESULT __stdcall DoConnect(BOOL *pbRetVal) ;
  41. virtual HRESULT __stdcall DoHangup() ;
  42. virtual HRESULT __stdcall GetDialPhoneNumber(BSTR *pVal);
  43. virtual HRESULT __stdcall PutDialPhoneNumber(BSTR newVal);
  44. virtual HRESULT __stdcall GetDialErrorMsg(BSTR *pVal);
  45. virtual HRESULT __stdcall GetSupportNumber(BSTR *pVal);
  46. virtual HRESULT __stdcall RemoveConnectoid(BOOL *pbRetVal);
  47. virtual HRESULT __stdcall SetRASCallbackHwnd(HWND hwndCallback);
  48. virtual HRESULT __stdcall GetSignupURL(BSTR *pVal);
  49. virtual HRESULT __stdcall GetReconnectURL(BSTR *pVal);
  50. virtual HRESULT __stdcall CheckPhoneBook(BSTR bstrISPFile, DWORD dwCountry, BSTR bstrAreaCode, DWORD dwFlag, BOOL *pbRetVal);
  51. virtual HRESULT __stdcall RestoreConnectoidInfo() ;
  52. virtual HRESULT __stdcall SetPreloginMode(BOOL bVal);
  53. virtual HRESULT __stdcall GetConnectionType(DWORD * pdwVal);
  54. virtual HRESULT __stdcall CheckKbdMouse(DWORD *pdwRetVal) ;
  55. virtual HRESULT __stdcall OnDownloadEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL* bHandled);
  56. virtual HRESULT __stdcall GetISPList(BSTR* pVal);
  57. virtual HRESULT __stdcall Set_SelectISP(UINT nVal);
  58. virtual HRESULT __stdcall Set_ConnectionMode(UINT nVal);
  59. virtual HRESULT __stdcall Get_ConnectionMode(UINT* pnVal);
  60. virtual HRESULT __stdcall DownloadReferralOffer(BOOL *pbVal);
  61. virtual HRESULT __stdcall DownloadISPOffer(BOOL *pbVal, BSTR *pVal);
  62. virtual HRESULT __stdcall Get_ISPName(BSTR *pVal);
  63. virtual HRESULT __stdcall RemoveDownloadDir() ;
  64. virtual HRESULT __stdcall PostRegData(DWORD dwSrvType, BSTR bstrRegUrl);
  65. virtual HRESULT __stdcall Connect(UINT nType, BSTR bstrISPFile, DWORD dwCountry, BSTR bstrAreaCode, DWORD dwFlag, DWORD dwAppMode);
  66. virtual HRESULT __stdcall CheckStayConnected(BSTR bstrISPFile, BOOL *pbVal);
  67. virtual HRESULT __stdcall CheckOnlineStatus(BOOL *pbVal);
  68. virtual HRESULT __stdcall GetPhoneBookNumber(BSTR *pVal);
  69. virtual HRESULT __stdcall SetDialAlternative(BOOL bVal);
  70. // WebGate html download methods
  71. virtual HRESULT __stdcall FetchPage(BSTR szURL, BSTR* szLocalFile);
  72. virtual HRESULT __stdcall DownloadFileBuffer(BSTR *pVal);
  73. virtual HRESULT __stdcall GetFile(BSTR szURL, BSTR szFileFullName);
  74. // INS processing methods
  75. virtual HRESULT __stdcall ProcessINS(BSTR bstrINSFilePath, BOOL *pbRetVal);
  76. // IConnectionPointContainer Methods
  77. virtual HRESULT __stdcall EnumConnectionPoints(IEnumConnectionPoints **ppEnum) ;
  78. virtual HRESULT __stdcall FindConnectionPoint(REFIID riid, IConnectionPoint **ppCP) ;
  79. //IObCommunicationEvents
  80. STDMETHOD (GetTypeInfoCount) (UINT* pcInfo);
  81. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo** );
  82. STDMETHOD (GetIDsOfNames) (REFIID, OLECHAR**, UINT, LCID, DISPID* );
  83. STDMETHOD (Invoke) (DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
  84. //IObCommunicationEvents Members
  85. virtual HRESULT Fire_Dialing (DWORD dwDialStatus);
  86. virtual HRESULT Fire_Connecting ();
  87. virtual HRESULT Fire_DialError (DWORD dwErrorCode);
  88. virtual HRESULT Fire_ConnectionComplete ();
  89. virtual HRESULT Fire_DownloadComplete (BSTR pVal);
  90. //ICS Routines
  91. virtual HRESULT __stdcall CreateIcsBot(DWORD *pdwRetVal);
  92. virtual HRESULT __stdcall IsIcsAvailable(BOOL *bRetVal);
  93. virtual HRESULT __stdcall IsCallbackUsed(BOOL *bRetVal);
  94. virtual HRESULT __stdcall NotifyIcsMgr(UINT msg, WPARAM wParam, LPARAM lParam);
  95. virtual HRESULT __stdcall NotifyIcsUsage(BOOL bParam);
  96. virtual HRESULT __stdcall TriggerIcsCallback(BOOL bParam);
  97. virtual HRESULT __stdcall IsIcsHostReachable(BOOL *bParam);
  98. //IObCommunicationManager2 Methods
  99. STDMETHOD(CreateModemConnectoid) (BSTR bstrPhoneBook,
  100. BSTR bstrConnectionName,
  101. DWORD dwCountryID,
  102. DWORD dwCountryCode,
  103. BSTR bstrAreaCode,
  104. BSTR bstrPhoneNumber,
  105. BOOL fAutoIPAddress,
  106. DWORD ipaddr_A,
  107. DWORD ipaddr_B,
  108. DWORD ipaddr_C,
  109. DWORD ipaddr_D,
  110. BOOL fAutoDNS,
  111. DWORD ipaddrDns_A,
  112. DWORD ipaddrDns_B,
  113. DWORD ipaddrDns_C,
  114. DWORD ipaddrDns_D,
  115. DWORD ipaddrDnsAlt_A,
  116. DWORD ipaddrDnsAlt_B,
  117. DWORD ipaddrDnsAlt_C,
  118. DWORD ipaddrDnsAlt_D,
  119. BSTR bstrUserName,
  120. BSTR bstrPassword);
  121. STDMETHOD(CreatePppoeConnectoid) (BSTR bstrPhoneBook,
  122. BSTR bstrConnectionName,
  123. BSTR bstrBroadbandService,
  124. BOOL fAutoIPAddress,
  125. DWORD ipaddr_A,
  126. DWORD ipaddr_B,
  127. DWORD ipaddr_C,
  128. DWORD ipaddr_D,
  129. BOOL fAutoDNS,
  130. DWORD ipaddrDns_A,
  131. DWORD ipaddrDns_B,
  132. DWORD ipaddrDns_C,
  133. DWORD ipaddrDns_D,
  134. DWORD ipaddrDnsAlt_A,
  135. DWORD ipaddrDnsAlt_B,
  136. DWORD ipaddrDnsAlt_C,
  137. DWORD ipaddrDnsAlt_D,
  138. BSTR bstrUserName,
  139. BSTR bstrPassword
  140. );
  141. STDMETHOD(CreateConnectoid) (BSTR bstrPhoneBook,
  142. BSTR bstrConnectionName,
  143. DWORD dwCountryID,
  144. DWORD dwCountryCode,
  145. BSTR bstrAreaCode,
  146. BSTR bstrPhoneNumber,
  147. BOOL fAutoIPAddress,
  148. DWORD ipaddr_A,
  149. DWORD ipaddr_B,
  150. DWORD ipaddr_C,
  151. DWORD ipaddr_D,
  152. BOOL fAutoDNS,
  153. DWORD ipaddrDns_A,
  154. DWORD ipaddrDns_B,
  155. DWORD ipaddrDns_C,
  156. DWORD ipaddrDns_D,
  157. DWORD ipaddrDnsAlt_A,
  158. DWORD ipaddrDnsAlt_B,
  159. DWORD ipaddrDnsAlt_C,
  160. DWORD ipaddrDnsAlt_D,
  161. BSTR bstrUserName,
  162. BSTR bstrPassword,
  163. BSTR bstrDeviceName,
  164. BSTR bstrDeviceType,
  165. DWORD dwEntryOptions,
  166. DWORD dwEntryType);
  167. STDMETHOD(SetPreferredConnectionTcpipProperties)
  168. (BOOL fAutoIPAddress,
  169. DWORD StaticIp_A,
  170. DWORD StaticIp_B,
  171. DWORD StaticIp_C,
  172. DWORD StaticIp_D,
  173. DWORD SubnetMask_A,
  174. DWORD SubnetMask_B,
  175. DWORD SubnetMask_C,
  176. DWORD SubnetMask_D,
  177. DWORD DefGateway_A,
  178. DWORD DefGateway_B,
  179. DWORD DefGateway_C,
  180. DWORD DefGateway_D,
  181. BOOL fAutoDns,
  182. DWORD DnsPref_A,
  183. DWORD DnsPref_B,
  184. DWORD DnsPref_C,
  185. DWORD DnsPref_D,
  186. DWORD DnsAlt_A,
  187. DWORD DnsAlt_B,
  188. DWORD DnsAlt_C,
  189. DWORD DnsAlt_D,
  190. BOOL fFirewallRequired
  191. );
  192. STDMETHOD(DoFinalTasks) (BOOL* pfRebootRequired);
  193. STDMETHOD(GetConnectionCapabilities) (DWORD* pdwConnectionCapabilities);
  194. STDMETHOD(GetPreferredConnection) (DWORD* pdwPreferredConnection);
  195. STDMETHOD(SetPreferredConnection) (const DWORD dwPreferredConnection,
  196. BOOL* pfSupportedType);
  197. STDMETHOD(ConnectedToInternet) (BOOL* pfConnected);
  198. STDMETHOD(ConnectedToInternetEx) (BOOL* pfConnected);
  199. STDMETHOD(AsyncConnectedToInternetEx) (const HWND hwnd);
  200. STDMETHOD(OobeAutodial) ();
  201. STDMETHOD(OobeAutodialHangup) ();
  202. STDMETHOD(FirewallPreferredConnection) (BOOL fFirewall);
  203. STDMETHOD(UseWinntProxySettings) ();
  204. STDMETHOD(DisableWinntProxySettings) ();
  205. STDMETHOD(GetProxySettings) (BOOL* pbUseAuto,
  206. BOOL* pbUseScript,
  207. BSTR* pszScriptUrl,
  208. BOOL* pbUseProxy,
  209. BSTR* pszProxy
  210. );
  211. STDMETHOD(SetProxySettings) (BOOL bUseAuto,
  212. BOOL bUseScript,
  213. BSTR szScriptUrl,
  214. BOOL bUseProxy,
  215. BSTR szProxy
  216. );
  217. BSTR GetPreferredModem ();
  218. STDMETHOD(SetICWCompleted) (BOOL bMultiUser);
  219. STDMETHOD(GetPublicLanCount) (int* pcPublicLan);
  220. STDMETHOD(SetExclude1394) (BOOL bExclude);
  221. STDMETHOD(GnsAutodial) (BOOL bEnabled,
  222. BSTR bstrUserSection
  223. );
  224. HWND m_hwndCallBack;
  225. CRefDial* m_pRefDial;
  226. BOOL m_pbPreLogin;
  227. private:
  228. DWORD m_dwcpCookie;
  229. HRESULT ConnectToConnectionPoint (IUnknown* punkThis,
  230. REFIID riidEvent,
  231. BOOL fConnect,
  232. IUnknown* punkTarget,
  233. DWORD* pdwCookie,
  234. IConnectionPoint** ppcpOut);
  235. // IUnknown
  236. virtual HRESULT __stdcall NondelegatingQueryInterface( const IID& iid, void** ppv);
  237. CObCommunicationManager (IUnknown* pOuterUnknown);
  238. virtual ~CObCommunicationManager ();
  239. virtual void FinalRelease (); // Notify derived classes that we are releasing
  240. // Connection Point support
  241. CConnectionPoint* m_pConnectionPoint;
  242. CWebGate* m_pWebGate;
  243. CINSHandler* m_InsHandler;
  244. CIcsMgr* m_IcsMgr;
  245. IDispatch* m_pDisp;
  246. BOOL m_bIsIcsUsed;
  247. static INT m_nNumListener;
  248. WCHAR m_szExternalConnectoid[RAS_MaxEntryName];
  249. CConnectionManager m_ConnectionManager;
  250. CEnumModem m_EnumModem;
  251. BOOL m_bFirewall;
  252. BOOL m_bAutodialCleanup;
  253. };
  254. LRESULT
  255. RegQueryOobeValue(
  256. LPCWSTR szValue,
  257. LPBYTE pBuffer,
  258. DWORD* pcbBuffer
  259. );
  260. #endif