Skip to content

Commit 0952f73

Browse files
committed
Taking incoming
2 parents c4cb22c + 8520721 commit 0952f73

File tree

2 files changed

+33
-42
lines changed

2 files changed

+33
-42
lines changed

src/Files.App (Package)/Package.appxmanifest

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="3.8.1.0" />
19+
Version="3.3.4.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>
@@ -33,11 +33,11 @@
3333
<Resource Language="en-US" />
3434
<Resource Language="af" />
3535
<Resource Language="ar" />
36-
<Resource Language="be-BY" />
3736
<Resource Language="bg" />
3837
<Resource Language="ca" />
3938
<Resource Language="cs-CZ" />
4039
<Resource Language="da" />
40+
<Resource Language="da-DK" />
4141
<Resource Language="de-DE" />
4242
<Resource Language="el" />
4343
<Resource Language="en-GB" />
@@ -55,21 +55,18 @@
5555
<Resource Language="it-IT" />
5656
<Resource Language="ja-JP" />
5757
<Resource Language="ka" />
58-
<Resource Language="km-KH" />
5958
<Resource Language="ko-KR" />
60-
<Resource Language="lt-LT" />
61-
<Resource Language="lv-LV" />
62-
<Resource Language="ms-MY" />
59+
<Resource Language="lt" />
60+
<Resource Language="lv-LV" />
6361
<Resource Language="nb-NO" />
6462
<Resource Language="nl-NL" />
63+
<Resource Language="or-IN" />
6564
<Resource Language="pl-PL" />
6665
<Resource Language="pt-BR" />
6766
<Resource Language="pt-PT" />
6867
<Resource Language="ro-RO" />
6968
<Resource Language="ru-RU" />
70-
<Resource Language="sk-SK" />
71-
<Resource Language="sq-AL" />
72-
<Resource Language="sr-Cyrl" />
69+
<Resource Language="sk-SK" />
7370
<Resource Language="sv-SE" />
7471
<Resource Language="ta" />
7572
<Resource Language="th-TH" />
@@ -98,7 +95,7 @@
9895
Wide310x150Logo="Assets\AppTiles\Dev\Wide310x150Logo.png"
9996
Square71x71Logo="Assets\AppTiles\Dev\Small71x71Logo.png"
10097
Square310x310Logo="Assets\AppTiles\Dev\Large310x310Logo.png"
101-
ShortName="Files - Dev">
98+
ShortName="Files">
10299
<uap:ShowNameOnTiles>
103100
<uap:ShowOn Tile="square150x150Logo" />
104101
<uap:ShowOn Tile="wide310x150Logo" />
@@ -119,26 +116,12 @@
119116
</uap3:Extension>
120117

121118
<uap:Extension Category="windows.protocol">
122-
<!-- This is kept for backward compatibility. -->
123119
<uap:Protocol ReturnResults="none" Name="files-uwp" />
124120
</uap:Extension>
125121

126-
<uap:Extension Category="windows.protocol">
127-
<!-- This is kept for backward compatibility. -->
128-
<uap:Protocol ReturnResults="none" Name="files" />
129-
</uap:Extension>
130-
131-
<uap:Extension Category="windows.protocol">
132-
<!-- This value changes based on the build branch by CI (files-stable, files-preview, files-dev). -->
133-
<uap:Protocol ReturnResults="none" Name="files-dev" />
134-
</uap:Extension>
135-
136122
<uap5:Extension Category="windows.appExecutionAlias">
137123
<uap5:AppExecutionAlias>
138-
<!-- This is kept for backward compatibility. -->
139124
<uap5:ExecutionAlias Alias="files.exe" />
140-
<!-- This value changes based on the build branch by CI (files-stable, files-preview, files-dev). -->
141-
<uap5:ExecutionAlias Alias="files-dev.exe" />
142125
</uap5:AppExecutionAlias>
143126
</uap5:Extension>
144127

