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.

165 lines
5.1 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992
  5. //
  6. // File: cdocfile.hxx
  7. //
  8. // Contents: CDocFile class header
  9. //
  10. // Classes: CDocFile
  11. //
  12. // History: 26-Sep-91 DrewB Created
  13. //
  14. //---------------------------------------------------------------
  15. #ifndef __CDOCFILE_HXX__
  16. #define __CDOCFILE_HXX__
  17. #include <dfmsp.hxx>
  18. #ifndef REF
  19. #include <dfbasis.hxx>
  20. #include <ulist.hxx>
  21. #endif //!REF
  22. #include <handle.hxx>
  23. #include <pdocfile.hxx>
  24. interface ILockBytes;
  25. class PDocFileIterator;
  26. //+--------------------------------------------------------------
  27. //
  28. // Class: CDocFile (df)
  29. //
  30. // Purpose: DocFile object
  31. //
  32. // Interface: See below
  33. //
  34. // History: 07-Nov-91 DrewB Created
  35. //
  36. //---------------------------------------------------------------
  37. class CDocFile : public PDocFile, public CMallocBased
  38. {
  39. public:
  40. inline void *operator new(size_t size, IMalloc * const pMalloc);
  41. inline void *operator new(size_t size, CDFBasis * const pdfb);
  42. inline void ReturnToReserve(CDFBasis * const pdfb);
  43. inline static SCODE Reserve(UINT cItems, CDFBasis * const pdfb);
  44. inline static void Unreserve(UINT cItems, CDFBasis * const pdfb);
  45. inline CDocFile(DFLUID luid, CDFBasis *pdfb);
  46. inline CDocFile(CMStream *pms,
  47. SID sid,
  48. DFLUID dl,
  49. CDFBasis *pdfb);
  50. SCODE InitFromEntry(CStgHandle *pstghParent,
  51. CDfName const *dfnName,
  52. BOOL const fCreate);
  53. inline ~CDocFile(void);
  54. // PDocFile
  55. inline void DecRef(void);
  56. SCODE DestroyEntry(CDfName const *dfnName,
  57. BOOL fClean);
  58. SCODE RenameEntry(CDfName const *dfnName,
  59. CDfName const *dfnNewName);
  60. SCODE GetClass(CLSID *pclsid);
  61. SCODE SetClass(REFCLSID clsid);
  62. SCODE GetStateBits(DWORD *pgrfStateBits);
  63. SCODE SetStateBits(DWORD grfStateBits, DWORD grfMask);
  64. SCODE CreateDocFile(CDfName const *pdfnName,
  65. DFLAGS const df,
  66. DFLUID luidSet,
  67. PDocFile **ppdfDocFile);
  68. inline SCODE CreateDocFile(CDfName const *pdfnName,
  69. DFLAGS const df,
  70. DFLUID luidSet,
  71. DWORD const dwType,
  72. PDocFile **ppdfDocFile)
  73. { return CreateDocFile(pdfnName, df, luidSet, ppdfDocFile); }
  74. SCODE GetDocFile(CDfName const *pdfnName,
  75. DFLAGS const df,
  76. PDocFile **ppdfDocFile);
  77. inline SCODE GetDocFile(CDfName const *pdfnName,
  78. DFLAGS const df,
  79. DWORD const dwType,
  80. PDocFile **ppdfDocFile)
  81. { return GetDocFile(pdfnName, df, ppdfDocFile); }
  82. inline void ReturnDocFile(CDocFile *pdf);
  83. SCODE CreateStream(CDfName const *pdfnName,
  84. DFLAGS const df,
  85. DFLUID luidSet,
  86. PSStream **ppsstStream);
  87. inline SCODE CreateStream(CDfName const *pdfnName,
  88. DFLAGS const df,
  89. DFLUID luidSet,
  90. DWORD const dwType,
  91. PSStream **ppsstStream)
  92. { return CreateStream(pdfnName, df, luidSet, ppsstStream); }
  93. SCODE GetStream(CDfName const *pdfnName,
  94. DFLAGS const df,
  95. PSStream **ppsstStream);
  96. inline SCODE GetStream(CDfName const *pdfnName,
  97. DFLAGS const df,
  98. DWORD const dwType,
  99. PSStream **ppsstStream)
  100. { return GetStream(pdfnName, df, ppsstStream); }
  101. inline void ReturnStream(CDirectStream *pstm);
  102. SCODE FindGreaterEntry(CDfName const *pdfnKey,
  103. SIterBuffer *pib,
  104. STATSTGW *pstat);
  105. SCODE StatEntry(CDfName const *pdfn,
  106. SIterBuffer *pib,
  107. STATSTGW *pstat);
  108. SCODE BeginCommitFromChild(CUpdateList &ulChanged,
  109. DWORD const dwFlags,
  110. CWrappedDocFile *pdfChild);
  111. void EndCommitFromChild(DFLAGS const df,
  112. CWrappedDocFile *pdfChild);
  113. SCODE IsEntry(CDfName const *dfnName,
  114. SEntryBuffer *peb);
  115. SCODE DeleteContents(void);
  116. // PTimeEntry
  117. SCODE GetTime(WHICHTIME wt, TIME_T *ptm);
  118. SCODE SetTime(WHICHTIME wt, TIME_T tm);
  119. SCODE GetAllTimes(TIME_T *patm, TIME_T *pmtm, TIME_T *pctm);
  120. SCODE SetAllTimes(TIME_T atm, TIME_T mtm, TIME_T ctm);
  121. inline CDocFile *GetReservedDocfile(DFLUID luid);
  122. inline CDirectStream *GetReservedStream(DFLUID luid);
  123. // New
  124. SCODE ApplyChanges(CUpdateList &ulChanged);
  125. SCODE CopyTo(CDocFile *pdfTo,
  126. DWORD dwFlags,
  127. SNBW snbExclude);
  128. #ifdef INDINST
  129. void Destroy(void);
  130. #endif
  131. inline CStgHandle *GetHandle(void);
  132. private:
  133. CUpdateList _ulChangedHolder;
  134. CStgHandle _stgh;
  135. CBasedDFBasisPtr const _pdfb;
  136. };
  137. // Inline methods are in dffuncs.hxx
  138. #endif