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.

111 lines
3.2 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1998-2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: SendQueue.cpp
  6. * Content: Queue to manage outgoing sends
  7. *
  8. *
  9. * History:
  10. * Date By Reason
  11. * ==== == ======
  12. * 06/14/99 jtk Created
  13. ***************************************************************************/
  14. #include "dnmdmi.h"
  15. #undef DPF_MODNAME
  16. #define DPF_MODNAME "SendQueue"
  17. #undef DPF_SUBCOMP
  18. #define DPF_SUBCOMP DN_SUBCOMP_MODEM
  19. //**********************************************************************
  20. // Constant definitions
  21. //**********************************************************************
  22. //**********************************************************************
  23. // Macro definitions
  24. //**********************************************************************
  25. //**********************************************************************
  26. // Structure definitions
  27. //**********************************************************************
  28. //**********************************************************************
  29. // Variable definitions
  30. //**********************************************************************
  31. //**********************************************************************
  32. // Function prototypes
  33. //**********************************************************************
  34. //**********************************************************************
  35. // Function definitions
  36. //**********************************************************************
  37. //**********************************************************************
  38. // ------------------------------
  39. // CSendQueue::CSendQueue - constructor
  40. //
  41. // Entry: Nothing
  42. //
  43. // Exit: Nothing
  44. //
  45. // Notes: Do not allocate anything in a constructor
  46. // ------------------------------
  47. CSendQueue::CSendQueue():
  48. m_pHead( NULL ),
  49. m_pTail( NULL )
  50. {
  51. }
  52. //**********************************************************************
  53. //**********************************************************************
  54. // ------------------------------
  55. // CSendQueue::~CSendQueue - destructor
  56. //
  57. // Entry: Nothing
  58. //
  59. // Exit: Nothing
  60. // ------------------------------
  61. CSendQueue::~CSendQueue()
  62. {
  63. DNASSERT( m_pHead == NULL );
  64. DNASSERT( m_pTail == NULL );
  65. }
  66. //**********************************************************************
  67. //**********************************************************************
  68. // ------------------------------
  69. // CSendQueue::Initialize - initialize this send queue
  70. //
  71. // Entry: Nothing
  72. //
  73. // Exit: Error code
  74. // ------------------------------
  75. HRESULT CSendQueue::Initialize( void )
  76. {
  77. HRESULT hr;
  78. hr = DPN_OK;
  79. if ( DNInitializeCriticalSection( &m_Lock ) == FALSE )
  80. {
  81. hr = DPNERR_OUTOFMEMORY;
  82. DPFX(DPFPREP, 0, "Could not initialize critical section for SendQueue!" );
  83. }
  84. else
  85. {
  86. DebugSetCriticalSectionRecursionCount( &m_Lock, 0 );
  87. DebugSetCriticalSectionGroup( &m_Lock, &g_blDPNModemCritSecsHeld ); // separate dpnmodem CSes from the rest of DPlay's CSes
  88. }
  89. return hr;
  90. }
  91. //**********************************************************************