user32: Fix GetClipboardFormatName behavior for integer formats.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
30179166d2
commit
4bdcf512cf
|
@ -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 : "");
|
||||
|
|
Loading…
Reference in New Issue