<div dir="ltr"><br><div class="gmail_extra">Hi Alexandre,<br>2017-07-10 16:58 GMT+08:00 Alexandre Julliard <<a href="mailto:julliard@winehq.org" target="_blank">julliard@winehq.org</a>>:<br>><br>> I don't see how this is different from the existing tests.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Do you mean <a href="https://source.winehq.org/git/wine.git/blob/a94938819280aa52fbc545911ca70a6c3a83ab49:/dlls/advapi32/tests/registry.c#l1771" target="_blank">https://source.winehq.<wbr>org/git/wine.git/blob/<wbr>a94938819280aa52fbc545911ca70a<wbr>6c3a83ab49:/dlls/advapi32/<wbr>tests/registry.c#l1771</a> ?</div><div class="gmail_extra"><br></div><div class="gmail_extra">The difference is here set an empty string and a zero length for RegSetValueExW:</div><div class="gmail_extra"><br></div><div class="gmail_extra">+    ret = RegSetValueExW(hkey_main, name4W, 0, REG_SZ, (const BYTE *)emptyW, lstrlenW(emptyW));<br><br>Later RegQueryValueExW will get a zero length and it will not set buffer[0] as NULL:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">+    ret = RegQueryValueExW(hkey_main, name4W, 0, &type, (LPBYTE)buffer, &len);</div><div class="gmail_extra">+    ok(ret == ERROR_SUCCESS, "RegQueryValueExW failed: %d, GLE=%d\n", ret, GetLastError());</div><div class="gmail_extra">+    ok(len == 0, "got wrong length: %d\n", len);</div><div class="gmail_extra">+    ok(type == REG_SZ, "got type %d\n", type);</div><div class="gmail_extra">+    ok(!lstrcmpW(buffer, string1W), "got wrong string: %s\n", wine_dbgstr_w(buffer));</div><div><br></div><div>I found this because of a notepad bug. It can be reproduced by:</div><div>1. $ wine notepad;</div><div>2. Open 'page setup' dialog in menu 'File';</div><div>3. Clear string in 'Header' and 'Footer' and then enter it;</div><div>4. Restart notepad and open 'page setup' dialog again.</div><div>'Header' and 'Footer' will be set as a font name, it is from another registry key of notepad 'lfFaceName'.</div><div><br></div>-- <br><div class="m_-279060703765213200gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div></div>
</div></div>