-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support for Windows Version and Edition Information #45
Support for Windows Version and Edition Information #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the pull request!
As you can see, the build is unsuccessful because of rust-fmt
. I don't like its formatting either, but I still prefer to have consistency.
Please apply formatting and fix the issue with osvi
, then I will be happy to merge your request.
src/windows/version.rs
Outdated
None => Self::osvi() | ||
}; | ||
|
||
let osvi = info.osvi.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if RtlGetVersion
fails? Then osvi()
function will return Win32Version
with None
in the osvi
field, right? After that Win32Version::osvi
is going to be called unsuccessfully again which gives panic.
Am I missing something? If not - it would be better to handle it somehow.
…calling RtlGetVersion
Hi! I'm new to rust, so I appreciate your feedback. I'll make the changes that you requested and commit. Do you have any idea how to fix the compile issues for the "x86_64-pc-windows-gnu" target? I was able to reproduce the issue in cygwin, but cannot find a solution. I typically use linux, so maybe I'm missing something. I was about to open a thread on stackoverflow when I saw your reply. I tried the solution found here, but that didn't seem to work either. |
Obviously my local version of rustfmt isn't working the same as the version in the CI. I will fix the rest of these formatting errors here shortly. |
Unfortunately, I don't know how to fix it either. I'm going to do a little investigation, but I welcome any help here. 😄 I'm using |
Cool. I opened the question on stackoverflow. Maybe someone can chip in, |
@mattmccarty I have found the following here:
|
I tried using target env, but the issue persisted. I took a look at how the developers of the winapi crate did it. It appears that we need to include the libntdll.a file in our repo and tell gcc to include the directory at build time. This happens by creating a custom build.rs file. So the build works on x86_64 targets, but fails on i686. Need to figure out how to fix that next. It seems like the DLL library isn't being included. |
Nevermind, it's probably because I'm not on an i686 machine. |
I have tested this on Windows 10 and it works great, but that's the only version of Windows I have access to. Need help with testing this on various versions of Windows.