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.

78 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: AUTHENT.HXX
  7. //
  8. // Contents: Definitions for code to handle multiplexing multiple
  9. // concurrent IAuthenticate interfaces.
  10. //
  11. // Classes: CBasicAuthHolder
  12. //
  13. // Functions:
  14. //
  15. // History: 02-05-96 JoeS (Joe Souza) Created
  16. //
  17. //----------------------------------------------------------------------------
  18. #ifndef _AUTHENT_HXX_
  19. #define _AUTHENT_HXX_
  20. class CBasicAuthNode;
  21. class CBasicAuthNode
  22. {
  23. public:
  24. CBasicAuthNode(IAuthenticate *pIBasicAuth)
  25. {
  26. _pIBasicAuth = pIBasicAuth;
  27. _pNext = NULL;
  28. }
  29. IAuthenticate *GetBasicAuthentication()
  30. {
  31. return _pIBasicAuth;
  32. }
  33. CBasicAuthNode *GetNextNode()
  34. {
  35. return _pNext;
  36. }
  37. void SetNextNode(CBasicAuthNode *pNext)
  38. {
  39. _pNext = pNext;
  40. }
  41. private:
  42. IAuthenticate * _pIBasicAuth; // Pointer to caller's IAuthenticate.
  43. CBasicAuthNode * _pNext;
  44. };
  45. class CBasicAuthHolder : public IAuthenticate
  46. {
  47. public:
  48. CBasicAuthHolder(void);
  49. // *** IUnknown methods ***
  50. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj);
  51. STDMETHOD_(ULONG,AddRef) (THIS);
  52. STDMETHOD_(ULONG,Release) (THIS);
  53. // *** IAuthenticate methods ***
  54. STDMETHOD(Authenticate) (
  55. HWND* phwnd,
  56. LPWSTR *pszUsername,
  57. LPWSTR *pszPassword);
  58. // *** Helper functions ***
  59. STDMETHOD(AddNode) (IAuthenticate *IBasicAuth);
  60. private:
  61. STDMETHOD(RemoveAllNodes) (void);
  62. CRefCount _CRefs;
  63. // BUGBUG: have node of 5 elements or so!
  64. CBasicAuthNode *_pCBasicAuthNode;
  65. LONG _cElements;
  66. };
  67. #endif //_AUTHENT_HXX_
  68.