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.

89 lines
1.7 KiB

  1. //***************************************************************************
  2. //
  3. // File:
  4. //
  5. // Module: MS SNMP Provider
  6. //
  7. // Purpose:
  8. //
  9. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. #include "precomp.h"
  13. #include <provexpt.h>
  14. #include <snmptempl.h>
  15. #include <snmpmt.h>
  16. #include <process.h>
  17. #include <objbase.h>
  18. #include <snmpcont.h>
  19. #include "snmpevt.h"
  20. #include "snmpthrd.h"
  21. #include "snmplog.h"
  22. extern CRITICAL_SECTION g_SnmpDebugLogMapCriticalSection ;
  23. //***************************************************************************
  24. //
  25. // LibMain32
  26. //
  27. // Purpose: Entry point for DLL. Good place for initialization.
  28. // Return: TRUE if OK.
  29. //***************************************************************************
  30. BOOL APIENTRY DllMain (
  31. HINSTANCE hInstance,
  32. ULONG ulReason ,
  33. LPVOID pvReserved
  34. )
  35. {
  36. BOOL status = TRUE ;
  37. SetStructuredExceptionHandler seh;
  38. try
  39. {
  40. if ( DLL_PROCESS_DETACH == ulReason )
  41. {
  42. status = TRUE ;
  43. }
  44. else if ( DLL_PROCESS_ATTACH == ulReason )
  45. {
  46. status = TRUE ;
  47. DisableThreadLibraryCalls(hInstance); // 158024
  48. }
  49. else if ( DLL_THREAD_DETACH == ulReason )
  50. {
  51. status = TRUE ;
  52. }
  53. else if ( DLL_THREAD_ATTACH == ulReason )
  54. {
  55. status = TRUE ;
  56. }
  57. }
  58. catch(Structured_Exception e_SE)
  59. {
  60. status = FALSE;
  61. }
  62. catch(Heap_Exception e_HE)
  63. {
  64. status = FALSE;
  65. }
  66. catch(...)
  67. {
  68. status = FALSE;
  69. }
  70. return status ;
  71. }