Koppew
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору #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 Func _RarInit($filename, $method) Global $rar_open_str, $rar_header_str $rar_open_arcname = DllStructCreate("char[260]") if @error Then MsgBox(0,"","Error in DllStructCreate " & @error); exit endif DllStructSetData($rar_open_arcname,1,$filename) $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,$method) 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) EndFunc Func _RarExtract($filename) _RarInit($filename, $RAR_OM_EXTRACT) $dll = DllOpen("e:\progz\unrar\unrar.dll") $rar_handle = DllCall($dll,"int","RAROpenArchive","ptr",DllStructGetPtr($rar_open_str)) Do $rar_header = DllCall($dll,"int", "RARReadHeader", "int", $rar_handle[0], "ptr", DllStructGetPtr($rar_header_str)) $rar_ext = DllCall($dll, "int", "RARProcessFile", "int", $rar_handle[0], "int", $RAR_EXTRACT, "ptr", "", "ptr", "") Until $rar_header[0] <> 0 $rar_close = DllCall($dll, "int", "RARCloseArchive", "Int", $rar_handle[0]) DllClose($dll) EndFunc _RarExtract("e:\test.rar") | Всего записей: 36 | Зарегистр. 14-09-2005 | Отправлено: 15:59 25-07-2007 | Исправлено: Koppew, 16:01 25-07-2007 |
|