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.

107 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. adminmgr.cxx
  5. Abstract:
  6. Implementation of DLL Exports.
  7. Author:
  8. Xiaoxi Tan (xtan) 11-May-2001
  9. --*/
  10. #include "pch.hxx"
  11. #include "stdafx.h"
  12. #include "resource.h"
  13. #include "initguid.h"
  14. #include "azroles.h"
  15. #include "azdisp.h"
  16. #include "azroles_i.c"
  17. CComModule _Module;
  18. BEGIN_OBJECT_MAP(ObjectMap)
  19. OBJECT_ENTRY(CLSID_AzAdminManager, CAzAdminManager)
  20. OBJECT_ENTRY(CLSID_AzApplication, CAzApplication)
  21. OBJECT_ENTRY(CLSID_AzEnumApplication, CAzEnumApplication)
  22. OBJECT_ENTRY(CLSID_AzOperation, CAzOperation)
  23. OBJECT_ENTRY(CLSID_AzEnumOperation, CAzEnumOperation)
  24. OBJECT_ENTRY(CLSID_AzTask, CAzTask)
  25. OBJECT_ENTRY(CLSID_AzEnumTask, CAzEnumTask)
  26. OBJECT_ENTRY(CLSID_AzScope, CAzScope)
  27. OBJECT_ENTRY(CLSID_AzEnumScope, CAzEnumScope)
  28. OBJECT_ENTRY(CLSID_AzApplicationGroup, CAzApplicationGroup)
  29. OBJECT_ENTRY(CLSID_AzEnumApplicationGroup, CAzEnumApplicationGroup)
  30. OBJECT_ENTRY(CLSID_AzRole, CAzRole)
  31. OBJECT_ENTRY(CLSID_AzEnumRole, CAzEnumRole)
  32. OBJECT_ENTRY(CLSID_AzJunctionPoint, CAzJunctionPoint)
  33. OBJECT_ENTRY(CLSID_AzEnumJunctionPoint, CAzEnumJunctionPoint)
  34. OBJECT_ENTRY(CLSID_AzClientContext, CAzClientContext)
  35. OBJECT_ENTRY(CLSID_AzAccessCheck, CAzAccessCheck)
  36. END_OBJECT_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // DLL Entry Point
  39. extern "C"
  40. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  41. {
  42. BOOL ret = TRUE;
  43. if (dwReason == DLL_PROCESS_ATTACH)
  44. {
  45. _Module.Init(ObjectMap, hInstance);
  46. DisableThreadLibraryCalls(hInstance);
  47. ret = AzDllInitialize();
  48. }
  49. else if (dwReason == DLL_PROCESS_DETACH)
  50. {
  51. _Module.Term();
  52. ret = AzDllUnInitialize();
  53. }
  54. return ret; // ok
  55. }
  56. /////////////////////////////////////////////////////////////////////////////
  57. // Used to determine whether the DLL can be unloaded by OLE
  58. STDAPI DllCanUnloadNow(void)
  59. {
  60. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // Returns a class factory to create an object of the requested type
  64. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  65. {
  66. return _Module.GetClassObject(rclsid, riid, ppv);
  67. }
  68. /////////////////////////////////////////////////////////////////////////////
  69. // DllRegisterServer - Adds entries to the system registry
  70. STDAPI DllRegisterServer(void)
  71. {
  72. // registers object, typelib and all interfaces in typelib
  73. return _Module.RegisterServer(TRUE);
  74. }
  75. /////////////////////////////////////////////////////////////////////////////
  76. // DllUnregisterServer - Removes entries from the system registry
  77. STDAPI DllUnregisterServer(void)
  78. {
  79. return _Module.UnregisterServer();
  80. }