I created the archive using ZipFileCreate() with a password.
I can successfully unzip the archive to a file with UnZip() and also successfully extract/view it with 7zip GUI app.
UnZipBuffer() will always throw exception stating "password incorrect".
This is the code for creating the archive
Code: Select all
text := "This is a test"
hZip := ZipCreateFile("test.zip", "12345")
ZipAddBuffer(hZip, &text, StrPut(text)*2, "test.txt")
ZipCloseFile(hZip)
Return
Code: Select all
;Extract to file ---WORKS
Size := UnZip("test.zip", "" , "test.txt", "unzipped.txt", "12345")
msgbox % "Success: " Size
;Unzip to memory --- ALWAYS EXCEPTION "PASSWORD INCORRECT"
Size := UnZipBuffer("test.zip", "test.txt", data, "12345")
msgbox % "Size: " Size "`nData: " data
Using AHK_H 1.1.33.10 x64 Unicode, Windows 10