@@ -160,7 +143,6 @@
160143
<uap:FileType>.tar</uap:FileType>
161144
<uap:FileType>.jar</uap:FileType>
162145
<uap:FileType>.mrpack</uap:FileType>
163-
<uap:FileType>.gz</uap:FileType>
164146
</uap:SupportedFileTypes>
165147
<uap:Logo>assets\archives\ExtensionIcon.png</uap:Logo>
166148
</uap:FileTypeAssociation>
@@ -171,7 +153,7 @@
171153
</Application>
172154
</Applications>
173155

174-
<!-- To host The background task component, this activatable class entry must be added. -->
156+
<!-- To Host The Background Task Component, This Activatable Class Entry Must Be Added. -->
175157
<Extensions>
176158
<Extension Category="windows.activatableClass.inProcessServer">
177159
<InProcessServer>
@@ -184,6 +166,13 @@
184166
<Path>Files.App.Server\Files.App.Server.exe</Path>
185167
<Instancing>singleInstance</Instancing>
186168
<ActivatableClass ActivatableClassId="Files.App.Server.AppInstanceMonitor" />
169+
<ActivatableClass ActivatableClassId="Files.App.Server.Database.FileTagsDatabase" />
170+
<ActivatableClass ActivatableClassId="Files.App.Server.Database.LayoutPreferencesDatabase" />
171+
<ActivatableClass ActivatableClassId="Files.App.Server.Data.ColumnPreferences" />
172+
<ActivatableClass ActivatableClassId="Files.App.Server.Data.ColumnPreferencesItem" />
173+
<ActivatableClass ActivatableClassId="Files.App.Server.Data.TaggedFile" />
174+
<ActivatableClass ActivatableClassId="Files.App.Server.Data.LayoutPreferences" />
175+
<ActivatableClass ActivatableClassId="Files.App.Server.Data.LayoutPreferencesItem" />
187176
</OutOfProcessServer>
188177
</Extension>
189178
</Extensions>

src/Files.App/Utils/Storage/Enumerators/Win32StorageEnumerator.cs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
using Files.App.Services.SizeProvider;
55
using Files.Shared.Helpers;
66
using System.IO;
7+
using Vanara.PInvoke;
78
using Windows.Storage;
8-
using static Files.App.Helpers.Win32Helper;
9+
using static Files.App.Helpers.NativeFindStorageItemHelper;
910
using FileAttributes = System.IO.FileAttributes;
1011

1112
namespace Files.App.Utils.Storage
@@ -17,10 +18,11 @@ public static class Win32StorageEnumerator
1718

1819
private static readonly string folderTypeTextLocalized = "Folder".GetLocalizedResource();
1920

21+
2022
public static async Task<List<ListedItem>> ListEntries(
2123
string path,
2224
IntPtr hFile,
23-
Win32PInvoke.WIN32_FIND_DATA findData,
25+
NativeFindStorageItemHelper.WIN32_FIND_DATA findData,
2426
CancellationToken cancellationToken,
2527
int countLimit,
2628
Func<List<ListedItem>, Task> intermediateAction
@@ -97,16 +99,16 @@ Func<List<ListedItem>, Task> intermediateAction
9799
// clear the temporary list every time we do an intermediate action
98100
tempList.Clear();
99101
}
100-
} while (Win32PInvoke.FindNextFile(hFile, out findData));
102+
} while (FindNextFile(hFile, out findData));
101103

102-
Win32PInvoke.FindClose(hFile);
104+
FindClose(hFile);
103105

104106
return tempList;
105107
}
106108

107109
private static IEnumerable<ListedItem> EnumAdsForPath(string itemPath, ListedItem main)
108110
{
109-
foreach (var ads in Win32Helper.GetAlternateStreams(itemPath))
111+
foreach (var ads in NativeFileOperationsHelper.GetAlternateStreams(itemPath))
110112
yield return GetAlternateStream(ads, main);
111113
}
112114

@@ -143,7 +145,7 @@ public static ListedItem GetAlternateStream((string Name, long Size) ads, Listed
143145
}
144146

