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.

188 lines
3.0 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 = {0x2af6bcaa,
  23. 0xf526,
  24. 0x4803,
  25. {0xae,0xb8,0x57,0x77,0xce,0x38,0x66,0x47}};
  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. extern "C"
  42. HINSTANCE
  43. GetRasDlgDLLHInstance(
  44. VOID
  45. )
  46. {
  47. static HINSTANCE hResourceModule = NULL;
  48. if ( !hResourceModule )
  49. {
  50. //
  51. // Change the name of this DLL as required for each service pack
  52. //
  53. hResourceModule = LoadLibrary ( "rasdlg.dll");
  54. }
  55. return(hResourceModule);
  56. }
  57. /*
  58. Returns:
  59. Notes:
  60. DLL Entry Point
  61. */
  62. extern "C"
  63. BOOL WINAPI
  64. DllMain(
  65. HINSTANCE hInstance,
  66. DWORD dwReason,
  67. LPVOID /*lpReserved*/
  68. )
  69. {
  70. if (dwReason == DLL_PROCESS_ATTACH)
  71. {
  72. g_hInstance = hInstance;
  73. _Module.Init(ObjectMap, hInstance);
  74. DisableThreadLibraryCalls(hInstance);
  75. }
  76. else if (dwReason == DLL_PROCESS_DETACH)
  77. {
  78. _Module.Term();
  79. }
  80. return(TRUE);
  81. }
  82. /*
  83. Returns:
  84. Notes:
  85. Used to determine whether the DLL can be unloaded by OLE
  86. */
  87. STDAPI
  88. DllCanUnloadNow(
  89. VOID
  90. )
  91. {
  92. if (0 == _Module.GetLockCount())
  93. {
  94. return(S_OK);
  95. }
  96. else
  97. {
  98. return(S_FALSE);
  99. }
  100. }
  101. /*
  102. Returns:
  103. Notes:
  104. Returns a class factory to create an object of the requested type
  105. */
  106. STDAPI
  107. DllGetClassObject(
  108. REFCLSID rclsid,
  109. REFIID riid,
  110. LPVOID* ppv
  111. )
  112. {
  113. return(_Module.GetClassObject(rclsid, riid, ppv));
  114. }
  115. /*
  116. Returns:
  117. Notes:
  118. Adds entries to the system registry. Registers object, typelib and all
  119. interfaces in typelib
  120. */
  121. STDAPI
  122. DllRegisterServer(
  123. VOID
  124. )
  125. {
  126. return(_Module.RegisterServer(FALSE /* bRegTypeLib */));
  127. }
  128. /*
  129. Returns:
  130. Notes:
  131. Removes entries from the system registry
  132. */
  133. STDAPI
  134. DllUnregisterServer(
  135. VOID
  136. )
  137. {
  138. _Module.UnregisterServer();
  139. return(S_OK);
  140. }