Pls Help H1 UnZipRawMemory Issue Topic is solved

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
joreli
Posts: 8
Joined: 13 Jul 2021, 15:33

Pls Help H1 UnZipRawMemory Issue

29 Oct 2021, 07:04

Hi,

With the latest version 1.1.33.10-H004 (x64W haven`t tested with other variants), UnZipRawMemory function is not working. Below is my test code

Code: Select all

FileGetSize, Sz, %A_ScriptFullPath%
MsgBox, % "Org Size: " Sz

FileRead, Data, *c %A_ScriptFullPath%
MsgBox, % "Org Data:`n" StrGet(&Data, "UTF-8")

;VarSetCapacity(Bin, Sz, 0)
CompSize := ZipRawMemory(&Data, sizeOfvar, Bin)
MsgBox, % "Comp Size: " CompSize
MsgBox, % "Comp Data:`n" StrGet(&Bin, "UTF-8")

;VarSetCapacity(Var, Sz*2, 0)
UnCompSize := UnZipRawMemory(&Bin, CompSize, var)
;UnCompSize := UnZipRawMemory(&Bin, CompSize, &var)
MsgBox, % "UnCompSize: " UnCompSize
MsgBox, % "UnCompressed Data:`n" StrGet(&Var, "UTF-8")
;MsgBox, % "UnCompressed Data:`n" StrGet(&Var, "CP0")
;MsgBox, % "UnCompressed Data:`n" StrGet(&Var)
Both UnCompressed Size and Data are blank.

Please Help. Thank You.
joreli
Posts: 8
Joined: 13 Jul 2021, 15:33

Re: Pls Help H1 UnZipRawMemory Issue  Topic is solved

29 Oct 2021, 07:15

Sorry. Silly Mistake.. My Bad

Changing this line

Code: Select all

CompSize := ZipRawMemory(&Data, sizeOfvar, Bin)
to this

Code: Select all

CompSize := ZipRawMemory(&Data, Sz, Bin)
fixed the problem.

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 5 guests