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.

115 lines
2.7 KiB

  1. //=============================================================================
  2. // MODULE: clusnet.c
  3. //
  4. // Description:
  5. //
  6. // DLL master file for the Bloodhound Parser DLL for the
  7. // Cluster Network Protocol suite.
  8. //
  9. // Modification History
  10. //
  11. // Mike Massa 03/21/97 Created
  12. //=============================================================================
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. //=============================================================================
  16. // Protocol entry points.
  17. //=============================================================================
  18. ENTRYPOINTS CnpEntryPoints =
  19. {
  20. CnpRegister,
  21. CnpDeregister,
  22. CnpRecognizeFrame,
  23. CnpAttachProperties,
  24. CnpFormatProperties
  25. };
  26. HPROTOCOL hCnp = NULL;
  27. ENTRYPOINTS CdpEntryPoints =
  28. {
  29. CdpRegister,
  30. CdpDeregister,
  31. CdpRecognizeFrame,
  32. CdpAttachProperties,
  33. CdpFormatProperties
  34. };
  35. HPROTOCOL hCdp = NULL;
  36. ENTRYPOINTS CcmpEntryPoints =
  37. {
  38. CcmpRegister,
  39. CcmpDeregister,
  40. CcmpRecognizeFrame,
  41. CcmpAttachProperties,
  42. CcmpFormatProperties
  43. };
  44. HPROTOCOL hCcmp = NULL;
  45. ENTRYPOINTS RGPEntryPoints =
  46. {
  47. RGPRegister,
  48. RGPDeregister,
  49. RGPRecognizeFrame,
  50. RGPAttachProperties,
  51. RGPFormatProperties
  52. };
  53. HPROTOCOL hRGP = NULL;
  54. DWORD Attached = 0;
  55. //=============================================================================
  56. // FUNCTION: DLLEntry()
  57. //
  58. // Modification History
  59. //
  60. // Steve Hiskey 07/07/94 Created
  61. //=============================================================================
  62. BOOL WINAPI DLLEntry(HANDLE hInstance, ULONG Command, LPVOID Reserved)
  63. {
  64. //=========================================================================
  65. // If we are loading!
  66. //=========================================================================
  67. if ( Command == DLL_PROCESS_ATTACH )
  68. {
  69. if ( Attached++ == 0 )
  70. {
  71. hCnp = CreateProtocol("CNP", &CnpEntryPoints, ENTRYPOINTS_SIZE);
  72. hCdp = CreateProtocol("CDP", &CdpEntryPoints, ENTRYPOINTS_SIZE);
  73. hCcmp = CreateProtocol("CCMP", &CcmpEntryPoints, ENTRYPOINTS_SIZE);
  74. hRGP = CreateProtocol("RGP", &RGPEntryPoints, ENTRYPOINTS_SIZE);
  75. }
  76. }
  77. //=========================================================================
  78. // If we are unloading!
  79. //=========================================================================
  80. if ( Command == DLL_PROCESS_DETACH )
  81. {
  82. if ( --Attached == 0 )
  83. {
  84. DestroyProtocol(hCnp);
  85. DestroyProtocol(hCdp);
  86. DestroyProtocol(hCcmp);
  87. DestroyProtocol(hRGP);
  88. }
  89. }
  90. return TRUE; //... Bloodhound parsers ALWAYS return TRUE.
  91. }
  92.