Source code of Windows XP (NT5)
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.

62 lines
1.6 KiB

  1. /***
  2. *Fwdr_DLL.c - CRTL Forwarder DLL initialization and termination routine (Win32)
  3. *
  4. * Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This module contains initialization entry point for the CRTL forwarder DLL
  8. * in the Win32 environment. This DLL doesn't do anything except forward its
  9. * imports to the newer CRTL DLL.
  10. *
  11. *Revision History:
  12. * 05-13-96 SKS Initial version.
  13. *
  14. *******************************************************************************/
  15. #ifdef CRTDLL
  16. #include <windows.h>
  17. /*
  18. * The following variable is exported just so that the forwarder DLL can import it.
  19. * The forwarder DLL needs to have at least one import from this DLL to ensure that
  20. * this DLL will be fully initialized.
  21. */
  22. extern __declspec(dllimport) int __dummy_export;
  23. extern __declspec(dllimport) int _osver;
  24. int __dummy_import;
  25. /***
  26. *BOOL _FWDR_CRTDLL_INIT(hDllHandle, dwReason, lpreserved) - C DLL initialization.
  27. *
  28. *Purpose:
  29. * This routine does the C runtime initialization. It disables Thread
  30. * Attach/Detach notifications for this DLL since they are not used.
  31. *
  32. *Entry:
  33. *
  34. *Exit:
  35. *
  36. *******************************************************************************/
  37. BOOL WINAPI _FWDR_CRTDLL_INIT(
  38. HANDLE hDllHandle,
  39. DWORD dwReason,
  40. LPVOID lpreserved
  41. )
  42. {
  43. if ( dwReason == DLL_PROCESS_ATTACH )
  44. {
  45. __dummy_import = __dummy_export + _osver;
  46. DisableThreadLibraryCalls(hDllHandle);
  47. }
  48. return TRUE ;
  49. }
  50. #endif /* CRTDLL */