03-03-2015 02:48 AM
Hi,
i have the following entry in the registry
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_22B5&PID_000C\6&23938f4b&0&7\Device Parameters]
"SymbolicName"="\\??\\USB#VID_22B5&PID_000C#6&23938f4b&0&7#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"
When i read the "SymbolicName" the result is in LabVIEW 2012 and 2014:
"\\??\\USB#VID_22B5&PID_000C#6&23938f4b&0&7#{a5dcbf10-6530-11d2-901f-00c04fb951ed" (feedback from VI)
"\\??\\USB#VID_22B5&PID_000C#6&23938f4b&0&7#{a5dcbf10-6530-11d2-901f-00c04fb951ed}" (in Registry)
The "}" at the end of the entry is always missinig.
Regards
Stefan
03-04-2015 03:59 AM
Hi Stefan,
I tried to read out a registry entry on my machine and it worked well. Do you see this behavior with multiple registry entries or only with this one?
Which OS do you use?
Best regards,
Melanie
03-05-2015 07:46 AM
Hi Melanie,
i readout several hundreds entries and around 10 to 20 like this style from "SymbolicName".
Every SymbolicName is without the last "}". I only notice is because i use RegEx to get the
part inside the { } and that didn't work and i was wondering why (the RegEx was ok).
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\
The underlined part changes but the key "SymbolicName" always exist below "Device Parameters".
I use Windows 7 x64. For now i check if the last char is a "}" and if not i add it.
Stefan
03-05-2015 09:13 AM - edited 03-05-2015 09:16 AM
Do you use backslash code display in the string control? All the Symbolic Names for USB devices in my system start with \??\USB# not \\??\\USB#.
It may be that the installer which wrote those values to the registry has somehow messed up. Looking at the low level inplementation of the Read Registry Value VI there is a potential that the installer attempts to write \??\USB.... to the registry and correctly updates the size for that string but really writes \\??\\ into it due to wrong unescaping in its installer routine. This would result in the registry to contain a string that is in fact 2 characters longer than it indicates to be.
LabVIEW retrieves a buffer and cuts it to the number of bytes the registry entry indicates and then tries to search for the zero char. Since the registry entry believes to be smaller than it is, this results in a early terminated string, with the last character missing.
The real problem is in fact the installer for that driver, which messes up with unescaping of the backslash character. The problem makes itself apparent in LabVIEW since the LabVIEW Read Registry function takes the returned parameters literal, where as it should probably be more lenient on string values and simply search for the zero terminated string end, ignoring what the registry entry tells it the length to really be.