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.

98 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994
  5. //
  6. // File: exports.cxx
  7. //
  8. // Contents: Code to export filter and word breaker class factories
  9. //
  10. // History: 15-Aug-1994 SitaramR Created
  11. //
  12. // Notes: Copied from txtifilt.hxx and then modified
  13. //
  14. //--------------------------------------------------------------------------
  15. #include <pch.cxx>
  16. #pragma hdrstop
  17. #include <classid.hxx>
  18. #include <nullfilt.hxx>
  19. #include <txtifilt.hxx>
  20. #include <defbreak.hxx>
  21. #include <cicontrl.hxx>
  22. #include <isrchcf.hxx>
  23. #include <nullstem.hxx>
  24. CLSID clsidNlCiControl = CLSID_NLCiControl;
  25. // 78fe669a-186e-4108-96e9-77b586c1332f
  26. CLSID clsidNullStemmer = { 0x78fe669a, 0x186e, 0x4108, {0x96, 0xe9, 0x77, 0xb5, 0x86, 0xc1, 0x33, 0x2f} };
  27. //+-------------------------------------------------------------------------
  28. //
  29. // Function: CifrmwrkDllGetClassObject
  30. //
  31. // Synopsis: Ole DLL load class routine
  32. //
  33. // Arguments: [cid] -- Class to load
  34. // [iid] -- Interface to bind to on class object
  35. // [ppvObj] -- Interface pointer returned here
  36. //
  37. // Returns: Text filter or a word breaker class factory
  38. //
  39. // History: 23-Feb-1994 KyleP Created
  40. //
  41. //--------------------------------------------------------------------------
  42. extern "C" SCODE STDMETHODCALLTYPE CifrmwrkDllGetClassObject(
  43. REFCLSID cid,
  44. REFIID iid,
  45. void ** ppvObj )
  46. {
  47. IUnknown * pResult = 0;
  48. SCODE sc = S_OK;
  49. TRY
  50. {
  51. if ( CLSID_CTextIFilter == cid || CLSID_CTextClass == cid )
  52. pResult = (IUnknown *)new CTextIFilterCF;
  53. else if ( CLSID_CNullIFilter == cid )
  54. pResult = (IUnknown *)new CNullIFilterCF;
  55. else if ( CLSID_Neutral_WBreaker == cid )
  56. pResult = (IUnknown *)new CDefWordBreakerCF;
  57. else if ( clsidCiControl == cid || clsidNlCiControl == cid )
  58. pResult = (IUnknown *) new CCiControlObjectCF;
  59. else if ( clsidISearchCreator == cid)
  60. pResult = (IUnknown *) new CCiISearchCreatorCF;
  61. else if ( clsidNullStemmer == cid)
  62. pResult = (IUnknown *) new CNullStemmerCF;
  63. else
  64. {
  65. ciDebugOut(( DEB_ITRACE, "DllGetClassObject: no such interface found\n" ));
  66. pResult = 0;
  67. sc = E_NOINTERFACE;
  68. }
  69. }
  70. CATCH(CException, e)
  71. {
  72. switch( e.GetErrorCode() )
  73. {
  74. case E_OUTOFMEMORY:
  75. sc = (E_OUTOFMEMORY);
  76. break;
  77. default:
  78. sc = (E_UNEXPECTED);
  79. }
  80. }
  81. END_CATCH;
  82. if (0 != pResult) {
  83. sc = pResult->QueryInterface( iid, ppvObj );
  84. pResult->Release( );
  85. }
  86. return (sc);
  87. }