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.

108 lines
2.7 KiB

  1. // ITLOCAL.CPP : Implementation of DLL Exports.
  2. #include <atlinc.h> // precompiled header
  3. #include <initguid.h>
  4. // MediaView (InfoTech) includes
  5. #include <mvopsys.h>
  6. #include <_mvutil.h>
  7. #include <groups.h>
  8. #include <wwheel.h>
  9. #include <stdbrkr.h>
  10. #include "itgroup.h"
  11. #include "itww.h"
  12. #include "itdb.h"
  13. #include "itquery.h"
  14. #include "itcat.h"
  15. #include "itrs.h"
  16. #include "itsortid.h"
  17. #include "itwbrkid.h"
  18. #include "wwimp.h"
  19. #include "dbimp.h"
  20. #include "catalog.h"
  21. #include "indeximp.h"
  22. #include "groupimp.h"
  23. #include "rsimp.h"
  24. #include "queryimp.h"
  25. #include "syssrt.h"
  26. #include "engstem.h"
  27. // The following includes are needed to support runtime wordwheel merging.
  28. #include "itpropl.h"
  29. #include "itcc.h"
  30. #include "prop.h"
  31. #include "plist.h"
  32. #include "wwumain.h"
  33. CComModule _Module;
  34. BEGIN_OBJECT_MAP(ObjectMap)
  35. OBJECT_ENTRY(CLSID_IITWordWheelLocal, CITWordWheelLocal)
  36. OBJECT_ENTRY(CLSID_IITDatabaseLocal, CITDatabaseLocal)
  37. OBJECT_ENTRY(CLSID_IITIndexLocal, CITIndexLocal)
  38. OBJECT_ENTRY(CLSID_IITCatalogLocal, CITCatalogLocal)
  39. OBJECT_ENTRY(CLSID_IITGroupLocal, CITGroupLocal) // support for groups
  40. OBJECT_ENTRY(CLSID_IITGroupArrayLocal, CITGroupArrayLocal) // support for groups
  41. OBJECT_ENTRY(CLSID_IITResultSet, CITResultSet)
  42. OBJECT_ENTRY(CLSID_IITQuery, CITQuery)
  43. OBJECT_ENTRY(CLSID_ITSysSort, CITSysSort)
  44. OBJECT_ENTRY(CLSID_ITStdBreaker, CITStdBreaker)
  45. OBJECT_ENTRY(CLSID_ITEngStemmer, CITEngStemmer)
  46. OBJECT_ENTRY(CLSID_IITPropList, CITPropList) // for runtime wordwheel merging
  47. OBJECT_ENTRY(CLSID_IITWordWheelUpdate, CITWordWheelUpdate) // for runtime wordwheel merging
  48. END_OBJECT_MAP()
  49. /////////////////////////////////////////////////////////////////////////////
  50. // DLL Entry Point
  51. extern "C"
  52. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  53. {
  54. if (dwReason == DLL_PROCESS_ATTACH)
  55. {
  56. _Module.Init(ObjectMap, hInstance);
  57. DisableThreadLibraryCalls(hInstance);
  58. #ifdef _DEBUG
  59. MakeGlobalPool();
  60. #endif
  61. }
  62. else if (dwReason == DLL_PROCESS_DETACH)
  63. {
  64. _Module.Term();
  65. #ifdef _DEBUG
  66. FreeGlobalPool();
  67. #endif
  68. }
  69. return TRUE; // ok
  70. }
  71. /////////////////////////////////////////////////////////////////////////////
  72. // Used to determine whether the DLL can be unloaded by OLE
  73. STDAPI DllCanUnloadNow(void)
  74. {
  75. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  76. }
  77. /////////////////////////////////////////////////////////////////////////////
  78. // Returns a class factory to create an object of the requested type
  79. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  80. {
  81. return _Module.GetClassObject(rclsid, riid, ppv);
  82. }
  83. STDAPI DllRegisterServer(void)
  84. {
  85. return _Module.RegisterServer(FALSE);
  86. }
  87. STDAPI DllUnregisterServer(void)
  88. {
  89. _Module.UnregisterServer();
  90. return S_OK;
  91. }