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.

86 lines
2.2 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: tp.cpp
  4. //
  5. // Description:
  6. //
  7. // Topology Pin Class
  8. //
  9. //@@BEGIN_MSINTERNAL
  10. // Development Team:
  11. // Mike McLaughlin
  12. //
  13. // History: Date Author Comment
  14. //
  15. // To Do: Date Author Comment
  16. //
  17. //@@END_MSINTERNAL
  18. //
  19. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  20. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  21. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  22. // PURPOSE.
  23. //
  24. // Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
  25. //
  26. //---------------------------------------------------------------------------
  27. #include "common.h"
  28. //---------------------------------------------------------------------------
  29. //---------------------------------------------------------------------------
  30. NTSTATUS
  31. CTopologyPin::Create(
  32. PTOPOLOGY_PIN *ppTopologyPin,
  33. ULONG ulPinNumber,
  34. PTOPOLOGY_NODE pTopologyNode
  35. )
  36. {
  37. PTOPOLOGY_PIN pTopologyPin = NULL;
  38. NTSTATUS Status = STATUS_SUCCESS;
  39. Assert(pTopologyNode);
  40. FOR_EACH_LIST_ITEM(&pTopologyNode->lstTopologyPin, pTopologyPin) {
  41. if(pTopologyPin->ulPinNumber == ulPinNumber) {
  42. goto exit;
  43. }
  44. } END_EACH_LIST_ITEM
  45. pTopologyPin = new TOPOLOGY_PIN(ulPinNumber, pTopologyNode);
  46. if(pTopologyPin == NULL) {
  47. Status = STATUS_INSUFFICIENT_RESOURCES;
  48. Trap();
  49. goto exit;
  50. }
  51. DPF2(70, "CTopologyPin::Create: %08x, TN: %08x",
  52. pTopologyPin,
  53. pTopologyNode);
  54. exit:
  55. *ppTopologyPin = pTopologyPin;
  56. return(Status);
  57. }
  58. CTopologyPin::CTopologyPin(
  59. ULONG ulPinNumber,
  60. PTOPOLOGY_NODE pTopologyNode
  61. )
  62. {
  63. Assert(this);
  64. this->ulPinNumber = ulPinNumber;
  65. this->pTopologyNode = pTopologyNode;
  66. AddList(&pTopologyNode->lstTopologyPin);
  67. DPF2(70, "CTopologyPin: %08x, TN: %08x", this, pTopologyNode);
  68. }
  69. CTopologyPin::~CTopologyPin(
  70. )
  71. {
  72. DPF1(70, "~CTopologyPin: %08x", this);
  73. Assert(this);
  74. }
  75. //---------------------------------------------------------------------------