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.

86 lines
2.0 KiB

  1. // CIENTRY.CPP : Implementation of DLL Exports.
  2. #include <atlinc.h>
  3. #include <initguid.h>
  4. #include <itcc.h>
  5. #include <mvopsys.h>
  6. #include <_mvutil.h>
  7. #include <itwbrkid.h>
  8. #include <itsortid.h>
  9. #include <itpropl.h>
  10. #include <itrs.h>
  11. #include <itdb.h>
  12. #include <itgroup.h>
  13. #include "svWrdSnk.h"
  14. #include "cmdint\cmdint.h"
  15. #include "itsvmgr.h"
  16. #include "gpbuild\gpumain.h"
  17. #include "gpbuild\wfumain.h"
  18. #include "ftbuild\ftumain.h"
  19. CComModule _Module;
  20. HINSTANCE _hInstITCC;
  21. BEGIN_OBJECT_MAP(ObjectMap)
  22. OBJECT_ENTRY(CLSID_IITCmdInt, CITCmdInt)
  23. OBJECT_ENTRY(CLSID_IITSvMgr, CITSvMgr)
  24. OBJECT_ENTRY(CLSID_IITGroupUpdate, CITGroupUpdate)
  25. OBJECT_ENTRY(CLSID_IITIndexBuild, CITIndexBuild)
  26. OBJECT_ENTRY(CLSID_IITWWFilterBuild, CITWWFilterUpdate)
  27. OBJECT_ENTRY(CLSID_IITWordSink, CDefWordSink)
  28. END_OBJECT_MAP()
  29. /////////////////////////////////////////////////////////////////////////////
  30. // DLL Entry Point
  31. extern "C"
  32. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  33. {
  34. if (dwReason == DLL_PROCESS_ATTACH)
  35. {
  36. _Module.Init(ObjectMap, hInstance);
  37. DisableThreadLibraryCalls(hInstance);
  38. #ifdef _DEBUG
  39. MakeGlobalPool();
  40. #endif
  41. }
  42. else if (dwReason == DLL_PROCESS_DETACH)
  43. {
  44. _Module.Term();
  45. #ifdef _DEBUG
  46. FreeGlobalPool();
  47. #endif
  48. }
  49. _hInstITCC = hInstance;
  50. return TRUE; // ok
  51. }
  52. /////////////////////////////////////////////////////////////////////////////
  53. // Used to determine whether the DLL can be unloaded by OLE
  54. STDAPI DllCanUnloadNow(void)
  55. {
  56. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  57. }
  58. /////////////////////////////////////////////////////////////////////////////
  59. // Returns a class factory to create an object of the requested type
  60. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  61. {
  62. return _Module.GetClassObject(rclsid, riid, ppv);
  63. }
  64. STDAPI DllRegisterServer(void)
  65. {
  66. return _Module.RegisterServer(FALSE);
  67. }
  68. STDAPI DllUnregisterServer(void)
  69. {
  70. _Module.UnregisterServer();
  71. return S_OK;
  72. }