Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed Sep 5, 2023
2 parents 85612c8 + 0f5c5b6 commit bf37a0c
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 19 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

## v2.x

### v2.5.1
### v2.5.2

Released on 2023-09-06

- Update wimlib binaries to 1.14.3.

### v2.5.2

Released on 2023-08-08
Released on 2023-08-09

- Update to wimlib 1.14.2.
- Update wimlib binaries to 1.14.2.

### v2.5.1

Released on 2023-08-01

- Update to wimlib 1.14.1.
- Update wimlib binaries to 1.14.1.

### v2.5.0

Expand Down
2 changes: 1 addition & 1 deletion ManagedWimLib.Tests/ManagedWimLib.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ManagedWimLib/ManagedWimLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Supports Windows, Linux and macOS.</Description>
</PropertyGroup>
<!-- PackageReference -->
<ItemGroup>
<PackageReference Include="Joveler.DynLoader" Version="2.2.0" />
<PackageReference Include="Joveler.DynLoader" Version="2.3.0" />
<PackageReference Include="System.Memory" Version="4.5.5" Condition=" '$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'netstandard2.0' " />
<!-- <PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" Condition=" '$(TargetFramework)' == 'net46' " /> -->
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ManagedWimLib/NUGET_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Cross-platform [wimlib](https://wimlib.net) pinvoke library for .NET.

### Supported wimlib version

- 1.14.2 (Included)
- 1.14.3 (Included)

## Usage

Expand Down
1 change: 0 additions & 1 deletion ManagedWimLib/NativeStructs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ You should have received a copy of the GNU Lesser General Public License
using Joveler.DynLoader;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;

Expand Down
1 change: 0 additions & 1 deletion ManagedWimLib/ProgressCallback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ You should have received a copy of the GNU Lesser General Public License

using Joveler.DynLoader;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
// ReSharper disable FieldCanBeMadeReadOnly.Local
// ReSharper disable InconsistentNaming
Expand Down
2 changes: 1 addition & 1 deletion ManagedWimLib/WimLibLoadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License

namespace ManagedWimLib
{
internal class WimLibLoadManager : LoadManagerBase<WimLibLoader>
internal sealed class WimLibLoadManager : LoadManagerBase<WimLibLoader>
{
protected override string ErrorMsgInitFirst => "Please call Wim.GlobalInit() first!";
protected override string ErrorMsgAlreadyLoaded => "ManagedWimLib is already initialized.";
Expand Down
2 changes: 1 addition & 1 deletion ManagedWimLib/WimLibLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You should have received a copy of the GNU Lesser General Public License

namespace ManagedWimLib
{
internal class WimLibLoader : DynLoaderBase
internal sealed class WimLibLoader : DynLoaderBase
{
#region Const
internal const string MsgErrorFileNotSet = "ErrorFile is not set unable to read last error.";
Expand Down
64 changes: 57 additions & 7 deletions ManagedWimLib/WimStruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ You should have received a copy of the GNU Lesser General Public License
using Joveler.DynLoader;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
Expand All @@ -36,25 +35,76 @@ public class Wim : IDisposable
#region (static) LoadManager
internal static WimLibLoadManager Manager = new WimLibLoadManager();
internal static WimLibLoader Lib => Manager.Lib;
internal static object _libLock = new object();
#endregion

#region (static) GlobalInit, GlobalCleanup
/// <summary>
/// Load system default wimlib library.
/// </summary>
public static void GlobalInit() => GlobalInit(InitFlags.None);
/// <summary>
/// Load system default wimlib library with given flags.
/// </summary>
/// <param name="flags">Flags to be passed to wimlib.</param>
public static void GlobalInit(InitFlags flags)
{
Manager.GlobalInit();
Lib.GlobalInit(flags);
lock (_libLock)
{
Manager.GlobalInit();
Lib.GlobalInit(flags);
}
}
/// <summary>
/// Load given wimlib library.
/// </summary>
/// <param name="libPath">The path to the libary file.</param>
public static void GlobalInit(string libPath) => GlobalInit(libPath, InitFlags.None);
/// <summary>
/// Load given wimlib library with given flags.
/// </summary>
/// <param name="libPath">The path to the libary file.</param>
/// <param name="flags">Flags to be passed to wimlib.</param>
public static void GlobalInit(string libPath, InitFlags flags)
{
Manager.GlobalInit(libPath);
Lib.GlobalInit(flags);
lock (_libLock)
{
Manager.GlobalInit(libPath);
Lib.GlobalInit(flags);
}
}
/// <summary>
/// Cleanup loaded wimlib library.
/// Throws InvalidOperationException when the wimlib library was not loaded.
/// </summary>
public static void GlobalCleanup()
{
Lib.GlobalCleanup();
Manager.GlobalCleanup();
lock (_libLock)
{
if (Lib.GlobalCleanup == null)
throw new InvalidOperationException("Please load wimlib library first.");

Lib.GlobalCleanup();
Manager.GlobalCleanup();
}
}
/// <summary>
/// Cleanup loaded wimlib library.
/// Returns queitly when the wimlib lirary was not loaded.
/// </summary>
/// <remarks>
/// Returns true when the library was successfully unloaded.
/// </remarks>
public static bool TryGlobalCleanup()
{
lock (_libLock)
{
if (Lib.GlobalCleanup == null)
return false;

Lib.GlobalCleanup();
return Manager.TryGlobalCleanup();
}
}
#endregion

Expand Down
Binary file modified ManagedWimLib/runtimes/linux-arm/native/libwim.so
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/linux-arm64/native/libwim.so
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/linux-x64/native/libwim.so
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/osx-arm64/native/libwim.dylib
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/osx-x64/native/libwim.dylib
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-arm64/native/libwim-15.dll
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-x64/native/libwim-15.dll
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-x86/native/libwim-15.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ManagedWimLib can be installed via [nuget](https://www.nuget.org/packages/Manage

### Supported wimlib version

- 1.14.2 (Included)
- 1.14.3 (Included)

## Usage

Expand Down

0 comments on commit bf37a0c

Please sign in to comment.