diff --git a/PInvoke/Lz32/LzExpand.cs b/PInvoke/Lz32/LzExpand.cs
index 8538a841..b3a8d64c 100644
--- a/PInvoke/Lz32/LzExpand.cs
+++ b/PInvoke/Lz32/LzExpand.cs
@@ -404,7 +404,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/lzexpand/nf-lzexpand-lzinit INT LZInit( INT hfSource );
[DllImport(Lib_Lz32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("lzexpand.h", MSDNShortId = "NF:lzexpand.LZInit")]
- public static extern int LZInit(/*HFILE*/ int hfSource);
+ public static extern HLZFILE LZInit(/*HFILE*/ int hfSource);
/// Creates, opens, reopens, or deletes the specified file.
/// The name of the file.
@@ -587,7 +587,7 @@ namespace Vanara.PInvoke
// lpReOpenBuf, WORD wStyle );
[DllImport(Lib_Lz32, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("lzexpand.h", MSDNShortId = "NF:lzexpand.LZOpenFileA")]
- public static extern int LZOpenFile([In, MarshalAs(UnmanagedType.LPTStr)] string lpFileName, ref OFSTRUCT lpReOpenBuf, LZ_OF wStyle);
+ public static extern HLZFILE LZOpenFile([In, MarshalAs(UnmanagedType.LPTStr)] string lpFileName, ref OFSTRUCT lpReOpenBuf, LZ_OF wStyle);
/// Reads (at most) the specified number of bytes from a file and copies them into a buffer.
/// A handle to the file.
@@ -767,7 +767,7 @@ namespace Vanara.PInvoke
/// Provides a handle to a compressed file.
[StructLayout(LayoutKind.Sequential)]
- public struct HLZFILE : IHandle
+ public readonly struct HLZFILE : IHandle
{
private readonly int handle;
diff --git a/UnitTests/PInvoke/Lz32/Lz32.csproj b/UnitTests/PInvoke/Lz32/Lz32.csproj
new file mode 100644
index 00000000..dc3feb4c
--- /dev/null
+++ b/UnitTests/PInvoke/Lz32/Lz32.csproj
@@ -0,0 +1,9 @@
+
+
+ UnitTest.PInvoke.Lz32
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/UnitTests/PInvoke/Lz32/Lz32Tests.cs b/UnitTests/PInvoke/Lz32/Lz32Tests.cs
new file mode 100644
index 00000000..725e79e7
--- /dev/null
+++ b/UnitTests/PInvoke/Lz32/Lz32Tests.cs
@@ -0,0 +1,19 @@
+using NUnit.Framework;
+using System.Runtime.InteropServices;
+using static Vanara.PInvoke.Lz32;
+
+namespace Vanara.PInvoke.Tests;
+
+[TestFixture]
+public class Lz32Tests
+{
+ [Test]
+ public void Test()
+ {
+ OFSTRUCT openStruct = new() { cBytes = (byte)Marshal.SizeOf(typeof(OFSTRUCT)) };
+ var hSrc = LZOpenFile(@"C:\Windows\IME\IMETC\HELP\IMTCEN14.CHM", ref openStruct, LZ_OF.OF_READ);
+ Assert.That((int)hSrc, Is.GreaterThanOrEqualTo(0));
+ openStruct.WriteValues();
+ LZClose(hSrc);
+ }
+}
\ No newline at end of file
diff --git a/Vanara.sln b/Vanara.sln
index a819d086..213425a8 100644
--- a/Vanara.sln
+++ b/Vanara.sln
@@ -414,7 +414,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreAudio", "UnitTests\PInv
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.CoreAudio", "PInvoke\CoreAudio\Vanara.PInvoke.CoreAudio.csproj", "{D3085D14-8745-4174-8D16-102615E2CE60}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vanara.PInvoke.Avrt", "PInvoke\Avrt\Vanara.PInvoke.Avrt.csproj", "{20C67C75-BCD0-4AFC-8C69-32C11450D7FA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.Avrt", "PInvoke\Avrt\Vanara.PInvoke.Avrt.csproj", "{20C67C75-BCD0-4AFC-8C69-32C11450D7FA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lz32", "UnitTests\PInvoke\Lz32\Lz32.csproj", "{3A6782D5-E72D-4546-81D6-EBA19A08D9E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -3649,6 +3651,23 @@ Global
{20C67C75-BCD0-4AFC-8C69-32C11450D7FA}.Release|x64.Build.0 = Release|x64
{20C67C75-BCD0-4AFC-8C69-32C11450D7FA}.Release|x86.ActiveCfg = Release|x86
{20C67C75-BCD0-4AFC-8C69-32C11450D7FA}.Release|x86.Build.0 = Release|x86
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Debug|x64.ActiveCfg = Debug|x64
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Debug|x64.Build.0 = Debug|x64
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Debug|x86.ActiveCfg = Debug|x86
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Debug|x86.Build.0 = Debug|x86
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.DebugNoTests|Any CPU.ActiveCfg = DebugNoTests|Any CPU
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.DebugNoTests|Any CPU.Build.0 = DebugNoTests|Any CPU
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.DebugNoTests|x64.ActiveCfg = DebugNoTests|x64
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.DebugNoTests|x64.Build.0 = DebugNoTests|x64
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.DebugNoTests|x86.ActiveCfg = DebugNoTests|x86
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.DebugNoTests|x86.Build.0 = DebugNoTests|x86
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Release|x64.ActiveCfg = Release|x64
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Release|x64.Build.0 = Release|x64
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Release|x86.ActiveCfg = Release|x86
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -3836,6 +3855,7 @@ Global
{B5EBAECC-D3F1-4388-8A2B-634F5A0014B9} = {385CAD2D-0A5E-4F80-927B-D5499D126B90}
{D3085D14-8745-4174-8D16-102615E2CE60} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{20C67C75-BCD0-4AFC-8C69-32C11450D7FA} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
+ {3A6782D5-E72D-4546-81D6-EBA19A08D9E3} = {385CAD2D-0A5E-4F80-927B-D5499D126B90}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {543FAC75-2AF1-4EF1-9609-B242B63FEED4}