this code is for vb to call the unmanaged decompress function >>:
<DllImport("compress.dll", CallingConvention:=CallingConvention.Cdecl)> _
Public Shared Function lzo_compress(<Out()> ByVal decompressed_buffer As Byte(), ByVal decompressed_size As Integer, <[In]()> ByVal compressed_buffer As Byte(), ByVal compressed_size As Integer, ByVal type As Integer) As Integer
End Function
if the decompress Returns nulled or invalid data means the file ur decompressing does not use that type.
so to check if ur decompressing whent like it suposed to be, could be done like this :
'declare a varaible as integer to use for return result from the decompressor
Dim Result as Integer = lzo_decompress(buffer, buffer.Length, Decompressed, Length, 8)
if Result > -1 then msgbox("Succesfull Decompression") else msgbox("Failed decompressing file!")
if the decompressing when succesfully it will return the decompressed length else it will return a negative value. (-1)



















Reply With Quote






