Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
56 of 85 tasks
lingsg opened this issue Nov 16, 2023 · 8 comments
Open
56 of 85 tasks

Comments

@lingsg
Copy link

lingsg commented Nov 16, 2023

.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

  • EventActivityIdControl
  • EventRegister
  • EventUnregister
  • EnumerateTraceGuidsEx
  • EventWriteTransfer
  • EventEnabled
  • EventWrite
  • EventWriteString

BCRYPT.DLL

Windows 7 SP1

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

Windows Vista RTM

  • BCryptDeriveKeyPBKDF2

Windows XP RTM

  • BCryptHashData
  • BCryptGetProperty
  • BCryptGenerateKeyPair
  • BCryptFinishHash
  • BCryptFinalizeKeyPair
  • BCryptExportKey
  • BCryptDecrypt
  • BCryptEncrypt
  • BCryptCreateHash
  • BCryptImportKeyPair
  • BCryptDestroyHash
  • BCryptSetProperty
  • BCryptDestroyKey
  • BCryptImportKey
  • BCryptGenerateSymmetricKey
  • BCryptSignHash
  • BCryptVerifySignature

Crypt32.dll

Windows XP RTM

  • CryptProtectMemory
  • CryptUnprotectMemory
  • CryptImportPublicKeyInfoEx2

IPHLPAPI.DLL

Windows XP RTM

  • if_nametoindex
  • CancelMibChangeNotify2
  • NotifyStableUnicastIpAddressTable

KERNEL32.DLL

Windows 7 RTM

  • CopyContext
  • InitializeContext
  • GetEnabledXStateFeatures
  • SetXStateFeaturesMask

Windows Vista RTM

  • FindStringOrdinal
  • QueryUnbiasedInterruptTime
  • GetProcessGroupAffinity
  • SetThreadIdealProcessorEx
  • GetThreadIdealProcessorEx

Windows XP RTM

  • CloseThreadpoolIo
  • CreateThreadpoolIo
  • StartThreadpoolIo
  • CancelThreadpoolIo
  • SetProcessWorkingSetSizeEx
  • GetProcessWorkingSetSizeEx
  • FindNLSStringEx
  • GetUserPreferredUILanguages
  • IsNLSDefinedString
  • EnumTimeFormatsEx
  • GetCalendarInfoEx
  • GetNLSVersionEx

NCRYPT.DLL

Windows 7 SP1

  • NCryptCloseProtectionDescriptor
  • NCryptCreateProtectionDescriptor
  • NCryptGetProtectionDescriptorInfo
  • NCryptProtectSecret
  • NCryptUnprotectSecret

Windows XP RTM

  • NCryptImportKey
  • NCryptExportKey
  • NCryptDeleteKey
  • NCryptCreatePersistedKey
  • NCryptFinalizeKey
  • NCryptOpenStorageProvider
  • NCryptGetProperty
  • NCryptSetProperty
  • NCryptOpenKey
  • NCryptFreeObject
  • NCryptEncrypt
  • NCryptDecrypt
  • NCryptDeriveKey
  • NCryptSecretAgreement
  • NCryptSignHash
  • NCryptVerifySignature

Normaliz.dll

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

  • IdnToAscii (微软IDN运行库提供)
  • IdnToUnicode (微软IDN运行库提供)
  • IsNormalizedString (微软IDN运行库提供)
  • NormalizeString (微软IDN运行库提供)
    IDN运行库.zip

user32.dll

  • GetPointerInfoHistory
    • Supported OS: 6.2.9200, 6.3.9600
    • Ref Module: AvaloniaApplication1.exe
  • GetPointerTouchInfo
    • Supported OS: 6.2.9200, 6.3.9600
    • Ref Module: AvaloniaApplication1.exe
  • GetPointerTouchInfoHistory
    • Supported OS: 6.2.9200, 6.3.9600
    • Ref Module: AvaloniaApplication1.exe
  • IsMouseInPointerEnabled
    • Supported OS: 6.2.9200, 6.3.9600
    • Ref Module: AvaloniaApplication1.exe

Ws2_32.dll

Windows 7 SP1

  • GetAddrInfoExCancel

Windows XP RTM

  • FreeAddrInfoExW
  • GetAddrInfoExW
