advapi32: Improve parameter sanity checks in RegLoadMUIString.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1b7f3698f0
commit
ec716f74d7
|
@ -3183,7 +3183,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
|
|||
cbBuffer, pcbData, dwFlags, debugstr_w(pwszBaseDir));
|
||||
|
||||
/* Parameter sanity checks. */
|
||||
if (!hKey || !pwszBuffer)
|
||||
if (!hKey || (!pwszBuffer && cbBuffer) || (cbBuffer % sizeof(WCHAR)))
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
/* Check for value existence and correctness of its type, allocate a buffer and load it. */
|
||||
|
|
|
@ -3896,8 +3896,8 @@ static void test_RegLoadMUIString(void)
|
|||
|
||||
memset(bufW, 0xff, sizeof(bufW));
|
||||
ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, sizeof(WCHAR)+1, &size, 0, NULL);
|
||||
todo_wine ok(ret == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", ret);
|
||||
todo_wine ok(bufW[0] == 0xffff, "got 0x%04x, expected 0xffff\n", bufW[0]);
|
||||
ok(ret == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", ret);
|
||||
ok(bufW[0] == 0xffff, "got 0x%04x, expected 0xffff\n", bufW[0]);
|
||||
|
||||
size = 0xdeadbeef;
|
||||
memset(bufW, 0xff, sizeof(bufW));
|
||||
|
|
Loading…
Reference in New Issue