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.

72 lines
1.8 KiB

  1. #include "stdafx.h"
  2. #include "resource.h"
  3. #include "initguid.h"
  4. #include "seo.h"
  5. #include "SEO_i.c"
  6. #include "nntpfilt.h"
  7. #include "ddrop.h"
  8. #include "ddrop_i.c"
  9. #include "nntpfilt_i.c"
  10. #include "filter.h"
  11. CComModule _Module;
  12. BEGIN_OBJECT_MAP(ObjectMap)
  13. OBJECT_ENTRY(CLSID_CNNTPDirectoryDrop, CNNTPDirectoryDrop)
  14. END_OBJECT_MAP()
  15. /////////////////////////////////////////////////////////////////////////////
  16. // DLL Entry Point
  17. extern "C"
  18. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) {
  19. if (dwReason == DLL_PROCESS_ATTACH) {
  20. _Module.Init(ObjectMap,hInstance);
  21. DisableThreadLibraryCalls(hInstance);
  22. }
  23. else if (dwReason == DLL_PROCESS_DETACH) {
  24. _Module.Term();
  25. }
  26. return (TRUE); // ok
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Used to determine whether the DLL can be unloaded by OLE
  30. STDAPI DllCanUnloadNow(void) {
  31. HRESULT hRes = (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  32. return (hRes);
  33. }
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Returns a class factory to create an object of the requested type
  36. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) {
  37. HRESULT hRes = _Module.GetClassObject(rclsid,riid,ppv);
  38. return (hRes);
  39. }
  40. /////////////////////////////////////////////////////////////////////////////
  41. // DllRegisterServer - Adds entries to the system registry
  42. STDAPI DllRegisterServer(void) {
  43. // registers object, typelib and all interfaces in typelib
  44. HRESULT hRes = _Module.RegisterServer();
  45. return (hRes);
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // DllUnregisterServer - Removes entries from the system registry
  49. STDAPI DllUnregisterServer(void) {
  50. _Module.UnregisterServer();
  51. return (S_OK);
  52. }