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.

63 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1998-2002 Microsoft Corporation
  3. Module Name :
  4. DllMain.cpp
  5. Abstract:
  6. DLL initialization and termination
  7. Author:
  8. George V. Reilly (GeorgeRe) 06-Jan-1998
  9. Environment:
  10. Win32 - User Mode
  11. Project:
  12. LKRhash
  13. Revision History:
  14. --*/
  15. #include <precomp.hxx>
  16. #define DLL_IMPLEMENTATION
  17. #define IMPLEMENTATION_EXPORT
  18. #include <irtldbg.h>
  19. #include <lkrhash.h>
  20. #include "_locks.h"
  21. /////////////////////////////////////////////////////////////////////////////
  22. // DLL Entry Point
  23. extern "C"
  24. BOOL WINAPI
  25. DllMain(
  26. HINSTANCE hInstance,
  27. DWORD dwReason,
  28. LPVOID /*lpReserved*/)
  29. {
  30. BOOL fReturn = TRUE; // ok
  31. if (dwReason == DLL_PROCESS_ATTACH)
  32. {
  33. DisableThreadLibraryCalls(hInstance);
  34. Locks_Initialize();
  35. IRTL_DEBUG_INIT();
  36. IRTLTRACE0("LKRhash::DllMain::DLL_PROCESS_ATTACH\n");
  37. fReturn = LKRHashTableInit();
  38. }
  39. else if (dwReason == DLL_PROCESS_DETACH)
  40. {
  41. IRTLTRACE0("LKRhash::DllMain::DLL_PROCESS_DETACH\n");
  42. LKRHashTableUninit();
  43. IRTL_DEBUG_TERM();
  44. Locks_Cleanup();
  45. }
  46. return fReturn;
  47. }