user32/tests: Allocate clipboard data with HeapAlloc.

This partially reverts commit faae2162b8.
This commit is contained in:
Alex Henrie 2023-11-11 14:40:00 -07:00 committed by Alexandre Julliard
parent 3a8d71041c
commit 88e66d0785

View file

@ -1531,10 +1531,10 @@ static void test_handles( HWND hwnd )
if (0) /* crashes on vista64 */
{
ptr = malloc( sizeof(void *) );
ptr = HeapAlloc( GetProcessHeap(), 0, 0 );
h = SetClipboardData( format_id2, ptr );
ok( !h, "got %p\n", h );
free( ptr );
HeapFree( GetProcessHeap(), 0, ptr );
}
h = SetClipboardData( format_id2, empty_fixed );
@ -1547,12 +1547,12 @@ static void test_handles( HWND hwnd )
ok( h == hmoveable, "got %p\n", h );
ok( is_moveable( h ), "expected moveable mem %p\n", h );
ptr = malloc( 37 );
ptr = HeapAlloc( GetProcessHeap(), 0, 37 );
h = SetClipboardData( 0xdeadfade, ptr );
ok( h == ptr || !h, "got %p\n", h );
if (!h) /* heap blocks are rejected on >= win8 */
{
free( ptr );
HeapFree( GetProcessHeap(), 0, ptr );
ptr = NULL;
}