mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
user32: Don't use server data types in clipboard.c.
This commit is contained in:
parent
95bab1b106
commit
94ab547404
1 changed files with 4 additions and 5 deletions
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue