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.

115 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1997-1998 Microsoft Corporation
  3. Module Name:
  4. rtmglob.h
  5. Abstract:
  6. Global Vars for Routing Table Manager DLL
  7. Author:
  8. Chaitanya Kodeboyina (chaitk) 25-Sep-1998
  9. Revision History:
  10. --*/
  11. #ifndef __ROUTING_RTMGLOB_H__
  12. #define __ROUTING_RTMGLOB_H__
  13. //
  14. // Global Information common to all RTM instances
  15. //
  16. #define INSTANCE_TABLE_SIZE 1
  17. typedef struct _RTMP_GLOBAL_INFO
  18. {
  19. ULONG TracingHandle; //
  20. HANDLE LoggingHandle; // Handles to debugging functionality
  21. ULONG LoggingLevel; //
  22. DWORD TracingFlags; // Flags that control debug tracing
  23. HANDLE GlobalHeap; // Handle to the private memory heap
  24. #if DBG_MEM
  25. CRITICAL_SECTION AllocsLock; // Protects the list of allocations
  26. LIST_ENTRY AllocsList; // List of all allocated mem blocks
  27. #endif
  28. PCHAR RegistryPath; // Registry Key that has RTM config
  29. RTL_RESOURCE InstancesLock; // Protects the instances' table
  30. // and instance infos themselves
  31. // and RTM API Initialization too
  32. BOOL ApiInitialized; // TRUE if API has been initialized
  33. UINT NumInstances; // Global table of all RTM instances
  34. LIST_ENTRY InstanceTable[INSTANCE_TABLE_SIZE];
  35. }
  36. RTMP_GLOBAL_INFO, *PRTMP_GLOBAL_INFO;
  37. //
  38. // Externs for global variables for the RTMv2 DLL
  39. //
  40. extern RTMP_GLOBAL_INFO RtmGlobals;
  41. //
  42. // Macros for acquiring various locks defined in this file
  43. //
  44. #if DBG_MEM
  45. #define ACQUIRE_ALLOCS_LIST_LOCK() \
  46. ACQUIRE_LOCK(&RtmGlobals.AllocsLock)
  47. #define RELEASE_ALLOCS_LIST_LOCK() \
  48. RELEASE_LOCK(&RtmGlobals.AllocsLock)
  49. #endif
  50. #define ACQUIRE_INSTANCES_READ_LOCK() \
  51. ACQUIRE_READ_LOCK(&RtmGlobals.InstancesLock)
  52. #define RELEASE_INSTANCES_READ_LOCK() \
  53. RELEASE_READ_LOCK(&RtmGlobals.InstancesLock)
  54. #define ACQUIRE_INSTANCES_WRITE_LOCK() \
  55. ACQUIRE_WRITE_LOCK(&RtmGlobals.InstancesLock)
  56. #define RELEASE_INSTANCES_WRITE_LOCK() \
  57. RELEASE_WRITE_LOCK(&RtmGlobals.InstancesLock)
  58. //
  59. // Macros for controlling the amount of tracing in this dll
  60. //
  61. #if DBG_TRACE
  62. #define TRACING_ENABLED(Type) \
  63. (RtmGlobals.TracingFlags & RTM_TRACE_ ## Type)
  64. #endif
  65. //
  66. // Other common helper functions
  67. //
  68. #if DBG_MEM
  69. VOID
  70. DumpAllocs (VOID);
  71. #endif
  72. #endif //__ROUTING_RTMGLOB_H__