microsoft / win32-app-isolation

Tools and documentation for Win32 app isolation
MIT License
1.26k stars 33 forks source link

[Bug]: `GetOpenFileName` & `IFileDialog` don't support DPI Scaling in AppSilo #39

Open AndromedaMelody opened 1 year ago

AndromedaMelody commented 1 year ago

Version

Windows Version: 10.0.25370.1 Win32 app isolation release version: 0.1.0

Repro Steps

  1. Write an application using winrt::com_ptr<IFileDialog>/GetOpenFileNameW()/GetSaveFileNameW().
  2. Write an fusion manifest and declare PerMonitorV2.
    ……
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
    <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
    </windowsSettings>
    </application>
    ……
  3. Package the app and run it in AppSilo.
    <?xml version="1.0" encoding="utf-8"?>
    <Package ……
    xmlns:previewsecurity2="http://schemas.microsoft.com/appx/manifest/preview/windows10/security/2" 
    IgnorableNamespaces="… previewsecurity2">
    ……
    <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.25229.0" MaxVersionTested="10.0.25229.0" />
    </Dependencies>
    <Applications>
    <Application … uap10:TrustLevel="appContainer" previewsecurity2:RuntimeBehavior="appSilo"> …… </Application>
    </Applications>
    </Package>

Unexpected Results

Open File Dialog is blurred. Screenshot 2023-06-09 001626

macruzco commented 1 year ago

Thanks for reporting this @AndromedaMelody ! Indeed we have to include support for DPI scaling options when brokering the file dialog.

Could you please clarify what exactly is blurry and where to look for the blur? I haven't been able to spot the blur myself, so it would be helpful to know exactly what to look for.

Thanks!