Skip to content

Commit

Permalink
Don't probe for A/W variants of entry points on non-Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky committed Mar 5, 2020
1 parent db702b2 commit a6b7187
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/coreclr/src/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5325,7 +5325,7 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const

FARPROC pFunc = NULL;

#ifndef TARGET_UNIX
#ifdef TARGET_WINDOWS
// Handle ordinals.
if (funcName[0] == '#')
{
Expand All @@ -5334,10 +5334,14 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const
}
#endif

// Just look for the user-provided name without charset suffixes. If it is unicode fcn, we are going
// Just look for the user-provided name without charset suffixes.
// If we are targetting Windows and it is unicode fcn, we are going
// to need to check for the 'W' API because it takes precedence over the
// unmangled one (on NT some APIs have unmangled ANSI exports).
pFunc = FindEntryPointWithMangling(hMod, funcName);
#ifndef TARGET_WINDOWS
return reinterpret_cast<LPVOID>(pFunc);
#else
if ((pFunc != NULL && IsNativeAnsi()) || IsNativeNoMangled())
{
return reinterpret_cast<LPVOID>(pFunc);
Expand Down Expand Up @@ -5369,6 +5373,7 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const
}

return reinterpret_cast<LPVOID>(pFunc);
#endif
}
#endif // CROSSGEN_COMPILE

Expand Down

0 comments on commit a6b7187

Please sign in to comment.