Source code of Windows XP (NT5)
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.

84 lines
1.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // extension.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class BaseCampExtension.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 12/01/1998 Original version.
  16. // 04/01/1999 Add new entry points.
  17. // 07/09/1999 Fix potential AV in BaseCampExtension::freeAttrs
  18. //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. #ifndef _EXTENSION_H_
  21. #define _EXTENSION_H_
  22. #if _MSC_VER >= 1000
  23. #pragma once
  24. #endif
  25. #include <authif.h>
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CLASS
  29. //
  30. // BaseCampExtension
  31. //
  32. // DESCRIPTION
  33. //
  34. // Wrapper around a RADIUS extension DLL.
  35. //
  36. ///////////////////////////////////////////////////////////////////////////////
  37. class BaseCampExtension
  38. {
  39. public:
  40. BaseCampExtension() throw ();
  41. ~BaseCampExtension() throw ();
  42. PCWSTR getName() throw ()
  43. { return name; }
  44. // Loads the extension DLL.
  45. DWORD load(PCWSTR dllPath) throw ();
  46. // Process a request.
  47. DWORD process(
  48. IN CONST RADIUS_ATTRIBUTE* pInAttrs,
  49. OUT PRADIUS_ATTRIBUTE* pOutAttrs,
  50. OUT PRADIUS_ACTION pfAction
  51. ) throw ();
  52. void freeAttrs(
  53. IN PRADIUS_ATTRIBUTE pAttrs
  54. ) throw ()
  55. { if (freeAttrsFn) { freeAttrsFn(pAttrs); } }
  56. protected:
  57. // Module handle.
  58. HINSTANCE hModule;
  59. // Module name.
  60. PWSTR name;
  61. // DLL entry points.
  62. PRADIUS_EXTENSION_INIT initFn;
  63. PRADIUS_EXTENSION_TERM termFn;
  64. PRADIUS_EXTENSION_PROCESS processFn;
  65. PRADIUS_EXTENSION_PROCESS_EX processExFn;
  66. PRADIUS_EXTENSION_FREE_ATTRIBUTES freeAttrsFn;
  67. private:
  68. // Not implemented.
  69. BaseCampExtension(const BaseCampExtension&);
  70. BaseCampExtension& operator=(const BaseCampExtension&);
  71. };
  72. #endif // _EXTENSION_H_