145147
public static async Task<ListedItem> GetFolder(
146-
Win32PInvoke.WIN32_FIND_DATA findData,
148+
NativeFindStorageItemHelper.WIN32_FIND_DATA findData,
147149
string pathRoot,
148150
bool isGitRepo,
149151
CancellationToken cancellationToken
@@ -157,10 +159,10 @@ CancellationToken cancellationToken
157159

158160
try
159161
{
160-
Win32PInvoke.FileTimeToSystemTime(ref findData.ftLastWriteTime, out Win32PInvoke.SYSTEMTIME systemModifiedTimeOutput);
162+
FileTimeToSystemTime(ref findData.ftLastWriteTime, out NativeFindStorageItemHelper.SYSTEMTIME systemModifiedTimeOutput);
161163
itemModifiedDate = systemModifiedTimeOutput.ToDateTime();
162164

163-
Win32PInvoke.FileTimeToSystemTime(ref findData.ftCreationTime, out Win32PInvoke.SYSTEMTIME systemCreatedTimeOutput);
165+
FileTimeToSystemTime(ref findData.ftCreationTime, out NativeFindStorageItemHelper.SYSTEMTIME systemCreatedTimeOutput);
164166
itemCreatedDate = systemCreatedTimeOutput.ToDateTime();
165167
}
166168
catch (ArgumentException)
@@ -220,7 +222,7 @@ CancellationToken cancellationToken
220222
}
221223

222224
public static async Task<ListedItem> GetFile(
223-
Win32PInvoke.WIN32_FIND_DATA findData,
225+
NativeFindStorageItemHelper.WIN32_FIND_DATA findData,
224226
string pathRoot,
225227
bool isGitRepo,
226228
CancellationToken cancellationToken
@@ -233,13 +235,13 @@ CancellationToken cancellationToken
233235

234236
try
235237
{
236-
Win32PInvoke.FileTimeToSystemTime(ref findData.ftLastWriteTime, out Win32PInvoke.SYSTEMTIME systemModifiedDateOutput);
238+
FileTimeToSystemTime(ref findData.ftLastWriteTime, out NativeFindStorageItemHelper.SYSTEMTIME systemModifiedDateOutput);
237239
itemModifiedDate = systemModifiedDateOutput.ToDateTime();
238240

239-
Win32PInvoke.FileTimeToSystemTime(ref findData.ftCreationTime, out Win32PInvoke.SYSTEMTIME systemCreatedDateOutput);
241+
FileTimeToSystemTime(ref findData.ftCreationTime, out NativeFindStorageItemHelper.SYSTEMTIME systemCreatedDateOutput);
240242
itemCreatedDate = systemCreatedDateOutput.ToDateTime();
241243

242-
Win32PInvoke.FileTimeToSystemTime(ref findData.ftLastAccessTime, out Win32PInvoke.SYSTEMTIME systemLastAccessOutput);
244+
FileTimeToSystemTime(ref findData.ftLastAccessTime, out NativeFindStorageItemHelper.SYSTEMTIME systemLastAccessOutput);
243245
itemLastAccessDate = systemLastAccessOutput.ToDateTime();
244246
}
245247
catch (ArgumentException)
@@ -270,12 +272,12 @@ CancellationToken cancellationToken
270272

271273
// https://learn.microsoft.com/openspecs/windows_protocols/ms-fscc/c8e77b37-3909-4fe6-a4ea-2b9d423b1ee4
272274
bool isReparsePoint = ((FileAttributes)findData.dwFileAttributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint;
273-
bool isSymlink = isReparsePoint && findData.dwReserved0 == Win32PInvoke.IO_REPARSE_TAG_SYMLINK;
275+
bool isSymlink = isReparsePoint && findData.dwReserved0 == NativeFileOperationsHelper.IO_REPARSE_TAG_SYMLINK;
274276

275-
if (isSymlink && !isGitRepo)
277+
if (isSymlink)
276278
{
277279
var targetPath = Win32Helper.ParseSymLink(itemPath);
278-
280+
279281
return new ShortcutItem(null)
280282
{
281283
PrimaryItemAttribute = StorageItemTypes.File,
@@ -294,7 +296,7 @@ CancellationToken cancellationToken
294296
FileSizeBytes = itemSizeBytes,
295297
TargetPath = targetPath,
296298
IsSymLink = true
297-
};
299+
};
298300
}
299301
else if (FileExtensionHelpers.IsShortcutOrUrlFile(findData.cFileName))
300302
{

0 commit comments

Comments
 (0)