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.

117 lines
3.3 KiB

  1. // nntpadm.cpp : Implementation of DLL Exports.
  2. // You will need the NT SUR Beta 2 SDK or VC 4.2 in order to build this
  3. // project. This is because you will need MIDL 3.00.15 or higher and new
  4. // headers and libs. If you have VC 4.2 installed, then everything should
  5. // already be configured correctly.
  6. // Note: Proxy/Stub Information
  7. // To build a separate proxy/stub DLL,
  8. // run nmake -f nntpadmps.mak in the project directory.
  9. #include "stdafx.h"
  10. #include "nntpcmn.h"
  11. #include "admin.h"
  12. #include "expire.h"
  13. #include "feeds.h"
  14. #include "groups.h"
  15. #include "rebuild.h"
  16. #include "sessions.h"
  17. #include "server.h"
  18. #include "vroots.h"
  19. /*
  20. #include "propcach.h"
  21. #include "service.h"
  22. #include "virsrv.h"
  23. */
  24. #include "regmacro.h"
  25. CComModule _Module;
  26. BEGIN_OBJECT_MAP(ObjectMap)
  27. OBJECT_ENTRY(CLSID_CNntpAdmin, CNntpAdmin)
  28. OBJECT_ENTRY(CLSID_CNntpVirtualServer, CNntpVirtualServer)
  29. OBJECT_ENTRY(CLSID_CNntpAdminFeeds, CNntpAdminFeeds)
  30. OBJECT_ENTRY(CLSID_CNntpAdminExpiration, CNntpAdminExpiration)
  31. OBJECT_ENTRY(CLSID_CNntpAdminGroups, CNntpAdminGroups)
  32. OBJECT_ENTRY(CLSID_CNntpAdminSessions, CNntpAdminSessions)
  33. OBJECT_ENTRY(CLSID_CNntpAdminRebuild, CNntpAdminRebuild)
  34. OBJECT_ENTRY(CLSID_CNntpVirtualRoot, CNntpVirtualRoot)
  35. OBJECT_ENTRY(CLSID_CNntpFeed, CNntpFeed)
  36. OBJECT_ENTRY(CLSID_CNntpOneWayFeed, CNntpOneWayFeed)
  37. // OBJECT_ENTRY(CLSID_CNntpService, CNntpAdminService)
  38. // OBJECT_ENTRY(CLSID_CAdsNntpVirtualServer, CAdsNntpVirtualServer)
  39. END_OBJECT_MAP()
  40. BEGIN_EXTENSION_REGISTRATION_MAP
  41. EXTENSION_REGISTRATION_MAP_ENTRY(IIsNntpExpires, NntpAdminExpiration)
  42. EXTENSION_REGISTRATION_MAP_ENTRY(IIsNntpFeeds, NntpAdminFeeds)
  43. EXTENSION_REGISTRATION_MAP_ENTRY(IIsNntpGroups, NntpAdminGroups)
  44. EXTENSION_REGISTRATION_MAP_ENTRY(IIsNntpRebuild, NntpAdminRebuild)
  45. EXTENSION_REGISTRATION_MAP_ENTRY(IIsNntpSessions, NntpAdminSessions)
  46. END_EXTENSION_REGISTRATION_MAP
  47. /////////////////////////////////////////////////////////////////////////////
  48. // DLL Entry Point
  49. extern "C"
  50. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  51. {
  52. if (dwReason == DLL_PROCESS_ATTACH)
  53. {
  54. // InitAsyncTrace ();
  55. _Module.Init(ObjectMap, hInstance);
  56. DisableThreadLibraryCalls(hInstance);
  57. }
  58. else if (dwReason == DLL_PROCESS_DETACH) {
  59. // TermAsyncTrace ();
  60. _Module.Term();
  61. }
  62. return TRUE; // ok
  63. }
  64. /////////////////////////////////////////////////////////////////////////////
  65. // Used to determine whether the DLL can be unloaded by OLE
  66. STDAPI DllCanUnloadNow(void)
  67. {
  68. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  69. }
  70. /////////////////////////////////////////////////////////////////////////////
  71. // Returns a class factory to create an object of the requested type
  72. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  73. {
  74. return _Module.GetClassObject(rclsid, riid, ppv);
  75. }
  76. /////////////////////////////////////////////////////////////////////////////
  77. // DllRegisterServer - Adds entries to the system registry
  78. STDAPI DllRegisterServer(void)
  79. {
  80. // register extensions
  81. RegisterExtensions();
  82. // registers object, typelib and all interfaces in typelib
  83. return _Module.RegisterServer(TRUE);
  84. }
  85. /////////////////////////////////////////////////////////////////////////////
  86. // DllUnregisterServer - Removes entries from the system registry
  87. STDAPI DllUnregisterServer(void)
  88. {
  89. // register extensions
  90. UnregisterExtensions();
  91. _Module.UnregisterServer();
  92. return S_OK;
  93. }