mirror of
https://github.com/reactos/reactos.git
synced 2024-08-26 21:28:48 +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
|
@ -1169,7 +1169,7 @@ HANDLE
|
||||||
NTAPI
|
NTAPI
|
||||||
NtUserGetClipboardData(
|
NtUserGetClipboardData(
|
||||||
UINT uFormat,
|
UINT uFormat,
|
||||||
DWORD Unknown1);
|
PVOID pBuffer);
|
||||||
|
|
||||||
INT
|
INT
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
|
@ -598,17 +598,16 @@ NtUserEmptyClipboard(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE STDCALL
|
HANDLE STDCALL
|
||||||
NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
NtUserGetClipboardData(UINT uFormat, PVOID pBuffer)
|
||||||
{
|
{
|
||||||
HANDLE ret = NULL;
|
HANDLE ret = NULL;
|
||||||
PCHAR buffer;
|
|
||||||
|
|
||||||
UserEnterShared();
|
UserEnterShared();
|
||||||
|
|
||||||
if (intIsClipboardOpenByMe())
|
if (intIsClipboardOpenByMe())
|
||||||
{
|
{
|
||||||
/* when Unknown1 is zero, we returns to user32 the data size */
|
/* when Unknown1 is zero, we returns to user32 the data size */
|
||||||
if (Unknown1 == 0)
|
if (!pBuffer)
|
||||||
{
|
{
|
||||||
PCLIPBOARDELEMENT data = intIsFormatAvailable(uFormat);
|
PCLIPBOARDELEMENT data = intIsFormatAvailable(uFormat);
|
||||||
|
|
||||||
|
@ -624,7 +623,7 @@ NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
||||||
co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
|
co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
|
||||||
data = intIsFormatAvailable(uFormat);
|
data = intIsFormatAvailable(uFormat);
|
||||||
ASSERT(data->size);
|
ASSERT(data->size);
|
||||||
ret = (HANDLE)data->size;
|
ret = (HANDLE)(ULONG_PTR)data->size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -635,7 +634,7 @@ NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
ret = (HANDLE)data->size;
|
ret = (HANDLE)(ULONG_PTR)data->size;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -668,20 +667,36 @@ NtUserGetClipboardData(UINT uFormat, DWORD Unknown1)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer = (PCHAR)Unknown1;
|
ret = (HANDLE)pBuffer;
|
||||||
memcpy(buffer, (PCHAR)synthesizedData, synthesizedDataSize);
|
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForWrite(pBuffer, synthesizedDataSize, 1);
|
||||||
|
memcpy(pBuffer, (PCHAR)synthesizedData, synthesizedDataSize);
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
ret = NULL;
|
||||||
|
}
|
||||||
|
_SEH_END
|
||||||
|
|
||||||
freeSynthesizedData();
|
freeSynthesizedData();
|
||||||
|
|
||||||
ret = (HANDLE)Unknown1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer = (PCHAR)Unknown1;
|
ret = (HANDLE)pBuffer;
|
||||||
memcpy(buffer, (PCHAR)data->hData, data->size);
|
|
||||||
|
|
||||||
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