user32: Don't use server data types in clipboard.c.

This commit is contained in:
Alexandre Julliard 2024-11-19 13:24:05 +01:00
parent 95bab1b106
commit 94ab547404

View file

@ -29,7 +29,6 @@
#include "winnls.h"
#include "objidl.h"
#include "shlobj.h"
#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(clipboard);
@ -164,7 +163,7 @@ static HANDLE marshal_data( UINT format, HANDLE handle, size_t *ret_size )
{
char *ptr;
if (!(size = GlobalSize( handle ))) return 0;
if ((data_size_t)size != size) return 0;
if ((UINT)size != size) return 0;
if (size < sizeof(WCHAR)) return 0;
if (!(ptr = GlobalLock( handle ))) return 0;
/* enforce nul-termination the Windows way: ignoring alignment */
@ -178,7 +177,7 @@ static HANDLE marshal_data( UINT format, HANDLE handle, size_t *ret_size )
{
char *ptr;
if (!(size = GlobalSize( handle ))) return 0;
if ((data_size_t)size != size) return 0;
if ((UINT)size != size) return 0;
if (!(ptr = GlobalLock( handle ))) return 0;
ptr[size - 1] = 0; /* enforce null-termination */
GlobalUnlock( handle );
@ -187,14 +186,14 @@ static HANDLE marshal_data( UINT format, HANDLE handle, size_t *ret_size )
}
default:
if (!(size = GlobalSize( handle ))) return 0;
if ((data_size_t)size != size) return 0;
if ((UINT)size != size) return 0;
*ret_size = size;
return handle;
}
}
/* rebuild the target handle from the data received in GetClipboardData */
static HANDLE unmarshal_data( UINT format, void *data, data_size_t size )
static HANDLE unmarshal_data( UINT format, void *data, UINT size )
{
HANDLE handle = GlobalReAlloc( data, size, GMEM_MOVEABLE ); /* release unused space */