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.

60 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 2000
  6. //
  7. // File: moduleinfonode.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // ModuleInfoNode.cpp: implementation of the CModuleInfoNode class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #include "ModuleInfoNode.h"
  14. #include "ModuleInfo.h"
  15. //////////////////////////////////////////////////////////////////////
  16. // Construction/Destruction
  17. //////////////////////////////////////////////////////////////////////
  18. CModuleInfoNode::CModuleInfoNode(CModuleInfo * lpModuleInfo)
  19. {
  20. // Save the Module Info object in our node...
  21. m_lpModuleInfo = lpModuleInfo;
  22. m_lpNextModuleInfoNode = NULL;
  23. }
  24. CModuleInfoNode::~CModuleInfoNode()
  25. {
  26. }
  27. /***
  28. ** CModuleInfoNode::AddModuleInfoNodeToTail()
  29. **
  30. ** This routine takes the current ModuleInfoNode, and adds it to the end of a linked
  31. ** list of these objects provided with an initial ModuleInfoNode (the head)
  32. */
  33. bool CModuleInfoNode::AddModuleInfoNodeToTail(CModuleInfoNode ** lplpModuleInfoNode)
  34. {
  35. if (NULL == *lplpModuleInfoNode)
  36. {
  37. *lplpModuleInfoNode = this;
  38. return true;
  39. }
  40. CModuleInfoNode * lpModuleInfoNodePointer = *lplpModuleInfoNode;
  41. // Add to the cache...
  42. // Traverse the linked list to the end..
  43. while (lpModuleInfoNodePointer->m_lpNextModuleInfoNode)
  44. { // Keep looking for the end...
  45. lpModuleInfoNodePointer = lpModuleInfoNodePointer->m_lpNextModuleInfoNode;
  46. }
  47. lpModuleInfoNodePointer->m_lpNextModuleInfoNode = this;
  48. return true;
  49. }