Hi Doug,

Last night I spent quite some time to diagnose a problem, the WindowsRegistry 
class refused to fetch a certain key from my registry (returned null).

After some debugging I discovered that the key was a bit longer, and the 
getValue() code in core/org.eclipse.cdt.core.win32/library/winreg/winreg.cpp is 
statically limited to 256 chars:

        wchar_t buffer[256];
        DWORD len = sizeof(buffer);
        rc = RegQueryValueEx(skey, (const wchar_t *)cname, NULL, &type, (BYTE 
*)&buffer, &len);

According to Microsoft, the registry element size limits are:

        
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724872(v=vs.85).aspx

It is true that the 255 limit exists, but refers to key names, not key values, 
which are limited to 1 MB or even unlimited.

On the other side, it is recommended to store values longer than 2048 bytes in 
a file.


Since reserving 1 MB might be a bit too much, I suggest you increase the buffer 
from 256 to 2049, to be more resilient in case of longer key values.


Regards,

Liviu


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to