@@ -39,79 +39,6 @@ void* GetClrModuleBase()
3939
4040thread_local int t_CantAllocCount;
4141
42- #ifdef FAILPOINTS_ENABLED
43- typedef int (*FHashStack) ();
44-
45- static FHashStack fHashStack = 0 ;
46- static _TEB *HashStackSetupThread = NULL ;
47- static _TEB *RFSCustomDataSetupThread = NULL ;
48-
49- static void SetupHashStack ()
50- {
51- CANNOT_HAVE_CONTRACT;
52-
53- FHashStack oldValue = InterlockedCompareExchangeT (&fHashStack ,
54- reinterpret_cast <FHashStack>(1 ), reinterpret_cast <FHashStack>(0 ));
55- if ((size_t ) oldValue >= 2 ) {
56- return ;
57- }
58- else if ((size_t ) oldValue == 0 ) {
59- // We are the first thread to initialize
60- HashStackSetupThread = NtCurrentTeb ();
61-
62- if (CLRConfig::GetConfigValue (CLRConfig::INTERNAL_HashStack) == 0 ) {
63- fHashStack = (FHashStack) 2 ;
64- return ;
65- }
66-
67- PAL_TRY (void *, unused, NULL ) {
68- FHashStack func;
69- HMODULE hmod = WszLoadLibrary (W (" mscorrfs.dll" ), NULL , 0 );
70- if (hmod) {
71- func = (FHashStack)GetProcAddress (hmod, " HashStack" );
72- if (func == 0 ) {
73- func = (FHashStack)2 ;
74- }
75- }
76- else
77- func = (FHashStack)2 ;
78- fHashStack = func;
79- }
80- PAL_EXCEPT (EXCEPTION_EXECUTE_HANDLER)
81- {
82- fHashStack = (FHashStack) 2 ;
83- }
84- PAL_ENDTRY;
85- }
86- else if (NtCurrentTeb () == HashStackSetupThread) {
87- // We get here while initializing
88- return ;
89- }
90- else {
91- // All other threads will wait
92- while (fHashStack == (FHashStack) 1 ) {
93- ClrSleepEx (100 , FALSE );
94- }
95- }
96- }
97-
98- int RFS_HashStack ()
99- {
100- CANNOT_HAVE_CONTRACT;
101-
102- if ((size_t )fHashStack < 2 ) {
103- SetupHashStack ();
104- }
105-
106- if ((size_t )fHashStack <= 2 ) {
107- return 0 ;
108- }
109- else
110- return fHashStack ();
111- }
112-
113- #endif // FAILPOINTS_ENABLED
114-
11542DWORD GetClrModulePathName (SString& buffer)
11643{
11744#ifdef HOST_WINDOWS
0 commit comments