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.

146 lines
2.3 KiB

  1. /*
  2. Copyright (c) 1999, Microsoft Corporation, all rights reserved
  3. Description:
  4. Implementation of DLL Exports.
  5. */
  6. #include <windows.h>
  7. #include <lmcons.h>
  8. #include <raseapif.h>
  9. #include <rtutils.h>
  10. #include "ceapcfg.h"
  11. #include <initguid.h>
  12. #include <atlimpl.cpp>
  13. extern "C"
  14. {
  15. extern DWORD g_dwEapTraceId;
  16. extern HINSTANCE g_hInstance;
  17. }
  18. CComModule _Module;
  19. const IID IID_IEAPProviderConfig = {
  20. 0x66A2DB19,
  21. 0xD706,
  22. 0x11D0,
  23. {0xA3, 0x7B, 0x00, 0xC0, 0x4F, 0xC9, 0xDA, 0x04}
  24. };
  25. // Define the EAP UI GUIDs here
  26. const CLSID CLSID_EapCfg = { /* 3b9aae60-a032-11d2-95f6-00104b98f3f5 */
  27. 0x3b9aae60,
  28. 0xa032,
  29. 0x11d2,
  30. {0x95, 0xf6, 0x00, 0x10, 0x4b, 0x98, 0xf3, 0xf5}
  31. };
  32. BEGIN_OBJECT_MAP(ObjectMap)
  33. OBJECT_ENTRY(CLSID_EapCfg, CEapCfg)
  34. END_OBJECT_MAP()
  35. /*
  36. Notes:
  37. DLL Entry Point
  38. */
  39. extern "C"
  40. BOOL WINAPI
  41. DllMain(
  42. HINSTANCE hInstance,
  43. DWORD dwReason,
  44. LPVOID /*lpReserved*/
  45. )
  46. {
  47. if (dwReason == DLL_PROCESS_ATTACH)
  48. {
  49. g_hInstance = hInstance;
  50. g_dwEapTraceId = TraceRegister(L"SampleEAP");
  51. _Module.Init(ObjectMap, hInstance);
  52. DisableThreadLibraryCalls(hInstance);
  53. }
  54. else if (dwReason == DLL_PROCESS_DETACH)
  55. {
  56. TraceDeregister(g_dwEapTraceId);
  57. g_dwEapTraceId = INVALID_TRACEID;
  58. _Module.Term();
  59. }
  60. return(TRUE);
  61. }
  62. /*
  63. Notes:
  64. Used to determine whether the DLL can be unloaded by OLE
  65. */
  66. STDAPI
  67. DllCanUnloadNow(
  68. VOID
  69. )
  70. {
  71. if (0 == _Module.GetLockCount())
  72. {
  73. return(S_OK);
  74. }
  75. else
  76. {
  77. return(S_FALSE);
  78. }
  79. }
  80. /*
  81. Notes:
  82. Returns a class factory to create an object of the requested type
  83. */
  84. STDAPI
  85. DllGetClassObject(
  86. REFCLSID rclsid,
  87. REFIID riid,
  88. LPVOID* ppv
  89. )
  90. {
  91. return(_Module.GetClassObject(rclsid, riid, ppv));
  92. }
  93. /*
  94. Notes:
  95. Adds entries to the system registry. Registers object, typelib and all
  96. interfaces in typelib
  97. */
  98. STDAPI
  99. DllRegisterServer(
  100. VOID
  101. )
  102. {
  103. return(_Module.RegisterServer(FALSE /* bRegTypeLib */));
  104. }
  105. /*
  106. Notes:
  107. Removes entries from the system registry
  108. */
  109. STDAPI
  110. DllUnregisterServer(
  111. VOID
  112. )
  113. {
  114. _Module.UnregisterServer();
  115. return(S_OK);
  116. }