Commit d4d304f4 authored by Andrey Melnikov's avatar Andrey Melnikov Committed by Alexandre Julliard

gdi32: Handle NULL filename in GetICMProfileA().

parent e5d7d69f
......@@ -116,11 +116,18 @@ BOOL WINAPI GetICMProfileA(HDC hdc, LPDWORD size, LPSTR 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))
{
int len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL);
if (!filename)
{
*size = len;
return FALSE;
}
if (*size >= len)
{
WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, *size, NULL, NULL);
......
......@@ -55,7 +55,6 @@ static void test_GetICMProfileA( HDC dc )
size = 0;
ret = GetICMProfileA( dc, &size, NULL );
ok( !ret, "GetICMProfileA succeeded\n" );
todo_wine
ok( size > 0, "got %u\n", size );
size = MAX_PATH;
......
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