files-community / files-community/Files

Feature: Standalone WinRT server for background operations

Open
#13,632 13 comments 0 reactions 1 assignee Claimed by @hez2010 View on GitHub
area - file operations
Dominant language
C#
Stars
45.4k
Forks
2.9k
Avg merge
19h 1m
Merged PRs (30d)
60

Description

### What feature or improvement do you think would benefit Files?

We initially chose Win32 Shell APIs for file operations because we wanted the file operations to continue even after Files was closed, but Win32 Shell APIs are designed for automation, not for the general use by a file explorer. And it comes with its own limitations (e.g. slow, no built-in transfer speed calculation and etc.).

We should consider implementing file operations as an out-of-process WinRT exe server, so that we no longer need to rely on the Win32 Shell APIs, neither facing the performance and maintainability issues due to serialization and inter-process communication. By using WinRT we can expose the APIs with WinRT types directly (such as `IAsyncOperation` and `Stream`), and call them directly from another process.

### Requirements

It was possible only with C++/WinRT, and CsWinRT still doesn't have built-in support for authoring OOP WinRT exe server for now (see the original feature request in CsWinRT: https://github.com/microsoft/CsWinRT/issues/1177).
But recently a project [Shmuelie.WinRTServer](https://github.com/shmuelie/Shmuelie.WinRTServer) has this implemented, so I think we can start to investigate it.

### Files Version

Planning for post 3.0

### Windows Version

10.0.22631.2506

### Comments

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.