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.

133 lines
2.2 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  5. //
  6. // File: bindinfo.hxx
  7. //
  8. // Contents: Class for keeping bind hanles in cache.
  9. //
  10. // Classes: CBindInfo
  11. //
  12. // History: 20-oct-2000 hiteshr Created
  13. //
  14. //---------------------------------------------------------------------------
  15. #ifndef __BINDNFO_HXX_
  16. #define __BINDINFO_HXX_
  17. //
  18. // Forward references
  19. //
  20. //===========================================================================
  21. //
  22. // CBindInfo
  23. //
  24. //===========================================================================
  25. //+--------------------------------------------------------------------------
  26. //
  27. // Class: CBindInfo
  28. //
  29. // Purpose: Manage credential and status info for a server
  30. //
  31. // History: 04-24-1998 DavidMun Created
  32. //
  33. //---------------------------------------------------------------------------
  34. class CBindInfo
  35. {
  36. public:
  37. CBindInfo(CBinder *pBinder,
  38. PCWSTR pwzServer,
  39. DWORD dwFlag);
  40. HRESULT
  41. Init(
  42. HWND hwnd);
  43. ~CBindInfo();
  44. CBindInfo *
  45. Next();
  46. BOOL
  47. IsForDomain(PCWSTR pwzServer);
  48. void
  49. LinkAfter(CBindInfo *pPrev);
  50. HANDLE
  51. GetDS(){ return m_hDs; }
  52. private:
  53. HRESULT
  54. _AskForCreds(
  55. HWND hwndParent,
  56. PWSTR wzUserName,
  57. PWSTR wzPassword);
  58. HRESULT
  59. _AskForCredsViaSendMessage(
  60. HWND hwndParent,
  61. PWSTR wzUserName,
  62. PWSTR wzPassword);
  63. HRESULT
  64. _AskForCredsViaPostMessage(
  65. HWND hwndParent,
  66. PWSTR wzUserName,
  67. PWSTR wzPassword);
  68. void
  69. _PopupCredErr(
  70. HWND hwnd,
  71. ULONG ids,
  72. PCWSTR pwzUserName,
  73. PCWSTR pwzError);
  74. String m_strDomainPath;
  75. CBinder *m_pBinder; // contains this
  76. CBindInfo *m_pNext;
  77. HANDLE m_hDs;
  78. HRESULT m_hrLastCredError;
  79. DWORD m_dwFlag;
  80. };
  81. inline CBindInfo *
  82. CBindInfo::Next()
  83. {
  84. return m_pNext;
  85. }
  86. inline void
  87. CBindInfo::LinkAfter(
  88. CBindInfo *pPrev)
  89. {
  90. pPrev->m_pNext = this;
  91. }
  92. //
  93. // Smart pointer
  94. //
  95. typedef auto_ptr<CBindInfo> CSpBindInfo;
  96. #endif // __SRVINFO_HXX_