Source code of Windows XP (NT5)
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.

113 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. cdpinit.c
  5. Abstract:
  6. Initialization and Cleanup code for the Cluster Datagram Protocol.
  7. Author:
  8. Mike Massa (mikemas) July 29, 1996
  9. Revision History:
  10. Who When What
  11. -------- -------- ----------------------------------------------
  12. mikemas 07-29-96 created
  13. Notes:
  14. --*/
  15. #include "precomp.h"
  16. #pragma hdrstop
  17. #include "cdpinit.tmh"
  18. #ifdef ALLOC_PRAGMA
  19. #pragma alloc_text(INIT, CdpLoad)
  20. #pragma alloc_text(PAGE, CdpUnload)
  21. #endif // ALLOC_PRAGMA
  22. BOOLEAN CdpInitialized = FALSE;
  23. //
  24. // Initialization/cleanup routines
  25. //
  26. NTSTATUS
  27. CdpLoad(
  28. VOID
  29. )
  30. {
  31. NTSTATUS status;
  32. ULONG i;
  33. IF_CNDBG(CN_DEBUG_INIT) {
  34. CNPRINT(("[CDP] Loading...\n"));
  35. }
  36. for (i=0; i<CX_ADDROBJ_TABLE_SIZE; i++) {
  37. InitializeListHead(&(CxAddrObjTable[i]));
  38. }
  39. CnInitializeLock(&CxAddrObjTableLock, CX_ADDROBJ_TABLE_LOCK);
  40. CdpInitialized = TRUE;
  41. status = CdpInitializeSend();
  42. if (status != STATUS_SUCCESS) {
  43. return(status);
  44. }
  45. status = CdpInitializeReceive();
  46. if (status != STATUS_SUCCESS) {
  47. return(status);
  48. }
  49. IF_CNDBG(CN_DEBUG_INIT) {
  50. CNPRINT(("[CDP] Loaded.\n"));
  51. }
  52. return(STATUS_SUCCESS);
  53. } // CdpLoad
  54. VOID
  55. CdpUnload(
  56. VOID
  57. )
  58. {
  59. PAGED_CODE();
  60. if (CdpInitialized) {
  61. IF_CNDBG(CN_DEBUG_INIT) {
  62. CNPRINT(("[CDP] Unloading...\n"));
  63. }
  64. CdpCleanupReceive();
  65. CdpCleanupSend();
  66. IF_CNDBG(CN_DEBUG_INIT) {
  67. CNPRINT(("[CDP] Unloaded.\n"));
  68. }
  69. CdpInitialized = FALSE;
  70. }
  71. return;
  72. } // CdpUnload