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.1 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: PendingDel.h
  6. * Content: DirectNet NameTable Pending Deletions Header
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 08/28/00 mjn Created
  12. *@@END_MSINTERNAL
  13. *
  14. ***************************************************************************/
  15. #ifndef __PENDINGDEL_H__
  16. #define __PENDINGDEL_H__
  17. //**********************************************************************
  18. // Constant definitions
  19. //**********************************************************************
  20. //**********************************************************************
  21. // Macro definitions
  22. //**********************************************************************
  23. //**********************************************************************
  24. // Structure definitions
  25. //**********************************************************************
  26. typedef struct _DIRECTNETOBJECT DIRECTNETOBJECT;
  27. //**********************************************************************
  28. // Variable definitions
  29. //**********************************************************************
  30. //**********************************************************************
  31. // Function prototypes
  32. //**********************************************************************
  33. //**********************************************************************
  34. // Class prototypes
  35. //**********************************************************************
  36. // class for NameTable Pending Deletions
  37. class CPendingDeletion
  38. {
  39. public:
  40. #undef DPF_MODNAME
  41. #define DPF_MODNAME "CPendingDeletion::FPMAlloc"
  42. static BOOL FPMAlloc( void* pvItem, void* pvContext )
  43. {
  44. CPendingDeletion* pPendingDel = (CPendingDeletion*)pvItem;
  45. pPendingDel->m_Sig[0] = 'N';
  46. pPendingDel->m_Sig[1] = 'T';
  47. pPendingDel->m_Sig[2] = 'P';
  48. pPendingDel->m_Sig[3] = 'D';
  49. pPendingDel->m_bilinkPendingDeletions.Initialize();
  50. return(TRUE);
  51. };
  52. #undef DPF_MODNAME
  53. #define DPF_MODNAME "CPendingDeletion::FPMInitialize"
  54. static void FPMInitialize( void* pvItem, void* pvContext )
  55. {
  56. CPendingDeletion* pPendingDel = (CPendingDeletion*)pvItem;
  57. pPendingDel->m_pdnObject = static_cast<DIRECTNETOBJECT*>(pvContext);
  58. pPendingDel->m_dpnid = 0;
  59. DNASSERT(pPendingDel->m_bilinkPendingDeletions.IsEmpty());
  60. };
  61. #undef DPF_MODNAME
  62. #define DPF_MODNAME "CPendingDeletion::FPMRelease"
  63. static void FPMRelease(void* pvItem)
  64. {
  65. const CPendingDeletion* pPendingDel = (CPendingDeletion*)pvItem;
  66. DNASSERT(pPendingDel->m_bilinkPendingDeletions.IsEmpty());
  67. };
  68. void ReturnSelfToPool( void )
  69. {
  70. g_PendingDeletionPool.Release( this );
  71. };
  72. void SetDPNID( const DPNID dpnid )
  73. {
  74. m_dpnid = dpnid;
  75. };
  76. DPNID GetDPNID( void ) const
  77. {
  78. return( m_dpnid );
  79. };
  80. CBilink m_bilinkPendingDeletions;
  81. private:
  82. BYTE m_Sig[4];
  83. DIRECTNETOBJECT *m_pdnObject;
  84. DPNID m_dpnid;
  85. };
  86. #undef DPF_MODNAME
  87. #endif // __PENDINGDEL_H__