Skip to content

Commit

Permalink
Merge pull request #35 from FreeTheTech101/master
Browse files Browse the repository at this point in the history
Fix "Not a valid Win32 FileTime" exception
  • Loading branch information
aerosoul94 committed Mar 31, 2024
2 parents f8b6842 + 85622ec commit 99a1937
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
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>

0 comments on commit 99a1937

Please sign in to comment.