From f301e2b222ea276fd028cee7929aece3eccda412 Mon Sep 17 00:00:00 2001 From: David Lechevalier Date: Wed, 12 Mar 2025 18:44:36 +0100 Subject: [PATCH 1/2] [channels,drive] Prefer using handle from IRP_CREATE when possible Windows can query information on a file recently renamed using a handle created before the rename --- channels/drive/client/drive_file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index cac5682b0..69e520dca 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -587,6 +587,11 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w if (!file || !output) return FALSE; + if ((file->file_handle != INVALID_HANDLE_VALUE) && + GetFileInformationByHandle(file->file_handle, &fileInformation)) + return drive_file_query_from_handle_information(file, &fileInformation, FsInformationClass, + output); + hFile = CreateFileW(file->fullpath, 0, FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) From 7e461a032782e637ffd3ce6290547189ef4b5bbd Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 13 Mar 2025 08:38:06 +0100 Subject: [PATCH 2/2] [codec,progressive] fix region cleanup --- libfreerdp/codec/progressive.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index e0b8e9ef1..c7ccf730f 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -2279,18 +2279,19 @@ static INLINE BOOL update_tiles(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, for (UINT32 j = 0; j < nbUpdateRects; j++) { + rc = FALSE; const RECTANGLE_16* rect = &updateRects[j]; if (rect->left < updateRect.left) - goto fail; + break; const UINT32 nXSrc = rect->left - updateRect.left; const UINT32 nYSrc = rect->top - updateRect.top; const UINT32 width = rect->right - rect->left; const UINT32 height = rect->bottom - rect->top; if (rect->left + width > surface->width) - goto fail; + break; if (rect->top + height > surface->height) - goto fail; + break; rc = freerdp_image_copy_no_overlap( pDstData, DstFormat, nDstStep, rect->left, rect->top, width, height, tile->data, progressive->format, tile->stride, nXSrc, nYSrc, NULL, FREERDP_KEEP_DST_ALPHA); @@ -2302,6 +2303,8 @@ static INLINE BOOL update_tiles(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, } region16_uninit(&updateRegion); + if (!rc) + goto fail; tile->dirty = FALSE; }