Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed an issue with admin operations not working #13545

Merged
merged 17 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Files.App/Dialogs/ElevateConfirmDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<Style BasedOn="{StaticResource AccentButtonStyle}" TargetType="Button">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate x:DataType="ContentDialog">
<DataTemplate>
<StackPanel Orientation="Horizontal" Spacing="5">
<FontIcon FontSize="14" Glyph="&#xEA18;" />
<TextBlock Text="{x:Bind PrimaryButtonText, Mode=OneWay}" />
<TextBlock Text="{Binding Content, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</StackPanel>
</DataTemplate>
</Setter.Value>
Expand Down
6 changes: 5 additions & 1 deletion src/Files.App/Utils/Shell/ShellFileOperations2.cs
gave92 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public class ShellFileOperations2 : IDisposable
/// <param name="owner">The window that owns the modal dialog. This value can be <see langword="null"/>.</param>
public ShellFileOperations2(HWND owner = default)
{
op = new IFileOperation();
// EDIT: use CoCreateInstance to explicitly create object with CLSCTX_LOCAL_SERVER (fixes #13229, hides UAC)
Ole32.CoCreateInstance(typeof(CFileOperations).GUID, null, Ole32.CLSCTX.CLSCTX_LOCAL_SERVER, typeof(IFileOperation).GUID, out var opObj);
gave92 marked this conversation as resolved.
Show resolved Hide resolved
op = (IFileOperation)opObj;
//op = new IFileOperation();
if (owner != default)
{
op.SetOwnerWindow(owner);
Expand Down Expand Up @@ -712,6 +715,7 @@ internal ShellFileOpEventArgs(TRANSFER_SOURCE_FLAGS flags, IShellItem source, IS

public delegate void ProgressChangedEventHandler(object? sender, ProgressChangedEventArgs e);

// From System.ComponentModel.ProgressChangedEventArgs but with double percentage
public class ProgressChangedEventArgs : EventArgs
{
private readonly double _progressPercentage;
Expand Down