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.

86 lines
2.4 KiB

  1. // P3Admin.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f P3Adminps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include "P3Admin.h"
  9. #include "P3Admin_i.c"
  10. #include "P3Config.h"
  11. #include "P3Domains.h"
  12. #include "P3Domain.h"
  13. #include "P3Users.h"
  14. #include "P3Service.h"
  15. #include "P3DomainEnum.h"
  16. #include "P3User.h"
  17. #include "P3UserEnum.h"
  18. CComModule _Module;
  19. BEGIN_OBJECT_MAP(ObjectMap)
  20. OBJECT_ENTRY(CLSID_P3Config, CP3Config)
  21. //OBJECT_ENTRY(CLSID_P3Domains, CP3Domains)
  22. //OBJECT_ENTRY(CLSID_P3Domain, CP3Domain)
  23. //OBJECT_ENTRY(CLSID_P3Users, CP3Users)
  24. //OBJECT_ENTRY(CLSID_P3Service, CP3Service)
  25. //OBJECT_ENTRY(CLSID_P3DomainEnum, CP3DomainEnum)
  26. //OBJECT_ENTRY(CLSID_P3User, CP3User)
  27. //OBJECT_ENTRY(CLSID_P3UserEnum, CP3UserEnum)
  28. END_OBJECT_MAP()
  29. /////////////////////////////////////////////////////////////////////////////
  30. // DLL Entry Point
  31. extern "C"
  32. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  33. {
  34. if (dwReason == DLL_PROCESS_ATTACH)
  35. {
  36. _Module.Init(ObjectMap, hInstance, &LIBID_P3ADMINLib);
  37. DisableThreadLibraryCalls(hInstance);
  38. }
  39. else if (dwReason == DLL_PROCESS_DETACH)
  40. _Module.Term();
  41. return TRUE; // ok
  42. }
  43. /////////////////////////////////////////////////////////////////////////////
  44. // Used to determine whether the DLL can be unloaded by OLE
  45. STDAPI DllCanUnloadNow(void)
  46. {
  47. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // Returns a class factory to create an object of the requested type
  51. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  52. {
  53. return _Module.GetClassObject(rclsid, riid, ppv);
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // DllRegisterServer - Adds entries to the system registry
  57. STDAPI DllRegisterServer(void)
  58. {
  59. // registers object, typelib and all interfaces in typelib
  60. return _Module.RegisterServer(TRUE);
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // DllUnregisterServer - Removes entries from the system registry
  64. STDAPI DllUnregisterServer(void)
  65. {
  66. return _Module.UnregisterServer(TRUE);
  67. }