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.

50 lines
837 B

  1. //
  2. // DLLENTRY.C
  3. //
  4. // Copyright (C) Microsoft Corporation, 1995
  5. //
  6. #include "pch.h"
  7. #ifdef USEHEAP
  8. #define RGHEAP_SIZE 9256*1024
  9. HANDLE g_RgHeap = NULL;
  10. #endif
  11. BOOL
  12. WINAPI
  13. VMMRegDllEntry(
  14. HINSTANCE hInstance,
  15. DWORD dwReason,
  16. LPVOID lpReserved
  17. )
  18. {
  19. switch (dwReason) {
  20. case DLL_PROCESS_ATTACH:
  21. #ifdef USEHEAP
  22. if ((g_RgHeap = HeapCreate(0, RGHEAP_SIZE, RGHEAP_SIZE)) == NULL)
  23. return FALSE;
  24. #endif
  25. if (VMMRegLibAttach(0) != ERROR_SUCCESS)
  26. return FALSE;
  27. break;
  28. case DLL_PROCESS_DETACH:
  29. VMMRegLibDetach();
  30. #ifdef USEHEAP
  31. if (g_RgHeap != NULL)
  32. HeapDestroy(g_RgHeap);
  33. #endif
  34. break;
  35. }
  36. return TRUE;
  37. }