user32: Clear last error in EnumClipboardFormats.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-09-09 22:48:32 +09:00
parent 64fba3e396
commit ef08bd7675
2 changed files with 15 additions and 0 deletions

View File

@ -738,6 +738,7 @@ UINT WINAPI EnumClipboardFormats(UINT wFormat)
SetLastError(ERROR_CLIPBOARD_NOT_OPEN);
return 0;
}
SetLastError( 0 );
return USER_Driver->pEnumClipboardFormats(wFormat);
}

View File

@ -680,16 +680,30 @@ static void test_synthesized(void)
r = OpenClipboard( NULL );
ok(r, "gle %d\n", GetLastError());
SetLastError( 0xdeadbeef );
cf = EnumClipboardFormats(0);
ok( cf == CF_UNICODETEXT, "cf %08x\n", cf );
ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
cf = EnumClipboardFormats(cf);
ok( cf == CF_TEXT, "cf %08x\n", cf );
ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
cf = EnumClipboardFormats(cf);
ok( cf == CF_OEMTEXT, "cf %08x\n", cf );
ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
cf = EnumClipboardFormats(cf);
ok( cf == CF_LOCALE, "cf %08x\n", cf );
ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
cf = EnumClipboardFormats( cf );
ok( cf == 0, "cf %08x\n", cf );
ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
cf = EnumClipboardFormats( 0xdead );
ok( cf == 0, "cf %08x\n", cf );
ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() );
r = EmptyClipboard();
ok(r, "gle %d\n", GetLastError());