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.

190 lines
2.8 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. class CShareInfo
  22. {
  23. DECLARE_SIG;
  24. public:
  25. CShareInfo(); // create new info
  26. CShareInfo(IN SHARE_INFO_502* pInfo); // cache existing info
  27. HRESULT
  28. InitInstance(
  29. VOID
  30. );
  31. ~CShareInfo();
  32. NET_API_STATUS
  33. Commit(
  34. IN PWSTR pszMachine
  35. );
  36. //
  37. // "Get" methods
  38. //
  39. SHARE_INFO_502*
  40. GetShareInfo(
  41. VOID
  42. );
  43. PWSTR
  44. GetNetname(
  45. VOID
  46. );
  47. DWORD
  48. GetType(
  49. VOID
  50. );
  51. PWSTR
  52. GetRemark(
  53. VOID
  54. );
  55. DWORD
  56. GetMaxUses(
  57. VOID
  58. );
  59. PWSTR
  60. GetPassword(
  61. VOID
  62. );
  63. PWSTR
  64. GetPath(
  65. VOID
  66. );
  67. PSECURITY_DESCRIPTOR
  68. GetSecurityDescriptor(
  69. VOID
  70. );
  71. //
  72. // "Set" methods
  73. //
  74. HRESULT
  75. SetNetname(
  76. IN PWSTR pszNetname
  77. );
  78. HRESULT
  79. SetType(
  80. IN DWORD dwType
  81. );
  82. HRESULT
  83. SetRemark(
  84. IN PWSTR pszRemark
  85. );
  86. HRESULT
  87. SetMaxUses(
  88. IN DWORD dwMaxUses
  89. );
  90. HRESULT
  91. SetPassword(
  92. IN PWSTR pszPassword
  93. );
  94. HRESULT
  95. SetPath(
  96. IN PWSTR pszPath
  97. );
  98. // Set... makes a copy of the argument
  99. HRESULT
  100. SetSecurityDescriptor(
  101. IN PSECURITY_DESCRIPTOR pSecDesc
  102. );
  103. // Transfer... takes ownership of "new BYTE[]" memory
  104. HRESULT
  105. TransferSecurityDescriptor(
  106. IN PSECURITY_DESCRIPTOR pSecDesc
  107. );
  108. //
  109. // Other Get/Set methods -- not SHARE_INFO_502 data
  110. //
  111. ULONG
  112. GetFlag(
  113. VOID
  114. );
  115. VOID
  116. SetDirtyFlag(
  117. ULONG flag
  118. );
  119. HRESULT
  120. Copy(
  121. IN SHARE_INFO_502* pInfo
  122. );
  123. #if DBG == 1
  124. VOID
  125. Dump(
  126. IN PWSTR pszCaption
  127. );
  128. #endif // DBG == 1
  129. BOOL
  130. TakeOwn(
  131. VOID
  132. );
  133. private:
  134. //
  135. // Main object data
  136. //
  137. BOOL m_bOwn;
  138. ULONG m_flags;
  139. SHARE_INFO_502* m_pInfo;
  140. };
  141. //
  142. // Helper API
  143. //
  144. VOID
  145. DeleteShareInfoList(
  146. IN CShareInfo* pShareInfoList,
  147. IN BOOL fDeleteDummyHeadNode = FALSE
  148. );
  149. #endif // __SHRINFO_HXX__