11-03-2026 03:07 PM - edited 11-03-2026 04:01 PM
Possible bug in LabVIEW 2026Q3 (Note that I just upgraded to 2026Q3 and this was not an issue in 2025Q3)
Using LabVIEW 2026Q3, Windows 11
I have the simple code below to get the OS Version for a "System Information Panel".
In the IDE environment it works, I get the following below
After compiling the program into an EXE in 2026Q3, I get the following
Once again this appears to be a 2026Q3 issue, as I did not see this issue in 2025Q3.
One possible work around is below
EDIT: The workaround did not work.
If I compiled the snippet above into its own EXE it works, and probably the original one. But in my program, it is Call and Forgetted, and runs in a subpanel. In the subpanel I get the strange number.
EDIT: Not sure what is going on, issue appears only in my application. Trying a mass compile and clear cache.Did not work. Not sure what is going on.
Solved! Go to Solution.
11-03-2026 05:17 PM
Well I may have found the bug/issue. It did not appear in 2025Q3.
I embedded a manifest file in the exe similar to the ones in this discussion for text rendering.
When I took out the manifest file the OS Version is now correct. Not sure how/why that made a difference.
11-04-2026 03:12 AM
@mcduff wrote:
Well I may have found the bug/issue. It did not appear in 2025Q3.
I embedded a manifest file in the exe similar to the ones in this discussion for text rendering.
When I took out the manifest file the OS Version is now correct. Not sure how/why that made a difference.
The reason is that the Windows GetVersion(Ex)() API is lying since Windows 8.1 about what OS version an application is running on. Basically it returns no higher version than either 6.2.xxx (which was the internal version of Windows 8.1) or what the manifest in the executable reports the application to be compatible with. Windows also uses this manifest version to change specific API behavior to match that version.
By replacing the LabVIEW provided manifest file for its executable stub that is built into an application, you delete the manifest version and Windows GetVersion(Ex)() resorts to report the Windows 8.1 version instead of your shiny Windows 11 version.
The only secure way for an application to get reliably the real OS version in Windows beyond 8.1 without manifest shenanigan, would be to replace the GetVersion(Ex)() call with a call to RtlGetNtVersionNumbers(). But this is in fact a kernel API and meant to be called by drivers and the like, not normal user applications. User applications are supposed to check for specific version features through the so called Version Helper Functions but they do not provide a means to query the actual version number.
11-04-2026 01:06 PM
@rolfk wrote:
@mcduff wrote:
Well I may have found the bug/issue. It did not appear in 2025Q3.
I embedded a manifest file in the exe similar to the ones in this discussion for text rendering.
When I took out the manifest file the OS Version is now correct. Not sure how/why that made a difference.
The reason is that the Windows GetVersion(Ex)() API is lying since Windows 8.1 about what OS version an application is running on. Basically it returns no higher version than either 6.2.xxx (which was the internal version of Windows 8.1) or what the manifest in the executable reports the application to be compatible with. Windows also uses this manifest version to change specific API behavior to match that version.
By replacing the LabVIEW provided manifest file for its executable stub that is built into an application, you delete the manifest version and Windows GetVersion(Ex)() resorts to report the Windows 8.1 version instead of your shiny Windows 11 version.
The only secure way for an application to get reliably the real OS version in Windows beyond 8.1 without manifest shenanigan, would be to replace the GetVersion(Ex)() call with a call to RtlGetNtVersionNumbers(). But this is in fact a kernel API and meant to be called by drivers and the like, not normal user applications. User applications are supposed to check for specific version features through the so called Version Helper Functions but they do not provide a means to query the actual version number.
I wonder why it returns different results depending on whether the code is compiled or not?
11-04-2026 01:17 PM
@billko wrote:
I wonder why it returns different results depending on whether the code is compiled or not?
Only the exe had the custom manifest file, the IDE has its own manifest file.
11-04-2026 02:51 PM
@rolfk wrote:
@mcduff wrote:
Well I may have found the bug/issue. It did not appear in 2025Q3.
I embedded a manifest file in the exe similar to the ones in this discussion for text rendering.
When I took out the manifest file the OS Version is now correct. Not sure how/why that made a difference.
The reason is that the Windows GetVersion(Ex)() API is lying since Windows 8.1 about what OS version an application is running on. Basically it returns no higher version than either 6.2.xxx (which was the internal version of Windows 8.1) or what the manifest in the executable reports the application to be compatible with. Windows also uses this manifest version to change specific API behavior to match that version.
By replacing the LabVIEW provided manifest file for its executable stub that is built into an application, you delete the manifest version and Windows GetVersion(Ex)() resorts to report the Windows 8.1 version instead of your shiny Windows 11 version.
The only secure way for an application to get reliably the real OS version in Windows beyond 8.1 without manifest shenanigan, would be to replace the GetVersion(Ex)() call with a call to RtlGetNtVersionNumbers(). But this is in fact a kernel API and meant to be called by drivers and the like, not normal user applications. User applications are supposed to check for specific version features through the so called Version Helper Functions but they do not provide a means to query the actual version number.
@rolfk
I made a function that calls RtlGetNtVersionNumbers() and it works. Is there any danger in using that function? I understand it is undocumented, etc., but any other concerns? Thanks
11-04-2026 03:10 PM
@mcduff wrote:
I made a function that calls RtlGetNtVersionNumbers() and it works. Is there any danger in using that function? I understand it is undocumented, etc., but any other concerns? Thanks
First, it is not exactly undocumented. https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlgetversion
But it is not part of the official Windows SDK documentation but the Windows Driver Development Kit. While it is accessible from user space it is not really meant to be called from user space.
So can you call it? Yes.
Should you? According to Microsoft not.
Is it safe? For now, but Microsoft in its infinite wisdom may decide that user space should not have access to this and other WDM APIs in the future.
11-05-2026 02:53 AM - edited 11-05-2026 02:55 AM
One other thing I forgot to mention. If you call nt.dll APIs and other low level kernel functions, you should be extra careful about your parameters. The normal Windows API functions have a lot of validation, error detection and parameter massaging before they eventually call into the kernel too for many things. If you pass in invalid or corrupt data, chances are very high that it will stumble and simply crash your process but otherwise not affect the Windows kernel in any way.
If you call into the kernel directly there is also of course parameter checking but there is also an assumption that the most stupid errors have already been caught higher up and that it is wasted effort to check for every possible mistake again. And it may affect things that are a lot closer to the kernel itself, and an error in the kernel won't just take your application out but can completely crash the whole machine. So you should tread even a lot more carefully when calling such functions.
For RtlGetNtVersionNumbers() I wouldn't expect it to affect the kernel directly as it most likely just reads information that has once been prepared at kernel startup and an invalid or to short input buffer most likely just crashes your process, but you still should be very careful.
The single parameter is a structure that needs to be at least 5 * 4 + 128 * 2 bytes long. Or if you do not care about the service pack version string in the Unicode szCSDVersion element you could also simply pass in an array of at least 69 int32 values as a C array pointer and just look at the first 5 elements in the returned array buffer. Passing in a shorter buffer has the chance to either generate error 1097 or simply crash your process, depending on the Debug level you set in the properties for your Call Library Node. In either case it is not safe to continue after that.
11-05-2026 01:55 PM
@rolfk wrote:
One other thing I forgot to mention. If you call nt.dll APIs and other low level kernel functions, you should be extra careful about your parameters. The normal Windows API functions have a lot of validation, error detection and parameter massaging before they eventually call into the kernel too for many things. If you pass in invalid or corrupt data, chances are very high that it will stumble and simply crash your process but otherwise not affect the Windows kernel in any way.
If you call into the kernel directly there is also of course parameter checking but there is also an assumption that the most stupid errors have already been caught higher up and that it is wasted effort to check for every possible mistake again. And it may affect things that are a lot closer to the kernel itself, and an error in the kernel won't just take your application out but can completely crash the whole machine. So you should tread even a lot more carefully when calling such functions.
For RtlGetNtVersionNumbers() I wouldn't expect it to affect the kernel directly as it most likely just reads information that has once been prepared at kernel startup and an invalid or to short input buffer most likely just crashes your process, but you still should be very careful.
The single parameter is a structure that needs to be at least 5 * 4 + 128 * 2 bytes long. Or if you do not care about the service pack version string in the Unicode szCSDVersion element you could also simply pass in an array of at least 69 int32 values as a C array pointer and just look at the first 5 elements in the returned array buffer. Passing in a shorter buffer has the chance to either generate error 1097 or simply crash your process, depending on the Debug level you set in the properties for your Call Library Node. In either case it is not safe to continue after that.
Below is the snippet of my OSVersion and attached is the LabVIEW 2020 version. I am a bit confused by your parameter for the function RtlGetNtVersionNumbers().
VOID NTAPI RtlGetNtVersionNumbers(
OUT PULONG MajorVersion,
OUT PULONG MinorVersion,
OUT PULONG BuildNumber
);
From the C example I found online, there are three separate outputs that each take a pointer to an unsigned integer. That is what I used for my LabVIEW version, and so far it has worked without crashing anything that I know of. I am not sure if it needs to be run in the UI thread, but it's an one time call, so not a major issue.
11-05-2026 04:56 PM
Sorry for the confusion. My Google foo led me to RtlGetVersion() https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlgetversion while you imported RtlGetNtVersionNumbers() instead. Your function is easier to import, but the RtlGetVersion() is at least documented by Microsoft in the DDK.