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.

106 lines
2.6 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // iassam.cpp
  8. //
  9. // SYNOPSIS
  10. //
  11. // Implementation of DLL exports for an ATL in proc server.
  12. //
  13. ///////////////////////////////////////////////////////////////////////////////
  14. #include <ias.h>
  15. #include <newop.cpp>
  16. CComModule _Module;
  17. #include <atlimpl.cpp>
  18. #include <ChangePwd.h>
  19. #include <MSChapError.h>
  20. #include <NTSamAuth.h>
  21. #include <NTSamNames.h>
  22. #include <NTSamPerUser.h>
  23. #include <NTSamUser.h>
  24. #include <EAP.h>
  25. #include <Hosts.h>
  26. BEGIN_OBJECT_MAP(ObjectMap)
  27. OBJECT_ENTRY( __uuidof(NTSamAuthentication),
  28. IASRequestHandlerObject<NTSamAuthentication> )
  29. OBJECT_ENTRY( __uuidof(NTSamNames),
  30. IASRequestHandlerObject<NTSamNames> )
  31. OBJECT_ENTRY( __uuidof(AccountValidation),
  32. IASRequestHandlerObject<AccountValidation> )
  33. OBJECT_ENTRY( __uuidof(NTSamPerUser),
  34. IASRequestHandlerObject<NTSamPerUser> )
  35. OBJECT_ENTRY( __uuidof(EAP),
  36. IASRequestHandlerObject<EAP> )
  37. OBJECT_ENTRY( __uuidof(MSChapErrorReporter),
  38. IASRequestHandlerObject<MSChapErrorReporter> )
  39. OBJECT_ENTRY( __uuidof(BaseCampHost),
  40. IASRequestHandlerObject<BaseCampHost> )
  41. OBJECT_ENTRY( __uuidof(AuthorizationHost),
  42. IASRequestHandlerObject<AuthorizationHost> )
  43. OBJECT_ENTRY( __uuidof(ChangePassword),
  44. IASRequestHandlerObject<ChangePassword> )
  45. END_OBJECT_MAP()
  46. //////////
  47. // DLL Entry Point
  48. //////////
  49. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  50. {
  51. if (dwReason == DLL_PROCESS_ATTACH)
  52. {
  53. _Module.Init(ObjectMap, hInstance);
  54. DisableThreadLibraryCalls(hInstance);
  55. }
  56. else if (dwReason == DLL_PROCESS_DETACH)
  57. {
  58. _Module.Term();
  59. }
  60. return TRUE;
  61. }
  62. //////////
  63. // Used to determine whether the DLL can be unloaded by OLE
  64. //////////
  65. STDAPI DllCanUnloadNow(void)
  66. {
  67. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  68. }
  69. //////////
  70. // Returns a class factory to create an object of the requested type.
  71. //////////
  72. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  73. {
  74. return _Module.GetClassObject(rclsid, riid, ppv);
  75. }
  76. //////////
  77. // DllRegisterServer - Adds entries to the system registry
  78. //////////
  79. STDAPI DllRegisterServer(void)
  80. {
  81. return _Module.RegisterServer(FALSE);
  82. }
  83. //////////
  84. // DllUnregisterServer - Removes entries from the system registry
  85. //////////
  86. STDAPI DllUnregisterServer(void)
  87. {
  88. return _Module.UnregisterServer();
  89. }