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.

175 lines
2.9 KiB

  1. /*
  2. Copyright (c) 1997, Microsoft Corporation, all rights reserved
  3. Description:
  4. Implementation of DLL Exports.
  5. History:
  6. */
  7. #include "ceapcfg.h"
  8. #include <initguid.h>
  9. #include <atlimpl.cpp>
  10. #include "resource.h"
  11. CComModule _Module;
  12. HINSTANCE g_hInstance = NULL;
  13. const IID IID_IEAPProviderConfig = {0x66A2DB19,
  14. 0xD706,
  15. 0x11D0,
  16. {0xA3,0x7B,0x00,0xC0,0x4F,0xC9,0xDA,0x04}};
  17. const IID IID_IEAPProviderConfig2 = {0xD565917A,
  18. 0x85c4,
  19. 0x4466,
  20. {0x85,0x6E,0x67,0x1C,0x37,0x42,0xEA,0x9A}};
  21. // Define the EAPTLS UI GUIDs here
  22. const CLSID CLSID_EapCfg = {0x58ab2366,
  23. 0xd597,
  24. 0x11d1,
  25. {0xb9,0x0e,0x00,0xc0,0x4f,0xc9,0xb2,0x63}};
  26. BEGIN_OBJECT_MAP(ObjectMap)
  27. OBJECT_ENTRY(CLSID_EapCfg, CEapCfg)
  28. END_OBJECT_MAP()
  29. /*
  30. Returns:
  31. Notes:
  32. */
  33. extern "C"
  34. HINSTANCE
  35. GetHInstance(
  36. VOID
  37. )
  38. {
  39. return(g_hInstance);
  40. }
  41. /*
  42. Returns:
  43. Notes:
  44. DLL Entry Point
  45. */
  46. extern "C"
  47. {
  48. extern CRITICAL_SECTION g_csProtectCachedCredentials;
  49. extern BOOL g_fCriticalSectionInitialized;
  50. BOOL WINAPI
  51. DllMain(
  52. HINSTANCE hInstance,
  53. DWORD dwReason,
  54. LPVOID /*lpReserved*/
  55. )
  56. {
  57. if (dwReason == DLL_PROCESS_ATTACH)
  58. {
  59. g_hInstance = hInstance;
  60. _Module.Init(ObjectMap, hInstance);
  61. DisableThreadLibraryCalls(hInstance);
  62. }
  63. else if (dwReason == DLL_PROCESS_DETACH)
  64. {
  65. //
  66. // Check to see if the critical section is initialized.
  67. //
  68. if ( g_fCriticalSectionInitialized )
  69. DeleteCriticalSection( &g_csProtectCachedCredentials );
  70. _Module.Term();
  71. }
  72. return(TRUE);
  73. }
  74. }
  75. /*
  76. Returns:
  77. Notes:
  78. Used to determine whether the DLL can be unloaded by OLE
  79. */
  80. STDAPI
  81. DllCanUnloadNow(
  82. VOID
  83. )
  84. {
  85. if (0 == _Module.GetLockCount())
  86. {
  87. return(S_OK);
  88. }
  89. else
  90. {
  91. return(S_FALSE);
  92. }
  93. }
  94. /*
  95. Returns:
  96. Notes:
  97. Returns a class factory to create an object of the requested type
  98. */
  99. STDAPI
  100. DllGetClassObject(
  101. REFCLSID rclsid,
  102. REFIID riid,
  103. LPVOID* ppv
  104. )
  105. {
  106. return(_Module.GetClassObject(rclsid, riid, ppv));
  107. }
  108. /*
  109. Returns:
  110. Notes:
  111. Adds entries to the system registry. Registers object, typelib and all
  112. interfaces in typelib
  113. */
  114. STDAPI
  115. DllRegisterServer(
  116. VOID
  117. )
  118. {
  119. return(_Module.RegisterServer(FALSE /* bRegTypeLib */));
  120. }
  121. /*
  122. Returns:
  123. Notes:
  124. Removes entries from the system registry
  125. */
  126. STDAPI
  127. DllUnregisterServer(
  128. VOID
  129. )
  130. {
  131. _Module.UnregisterServer();
  132. return(S_OK);
  133. }