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.

58 lines
1.9 KiB

  1. /*---------------------------------------------------------------------------
  2. File: NT4Enum.cpp
  3. Comments: Implementation of the enumeration object. This object implements
  4. IEnumVARIANT interface.
  5. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  6. Proprietary and confidential to Mission Critical Software, Inc.
  7. REVISION LOG ENTRY
  8. Revision By: Sham Chauthani
  9. Revised on 07/02/99 12:40:00
  10. ---------------------------------------------------------------------------
  11. */
  12. #include "stdafx.h"
  13. #include "NetNode.h"
  14. #include "AttrNode.h"
  15. #include "TNode.hpp"
  16. #include "NT4Enum.h"
  17. //////////////////////////////////////////////////////////////////////
  18. // Construction/Destruction
  19. //////////////////////////////////////////////////////////////////////
  20. CNT4Enum::CNT4Enum(TNodeList * pNodeList) : m_listEnum(pNodeList)
  21. {
  22. m_pNodeList = pNodeList;
  23. }
  24. CNT4Enum::~CNT4Enum()
  25. {
  26. }
  27. //---------------------------------------------------------------------------
  28. // Next : Implements next method of the IEnumVaraint interface. This method
  29. // returns the next object in the enumeration. It returns S_FALSE when
  30. // there are no more objects to enumerate.
  31. //---------------------------------------------------------------------------
  32. HRESULT CNT4Enum::Next(
  33. unsigned long celt, //in -Number of elements to return IGNORED.
  34. VARIANT FAR* rgvar, //out-Variant used to return the object information
  35. unsigned long FAR* pceltFetched //out-Number of elements returned (ALWAYS 1).
  36. )
  37. {
  38. TAttrNode * pNode = (TAttrNode *)m_listEnum.Next();
  39. if ( pNode == NULL )
  40. return S_FALSE;
  41. // *rgvar = pNode->m_Val;
  42. HRESULT hr = VariantCopy(rgvar, &pNode->m_Val);
  43. if (SUCCEEDED(hr))
  44. {
  45. *pceltFetched = 1;
  46. }
  47. return hr;
  48. }