Skip to content
Closed
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
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
<PackageVersion Include="Appium.WebDriver" Version="4.4.5" />
<PackageVersion Include="Axe.Windows" Version="2.4.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="MSTest" Version="3.8.3" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.8.3" />
<PackageVersion Include="MSTest.TestFramework" Version="3.8.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Dongle.GuidRVAGen" Version="1.0.5" />
<PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.13.0" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions Files.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<File Path="Directory.Packages.props" />
</Folder>
<Folder Name="/src/" />
<Folder Name="/src/core/" Id="8d626ea8-cb54-bc41-363a-217881beba6e">
<Folder Name="/src/core/">
<Project Path="src/Files.Core.SourceGenerator/Files.Core.SourceGenerator.csproj" />
<Project Path="src/Files.Core.Storage/Files.Core.Storage.csproj">
<Platform Solution="*|arm64" Project="arm64" />
Expand All @@ -22,7 +22,7 @@
<Platform Solution="*|x86" Project="x86" />
</Project>
</Folder>
<Folder Name="/src/platforms/" Id="82099983-647e-f067-e69a-cd800643a918">
<Folder Name="/src/platforms/">
<Project Path="src/Files.App (Package)/Files.Package.wapproj" Type="c7167f0d-bc9f-4e6e-afe1-012c56b48db5">
<Deploy />
</Project>
Expand Down Expand Up @@ -75,6 +75,7 @@
</Project>
</Folder>
<Folder Name="/tests/">
<Project Path="TestProject1/TestProject1.csproj" />
<Project Path="tests/Files.App.UITests/Files.App.UITests.csproj">
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
Expand Down
10 changes: 10 additions & 0 deletions src/Files.App.CsWin32/ComHeapPtr`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Runtime.CompilerServices;
using Windows.Win32.System.Com;

namespace Windows.Win32
{
Expand All @@ -21,6 +22,15 @@ public ComHeapPtr(T* ptr)
_ptr = ptr;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Attach(T* other)
{
if (_ptr is not null)
((IUnknown*)_ptr)->Release();

_ptr = other;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly T* Get()
{
Expand Down
12 changes: 12 additions & 0 deletions src/Files.App.CsWin32/ManualGuid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public static Guid* IID_IStorageProviderStatusUISourceFactory

[GuidRVAGen.Guid("000214F4-0000-0000-C000-000000000046")]
public static partial Guid* IID_IContextMenu2 { get; }

[GuidRVAGen.Guid("0000010E-0000-0000-C000-000000000046")]
public static partial Guid* IID_IDataObject { get; }
}

public static unsafe partial class CLSID
Expand Down Expand Up @@ -89,6 +92,9 @@ public static unsafe partial class CLSID

[GuidRVAGen.Guid("D969A300-E7FF-11d0-A93B-00A0C90F2719")]
public static partial Guid* CLSID_NewMenu { get; }

[GuidRVAGen.Guid("09799AFB-AD67-11D1-ABCD-00C04FC30936")]
public static partial Guid* CLSID_OpenWithMenu { get; }
}

public static unsafe partial class BHID
Expand All @@ -104,5 +110,11 @@ public static unsafe partial class FOLDERID
{
[GuidRVAGen.Guid("B7534046-3ECB-4C18-BE4E-64CD4CB7D6AC")]
public static partial Guid* FOLDERID_RecycleBinFolder { get; }

[GuidRVAGen.Guid("B4BFCC3A-DB2C-424C-B029-7FE99A87C641")]
public static partial Guid* FOLDERID_Desktop { get; }

[GuidRVAGen.Guid("374DE290-123F-4565-9164-39C4925E467B")]
public static partial Guid* FOLDERID_Downloads { get; }
}
}
4 changes: 4 additions & 0 deletions src/Files.App.CsWin32/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,7 @@ GetMenuItemCount
GetMenuItemInfo
IsWow64Process2
GetCurrentProcess
ILFindLastID
SHCreateDataObject
CoInitializeEx
CoUninitialize
19 changes: 0 additions & 19 deletions src/Files.App.Storage/Storables/WindowsStorage/ContextMenuItem.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Files Community
// Licensed under the MIT License.

namespace Files.App.Storage
{
/// <summary>
/// Represents a Windows Shell ContextMenu item.
/// </summary>
public partial record WindowsContextMenuItem(uint Id = 0U, string? Name = null, byte[]? Icon = null, WindowsContextMenuType Type = WindowsContextMenuType.String, WindowsContextMenuState State = WindowsContextMenuState.Enabled);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

namespace Files.App.Storage
{
public enum ContextMenuType
public enum WindowsContextMenuState : uint
{
Normal = 0x00000000,
Enabled = 0x00000000,

Disabled = 0x00000003,

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Files Community
// Licensed under the MIT License.

namespace Files.App.Storage
{
[Flags]
public enum WindowsContextMenuType : uint
{
Bitmap = 0x00000004,

MenuBarBreak = 0x00000020,

MenuBreak = 0x00000040,

OwnerDraw = 0x00000100,

RadioCheck = 0x00000200,

RightJustify = 0x00004000,

RightOrder = 0x00002000,

Separator = 0x00000800,

String = 0x00000000,
}
}
Loading
Loading