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.

90 lines
1.8 KiB

  1. #include "precomp.h"
  2. //
  3. // CPI32DLL.CPP
  4. // CPI32 dll entry point
  5. //
  6. // Copyright(c) Microsoft 1997-
  7. //
  8. #define INIT_DBG_ZONE_DATA
  9. #include "dbgzones.h"
  10. BOOL APIENTRY DllMain (HINSTANCE hInstance, DWORD reason, LPVOID plReserved)
  11. {
  12. BOOL rc = TRUE;
  13. switch (reason)
  14. {
  15. case DLL_PROCESS_ATTACH:
  16. {
  17. #ifdef _DEBUG
  18. MLZ_DbgInit((PSTR *) &c_apszDbgZones[0],
  19. (sizeof(c_apszDbgZones) / sizeof(c_apszDbgZones[0])) - 1);
  20. #endif // _DEBUG
  21. DBG_INIT_MEMORY_TRACKING(hInstance);
  22. //
  23. // Utility stuff
  24. //
  25. if (!UT_HandleProcessStart(hInstance))
  26. {
  27. rc = FALSE;
  28. break;
  29. }
  30. //
  31. // Call platform specific init code
  32. //
  33. OSI_Load();
  34. //
  35. // Do common stuff
  36. //
  37. //
  38. // Init Persistent PKZIP -- this just calculates some values
  39. // which are effectively constants, the tables are just too
  40. // unwieldy to declare as such.
  41. //
  42. GDC_Init();
  43. break;
  44. }
  45. case DLL_PROCESS_DETACH:
  46. {
  47. //
  48. // Call platform specific cleanup code
  49. //
  50. OSI_Unload();
  51. //
  52. // Utility stuff
  53. //
  54. UT_HandleProcessEnd();
  55. DBG_CHECK_MEMORY_TRACKING(hInstance);
  56. #ifdef _DEBUG
  57. MLZ_DbgDeInit();
  58. #endif // _DEBUG
  59. break;
  60. }
  61. case DLL_THREAD_DETACH:
  62. UT_HandleThreadEnd();
  63. break;
  64. default:
  65. break;
  66. }
  67. return(rc);
  68. }