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.

76 lines
2.0 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. // ServDeps.cpp : Implementation of DLL Exports.
  3. // Note: Proxy/Stub Information
  4. // To build a separate proxy/stub DLL,
  5. // run nmake -f ServDepsps.mk in the project directory.
  6. #include "precomp.h"
  7. #include "resource.h"
  8. #include "initguid.h"
  9. #include "ServDeps.h"
  10. #include "ServDeps_i.c"
  11. #include "SDSnapin.h"
  12. CExeModule _Module;
  13. BEGIN_OBJECT_MAP(ObjectMap)
  14. OBJECT_ENTRY(CLSID_SDSnapin, CSDSnapin)
  15. OBJECT_ENTRY(CLSID_SDSnapinAbout, CSDSnapinAbout)
  16. END_OBJECT_MAP()
  17. /////////////////////////////////////////////////////////////////////////////
  18. // DLL Entry Point
  19. extern "C"
  20. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  21. {
  22. if (dwReason == DLL_PROCESS_ATTACH)
  23. {
  24. _Module.Init(ObjectMap, hInstance);
  25. CSnapInItem::Init();
  26. DisableThreadLibraryCalls(hInstance);
  27. }
  28. else if (dwReason == DLL_PROCESS_DETACH)
  29. _Module.Term();
  30. return TRUE; // ok
  31. }
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Used to determine whether the DLL can be unloaded by OLE
  34. STDAPI DllCanUnloadNow(void)
  35. {
  36. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // Returns a class factory to create an object of the requested type
  40. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  41. {
  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. return _Module.RegisterServer(TRUE);
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // DllUnregisterServer - Removes entries from the system registry
  53. STDAPI DllUnregisterServer(void)
  54. {
  55. _Module.UnregisterServer();
  56. return S_OK;
  57. }