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.

57 lines
1.1 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. MAINDLL.CPP
  5. Abstract:
  6. Contains DLL entry points. Also has code that controls
  7. when the DLL can be unloaded by tracking the number of
  8. objects and locks.
  9. --*/
  10. #include "precomp.h"
  11. #include <statsync.h>
  12. HINSTANCE ghModule;
  13. //***************************************************************************
  14. //
  15. // BOOL WINAPI DllMain
  16. //
  17. // DESCRIPTION:
  18. //
  19. // Entry point for DLL. Good place for initialization.
  20. //
  21. // PARAMETERS:
  22. //
  23. // hInstance instance handle
  24. // ulReason why we are being called
  25. // pvReserved reserved
  26. //
  27. // RETURN VALUE:
  28. //
  29. // TRUE if OK.
  30. //
  31. //***************************************************************************
  32. BOOL WINAPI DllMain( IN HINSTANCE hInstance,
  33. IN ULONG ulReason,
  34. LPVOID pvReserved)
  35. {
  36. if(DLL_PROCESS_ATTACH == ulReason)
  37. {
  38. ghModule = hInstance;
  39. DisableThreadLibraryCalls ( hInstance ) ;
  40. if (CStaticCritSec::anyFailure())
  41. return FALSE;
  42. }
  43. return TRUE;
  44. }