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.

107 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. server.cpp
  5. Abstract:
  6. This file implements the CComModule Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #include "private.h"
  12. #include "oldaimm.h"
  13. #include "dimmex.h"
  14. #include "dimmwrp.h"
  15. BEGIN_COCLASSFACTORY_TABLE
  16. DECLARE_COCLASSFACTORY_ENTRY(CLSID_CActiveIMM12, CActiveIMMAppEx, TEXT("CActiveIMMAppEx"))
  17. DECLARE_COCLASSFACTORY_ENTRY(CLSID_CActiveIMM12_Trident, CActiveIMMAppEx_Trident, TEXT("CActiveIMMAppEx_Trident"))
  18. DECLARE_COCLASSFACTORY_ENTRY(CLSID_CActiveIMM, CActiveIMMApp, TEXT("CActiveIMMApp"))
  19. END_COCLASSFACTORY_TABLE
  20. //+---------------------------------------------------------------------------
  21. //
  22. // DllInit
  23. //
  24. // Called on our first CoCreate. Use this function to do initialization that
  25. // would be unsafe during process attach, like anything requiring a LoadLibrary.
  26. //
  27. //----------------------------------------------------------------------------
  28. BOOL DllInit(void)
  29. {
  30. return TRUE;
  31. }
  32. //+---------------------------------------------------------------------------
  33. //
  34. // DllUninit
  35. //
  36. // Called after the dll ref count drops to zero. Use this function to do
  37. // uninitialization that would be unsafe during process detach, like
  38. // FreeLibrary calls, COM Releases, or mutexing.
  39. //
  40. //----------------------------------------------------------------------------
  41. void DllUninit(void)
  42. {
  43. }
  44. STDAPI
  45. DllGetClassObject(
  46. REFCLSID rclsid,
  47. REFIID riid,
  48. void** ppvObj
  49. )
  50. {
  51. return COMBase_DllGetClassObject(rclsid, riid, ppvObj);
  52. }
  53. STDAPI
  54. DllCanUnloadNow(
  55. void
  56. )
  57. {
  58. return COMBase_DllCanUnloadNow();
  59. }
  60. STDAPI
  61. DllRegisterServer(
  62. void
  63. )
  64. {
  65. #ifdef OLD_AIMM_ENABLED
  66. HRESULT hr;
  67. if ((hr=WIN32LR_DllRegisterServer()) != S_OK)
  68. return hr;
  69. #else
  70. #error Should call RegisterCategories(GUID_PROP_MSIMTF_READONLY)
  71. #endif // OLD_AIMM_ENABLED
  72. return COMBase_DllRegisterServer();
  73. }
  74. STDAPI
  75. DllUnregisterServer(
  76. void
  77. )
  78. {
  79. #ifdef OLD_AIMM_ENABLED
  80. HRESULT hr;
  81. if ((hr=WIN32LR_DllUnregisterServer()) != S_OK)
  82. return hr;
  83. #else
  84. #error Should call UnregisterCategories(GUID_PROP_MSIMTF_READONLY)
  85. #endif // OLD_AIMM_ENABLED
  86. return COMBase_DllUnregisterServer();
  87. }