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.

214 lines
3.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: shrinfo.hxx
  7. //
  8. // Contents: Lanman SHARE_INFO encapsulation
  9. //
  10. // History: 21-Feb-95 BruceFo Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef __SHRINFO_HXX__
  14. #define __SHRINFO_HXX__
  15. //
  16. // Valid flags:
  17. //
  18. #define SHARE_FLAG_ADDED 1
  19. #define SHARE_FLAG_REMOVE 2
  20. #define SHARE_FLAG_MODIFY 3
  21. #include "dlink.hxx"
  22. class CShareInfo : public CDoubleLink
  23. {
  24. DECLARE_SIG;
  25. friend class CSharingPropertyPage; // for m_next
  26. public:
  27. CShareInfo(); // create new info
  28. CShareInfo(IN SHARE_INFO_502* pInfo); // cache existing info
  29. HRESULT
  30. InitInstance(
  31. VOID
  32. );
  33. ~CShareInfo();
  34. NET_API_STATUS
  35. Commit(
  36. IN PWSTR pszMachine
  37. );
  38. //
  39. // "Get" methods
  40. //
  41. SHARE_INFO_502*
  42. GetShareInfo(
  43. VOID
  44. );
  45. PWSTR
  46. GetNetname(
  47. VOID
  48. );
  49. DWORD
  50. GetType(
  51. VOID
  52. );
  53. PWSTR
  54. GetRemark(
  55. VOID
  56. );
  57. DWORD
  58. GetMaxUses(
  59. VOID
  60. );
  61. PWSTR
  62. GetPassword(
  63. VOID
  64. );
  65. PWSTR
  66. GetPath(
  67. VOID
  68. );
  69. PSECURITY_DESCRIPTOR
  70. GetSecurityDescriptor(
  71. VOID
  72. );
  73. //
  74. // "Set" methods
  75. //
  76. HRESULT
  77. SetNetname(
  78. IN PWSTR pszNetname
  79. );
  80. HRESULT
  81. SetType(
  82. IN DWORD dwType
  83. );
  84. HRESULT
  85. SetRemark(
  86. IN PWSTR pszRemark
  87. );
  88. HRESULT
  89. SetMaxUses(
  90. IN DWORD dwMaxUses
  91. );
  92. HRESULT
  93. SetPassword(
  94. IN PWSTR pszPassword
  95. );
  96. HRESULT
  97. SetPath(
  98. IN PWSTR pszPath
  99. );
  100. // Set... makes a copy of the argument
  101. HRESULT
  102. SetSecurityDescriptor(
  103. IN PSECURITY_DESCRIPTOR pSecDesc
  104. );
  105. // Transfer... takes ownership of "new BYTE[]" memory
  106. HRESULT
  107. TransferSecurityDescriptor(
  108. IN PSECURITY_DESCRIPTOR pSecDesc
  109. );
  110. //
  111. // Other Get/Set methods -- not SHARE_INFO_502 data
  112. //
  113. ULONG
  114. GetFlag(
  115. VOID
  116. );
  117. VOID
  118. SetDirtyFlag(
  119. ULONG flag
  120. );
  121. HRESULT
  122. Copy(
  123. IN SHARE_INFO_502* pInfo
  124. );
  125. #if DBG == 1
  126. VOID
  127. Dump(
  128. IN PWSTR pszCaption
  129. );
  130. #endif // DBG == 1
  131. BOOL
  132. TakeOwn(
  133. VOID
  134. );
  135. void
  136. SetCacheFlags (
  137. DWORD dwFlags
  138. );
  139. DWORD
  140. GetCacheFlags (
  141. VOID
  142. ) const;
  143. NET_API_STATUS
  144. ReadCacheFlags(
  145. VOID
  146. );
  147. private:
  148. bool m_bCachingSupported;
  149. NET_API_STATUS
  150. WriteCacheFlags(
  151. VOID
  152. );
  153. //
  154. // Main object data
  155. //
  156. BOOL m_bOwn;
  157. ULONG m_flags;
  158. SHARE_INFO_502* m_pInfo;
  159. DWORD m_dwCacheFlags;
  160. };
  161. //
  162. // Helper API
  163. //
  164. VOID
  165. DeleteShareInfoList(
  166. IN CShareInfo* pShareInfoList,
  167. IN BOOL fDeleteDummyHeadNode = FALSE
  168. );
  169. #endif // __SHRINFO_HXX__