Fix the NtUserGetClipboardData function for the synthesized text formats (CF_TEXT, CF_OEMTEXT and CF_UNICODETEXT).
CORE-11471
bHaveBm = IntIsFormatAvailable(pWinStaObj, CF_BITMAP);
bHaveDib = IntIsFormatAvailable(pWinStaObj, CF_DIB);
bHaveBm = IntIsFormatAvailable(pWinStaObj, CF_BITMAP);
bHaveDib = IntIsFormatAvailable(pWinStaObj, CF_DIB);
- /* Add CF_LOCALE format if we have CF_TEXT */
- if (!bHaveLocale && bHaveText)
+ /* Add CF_LOCALE format if we have CF_TEXT, CF_OEMTEXT or CF_UNICODETEXT */
+ if (!bHaveLocale && (bHaveText || bHaveOemText || bHaveUniText))
{
PCLIPBOARDDATA pMemObj;
HANDLE hMem;
{
PCLIPBOARDDATA pMemObj;
HANDLE hMem;
HANDLE hRet = NULL;
PCLIP pElement;
PWINSTATION_OBJECT pWinStaObj;
HANDLE hRet = NULL;
PCLIP pElement;
PWINSTATION_OBJECT pWinStaObj;
TRACE("NtUserGetClipboardData(%x, %p)\n", fmt, pgcd);
TRACE("NtUserGetClipboardData(%x, %p)\n", fmt, pgcd);
}
pElement = IntGetFormatElement(pWinStaObj, fmt);
}
pElement = IntGetFormatElement(pWinStaObj, fmt);
- if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
- {
- /* Send WM_RENDERFORMAT message */
- pWinStaObj->fInDelayedRendering = TRUE;
- co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)fmt, 0);
- pWinStaObj->fInDelayedRendering = FALSE;
-
- /* Data should be in clipboard now */
- pElement = IntGetFormatElement(pWinStaObj, fmt);
- }
-
- if (!pElement || IS_DATA_DELAYED(pElement))
goto cleanup;
if (IS_DATA_SYNTHESIZED(pElement))
goto cleanup;
if (IS_DATA_SYNTHESIZED(pElement))
case CF_UNICODETEXT:
case CF_TEXT:
case CF_OEMTEXT:
case CF_UNICODETEXT:
case CF_TEXT:
case CF_OEMTEXT:
- pElement = IntGetFormatElement(pWinStaObj, CF_UNICODETEXT);
+ uSourceFmt = CF_UNICODETEXT;
+ pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
if (IS_DATA_SYNTHESIZED(pElement))
if (IS_DATA_SYNTHESIZED(pElement))
- pElement = IntGetFormatElement(pWinStaObj, CF_TEXT);
+ {
+ uSourceFmt = CF_TEXT;
+ pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
+ }
if (IS_DATA_SYNTHESIZED(pElement))
if (IS_DATA_SYNTHESIZED(pElement))
- pElement = IntGetFormatElement(pWinStaObj, CF_OEMTEXT);
+ {
+ uSourceFmt = CF_OEMTEXT;
+ pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
+ }
case CF_BITMAP:
IntSynthesizeBitmap(pWinStaObj, pElement);
break;
case CF_BITMAP:
IntSynthesizeBitmap(pWinStaObj, pElement);
break;
default:
ASSERT(FALSE);
}
}
default:
ASSERT(FALSE);
}
}
+ if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
+ {
+ /* Send WM_RENDERFORMAT message */
+ pWinStaObj->fInDelayedRendering = TRUE;
+ co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)uSourceFmt, 0);
+ pWinStaObj->fInDelayedRendering = FALSE;
+
+ /* Data should be in clipboard now */
+ pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
+ }
+
+ if (!pElement || IS_DATA_DELAYED(pElement))
+ goto cleanup;
+
_SEH2_TRY
{
ProbeForWrite(pgcd, sizeof(*pgcd), 1);
_SEH2_TRY
{
ProbeForWrite(pgcd, sizeof(*pgcd), 1);