Commit 4bdcf512 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Fix GetClipboardFormatName behavior for integer formats.

parent 30179166
......@@ -456,20 +456,20 @@ UINT WINAPI RegisterClipboardFormatA( LPCSTR name )
/**************************************************************************
* GetClipboardFormatNameW (USER32.@)
*/
INT WINAPI GetClipboardFormatNameW(UINT wFormat, LPWSTR retStr, INT maxlen)
INT WINAPI GetClipboardFormatNameW( UINT format, LPWSTR buffer, INT maxlen )
{
if (wFormat < MAXINTATOM) return 0;
return GlobalGetAtomNameW( wFormat, retStr, maxlen );
if (format < MAXINTATOM || format > 0xffff) return 0;
return GlobalGetAtomNameW( format, buffer, maxlen );
}
/**************************************************************************
* GetClipboardFormatNameA (USER32.@)
*/
INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen)
INT WINAPI GetClipboardFormatNameA( UINT format, LPSTR buffer, INT maxlen )
{
if (wFormat < MAXINTATOM) return 0;
return GlobalGetAtomNameA( wFormat, retStr, maxlen );
if (format < MAXINTATOM || format > 0xffff) return 0;
return GlobalGetAtomNameA( format, buffer, maxlen );
}
......
......@@ -416,12 +416,12 @@ todo_wine
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "err %d\n", GetLastError());
}
for (format_id = 0; format_id < 0xffff; format_id++)
for (format_id = 0; format_id < 0x10fff; format_id++)
{
SetLastError(0xdeadbeef);
len = GetClipboardFormatNameA(format_id, buf, 256);
if (format_id < 0xc000)
if (format_id < 0xc000 || format_id > 0xffff)
ok(!len, "GetClipboardFormatNameA should fail, but it returned %d (%s)\n", len, buf);
else if (len && winetest_debug > 1)
trace("%04x: %s\n", format_id, len ? buf : "");
......
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