mingkuang-Chuyu added a commit that referenced this issue May 2, 2024
  - 新增GetProcessGroupAffinity
  - 新增QueryUnbiasedInterruptTime
  - 新增FindStringOrdinal
  - 新增GetEnabledXStateFeatures
  - 新增SetXStateFeaturesMask
  - 新增InitializeContext
  - 新增InitializeContext2
  - 新增LocateXStateFeature
@mingkuang-Chuyu mingkuang-Chuyu added 进度:等待发布 处理完毕,耐心等待新版本。 and removed 方案:以后再说 labels May 3, 2024
@mingkuang-Chuyu mingkuang-Chuyu changed the title 让.NET 8 支持XP 让.NET 8 支持 Windows Vista RTM May 3, 2024
@mingkuang-Chuyu mingkuang-Chuyu added 进度:处理完成 and removed 进度:等待发布 处理完毕,耐心等待新版本。 labels May 3, 2024
@mingkuang-Chuyu mingkuang-Chuyu changed the title 让.NET 8 支持 Windows Vista RTM 让.NET 8/9 支持 Windows Vista RTM May 5, 2024
@mingkuang-Chuyu mingkuang-Chuyu changed the title 让.NET 8/9 支持 Windows Vista RTM 让.NET 8/9 支持 Windows XP RTM May 5, 2024
mingkuang-Chuyu added a commit that referenced this issue May 6, 2024
  - 添加 CopyContext
  - 添加 SetThreadIdealProcessorEx
  - 添加 GetThreadIdealProcessorEx
  - 添加 EventActivityIdControl
  - 添加 EventRegister
  - 添加 EventUnregister
  - 添加 EnumerateTraceGuidsEx
  - 添加 EventEnabled
  - 添加 EventWrite
  - 添加 EventWriteTransfer
  - 添加 EventWriteEx
  - 添加 ConvertInterfaceIndexToLuid
  - 添加 ConvertInterfaceLuidToNameW(A)
  - 添加 ConvertInterfaceNameToLuidW(A)
  - 添加 if_nametoindex
  - 添加 if_indextoname
mingkuang-Chuyu added a commit that referenced this issue May 6, 2024
  - 添加 CopyContext
  - 添加 SetThreadIdealProcessorEx
  - 添加 GetThreadIdealProcessorEx
  - 添加 EventActivityIdControl
  - 添加 EventRegister
  - 添加 EventUnregister
  - 添加 EnumerateTraceGuidsEx
  - 添加 EventEnabled
  - 添加 EventWrite
  - 添加 EventWriteTransfer
  - 添加 EventWriteEx
  - 添加 ConvertInterfaceIndexToLuid
  - 添加 ConvertInterfaceLuidToNameW(A)
  - 添加 ConvertInterfaceNameToLuidW(A)
  - 添加 if_nametoindex
  - 添加 if_indextoname
mingkuang-Chuyu added a commit that referenced this issue May 6, 2024
  - 添加 GetUserPreferredUILanguages
  - 添加 EventWriteString
  - 添加 CryptProtectMemory
  - 添加 CryptUnprotectMemory
  - 添加 EnumTimeFormatsEx
  - 添加 GetCalendarInfoEx
  - 添加 GetNLSVersionEx
  - 添加 IsNLSDefinedString
@Chuyu-Team Chuyu-Team deleted a comment from wwh1004 May 6, 2024
@Chuyu-Team Chuyu-Team deleted a comment from MouriNaruto May 6, 2024
mingkuang-Chuyu added a commit that referenced this issue May 6, 2024
  - 添加 SetProcessWorkingSetSizeEx
  - 添加 GetProcessWorkingSetSizeEx
mingkuang-Chuyu added a commit that referenced this issue May 12, 2024
  - BCryptGetProperty
  - BCryptCreateHash
  - BCryptDestroyHash
  - BCryptHashData
  - BCryptFinishHash
mingkuang-Chuyu added a commit that referenced this issue May 12, 2024
  - 添加 BCryptGetProperty
  - 添加 BCryptCreateHash
  - 添加 BCryptDestroyHash
  - 添加 BCryptHashData
  - 添加 BCryptFinishHash
  - 添加 BCryptDeriveKeyPBKDF2
  - 添加 BCryptDeriveKeyCapi
