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

UX: Get windows product and build number properly #1309

Merged
merged 18 commits into from
Jun 12, 2023

Conversation

Fabxx
Copy link
Contributor

@Fabxx Fabxx commented Dec 25, 2022

instead of returning "windows", based on the kernel version, we obtain the product name and the build number displayed in winver command.

For modern systems the check is made on "10.0" value according to the windows NT kernel version list.

Screenshot (via wine, in this case wine uses "Software" instead of "SOFTWARE"):
immagine

Wine windows XP
immagine

Wine windows Vista
immagine

Wine windows 7
immagine

Wine windows 8
immagine

Wine windows 8.1
immagine

ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
ui/xemu-os-utils-windows.c Outdated Show resolved Hide resolved
Copy link
Contributor

@antangelo antangelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more nits, but it otherwise looks fine to me

return NULL;

if (RegGetValueW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
L"ProductName", RRF_RT_REG_SZ, (LPVOID)NULL, &product_name, (LPDWORD)&product_size) != ERROR_SUCCESS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These should be aligned consistently

L"CurrentVersion", RRF_RT_REG_SZ, (LPVOID)NULL, &current_version, (LPDWORD)&version_size) != ERROR_SUCCESS)
return NULL;

/* if version number is 6.3/10.0 (8.1/10/11), get the build number from the DisplayVersion Registry.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Comments not indented correctly

}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Extra newline

@mborgerson
Copy link
Member

@Fabxx I made some simplifications over here: https://github.com/xemu-project/xemu/tree/fix/win_os_info

Would you mind taking a look and helping to test it?

@Fabxx
Copy link
Contributor Author

Fabxx commented Jun 12, 2023

@Fabxx I made some simplifications over here: https://github.com/xemu-project/xemu/tree/fix/win_os_info

Would you mind taking a look and helping to test it?

Sure, will do when i get home. Will let you know within the day

@mborgerson mborgerson merged commit af3f832 into xemu-project:master Jun 12, 2023
13 checks passed
@mborgerson
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants