Skip to content

Windows: Report Version and UBR #36451

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

Merged
merged 1 commit into from
Mar 7, 2018
Merged

Windows: Report Version and UBR #36451

merged 1 commit into from
Mar 7, 2018

Conversation

lowenna
Copy link
Member

@lowenna lowenna commented Feb 28, 2018

Signed-off-by: John Howard jhoward@microsoft.com

@johnstep as talked about offline. Reports back the ReleaseID (aka Version) and UBR in the operating system string reported by Docker Info. Also switches this to use the golang built in registry reader rather than direct API while I was there.

…
Default Isolation: process
Kernel Version: 10.0 17111 (17111.1.amd64fre.rs4_release.180226-1411)
Operating System: Windows Server Datacenter Version 1803, Update Build Revision 1
OSType: windows
Architecture: x86_64
CPUs: 8
…

@codecov
Copy link

codecov bot commented Mar 1, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@61cb026). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #36451   +/-   ##
=========================================
  Coverage          ?   34.63%           
=========================================
  Files             ?      613           
  Lines             ?    45385           
  Branches          ?        0           
=========================================
  Hits              ?    15721           
  Misses            ?    27602           
  Partials          ?     2062

Copy link
Member

@johnstep johnstep left a comment

Choose a reason for hiding this comment

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

LGTM

return ret, err
}
ret = windows.UTF16ToString(buf[:])
ret = fmt.Sprintf("%s, Update Build Revision %d", ret, ubr)
Copy link
Member

Choose a reason for hiding this comment

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

The format looks okay, and should look like this for Windows Server 1709:
Windows Server Standard Version 1709, Update Build Revision 248

However, did you consider something more consistent with winver.exe?
Windows Server Standard Version 1709 (OS Build 16299.248)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure updated.

Client (RS4 Pre-release)

Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17114 (17114.1000.amd64fre.rs4_release_base.180301-1503)
Operating System: Windows 10 Enterprise Insider Preview Version 1803 (OS Build 17114.1000)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 15.93GiB

Copy link
Member Author

Choose a reason for hiding this comment

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

And server RS3

Default Isolation: process
Kernel Version: 10.0 16299 (16299.248.amd64fre.rs3_release_svc_escrow.180209-1727)
Operating System: Windows Server Datacenter Version 1709 (OS Build 16299.248)
OSType: windows
Architecture: x86_64
CPUs: 32
Total Memory: 16.01GiB

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

ping @salah-khan PTAL

0,
windows.KEY_READ,
&h); err != nil {
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\WIndows NT\CurrentVersion`, registry.QUERY_VALUE)
Copy link
Member

Choose a reason for hiding this comment

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

Should pkg/parsers/kernel/ also be updated to use the registry package?

if err = windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE,
windows.StringToUTF16Ptr(`SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\`),
0,
windows.KEY_READ,
&h); err != nil {
return KVI, err
}
defer windows.RegCloseKey(h)
var buf [1 << 10]uint16
var typ uint32
n := uint32(len(buf) * 2) // api expects array of bytes, not uint16
if err = windows.RegQueryValueEx(h,
windows.StringToUTF16Ptr("BuildLabEx"),
nil,
&typ,
(*byte)(unsafe.Pointer(&buf[0])),
&n); err != nil {
return KVI, err
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure but orthogonal to this PR itself. Can be addressed as a follow-up

Copy link
Member

Choose a reason for hiding this comment

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

oh, definitely not needed in this PR 👍

@thaJeztah
Copy link
Member

Actually, let's move this back to design review for a bit, so that we can discuss @johnstep's suggestion for the format #36451 (comment)

Signed-off-by: John Howard <jhoward@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants