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.

158 lines
4.7 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1996
  5. //
  6. // File: cdocfile.hxx
  7. //
  8. // Contents: CDocFile class header
  9. //
  10. // Classes: CDocFile
  11. //
  12. //---------------------------------------------------------------
  13. #ifndef __CDOCFILE_HXX__
  14. #define __CDOCFILE_HXX__
  15. #include "handle.hxx"
  16. #include "entry.hxx"
  17. interface ILockBytes;
  18. class PDocFileIterator;
  19. class CUpdateList;
  20. // CopyDocFileToDocFile flags
  21. #define CDF_NORMAL 0 // Normal copy
  22. #define CDF_EXACT 1 // Exact dir entry match
  23. #define CDF_REMAP 2 // Remap handles
  24. #define CDF_ENTRIESONLY 4 // Don't copy contents
  25. //+--------------------------------------------------------------
  26. //
  27. // Class: CDocFile (df)
  28. //
  29. // Purpose: DocFile object
  30. //
  31. // Interface: See below
  32. //
  33. //---------------------------------------------------------------
  34. class CDocFile : public PEntry
  35. {
  36. public:
  37. inline CDocFile(DFLUID luid, ILockBytes *pilbBase);
  38. inline CDocFile(CMStream *pms,
  39. SID sid,
  40. DFLUID dl,
  41. ILockBytes *pilbBase);
  42. SCODE InitFromEntry(CStgHandle *pstghParent,
  43. CDfName const *dfnName,
  44. BOOL const fCreate);
  45. inline ~CDocFile(void);
  46. void AddRef(void);
  47. inline void DecRef(void);
  48. void Release(void);
  49. SCODE DestroyEntry(CDfName const *dfnName,
  50. BOOL fClean);
  51. SCODE RenameEntry(CDfName const *dfnName,
  52. CDfName const *dfnNewName);
  53. SCODE GetClass(CLSID *pclsid);
  54. SCODE SetClass(REFCLSID clsid);
  55. SCODE GetStateBits(DWORD *pgrfStateBits);
  56. SCODE SetStateBits(DWORD grfStateBits, DWORD grfMask);
  57. SCODE CreateDocFile(CDfName const *pdfnName,
  58. DFLAGS const df,
  59. DFLUID luidSet,
  60. CDocFile **ppdfDocFile);
  61. inline SCODE CreateDocFile(CDfName const *pdfnName,
  62. DFLAGS const df,
  63. DFLUID luidSet,
  64. DWORD const dwType,
  65. CDocFile **ppdfDocFile)
  66. { UNREFERENCED_PARM(dwType);
  67. return CreateDocFile(pdfnName, df, luidSet, ppdfDocFile); }
  68. SCODE GetDocFile(CDfName const *pdfnName,
  69. DFLAGS const df,
  70. CDocFile **ppdfDocFile);
  71. inline SCODE GetDocFile(CDfName const *pdfnName,
  72. DFLAGS const df,
  73. DWORD const dwType,
  74. CDocFile **ppdfDocFile)
  75. { UNREFERENCED_PARM(dwType);
  76. return GetDocFile(pdfnName, df, ppdfDocFile); }
  77. inline void ReturnDocFile(CDocFile *pdf);
  78. SCODE CreateStream(CDfName const *pdfnName,
  79. DFLAGS const df,
  80. DFLUID luidSet,
  81. CDirectStream **ppStream);
  82. inline SCODE CreateStream(CDfName const *pdfnName,
  83. DFLAGS const df,
  84. DFLUID luidSet,
  85. DWORD const dwType,
  86. CDirectStream **ppStream)
  87. { UNREFERENCED_PARM(dwType);
  88. return CreateStream(pdfnName, df, luidSet, ppStream); }
  89. SCODE GetStream(CDfName const *pdfnName,
  90. DFLAGS const df,
  91. CDirectStream **ppStream);
  92. inline SCODE GetStream(CDfName const *pdfnName,
  93. DFLAGS const df,
  94. DWORD const dwType,
  95. CDirectStream **ppStream)
  96. { UNREFERENCED_PARM(dwType);
  97. return GetStream(pdfnName, df, ppStream); }
  98. inline void ReturnStream(CDirectStream *pstm);
  99. SCODE GetIterator(PDocFileIterator **ppdfi);
  100. SCODE IsEntry(CDfName const *dfnName,
  101. SEntryBuffer *peb);
  102. SCODE DeleteContents(void);
  103. SCODE FindGreaterEntry(CDfName const *pdfnKey,
  104. CDfName *pNextKey,
  105. STATSTGW *pstat);
  106. // PEntry
  107. virtual SCODE GetTime(WHICHTIME wt, TIME_T *ptm);
  108. virtual SCODE SetTime(WHICHTIME wt, TIME_T tm);
  109. // New
  110. SCODE ApplyChanges(CUpdateList &ulChanged);
  111. SCODE CopyTo(CDocFile *pdfTo,
  112. DWORD dwFlags,
  113. SNBW snbExclude);
  114. inline CStgHandle *GetHandle(void);
  115. SCODE ExcludeEntries(CDocFile *pdf, SNBW snbExclude);
  116. private:
  117. LONG _cReferences;
  118. CStgHandle _stgh;
  119. ILockBytes *_pilbBase;
  120. #ifdef _MSC_VER
  121. #pragma warning(disable:4512)
  122. // default assignment operator could not be generated since we have a const
  123. // member variable. This is okay snce we are not using the assignment
  124. // operator anyway.
  125. #endif
  126. };
  127. #ifdef _MSC_VER
  128. #pragma warning(default:4512)
  129. #endif
  130. // Inline methods are in dffuncs.hxx
  131. #endif