0

I've created a Bluetooth low-energy library, that due to an issue with Windows 10 Version 1709, only works for OS Build 16299.125 and above (fixed in the KB4054517 update). For earlier versions, it causes to BLE device to misbehave and give false connection indications.

Thus, I wish to check for the existence of this update on the client machine, and prevent the library from running if the version is too low.

I've followed this SO answer, and used RtlGetVersion() to get the OS version. However, as far as I can tell, no field in the returned structure contains the minor part of the build version (e.g. '125' in '16299.125'), AKA 'Update Build Revision' or UBR.

This is true even when calling RtlGetVersion() with the extended structure (RTL_OSVERSIONINFOEXW).

Is there a reliable way of getting the minor version of the OS build?

bavaza
  • 10,319
  • 10
  • 64
  • 103

1 Answers1

1

This UBR value is stored in Registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion in a DWORD which you can query

enter image description here

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • Is `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion.UBR` a formal Windows API (or close enough)? – bavaza Dec 24 '17 at 11:09
  • 2
    this is defined in winnt.h: UNIFIEDBUILDREVISION_KEY L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion", UNIFIEDBUILDREVISION_VALUE L"UBR" – magicandre1981 Dec 24 '17 at 12:33
  • great! just what I was looking for. – bavaza Dec 24 '17 at 13:31