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.

117 lines
3.2 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: dfiter.cxx
  7. //
  8. // Contents: Implementations of CDocFile iterator methods
  9. //
  10. // History: 16-Dec-91 DrewB Created
  11. //
  12. //---------------------------------------------------------------
  13. #include <dfhead.cxx>
  14. #pragma hdrstop
  15. //+---------------------------------------------------------------------------
  16. //
  17. // Member: CDocFile::FindGreaterEntry, public
  18. //
  19. // Synopsis: Returns the next greater child
  20. //
  21. // Arguments: [pdfnKey] - Previous key
  22. // [pib] - Fast iterator buffer
  23. // [pstat] - Full iterator buffer
  24. //
  25. // Returns: Appropriate status code
  26. //
  27. // Modifies: [pib] or [pstat]
  28. //
  29. // History: 16-Apr-93 DrewB Created
  30. //
  31. // Notes: Either [pib] or [pstat] must be NULL
  32. //
  33. //----------------------------------------------------------------------------
  34. #ifdef CODESEGMENTS
  35. #pragma code_seg(SEG_CDocFile_FindGreaterEntry) // Iterate_TEXT
  36. #endif
  37. SCODE CDocFile::FindGreaterEntry(CDfName const *pdfnKey,
  38. SIterBuffer *pib,
  39. STATSTGW *pstat)
  40. {
  41. SID sidChild;
  42. SCODE sc;
  43. olDebugOut((DEB_ITRACE, "In CDocFile::FindGreaterEntry:%p(%p, %p, %p)\n",
  44. this, pdfnKey, pib, pstat));
  45. olAssert((pib == NULL) != (pstat == NULL));
  46. if (SUCCEEDED(sc = _stgh.GetMS()->GetChild(_stgh.GetSid(), &sidChild)))
  47. {
  48. if (sidChild == NOSTREAM)
  49. {
  50. sc = STG_E_NOMOREFILES;
  51. }
  52. else
  53. {
  54. SID sid = 0; // initialize recursion count to 0
  55. if (SUCCEEDED(sc = _stgh.GetMS()->FindGreaterEntry(sidChild,
  56. pdfnKey,
  57. &sid)))
  58. {
  59. sc = _stgh.GetMS()->StatEntry(sid, pib, pstat);
  60. }
  61. }
  62. }
  63. olDebugOut((DEB_ITRACE, "Out CDocFile::FindGreaterEntry\n"));
  64. return sc;
  65. }
  66. //+---------------------------------------------------------------------------
  67. //
  68. // Member: CDocFile::StatEntry, public
  69. //
  70. // Synopsis: Gets information for a child
  71. //
  72. // Arguments: [pdfn] - Child name
  73. // [pib] - Short information
  74. // [pstat] - Full information
  75. //
  76. // Returns: Appropriate status code
  77. //
  78. // Modifies: [pib] or [pstat]
  79. //
  80. // History: 16-Apr-93 DrewB Created
  81. //
  82. // Notes: Either [pib] or [pstat] must be NULL
  83. //
  84. //----------------------------------------------------------------------------
  85. #ifdef CODESEGMENTS
  86. #pragma code_seg(SEG_CDocFile_StatEntry)
  87. #endif
  88. SCODE CDocFile::StatEntry(CDfName const *pdfn,
  89. SIterBuffer *pib,
  90. STATSTGW *pstat)
  91. {
  92. SEntryBuffer eb;
  93. SCODE sc;
  94. olDebugOut((DEB_ITRACE, "In CDocFile::StatEntry:%p(%p, %p, %p)\n",
  95. this, pdfn, pib, pstat));
  96. olAssert((pib == NULL) != (pstat == NULL));
  97. olChk(_stgh.GetMS()->IsEntry(_stgh.GetSid(), pdfn, &eb));
  98. sc = _stgh.GetMS()->StatEntry(eb.sid, pib, pstat);
  99. olDebugOut((DEB_ITRACE, "Out CDocFile::StatEntry\n"));
  100. EH_Err:
  101. return sc;
  102. }