Jactry Zeng jactry92@gmail.com writes:
2017-07-10 17:32 GMT+08:00 Alexandre Julliard julliard@winehq.org:
That's also tested already, in test_hkey_main_Value_A/W.
Aha! Yes, you are right. That was tested. So RegQueryValueExW will not add a NULL terminator all the time, and setting a length with NULL terminator for RegSetValueExW is necessary when using a same buffer for many RegQueryValueExW call.
In general it would be more robust to check the length from RegQueryValueExW. Fixing the setting side doesn't guarantee anything since it could be changed by some other piece of code.