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.

63 lines
2.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class RadiusExtension
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef EXTENSION_H
  11. #define EXTENSION_H
  12. #pragma once
  13. #include "authif.h"
  14. // Wrapper around an extension DLL.
  15. class RadiusExtension
  16. {
  17. public:
  18. RadiusExtension() throw ();
  19. ~RadiusExtension() throw ();
  20. // Load the extension DLL.
  21. DWORD Load(const wchar_t* dllPath) throw ();
  22. // Process a request.
  23. DWORD Process(RADIUS_EXTENSION_CONTROL_BLOCK* ecb) const throw ();
  24. private:
  25. wchar_t* name; // Module name; used for tracing.
  26. HINSTANCE module; // Module handle.
  27. bool initialized; // Has the module been successfully initialized ?
  28. // DLL entry points.
  29. PRADIUS_EXTENSION_INIT RadiusExtensionInit;
  30. PRADIUS_EXTENSION_TERM RadiusExtensionTerm;
  31. PRADIUS_EXTENSION_PROCESS RadiusExtensionProcess;
  32. PRADIUS_EXTENSION_PROCESS_EX RadiusExtensionProcessEx;
  33. PRADIUS_EXTENSION_FREE_ATTRIBUTES RadiusExtensionFreeAttributes;
  34. PRADIUS_EXTENSION_PROCESS_2 RadiusExtensionProcess2;
  35. // Flags to indicate which actions are allowed by old-style extensions.
  36. static const unsigned acceptAllowed = 0x1;
  37. static const unsigned rejectAllowed = 0x2;
  38. // Functions to create the attribute arrays used by old-style extensions.
  39. static RADIUS_ATTRIBUTE* CreateExtensionAttributes(
  40. RADIUS_EXTENSION_CONTROL_BLOCK* ecb
  41. ) throw ();
  42. static RADIUS_ATTRIBUTE* CreateAuthorizationAttributes(
  43. RADIUS_EXTENSION_CONTROL_BLOCK* ecb
  44. ) throw ();
  45. // Not implemented.
  46. RadiusExtension(const RadiusExtension&);
  47. RadiusExtension& operator=(const RadiusExtension&);
  48. };
  49. // Helper function to extract just the file name from a path.
  50. const wchar_t* ExtractFileNameFromPath(const wchar_t* path) throw ();
  51. #endif // EXTENSION_H