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.

110 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. msdata.c
  5. Abstract:
  6. This module declares the global variable used by the mailslot
  7. file system.
  8. Author:
  9. Manny Weiser (mannyw) 7-Jan-1991
  10. Revision History:
  11. --*/
  12. #include "mailslot.h"
  13. #ifdef MSDBG
  14. //
  15. // Debugging variables
  16. //
  17. LONG MsDebugTraceLevel;
  18. LONG MsDebugTraceIndent;
  19. #endif
  20. //
  21. // This lock protects access to reference counts.
  22. //
  23. PERESOURCE MsGlobalResource;
  24. #ifdef ALLOC_PRAGMA
  25. #pragma alloc_text( INIT, MsInitializeData )
  26. #pragma alloc_text( PAGE, MsUninitializeData )
  27. #endif
  28. NTSTATUS
  29. MsInitializeData(
  30. VOID
  31. )
  32. /*++
  33. Routine Description:
  34. This function initializes all MSFS global data.
  35. Arguments:
  36. None.
  37. Return Value:
  38. None.
  39. --*/
  40. {
  41. PAGED_CODE();
  42. #ifdef MSDBG
  43. MsDebugTraceLevel = 0;
  44. MsDebugTraceIndent = 0;
  45. #endif
  46. MsGlobalResource = MsAllocateNonPagedPool (sizeof(ERESOURCE), 'gFsM');
  47. if (MsGlobalResource == NULL) {
  48. return STATUS_INSUFFICIENT_RESOURCES;
  49. }
  50. ExInitializeResourceLite ( MsGlobalResource );
  51. return STATUS_SUCCESS;
  52. }
  53. VOID
  54. MsUninitializeData(
  55. VOID
  56. )
  57. /*++
  58. Routine Description:
  59. This function uninitializes all MSFS global data.
  60. Arguments:
  61. None.
  62. Return Value:
  63. None.
  64. --*/
  65. {
  66. ExDeleteResourceLite ( MsGlobalResource );
  67. ExFreePool ( MsGlobalResource );
  68. MsGlobalResource = NULL;
  69. }