advapi32: Use STATUS_BUFFER_TOO_SMALL for buffer overflows in RegQueryInfoKeyW.

This commit is contained in:
Thomas Faber 2015-05-19 09:59:09 -04:00 committed by Alexandre Julliard
parent f4790714fe
commit b6c31bea3d
2 changed files with 3 additions and 3 deletions

View File

@ -865,7 +865,7 @@ LSTATUS WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPD
if (class_len && (info->ClassLength/sizeof(WCHAR) + 1 > *class_len))
{
status = STATUS_BUFFER_OVERFLOW;
status = STATUS_BUFFER_TOO_SMALL;
}
else
{

View File

@ -1823,7 +1823,7 @@ static void test_reg_query_info(void)
memset(classbufferW, 0x55, sizeof(classbufferW));
classlen = 1;
ret = RegQueryInfoKeyW(subkey, classbufferW, &classlen, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
todo_wine ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(classlen == 0 /* win8 */ ||
classlen == strlen(subkey_class), "classlen = %u\n", classlen);
memset(expectbufferW, 0x55, sizeof(expectbufferW));
@ -1846,7 +1846,7 @@ static void test_reg_query_info(void)
memset(classbufferW, 0x55, sizeof(classbufferW));
classlen = sizeof(subkey_class) - 1;
ret = RegQueryInfoKeyW(subkey, classbufferW, &classlen, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
todo_wine ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(classlen == sizeof(subkey_class) - 2 /* win8 */ ||
classlen == strlen(subkey_class), "classlen = %u\n", classlen);
memset(expectbufferW, 0x55, sizeof(expectbufferW));