mingkuang-Chuyu added a commit that referenced this issue May 13, 2024
  - 添加 BCryptGetProperty
  - 添加 BCryptCreateHash
  - 添加 BCryptDestroyHash
  - 添加 BCryptHashData
  - 添加 BCryptFinishHash
  - 添加 BCryptDeriveKeyPBKDF2
  - 添加 BCryptDeriveKeyCapi
mingkuang-Chuyu added a commit that referenced this issue May 13, 2024
  - 添加 BCryptGetProperty
  - 添加 BCryptCreateHash
  - 添加 BCryptDestroyHash
  - 添加 BCryptHashData
  - 添加 BCryptFinishHash
  - 添加 BCryptDeriveKeyPBKDF2
  - 添加 BCryptDeriveKeyCapi
mingkuang-Chuyu added a commit that referenced this issue May 13, 2024
  - 添加 BCryptGetProperty
  - 添加 BCryptCreateHash
  - 添加 BCryptDestroyHash
  - 添加 BCryptHashData
  - 添加 BCryptFinishHash
  - 添加 BCryptDeriveKeyPBKDF2
  - 添加 BCryptDeriveKeyCapi
mingkuang-Chuyu added a commit that referenced this issue May 14, 2024
  - 添加 GetAddrInfoExCancel
  - 添加 GetAddrInfoExW(A)
  - 添加 GetAddrInfoExOverlappedResult
  - 添加 FreeAddrInfoEx(W)
  - 添加 GetAddrInfoW
  - 添加 FreeAddrInfoW
@mingkuang-Chuyu mingkuang-Chuyu changed the title 让.NET 8/9 支持 Windows XP RTM 让.NET 8/9 支持 Windows XP RTM(.NET相关程序API缺失统一在这里回复) May 15, 2024
mingkuang-Chuyu added a commit that referenced this issue May 17, 2024
  - 添加 BCryptSetProperty
  - 添加 BCryptEncrypt
  - 添加 BCryptDecrypt
  - 添加 BCryptGenerateSymmetricKey
  - 添加 BCryptDestroyKey
  - 添加 BCryptExportKey
  - 添加 BCryptImportKey
mingkuang-Chuyu added a commit that referenced this issue May 19, 2024
  - 现有WaitForThreadpoolWorkCallbacks等函数添加Cancel支持
  - 添加 CreateThreadpoolIo
  - 添加 CloseThreadpoolIo
  - 添加 StartThreadpoolIo
  - 添加 CancelThreadpoolIo
  - 添加 WaitForThreadpoolIoCallbacks
mingkuang-Chuyu added a commit that referenced this issue May 19, 2024
  - 现有WaitForThreadpoolWorkCallbacks等函数添加Cancel支持
  - 添加 CreateThreadpoolIo
  - 添加 CloseThreadpoolIo
  - 添加 StartThreadpoolIo
  - 添加 CancelThreadpoolIo
  - 添加 WaitForThreadpoolIoCallbacks
@gailium119
Copy link

gailium119 commented Jul 31, 2024

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
4. (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
Copy link

gailium119 commented Jul 31, 2024

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

@mingkuang-Chuyu
Copy link
Collaborator

mingkuang-Chuyu commented Jul 31, 2024 via email

@gailium119
Copy link

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
Copy link
Collaborator

coreclr.dll

@gailium119 So? you can rebuild coreclr.dll?

@gailium119
Copy link

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.

mingkuang-Chuyu added a commit that referenced this issue Sep 9, 2024
  - 添加 GetPointerInfoHistory
  - 添加 GetPointerTouchInfo
  - 添加 GetPointerTouchInfoHistory
  - 添加 IsMouseInPointerEnabled
  - 添加 EnableMouseInPointer
@Chuyu-Team Chuyu-Team deleted a comment Sep 9, 2024
@Chuyu-Team Chuyu-Team deleted a comment from MakesYT Sep 9, 2024
@zhaocjcc
Copy link

zhaocjcc commented Nov 1, 2024

很需要winform支持xp

@armed
Copy link

armed commented Dec 20, 2024

Oh, I guess #134 could be considered as dupe of this. But there is extra function NotifyIpInterfaceChange from iphlpapi.dll which is not listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

5 participants