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.

128 lines
2.9 KiB

  1. /****************************************************************************
  2. *
  3. * SERVER.cpp
  4. *
  5. * Microsoft Confidential
  6. * Copyright (c) Microsoft Corporation 1992-1997
  7. * All rights reserved
  8. *
  9. *
  10. ***************************************************************************/
  11. #include "pre.h"
  12. /*---------------------------------------------------------------------------
  13. Implementation the internal CServer C++ object. Used to encapsulate
  14. some server data and the methods for Lock and Object count incrementing
  15. and decrementing.
  16. ---------------------------------------------------------------------------*/
  17. /*---------------------------------------------------------------------------
  18. Method: CServer::CServer
  19. Summary: CServer Constructor.
  20. Args: void
  21. Modifies: .
  22. Returns: void
  23. ---------------------------------------------------------------------------*/
  24. CServer::CServer(void)
  25. {
  26. // Zero the Object and Lock counts for this attached process.
  27. m_cObjects = 0;
  28. m_cLocks = 0;
  29. return;
  30. }
  31. /*---------------------------------------------------------------------------
  32. Method: CServer::~CServer
  33. Summary: CServer Destructor.
  34. Args: void
  35. Modifies: .
  36. Returns: void
  37. ---------------------------------------------------------------------------*/
  38. CServer::~CServer(void)
  39. {
  40. return;
  41. }
  42. /*---------------------------------------------------------------------------
  43. Method: CServer::Lock
  44. Summary: Increment the Server's Lock count.
  45. Args: void
  46. Modifies: .
  47. Returns: void
  48. ---------------------------------------------------------------------------*/
  49. void CServer::Lock(void)
  50. {
  51. InterlockedIncrement((PLONG) &m_cLocks);
  52. return;
  53. }
  54. /*---------------------------------------------------------------------------
  55. Method: CServer::Unlock
  56. Summary: Decrement the Server's Lock count.
  57. Args: void
  58. Modifies: .
  59. Returns: void
  60. ---------------------------------------------------------------------------*/
  61. void CServer::Unlock(void)
  62. {
  63. InterlockedDecrement((PLONG) &m_cLocks);
  64. return;
  65. }
  66. /*---------------------------------------------------------------------------
  67. Method: CServer::ObjectsUp
  68. Summary: Increment the Server's living Object count.
  69. Args: void
  70. Modifies: .
  71. Returns: void
  72. ---------------------------------------------------------------------------*/
  73. void CServer::ObjectsUp(void)
  74. {
  75. InterlockedIncrement((PLONG) &m_cObjects);
  76. return;
  77. }
  78. /*---------------------------------------------------------------------------
  79. Method: CServer::ObjectsDown
  80. Summary: Decrement the Server's living object count.
  81. Args: void
  82. Modifies: .
  83. Returns: void
  84. ---------------------------------------------------------------------------*/
  85. void CServer::ObjectsDown(void)
  86. {
  87. InterlockedDecrement((PLONG) &m_cObjects);
  88. return;
  89. }