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.

72 lines
1.6 KiB

  1. /***
  2. *initsect.cpp - RTC support
  3. *
  4. * Copyright (c) 1998-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *
  7. *Revision History:
  8. * 11-03-98 KBF Module incorporated into CRTs
  9. * 05-11-99 KBF Error if RTC support define not enabled
  10. * 08-10-99 RMS Use external symbols for BBT support
  11. *
  12. ****/
  13. #ifndef _RTC
  14. #error RunTime Check support not enabled!
  15. #endif
  16. #include "internal.h"
  17. #include "rtcpriv.h"
  18. #include "sect_attribs.h"
  19. #pragma const_seg(".rtc$IAA")
  20. extern "C" const _CRTALLOC(".rtc$IAA") _PVFV __rtc_iaa[] = { 0 };
  21. #pragma const_seg(".rtc$IZZ")
  22. extern "C" const _CRTALLOC(".rtc$IZZ") _PVFV __rtc_izz[] = { 0 };
  23. #pragma const_seg(".rtc$TAA")
  24. extern "C" const _CRTALLOC(".rtc$TAA") _PVFV __rtc_taa[] = { 0 };
  25. #pragma const_seg(".rtc$TZZ")
  26. extern "C" const _CRTALLOC(".rtc$TZZ") _PVFV __rtc_tzz[] = { 0 };
  27. #pragma const_seg()
  28. #pragma comment(linker, "/MERGE:.rtc=.rdata")
  29. #ifndef _RTC_DEBUG
  30. #pragma optimize("g", on)
  31. #endif
  32. // Run the RTC initializers
  33. extern "C" void __declspec(nothrow) __cdecl _RTC_Initialize()
  34. {
  35. // Just step thru every item
  36. const _PVFV *f;
  37. for (f = __rtc_iaa + 1; f < __rtc_izz; f++)
  38. {
  39. __try {
  40. if (*f)
  41. (**f)();
  42. } __except(1){}
  43. }
  44. }
  45. // Run the RTC terminators
  46. extern "C" void __declspec(nothrow) __cdecl _RTC_Terminate()
  47. {
  48. // Just step thru every item
  49. const _PVFV *f;
  50. for (f = __rtc_taa + 1; f < __rtc_tzz; f++)
  51. {
  52. __try {
  53. if (*f)
  54. (**f)();
  55. } __except(1){}
  56. }
  57. }