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.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-1998
  5. //
  6. // File: ciodm.cxx
  7. //
  8. // Contents: Implementation of DLL Exports.
  9. //
  10. // History: 12-10-97 mohamedn/ATL Generated
  11. //
  12. //----------------------------------------------------------------------------
  13. // Note: Proxy/Stub Information
  14. // To build a separate proxy/stub DLL,
  15. // run nmake -f ciodmps.mk in the project directory.
  16. #include "pch.cxx"
  17. #pragma hdrstop
  18. #include "stdafx.h"
  19. #include "resource.h"
  20. #include "initguid.h"
  21. #include <ciodm.h>
  22. #include "ciodmGUID.h"
  23. #include "MacAdmin.hxx"
  24. #include "CatAdm.hxx"
  25. #include "scopeadm.hxx"
  26. CComModule _Module;
  27. BEGIN_OBJECT_MAP(ObjectMap)
  28. OBJECT_ENTRY(CLSID_AdminIndexServer, CMachineAdm)
  29. OBJECT_ENTRY(CLSID_CatAdm, CCatAdm)
  30. OBJECT_ENTRY(CLSID_ScopeAdm, CScopeAdm)
  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(TRUE);
  64. }
  65. /////////////////////////////////////////////////////////////////////////////
  66. // DllUnregisterServer - Removes entries from the system registry
  67. STDAPI DllUnregisterServer(void)
  68. {
  69. _Module.UnregisterServer();
  70. return S_OK;
  71. }