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.

105 lines
2.8 KiB

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