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.

109 lines
3.1 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. SCODE CDocFile::FindGreaterEntry(CDfName const *pdfnKey,
  35. SIterBuffer *pib,
  36. STATSTGW *pstat)
  37. {
  38. SID sidChild;
  39. SCODE sc;
  40. olDebugOut((DEB_ITRACE, "In CDocFile::FindGreaterEntry:%p(%p, %p, %p)\n",
  41. this, pdfnKey, pib, pstat));
  42. olAssert((pib == NULL) != (pstat == NULL));
  43. if (SUCCEEDED(sc = _stgh.GetMS()->GetChild(_stgh.GetSid(), &sidChild)))
  44. {
  45. if (sidChild == NOSTREAM)
  46. {
  47. sc = STG_E_NOMOREFILES;
  48. }
  49. else
  50. {
  51. SID sid = 0; // initialize recursion count to 0
  52. if (SUCCEEDED(sc = _stgh.GetMS()->FindGreaterEntry(sidChild,
  53. pdfnKey,
  54. &sid)))
  55. {
  56. sc = _stgh.GetMS()->StatEntry(sid, pib, pstat);
  57. }
  58. }
  59. }
  60. olDebugOut((DEB_ITRACE, "Out CDocFile::FindGreaterEntry\n"));
  61. return sc;
  62. }
  63. //+---------------------------------------------------------------------------
  64. //
  65. // Member: CDocFile::StatEntry, public
  66. //
  67. // Synopsis: Gets information for a child
  68. //
  69. // Arguments: [pdfn] - Child name
  70. // [pib] - Short information
  71. // [pstat] - Full information
  72. //
  73. // Returns: Appropriate status code
  74. //
  75. // Modifies: [pib] or [pstat]
  76. //
  77. // History: 16-Apr-93 DrewB Created
  78. //
  79. // Notes: Either [pib] or [pstat] must be NULL
  80. //
  81. //----------------------------------------------------------------------------
  82. SCODE CDocFile::StatEntry(CDfName const *pdfn,
  83. SIterBuffer *pib,
  84. STATSTGW *pstat)
  85. {
  86. SEntryBuffer eb;
  87. SCODE sc;
  88. olDebugOut((DEB_ITRACE, "In CDocFile::StatEntry:%p(%p, %p, %p)\n",
  89. this, pdfn, pib, pstat));
  90. olAssert((pib == NULL) != (pstat == NULL));
  91. olChk(_stgh.GetMS()->IsEntry(_stgh.GetSid(), pdfn, &eb));
  92. sc = _stgh.GetMS()->StatEntry(eb.sid, pib, pstat);
  93. olDebugOut((DEB_ITRACE, "Out CDocFile::StatEntry\n"));
  94. EH_Err:
  95. return sc;
  96. }