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 "Not a valid Win32 FileTime" exception #35

Merged
merged 5 commits into from
Mar 31, 2024
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1
dotnet-version: 8.0

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
Expand Down
4 changes: 2 additions & 2 deletions FATX/FATX.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
</ItemGroup>

</Project>
8 changes: 7 additions & 1 deletion FATX/FileSystem/TimeStamp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class TimeStamp
{
private uint _Time;
private DateTime? _DateTime;
private readonly DateTime _minWinFileTime = new DateTime(1601, 01, 01);

public TimeStamp(uint time)
{
Expand Down Expand Up @@ -70,6 +71,11 @@ public DateTime AsDateTime()
{
if (this._DateTime.HasValue)
{
if (this._DateTime < _minWinFileTime)
{
return _minWinFileTime;
}

return this._DateTime.Value;
}
else
Expand Down Expand Up @@ -97,7 +103,7 @@ public DateTime AsDateTime()
}
catch (Exception)
{
_DateTime = DateTime.MinValue;
_DateTime = _minWinFileTime;
}

return _DateTime.Value;
Expand Down
4 changes: 2 additions & 2 deletions FATXTools/FATXTools.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<OutputType>WinExe</OutputType>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
Expand Down Expand Up @@ -71,7 +71,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.Text.Json">
<Version>4.7.2</Version>
<Version>8.0.3</Version>
</PackageReference>
</ItemGroup>
</Project>
Loading