Merge pull request #11338 from dev-ddoe/fix#11335

[channels,drive] Prefer using handle from IRP_CREATE when possible
This commit is contained in:
akallabeth
2025-03-13 09:07:28 +01:00
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -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)

View File

@@ -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;
}