Commit 9bd3e3fb authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

user32/tests: GetClipboardData() returns no error for missing formats.

Despite the documentation that says if GetClipboardData() returns NULL one can check GetLastError() to know why! Signed-off-by: 's avatarFrancois Gouget <fgouget@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1b36c218
......@@ -1070,6 +1070,7 @@ HANDLE WINAPI GetClipboardData( UINT format )
GlobalFree( data );
if (status == STATUS_BUFFER_OVERFLOW) continue; /* retry with the new size */
if (status == STATUS_OBJECT_NAME_NOT_FOUND) return 0; /* no such format */
if (status)
{
SetLastError( RtlNtStatusToDosError( status ));
......
......@@ -1543,6 +1543,11 @@ static void test_handles( HWND hwnd )
data = GetClipboardData( 0xdeadfade );
ok( data == ptr, "wrong data %p\n", data );
SetLastError( 0xdeadbeef );
data = GetClipboardData( CF_RIFF );
ok( GetLastError() == 0xdeadbeef, "unexpected last error %d\n", GetLastError() );
ok( !data, "wrong data %p\n", data );
h = SetClipboardData( CF_PRIVATEFIRST + 7, htext4 );
ok( h == htext4, "got %p\n", h );
ok( is_moveable( h ), "expected moveable mem %p\n", h );
......
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