Chuyu-Team / YY-Thunks

Fix DecodePointer, EncodePointer,RegDeleteKeyEx etc. APIs not found in Windows XP RTM.
MIT License
567 stars 103 forks source link

让.NET 8/9 支持 Windows XP RTM(.NET相关程序API缺失统一在这里回复) #66

Open lingsg opened 10 months ago

lingsg commented 10 months ago

.NET 8/ Naitve AOT依赖下列函数,打✔表示API已经兼容完成,其他则代表任然需要兼容。

注意:该列表为全集,实际情况由于链接器优化,往往不会使用到所有的函数。

如果你的程序提示找不到API,请使用YY-Thunk内置的YY.Depends.Analyzer扫描你的应用程序。扫描程序将检查所有缺失的API,并且整理成报告,这样可以极减少遗漏的概率。

当API不存在时往往存在其他API缺失,如果依靠系统的弹窗,这个处理效率是非常堪忧的。

; 比如分析Google浏览器 XP系统上缺失的API,可以输入以下命令,YY.Depends.Analyzer在Release产物中提供。
YY.Depends.Analyzer  "C:\Program Files\Google\Chrome\Application\125.0.6422.113" /IgnoreReady

.NET 8/9新增缺失清单

ADVAPI32.DLL

Windows XP RTM

BCRYPT.DLL

Windows 7 SP1

~* [ ] BCryptKeyDerivation~ 微软源代码已经做了判断Win8一下不会调用这个函数

Windows Vista RTM

Crypt32.dll

Windows XP RTM

IPHLPAPI.DLL

Windows XP RTM

KERNEL32.DLL

Windows 7 RTM

NCRYPT.DLL

Windows 7 SP1

Normaliz.dll

Windows XP RTM(这部分暂时认为已经解决,因为程序可以在根目录放置微软的的IDN运行库解决)

user32.dll

Ws2_32.dll

Windows 7 SP1

gailium119 commented 2 months ago

Just compiled .NET 8.0.6 (core+winforms, no WPF because it isn't fully open-source), it seems that it works fine with windows 7 sp1 with the following patches: 1.eng/native/configurecompiler.cmake For static linking, no ucrt 2.src/coreclr/vm/threads.h For RoInitialize and RoUninitialize, the apiset dll is not present 3.src/coreclr/vm/threads.cpp

  1. (Not commited) src/native/corehost/hostmisc/pal.windows.cpp : pal::load_library dll = ::LoadLibraryExW(path.c_str(), NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); -> dll = ::LoadLibraryExW(path.c_str(), NULL, NULL); Or else it causes 80070057 when loading dlls As for WinForms, the original version seems to be fine.
gailium119 commented 2 months ago

For Win7 SP0, AVX related functions are missing for amd64, not sure about x86 Update: x86 also require AVX functions

mingkuang-Chuyu commented 2 months ago

Please provide more detail info.

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: gailium119 @.> Sent: Wednesday, July 31, 2024 6:49:07 PM To: Chuyu-Team/YY-Thunks @.> Cc: mingkuang @.>; State change @.> Subject: Re: [Chuyu-Team/YY-Thunks] 让.NET 8/9 支持 Windows XP RTM(.NET相关程序API缺失统一在这里回复) (Issue #66)

For Win7 SP0, AVX related functions are missing for amd64, not sure about x86

― Reply to this email directly, view it on GitHubhttps://github.com/Chuyu-Team/YY-Thunks/issues/66#issuecomment-2260228892, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEX7GZPYEU4N6V7QC2AATELZPC6KHAVCNFSM6AAAAAA7NNG5UKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRQGIZDQOBZGI. You are receiving this because you modified the open/close state.Message ID: @.***>

gailium119 commented 2 months ago

Please provide more detail info. 获取Outlook for Androidhttps://aka.ms/AAb9ysg ____ From: gailium119 @.> Sent: Wednesday, July 31, 2024 6:49:07 PM To: Chuyu-Team/YY-Thunks @.> Cc: mingkuang @.>; State change @.> Subject: Re: [Chuyu-Team/YY-Thunks] 让.NET 8/9 支持 Windows XP RTM(.NET相关程序API缺失统一在这里回复) (Issue #66) For Win7 SP0, AVX related functions are missing for amd64, not sure about x86 ― Reply to this email directly, view it on GitHub<#66 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEX7GZPYEU4N6V7QC2AATELZPC6KHAVCNFSM6AAAAAA7NNG5UKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRQGIZDQOBZGI. You are receiving this because you modified the open/close state.Message ID: @.***>

It appears that the problem is within coreclr.dll, x64 errors out with missing function LocateXStateFeature and x86 errors out with GetEnabledXStateFeatures

mingkuang-Chuyu commented 2 months ago

coreclr.dll

@gailium119 So? you can rebuild coreclr.dll?

gailium119 commented 2 months ago

coreclr.dll

@gailium119 So? you can rebuild coreclr.dll?

Pretty yes, although removing the AVX related functions may dampen performance on later builds. A better way is to wrap then with dynamic loading, but it takes more time and effort.