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.

88 lines
2.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 1999-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // SetAlertEmail.cpp
  7. //
  8. // Description:
  9. // Implementation of DLL Exports.
  10. //
  11. // History:
  12. // 1. lustar.li (Guogang Li), creation date in 18-DEC-2000
  13. //
  14. // Notes:
  15. //
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. //
  19. // Note: Proxy/Stub Information
  20. // To build a separate proxy/stub DLL,
  21. // run nmake -f SetAlertEmailps.mk in the project directory.
  22. //
  23. #include "stdafx.h"
  24. #include "resource.h"
  25. #include <initguid.h>
  26. #include "SetAlertEmail.h"
  27. #include "ConfigAlertEmail.h"
  28. CComModule _Module;
  29. BEGIN_OBJECT_MAP(ObjectMap)
  30. OBJECT_ENTRY(CLSID_ConfigAlertEmail, CConfigAlertEmail)
  31. END_OBJECT_MAP()
  32. /////////////////////////////////////////////////////////////////////////////
  33. // DLL Entry Point
  34. extern "C"
  35. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  36. {
  37. if (dwReason == DLL_PROCESS_ATTACH)
  38. {
  39. _Module.Init(ObjectMap, hInstance);
  40. DisableThreadLibraryCalls(hInstance);
  41. }
  42. else if (dwReason == DLL_PROCESS_DETACH)
  43. _Module.Term();
  44. return TRUE; // ok
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // Used to determine whether the DLL can be unloaded by OLE
  48. STDAPI DllCanUnloadNow(void)
  49. {
  50. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  51. }
  52. /////////////////////////////////////////////////////////////////////////////
  53. // Returns a class factory to create an object of the requested type
  54. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  55. {
  56. return _Module.GetClassObject(rclsid, riid, ppv);
  57. }
  58. /////////////////////////////////////////////////////////////////////////////
  59. // DllRegisterServer - Adds entries to the system registry
  60. STDAPI DllRegisterServer(void)
  61. {
  62. // registers object, typelib and all interfaces in typelib
  63. return _Module.RegisterServer(FALSE);
  64. }
  65. /////////////////////////////////////////////////////////////////////////////
  66. // DllUnregisterServer - Removes entries from the system registry
  67. STDAPI DllUnregisterServer(void)
  68. {
  69. return _Module.UnregisterServer();
  70. }