gdi32: Handle NULL filename in GetICMProfileA().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Andrey Melnikov <temnota.am@gmail.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e5d7d69f72
commit
d4d304f436
|
@ -116,11 +116,18 @@ BOOL WINAPI GetICMProfileA(HDC hdc, LPDWORD size, LPSTR filename)
|
||||||
|
|
||||||
TRACE("%p, %p, %p\n", hdc, size, filename);
|
TRACE("%p, %p, %p\n", hdc, size, filename);
|
||||||
|
|
||||||
if (!hdc || !size || !filename) return FALSE;
|
if (!hdc || !size) return FALSE;
|
||||||
|
|
||||||
if (GetICMProfileW(hdc, &buflen, filenameW))
|
if (GetICMProfileW(hdc, &buflen, filenameW))
|
||||||
{
|
{
|
||||||
int len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL);
|
int len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL);
|
||||||
|
|
||||||
|
if (!filename)
|
||||||
|
{
|
||||||
|
*size = len;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (*size >= len)
|
if (*size >= len)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, *size, NULL, NULL);
|
WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, *size, NULL, NULL);
|
||||||
|
|
|
@ -55,7 +55,6 @@ static void test_GetICMProfileA( HDC dc )
|
||||||
size = 0;
|
size = 0;
|
||||||
ret = GetICMProfileA( dc, &size, NULL );
|
ret = GetICMProfileA( dc, &size, NULL );
|
||||||
ok( !ret, "GetICMProfileA succeeded\n" );
|
ok( !ret, "GetICMProfileA succeeded\n" );
|
||||||
todo_wine
|
|
||||||
ok( size > 0, "got %u\n", size );
|
ok( size > 0, "got %u\n", size );
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
|
|
Loading…
Reference in New Issue