-
Notifications
You must be signed in to change notification settings - Fork 113
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
PSAPI_VERSION
support
#1789
Comments
I believe this was to support versions of Windows older than Windows 7, so these could safely be replaced with the |
Do we need to do anything here? [DllImport("KERNEL32.dll", ExactSpelling = true, PreserveSig = false)]
[Documentation("https://learn.microsoft.com/windows/win32/api/psapi/nf-psapi-getmoduleinformation")]
public unsafe static extern BOOL K32GetModuleInformation([In] HANDLE hProcess, [In] HMODULE hModule, [Out] MODULEINFO* lpmodinfo, [In] uint cb);
[DllImport("PSAPI.dll", ExactSpelling = true, PreserveSig = false, SetLastError = true)]
[SupportedOSPlatform("windows5.1.2600")]
[Documentation("https://learn.microsoft.com/windows/win32/api/psapi/nf-psapi-getmoduleinformation")]
public unsafe static extern BOOL GetModuleInformation([In] HANDLE hProcess, [In] HMODULE hModule, [Out] MODULEINFO* lpmodinfo, [In] uint cb); https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/System/ProcessStatus/fn.K32GetModuleInformation.html |
I don't have a strong opinion. One option would be to update the metadata for |
Worth noting that this change would make apps rely on win32metadata unusable on Windows XP & WIndows Vista. Since Providing a features flag for such direction might be better in terms of compatibility. |
BTW, it's vague that whether |
We exposed both variants in #920. A feature flag in the projection seems reasonable. Do you have everything you need in the metadata to do that? |
Suggestion
For win32 api like
GetModuleInformation
,GetPerformanceInfo
, there is aPSAPI_VERSION
flag to conveniently redirecting them toKernel32.dll
. But there is no such equivalent inwindows
crate, which makes it hard for downstream users to removePsapi.dll
's usage without forking every dependency. Normally crates won't call kernel32 apis directly(e.g.K32GetModuleInformation
) for old Windows Version support(or the authors are not aware of that). It would be awesome to have a feature flag or cfg for kernel32 api redirection just like whatPSAPI_VERSION
does.The text was updated successfully, but these errors were encountered: