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
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: D L L M A I N . C P P
  7. //
  8. // Contents: Networking Optional component DLL
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 18 Dec 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include <ncxbase.h>
  18. #include <ncreg.h>
  19. #include "nceh.h"
  20. // Optional component setup
  21. #include "netoc.h"
  22. #include "netocp.h"
  23. BEGIN_OBJECT_MAP(ObjectMap)
  24. END_OBJECT_MAP()
  25. // Global
  26. CComModule _Module;
  27. EXTERN_C
  28. BOOL
  29. WINAPI
  30. DllMain (
  31. HINSTANCE hInstance,
  32. DWORD dwReason,
  33. LPVOID /*lpReserved*/)
  34. {
  35. if (DLL_PROCESS_ATTACH == dwReason)
  36. {
  37. #ifndef DBG
  38. DisableThreadLibraryCalls (hInstance);
  39. #endif
  40. BOOL fRetVal = FALSE;
  41. EnableCPPExceptionHandling(); // Translate any SEH exceptions into CPP exceptions.
  42. // Initialize fusion
  43. fRetVal = SHFusionInitializeFromModuleID(hInstance, 50);
  44. Assert(fRetVal);
  45. InitializeDebugging();
  46. _Module.Init (ObjectMap, hInstance);
  47. }
  48. else if (DLL_PROCESS_DETACH == dwReason)
  49. {
  50. _Module.Term ();
  51. UnInitializeDebugging();
  52. SHFusionUninitialize();
  53. DisableCPPExceptionHandling(); // Disable translation of SEH exceptions into CPP exceptions.
  54. }
  55. #ifdef DBG
  56. else if (dwReason == DLL_THREAD_DETACH)
  57. {
  58. CTracingIndent::FreeThreadInfo();
  59. }
  60. #endif
  61. return TRUE; // ok
  62. }
  63. //+---------------------------------------------------------------------------
  64. //
  65. // Function: NetOcSetupProc
  66. //
  67. // Purpose:
  68. //
  69. // Arguments:
  70. // pvComponentId []
  71. // pvSubcomponentId []
  72. // uFunction []
  73. // uParam1 []
  74. // pvParam2 []
  75. //
  76. // Returns:
  77. //
  78. // Author: danielwe 12 Dec 1997
  79. //
  80. // Notes:
  81. //
  82. EXTERN_C
  83. DWORD
  84. WINAPI
  85. NetOcSetupProc (
  86. LPCVOID pvComponentId,
  87. LPCVOID pvSubcomponentId,
  88. UINT uFunction,
  89. UINT uParam1,
  90. LPVOID pvParam2)
  91. {
  92. return NetOcSetupProcHelper(pvComponentId, pvSubcomponentId, uFunction,
  93. uParam1, pvParam2);
  94. }