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.

879 lines
23 KiB

  1. #ifndef __SEODISP_H__
  2. #define __SEODISP_H__
  3. #include "smtpseo.h"
  4. #include <smtpevent.h>
  5. #include "smtpguid.h"
  6. #ifdef PLATINUM
  7. #include <ptntintf.h>
  8. #include "ptntguid.h"
  9. #endif
  10. #include <comcat.h>
  11. #include "seolib2.h"
  12. #ifdef PLATINUM
  13. #include "cdosys.h"
  14. #else
  15. #include "cdo.h"
  16. #endif // PLATINUM
  17. #include "cdoconstimsg.h"
  18. #include <baseobj.h>
  19. #include <aqevents.h>
  20. class __declspec(uuid("B226CEB5-0BBF-11d2-A011-00C04FA37348")) CStoreDispatcherData : public IUnknown {
  21. public:
  22. CStoreDispatcherData() {
  23. m_pvServer = NULL;
  24. m_dwServerInstance = 0;
  25. };
  26. HRESULT STDMETHODCALLTYPE GetData(LPVOID *ppvServer, DWORD *pdwServerInstance) {
  27. if (ppvServer) {
  28. *ppvServer = NULL;
  29. }
  30. if (pdwServerInstance) {
  31. *pdwServerInstance = 0;
  32. }
  33. if (!m_pvServer) {
  34. return (E_FAIL);
  35. }
  36. if (ppvServer) {
  37. *ppvServer = m_pvServer;
  38. }
  39. if (pdwServerInstance) {
  40. *pdwServerInstance = m_dwServerInstance;
  41. }
  42. return (S_OK);
  43. };
  44. HRESULT STDMETHODCALLTYPE SetData(LPVOID pvServer, DWORD dwServerInstance) {
  45. m_pvServer = pvServer;
  46. m_dwServerInstance = dwServerInstance;
  47. return (S_OK);
  48. };
  49. private:
  50. LPVOID m_pvServer;
  51. DWORD m_dwServerInstance;
  52. };
  53. class CStoreDispatcher :
  54. public CEventBaseDispatcher,
  55. public CComObjectRootEx<CComMultiThreadModelNoCS>,
  56. public IServerDispatcher,
  57. public IMailTransportNotify,
  58. public IClassFactory,
  59. public IEventDispatcherChain,
  60. public CStoreDispatcherData
  61. {
  62. public:
  63. DECLARE_PROTECT_FINAL_CONSTRUCT();
  64. DECLARE_GET_CONTROLLING_UNKNOWN();
  65. DECLARE_NOT_AGGREGATABLE(CStoreDispatcher);
  66. BEGIN_COM_MAP(CStoreDispatcher)
  67. COM_INTERFACE_ENTRY(IEventDispatcher)
  68. COM_INTERFACE_ENTRY(IServerDispatcher)
  69. COM_INTERFACE_ENTRY(IMailTransportNotify)
  70. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  71. COM_INTERFACE_ENTRY(IClassFactory)
  72. COM_INTERFACE_ENTRY(IEventDispatcherChain)
  73. COM_INTERFACE_ENTRY_IID(__uuidof(CStoreDispatcherData),CStoreDispatcherData)
  74. END_COM_MAP()
  75. // this code gets called during initialization
  76. HRESULT FinalConstruct()
  77. {
  78. // we need to do this to signal that we are free threaded
  79. return (CoCreateFreeThreadedMarshaler(GetControllingUnknown(), &m_pUnkMarshaler.p));
  80. }
  81. // this has the global destructor code in it
  82. void FinalRelease() {}
  83. virtual HRESULT AllocBinding(REFGUID rguidEventType,
  84. IEventBinding *piBinding,
  85. CBinding **ppNewBinding)
  86. {
  87. if (ppNewBinding)
  88. *ppNewBinding = NULL;
  89. if (!piBinding || !ppNewBinding)
  90. return E_POINTER;
  91. *ppNewBinding = new CStoreBinding;
  92. if (*ppNewBinding == NULL)
  93. return E_OUTOFMEMORY;
  94. return S_OK;
  95. }
  96. //
  97. // Local binding class
  98. //
  99. class CStoreBinding : public CEventBaseDispatcher::CBinding
  100. {
  101. public:
  102. CStoreBinding();
  103. ~CStoreBinding();
  104. virtual HRESULT Init(IEventBinding *piBinding);
  105. LPSTR GetRuleString() { return(m_szRule); }
  106. private:
  107. HRESULT GetAnsiStringFromVariant(CComVariant &vString, LPSTR *ppszString);
  108. public:
  109. LPSTR m_szRule;
  110. };
  111. //
  112. // Parameter abstract base class
  113. //
  114. #define SIGNATURE_VALID_CSTOREPARAMS (DWORD)'CSPa'
  115. #define SIGNATURE_INVALID_CSTOREPARAMS (DWORD)'aPSC'
  116. class CStoreBaseParams :
  117. public CEventBaseDispatcher::CParams,
  118. public CBaseObject
  119. {
  120. public:
  121. virtual HRESULT CallObject(IEventManager *pManager, CBinding&
  122. bBinding);
  123. virtual HRESULT CallObject(CBinding& bBinding, IUnknown
  124. *punkObject) = 0;
  125. virtual HRESULT CallDefault() = 0;
  126. virtual HRESULT CallCompletion(HRESULT hrStatus)
  127. {
  128. //
  129. // Free this Params object (Referenced in CStoreDispatcher::OnEvent)
  130. //
  131. Release();
  132. return S_OK;
  133. }
  134. virtual HRESULT Init(PVOID pContext) = 0;
  135. HRESULT CheckMailMsgRule(
  136. CBinding *pBinding,
  137. IMailMsgProperties *pIMsgProps);
  138. HRESULT CheckMailMsgRecipientsRule(
  139. IUnknown *pIMsg,
  140. LPSTR pszPatterns);
  141. HRESULT CheckSignature()
  142. {
  143. return (m_dwSignature == SIGNATURE_VALID_CSTOREPARAMS) ? S_OK : E_FAIL;
  144. }
  145. HRESULT MatchEmailOrDomainName(
  146. LPSTR szEmail,
  147. LPSTR szPattern,
  148. BOOL fIsEmail);
  149. public:
  150. CStoreBaseParams();
  151. ~CStoreBaseParams();
  152. HRESULT InitParamData(
  153. LPVOID pContext,
  154. DWORD dwEventType,
  155. IMailTransportNotify *pINotify,
  156. REFIID rguidEventType);
  157. public:
  158. DWORD m_dwSignature;
  159. // This indicates which event type we are raising so that
  160. // the proper sink can be QI'd
  161. DWORD m_dwEventType;
  162. public:
  163. // Data needed for async sink operation:
  164. // How many sinks to skip on the next async sink completion
  165. DWORD m_dwIdx_SinkSkip;
  166. // Indicates wether or not default processing has been called
  167. BOOL m_fDefaultProcessingCalled;
  168. // The IMailTransportNotify interface to pass to async capable sinks
  169. IMailTransportNotify *m_pINotify;
  170. // Our event type guid -- pass to dispatcher function
  171. GUID m_rguidEventType;
  172. // A pointer to the sink currently in asynchronous operation.
  173. // Must be NULL when no sinks are in async operation.
  174. IUnknown *m_pIUnknownSink;
  175. };
  176. //
  177. // Parameter class
  178. //
  179. class CStoreParams : public CStoreBaseParams
  180. {
  181. public:
  182. CStoreParams()
  183. {
  184. m_pContext = NULL;
  185. }
  186. virtual HRESULT CallObject(IEventManager *pManager, CBinding&
  187. bBinding);
  188. virtual HRESULT CallObject(CBinding& bBinding, IUnknown
  189. *punkObject);
  190. HRESULT CallDefault();
  191. HRESULT Init(PVOID pContext)
  192. {
  193. m_pContext = (AQ_ALLOC_PARAMS* )pContext;
  194. return S_OK;
  195. }
  196. public:
  197. AQ_ALLOC_PARAMS * m_pContext;
  198. };
  199. //
  200. // Parameter class - OnPreCategorize
  201. //
  202. class CMailTransportPreCategorizeParams : public CStoreBaseParams
  203. {
  204. public:
  205. HRESULT CallObject(CBinding& bBinding, IUnknown
  206. *punkObject);
  207. HRESULT CallDefault();
  208. HRESULT CallCompletion(HRESULT hrStatus);
  209. HRESULT Init(PVOID pContext)
  210. {
  211. CopyMemory(&m_Context, pContext, sizeof(EVENTPARAMS_PRECATEGORIZE));
  212. return S_OK;
  213. }
  214. HRESULT CheckRule(CBinding &bBinding);
  215. private:
  216. EVENTPARAMS_PRECATEGORIZE m_Context;
  217. };
  218. //
  219. // Parameter class - OnPostCategorize
  220. //
  221. class CMailTransportPostCategorizeParams : public CStoreBaseParams
  222. {
  223. public:
  224. HRESULT CallObject(CBinding& bBinding, IUnknown
  225. *punkObject);
  226. HRESULT CallDefault();
  227. HRESULT CallCompletion(HRESULT hrStatus);
  228. HRESULT Init(PVOID pContext)
  229. {
  230. CopyMemory(&m_Context, pContext, sizeof(EVENTPARAMS_POSTCATEGORIZE));
  231. return S_OK;
  232. }
  233. HRESULT CheckRule(CBinding &bBinding);
  234. private:
  235. EVENTPARAMS_POSTCATEGORIZE m_Context;
  236. };
  237. // ------------------------------------------------------------
  238. // Categorizer Parameter classes
  239. // ------------------------------------------------------------
  240. class CMailTransportCatRegisterParams : public CStoreBaseParams
  241. {
  242. public:
  243. HRESULT CallObject(CBinding& bBinding, IUnknown
  244. *punkObject);
  245. HRESULT CallDefault();
  246. HRESULT Init(PVOID pContext)
  247. {
  248. m_pContext = (PEVENTPARAMS_CATREGISTER) pContext;
  249. return S_OK;
  250. }
  251. private:
  252. PEVENTPARAMS_CATREGISTER m_pContext;
  253. };
  254. //
  255. // Parameter class
  256. //
  257. class CMailTransportCatBeginParams : public CStoreBaseParams
  258. {
  259. public:
  260. HRESULT CallObject(CBinding& bBinding, IUnknown
  261. *punkObject);
  262. HRESULT CallDefault();
  263. HRESULT Init(PVOID pContext)
  264. {
  265. m_pContext = (PEVENTPARAMS_CATBEGIN) pContext;
  266. return S_OK;
  267. }
  268. private:
  269. PEVENTPARAMS_CATBEGIN m_pContext;
  270. };
  271. //
  272. // Parameter class
  273. //
  274. class CMailTransportCatEndParams : public CStoreBaseParams
  275. {
  276. public:
  277. HRESULT CallObject(CBinding& bBinding, IUnknown
  278. *punkObject);
  279. HRESULT CallDefault();
  280. HRESULT Init(PVOID pContext)
  281. {
  282. m_pContext = (PEVENTPARAMS_CATEND) pContext;
  283. return S_OK;
  284. }
  285. private:
  286. PEVENTPARAMS_CATEND m_pContext;
  287. };
  288. //
  289. // Parameter class
  290. //
  291. class CMailTransportCatBuildQueryParams : public CStoreBaseParams
  292. {
  293. public:
  294. HRESULT CallObject(CBinding& bBinding, IUnknown
  295. *punkObject);
  296. HRESULT CallDefault();
  297. HRESULT Init(PVOID pContext)
  298. {
  299. m_pContext = (PEVENTPARAMS_CATBUILDQUERY) pContext;
  300. return S_OK;
  301. }
  302. private:
  303. PEVENTPARAMS_CATBUILDQUERY m_pContext;
  304. };
  305. //
  306. // Parameter class
  307. //
  308. class CMailTransportCatBuildQueriesParams : public CStoreBaseParams
  309. {
  310. public:
  311. HRESULT CallObject(CBinding& bBinding, IUnknown
  312. *punkObject);
  313. HRESULT CallDefault();
  314. HRESULT Init(PVOID pContext)
  315. {
  316. m_pContext = (PEVENTPARAMS_CATBUILDQUERIES) pContext;
  317. return S_OK;
  318. }
  319. private:
  320. PEVENTPARAMS_CATBUILDQUERIES m_pContext;
  321. };
  322. //
  323. // Parameter class
  324. //
  325. class CMailTransportCatSendQueryParams : public CStoreBaseParams
  326. {
  327. public:
  328. HRESULT CallObject(CBinding& bBinding, IUnknown
  329. *punkObject);
  330. HRESULT CallDefault();
  331. HRESULT CallCompletion(HRESULT hrStatus);
  332. HRESULT Init(PVOID pContext)
  333. {
  334. CopyMemory(&m_Context, pContext, sizeof(EVENTPARAMS_CATSENDQUERY));
  335. //
  336. // Setup async params (so ICatAsyncContext can call back into dispatcher)
  337. //
  338. m_Context.pIMailTransportNotify = m_pINotify;
  339. m_Context.pvNotifyContext = (PVOID)this;
  340. return S_OK;
  341. }
  342. private:
  343. EVENTPARAMS_CATSENDQUERY m_Context;
  344. };
  345. //
  346. // Parameter class
  347. //
  348. class CMailTransportCatSortQueryResultParams : public CStoreBaseParams
  349. {
  350. public:
  351. HRESULT CallObject(CBinding& bBinding, IUnknown
  352. *punkObject);
  353. HRESULT CallDefault();
  354. HRESULT Init(PVOID pContext)
  355. {
  356. m_pContext = (PEVENTPARAMS_CATSORTQUERYRESULT) pContext;
  357. return S_OK;
  358. }
  359. private:
  360. PEVENTPARAMS_CATSORTQUERYRESULT m_pContext;
  361. };
  362. //
  363. // Parameter class
  364. //
  365. class CMailTransportCatProcessItemParams : public CStoreBaseParams
  366. {
  367. public:
  368. HRESULT CallObject(CBinding& bBinding, IUnknown
  369. *punkObject);
  370. HRESULT CallDefault();
  371. HRESULT Init(PVOID pContext)
  372. {
  373. m_pContext = (PEVENTPARAMS_CATPROCESSITEM) pContext;
  374. return S_OK;
  375. }
  376. private:
  377. PEVENTPARAMS_CATPROCESSITEM m_pContext;
  378. };
  379. //
  380. // Parameter class
  381. //
  382. class CMailTransportCatExpandItemParams : public CStoreBaseParams
  383. {
  384. public:
  385. HRESULT CallObject(CBinding& bBinding, IUnknown
  386. *punkObject);
  387. HRESULT CallDefault();
  388. HRESULT CallCompletion(HRESULT hrStatus);
  389. HRESULT Init(PVOID pContext)
  390. {
  391. m_fAsyncCompletion = FALSE;
  392. CopyMemory(&m_Context, pContext, sizeof(EVENTPARAMS_CATEXPANDITEM));
  393. m_Context.pIMailTransportNotify = m_pINotify;
  394. m_Context.pvNotifyContext = (PVOID)this;
  395. return S_OK;
  396. }
  397. private:
  398. BOOL m_fAsyncCompletion;
  399. EVENTPARAMS_CATEXPANDITEM m_Context;
  400. };
  401. //
  402. // Parameter class
  403. //
  404. class CMailTransportCatCompleteItemParams : public CStoreBaseParams
  405. {
  406. public:
  407. HRESULT CallObject(CBinding& bBinding, IUnknown
  408. *punkObject);
  409. HRESULT CallDefault();
  410. HRESULT Init(PVOID pContext)
  411. {
  412. m_pContext = (PEVENTPARAMS_CATCOMPLETEITEM) pContext;
  413. return S_OK;
  414. }
  415. private:
  416. PEVENTPARAMS_CATCOMPLETEITEM m_pContext;
  417. };
  418. //
  419. // Parameter class
  420. //
  421. class CMailTransportSubmissionParams : public CStoreBaseParams
  422. {
  423. public:
  424. CMailTransportSubmissionParams()
  425. {
  426. m_pCDOMessage = NULL;
  427. }
  428. ~CMailTransportSubmissionParams()
  429. {
  430. if(m_pCDOMessage)
  431. m_pCDOMessage->Release();
  432. }
  433. HRESULT CallObject(CBinding& bBinding, IUnknown
  434. *punkObject);
  435. HRESULT CallDefault();
  436. HRESULT CallCompletion(HRESULT hrStatus);
  437. HRESULT Init(PVOID pContext)
  438. {
  439. CopyMemory(&m_Context, pContext, sizeof(EVENTPARAMS_SUBMISSION));
  440. return S_OK;
  441. }
  442. HRESULT CheckRule(CBinding &bBinding);
  443. private:
  444. HRESULT CallCDOSink(IUnknown *pSink);
  445. EVENTPARAMS_SUBMISSION m_Context;
  446. IMessage *m_pCDOMessage;
  447. };
  448. //
  449. // Create options class - Routing
  450. //
  451. class CRouterCreateOptions : public CEventCreateOptionsBase
  452. {
  453. public:
  454. CRouterCreateOptions(PEVENTPARAMS_ROUTER pContext)
  455. {
  456. _ASSERT (pContext != NULL);
  457. m_pContext = pContext;
  458. }
  459. private:
  460. HRESULT STDMETHODCALLTYPE Init(
  461. REFIID iidDesired,
  462. IUnknown **ppUnkObject,
  463. IEventBinding *,
  464. IUnknown *);
  465. PEVENTPARAMS_ROUTER m_pContext;
  466. };
  467. //
  468. // Parameter class - Routing
  469. //
  470. class CMailTransportRouterParams : public CStoreBaseParams
  471. {
  472. public:
  473. virtual HRESULT CallObject(IEventManager *pManager, CBinding&
  474. bBinding);
  475. virtual HRESULT CallObject(CBinding& bBinding, IUnknown
  476. *punkObject);
  477. HRESULT CallDefault();
  478. HRESULT Init(PVOID pContext)
  479. {
  480. m_pContext = (PEVENTPARAMS_ROUTER) pContext;
  481. //
  482. // Make sure caller initialized pIMessageRouter to NULL
  483. //
  484. _ASSERT(m_pContext->pIMessageRouter == NULL);
  485. return S_OK;
  486. }
  487. private:
  488. PEVENTPARAMS_ROUTER m_pContext;
  489. };
  490. //
  491. // Parameter class
  492. //
  493. class CStoreAllocParams : public CEventBaseDispatcher::CParams
  494. {
  495. public:
  496. CStoreAllocParams();
  497. ~CStoreAllocParams();
  498. virtual HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  499. public:
  500. PFIO_CONTEXT m_hContent;
  501. };
  502. //
  503. // Parameter class for msgTrackLog
  504. //
  505. class CMsgTrackLogParams : public CStoreBaseParams
  506. {
  507. public:
  508. CMsgTrackLogParams()
  509. {
  510. m_pContext = NULL;
  511. }
  512. HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  513. HRESULT CallDefault();
  514. HRESULT Init(PVOID pContext)
  515. {
  516. m_pContext = (PEVENTPARAMS_MSGTRACKLOG) pContext;
  517. return S_OK;
  518. }
  519. private:
  520. PEVENTPARAMS_MSGTRACKLOG m_pContext;
  521. };
  522. //
  523. // Parameter class for mx records
  524. //
  525. class CDnsResolverRecordParams : public CStoreBaseParams
  526. {
  527. public:
  528. CDnsResolverRecordParams()
  529. {
  530. m_pContext = NULL;
  531. }
  532. HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  533. HRESULT CallDefault();
  534. HRESULT Init(PVOID pContext)
  535. {
  536. m_pContext = (PEVENTPARAMS_DNSRESOLVERRECORD) pContext;
  537. return S_OK;
  538. }
  539. private:
  540. PEVENTPARAMS_DNSRESOLVERRECORD m_pContext;
  541. };
  542. //
  543. // Parameter class for max msg size exceeded event
  544. //
  545. class CSmtpMaxMsgSizeParams : public CStoreBaseParams
  546. {
  547. public:
  548. CSmtpMaxMsgSizeParams()
  549. {
  550. m_pContext = NULL;
  551. }
  552. HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  553. HRESULT CallDefault();
  554. HRESULT Init(PVOID pContext)
  555. {
  556. m_pContext = (PEVENTPARAMS_MAXMSGSIZE) pContext;
  557. return S_OK;
  558. }
  559. private:
  560. PEVENTPARAMS_MAXMSGSIZE m_pContext;
  561. };
  562. //
  563. // Parameter classes for DSN events
  564. //
  565. // Create options class - DSN sinks
  566. //
  567. class CDSNCreateOptions : public CEventCreateOptionsBase
  568. {
  569. public:
  570. CDSNCreateOptions(DWORD dwVSID)
  571. {
  572. m_dwVSID = dwVSID;
  573. }
  574. private:
  575. HRESULT STDMETHODCALLTYPE Init(
  576. REFIID iidDesired,
  577. IUnknown **ppUnkObject,
  578. IEventBinding *,
  579. IUnknown *);
  580. DWORD m_dwVSID;
  581. };
  582. //
  583. // Parameter class for DSN params
  584. //
  585. class CDSNBaseParams : public CStoreBaseParams
  586. {
  587. public:
  588. HRESULT CallObject(
  589. IEventManager *pManager,
  590. CBinding& bBinding);
  591. virtual HRESULT CallObject(
  592. CBinding& bBinding,
  593. IUnknown *punkObject) = 0;
  594. virtual DWORD GetVSID() = 0;
  595. };
  596. //
  597. // Parameter class for OnSyncGetDNSRecipientIterator
  598. //
  599. class CDSNRecipientIteratorParams : public CDSNBaseParams
  600. {
  601. public:
  602. CDSNRecipientIteratorParams()
  603. {
  604. m_pContext = NULL;
  605. }
  606. HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  607. HRESULT CallDefault()
  608. {
  609. return S_OK;
  610. }
  611. HRESULT Init(PVOID pContext)
  612. {
  613. m_pContext = (PEVENTPARAMS_GET_DSN_RECIPIENT_ITERATOR) pContext;
  614. return S_OK;
  615. }
  616. DWORD GetVSID()
  617. {
  618. return m_pContext->dwVSID;
  619. }
  620. private:
  621. PEVENTPARAMS_GET_DSN_RECIPIENT_ITERATOR m_pContext;
  622. };
  623. //
  624. // Parameter class for OnSyncGenerateDSN
  625. //
  626. class CDSNGenerateParams : public CDSNBaseParams
  627. {
  628. public:
  629. CDSNGenerateParams()
  630. {
  631. m_pContext = NULL;
  632. }
  633. HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  634. HRESULT CallDefault();
  635. HRESULT Init(PVOID pContext)
  636. {
  637. m_pContext = (PEVENTPARAMS_GENERATE_DSN) pContext;
  638. return S_OK;
  639. }
  640. DWORD GetVSID()
  641. {
  642. return m_pContext->dwVSID;
  643. }
  644. private:
  645. PEVENTPARAMS_GENERATE_DSN m_pContext;
  646. };
  647. //
  648. // Parameter class for OnSyncPostGenerateDSN
  649. //
  650. class CDSNPostGenerateParams : public CDSNBaseParams
  651. {
  652. public:
  653. CDSNPostGenerateParams()
  654. {
  655. m_pContext = NULL;
  656. }
  657. HRESULT CallObject(CBinding& bBinding, IUnknown *punkObject);
  658. HRESULT CallDefault()
  659. {
  660. return S_OK;
  661. }
  662. HRESULT Init(PVOID pContext)
  663. {
  664. m_pContext = (PEVENTPARAMS_POST_GENERATE_DSN) pContext;
  665. return S_OK;
  666. }
  667. DWORD GetVSID()
  668. {
  669. return m_pContext->dwVSID;
  670. }
  671. private:
  672. PEVENTPARAMS_POST_GENERATE_DSN m_pContext;
  673. };
  674. HRESULT CreateCParams(
  675. DWORD dwEventType,
  676. LPVOID pContext,
  677. IMailTransportNotify *pINotify,
  678. REFIID rGuidEventType,
  679. CStoreBaseParams **ppCParams);
  680. HRESULT STDMETHODCALLTYPE OnEvent(
  681. REFIID iidEvent,
  682. DWORD dwEventType,
  683. LPVOID pvContext);
  684. HRESULT STDMETHODCALLTYPE Dispatcher(
  685. REFIID rguidEventType,
  686. CStoreBaseParams *pParams);
  687. HRESULT STDMETHODCALLTYPE Notify(
  688. HRESULT hrStatus,
  689. PVOID pvContext);
  690. // IClassFactory methods
  691. public:
  692. HRESULT STDMETHODCALLTYPE CreateInstance (LPUNKNOWN pUnkOuter, REFIID riid, void * * ppvObj)
  693. {
  694. return CComObject<CStoreDispatcher>::_CreatorClass::CreateInstance(pUnkOuter, riid, ppvObj);
  695. }
  696. HRESULT STDMETHODCALLTYPE LockServer (int fLock)
  697. {
  698. _ASSERT(FALSE);
  699. return E_NOTIMPL;
  700. }
  701. // IEventDispatcherChain methods
  702. public:
  703. HRESULT STDMETHODCALLTYPE SetPrevious(IUnknown *pUnkPrevious, IUnknown **ppUnkPreload);
  704. // IEventDispatcher methods
  705. public:
  706. HRESULT STDMETHODCALLTYPE SetContext(REFGUID guidEventType,
  707. IEventRouter *piRouter,
  708. IEventBindings *pBindings);
  709. private:
  710. CComPtr<IUnknown> m_pUnkMarshaler;
  711. };
  712. class CStoreDispatcherClassFactory : public IClassFactory
  713. {
  714. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void * * ppvObj)
  715. {
  716. _ASSERT(FALSE);
  717. return E_NOTIMPL;
  718. }
  719. unsigned long STDMETHODCALLTYPE AddRef () { _ASSERT(FALSE); return 0; }
  720. unsigned long STDMETHODCALLTYPE Release () { _ASSERT(FALSE); return 0; }
  721. // *** IClassFactory methods ***
  722. HRESULT STDMETHODCALLTYPE CreateInstance (LPUNKNOWN pUnkOuter, REFIID riid, void * * ppvObj)
  723. {
  724. return CComObject<CStoreDispatcher>::_CreatorClass::CreateInstance(pUnkOuter, riid, ppvObj);
  725. }
  726. HRESULT STDMETHODCALLTYPE LockServer (int fLock)
  727. {
  728. _ASSERT(FALSE);
  729. return E_NOTIMPL;
  730. }
  731. };
  732. // helper functions
  733. //
  734. // jstamerj 980603 10:45:21: TriggerServerEvent with async callback
  735. // support for completion
  736. //
  737. HRESULT TriggerServerEvent(IEventRouter *pRouter,
  738. DWORD dwEventType,
  739. PVOID pvContext);
  740. //
  741. // register a new SEO instance. if the instance is already registered
  742. // this function will detect it and won't register it again. it should
  743. // be called for each instance at service startup and when each instance
  744. // is created.
  745. //
  746. HRESULT RegisterPlatSEOInstance(DWORD dwInstanceID);
  747. //
  748. // unregister an SEO instance. this should be called when an SEO
  749. // instance is being deleted.
  750. //
  751. HRESULT UnregisterPlatSEOInstance(DWORD dwInstanceID);
  752. #endif