Revert "user32: Moved some 16-bit functions."

This partially reverts commit 6e9fea22f8.
16-bit and 32-bit clipboard handles aren't interchangeable.
This commit is contained in:
Alexandre Julliard 2007-12-17 11:56:05 +01:00
parent f1dcf4bf3a
commit 61bace5ba9
2 changed files with 51 additions and 18 deletions

View File

@ -485,6 +485,35 @@ BOOL WINAPI ChangeClipboardChain(HWND hWnd, HWND hWndNext)
}
/**************************************************************************
* SetClipboardData (USER.141)
*/
HANDLE16 WINAPI SetClipboardData16(UINT16 wFormat, HANDLE16 hData)
{
CLIPBOARDINFO cbinfo;
HANDLE16 hResult = 0;
TRACE("(%04X, %04x) !\n", wFormat, hData);
/* If it's not owned, data can only be set if the format doesn't exists
and its rendering is not delayed */
if (!CLIPBOARD_GetClipboardInfo(&cbinfo) ||
(!(cbinfo.flags & CB_OWNER) && !hData))
{
WARN("Clipboard not owned by calling task. Operation failed.\n");
return 0;
}
if (USER_Driver->pSetClipboardData(wFormat, hData, 0, cbinfo.flags & CB_OWNER))
{
hResult = hData;
bCBHasChanged = TRUE;
}
return hResult;
}
/**************************************************************************
* SetClipboardData (USER32.@)
*/
@ -556,6 +585,28 @@ BOOL WINAPI IsClipboardFormatAvailable(UINT wFormat)
}
/**************************************************************************
* GetClipboardData (USER.142)
*/
HANDLE16 WINAPI GetClipboardData16(UINT16 wFormat)
{
HANDLE16 hData = 0;
CLIPBOARDINFO cbinfo;
if (!CLIPBOARD_GetClipboardInfo(&cbinfo) ||
(~cbinfo.flags & CB_OPEN))
{
WARN("Clipboard not opened by calling task.\n");
SetLastError(ERROR_CLIPBOARD_NOT_OPEN);
return 0;
}
if (!USER_Driver->pGetClipboardData(wFormat, &hData, NULL)) hData = 0;
return hData;
}
/**************************************************************************
* GetClipboardData (USER32.@)
*/

View File

@ -446,24 +446,6 @@ BOOL16 WINAPI EmptyClipboard16(void)
}
/**************************************************************************
* SetClipboardData (USER.141)
*/
HANDLE16 WINAPI SetClipboardData16(UINT16 wFormat, HANDLE16 hData)
{
return HANDLE_16(SetClipboardData(wFormat, HANDLE_32(hData)));
}
/**************************************************************************
* GetClipboardData (USER.142)
*/
HANDLE16 WINAPI GetClipboardData16(UINT16 wFormat)
{
return HANDLE_16(GetClipboardData(wFormat));
}
/**************************************************************************
* CountClipboardFormats (USER.143)
*/