corert icon indicating copy to clipboard operation
corert copied to clipboard

Windows DLL import leftovers in Unix assemblies?

Open RalfKornmannEnvision opened this issue 5 years ago • 3 comments
trafficstars

To get an idea of how many and which native calls I need to implement on different game consoles I have written a small tool that scans assemblies for DLLImports. To my surprise I found some calls to Windows dlls in the SDK and framework folder that were build for an ARM64 Unix system. 

I assume it's not a big issue as these functions might not be called at all and as CoreRT would use dynamic loading they will not cause any unresolved externals. But maybe someone is interested and like to clean it up at some point

In System.Private.CoreLib.dll I found         kernel32.dll                 LCIDToLocaleName                 LocaleNameToLCID                 LCMapStringEx                 FindNLSStringEx                 CompareStringEx                 CompareStringOrdinal                 FindStringOrdinal                 IsNLSDefinedString                 GetUserPreferredUILanguages                 GetLocaleInfoEx                 EnumSystemLocalesEx                 EnumTimeFormatsEx                 GetCalendarInfoEx                 GetUserGeoID                 GetGeoInfo                 EnumCalendarInfoExEx                 GetNLSVersionEx                 ResolveLocaleName         Normaliz.dll                 IdnToAscii                 IdnToUnicode                 IsNormalizedString                 NormalizeString

and another one in System.Reflection.Metadata.dll         kernel32.dll                 ReadFile

RalfKornmannEnvision avatar Aug 05 '20 07:08 RalfKornmannEnvision

This list suggests that the System.Private.CoreLib is not actually built for Unix.

jkotas avatar Aug 05 '20 07:08 jkotas

Ah ... I forgot about the recent globalization changes. All kernel32.dll functions in the list are unreachable on Unix. We depend on the compiler or IL linker to strip them out.

jkotas avatar Aug 05 '20 07:08 jkotas

If it is supposed to work this way ignore my ramblings about it.

RalfKornmannEnvision avatar Aug 05 '20 07:08 RalfKornmannEnvision