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.

174 lines
4.0 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: iasradius.cpp
  4. //
  5. // Synopsis: this is the main Source File for the UDP
  6. // Protocol DLL
  7. //
  8. //
  9. // History: 8/18/97 MKarki Created
  10. //
  11. // Copyright (C) 1997-98 Microsoft Corporation
  12. // All rights reserved.
  13. //
  14. //----------------------------------------------------------------
  15. //
  16. // Note: Proxy/Stub Information
  17. // To build a separate proxy/stub DLL,
  18. // run nmake -f radprotops.mk in the project directory.
  19. #include "radcommon.h"
  20. #include "controller.h"
  21. #include "proxy.h"
  22. #include <newop.cpp>
  23. CComModule _Module;
  24. BEGIN_OBJECT_MAP(ObjectMap)
  25. OBJECT_ENTRY(__uuidof(RadiusProtocol), CController)
  26. OBJECT_ENTRY(__uuidof(RadiusProxy),
  27. IASRequestHandlerObject< RadiusProxy >)
  28. OBJECT_ENTRY(__uuidof(CClient), CClient)
  29. END_OBJECT_MAP()
  30. //++--------------------------------------------------------------
  31. //
  32. // Function: DllMain
  33. //
  34. // Synopsis: Disabling thread calls
  35. //
  36. // Arguments: [in] HINSTANCE - module handle
  37. // [in] DWORD - reason for call
  38. // reserved
  39. //
  40. // Returns: BOOL - sucess/failure
  41. //
  42. //
  43. // History: MKarki Created 8/20/97
  44. //
  45. //----------------------------------------------------------------
  46. extern "C" BOOL WINAPI
  47. DllMain(
  48. HINSTANCE hInstance,
  49. DWORD dwReason,
  50. LPVOID lpReserved
  51. )
  52. {
  53. if (dwReason == DLL_PROCESS_ATTACH)
  54. {
  55. _Module.Init(ObjectMap, hInstance);
  56. DisableThreadLibraryCalls(hInstance);
  57. }
  58. else if (dwReason == DLL_PROCESS_DETACH)
  59. {
  60. _Module.Term();
  61. }
  62. return (TRUE);
  63. } // end of DllMain method
  64. //++--------------------------------------------------------------
  65. //
  66. // Function: DllCanUnloadNow
  67. //
  68. // Synopsis: Used to determine if the DLL can be unloaded
  69. //
  70. // Arguments: NONE
  71. //
  72. // Returns: HRESULT
  73. //
  74. //
  75. // History: MKarki Created 8/20/97
  76. //
  77. //----------------------------------------------------------------
  78. STDAPI
  79. DllCanUnloadNow(
  80. VOID
  81. )
  82. {
  83. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  84. } // end of DllCanUnloadNow method
  85. //++--------------------------------------------------------------
  86. //
  87. // Function: DllGetClassObject
  88. //
  89. // Synopsis: Returns a class factory to create an object
  90. // of the requested type
  91. //
  92. // Arguments: [in] REFCLSID
  93. // [in] REFIID
  94. // [out] LPVOID - class factory
  95. //
  96. //
  97. // Returns: HRESULT
  98. //
  99. //
  100. // History: MKarki Created 8/20/97
  101. //
  102. //----------------------------------------------------------------
  103. STDAPI
  104. DllGetClassObject(
  105. REFCLSID rclsid,
  106. REFIID riid,
  107. LPVOID* ppv
  108. )
  109. {
  110. return (_Module.GetClassObject(rclsid, riid, ppv));
  111. } // end of DllGetClassObject method
  112. //++--------------------------------------------------------------
  113. //
  114. // Function: DllRegisterServer
  115. //
  116. // Synopsis: Add entries to the system registry
  117. //
  118. // Arguments: NONE
  119. //
  120. // Returns: HRESULT
  121. //
  122. //
  123. // History: MKarki Created 8/20/97
  124. //
  125. //----------------------------------------------------------------
  126. STDAPI DllRegisterServer(
  127. VOID
  128. )
  129. {
  130. //
  131. // registers object, typelib and all interfaces in typelib
  132. //
  133. return (_Module.RegisterServer(TRUE));
  134. } // end of DllRegisterServer method
  135. //++--------------------------------------------------------------
  136. //
  137. // Function: DllUnregisterServer
  138. //
  139. // Synopsis: Removes entries from the system registry
  140. //
  141. // Arguments: NONE
  142. //
  143. // Returns: HRESULT
  144. //
  145. //
  146. // History: MKarki Created 8/20/97
  147. //
  148. //----------------------------------------------------------------
  149. STDAPI DllUnregisterServer(
  150. VOID
  151. )
  152. {
  153. _Module.UnregisterServer();
  154. return (S_OK);
  155. } // end of DllUnregisterServer method
  156. #include <atlimpl.cpp>