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.

666 lines
28 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. ServiceProxy.h
  5. Abstract:
  6. All the interaction with the Help Service is done through this class.
  7. It's responsible for kickstarting the service as late as possible.
  8. Revision History:
  9. Davide Massarenti (dmassare) 07/17/2000
  10. created
  11. Kalyani Narlanka (KalyaniN) 03/15/01
  12. Moved Incident and Encryption Objects from HelpService to HelpCtr to improve Perf.
  13. ******************************************************************************/
  14. #if !defined(__INCLUDED___PCH___SERVICEPROXY_H___)
  15. #define __INCLUDED___PCH___SERVICEPROXY_H___
  16. //
  17. // From HelpServiceTypeLib.idl
  18. //
  19. #include <HelpServiceTypeLib.h>
  20. #include <MPC_COM.h>
  21. #include <Events.h>
  22. #include <HelpSession.h>
  23. #include <Options.h>
  24. #include <ConnectivityLib.h>
  25. #include <OfflineCache.h>
  26. /////////////////////////////////////////////////////////////////////////////
  27. class CPCHProxy_IPCHService;
  28. class CPCHProxy_IPCHUtility;
  29. class CPCHProxy_IPCHUserSettings2;
  30. class CPCHProxy_IPCHSetOfHelpTopics;
  31. class CPCHProxy_IPCHTaxonomyDatabase;
  32. class CPCHHelpCenterExternal;
  33. ////////////////////////////////////////////////////////////////////////////////
  34. ////////////////////////////////////////////////////////////////////////////////
  35. //
  36. // IDispatchEx (We override the default implementation to get a chance to look at the TRUSTED/UNTRUSTED settings)
  37. //
  38. #define INTERNETSECURITY__INVOKEEX() \
  39. STDMETHOD(InvokeEx)( DISPID id , \
  40. LCID lcid , \
  41. WORD wFlags , \
  42. DISPPARAMS* pdp , \
  43. VARIANT* pvarRes , \
  44. EXCEPINFO* pei , \
  45. IServiceProvider* pspCaller ) \
  46. { \
  47. return m_SecurityHandle.ForwardInvokeEx( id, lcid, wFlags, pdp, pvarRes, pei, pspCaller ); \
  48. }
  49. #define INTERNETSECURITY__CHECK_TRUST() __MPC_EXIT_IF_METHOD_FAILS(hr, m_SecurityHandle.IsTrusted())
  50. #define INTERNETSECURITY__CHECK_SYSTEM() __MPC_EXIT_IF_METHOD_FAILS(hr, m_SecurityHandle.IsSystem())
  51. class CPCHSecurityHandle
  52. {
  53. CPCHHelpCenterExternal* m_ext;
  54. IDispatch* m_object;
  55. public:
  56. CPCHSecurityHandle();
  57. void Initialize( /*[in]*/ CPCHHelpCenterExternal* ext, /*[in] */ IDispatch* object );
  58. void Passivate ( );
  59. operator CPCHHelpCenterExternal*() const { return m_ext; }
  60. ////////////////////
  61. HRESULT ForwardInvokeEx( /*[in] */ DISPID id ,
  62. /*[in] */ LCID lcid ,
  63. /*[in] */ WORD wFlags ,
  64. /*[in] */ DISPPARAMS* pdp ,
  65. /*[out]*/ VARIANT* pvarRes ,
  66. /*[out]*/ EXCEPINFO* pei ,
  67. /*[in] */ IServiceProvider* pspCaller );
  68. HRESULT IsTrusted();
  69. HRESULT IsSystem ();
  70. };
  71. /////////////////////////////////////////////////////////////////////////////
  72. /////////////////////////////////////////////////////////////////////////////
  73. namespace AsynchronousTaxonomyDatabase
  74. {
  75. class Notifier;
  76. class QueryStore;
  77. class Engine;
  78. ////////////////////
  79. class NotifyHandle : public CComObjectRootEx<MPC::CComSafeMultiThreadModel> // For locking and reference counting...
  80. {
  81. friend class Notifier;
  82. int m_iType;
  83. CComBSTR m_bstrID;
  84. bool m_fAttached;
  85. HANDLE m_hEvent;
  86. HRESULT m_hr;
  87. CPCHQueryResultCollection* m_pColl;
  88. ////////////////////
  89. HRESULT Init( );
  90. void Bind( /*[in]*/ int iType, /*[in]*/ LPCWSTR szID );
  91. virtual void Call( /*[in]*/ QueryStore* qs );
  92. public:
  93. NotifyHandle();
  94. virtual ~NotifyHandle();
  95. STDMETHOD_(ULONG, AddRef)();
  96. STDMETHOD_(ULONG, Release)();
  97. virtual void Detach();
  98. virtual bool IsAttached();
  99. HRESULT GetData( /*[out]*/ CPCHQueryResultCollection* *pColl );
  100. HRESULT Wait ( /*[in]*/ DWORD dwTimeout = INFINITE );
  101. };
  102. template <class C> class NotifyHandle_Method : public NotifyHandle
  103. {
  104. typedef void (C::*CLASS_METHOD)( /*[in]*/ NotifyHandle* notify );
  105. C* m_pThis;
  106. CLASS_METHOD m_pCallback;
  107. ////////////////////
  108. void Call( /*[in]*/ QueryStore* qs )
  109. {
  110. MPC::SmartLock<_ThreadModel> lock( this );
  111. NotifyHandle::Call( qs );
  112. if(m_pThis)
  113. {
  114. (m_pThis->*m_pCallback)( this );
  115. }
  116. }
  117. public:
  118. NotifyHandle_Method( /*[in]*/ C* pThis, /*[in]*/ CLASS_METHOD pCallback )
  119. {
  120. m_pThis = pThis;
  121. m_pCallback = pCallback;
  122. }
  123. void Detach()
  124. {
  125. MPC::SmartLock<_ThreadModel> lock( this );
  126. NotifyHandle::Detach( qs );
  127. m_pThis = NULL;
  128. }
  129. };
  130. class Notifier : public CComObjectRootEx<MPC::CComSafeMultiThreadModel> // For locking...
  131. {
  132. typedef std::list< NotifyHandle* > List;
  133. typedef List::iterator Iter;
  134. typedef List::const_iterator IterConst;
  135. List m_lstCallback;
  136. ////////////////////
  137. private: // Disable copy constructors...
  138. Notifier ( /*[in]*/ const Notifier& );
  139. Notifier& operator=( /*[in]*/ const Notifier& );
  140. public:
  141. Notifier();
  142. ~Notifier();
  143. ////////////////////
  144. void Notify( /*[in]*/ QueryStore* qs );
  145. ////////////////////
  146. HRESULT AddNotification( /*[in]*/ QueryStore* qs, /*[in]*/ NotifyHandle* nb );
  147. };
  148. ////////////////////
  149. class QueryStore
  150. {
  151. friend class Notifier;
  152. friend class Engine;
  153. int m_iType;
  154. CComBSTR m_bstrID;
  155. CComVariant m_vOption;
  156. bool m_fDone;
  157. HRESULT m_hr;
  158. MPC::CComHGLOBAL m_hgData;
  159. FILETIME m_dLastUsed;
  160. private: // Disable copy constructors...
  161. QueryStore ( /*[in]*/ const QueryStore& );
  162. QueryStore& operator=( /*[in]*/ const QueryStore& );
  163. public:
  164. QueryStore( /*[in]*/ int iType, /*[in]*/ LPCWSTR szID, /*[in]*/ VARIANT* option );
  165. ~QueryStore();
  166. bool LessThen ( /*[in]*/ QueryStore const &qs ) const;
  167. bool NewerThen( /*[in]*/ QueryStore const &qs ) const;
  168. ////////////////////
  169. HRESULT Execute( /*[in]*/ OfflineCache::Handle* handle, /*[in]*/ CPCHProxy_IPCHTaxonomyDatabase* parent, /*[in]*/ bool fForce = false );
  170. HRESULT GetData( /*[out]*/ CPCHQueryResultCollection* *pColl );
  171. void Invalidate();
  172. };
  173. ////////////////////
  174. class Engine :
  175. public MPC::Thread<Engine,IUnknown>,
  176. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>
  177. {
  178. class CompareQueryStores
  179. {
  180. public:
  181. bool operator()( /*[in]*/ const QueryStore *, /*[in]*/ const QueryStore * ) const;
  182. };
  183. typedef std::set<QueryStore *,CompareQueryStores> Set;
  184. typedef Set::iterator Iter;
  185. typedef Set::const_iterator IterConst;
  186. CPCHProxy_IPCHTaxonomyDatabase* m_parent;
  187. Set m_setQueries;
  188. Notifier m_notifier;
  189. ////////////////////
  190. bool LookupCache( /*[out]*/ OfflineCache::Handle& handle );
  191. HRESULT Run();
  192. void InvalidateQueries();
  193. public:
  194. Engine( /*[in]*/ CPCHProxy_IPCHTaxonomyDatabase* parent );
  195. virtual ~Engine();
  196. void Passivate ();
  197. void RefreshConnection();
  198. ////////////////////
  199. HRESULT ExecuteQuery( /*[in]*/ int iType, /*[in]*/ LPCWSTR szID, /*[in]*/ VARIANT* option, /*[in]*/ NotifyHandle* nb );
  200. HRESULT ExecuteQuery( /*[in]*/ int iType, /*[in]*/ LPCWSTR szID, /*[in]*/ VARIANT* option, /*[out, retval]*/ CPCHQueryResultCollection* *ppC );
  201. };
  202. };
  203. ////////////////////////////////////////////////////////////////////////////////
  204. ////////////////////////////////////////////////////////////////////////////////
  205. typedef MPC::SmartLockGeneric<MPC::CComSafeAutoCriticalSection> ProxySmartLock;
  206. class ATL_NO_VTABLE CPCHProxy_IPCHService :
  207. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  208. public MPC::IDispatchExImpl< IPCHService, &IID_IPCHService, &LIBID_HelpServiceTypeLib>
  209. {
  210. CPCHSecurityHandle m_SecurityHandle;
  211. CPCHHelpCenterExternal* m_parent;
  212. MPC::CComSafeAutoCriticalSection m_DirectLock;
  213. MPC::CComPtrThreadNeutral<IPCHService> m_Direct_Service;
  214. bool m_fContentStoreTested;
  215. CPCHProxy_IPCHUtility* m_Utility;
  216. public:
  217. BEGIN_COM_MAP(CPCHProxy_IPCHService)
  218. COM_INTERFACE_ENTRY2(IDispatch, IDispatchEx)
  219. COM_INTERFACE_ENTRY(IDispatchEx)
  220. COM_INTERFACE_ENTRY(IPCHService)
  221. END_COM_MAP()
  222. CPCHProxy_IPCHService();
  223. virtual ~CPCHProxy_IPCHService();
  224. INTERNETSECURITY__INVOKEEX();
  225. ////////////////////
  226. CPCHHelpCenterExternal* Parent () { return m_parent; }
  227. bool IsConnected() { return !!m_Direct_Service; }
  228. ////////////////////
  229. HRESULT ConnectToParent ( /*[in]*/ CPCHHelpCenterExternal* parent );
  230. void Passivate ( );
  231. HRESULT EnsureDirectConnection( /*[out]*/ CComPtr<IPCHService>& svc, /*[in]*/ bool fRefresh = false );
  232. HRESULT EnsureContentStore ( );
  233. HRESULT GetUtility( /*[out]*/ CPCHProxy_IPCHUtility* *pVal = NULL );
  234. ////////////////////
  235. public:
  236. // IPCHService
  237. STDMETHOD(get_RemoteSKUs )( /*[out, retval]*/ IPCHCollection* *pVal ) { return E_NOTIMPL; }
  238. STDMETHOD(get_RemoteModemConnected)( /*[out, retval]*/ VARIANT_BOOL *pVal ) { return E_NOTIMPL; }
  239. STDMETHOD(IsTrusted)( /*[in]*/ BSTR bstrURL, /*[out, retval]*/ VARIANT_BOOL *pfTrusted ) { return E_NOTIMPL; }
  240. STDMETHOD(Utility )( /*[in]*/ BSTR bstrSKU, /*[in]*/ long lLCID, /*[out]*/ IPCHUtility* *pVal ) { return E_NOTIMPL; }
  241. STDMETHOD(RemoteHelpContents)( /*[in]*/ BSTR bstrSKU, /*[in]*/ long lLCID, /*[out]*/ IPCHRemoteHelpContents* *pVal ) { return E_NOTIMPL; }
  242. STDMETHOD(RegisterHost )( /*[in]*/ BSTR bstrID , /*[in ]*/ IUnknown* pObj ) { return E_NOTIMPL; }
  243. STDMETHOD(CreateScriptWrapper)( /*[in]*/ REFCLSID rclsid, /*[in]*/ BSTR bstrCode, /*[in]*/ BSTR bstrURL, /*[out]*/ IUnknown* *ppObj );
  244. STDMETHOD(TriggerScheduledDataCollection)( /*[in]*/ VARIANT_BOOL fStart ) { return E_NOTIMPL; }
  245. STDMETHOD(PrepareForShutdown )( ) { return E_NOTIMPL; }
  246. STDMETHOD(ForceSystemRestore)( ) { return E_NOTIMPL; }
  247. STDMETHOD(UpgradeDetected )( ) { return E_NOTIMPL; }
  248. STDMETHOD(MUI_Install )( /*[in]*/ long LCID, /*[in]*/ BSTR bstrFile ) { return E_NOTIMPL; }
  249. STDMETHOD(MUI_Uninstall )( /*[in]*/ long LCID ) { return E_NOTIMPL; }
  250. STDMETHOD(RemoteConnectionParms)( /*[in ]*/ BSTR bstrUserName ,
  251. /*[in ]*/ BSTR bstrDomainName ,
  252. /*[in ]*/ long lSessionID ,
  253. /*[in ]*/ BSTR bstrUserHelpBlob ,
  254. /*[out]*/ BSTR *pbstrConnectionString ) { return E_NOTIMPL; }
  255. STDMETHOD(RemoteUserSessionInfo)( /*[out]*/ IPCHCollection* *pVal ) { return E_NOTIMPL; }
  256. };
  257. ////////////////////////////////////////////////////////////////////////////////
  258. class ATL_NO_VTABLE CPCHProxy_IPCHUtility :
  259. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  260. public MPC::IDispatchExImpl< IPCHUtility, &IID_IPCHUtility, &LIBID_HelpServiceTypeLib>
  261. {
  262. CPCHSecurityHandle m_SecurityHandle;
  263. CPCHProxy_IPCHService* m_parent;
  264. MPC::CComSafeAutoCriticalSection m_DirectLock;
  265. MPC::CComPtrThreadNeutral<IPCHUtility> m_Direct_Utility;
  266. CPCHProxy_IPCHUserSettings2* m_UserSettings2;
  267. CPCHProxy_IPCHTaxonomyDatabase* m_TaxonomyDatabase;
  268. public:
  269. BEGIN_COM_MAP(CPCHProxy_IPCHUtility)
  270. COM_INTERFACE_ENTRY2(IDispatch, IDispatchEx)
  271. COM_INTERFACE_ENTRY(IDispatchEx)
  272. COM_INTERFACE_ENTRY(IPCHUtility)
  273. END_COM_MAP()
  274. CPCHProxy_IPCHUtility();
  275. virtual ~CPCHProxy_IPCHUtility();
  276. INTERNETSECURITY__INVOKEEX();
  277. ////////////////////
  278. CPCHProxy_IPCHService* Parent () { return m_parent; }
  279. bool IsConnected() { return !!m_Direct_Utility; }
  280. ////////////////////
  281. HRESULT ConnectToParent ( /*[in]*/ CPCHProxy_IPCHService* parent, /*[in]*/ CPCHHelpCenterExternal* ext );
  282. void Passivate ( );
  283. HRESULT EnsureDirectConnection( /*[out]*/ CComPtr<IPCHUtility>& util, /*[in]*/ bool fRefresh = false );
  284. HRESULT GetUserSettings2( /*[out]*/ CPCHProxy_IPCHUserSettings2* *pVal = NULL );
  285. HRESULT GetDatabase ( /*[out]*/ CPCHProxy_IPCHTaxonomyDatabase* *pVal = NULL );
  286. ////////////////////
  287. public:
  288. // IPCHUtility
  289. STDMETHOD(get_UserSettings)( /*[out, retval]*/ IPCHUserSettings* *pVal );
  290. STDMETHOD(get_Channels )( /*[out, retval]*/ ISAFReg* *pVal );
  291. STDMETHOD(get_Security )( /*[out, retval]*/ IPCHSecurity* *pVal );
  292. STDMETHOD(get_Database )( /*[out, retval]*/ IPCHTaxonomyDatabase* *pVal );
  293. STDMETHOD(FormatError)( /*[in]*/ VARIANT vError, /*[out, retval]*/ BSTR *pVal );
  294. STDMETHOD(CreateObject_SearchEngineMgr)( /*[out, retval]*/ IPCHSEManager* *ppSE );
  295. STDMETHOD(CreateObject_DataCollection )( /*[out, retval]*/ ISAFDataCollection* *ppDC );
  296. STDMETHOD(CreateObject_Cabinet )( /*[out, retval]*/ ISAFCabinet* *ppCB );
  297. STDMETHOD(CreateObject_Encryption )( /*[out, retval]*/ ISAFEncrypt* *ppEn );
  298. STDMETHOD(CreateObject_Channel )( /*[in]*/ BSTR bstrVendorID, /*[in]*/ BSTR bstrProductID, /*[out, retval]*/ ISAFChannel* *ppCh );
  299. STDMETHOD(CreateObject_RemoteDesktopConnection)( /*[out, retval]*/ ISAFRemoteDesktopConnection* *ppRDC );
  300. STDMETHOD(CreateObject_RemoteDesktopSession )( /*[in] */ REMOTE_DESKTOP_SHARING_CLASS sharingClass ,
  301. /*[in] */ long lTimeout ,
  302. /*[in] */ BSTR bstrConnectionParms ,
  303. /*[in] */ BSTR bstrUserHelpBlob ,
  304. /*[out, retval]*/ ISAFRemoteDesktopSession* *ppRCS );
  305. STDMETHOD(ConnectToExpert)( /*[in]*/ BSTR bstrExpertConnectParm, /*[in]*/ LONG lTimeout, /*[out, retval]*/ LONG *lSafErrorCode );
  306. STDMETHOD(SwitchDesktopMode)( /*[in]*/ int nMode, /* [in]*/ int nRAType );
  307. };
  308. ////////////////////////////////////////////////////////////////////////////////
  309. class ATL_NO_VTABLE CPCHProxy_IPCHUserSettings2 :
  310. public MPC::Thread<CPCHProxy_IPCHUserSettings2,IPCHUserSettings2>,
  311. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  312. public MPC::IDispatchExImpl<IPCHUserSettings2, &IID_IPCHUserSettings2, &LIBID_HelpCenterTypeLib>
  313. {
  314. CPCHSecurityHandle m_SecurityHandle;
  315. CPCHProxy_IPCHUtility* m_parent;
  316. MPC::CComSafeAutoCriticalSection m_DirectLock;
  317. MPC::CComPtrThreadNeutral<IPCHUserSettings> m_Direct_UserSettings;
  318. CPCHProxy_IPCHSetOfHelpTopics* m_MachineSKU;
  319. CPCHProxy_IPCHSetOfHelpTopics* m_CurrentSKU;
  320. Taxonomy::HelpSet m_ths;
  321. CComBSTR m_bstrScope;
  322. bool m_fReady;
  323. Taxonomy::Instance m_instMachine;
  324. Taxonomy::Instance m_instCurrent;
  325. bool m_News_fDone;
  326. bool m_News_fEnabled;
  327. MPC::CComPtrThreadNeutral<IUnknown> m_News_xmlData;
  328. ////////////////////
  329. HRESULT PollNews ();
  330. HRESULT PrepareNews();
  331. HRESULT GetInstanceValue( /*[in]*/ const MPC::wstring* str, /*[out, retval]*/ BSTR *pVal );
  332. public:
  333. BEGIN_COM_MAP(CPCHProxy_IPCHUserSettings2)
  334. COM_INTERFACE_ENTRY2(IDispatch, IDispatchEx)
  335. COM_INTERFACE_ENTRY(IDispatchEx)
  336. COM_INTERFACE_ENTRY(IPCHUserSettings)
  337. COM_INTERFACE_ENTRY(IPCHUserSettings2)
  338. END_COM_MAP()
  339. CPCHProxy_IPCHUserSettings2();
  340. virtual ~CPCHProxy_IPCHUserSettings2();
  341. INTERNETSECURITY__INVOKEEX();
  342. ////////////////////
  343. CPCHProxy_IPCHUtility* Parent () { return m_parent; }
  344. bool IsConnected () { return !!m_Direct_UserSettings; }
  345. bool IsDesktopSKU () { (void)EnsureInSync(); return m_instCurrent.m_fDesktop; }
  346. Taxonomy::Instance& MachineInstance() { return m_instMachine; }
  347. Taxonomy::Instance& CurrentInstance() { return m_instCurrent; }
  348. Taxonomy::HelpSet& THS () { return m_ths; }
  349. HRESULT EnsureInSync();
  350. ////////////////////
  351. HRESULT ConnectToParent ( /*[in]*/ CPCHProxy_IPCHUtility* parent, /*[in]*/ CPCHHelpCenterExternal* ext );
  352. void Passivate ( );
  353. HRESULT EnsureDirectConnection( /*[out]*/ CComPtr<IPCHUserSettings>& us, /*[in]*/ bool fRefresh = false );
  354. HRESULT Initialize ( );
  355. HRESULT GetCurrentSKU( /*[out]*/ CPCHProxy_IPCHSetOfHelpTopics* *pVal = NULL );
  356. HRESULT GetMachineSKU( /*[out]*/ CPCHProxy_IPCHSetOfHelpTopics* *pVal = NULL );
  357. ////////////////////
  358. bool CanUseUserSettings();
  359. HRESULT LoadUserSettings ();
  360. HRESULT SaveUserSettings ();
  361. public:
  362. // IPCHUserSettings
  363. STDMETHOD(get_CurrentSKU)( /*[out, retval]*/ IPCHSetOfHelpTopics* *pVal );
  364. STDMETHOD(get_MachineSKU)( /*[out, retval]*/ IPCHSetOfHelpTopics* *pVal );
  365. STDMETHOD(get_HelpLocation )( /*[out, retval]*/ BSTR *pVal );
  366. STDMETHOD(get_DatabaseDir )( /*[out, retval]*/ BSTR *pVal );
  367. STDMETHOD(get_DatabaseFile )( /*[out, retval]*/ BSTR *pVal );
  368. STDMETHOD(get_IndexFile )( /*[in,optional]*/ VARIANT vScope, /*[out, retval]*/ BSTR *pVal );
  369. STDMETHOD(get_IndexDisplayName)( /*[in,optional]*/ VARIANT vScope, /*[out, retval]*/ BSTR *pVal );
  370. STDMETHOD(get_LastUpdated )( /*[out, retval]*/ DATE *pVal );
  371. STDMETHOD(get_AreHeadlinesEnabled)( /*[out, retval]*/ VARIANT_BOOL *pVal );
  372. STDMETHOD(get_News )( /*[out, retval]*/ IUnknown* *pVal );
  373. STDMETHOD(Select)( /*[in]*/ BSTR bstrSKU, /*[in]*/ long lLCID );
  374. // IPCHUserSettings2
  375. STDMETHOD(get_Favorites)( /*[out, retval]*/ IPCHFavorites* *pVal );
  376. STDMETHOD(get_Options )( /*[out, retval]*/ IPCHOptions* *pVal );
  377. STDMETHOD(get_Scope )( /*[out, retval]*/ BSTR *pVal );
  378. HRESULT put_Scope ( /*[in ]*/ BSTR newVal ); // INTERNAL METHOD.
  379. STDMETHOD(get_IsRemoteSession )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  380. STDMETHOD(get_IsTerminalServer )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  381. STDMETHOD(get_IsDesktopVersion )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  382. STDMETHOD(get_IsAdmin )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  383. STDMETHOD(get_IsPowerUser )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  384. STDMETHOD(get_IsStartPanelOn )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  385. STDMETHOD(get_IsWebViewBarricadeOn)( /*[out, retval]*/ VARIANT_BOOL *pVal );
  386. };
  387. ////////////////////////////////////////////////////////////////////////////////
  388. class ATL_NO_VTABLE CPCHProxy_IPCHSetOfHelpTopics :
  389. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  390. public IDispatchImpl<IPCHSetOfHelpTopics, &IID_IPCHSetOfHelpTopics, &LIBID_HelpServiceTypeLib>
  391. {
  392. CPCHProxy_IPCHUserSettings2* m_parent;
  393. MPC::CComSafeAutoCriticalSection m_DirectLock;
  394. MPC::CComPtrThreadNeutral<IPCHSetOfHelpTopics> m_Direct_SKU;
  395. bool m_fMachine;
  396. ////////////////////
  397. public:
  398. BEGIN_COM_MAP(CPCHProxy_IPCHSetOfHelpTopics)
  399. COM_INTERFACE_ENTRY(IDispatch)
  400. COM_INTERFACE_ENTRY(IPCHSetOfHelpTopics)
  401. END_COM_MAP()
  402. CPCHProxy_IPCHSetOfHelpTopics();
  403. virtual ~CPCHProxy_IPCHSetOfHelpTopics();
  404. ////////////////////
  405. CPCHProxy_IPCHUserSettings2* Parent () { return m_parent; }
  406. bool IsConnected() { return !!m_Direct_SKU; }
  407. ////////////////////
  408. HRESULT ConnectToParent ( /*[in]*/ CPCHProxy_IPCHUserSettings2* parent, /*[in]*/ bool fMachine );
  409. void Passivate ( );
  410. HRESULT EnsureDirectConnection( /*[out]*/ CComPtr<IPCHSetOfHelpTopics>& sht, /*[in]*/ bool fRefresh = false );
  411. ////////////////////
  412. public:
  413. //
  414. // IPCHSetOfHelpTopics
  415. STDMETHOD(get_SKU )( /*[out, retval]*/ BSTR *pVal );
  416. STDMETHOD(get_Language )( /*[out, retval]*/ long *pVal );
  417. STDMETHOD(get_DisplayName )( /*[out, retval]*/ BSTR *pVal );
  418. STDMETHOD(get_ProductID )( /*[out, retval]*/ BSTR *pVal );
  419. STDMETHOD(get_Version )( /*[out, retval]*/ BSTR *pVal );
  420. STDMETHOD(get_Location )( /*[out, retval]*/ BSTR *pVal );
  421. STDMETHOD(get_Exported )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  422. STDMETHOD(put_Exported )( /*[in ]*/ VARIANT_BOOL newVal );
  423. STDMETHOD(put_onStatusChange)( /*[in ]*/ IDispatch* function );
  424. STDMETHOD(get_Status )( /*[out, retval]*/ SHT_STATUS *pVal );
  425. STDMETHOD(get_ErrorCode )( /*[out, retval]*/ long *pVal );
  426. STDMETHOD(get_IsMachineHelp )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  427. STDMETHOD(get_IsInstalled )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  428. STDMETHOD(get_CanInstall )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  429. STDMETHOD(get_CanUninstall )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  430. STDMETHOD(Install )();
  431. STDMETHOD(Uninstall)();
  432. STDMETHOD(Abort )();
  433. };
  434. ////////////////////////////////////////////////////////////////////////////////
  435. class ATL_NO_VTABLE CPCHProxy_IPCHTaxonomyDatabase :
  436. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  437. public MPC::IDispatchExImpl< IPCHTaxonomyDatabase, &IID_IPCHTaxonomyDatabase, &LIBID_HelpServiceTypeLib>
  438. {
  439. CPCHSecurityHandle m_SecurityHandle;
  440. CPCHProxy_IPCHUtility* m_parent;
  441. MPC::CComSafeAutoCriticalSection m_DirectLock;
  442. MPC::CComPtrThreadNeutral<IPCHTaxonomyDatabase> m_Direct_TaxonomyDatabase;
  443. AsynchronousTaxonomyDatabase::Engine m_AsyncCachingEngine;
  444. public:
  445. BEGIN_COM_MAP(CPCHProxy_IPCHTaxonomyDatabase)
  446. COM_INTERFACE_ENTRY2(IDispatch, IDispatchEx)
  447. COM_INTERFACE_ENTRY(IDispatchEx)
  448. COM_INTERFACE_ENTRY(IPCHTaxonomyDatabase)
  449. END_COM_MAP()
  450. CPCHProxy_IPCHTaxonomyDatabase();
  451. virtual ~CPCHProxy_IPCHTaxonomyDatabase();
  452. INTERNETSECURITY__INVOKEEX();
  453. ////////////////////
  454. CPCHProxy_IPCHUtility* Parent () { return m_parent; };
  455. bool IsConnected() { return !!m_Direct_TaxonomyDatabase; };
  456. ////////////////////
  457. HRESULT ConnectToParent ( /*[in]*/ CPCHProxy_IPCHUtility* parent, /*[in]*/ CPCHHelpCenterExternal* ext );
  458. void Passivate ( );
  459. HRESULT EnsureDirectConnection( /*[out]*/ CComPtr<IPCHTaxonomyDatabase>& db, /*[in]*/ bool fRefresh = false );
  460. ////////////////////
  461. HRESULT ExecuteQuery( /*[in]*/ int iType, /*[in]*/ LPCWSTR szID, /*[out, retval]*/ CPCHQueryResultCollection* *ppC, /*[in]*/ VARIANT* option = NULL );
  462. HRESULT ExecuteQuery( /*[in]*/ int iType, /*[in]*/ LPCWSTR szID, /*[out, retval]*/ IPCHCollection* *ppC, /*[in]*/ VARIANT* option = NULL );
  463. public:
  464. // IPCHTaxonomyDatabase
  465. STDMETHOD(get_InstalledSKUs )( /*[out, retval]*/ IPCHCollection* *pVal );
  466. STDMETHOD(get_HasWritePermissions)( /*[out, retval]*/ VARIANT_BOOL *pVal );
  467. STDMETHOD(LookupNode )( /*[in]*/ BSTR bstrNode , /*[out, retval]*/ IPCHCollection* *ppC );
  468. STDMETHOD(LookupSubNodes )( /*[in]*/ BSTR bstrNode , /*[in]*/ VARIANT_BOOL fVisibleOnly, /*[out, retval]*/ IPCHCollection* *ppC );
  469. STDMETHOD(LookupNodesAndTopics)( /*[in]*/ BSTR bstrNode , /*[in]*/ VARIANT_BOOL fVisibleOnly, /*[out, retval]*/ IPCHCollection* *ppC );
  470. STDMETHOD(LookupTopics )( /*[in]*/ BSTR bstrNode , /*[in]*/ VARIANT_BOOL fVisibleOnly, /*[out, retval]*/ IPCHCollection* *ppC );
  471. STDMETHOD(LocateContext )( /*[in]*/ BSTR bstrURL , /*[in,optional]*/ VARIANT vSubSite, /*[out, retval]*/ IPCHCollection* *ppC );
  472. STDMETHOD(KeywordSearch )( /*[in]*/ BSTR bstrQuery, /*[in,optional]*/ VARIANT vSubSite, /*[out, retval]*/ IPCHCollection* *ppC );
  473. STDMETHOD(GatherNodes )( /*[in]*/ BSTR bstrNode , /*[in]*/ VARIANT_BOOL fVisibleOnly, /*[out, retval]*/ IPCHCollection* *ppC );
  474. STDMETHOD(GatherTopics )( /*[in]*/ BSTR bstrNode , /*[in]*/ VARIANT_BOOL fVisibleOnly, /*[out, retval]*/ IPCHCollection* *ppC );
  475. STDMETHOD(ConnectToDisk )( /*[in]*/ BSTR bstrDirectory , /*[in]*/ IDispatch* notify, /*[out, retval]*/ IPCHCollection* *ppC );
  476. STDMETHOD(ConnectToServer)( /*[in]*/ BSTR bstrServerName, /*[in]*/ IDispatch* notify, /*[out, retval]*/ IPCHCollection* *ppC );
  477. STDMETHOD(Abort )( );
  478. };
  479. ////////////////////////////////////////////////////////////////////////////////
  480. #endif // !defined(__INCLUDED___PCH___SERVICEPROXY_H___)