Commit cefcadcc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32: Ignore size field when creating with -W calls.

parent bf3f848d
...@@ -649,9 +649,9 @@ INT WINAPI FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum) ...@@ -649,9 +649,9 @@ INT WINAPI FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum)
} }
/************************************************************************* /*************************************************************************
* CreateMRUListLazy_common (internal) * create_mru_list (internal)
*/ */
static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp) static HANDLE create_mru_list(LPWINEMRULIST mp)
{ {
UINT i, err; UINT i, err;
HKEY newkey; HKEY newkey;
...@@ -737,24 +737,22 @@ static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp) ...@@ -737,24 +737,22 @@ static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
* *
* See CreateMRUListLazyA. * See CreateMRUListLazyA.
*/ */
HANDLE WINAPI CreateMRUListLazyW (const MRUINFOW *lpcml, DWORD dwParam2, HANDLE WINAPI CreateMRUListLazyW (const MRUINFOW *infoW, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4) DWORD dwParam3, DWORD dwParam4)
{ {
LPWINEMRULIST mp; LPWINEMRULIST mp;
/* Native does not check for a NULL lpcml */ /* Native does not check for a NULL lpcml */
if (!infoW->hKey || IsBadStringPtrW(infoW->lpszSubKey, -1))
if (lpcml->cbSize != sizeof(MRUINFOW) || !lpcml->hKey ||
IsBadStringPtrW(lpcml->lpszSubKey, -1))
return NULL; return NULL;
mp = Alloc(sizeof(WINEMRULIST)); mp = Alloc(sizeof(WINEMRULIST));
memcpy(&mp->extview, lpcml, sizeof(MRUINFOW)); memcpy(&mp->extview, infoW, sizeof(MRUINFOW));
mp->extview.lpszSubKey = Alloc((strlenW(lpcml->lpszSubKey) + 1) * sizeof(WCHAR)); mp->extview.lpszSubKey = Alloc((strlenW(infoW->lpszSubKey) + 1) * sizeof(WCHAR));
strcpyW(mp->extview.lpszSubKey, lpcml->lpszSubKey); strcpyW(mp->extview.lpszSubKey, infoW->lpszSubKey);
mp->isUnicode = TRUE; mp->isUnicode = TRUE;
return CreateMRUListLazy_common(mp); return create_mru_list(mp);
} }
/************************************************************************** /**************************************************************************
...@@ -790,7 +788,7 @@ HANDLE WINAPI CreateMRUListLazyA (const MRUINFOA *lpcml, DWORD dwParam2, ...@@ -790,7 +788,7 @@ HANDLE WINAPI CreateMRUListLazyA (const MRUINFOA *lpcml, DWORD dwParam2,
MultiByteToWideChar(CP_ACP, 0, lpcml->lpszSubKey, -1, MultiByteToWideChar(CP_ACP, 0, lpcml->lpszSubKey, -1,
mp->extview.lpszSubKey, len); mp->extview.lpszSubKey, len);
mp->isUnicode = FALSE; mp->isUnicode = FALSE;
return CreateMRUListLazy_common(mp); return create_mru_list(mp);
} }
/************************************************************************** /**************************************************************************
...@@ -798,9 +796,9 @@ HANDLE WINAPI CreateMRUListLazyA (const MRUINFOA *lpcml, DWORD dwParam2, ...@@ -798,9 +796,9 @@ HANDLE WINAPI CreateMRUListLazyA (const MRUINFOA *lpcml, DWORD dwParam2,
* *
* See CreateMRUListA. * See CreateMRUListA.
*/ */
HANDLE WINAPI CreateMRUListW (const MRUINFOW *lpcml) HANDLE WINAPI CreateMRUListW (const MRUINFOW *infoW)
{ {
return CreateMRUListLazyW(lpcml, 0, 0, 0); return CreateMRUListLazyW(infoW, 0, 0, 0);
} }
/************************************************************************** /**************************************************************************
......
...@@ -573,7 +573,7 @@ static void test_CreateMRUListW(void) ...@@ -573,7 +573,7 @@ static void test_CreateMRUListW(void)
infoW.lpfnCompare = NULL; infoW.lpfnCompare = NULL;
hMru = pCreateMRUListW(&infoW); hMru = pCreateMRUListW(&infoW);
todo_wine ok(hMru != NULL, "got %p\n", hMru); ok(hMru != NULL, "got %p\n", hMru);
pFreeMRUList(hMru); pFreeMRUList(hMru);
/* increased size */ /* increased size */
...@@ -585,7 +585,7 @@ static void test_CreateMRUListW(void) ...@@ -585,7 +585,7 @@ static void test_CreateMRUListW(void)
infoW.lpfnCompare = NULL; infoW.lpfnCompare = NULL;
hMru = pCreateMRUListW(&infoW); hMru = pCreateMRUListW(&infoW);
todo_wine ok(hMru != NULL, "got %p\n", hMru); ok(hMru != NULL, "got %p\n", hMru);
pFreeMRUList(hMru); pFreeMRUList(hMru);
/* zero size */ /* zero size */
...@@ -597,7 +597,7 @@ static void test_CreateMRUListW(void) ...@@ -597,7 +597,7 @@ static void test_CreateMRUListW(void)
infoW.lpfnCompare = NULL; infoW.lpfnCompare = NULL;
hMru = pCreateMRUListW(&infoW); hMru = pCreateMRUListW(&infoW);
todo_wine ok(hMru != NULL, "got %p\n", hMru); ok(hMru != NULL, "got %p\n", hMru);
pFreeMRUList(hMru); pFreeMRUList(hMru);
/* NULL hKey */ /* NULL hKey */
...@@ -655,7 +655,7 @@ static void test_CreateMRUListLazyW(void) ...@@ -655,7 +655,7 @@ static void test_CreateMRUListLazyW(void)
infoW.lpfnCompare = NULL; infoW.lpfnCompare = NULL;
hMru = pCreateMRUListLazyW(&infoW, 0, 0, 0); hMru = pCreateMRUListLazyW(&infoW, 0, 0, 0);
todo_wine ok(hMru != NULL, "got %p\n", hMru); ok(hMru != NULL, "got %p\n", hMru);
pFreeMRUList(hMru); pFreeMRUList(hMru);
/* increased size */ /* increased size */
...@@ -667,7 +667,7 @@ static void test_CreateMRUListLazyW(void) ...@@ -667,7 +667,7 @@ static void test_CreateMRUListLazyW(void)
infoW.lpfnCompare = NULL; infoW.lpfnCompare = NULL;
hMru = pCreateMRUListLazyW(&infoW, 0, 0, 0); hMru = pCreateMRUListLazyW(&infoW, 0, 0, 0);
todo_wine ok(hMru != NULL, "got %p\n", hMru); ok(hMru != NULL, "got %p\n", hMru);
pFreeMRUList(hMru); pFreeMRUList(hMru);
/* zero size */ /* zero size */
...@@ -679,7 +679,7 @@ static void test_CreateMRUListLazyW(void) ...@@ -679,7 +679,7 @@ static void test_CreateMRUListLazyW(void)
infoW.lpfnCompare = NULL; infoW.lpfnCompare = NULL;
hMru = pCreateMRUListLazyW(&infoW, 0, 0, 0); hMru = pCreateMRUListLazyW(&infoW, 0, 0, 0);
todo_wine ok(hMru != NULL, "got %p\n", hMru); ok(hMru != NULL, "got %p\n", hMru);
pFreeMRUList(hMru); pFreeMRUList(hMru);
/* NULL hKey */ /* NULL hKey */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment