Documentation error for Registry measure?

Discussion about the documentation, main Rainmeter site and forums.
User avatar

Documentation error for Registry measure?

July 2nd, 2017, 1:37 am
SilverAzide
   [214 posts]

Hello,

The documentation for the Registry measure states that RegValue supports key value types of REG_SZ and REG_DWORD, DWORD being a 32-bit unsigned integer. However, I've successfully been pulling REG_QWORD values (64-bit unsigned long) from the registry using this measure.

Is the documentation correct? It seems like REG_QWORD values are supported...
User avatar

Re: Documentation error for Registry measure?

July 2nd, 2017, 6:36 am
Brian
Developer   [1508 posts]

Technically speaking, the Registry measure can get the following 'types': REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_DWORD, and REG_QWORD.
Code: https://github.com/rainmeter/rainmeter/blob/master/Library/MeasureRegistry.cpp#L44-L61

However, there are some issues that can arise when using types other than REG_DWORD and REG_SZ.
REG_EXPAND_SZ is generally acceptable to use but will contain non-expanded environmental variables (in most cases).
REG_MULTI_SZ usually contains a list of multiple null terminated strings. The measure is not set up to handle strings like this and will truncate the rest of the string after the first null.
REG_QWORD will work fine until the value returned is too large to convert properly. A measures "number value" is a floating-point number (called a double) that can lose precision when approaching really large numbers. Since the point of a QWORD is to represent large numbers, this conversion issue will likely raise its ugly head from time to time - so that is why we don't recommend using it. See this post for more information on this: https://forum.rainmeter.net/viewtopic.php?p=79969#p79969

Example:
qword.png


So while the registry measure can get different types, it is generally not recommended since the data returned may not be accurate. Having said that, we probably could clarify the docs some.

-Brian

Return to “Site Discussion”



Who is online

Users browsing this forum: No registered users and 1 guest