mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 06:45:24 +00:00
rename 2nd parameter of NtUserGetClipboardData from Unknown1 to pBuffer. Use SEH to copy data.
svn path=/trunk/; revision=33329
This commit is contained in:
parent
a64e1e81c5
commit
9aafcccad6
2 changed files with 29 additions and 14 deletions
|
@ -1169,7 +1169,7 @@ HANDLE
|
|||
NTAPI
|
||||
NtUserGetClipboardData(
|
||||
UINT uFormat,
|
||||
DWORD Unknown1);
|
||||
PVOID pBuffer);
|
||||
|
||||
INT
|
||||
NTAPI
|
||||
|
@ -1614,7 +1614,7 @@ NtUserMapVirtualKeyEx( UINT keyCode,
|
|||
|
||||
#define NUMC_SENDMESSAGE 0x02B0
|
||||
// Kernel has option to use TO or normal msg send, based on type of msg.
|
||||
#define NUMC_SENDMESSAGEWTOOPTION 0x02B1
|
||||
#define NUMC_SENDMESSAGEWTOOPTION 0x02B1
|
||||
#define NUMC_SENDMESSAGETIMEOUT 0x02B2
|
||||
#define NUMC_BROADCASTSYSTEMMESSAGE 0x02B4
|
||||
#define NUMC_SENDNOTIFYMESSAGE 0x02B7
|
||||
|
|
|
@ -598,17 +598,16 @@ NtUserEmptyClipboard(VOID)
|
|||
}
|
||||
|
||||
HANDLE STDCALL
|
||||
NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
||||
NtUserGetClipboardData(UINT uFormat, PVOID pBuffer)
|
||||
{
|
||||
HANDLE ret = NULL;
|
||||
PCHAR buffer;
|
||||
|
||||
UserEnterShared();
|
||||
|
||||
if (intIsClipboardOpenByMe())
|
||||
{
|
||||
/* when Unknown1 is zero, we returns to user32 the data size */
|
||||
if (Unknown1 == 0)
|
||||
if (!pBuffer)
|
||||
{
|
||||
PCLIPBOARDELEMENT data = intIsFormatAvailable(uFormat);
|
||||
|
||||
|
@ -624,7 +623,7 @@ NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
|||
co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
|
||||
data = intIsFormatAvailable(uFormat);
|
||||
ASSERT(data->size);
|
||||
ret = (HANDLE)data->size;
|
||||
ret = (HANDLE)(ULONG_PTR)data->size;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -635,7 +634,7 @@ NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
|||
}
|
||||
|
||||
}
|
||||
ret = (HANDLE)data->size;
|
||||
ret = (HANDLE)(ULONG_PTR)data->size;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -668,20 +667,36 @@ NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
|||
}
|
||||
else
|
||||
{
|
||||
buffer = (PCHAR)Unknown1;
|
||||
memcpy(buffer, (PCHAR)synthesizedData, synthesizedDataSize);
|
||||
ret = (HANDLE)pBuffer;
|
||||
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeForWrite(pBuffer, synthesizedDataSize, 1);
|
||||
memcpy(pBuffer, (PCHAR)synthesizedData, synthesizedDataSize);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
ret = NULL;
|
||||
}
|
||||
_SEH_END
|
||||
|
||||
freeSynthesizedData();
|
||||
|
||||
ret = (HANDLE)Unknown1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = (PCHAR)Unknown1;
|
||||
memcpy(buffer, (PCHAR)data->hData, data->size);
|
||||
ret = (HANDLE)pBuffer;
|
||||
|
||||
ret = (HANDLE)Unknown1;
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeForWrite(pBuffer, data->size, 1);
|
||||
memcpy(pBuffer, (PCHAR)data->hData, data->size);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
ret = NULL;
|
||||
}
|
||||
_SEH_END
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue