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.

89 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. azroles.cxx
  5. Abstract:
  6. Implementation of DLL Exports.
  7. Author:
  8. Xiaoxi Tan (xtan) 11-May-2001
  9. --*/
  10. #include "pch.hxx"
  11. #include "resource.h"
  12. #include "initguid.h"
  13. #include "azroles_i.c"
  14. CComModule _Module;
  15. BEGIN_OBJECT_MAP(ObjectMap)
  16. OBJECT_ENTRY(CLSID_AzAuthorizationStore, CAzAuthorizationStore)
  17. OBJECT_ENTRY(CLSID_AzBizRuleContext, CAzBizRuleContext)
  18. END_OBJECT_MAP()
  19. /////////////////////////////////////////////////////////////////////////////
  20. // DLL Entry Point
  21. extern "C"
  22. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  23. {
  24. BOOL ret = TRUE;
  25. if (dwReason == DLL_PROCESS_ATTACH)
  26. {
  27. _Module.Init(ObjectMap, hInstance);
  28. DisableThreadLibraryCalls(hInstance);
  29. ret = AzDllInitialize();
  30. }
  31. else if (dwReason == DLL_PROCESS_DETACH)
  32. {
  33. _Module.Term();
  34. ret = AzDllUnInitialize();
  35. }
  36. return ret; // ok
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // Used to determine whether the DLL can be unloaded by OLE
  40. STDAPI DllCanUnloadNow(void)
  41. {
  42. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  43. }
  44. /////////////////////////////////////////////////////////////////////////////
  45. // Returns a class factory to create an object of the requested type
  46. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  47. {
  48. return _Module.GetClassObject(rclsid, riid, ppv);
  49. }
  50. /////////////////////////////////////////////////////////////////////////////
  51. // DllRegisterServer - Adds entries to the system registry
  52. STDAPI DllRegisterServer(void)
  53. {
  54. // registers object, typelib and all interfaces in typelib
  55. return _Module.RegisterServer(TRUE);
  56. }
  57. /////////////////////////////////////////////////////////////////////////////
  58. // DllUnregisterServer - Removes entries from the system registry
  59. STDAPI DllUnregisterServer(void)
  60. {
  61. return _Module.UnregisterServer();
  62. }