Repository navigation
Conversation
This was referenced Nov 1, 2026
2 of 5 tasks
agneszitte
requested review from
MartinZikmund,
Xiaoy312,
ajpinedam,
morning4coffe-dev and
ramezgerges
November 3, 2026 10:57
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 244750 did not find any UI Test snapshots differences. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: backport of #23924 (closes #25863 on 6.8)
PR Type:
🐞 Bugfix
What changed? 🚀
Manual backport to
servicing/6.8of two Skia Win32 (Windows desktop) drag-and-drop fixes that master got in #23924. That's a RichEditBox feature PR, so it wasn't backported, and the two fixes are a small part of its commits, so Mergify's cherry-pick can't be used.A CF_DIB drag's bitmap can't be read in
DragOverorDrop(#25863). When an external drag enters the window,DragEnterreads each standard format offered asTYMED_HGLOBALwithIDataObject::GetDataand releases every medium (ReleaseStgMedium) before it returns. Text and file lists are copied right away. The CF_DIB reader, though, only registered a data provider that kept the rawHGLOBALand locked it later, when the app calledDataPackageView.GetBitmapAsync(), typically from itsDragOverorDrophandler. The handle is usually freed by then, soGetBitmapAsyncthrowsInvalidOperationException("Failed to asynchronously load the data of id 'Bitmap'") for the Bitmap format of any CF_DIB drag, after logging "GlobalLock failed: The handle is invalid.". This matters most for a drag that offers a picture without a file. Files dropped from Explorer, and files that only exist in the source app (copied to a temporary folder atDragEnter), aren't affected. The reader now builds the BMP (the DIB behind a file header) and callsSetBitmapbeforeDragEnterreleases the handle, as on master. The package then holds a buffer the size of the bitmap for the whole drag, about 33 MB for a 3840×2160, 32-bit bitmap. Reading the bitmap twice, for example inDragOverand again inDrop, depends on theRandomAccessStreamReference.CreateFromStreamfix in #25867.Async file drops: defensive hardening and completion ordering. When the drag source supports asynchronous data extraction (
IDataObjectAsyncCapability), the drop target reads the file list (HDROP) on a worker thread afterDrop. On 6.8, a read that fails (the list can't be read) already faults the task behindGetStorageItemsAsync(). But an exception thrown on that thread, while reading the list or during the cleanup (releasing the medium and callingEndOperation), would escape the thread and end the process. No known input makes it throw on 6.8, so this part is defensive. Also, the task completed before that cleanup, and its continuations could run inline on the worker, before the cleanup. Now the worker completes the task only after the cleanup, with continuations run asynchronously, and faults it with any non-fatal exception:GetStorageItemsAsyncnow throws (the cause is logged) instead of the process ending.The backport has three commits:
fix(win32): Read drag bitmaps (backport #23924): theGetBitmappart of eb508ad, by Dominik Titl. The method is identical to master's, including the removedSystem.Threading.Tasksusing. The rest of eb508ad is RichEditBox work, plus drag-drop input hardening inReadContentIntoPackagethat this backport leaves out: a limit on the number of formats, size budgets per format and per drag, a check that dragged text is null-terminated within its allocation, and size checks on the HDROP. That hardening uses constants and helpers (MaxClipboardFormatBytes,GetUnicodeStringand others) that b2be67e, also in feat(richeditbox): implement Skia support #23924, added toWin32ClipboardExtension.cs, and 6.8 doesn't have them. As a result, the new copy of the bitmap has no size limit on 6.8, while master ignores a format over 256 MB.fix(win32): Contain async drop errors (backport #23924): de8bb7e, by morning4coffe-dev, with its two tests in a newGiven_Win32DragDrop.skia.cs. The cherry-pick had two conflicts. InWin32DragDropExtension.cs, master's context was b2be67e's in-between version of the worker thread code (atry/catcharound it), which 6.8 doesn't have; the result takes de8bb7e's version. The test file moved from master'sWindows/ApplicationModel/DataTransferfolder to 6.8'sTests/Windows_ApplicationModel/DataTransfer. Apart from the 6.8 namespace (Uno.UI.Runtime.Skia.Win32), the result matches master's file except at the end: 6.8's file keeps the trailing blank line that b2be67e removed on master.test(win32): Cover reading a DIB after release: a regression test for the bitmap bug,Given_Win32DragDrop.When_Bitmap_Drop_Read_After_Medium_Released. It builds a 2×3, 32-bitBI_RGBCF_DIB in anHGLOBAL, passes it toReadContentIntoPackage, frees the handle asReleaseStgMediumdoes, then reads the bitmap withGetBitmapAsync. It checks the BMP file header (BM,bfSizeequal to the length,bfOffBitsof 54) and that the DIB bytes are unchanged. master has no test for this; test(win32): Cover reading a DIB after release #25864 adds the same test there.Tests: on Skia Desktop (Windows),
Given_Win32DragDrop, onservicing/6.8at 6951c2c:When_Bitmap_Drop_Read_After_Medium_ReleasedWhen_File_Drop_Failure_Completes_Task(2 rows)When_File_Drop_Completes_Only_After_CleanupWithout the bitmap fix,
GetBitmapAsyncthrowsInvalidOperationExceptionwith an innerTaskCanceledException, becauseDataPackageswallows the provider's error: it logs it and completes the request without data. The two file drop tests come with the async drop fix and call its newCompleteFileDropmethod, so they can't run without it.PR Checklist ✅
Screenshots Compare Test Runresults.