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.

62 lines
1.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // userr.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class UserRestrictions.
  12. //
  13. ///////////////////////////////////////////////////////////////////////////////
  14. #ifndef USERR_H
  15. #define USERR_H
  16. #include <iastl.h>
  17. #include <iastlutl.h>
  18. using namespace IASTL;
  19. ///////////////////////////////////////////////////////////////////////////////
  20. //
  21. // CLASS
  22. //
  23. // UserRestrictions
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. class ATL_NO_VTABLE UserRestrictions:
  27. public IASRequestHandlerSync,
  28. public CComCoClass<UserRestrictions, &__uuidof(URHandler)>
  29. {
  30. public:
  31. IAS_DECLARE_REGISTRY(URHandler, 1, IAS_REGISTRY_AUTO, IASTypeLibrary)
  32. protected:
  33. virtual IASREQUESTSTATUS onSyncRequest(IRequest* pRequest) throw ();
  34. private:
  35. // Helper functions for each of the restrictions we enforce.
  36. static BOOL checkAllowDialin(IAttributesRaw* request);
  37. static BOOL checkTimeOfDay(IAttributesRaw* request);
  38. static BOOL checkAuthenticationType(IAttributesRaw* request);
  39. static BOOL checkCallingStationId(IAttributesRaw* request);
  40. static BOOL checkCalledStationId(IAttributesRaw* request);
  41. static BOOL checkAllowedPortType(IAttributesRaw* request);
  42. static BOOL checkPasswordMustChange(IASRequest& request);
  43. static BOOL checkStringMatch(
  44. IAttributesRaw* request,
  45. DWORD allowedId,
  46. DWORD userId
  47. );
  48. // Default buffer size for retrieving attributes.
  49. typedef IASAttributeVectorWithBuffer<16> AttributeVector;
  50. };
  51. #endif // USERR_H