Skip to content

Commit 39f288d

Browse files
committed
Init
1 parent 28ce3cf commit 39f288d

26 files changed

+446
-151
lines changed

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@
5959
<PackageVersion Include="MSTest.TestAdapter" Version="3.8.3" />
6060
<PackageVersion Include="MSTest.TestFramework" Version="3.8.3" />
6161
<PackageVersion Include="Dongle.GuidRVAGen" Version="1.0.5" />
62+
<PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.13.0" />
6263
</ItemGroup>
6364
</Project>

Files.slnx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<File Path="Directory.Packages.props" />
1010
</Folder>
1111
<Folder Name="/src/" />
12-
<Folder Name="/src/core/" Id="8d626ea8-cb54-bc41-363a-217881beba6e">
12+
<Folder Name="/src/core/">
1313
<Project Path="src/Files.Core.SourceGenerator/Files.Core.SourceGenerator.csproj" />
1414
<Project Path="src/Files.Core.Storage/Files.Core.Storage.csproj">
1515
<Platform Solution="*|arm64" Project="arm64" />
@@ -22,7 +22,7 @@
2222
<Platform Solution="*|x86" Project="x86" />
2323
</Project>
2424
</Folder>
25-
<Folder Name="/src/platforms/" Id="82099983-647e-f067-e69a-cd800643a918">
25+
<Folder Name="/src/platforms/">
2626
<Project Path="src/Files.App (Package)/Files.Package.wapproj" Type="c7167f0d-bc9f-4e6e-afe1-012c56b48db5">
2727
<Deploy />
2828
</Project>
@@ -81,6 +81,12 @@
8181
<Platform Solution="*|x86" Project="x86" />
8282
<Deploy />
8383
</Project>
84+
<Project Path="tests/Files.App.UnitTests/Files.App.UnitTests.csproj">
85+
<Platform Solution="*|arm64" Project="ARM64" />
86+
<Platform Solution="*|x64" Project="x64" />
87+
<Platform Solution="*|x86" Project="x86" />
88+
<Deploy />
89+
</Project>
8490
<Project Path="tests/Files.InteractionTests/Files.InteractionTests.csproj">
8591
<Platform Solution="*|arm64" Project="arm64" />
8692
<Platform Solution="*|x64" Project="x64" />

src/Files.App.CsWin32/ComHeapPtr`1.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ public ComHeapPtr(T* ptr)
2121
_ptr = ptr;
2222
}
2323

24+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
25+
public void Attach(T* other)
26+
{
27+
if (_ptr is not null)
28+
((IUnknown*)_ptr)->Release();
29+
30+
_ptr = other;
31+
}
32+
2433
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2534
public readonly T* Get()
2635
{

src/Files.App.CsWin32/ManualGuid.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public static Guid* IID_IStorageProviderStatusUISourceFactory
6262

6363
[GuidRVAGen.Guid("000214F4-0000-0000-C000-000000000046")]
6464
public static partial Guid* IID_IContextMenu2 { get; }
65+
66+
[GuidRVAGen.Guid("0000010E-0000-0000-C000-000000000046")]
67+
public static partial Guid* IID_IDataObject { get; }
6568
}
6669

6770
public static unsafe partial class CLSID
@@ -89,6 +92,9 @@ public static unsafe partial class CLSID
8992

9093
[GuidRVAGen.Guid("D969A300-E7FF-11d0-A93B-00A0C90F2719")]
9194
public static partial Guid* CLSID_NewMenu { get; }
95+
96+
[GuidRVAGen.Guid("09799AFB-AD67-11D1-ABCD-00C04FC30936")]
97+
public static partial Guid* CLSID_OpenWithMenu { get; }
9298
}
9399

94100
public static unsafe partial class BHID

src/Files.App.CsWin32/NativeMethods.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,5 @@ GetMenuItemCount
236236
GetMenuItemInfo
237237
IsWow64Process2
238238
GetCurrentProcess
239+
ILFindLastID
240+
SHCreateDataObject

src/Files.App.Storage/Storables/WindowsStorage/ContextMenuItem.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
namespace Files.App.Storage
5+
{
6+
/// <summary>
7+
/// Represents a Windows Shell ContextMenu item.
8+
/// </summary>
9+
public partial record WindowsContextMenuItem(uint Id = 0U, string? Name = null, byte[]? Icon = null, WindowsContextMenuType Type = WindowsContextMenuType.String, WindowsContextMenuState State = WindowsContextMenuState.Enabled);
10+
}

src/Files.App.Storage/Storables/WindowsStorage/ContextMenuType.cs renamed to src/Files.App.Storage/Storables/WindowsStorage/WindowsContextMenuState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
namespace Files.App.Storage
55
{
6-
public enum ContextMenuType
6+
public enum WindowsContextMenuState : uint
77
{
8-
Normal = 0x00000000,
8+
Enabled = 0x00000000,
99

1010
Disabled = 0x00000003,
1111

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
namespace Files.App.Storage
5+
{
6+
[Flags]
7+
public enum WindowsContextMenuType : uint
8+
{
9+
Bitmap = 0x00000004,
10+
11+
MenuBarBreak = 0x00000020,
12+
13+
MenuBreak = 0x00000040,
14+
15+
OwnerDraw = 0x00000100,
16+
17+
RadioCheck = 0x00000200,
18+
19+
RightJustify = 0x00004000,
20+
21+
RightOrder = 0x00002000,
22+
23+
Separator = 0x00000800,
24+
25+
String = 0x00000000,
26+
}
27+
}

0 commit comments

Comments
 (0)