Problemas al comprimir datos.

Iniciado por illuminat3d, 8 Abril 2010, 18:03 PM

0 Miembros y 1 Visitante están viendo este tema.

illuminat3d

Bueno estoy guiandome de un Tips de Leandro y de la MSDN, pero aun sigo teniendo problemas para comprimir los datos de una variable.

Código (vb) [Seleccionar]
Public Declare Function RtlGetCompressionWorkSpaceSize Lib "NTDLL" (ByVal flags As Integer, WorkSpaceSize As Long, UNKNOWN_PARAMETER As Long) As Long
Public Declare Function RtlCompressBuffer Lib "NTDLL" (ByVal flags As Integer, ByVal BuffUnCompressed As Long, ByVal UnCompSize As Long, ByVal BuffCompressed As Long, ByVal CompBuffSize As Long, ByVal UNKNOWN_PARAMETER As Long, OutputSize As Long, ByVal WorkSpace As Long) As Long
Public Declare Function RtlDecompressBuffer Lib "NTDLL" (ByVal flags As Integer, ByVal BuffUnCompressed As Long, ByVal UnCompSize As Long, ByVal BuffCompressed As Long, ByVal CompBuffSize As Long, OutputSize As Long) As Long


Public Function Compress(Data As String) As String
Dim lenCompress    As Long
Dim xWorkSpace     As Long
 
  RtlGetCompressionWorkSpaceSize 2, xWorkSpace, 0
  RtlCompressBuffer 2, VarPtr(Data), LenB(Data), VarPtr(Compress), LenB(Compress), 4096, lenCompress, xWorkSpace
  Debug.Print Len(Compress)
End Function


Que puede ser? x)

PD : Me crashea..