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.

230 lines
5.5 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: tset.hxx
  7. //
  8. // Contents: Transaction set definitions
  9. //
  10. // Classes: PTSetMember
  11. //
  12. // History: 12-Dec-91 DrewB Created
  13. //
  14. //---------------------------------------------------------------
  15. #ifndef __TSET_HXX__
  16. #define __TSET_HXX__
  17. #include <dfmsp.hxx>
  18. #include <ole.hxx>
  19. #include <dblink.hxx>
  20. //+--------------------------------------------------------------
  21. //
  22. // Class: PTSetMember (tsm)
  23. //
  24. // Purpose: Transaction set member object
  25. //
  26. // Interface: See below
  27. //
  28. // History: 07-Nov-91 DrewB Created
  29. //
  30. //---------------------------------------------------------------
  31. class PTSetMember : public CDlElement
  32. {
  33. public:
  34. void AddRef(void);
  35. void Release(void);
  36. SCODE BeginCommit(DWORD const dwFlags);
  37. void EndCommit(DFLAGS const df);
  38. void Revert(void);
  39. #ifdef LARGE_STREAMS
  40. void GetCommitInfo(ULONGLONG *pulRet1, ULONGLONG *pulRet2);
  41. #else
  42. void GetCommitInfo(ULONG *pulRet1, ULONG *pulRet2);
  43. #endif
  44. inline DWORD ObjectType(void) const;
  45. inline void SetXsInfo(DFLUID dlTree, DFLUID dlName, ULONG ulLevel);
  46. inline DFLUID GetTree(void);
  47. inline DFLUID GetName(void);
  48. inline ULONG GetLevel(void);
  49. inline ULONG GetFlags(void);
  50. inline void SetFlags(ULONG ulFlags);
  51. inline CDfName *GetDfName(void);
  52. SCODE Stat(STATSTGW *pstat, DWORD dwFlags);
  53. // CDlElement support
  54. DECLARE_DBLINK(PTSetMember)
  55. protected:
  56. inline PTSetMember(CDfName const *pdfn, DWORD dwType);
  57. ULONG _sig;
  58. private:
  59. const DWORD _dwType; // STGTY_*
  60. ULONG _ulFlags;
  61. DFLUID _dlTree, _dlName;
  62. ULONG _ulLevel;
  63. CDfName _dfnName;
  64. };
  65. SAFE_DFBASED_PTR(CBasedTSetMemberPtr, PTSetMember);
  66. //+-------------------------------------------------------------------------
  67. //
  68. // Member: PTSetMember::PTSetMember
  69. //
  70. // Synopsis: constructor
  71. //
  72. // Arguments: [dwType] - A STGTY flag
  73. //
  74. // History: 25-Jun-92 AlexT Created
  75. // 27-Jul-92 DrewB Changed to use STGTY
  76. //
  77. //--------------------------------------------------------------------------
  78. inline PTSetMember::PTSetMember(CDfName const *pdfn, DWORD dwType)
  79. : _dwType(dwType)
  80. {
  81. olAssert(pdfn != NULL && aMsg("PTSetMember name cannot be NULL"));
  82. _dfnName.Set(pdfn->GetLength(), pdfn->GetBuffer());
  83. }
  84. //+-------------------------------------------------------------------------
  85. //
  86. // Member: PTSetMember::ObjectType
  87. //
  88. // Synopsis: Returns type of PTSetMember this is
  89. //
  90. // Returns: Appropriate STGTY flag
  91. //
  92. // History: 25-Jun-92 AlexT Created
  93. // 27-Jul-92 DrewB Changed to use STGTY
  94. //
  95. //--------------------------------------------------------------------------
  96. inline DWORD PTSetMember::ObjectType(void) const
  97. {
  98. return _dwType;
  99. }
  100. //+--------------------------------------------------------------
  101. //
  102. // Member: PTSetMember::SetXsInfo, public
  103. //
  104. // Synopsis: Sets the XS member info
  105. //
  106. // Arguments: [dlTree] - LUID of containing tree
  107. // [dlName] - LUID of self
  108. // [ulLevel] - Tree depth
  109. //
  110. // History: 27-Jul-1992 DrewB Created
  111. //
  112. //---------------------------------------------------------------
  113. inline void PTSetMember::SetXsInfo(DFLUID dlTree,
  114. DFLUID dlName,
  115. ULONG ulLevel)
  116. {
  117. _dlTree = dlTree;
  118. _dlName = dlName;
  119. _ulLevel = ulLevel;
  120. _ulFlags = 0;
  121. }
  122. //+--------------------------------------------------------------
  123. //
  124. // Member: PTSetMember::GetTree, public
  125. //
  126. // Synopsis: Returns _dlTree
  127. //
  128. // History: 08-Apr-92 DrewB Created
  129. //
  130. //---------------------------------------------------------------
  131. inline DFLUID PTSetMember::GetTree(void)
  132. {
  133. return _dlTree;
  134. }
  135. //+--------------------------------------------------------------
  136. //
  137. // Member: PTSetMember::GetName, public
  138. //
  139. // Synopsis: Returns _dlName
  140. //
  141. // History: 08-Apr-92 DrewB Created
  142. //
  143. //---------------------------------------------------------------
  144. inline DFLUID PTSetMember::GetName(void)
  145. {
  146. return _dlName;
  147. }
  148. //+--------------------------------------------------------------
  149. //
  150. // Member: PTSetMember::GetDfName, public
  151. //
  152. // Synopsis: Returns _dfnName
  153. //
  154. // History: 28-Oct-92 AlexT Created
  155. //
  156. //---------------------------------------------------------------
  157. inline CDfName *PTSetMember::GetDfName(void)
  158. {
  159. return &_dfnName;
  160. }
  161. //+--------------------------------------------------------------
  162. //
  163. // Member: PTSetMember::GetLevel, public
  164. //
  165. // Synopsis: Returns _ulLevel
  166. //
  167. // History: 08-Apr-92 DrewB Created
  168. //
  169. //---------------------------------------------------------------
  170. inline ULONG PTSetMember::GetLevel(void)
  171. {
  172. return _ulLevel;
  173. }
  174. //+--------------------------------------------------------------
  175. //
  176. // Member: PTSetMember::GetFlags, public
  177. //
  178. // Synopsis: Returns _ulFlags
  179. //
  180. // History: 08-Apr-92 DrewB Created
  181. //
  182. //---------------------------------------------------------------
  183. inline ULONG PTSetMember::GetFlags(void)
  184. {
  185. return _ulFlags;
  186. }
  187. //+--------------------------------------------------------------
  188. //
  189. // Member: PTSetMember::SetFlags, public
  190. //
  191. // Synopsis: Sets _ulFlags
  192. //
  193. // History: 08-Apr-92 DrewB Created
  194. //
  195. //---------------------------------------------------------------
  196. inline void PTSetMember::SetFlags(ULONG ulFlags)
  197. {
  198. _ulFlags = ulFlags;
  199. }
  200. #endif