#include <array.au3> #include <string.au3> Const $ERAR_END_ARCHIVE = 10 Const $ERAR_NO_MEMORY = 11 Const $ERAR_BAD_DATA = 12 Const $ERAR_BAD_ARCHIVE = 13 Const $ERAR_UNKNOWN_FORMAT = 14 Const $ERAR_EOPEN = 15 Const $ERAR_ECREATE = 16 Const $ERAR_ECLOSE = 17 Const $ERAR_EREAD = 18 Const $ERAR_EWRITE = 19 Const $ERAR_SMALL_BUF = 20 Const $RAR_OM_LIST = 0 Const $RAR_OM_EXTRACT = 1 Const $RAR_SKIP = 0 Const $RAR_TEST = 1 Const $RAR_EXTRACT = 2 Const $RAR_VOL_ASK = 0 Const $RAR_VOL_NOTIFY = 1 $rar_open_arcname = DllStructCreate("char[260]") if @error Then MsgBox(0,"","Error in DllStructCreate " & @error); exit endif DllStructSetData($rar_open_arcname,1,'e:\test.rar') $rar_open_cmtbuf = DllStructCreate("char[16384]") if @error Then MsgBox(0,"","Error in DllStructCreate " & @error); exit endif DllStructSetData($rar_open_cmtbuf,1,_StringRepeat(" ",16384)) $rar_open_str = DllStructCreate("ptr;uint;uint;ptr;uint;uint;uint") if @error Then MsgBox(0,"","Error in DllStructCreate " & @error); exit endif DllStructSetData($rar_open_str,1,DllStructGetPtr($rar_open_arcname)) DllStructSetData($rar_open_str,2,$RAR_OM_LIST) DllStructSetData($rar_open_str,3,0) DllStructSetData($rar_open_str,4,DllStructGetPtr($rar_open_cmtbuf)) DllStructSetData($rar_open_str,5,16384) DllStructSetData($rar_open_str,6,0) DllStructSetData($rar_open_str,7,0) $rar_hdr_cmtbuf = DllStructCreate("char[16384]") if @error Then MsgBox(0,"","Error in DllStructCreate " & @error); exit endif DllStructSetData($rar_hdr_cmtbuf,1,_StringRepeat(" ",16384)) $rar_header_str = DllStructCreate("char[260];char[260];uint;uint;uint;uint;uint;uint;uint;uint;uint;ptr;uint;uint;uint") if @error Then MsgBox(0,"","Error in DllStructCreate " & @error); exit endif DllStructSetData($rar_header_str,1,"") DllStructSetData($rar_header_str,2,"") DllStructSetData($rar_header_str,3,0) DllStructSetData($rar_header_str,4,0) DllStructSetData($rar_header_str,5,0) DllStructSetData($rar_header_str,6,0) DllStructSetData($rar_header_str,7,0) DllStructSetData($rar_header_str,8,0) DllStructSetData($rar_header_str,9,0) DllStructSetData($rar_header_str,10,0) DllStructSetData($rar_header_str,11,0) DllStructSetData($rar_header_str,12,DllStructGetPtr($rar_hdr_cmtbuf)) DllStructSetData($rar_header_str,13,16384) DllStructSetData($rar_header_str,14,0) DllStructSetData($rar_header_str,15,0) $rar_handle = DllCall("E:\progz\Unrar\unrar.dll","int","RAROpenArchive","ptr",DllStructGetPtr($rar_open_str)) $aa = DllStructGetData($rar_open_str,1) $bb = DllStructGetData($rar_open_str,2) $cc = DllStructGetData($rar_open_str,3) $dd = DllStructGetData($rar_open_str,4) $ee = DllStructGetData($rar_open_str,5) $ff = DllStructGetData($rar_open_str,6) $gg = DllStructGetData($rar_open_str,7) msgbox(0,"","aa: " & $aa & @CRLF & _ "bb: " & $bb & @CRLF & _ "cc: " & $cc & @CRLF & _ "dd: " & $dd & @CRLF & _ "ee: " & $ee & @CRLF & _ "ff: " & $ff & @CRLF & _ "gg: " & $gg) $rar_header = DllCall("E:\progz\Unrar\unrar.dll","int", "RARReadHeader", "int", $rar_handle, "ptr", DllStructGetPtr($rar_header_str)) $rar_ext = DllCall("E:\progz\Unrar\unrar.dll", "int", "RARProcessFile", "int", $rar_handle, "int", $RAR_EXTRACT, "char", "", "char", "") $rar_close = DllCall("E:\progz\Unrar\unrar.dll", "int", "RARCloseArchive", "Int", $rar_handle) _ArrayDisplay($rar_close,"") |