Skip to content

Commit

Permalink
Backport UpdateCommand{32,64} patch from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed Oct 14, 2018
1 parent 9c2936c commit b0d78b6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ManagedWimLib/ManagedWimLib.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<metadata>
<id>ManagedWimLib</id>
<title>ManagedWimLib</title>
<version>1.1.1</version>
<version>1.1.2</version>
<owners>ied206</owners>
<authors>Eric Biggers, Hajin Jang</authors>
<licenseUrl>https://github.com/ied206/ManagedWimLib/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/ied206/ManagedWimLib</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>C# pinvoke library for wimlib.</description>
<summary>C# pinvoke library for wimlib.</summary>
<releaseNotes>- Fix Wim.GetErrorString() to report correct error message</releaseNotes>
<releaseNotes>- Fix stack corruption at Wim.UpdateImage().</releaseNotes>
<copyright>Copyright (c) 2018 Hajin Jang</copyright>
<tags>wimlib</tags>
<dependencies>
Expand Down
42 changes: 30 additions & 12 deletions ManagedWimLib/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2684,12 +2684,21 @@ public string RenWimTargetPath
#region Free
public void Free()
{
FreePtr(ref AddFsSourcePathPtr);
FreePtr(ref AddWimTargetPathPtr);
FreePtr(ref AddConfigFilePtr);
FreePtr(ref DelWimPathPtr);
FreePtr(ref RenWimSourcePathPtr);
FreePtr(ref RenWimTargetPathPtr);
switch (Op)
{
case UpdateOp.ADD:
FreePtr(ref AddFsSourcePathPtr);
FreePtr(ref AddWimTargetPathPtr);
FreePtr(ref AddConfigFilePtr);
break;
case UpdateOp.DELETE:
FreePtr(ref DelWimPathPtr);
break;
case UpdateOp.RENAME:
FreePtr(ref RenWimSourcePathPtr);
FreePtr(ref RenWimTargetPathPtr);
break;
}
}

internal void FreePtr(ref IntPtr ptr)
Expand Down Expand Up @@ -2823,12 +2832,21 @@ public string RenWimTargetPath
#region Free
public void Free()
{
FreePtr(ref AddFsSourcePathPtr);
FreePtr(ref AddWimTargetPathPtr);
FreePtr(ref AddConfigFilePtr);
FreePtr(ref DelWimPathPtr);
FreePtr(ref RenWimSourcePathPtr);
FreePtr(ref RenWimTargetPathPtr);
switch (Op)
{
case UpdateOp.ADD:
FreePtr(ref AddFsSourcePathPtr);
FreePtr(ref AddWimTargetPathPtr);
FreePtr(ref AddConfigFilePtr);
break;
case UpdateOp.DELETE:
FreePtr(ref DelWimPathPtr);
break;
case UpdateOp.RENAME:
FreePtr(ref RenWimSourcePathPtr);
FreePtr(ref RenWimTargetPathPtr);
break;
}
}

internal void FreePtr(ref IntPtr ptr)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ManagedWimLib

C# wrapper library for native [wimlib](https://wimlib.net).
C# pinvoke library for [wimlib](https://wimlib.net).

wimlib is a library handles Windows Imaging (WIM) archives, written by Eric Biggers.

Expand Down

0 comments on commit b0d78b6

Please sign in to comment.