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.

90 lines
2.0 KiB

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