react-native-update 10.34.2 → 10.34.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (908) hide show
  1. package/.gitmodules +4 -4
  2. package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +291 -0
  3. package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +48 -0
  4. package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +473 -0
  5. package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +552 -0
  6. package/harmony/pushy/src/main/cpp/HDiffPatch/README_cn.md +547 -0
  7. package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +127 -0
  8. package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +59 -0
  9. package/harmony/pushy/src/main/cpp/HDiffPatch/_dir_ignore.h +191 -0
  10. package/harmony/pushy/src/main/cpp/HDiffPatch/_hextobytes.h +112 -0
  11. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.cpp +389 -0
  12. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.h +73 -0
  13. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.c +266 -0
  14. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.h +58 -0
  15. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +190 -0
  16. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +8 -0
  17. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.bat +1 -0
  18. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.sh +1 -0
  19. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.bat +1 -0
  20. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.sh +1 -0
  21. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +49 -0
  22. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +31 -0
  23. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +38 -0
  24. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +26 -0
  25. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +155 -0
  26. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +364 -0
  27. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +348 -0
  28. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/bzip2.vcxproj +228 -0
  29. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/hpatchz_test.vcxproj +215 -0
  30. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/libdeflate.vcxproj +256 -0
  31. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/longPathAware.exe.manifest +7 -0
  32. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/lzma.vcxproj +271 -0
  33. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/testHashClash.vcxproj +228 -0
  34. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +296 -0
  35. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zlib.vcxproj +242 -0
  36. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zstd.vcxproj +287 -0
  37. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +39 -0
  38. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  39. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  40. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +447 -0
  41. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +703 -0
  42. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +463 -0
  43. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/libdeflate.xcodeproj/project.pbxproj +286 -0
  44. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lz4.xcodeproj/project.pbxproj +268 -0
  45. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +585 -0
  46. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +301 -0
  47. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +591 -0
  48. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zlib.xcodeproj/project.pbxproj +308 -0
  49. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +524 -0
  50. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.h +33 -0
  51. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.m +33 -0
  52. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj +774 -0
  53. package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +799 -0
  54. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +201 -0
  55. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +59 -0
  56. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +1526 -0
  57. package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +1637 -0
  58. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +846 -0
  59. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +79 -0
  60. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +339 -0
  61. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +190 -0
  62. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +339 -0
  63. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.h +87 -0
  64. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +43 -0
  65. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +836 -0
  66. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +246 -0
  67. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_private.h +47 -0
  68. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +112 -0
  69. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +69 -0
  70. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +65 -0
  71. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +346 -0
  72. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +149 -0
  73. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +176 -0
  74. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +84 -0
  75. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +146 -0
  76. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +61 -0
  77. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +152 -0
  78. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +76 -0
  79. package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +735 -0
  80. package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +240 -0
  81. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +1971 -0
  82. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.c +31 -0
  83. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.h +42 -0
  84. package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +307 -0
  85. package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +1786 -0
  86. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +1746 -0
  87. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +201 -0
  88. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_for_hpatch_lite.h +74 -0
  89. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +187 -0
  90. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp +478 -0
  91. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.h +222 -0
  92. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +383 -0
  93. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +73 -0
  94. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +184 -0
  95. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +88 -0
  96. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/config.h +89 -0
  97. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +325 -0
  98. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.cpp +10 -0
  99. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +97 -0
  100. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.cpp +14 -0
  101. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +108 -0
  102. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +186 -0
  103. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +780 -0
  104. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +579 -0
  105. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +415 -0
  106. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +144 -0
  107. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +164 -0
  108. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +148 -0
  109. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +769 -0
  110. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +97 -0
  111. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +954 -0
  112. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +299 -0
  113. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.cpp +168 -0
  114. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.h +44 -0
  115. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +72 -0
  116. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +130 -0
  117. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/qsort_parallel.h +125 -0
  118. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +428 -0
  119. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +133 -0
  120. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/checksum_plugin.h +52 -0
  121. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.c +243 -0
  122. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.h +51 -0
  123. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.c +153 -0
  124. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.h +54 -0
  125. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.c +158 -0
  126. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.h +49 -0
  127. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.c +294 -0
  128. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.h +59 -0
  129. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_patch_private_mt.h +217 -0
  130. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.c +349 -0
  131. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h +110 -0
  132. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +2643 -0
  133. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +253 -0
  134. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +245 -0
  135. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +361 -0
  136. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c +366 -0
  137. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.h +91 -0
  138. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_input_cache.h +31 -0
  139. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_types.h +106 -0
  140. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +170 -0
  141. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +250 -0
  142. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +67 -0
  143. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.c +497 -0
  144. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.h +106 -0
  145. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.cpp +254 -0
  146. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.h +39 -0
  147. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_sign_diff_type.h +37 -0
  148. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.cpp +62 -0
  149. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.h +44 -0
  150. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dict_decompress_plugin.h +156 -0
  151. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.cpp +440 -0
  152. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.h +88 -0
  153. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.cpp +332 -0
  154. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.h +48 -0
  155. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_types.h +198 -0
  156. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.cpp +697 -0
  157. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.h +74 -0
  158. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_private.h +262 -0
  159. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type.h +174 -0
  160. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type_private.h +174 -0
  161. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.cpp +252 -0
  162. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.h +67 -0
  163. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.cpp +680 -0
  164. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.h +137 -0
  165. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dict_compress_plugin.h +83 -0
  166. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.cpp +125 -0
  167. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.h +56 -0
  168. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/hsynz_plugin.h +55 -0
  169. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.cpp +147 -0
  170. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.h +38 -0
  171. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.cpp +354 -0
  172. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.h +76 -0
  173. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.cpp +521 -0
  174. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.h +69 -0
  175. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_hash_clash.h +122 -0
  176. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_private.h +66 -0
  177. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type.h +36 -0
  178. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type_private.h +81 -0
  179. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.cpp +247 -0
  180. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.h +71 -0
  181. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.cpp +351 -0
  182. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.h +42 -0
  183. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.cpp +124 -0
  184. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.h +38 -0
  185. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.cpp +203 -0
  186. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.h +55 -0
  187. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.cpp +79 -0
  188. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.h +66 -0
  189. package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +301 -0
  190. package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +291 -0
  191. package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +630 -0
  192. package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +889 -0
  193. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.cpp +628 -0
  194. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.h +95 -0
  195. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_code_table.h +78 -0
  196. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.c +950 -0
  197. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.h +72 -0
  198. package/harmony/pushy/src/main/cpp/lzma/Asm/arm/7zCrcOpt.asm +100 -0
  199. package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/7zAsm.S +181 -0
  200. package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/LzmaDecOpt.S +1487 -0
  201. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +341 -0
  202. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +258 -0
  203. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +742 -0
  204. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzFindOpt.asm +540 -0
  205. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +1339 -0
  206. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sha256Opt.asm +275 -0
  207. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sort.asm +860 -0
  208. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +523 -0
  209. package/harmony/pushy/src/main/cpp/lzma/C/7z.h +204 -0
  210. package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +89 -0
  211. package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +19 -0
  212. package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +1786 -0
  213. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.c +36 -0
  214. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +35 -0
  215. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf2.c +52 -0
  216. package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +464 -0
  217. package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +28 -0
  218. package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +199 -0
  219. package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +673 -0
  220. package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +443 -0
  221. package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +92 -0
  222. package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +199 -0
  223. package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +597 -0
  224. package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +27 -0
  225. package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.rc +55 -0
  226. package/harmony/pushy/src/main/cpp/lzma/C/7zWindows.h +101 -0
  227. package/harmony/pushy/src/main/cpp/lzma/C/7zip_gcc_c.mak +360 -0
  228. package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +429 -0
  229. package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +60 -0
  230. package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +1002 -0
  231. package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +605 -0
  232. package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +76 -0
  233. package/harmony/pushy/src/main/cpp/lzma/C/Asm_c.mak +12 -0
  234. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +290 -0
  235. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +332 -0
  236. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +506 -0
  237. package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +709 -0
  238. package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +105 -0
  239. package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +187 -0
  240. package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +14 -0
  241. package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +246 -0
  242. package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +970 -0
  243. package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +686 -0
  244. package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +169 -0
  245. package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +19 -0
  246. package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +99 -0
  247. package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +20 -0
  248. package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +1746 -0
  249. package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +160 -0
  250. package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +1422 -0
  251. package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +114 -0
  252. package/harmony/pushy/src/main/cpp/lzma/C/LzFindOpt.c +578 -0
  253. package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +34 -0
  254. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +493 -0
  255. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +121 -0
  256. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +1095 -0
  257. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +81 -0
  258. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +807 -0
  259. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +58 -0
  260. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +111 -0
  261. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +53 -0
  262. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +103 -0
  263. package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +1363 -0
  264. package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +237 -0
  265. package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +3150 -0
  266. package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +85 -0
  267. package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +42 -0
  268. package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +138 -0
  269. package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +604 -0
  270. package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +144 -0
  271. package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +1124 -0
  272. package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +202 -0
  273. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +169 -0
  274. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +1131 -0
  275. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +181 -0
  276. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +312 -0
  277. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +337 -0
  278. package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +127 -0
  279. package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +50 -0
  280. package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +492 -0
  281. package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +86 -0
  282. package/harmony/pushy/src/main/cpp/lzma/C/Sha256Opt.c +451 -0
  283. package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +268 -0
  284. package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +15 -0
  285. package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.c +835 -0
  286. package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.h +17 -0
  287. package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +812 -0
  288. package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +260 -0
  289. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +249 -0
  290. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsw +29 -0
  291. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +889 -0
  292. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.c +4 -0
  293. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +13 -0
  294. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +44 -0
  295. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +32 -0
  296. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +313 -0
  297. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +192 -0
  298. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsw +29 -0
  299. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/Precomp.h +13 -0
  300. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +30 -0
  301. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +21 -0
  302. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.def +4 -0
  303. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +206 -0
  304. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsw +29 -0
  305. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +15 -0
  306. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.c +4 -0
  307. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.h +13 -0
  308. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +59 -0
  309. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/resource.rc +3 -0
  310. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.c +4 -0
  311. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +13 -0
  312. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +657 -0
  313. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsp +231 -0
  314. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsw +29 -0
  315. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +44 -0
  316. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +40 -0
  317. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/resource.rc +5 -0
  318. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/setup.ico +0 -0
  319. package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +92 -0
  320. package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +542 -0
  321. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +140 -0
  322. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +26 -0
  323. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +261 -0
  324. package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +2876 -0
  325. package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +1384 -0
  326. package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +64 -0
  327. package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +385 -0
  328. package/harmony/pushy/src/main/cpp/lzma/C/var_clang.mak +11 -0
  329. package/harmony/pushy/src/main/cpp/lzma/C/var_clang_arm64.mak +12 -0
  330. package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x64.mak +11 -0
  331. package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x86.mak +11 -0
  332. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc.mak +12 -0
  333. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_arm64.mak +12 -0
  334. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x64.mak +10 -0
  335. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x86.mak +10 -0
  336. package/harmony/pushy/src/main/cpp/lzma/C/var_mac_arm64.mak +11 -0
  337. package/harmony/pushy/src/main/cpp/lzma/C/var_mac_x64.mak +11 -0
  338. package/harmony/pushy/src/main/cpp/lzma/C/warn_clang.mak +1 -0
  339. package/harmony/pushy/src/main/cpp/lzma/C/warn_clang_mac.mak +1 -0
  340. package/harmony/pushy/src/main/cpp/lzma/C/warn_gcc.mak +51 -0
  341. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +240 -0
  342. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip_gcc.mak +1370 -0
  343. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +10 -0
  344. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
  345. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
  346. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
  347. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +73 -0
  348. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +721 -0
  349. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +95 -0
  350. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
  351. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
  352. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
  353. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +795 -0
  354. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +178 -0
  355. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
  356. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
  357. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +156 -0
  358. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +1764 -0
  359. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +454 -0
  360. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +207 -0
  361. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
  362. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +346 -0
  363. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
  364. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +26 -0
  365. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
  366. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
  367. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
  368. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +3088 -0
  369. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
  370. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
  371. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +11 -0
  372. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +14 -0
  373. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +21 -0
  374. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
  375. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
  376. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
  377. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
  378. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
  379. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
  380. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
  381. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
  382. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
  383. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
  384. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
  385. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
  386. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +86 -0
  387. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
  388. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
  389. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
  390. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
  391. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +11 -0
  392. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +175 -0
  393. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +754 -0
  394. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Icons/7z.ico +0 -0
  395. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +608 -0
  396. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +353 -0
  397. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +11 -0
  398. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +1452 -0
  399. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +11 -0
  400. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +12 -0
  401. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
  402. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
  403. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
  404. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
  405. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +168 -0
  406. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile.gcc +279 -0
  407. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
  408. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
  409. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
  410. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
  411. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
  412. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
  413. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
  414. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +121 -0
  415. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
  416. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +817 -0
  417. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
  418. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
  419. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
  420. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
  421. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
  422. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
  423. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
  424. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp +715 -0
  425. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
  426. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
  427. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
  428. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
  429. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
  430. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
  431. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +137 -0
  432. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
  433. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
  434. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
  435. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
  436. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
  437. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
  438. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
  439. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
  440. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +371 -0
  441. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
  442. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
  443. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
  444. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
  445. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
  446. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
  447. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
  448. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
  449. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
  450. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
  451. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
  452. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
  453. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +159 -0
  454. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
  455. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
  456. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +358 -0
  457. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +182 -0
  458. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +548 -0
  459. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +200 -0
  460. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
  461. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +10 -0
  462. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +923 -0
  463. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +205 -0
  464. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +577 -0
  465. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +201 -0
  466. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +182 -0
  467. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +121 -0
  468. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
  469. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +45 -0
  470. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +393 -0
  471. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +221 -0
  472. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.cpp +3 -0
  473. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +6 -0
  474. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.cpp +3 -0
  475. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +10 -0
  476. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +765 -0
  477. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +349 -0
  478. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.cpp +855 -0
  479. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.h +160 -0
  480. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +37 -0
  481. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +22 -0
  482. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +111 -0
  483. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +133 -0
  484. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +51 -0
  485. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +33 -0
  486. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +117 -0
  487. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +80 -0
  488. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +106 -0
  489. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +11 -0
  490. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +151 -0
  491. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +78 -0
  492. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +290 -0
  493. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +146 -0
  494. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +101 -0
  495. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +31 -0
  496. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +57 -0
  497. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +41 -0
  498. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +47 -0
  499. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +24 -0
  500. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
  501. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +127 -0
  502. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
  503. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +24 -0
  504. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +37 -0
  505. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +17 -0
  506. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +106 -0
  507. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +59 -0
  508. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +58 -0
  509. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +91 -0
  510. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +378 -0
  511. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +153 -0
  512. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +34 -0
  513. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyRegister.cpp +15 -0
  514. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
  515. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
  516. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
  517. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
  518. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
  519. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
  520. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
  521. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +113 -0
  522. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
  523. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +45 -0
  524. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
  525. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
  526. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +87 -0
  527. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
  528. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +49 -0
  529. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
  530. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +11 -0
  531. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +151 -0
  532. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +86 -0
  533. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +243 -0
  534. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +35 -0
  535. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +8 -0
  536. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +8 -0
  537. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +315 -0
  538. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +130 -0
  539. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
  540. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +277 -0
  541. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +122 -0
  542. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
  543. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +241 -0
  544. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +41 -0
  545. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +11 -0
  546. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +119 -0
  547. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +243 -0
  548. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +480 -0
  549. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +76 -0
  550. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +54 -0
  551. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +20 -0
  552. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +210 -0
  553. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzFindOpt.mak +7 -0
  554. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +7 -0
  555. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec_gcc.mak +14 -0
  556. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersion.h +2 -0
  557. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +2 -0
  558. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +178 -0
  559. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sha256.mak +13 -0
  560. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sort.mak +6 -0
  561. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/SubBuild.mak +3 -0
  562. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
  563. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
  564. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
  565. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
  566. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
  567. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +29 -0
  568. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
  569. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/resource.rc +3 -0
  570. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1799 -0
  571. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
  572. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3077 -0
  573. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +641 -0
  574. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
  575. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +16 -0
  576. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +398 -0
  577. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
  578. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +5026 -0
  579. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +121 -0
  580. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
  581. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +11 -0
  582. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +407 -0
  583. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
  584. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
  585. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +27 -0
  586. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +575 -0
  587. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +107 -0
  588. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +44 -0
  589. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +296 -0
  590. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
  591. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
  592. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +322 -0
  593. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
  594. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +1337 -0
  595. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
  596. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +3702 -0
  597. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +469 -0
  598. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +745 -0
  599. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
  600. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +14 -0
  601. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
  602. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +10 -0
  603. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
  604. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +10 -0
  605. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +11 -0
  606. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
  607. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +19 -0
  608. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +1931 -0
  609. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +221 -0
  610. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
  611. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +66 -0
  612. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +1069 -0
  613. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
  614. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +302 -0
  615. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +27 -0
  616. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +74 -0
  617. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
  618. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
  619. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +30 -0
  620. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
  621. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
  622. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +14 -0
  623. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +46 -0
  624. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +16 -0
  625. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
  626. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
  627. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +946 -0
  628. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
  629. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +426 -0
  630. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +58 -0
  631. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +1417 -0
  632. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +42 -0
  633. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +1635 -0
  634. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +235 -0
  635. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
  636. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
  637. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
  638. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
  639. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
  640. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +11 -0
  641. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +998 -0
  642. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
  643. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
  644. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
  645. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +68 -0
  646. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile.gcc +187 -0
  647. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/resource.rc +7 -0
  648. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
  649. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
  650. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
  651. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
  652. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
  653. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
  654. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
  655. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
  656. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
  657. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1272 -0
  658. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
  659. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
  660. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
  661. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
  662. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
  663. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
  664. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
  665. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
  666. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
  667. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
  668. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
  669. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
  670. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
  671. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
  672. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
  673. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
  674. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
  675. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
  676. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
  677. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1483 -0
  678. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
  679. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
  680. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
  681. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
  682. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
  683. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
  684. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
  685. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
  686. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
  687. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +351 -0
  688. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
  689. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +199 -0
  690. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
  691. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
  692. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +59 -0
  693. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +421 -0
  694. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
  695. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
  696. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
  697. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
  698. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
  699. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
  700. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +27 -0
  701. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/resource2.h +2 -0
  702. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang.mak +3 -0
  703. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_arm64.mak +3 -0
  704. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x64.mak +3 -0
  705. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x86.mak +3 -0
  706. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc.mak +3 -0
  707. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
  708. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x64.mak +3 -0
  709. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x86.mak +3 -0
  710. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_arm64.mak +3 -0
  711. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_x64.mak +3 -0
  712. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang.mak +11 -0
  713. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_arm64.mak +19 -0
  714. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x64.mak +11 -0
  715. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x86.mak +11 -0
  716. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc.mak +12 -0
  717. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_arm64.mak +12 -0
  718. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x64.mak +11 -0
  719. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x86.mak +10 -0
  720. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_arm64.mak +13 -0
  721. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_x64.mak +11 -0
  722. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang.mak +3 -0
  723. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang_mac.mak +9 -0
  724. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_gcc.mak +55 -0
  725. package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +252 -0
  726. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +46 -0
  727. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +7 -0
  728. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +3 -0
  729. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +6 -0
  730. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +21 -0
  731. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +231 -0
  732. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +63 -0
  733. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +28 -0
  734. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common0.h +330 -0
  735. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +77 -0
  736. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +16 -0
  737. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.cpp +93 -0
  738. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.h +41 -0
  739. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +76 -0
  740. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +215 -0
  741. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +54 -0
  742. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +30 -0
  743. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +150 -0
  744. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +18 -0
  745. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/LzFindPrepare.cpp +7 -0
  746. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +297 -0
  747. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +185 -0
  748. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +693 -0
  749. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +14 -0
  750. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +63 -0
  751. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +57 -0
  752. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +75 -0
  753. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +1842 -0
  754. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +1079 -0
  755. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +38 -0
  756. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +8 -0
  757. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.cpp +3 -0
  758. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +724 -0
  759. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +292 -0
  760. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +325 -0
  761. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +340 -0
  762. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +121 -0
  763. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Prepare.cpp +7 -0
  764. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +67 -0
  765. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +8 -0
  766. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +98 -0
  767. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +46 -0
  768. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +248 -0
  769. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +87 -0
  770. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +762 -0
  771. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +110 -0
  772. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +154 -0
  773. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +38 -0
  774. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +123 -0
  775. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +19 -0
  776. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +863 -0
  777. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +384 -0
  778. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +789 -0
  779. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +231 -0
  780. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Init.cpp +7 -0
  781. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +39 -0
  782. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +86 -0
  783. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.cpp +130 -0
  784. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.h +28 -0
  785. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +269 -0
  786. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +43 -0
  787. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +66 -0
  788. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +77 -0
  789. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +52 -0
  790. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +446 -0
  791. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +213 -0
  792. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +19 -0
  793. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.cpp +10 -0
  794. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +87 -0
  795. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +162 -0
  796. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +156 -0
  797. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +35 -0
  798. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +165 -0
  799. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +50 -0
  800. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +34 -0
  801. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +28 -0
  802. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +42 -0
  803. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +11 -0
  804. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +43 -0
  805. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +27 -0
  806. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +202 -0
  807. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +53 -0
  808. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +178 -0
  809. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +103 -0
  810. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +17 -0
  811. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +133 -0
  812. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +16 -0
  813. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +1362 -0
  814. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +172 -0
  815. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +1449 -0
  816. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +347 -0
  817. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +954 -0
  818. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +467 -0
  819. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +697 -0
  820. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.cpp +12 -0
  821. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +66 -0
  822. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +911 -0
  823. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +142 -0
  824. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +187 -0
  825. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +31 -0
  826. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +39 -0
  827. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.cpp +36 -0
  828. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.h +55 -0
  829. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +127 -0
  830. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +40 -0
  831. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +58 -0
  832. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +393 -0
  833. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +173 -0
  834. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +274 -0
  835. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +47 -0
  836. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +474 -0
  837. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +96 -0
  838. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +103 -0
  839. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +17 -0
  840. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +186 -0
  841. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +150 -0
  842. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +839 -0
  843. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +129 -0
  844. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +11 -0
  845. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +87 -0
  846. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +386 -0
  847. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +421 -0
  848. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +189 -0
  849. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.cpp +1251 -0
  850. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.h +19 -0
  851. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +46 -0
  852. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +467 -0
  853. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +146 -0
  854. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +179 -0
  855. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +363 -0
  856. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CRC.cs +55 -0
  857. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CommandLineParser.cs +274 -0
  858. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/InBuffer.cs +72 -0
  859. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/OutBuffer.cs +47 -0
  860. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/IMatchFinder.cs +24 -0
  861. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzBinTree.cs +367 -0
  862. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzInWindow.cs +132 -0
  863. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzOutWindow.cs +110 -0
  864. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaBase.cs +76 -0
  865. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaDecoder.cs +398 -0
  866. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaEncoder.cs +1480 -0
  867. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs +364 -0
  868. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln +20 -0
  869. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaBench.cs +340 -0
  870. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs +29 -0
  871. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs +70 -0
  872. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs +42 -0
  873. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoder.cs +234 -0
  874. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs +117 -0
  875. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs +157 -0
  876. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/ICoder.cs +157 -0
  877. package/harmony/pushy/src/main/cpp/lzma/DOC/7zC.txt +187 -0
  878. package/harmony/pushy/src/main/cpp/lzma/DOC/7zFormat.txt +469 -0
  879. package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +177 -0
  880. package/harmony/pushy/src/main/cpp/lzma/DOC/installer.txt +166 -0
  881. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +651 -0
  882. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +437 -0
  883. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-specification.txt +1176 -0
  884. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +345 -0
  885. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/CRC.java +52 -0
  886. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/BinTree.java +382 -0
  887. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/InWindow.java +131 -0
  888. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/OutWindow.java +85 -0
  889. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Base.java +88 -0
  890. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Decoder.java +329 -0
  891. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Encoder.java +1416 -0
  892. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java +55 -0
  893. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java +99 -0
  894. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Decoder.java +88 -0
  895. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Encoder.java +151 -0
  896. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/ICodeProgress.java +6 -0
  897. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaAlone.java +253 -0
  898. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaBench.java +392 -0
  899. package/harmony/pushy/src/main/cpp/lzma/bin/7zS2.sfx +0 -0
  900. package/harmony/pushy/src/main/cpp/lzma/bin/7zS2con.sfx +0 -0
  901. package/harmony/pushy/src/main/cpp/lzma/bin/7zSD.sfx +0 -0
  902. package/harmony/pushy/src/main/cpp/lzma/bin/7zdec.exe +0 -0
  903. package/harmony/pushy/src/main/cpp/lzma/bin/7zr.exe +0 -0
  904. package/harmony/pushy/src/main/cpp/lzma/bin/installer/config.txt +5 -0
  905. package/harmony/pushy/src/main/cpp/lzma/bin/installer/cr.bat +5 -0
  906. package/harmony/pushy/src/main/cpp/lzma/bin/lzma.exe +0 -0
  907. package/harmony/pushy/src/main/cpp/lzma/bin/x64/7zr.exe +0 -0
  908. package/package.json +1 -1
@@ -0,0 +1,3077 @@
1
+ // ArchiveExtractCallback.cpp
2
+
3
+ #include "StdAfx.h"
4
+
5
+ #undef sprintf
6
+ #undef printf
7
+
8
+ // #include <stdio.h>
9
+
10
+ #include "../../../../C/Alloc.h"
11
+ #include "../../../../C/CpuArch.h"
12
+
13
+ #include "../../../Common/ComTry.h"
14
+ #include "../../../Common/IntToString.h"
15
+ #include "../../../Common/StringConvert.h"
16
+ #include "../../../Common/UTFConvert.h"
17
+ #include "../../../Common/Wildcard.h"
18
+
19
+ #include "../../../Windows/ErrorMsg.h"
20
+ #include "../../../Windows/FileDir.h"
21
+ #include "../../../Windows/FileFind.h"
22
+ #include "../../../Windows/FileName.h"
23
+ #include "../../../Windows/PropVariant.h"
24
+ #include "../../../Windows/PropVariantConv.h"
25
+
26
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
27
+ #define Z7_USE_SECURITY_CODE
28
+ #include "../../../Windows/SecurityUtils.h"
29
+ #endif
30
+
31
+ #include "../../Common/FilePathAutoRename.h"
32
+ #include "../../Common/StreamUtils.h"
33
+
34
+ #include "../../Archive/Common/ItemNameUtils.h"
35
+
36
+ #include "../Common/ExtractingFilePath.h"
37
+ #include "../Common/PropIDUtils.h"
38
+
39
+ #include "ArchiveExtractCallback.h"
40
+
41
+ using namespace NWindows;
42
+ using namespace NFile;
43
+ using namespace NDir;
44
+
45
+ static const char * const kCantAutoRename = "Cannot create file with auto name";
46
+ static const char * const kCantRenameFile = "Cannot rename existing file";
47
+ static const char * const kCantDeleteOutputFile = "Cannot delete output file";
48
+ static const char * const kCantDeleteOutputDir = "Cannot delete output folder";
49
+ static const char * const kCantOpenOutFile = "Cannot open output file";
50
+ #ifndef Z7_SFX
51
+ static const char * const kCantOpenInFile = "Cannot open input file";
52
+ #endif
53
+ static const char * const kCantSetFileLen = "Cannot set length for output file";
54
+ #ifdef SUPPORT_LINKS
55
+ static const char * const kCantCreateHardLink = "Cannot create hard link";
56
+ static const char * const kCantCreateSymLink = "Cannot create symbolic link";
57
+ static const char * const k_HardLink_to_SymLink_Ignored = "Hard link to symbolic link was ignored";
58
+ static const char * const k_CantDelete_File_for_SymLink = "Cannot delete file for symbolic link creation";
59
+ static const char * const k_CantDelete_Dir_for_SymLink = "Cannot delete directory for symbolic link creation";
60
+ #endif
61
+
62
+ static const unsigned k_LinkDataSize_LIMIT = 1 << 12;
63
+
64
+ #ifdef SUPPORT_LINKS
65
+ #if WCHAR_PATH_SEPARATOR != L'/'
66
+ // we convert linux slashes to windows slashes for further processing.
67
+ // also we convert linux backslashes to BackslashReplacement character.
68
+ #define REPLACE_SLASHES_from_Linux_to_Sys(s) \
69
+ { NArchive::NItemName::ReplaceToWinSlashes(s, true); } // useBackslashReplacement
70
+ // { s.Replace(L'/', WCHAR_PATH_SEPARATOR); }
71
+ #else
72
+ #define REPLACE_SLASHES_from_Linux_to_Sys(s)
73
+ #endif
74
+ #endif
75
+
76
+ #ifndef Z7_SFX
77
+
78
+ Z7_COM7F_IMF(COutStreamWithHash::Write(const void *data, UInt32 size, UInt32 *processedSize))
79
+ {
80
+ HRESULT result = S_OK;
81
+ if (_stream)
82
+ result = _stream->Write(data, size, &size);
83
+ if (_calculate)
84
+ _hash->Update(data, size);
85
+ _size += size;
86
+ if (processedSize)
87
+ *processedSize = size;
88
+ return result;
89
+ }
90
+
91
+ #endif // Z7_SFX
92
+
93
+
94
+ #ifdef Z7_USE_SECURITY_CODE
95
+ bool InitLocalPrivileges();
96
+ bool InitLocalPrivileges()
97
+ {
98
+ NSecurity::CAccessToken token;
99
+ if (!token.OpenProcessToken(GetCurrentProcess(),
100
+ TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES))
101
+ return false;
102
+
103
+ TOKEN_PRIVILEGES tp;
104
+
105
+ tp.PrivilegeCount = 1;
106
+ tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
107
+
108
+ if (!::LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid))
109
+ return false;
110
+ if (!token.AdjustPrivileges(&tp))
111
+ return false;
112
+ return (GetLastError() == ERROR_SUCCESS);
113
+ }
114
+ #endif // Z7_USE_SECURITY_CODE
115
+
116
+
117
+
118
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
119
+
120
+ static const char * const kOfficeExtensions =
121
+ " doc dot wbk"
122
+ " docx docm dotx dotm docb wll wwl"
123
+ " xls xlt xlm"
124
+ " xlsx xlsm xltx xltm xlsb xla xlam"
125
+ " ppt pot pps ppa ppam"
126
+ " pptx pptm potx potm ppam ppsx ppsm sldx sldm"
127
+ " ";
128
+
129
+ static bool FindExt2(const char *p, const UString &name)
130
+ {
131
+ const int pathPos = name.ReverseFind_PathSepar();
132
+ const int dotPos = name.ReverseFind_Dot();
133
+ if (dotPos < 0
134
+ || dotPos < pathPos
135
+ || dotPos == (int)name.Len() - 1)
136
+ return false;
137
+
138
+ AString s;
139
+ for (unsigned pos = (unsigned)(dotPos + 1);; pos++)
140
+ {
141
+ const wchar_t c = name[pos];
142
+ if (c <= 0)
143
+ break;
144
+ if (c >= 0x80)
145
+ return false;
146
+ s.Add_Char((char)MyCharLower_Ascii((char)c));
147
+ }
148
+ for (unsigned i = 0; p[i] != 0;)
149
+ {
150
+ unsigned j;
151
+ for (j = i; p[j] != ' '; j++);
152
+ if (s.Len() == j - i && memcmp(p + i, (const char *)s, s.Len()) == 0)
153
+ return true;
154
+ i = j + 1;
155
+ }
156
+ return false;
157
+ }
158
+
159
+
160
+ static const char * const k_ZoneId_StreamName_With_Colon_Prefix = ":Zone.Identifier";
161
+
162
+ bool Is_ZoneId_StreamName(const wchar_t *s)
163
+ {
164
+ return StringsAreEqualNoCase_Ascii(s, k_ZoneId_StreamName_With_Colon_Prefix + 1);
165
+ }
166
+
167
+ void ReadZoneFile_Of_BaseFile(CFSTR fileName, CByteBuffer &buf)
168
+ {
169
+ buf.Free();
170
+ FString path (fileName);
171
+ path += k_ZoneId_StreamName_With_Colon_Prefix;
172
+ NIO::CInFile file;
173
+ if (!file.Open(path))
174
+ return;
175
+ UInt64 fileSize;
176
+ if (!file.GetLength(fileSize))
177
+ return;
178
+ if (fileSize == 0 || fileSize >= (1u << 15))
179
+ return;
180
+ buf.Alloc((size_t)fileSize);
181
+ size_t processed;
182
+ if (file.ReadFull(buf, (size_t)fileSize, processed) && processed == fileSize)
183
+ return;
184
+ buf.Free();
185
+ }
186
+
187
+ bool WriteZoneFile_To_BaseFile(CFSTR fileName, const CByteBuffer &buf)
188
+ {
189
+ FString path (fileName);
190
+ path += k_ZoneId_StreamName_With_Colon_Prefix;
191
+ NIO::COutFile file;
192
+ if (!file.Create_ALWAYS(path))
193
+ return false;
194
+ return file.WriteFull(buf, buf.Size());
195
+ }
196
+
197
+ #endif
198
+
199
+
200
+ #ifdef SUPPORT_LINKS
201
+
202
+ int CHardLinkNode::Compare(const CHardLinkNode &a) const
203
+ {
204
+ if (StreamId < a.StreamId) return -1;
205
+ if (StreamId > a.StreamId) return 1;
206
+ return MyCompare(INode, a.INode);
207
+ }
208
+
209
+ static HRESULT Archive_Get_HardLinkNode(IInArchive *archive, UInt32 index, CHardLinkNode &h, bool &defined)
210
+ {
211
+ h.INode = 0;
212
+ h.StreamId = (UInt64)(Int64)-1;
213
+ defined = false;
214
+ {
215
+ NCOM::CPropVariant prop;
216
+ RINOK(archive->GetProperty(index, kpidINode, &prop))
217
+ if (!ConvertPropVariantToUInt64(prop, h.INode))
218
+ return S_OK;
219
+ }
220
+ {
221
+ NCOM::CPropVariant prop;
222
+ RINOK(archive->GetProperty(index, kpidStreamId, &prop))
223
+ ConvertPropVariantToUInt64(prop, h.StreamId);
224
+ }
225
+ defined = true;
226
+ return S_OK;
227
+ }
228
+
229
+
230
+ HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *realIndices)
231
+ {
232
+ _hardLinks.Clear();
233
+
234
+ if (!_arc->Ask_INode)
235
+ return S_OK;
236
+
237
+ IInArchive * const archive = _arc->Archive;
238
+ CRecordVector<CHardLinkNode> &hardIDs = _hardLinks.IDs;
239
+
240
+ {
241
+ UInt32 numItems;
242
+ if (realIndices)
243
+ numItems = realIndices->Size();
244
+ else
245
+ {
246
+ RINOK(archive->GetNumberOfItems(&numItems))
247
+ }
248
+
249
+ for (UInt32 i = 0; i < numItems; i++)
250
+ {
251
+ CHardLinkNode h;
252
+ bool defined;
253
+ const UInt32 realIndex = realIndices ? (*realIndices)[i] : i;
254
+
255
+ RINOK(Archive_Get_HardLinkNode(archive, realIndex, h, defined))
256
+ if (defined)
257
+ {
258
+ bool isAltStream = false;
259
+ RINOK(Archive_IsItem_AltStream(archive, realIndex, isAltStream))
260
+ if (!isAltStream)
261
+ {
262
+ bool isDir = false;
263
+ RINOK(Archive_IsItem_Dir(archive, realIndex, isDir))
264
+ if (!isDir)
265
+ hardIDs.Add(h);
266
+ }
267
+ }
268
+ }
269
+ }
270
+
271
+ hardIDs.Sort2();
272
+
273
+ {
274
+ // we keep only items that have 2 or more items
275
+ unsigned k = 0;
276
+ unsigned numSame = 1;
277
+ for (unsigned i = 1; i < hardIDs.Size(); i++)
278
+ {
279
+ if (hardIDs[i].Compare(hardIDs[i - 1]) != 0)
280
+ numSame = 1;
281
+ else if (++numSame == 2)
282
+ {
283
+ if (i - 1 != k)
284
+ hardIDs[k] = hardIDs[i - 1];
285
+ k++;
286
+ }
287
+ }
288
+ hardIDs.DeleteFrom(k);
289
+ }
290
+
291
+ _hardLinks.PrepareLinks();
292
+ return S_OK;
293
+ }
294
+
295
+ #endif // SUPPORT_LINKS
296
+
297
+
298
+ CArchiveExtractCallback::CArchiveExtractCallback():
299
+ // Write_CTime(true),
300
+ // Write_ATime(true),
301
+ // Write_MTime(true),
302
+ Is_elimPrefix_Mode(false),
303
+ _arc(NULL),
304
+ _multiArchives(false)
305
+ {
306
+ #ifdef Z7_USE_SECURITY_CODE
307
+ _saclEnabled = InitLocalPrivileges();
308
+ #endif
309
+ }
310
+
311
+
312
+ void CArchiveExtractCallback::InitBeforeNewArchive()
313
+ {
314
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
315
+ ZoneBuf.Free();
316
+ #endif
317
+ }
318
+
319
+ void CArchiveExtractCallback::Init(
320
+ const CExtractNtOptions &ntOptions,
321
+ const NWildcard::CCensorNode *wildcardCensor,
322
+ const CArc *arc,
323
+ IFolderArchiveExtractCallback *extractCallback2,
324
+ bool stdOutMode, bool testMode,
325
+ const FString &directoryPath,
326
+ const UStringVector &removePathParts, bool removePartsForAltStreams,
327
+ UInt64 packSize)
328
+ {
329
+ ClearExtractedDirsInfo();
330
+ _outFileStream.Release();
331
+ _bufPtrSeqOutStream.Release();
332
+
333
+ #ifdef SUPPORT_LINKS
334
+ _hardLinks.Clear();
335
+ _postLinks.Clear();
336
+ #endif
337
+
338
+ #ifdef SUPPORT_ALT_STREAMS
339
+ _renamedFiles.Clear();
340
+ #endif
341
+
342
+ _ntOptions = ntOptions;
343
+ _wildcardCensor = wildcardCensor;
344
+ _stdOutMode = stdOutMode;
345
+ _testMode = testMode;
346
+ _packTotal = packSize;
347
+ _progressTotal = packSize;
348
+ // _progressTotal = 0;
349
+ // _progressTotal_Defined = false;
350
+ // _progressTotal_Defined = true;
351
+ _extractCallback2 = extractCallback2;
352
+ /*
353
+ _compressProgress.Release();
354
+ _extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress);
355
+ _callbackMessage.Release();
356
+ _extractCallback2.QueryInterface(IID_IArchiveExtractCallbackMessage2, &_callbackMessage);
357
+ */
358
+ _folderArchiveExtractCallback2.Release();
359
+ _extractCallback2.QueryInterface(IID_IFolderArchiveExtractCallback2, &_folderArchiveExtractCallback2);
360
+
361
+ #ifndef Z7_SFX
362
+
363
+ ExtractToStreamCallback.Release();
364
+ _extractCallback2.QueryInterface(IID_IFolderExtractToStreamCallback, &ExtractToStreamCallback);
365
+ if (ExtractToStreamCallback)
366
+ {
367
+ Int32 useStreams = 0;
368
+ if (ExtractToStreamCallback->UseExtractToStream(&useStreams) != S_OK)
369
+ useStreams = 0;
370
+ if (useStreams == 0)
371
+ ExtractToStreamCallback.Release();
372
+ }
373
+
374
+ #endif
375
+
376
+ LocalProgressSpec->Init(extractCallback2, true);
377
+ LocalProgressSpec->SendProgress = false;
378
+
379
+ _removePathParts = removePathParts;
380
+ _removePartsForAltStreams = removePartsForAltStreams;
381
+
382
+ #ifndef Z7_SFX
383
+ _baseParentFolder = (UInt32)(Int32)-1;
384
+ _use_baseParentFolder_mode = false;
385
+ #endif
386
+
387
+ _arc = arc;
388
+ _dirPathPrefix = directoryPath;
389
+ _dirPathPrefix_Full = directoryPath;
390
+ #if defined(_WIN32) && !defined(UNDER_CE)
391
+ if (!NName::IsAltPathPrefix(_dirPathPrefix))
392
+ #endif
393
+ {
394
+ NName::NormalizeDirPathPrefix(_dirPathPrefix);
395
+ NDir::MyGetFullPathName(directoryPath, _dirPathPrefix_Full);
396
+ NName::NormalizeDirPathPrefix(_dirPathPrefix_Full);
397
+ }
398
+ }
399
+
400
+
401
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetTotal(UInt64 size))
402
+ {
403
+ COM_TRY_BEGIN
404
+ _progressTotal = size;
405
+ // _progressTotal_Defined = true;
406
+ if (!_multiArchives && _extractCallback2)
407
+ return _extractCallback2->SetTotal(size);
408
+ return S_OK;
409
+ COM_TRY_END
410
+ }
411
+
412
+
413
+ static void NormalizeVals(UInt64 &v1, UInt64 &v2)
414
+ {
415
+ const UInt64 kMax = (UInt64)1 << 31;
416
+ while (v1 > kMax)
417
+ {
418
+ v1 >>= 1;
419
+ v2 >>= 1;
420
+ }
421
+ }
422
+
423
+
424
+ static UInt64 MyMultDiv64(UInt64 unpCur, UInt64 unpTotal, UInt64 packTotal)
425
+ {
426
+ NormalizeVals(packTotal, unpTotal);
427
+ NormalizeVals(unpCur, unpTotal);
428
+ if (unpTotal == 0)
429
+ unpTotal = 1;
430
+ return unpCur * packTotal / unpTotal;
431
+ }
432
+
433
+
434
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
435
+ {
436
+ COM_TRY_BEGIN
437
+
438
+ if (!_extractCallback2)
439
+ return S_OK;
440
+
441
+ UInt64 packCur;
442
+ if (_multiArchives)
443
+ {
444
+ packCur = LocalProgressSpec->InSize;
445
+ if (completeValue /* && _progressTotal_Defined */)
446
+ packCur += MyMultDiv64(*completeValue, _progressTotal, _packTotal);
447
+ completeValue = &packCur;
448
+ }
449
+ return _extractCallback2->SetCompleted(completeValue);
450
+
451
+ COM_TRY_END
452
+ }
453
+
454
+
455
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize))
456
+ {
457
+ COM_TRY_BEGIN
458
+ return LocalProgressSpec.Interface()->SetRatioInfo(inSize, outSize);
459
+ COM_TRY_END
460
+ }
461
+
462
+
463
+ void CArchiveExtractCallback::CreateComplexDirectory(
464
+ const UStringVector &dirPathParts, bool isFinal, FString &fullPath)
465
+ {
466
+ // we use (_item.IsDir) in this function
467
+
468
+ bool isAbsPath = false;
469
+
470
+ if (!dirPathParts.IsEmpty())
471
+ {
472
+ const UString &s = dirPathParts[0];
473
+ if (s.IsEmpty())
474
+ isAbsPath = true;
475
+ #if defined(_WIN32) && !defined(UNDER_CE)
476
+ else
477
+ {
478
+ if (NName::IsDrivePath2(s))
479
+ isAbsPath = true;
480
+ }
481
+ #endif
482
+ }
483
+
484
+ if (_pathMode == NExtract::NPathMode::kAbsPaths && isAbsPath)
485
+ fullPath.Empty();
486
+ else
487
+ fullPath = _dirPathPrefix;
488
+
489
+ FOR_VECTOR (i, dirPathParts)
490
+ {
491
+ if (i != 0)
492
+ fullPath.Add_PathSepar();
493
+ const UString &s = dirPathParts[i];
494
+ fullPath += us2fs(s);
495
+
496
+ const bool isFinalDir = (i == dirPathParts.Size() - 1 && isFinal && _item.IsDir);
497
+
498
+ if (fullPath.IsEmpty())
499
+ {
500
+ if (isFinalDir)
501
+ _itemFailure = true;
502
+ continue;
503
+ }
504
+
505
+ #if defined(_WIN32) && !defined(UNDER_CE)
506
+ if (_pathMode == NExtract::NPathMode::kAbsPaths)
507
+ if (i == 0 && s.Len() == 2 && NName::IsDrivePath2(s))
508
+ {
509
+ if (isFinalDir)
510
+ {
511
+ // we don't want to call SetAttrib() for root drive path
512
+ _itemFailure = true;
513
+ }
514
+ continue;
515
+ }
516
+ #endif
517
+
518
+ HRESULT hres = S_OK;
519
+ if (!CreateDir(fullPath))
520
+ hres = GetLastError_noZero_HRESULT();
521
+ if (isFinalDir)
522
+ {
523
+ if (!NFile::NFind::DoesDirExist(fullPath))
524
+ {
525
+ _itemFailure = true;
526
+ SendMessageError_with_Error(hres, "Cannot create folder", fullPath);
527
+ }
528
+ }
529
+ }
530
+ }
531
+
532
+
533
+ HRESULT CArchiveExtractCallback::GetTime(UInt32 index, PROPID propID, CArcTime &ft)
534
+ {
535
+ ft.Clear();
536
+ NCOM::CPropVariant prop;
537
+ RINOK(_arc->Archive->GetProperty(index, propID, &prop))
538
+ if (prop.vt == VT_FILETIME)
539
+ ft.Set_From_Prop(prop);
540
+ else if (prop.vt != VT_EMPTY)
541
+ return E_FAIL;
542
+ return S_OK;
543
+ }
544
+
545
+
546
+ HRESULT CArchiveExtractCallback::GetUnpackSize()
547
+ {
548
+ return _arc->GetItem_Size(_index, _curSize, _curSize_Defined);
549
+ }
550
+
551
+ static void AddPathToMessage(UString &s, const FString &path)
552
+ {
553
+ s += " : ";
554
+ s += fs2us(path);
555
+ }
556
+
557
+ HRESULT CArchiveExtractCallback::SendMessageError(const char *message, const FString &path) const
558
+ {
559
+ UString s (message);
560
+ AddPathToMessage(s, path);
561
+ return _extractCallback2->MessageError(s);
562
+ }
563
+
564
+
565
+ HRESULT CArchiveExtractCallback::SendMessageError_with_Error(HRESULT errorCode, const char *message, const FString &path) const
566
+ {
567
+ UString s (message);
568
+ if (errorCode != S_OK)
569
+ {
570
+ s += " : ";
571
+ s += NError::MyFormatMessage(errorCode);
572
+ }
573
+ AddPathToMessage(s, path);
574
+ return _extractCallback2->MessageError(s);
575
+ }
576
+
577
+ HRESULT CArchiveExtractCallback::SendMessageError_with_LastError(const char *message, const FString &path) const
578
+ {
579
+ const HRESULT errorCode = GetLastError_noZero_HRESULT();
580
+ return SendMessageError_with_Error(errorCode, message, path);
581
+ }
582
+
583
+ HRESULT CArchiveExtractCallback::SendMessageError2(HRESULT errorCode, const char *message, const FString &path1, const FString &path2) const
584
+ {
585
+ UString s (message);
586
+ if (errorCode != 0)
587
+ {
588
+ s += " : ";
589
+ s += NError::MyFormatMessage(errorCode);
590
+ }
591
+ AddPathToMessage(s, path1);
592
+ AddPathToMessage(s, path2);
593
+ return _extractCallback2->MessageError(s);
594
+ }
595
+
596
+ HRESULT CArchiveExtractCallback::SendMessageError2_with_LastError(
597
+ const char *message, const FString &path1, const FString &path2) const
598
+ {
599
+ const HRESULT errorCode = GetLastError_noZero_HRESULT();
600
+ return SendMessageError2(errorCode, message, path1, path2);
601
+ }
602
+
603
+ #ifndef Z7_SFX
604
+
605
+ Z7_CLASS_IMP_COM_1(
606
+ CGetProp
607
+ , IGetProp
608
+ )
609
+ public:
610
+ UInt32 IndexInArc;
611
+ const CArc *Arc;
612
+ // UString BaseName; // relative path
613
+ };
614
+
615
+ Z7_COM7F_IMF(CGetProp::GetProp(PROPID propID, PROPVARIANT *value))
616
+ {
617
+ /*
618
+ if (propID == kpidBaseName)
619
+ {
620
+ COM_TRY_BEGIN
621
+ NCOM::CPropVariant prop = BaseName;
622
+ prop.Detach(value);
623
+ return S_OK;
624
+ COM_TRY_END
625
+ }
626
+ */
627
+ return Arc->Archive->GetProperty(IndexInArc, propID, value);
628
+ }
629
+
630
+ #endif // Z7_SFX
631
+
632
+
633
+ struct CLinkLevelsInfo
634
+ {
635
+ bool IsAbsolute;
636
+ bool ParentDirDots_after_NonParent;
637
+ int LowLevel;
638
+ int FinalLevel;
639
+
640
+ void Parse(const UString &path, bool isWSL);
641
+ };
642
+
643
+ void CLinkLevelsInfo::Parse(const UString &path, bool isWSL)
644
+ {
645
+ IsAbsolute = isWSL ?
646
+ IS_PATH_SEPAR(path[0]) :
647
+ NName::IsAbsolutePath(path);
648
+ LowLevel = 0;
649
+ FinalLevel = 0;
650
+ ParentDirDots_after_NonParent = false;
651
+ bool nonParentDir = false;
652
+
653
+ UStringVector parts;
654
+ SplitPathToParts(path, parts);
655
+ int level = 0;
656
+
657
+ FOR_VECTOR (i, parts)
658
+ {
659
+ const UString &s = parts[i];
660
+ if (s.IsEmpty())
661
+ {
662
+ if (i == 0)
663
+ IsAbsolute = true;
664
+ continue;
665
+ }
666
+ if (s.IsEqualTo("."))
667
+ continue;
668
+ if (s.IsEqualTo(".."))
669
+ {
670
+ if (IsAbsolute || nonParentDir)
671
+ ParentDirDots_after_NonParent = true;
672
+ level--;
673
+ if (LowLevel > level)
674
+ LowLevel = level;
675
+ }
676
+ else
677
+ {
678
+ nonParentDir = true;
679
+ level++;
680
+ }
681
+ }
682
+
683
+ FinalLevel = level;
684
+ }
685
+
686
+
687
+ static bool IsSafePath(const UString &path, bool isWSL)
688
+ {
689
+ CLinkLevelsInfo levelsInfo;
690
+ levelsInfo.Parse(path, isWSL);
691
+ return !levelsInfo.IsAbsolute
692
+ && levelsInfo.LowLevel >= 0
693
+ && levelsInfo.FinalLevel > 0;
694
+ }
695
+
696
+ bool IsSafePath(const UString &path);
697
+ bool IsSafePath(const UString &path)
698
+ {
699
+ return IsSafePath(path, false); // isWSL
700
+ }
701
+
702
+ bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include);
703
+ bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include)
704
+ {
705
+ bool found = false;
706
+
707
+ // CheckPathVect() doesn't check path to Parent nodes
708
+ if (node.CheckPathVect(item.PathParts, !item.MainIsDir, include))
709
+ {
710
+ if (!include)
711
+ return true;
712
+
713
+ #ifdef SUPPORT_ALT_STREAMS
714
+ if (!item.IsAltStream)
715
+ return true;
716
+ #endif
717
+
718
+ found = true;
719
+ }
720
+
721
+ #ifdef SUPPORT_ALT_STREAMS
722
+
723
+ if (!item.IsAltStream)
724
+ return false;
725
+
726
+ UStringVector pathParts2 = item.PathParts;
727
+ if (pathParts2.IsEmpty())
728
+ pathParts2.AddNew();
729
+ UString &back = pathParts2.Back();
730
+ back.Add_Colon();
731
+ back += item.AltStreamName;
732
+ bool include2;
733
+
734
+ if (node.CheckPathVect(pathParts2,
735
+ true, // isFile,
736
+ include2))
737
+ {
738
+ include = include2;
739
+ return true;
740
+ }
741
+
742
+ #endif // SUPPORT_ALT_STREAMS
743
+
744
+ return found;
745
+ }
746
+
747
+
748
+ bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item)
749
+ {
750
+ bool include;
751
+ if (CensorNode_CheckPath2(node, item, include))
752
+ return include;
753
+ return false;
754
+ }
755
+
756
+
757
+ static FString MakePath_from_2_Parts(const FString &prefix, const FString &path)
758
+ {
759
+ FString s (prefix);
760
+ #if defined(_WIN32) && !defined(UNDER_CE)
761
+ if (!path.IsEmpty() && path[0] == ':' && !prefix.IsEmpty() && IsPathSepar(prefix.Back()))
762
+ {
763
+ if (!NName::IsDriveRootPath_SuperAllowed(prefix))
764
+ s.DeleteBack();
765
+ }
766
+ #endif
767
+ s += path;
768
+ return s;
769
+ }
770
+
771
+
772
+
773
+ #ifdef SUPPORT_LINKS
774
+
775
+ /*
776
+ struct CTempMidBuffer
777
+ {
778
+ void *Buf;
779
+
780
+ CTempMidBuffer(size_t size): Buf(NULL) { Buf = ::MidAlloc(size); }
781
+ ~CTempMidBuffer() { ::MidFree(Buf); }
782
+ };
783
+
784
+ HRESULT CArchiveExtractCallback::MyCopyFile(ISequentialOutStream *outStream)
785
+ {
786
+ const size_t kBufSize = 1 << 16;
787
+ CTempMidBuffer buf(kBufSize);
788
+ if (!buf.Buf)
789
+ return E_OUTOFMEMORY;
790
+
791
+ NIO::CInFile inFile;
792
+ NIO::COutFile outFile;
793
+
794
+ if (!inFile.Open(_copyFile_Path))
795
+ return SendMessageError_with_LastError("Open error", _copyFile_Path);
796
+
797
+ for (;;)
798
+ {
799
+ UInt32 num;
800
+
801
+ if (!inFile.Read(buf.Buf, kBufSize, num))
802
+ return SendMessageError_with_LastError("Read error", _copyFile_Path);
803
+
804
+ if (num == 0)
805
+ return S_OK;
806
+
807
+
808
+ RINOK(WriteStream(outStream, buf.Buf, num));
809
+ }
810
+ }
811
+ */
812
+
813
+
814
+ HRESULT CArchiveExtractCallback::ReadLink()
815
+ {
816
+ IInArchive * const archive = _arc->Archive;
817
+ const UInt32 index = _index;
818
+ // _link.Clear(); // _link.Clear() was called already.
819
+ {
820
+ NCOM::CPropVariant prop;
821
+ RINOK(archive->GetProperty(index, kpidHardLink, &prop))
822
+ if (prop.vt == VT_BSTR)
823
+ {
824
+ _link.LinkType = k_LinkType_HardLink;
825
+ _link.isRelative = false; // RAR5, TAR: hard links are from root folder of archive
826
+ _link.LinkPath.SetFromBstr(prop.bstrVal);
827
+ // 7-Zip 24-: tar handler returned original path (with linux slash in most case)
828
+ // 7-Zip 24-: rar5 handler returned path with system slash.
829
+ // 7-Zip 25+: tar/rar5 handlers return linux path in most cases.
830
+ }
831
+ else if (prop.vt != VT_EMPTY)
832
+ return E_FAIL;
833
+ }
834
+ /*
835
+ {
836
+ NCOM::CPropVariant prop;
837
+ RINOK(archive->GetProperty(index, kpidCopyLink, &prop));
838
+ if (prop.vt == VT_BSTR)
839
+ {
840
+ _link.LinkType = k_LinkType_CopyLink;
841
+ _link.isRelative = false; // RAR5: copy links are from root folder of archive
842
+ _link.LinkPath.SetFromBstr(prop.bstrVal);
843
+ }
844
+ else if (prop.vt != VT_EMPTY)
845
+ return E_FAIL;
846
+ }
847
+ */
848
+ {
849
+ NCOM::CPropVariant prop;
850
+ RINOK(archive->GetProperty(index, kpidSymLink, &prop))
851
+ if (prop.vt == VT_BSTR)
852
+ {
853
+ _link.LinkType = k_LinkType_PureSymLink;
854
+ _link.isRelative = true; // RAR5, TAR: symbolic links are relative by default
855
+ _link.LinkPath.SetFromBstr(prop.bstrVal);
856
+ // 7-Zip 24-: (tar, cpio, xar, ext, iso) handlers returned returned original path (with linux slash in most case)
857
+ // 7-Zip 24-: rar5 handler returned path with system slash.
858
+ // 7-Zip 25+: all handlers return linux path in most cases.
859
+ }
860
+ else if (prop.vt != VT_EMPTY)
861
+ return E_FAIL;
862
+ }
863
+
864
+ // linux path separator in (_link.LinkPath) is expected for most cases,
865
+ // if new handler code is used, and if data in archive is correct.
866
+ // NtReparse_Data = NULL;
867
+ // NtReparse_Size = 0;
868
+ if (!_link.LinkPath.IsEmpty())
869
+ {
870
+ REPLACE_SLASHES_from_Linux_to_Sys(_link.LinkPath)
871
+ }
872
+ else if (_arc->GetRawProps)
873
+ {
874
+ const void *data;
875
+ UInt32 dataSize, propType;
876
+ if (_arc->GetRawProps->GetRawProp(_index, kpidNtReparse, &data, &dataSize, &propType) == S_OK
877
+ // && dataSize == 1234567 // for debug: unpacking without reparse
878
+ && dataSize)
879
+ {
880
+ if (propType != NPropDataType::kRaw)
881
+ return E_FAIL;
882
+ // 21.06: we need kpidNtReparse in linux for wim archives created in Windows
883
+ // NtReparse_Data = data;
884
+ // NtReparse_Size = dataSize;
885
+ // we ignore error code here, if there is failure of parsing:
886
+ _link.Parse_from_WindowsReparseData((const Byte *)data, dataSize);
887
+ }
888
+ }
889
+
890
+ if (_link.LinkPath.IsEmpty())
891
+ return S_OK;
892
+ // (_link.LinkPath) uses system path separator.
893
+ // windows: (_link.LinkPath) doesn't contain linux separator (slash).
894
+ {
895
+ // _link.LinkPath = "\\??\\r:\\1\\2"; // for debug
896
+ // rar5+ returns kpidSymLink absolute link path with "\??\" prefix.
897
+ // we normalize such prefix:
898
+ if (_link.LinkPath.IsPrefixedBy(STRING_PATH_SEPARATOR "??" STRING_PATH_SEPARATOR))
899
+ {
900
+ _link.isRelative = false;
901
+ // we normalize prefix from "\??\" to "\\?\":
902
+ _link.LinkPath.ReplaceOneCharAtPos(1, WCHAR_PATH_SEPARATOR);
903
+ _link.isWindowsPath = true;
904
+ if (_link.LinkPath.IsPrefixedBy_Ascii_NoCase(
905
+ STRING_PATH_SEPARATOR
906
+ STRING_PATH_SEPARATOR "?"
907
+ STRING_PATH_SEPARATOR "UNC"
908
+ STRING_PATH_SEPARATOR))
909
+ {
910
+ // we normalize prefix from "\\?\UNC\path" to "\\path":
911
+ _link.LinkPath.DeleteFrontal(6);
912
+ _link.LinkPath.ReplaceOneCharAtPos(0, WCHAR_PATH_SEPARATOR);
913
+ }
914
+ else
915
+ {
916
+ const unsigned k_prefix_Size = 4;
917
+ if (NName::IsDrivePath(_link.LinkPath.Ptr(k_prefix_Size)))
918
+ _link.LinkPath.DeleteFrontal(k_prefix_Size);
919
+ }
920
+ }
921
+ }
922
+ _link.Normalize_to_RelativeSafe(_removePathParts);
923
+ return S_OK;
924
+ }
925
+
926
+ #endif // SUPPORT_LINKS
927
+
928
+
929
+ #ifndef _WIN32
930
+
931
+ static HRESULT GetOwner(IInArchive *archive,
932
+ UInt32 index, UInt32 pidName, UInt32 pidId, CProcessedFileInfo::COwnerInfo &res)
933
+ {
934
+ {
935
+ NWindows::NCOM::CPropVariant prop;
936
+ RINOK(archive->GetProperty(index, pidId, &prop))
937
+ if (prop.vt == VT_UI4)
938
+ {
939
+ res.Id_Defined = true;
940
+ res.Id = prop.ulVal;
941
+ // res.Id++; // for debug
942
+ // if (pidId == kpidGroupId) res.Id += 7; // for debug
943
+ // res.Id = 0; // for debug
944
+ }
945
+ else if (prop.vt != VT_EMPTY)
946
+ return E_INVALIDARG;
947
+ }
948
+ {
949
+ NWindows::NCOM::CPropVariant prop;
950
+ RINOK(archive->GetProperty(index, pidName, &prop))
951
+ if (prop.vt == VT_BSTR)
952
+ {
953
+ const UString s = prop.bstrVal;
954
+ ConvertUnicodeToUTF8(s, res.Name);
955
+ }
956
+ else if (prop.vt == VT_UI4)
957
+ {
958
+ res.Id_Defined = true;
959
+ res.Id = prop.ulVal;
960
+ }
961
+ else if (prop.vt != VT_EMPTY)
962
+ return E_INVALIDARG;
963
+ }
964
+ return S_OK;
965
+ }
966
+
967
+ #endif
968
+
969
+
970
+ HRESULT CArchiveExtractCallback::Read_fi_Props()
971
+ {
972
+ IInArchive * const archive = _arc->Archive;
973
+ const UInt32 index = _index;
974
+
975
+ _fi.Attrib_Defined = false;
976
+
977
+ #ifndef _WIN32
978
+ _fi.Owner.Clear();
979
+ _fi.Group.Clear();
980
+ #endif
981
+
982
+ {
983
+ NCOM::CPropVariant prop;
984
+ RINOK(archive->GetProperty(index, kpidPosixAttrib, &prop))
985
+ if (prop.vt == VT_UI4)
986
+ {
987
+ _fi.SetFromPosixAttrib(prop.ulVal);
988
+ }
989
+ else if (prop.vt != VT_EMPTY)
990
+ return E_FAIL;
991
+ }
992
+
993
+ {
994
+ NCOM::CPropVariant prop;
995
+ RINOK(archive->GetProperty(index, kpidAttrib, &prop))
996
+ if (prop.vt == VT_UI4)
997
+ {
998
+ _fi.Attrib = prop.ulVal;
999
+ _fi.Attrib_Defined = true;
1000
+ }
1001
+ else if (prop.vt != VT_EMPTY)
1002
+ return E_FAIL;
1003
+ }
1004
+
1005
+ RINOK(GetTime(index, kpidCTime, _fi.CTime))
1006
+ RINOK(GetTime(index, kpidATime, _fi.ATime))
1007
+ RINOK(GetTime(index, kpidMTime, _fi.MTime))
1008
+
1009
+ #ifndef _WIN32
1010
+ if (_ntOptions.ExtractOwner)
1011
+ {
1012
+ // SendMessageError_with_LastError("_ntOptions.ExtractOwner", _diskFilePath);
1013
+ GetOwner(archive, index, kpidUser, kpidUserId, _fi.Owner);
1014
+ GetOwner(archive, index, kpidGroup, kpidGroupId, _fi.Group);
1015
+ }
1016
+ #endif
1017
+
1018
+ return S_OK;
1019
+ }
1020
+
1021
+
1022
+
1023
+ void CArchiveExtractCallback::CorrectPathParts()
1024
+ {
1025
+ UStringVector &pathParts = _item.PathParts;
1026
+
1027
+ #ifdef SUPPORT_ALT_STREAMS
1028
+ if (!_item.IsAltStream
1029
+ || !pathParts.IsEmpty()
1030
+ || !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
1031
+ #endif
1032
+ Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, _keepAndReplaceEmptyDirPrefixes, pathParts, _item.MainIsDir);
1033
+
1034
+ #ifdef SUPPORT_ALT_STREAMS
1035
+
1036
+ if (_item.IsAltStream)
1037
+ {
1038
+ UString s (_item.AltStreamName);
1039
+ Correct_AltStream_Name(s);
1040
+ bool needColon = true;
1041
+
1042
+ if (pathParts.IsEmpty())
1043
+ {
1044
+ pathParts.AddNew();
1045
+ if (_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt)
1046
+ needColon = false;
1047
+ }
1048
+ #ifdef _WIN32
1049
+ else if (_pathMode == NExtract::NPathMode::kAbsPaths &&
1050
+ NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
1051
+ pathParts.AddNew();
1052
+ #endif
1053
+
1054
+ UString &name = pathParts.Back();
1055
+ if (needColon)
1056
+ name.Add_Char((char)(_ntOptions.ReplaceColonForAltStream ? '_' : ':'));
1057
+ name += s;
1058
+ }
1059
+
1060
+ #endif // SUPPORT_ALT_STREAMS
1061
+ }
1062
+
1063
+
1064
+ static void GetFiTimesCAM(const CProcessedFileInfo &fi, CFiTimesCAM &pt, const CArc &arc)
1065
+ {
1066
+ pt.CTime_Defined = false;
1067
+ pt.ATime_Defined = false;
1068
+ pt.MTime_Defined = false;
1069
+
1070
+ // if (Write_MTime)
1071
+ {
1072
+ if (fi.MTime.Def)
1073
+ {
1074
+ fi.MTime.Write_To_FiTime(pt.MTime);
1075
+ pt.MTime_Defined = true;
1076
+ }
1077
+ else if (arc.MTime.Def)
1078
+ {
1079
+ arc.MTime.Write_To_FiTime(pt.MTime);
1080
+ pt.MTime_Defined = true;
1081
+ }
1082
+ }
1083
+
1084
+ if (/* Write_CTime && */ fi.CTime.Def)
1085
+ {
1086
+ fi.CTime.Write_To_FiTime(pt.CTime);
1087
+ pt.CTime_Defined = true;
1088
+ }
1089
+
1090
+ if (/* Write_ATime && */ fi.ATime.Def)
1091
+ {
1092
+ fi.ATime.Write_To_FiTime(pt.ATime);
1093
+ pt.ATime_Defined = true;
1094
+ }
1095
+ }
1096
+
1097
+
1098
+ void CArchiveExtractCallback::CreateFolders()
1099
+ {
1100
+ // 21.04 : we don't change original (_item.PathParts) here
1101
+ UStringVector pathParts = _item.PathParts;
1102
+
1103
+ bool isFinal = true;
1104
+ // bool is_DirOp = false;
1105
+ if (!pathParts.IsEmpty())
1106
+ {
1107
+ /* v23: if we extract symlink, and we know that it links to dir:
1108
+ Linux: we don't create dir item (symlink_from_path) here.
1109
+ Windows: SetReparseData() will create dir item, if it doesn't exist,
1110
+ but if we create dir item here, it's not problem. */
1111
+ if (!_item.IsDir
1112
+ #ifdef SUPPORT_LINKS
1113
+ // #ifndef WIN32
1114
+ || !_link.LinkPath.IsEmpty()
1115
+ // #endif
1116
+ #endif
1117
+ )
1118
+ {
1119
+ pathParts.DeleteBack();
1120
+ isFinal = false; // last path part was excluded
1121
+ }
1122
+ // else is_DirOp = true;
1123
+ }
1124
+
1125
+ if (pathParts.IsEmpty())
1126
+ {
1127
+ /* if (_some_pathParts_wereRemoved && Is_elimPrefix_Mode),
1128
+ then we can have empty pathParts() here for root folder.
1129
+ v24.00: fixed: we set timestamps for such folder still.
1130
+ */
1131
+ if (!_some_pathParts_wereRemoved ||
1132
+ !Is_elimPrefix_Mode)
1133
+ return;
1134
+ // return; // ignore empty paths case
1135
+ }
1136
+ /*
1137
+ if (is_DirOp)
1138
+ {
1139
+ RINOK(PrepareOperation(NArchive::NExtract::NAskMode::kExtract))
1140
+ _op_WasReported = true;
1141
+ }
1142
+ */
1143
+
1144
+ FString fullPathNew;
1145
+ CreateComplexDirectory(pathParts, isFinal, fullPathNew);
1146
+
1147
+ /*
1148
+ if (is_DirOp)
1149
+ {
1150
+ RINOK(SetOperationResult(
1151
+ // _itemFailure ? NArchive::NExtract::NOperationResult::kDataError :
1152
+ NArchive::NExtract::NOperationResult::kOK
1153
+ ))
1154
+ }
1155
+ */
1156
+
1157
+ if (!_item.IsDir)
1158
+ return;
1159
+ if (fullPathNew.IsEmpty())
1160
+ return;
1161
+
1162
+ if (_itemFailure)
1163
+ return;
1164
+
1165
+ CDirPathTime pt;
1166
+ GetFiTimesCAM(_fi, pt, *_arc);
1167
+
1168
+ if (pt.IsSomeTimeDefined())
1169
+ {
1170
+ pt.Path = fullPathNew;
1171
+ pt.SetDirTime_to_FS_2();
1172
+ _extractedFolders.Add(pt);
1173
+ }
1174
+ }
1175
+
1176
+
1177
+
1178
+ /*
1179
+ CheckExistFile(fullProcessedPath)
1180
+ it can change: fullProcessedPath, _isRenamed, _overwriteMode
1181
+ (needExit = true) means that we must exit GetStream() even for S_OK result.
1182
+ */
1183
+
1184
+ HRESULT CArchiveExtractCallback::CheckExistFile(FString &fullProcessedPath, bool &needExit)
1185
+ {
1186
+ needExit = true; // it was set already before
1187
+
1188
+ NFind::CFileInfo fileInfo;
1189
+
1190
+ if (fileInfo.Find(fullProcessedPath))
1191
+ {
1192
+ if (_overwriteMode == NExtract::NOverwriteMode::kSkip)
1193
+ return S_OK;
1194
+
1195
+ if (_overwriteMode == NExtract::NOverwriteMode::kAsk)
1196
+ {
1197
+ const int slashPos = fullProcessedPath.ReverseFind_PathSepar();
1198
+ const FString realFullProcessedPath = fullProcessedPath.Left((unsigned)(slashPos + 1)) + fileInfo.Name;
1199
+
1200
+ /* (fileInfo) can be symbolic link.
1201
+ we can show final file properties here. */
1202
+
1203
+ FILETIME ft1;
1204
+ FiTime_To_FILETIME(fileInfo.MTime, ft1);
1205
+
1206
+ Int32 overwriteResult;
1207
+ RINOK(_extractCallback2->AskOverwrite(
1208
+ fs2us(realFullProcessedPath), &ft1, &fileInfo.Size, _item.Path,
1209
+ _fi.MTime.Def ? &_fi.MTime.FT : NULL,
1210
+ _curSize_Defined ? &_curSize : NULL,
1211
+ &overwriteResult))
1212
+
1213
+ switch (overwriteResult)
1214
+ {
1215
+ case NOverwriteAnswer::kCancel:
1216
+ return E_ABORT;
1217
+ case NOverwriteAnswer::kNo:
1218
+ return S_OK;
1219
+ case NOverwriteAnswer::kNoToAll:
1220
+ _overwriteMode = NExtract::NOverwriteMode::kSkip;
1221
+ return S_OK;
1222
+
1223
+ case NOverwriteAnswer::kYes:
1224
+ break;
1225
+ case NOverwriteAnswer::kYesToAll:
1226
+ _overwriteMode = NExtract::NOverwriteMode::kOverwrite;
1227
+ break;
1228
+ case NOverwriteAnswer::kAutoRename:
1229
+ _overwriteMode = NExtract::NOverwriteMode::kRename;
1230
+ break;
1231
+ default:
1232
+ return E_FAIL;
1233
+ }
1234
+ } // NExtract::NOverwriteMode::kAsk
1235
+
1236
+ if (_overwriteMode == NExtract::NOverwriteMode::kRename)
1237
+ {
1238
+ if (!AutoRenamePath(fullProcessedPath))
1239
+ {
1240
+ RINOK(SendMessageError(kCantAutoRename, fullProcessedPath))
1241
+ return E_FAIL;
1242
+ }
1243
+ _isRenamed = true;
1244
+ }
1245
+ else if (_overwriteMode == NExtract::NOverwriteMode::kRenameExisting)
1246
+ {
1247
+ FString existPath (fullProcessedPath);
1248
+ if (!AutoRenamePath(existPath))
1249
+ {
1250
+ RINOK(SendMessageError(kCantAutoRename, fullProcessedPath))
1251
+ return E_FAIL;
1252
+ }
1253
+ // MyMoveFile can rename folders. So it's OK to use it for folders too
1254
+ if (!MyMoveFile(fullProcessedPath, existPath))
1255
+ {
1256
+ RINOK(SendMessageError2_with_LastError(kCantRenameFile, existPath, fullProcessedPath))
1257
+ return E_FAIL;
1258
+ }
1259
+ }
1260
+ else // not Rename*
1261
+ {
1262
+ if (fileInfo.IsDir())
1263
+ {
1264
+ // do we need to delete all files in folder?
1265
+ if (!RemoveDir(fullProcessedPath))
1266
+ {
1267
+ RINOK(SendMessageError_with_LastError(kCantDeleteOutputDir, fullProcessedPath))
1268
+ return S_OK;
1269
+ }
1270
+ }
1271
+ else // fileInfo is not Dir
1272
+ {
1273
+ if (NFind::DoesFileExist_Raw(fullProcessedPath))
1274
+ if (!DeleteFileAlways(fullProcessedPath))
1275
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) // check it in linux
1276
+ {
1277
+ RINOK(SendMessageError_with_LastError(kCantDeleteOutputFile, fullProcessedPath))
1278
+ return S_OK;
1279
+ // return E_FAIL;
1280
+ }
1281
+ } // fileInfo is not Dir
1282
+ } // not Rename*
1283
+ }
1284
+ else // not Find(fullProcessedPath)
1285
+ {
1286
+ #if defined(_WIN32) && !defined(UNDER_CE)
1287
+ // we need to clear READ-ONLY of parent before creating alt stream
1288
+ const int colonPos = NName::FindAltStreamColon(fullProcessedPath);
1289
+ if (colonPos >= 0 && fullProcessedPath[(unsigned)colonPos + 1] != 0)
1290
+ {
1291
+ FString parentFsPath (fullProcessedPath);
1292
+ parentFsPath.DeleteFrom((unsigned)colonPos);
1293
+ NFind::CFileInfo parentFi;
1294
+ if (parentFi.Find(parentFsPath))
1295
+ {
1296
+ if (parentFi.IsReadOnly())
1297
+ {
1298
+ _altStream_NeedRestore_Attrib_for_parentFsPath = parentFsPath;
1299
+ _altStream_NeedRestore_AttribVal = parentFi.Attrib;
1300
+ SetFileAttrib(parentFsPath, parentFi.Attrib & ~(DWORD)FILE_ATTRIBUTE_READONLY);
1301
+ }
1302
+ }
1303
+ }
1304
+ #endif // defined(_WIN32) && !defined(UNDER_CE)
1305
+ }
1306
+
1307
+ needExit = false;
1308
+ return S_OK;
1309
+ }
1310
+
1311
+
1312
+
1313
+ /*
1314
+ return:
1315
+ needExit = false: caller will use (outStreamLoc) and _hashStreamSpec
1316
+ needExit = true : caller will not use (outStreamLoc) and _hashStreamSpec.
1317
+ */
1318
+ HRESULT CArchiveExtractCallback::GetExtractStream(CMyComPtr<ISequentialOutStream> &outStreamLoc, bool &needExit)
1319
+ {
1320
+ needExit = true;
1321
+
1322
+ RINOK(Read_fi_Props())
1323
+
1324
+ #ifdef SUPPORT_LINKS
1325
+ IInArchive * const archive = _arc->Archive;
1326
+ #endif
1327
+
1328
+ const UInt32 index = _index;
1329
+
1330
+ bool isAnti = false;
1331
+ RINOK(_arc->IsItem_Anti(index, isAnti))
1332
+
1333
+ CorrectPathParts();
1334
+ UString processedPath (MakePathFromParts(_item.PathParts));
1335
+
1336
+ if (!isAnti)
1337
+ {
1338
+ // 21.04: CreateFolders doesn't change (_item.PathParts)
1339
+ CreateFolders();
1340
+ }
1341
+
1342
+ FString fullProcessedPath (us2fs(processedPath));
1343
+ if (_pathMode != NExtract::NPathMode::kAbsPaths
1344
+ || !NName::IsAbsolutePath(processedPath))
1345
+ {
1346
+ fullProcessedPath = MakePath_from_2_Parts(_dirPathPrefix, fullProcessedPath);
1347
+ }
1348
+
1349
+ #ifdef SUPPORT_ALT_STREAMS
1350
+ if (_item.IsAltStream && _item.ParentIndex != (UInt32)(Int32)-1)
1351
+ {
1352
+ const int renIndex = _renamedFiles.FindInSorted(CIndexToPathPair(_item.ParentIndex));
1353
+ if (renIndex != -1)
1354
+ {
1355
+ const CIndexToPathPair &pair = _renamedFiles[(unsigned)renIndex];
1356
+ fullProcessedPath = pair.Path;
1357
+ fullProcessedPath.Add_Colon();
1358
+ UString s (_item.AltStreamName);
1359
+ Correct_AltStream_Name(s);
1360
+ fullProcessedPath += us2fs(s);
1361
+ }
1362
+ }
1363
+ #endif // SUPPORT_ALT_STREAMS
1364
+
1365
+ if (_item.IsDir)
1366
+ {
1367
+ _diskFilePath = fullProcessedPath;
1368
+ if (isAnti)
1369
+ RemoveDir(_diskFilePath);
1370
+ #ifdef SUPPORT_LINKS
1371
+ if (_link.LinkPath.IsEmpty())
1372
+ #endif
1373
+ {
1374
+ if (!isAnti)
1375
+ SetAttrib();
1376
+ return S_OK;
1377
+ }
1378
+ }
1379
+ else if (!_isSplit)
1380
+ {
1381
+ RINOK(CheckExistFile(fullProcessedPath, needExit))
1382
+ if (needExit)
1383
+ return S_OK;
1384
+ needExit = true;
1385
+ }
1386
+
1387
+ _diskFilePath = fullProcessedPath;
1388
+
1389
+
1390
+ if (isAnti)
1391
+ {
1392
+ needExit = false;
1393
+ return S_OK;
1394
+ }
1395
+
1396
+ // not anti
1397
+
1398
+ #ifdef SUPPORT_LINKS
1399
+
1400
+ if (!_link.LinkPath.IsEmpty())
1401
+ {
1402
+ #ifndef UNDER_CE
1403
+ {
1404
+ bool linkWasSet = false;
1405
+ RINOK(SetLink(fullProcessedPath, _link, linkWasSet))
1406
+ /*
1407
+ // we don't set attributes for placeholder.
1408
+ if (linkWasSet)
1409
+ {
1410
+ _isSymLinkCreated = _link.Is_AnySymLink();
1411
+ SetAttrib();
1412
+ // printf("\nlinkWasSet %s\n", GetAnsiString(_diskFilePath));
1413
+ }
1414
+ */
1415
+ }
1416
+ #endif // UNDER_CE
1417
+
1418
+ // if (_copyFile_Path.IsEmpty())
1419
+ {
1420
+ needExit = false;
1421
+ return S_OK;
1422
+ }
1423
+ }
1424
+
1425
+ if (!_hardLinks.IDs.IsEmpty() && !_item.IsAltStream && !_item.IsDir)
1426
+ {
1427
+ CHardLinkNode h;
1428
+ bool defined;
1429
+ RINOK(Archive_Get_HardLinkNode(archive, index, h, defined))
1430
+ if (defined)
1431
+ {
1432
+ const int linkIndex = _hardLinks.IDs.FindInSorted2(h);
1433
+ if (linkIndex != -1)
1434
+ {
1435
+ FString &hl = _hardLinks.Links[(unsigned)linkIndex];
1436
+ if (hl.IsEmpty())
1437
+ hl = fullProcessedPath;
1438
+ else
1439
+ {
1440
+ bool link_was_Created = false;
1441
+ RINOK(CreateHardLink2(fullProcessedPath, hl, link_was_Created))
1442
+ if (!link_was_Created)
1443
+ return S_OK;
1444
+ // printf("\nHard linkWasSet Archive_Get_HardLinkNode %s\n", GetAnsiString(_diskFilePath));
1445
+ // _needSetAttrib = true; // do we need to set attribute ?
1446
+ SetAttrib();
1447
+ /* if we set (needExit = false) here, _hashStreamSpec will be used,
1448
+ and hash will be calulated for all hard links files (it's slower).
1449
+ But "Test" operation also calculates hashes.
1450
+ */
1451
+ needExit = false;
1452
+ return S_OK;
1453
+ }
1454
+ }
1455
+ }
1456
+ }
1457
+
1458
+ #endif // SUPPORT_LINKS
1459
+
1460
+
1461
+ // ---------- CREATE WRITE FILE -----
1462
+
1463
+ _outFileStreamSpec = new COutFileStream;
1464
+ CMyComPtr<IOutStream> outFileStream_Loc(_outFileStreamSpec);
1465
+
1466
+ if (!_outFileStreamSpec->Create_ALWAYS_or_Open_ALWAYS(fullProcessedPath, !_isSplit))
1467
+ {
1468
+ // if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit)
1469
+ {
1470
+ RINOK(SendMessageError_with_LastError(kCantOpenOutFile, fullProcessedPath))
1471
+ return S_OK;
1472
+ }
1473
+ }
1474
+
1475
+ _needSetAttrib = true;
1476
+
1477
+ bool is_SymLink_in_Data = false;
1478
+
1479
+ if (_curSize_Defined && _curSize && _curSize < k_LinkDataSize_LIMIT)
1480
+ {
1481
+ if (_fi.IsLinuxSymLink())
1482
+ {
1483
+ is_SymLink_in_Data = true;
1484
+ _is_SymLink_in_Data_Linux = true;
1485
+ }
1486
+ else if (_fi.IsReparse())
1487
+ {
1488
+ is_SymLink_in_Data = true;
1489
+ _is_SymLink_in_Data_Linux = false;
1490
+ }
1491
+ }
1492
+
1493
+ if (is_SymLink_in_Data)
1494
+ {
1495
+ _outMemBuf.Alloc((size_t)_curSize);
1496
+ _bufPtrSeqOutStream_Spec = new CBufPtrSeqOutStream;
1497
+ _bufPtrSeqOutStream = _bufPtrSeqOutStream_Spec;
1498
+ _bufPtrSeqOutStream_Spec->Init(_outMemBuf, _outMemBuf.Size());
1499
+ outStreamLoc = _bufPtrSeqOutStream;
1500
+ }
1501
+ else // not reparse
1502
+ {
1503
+ if (_ntOptions.PreAllocateOutFile && !_isSplit && _curSize_Defined && _curSize > (1 << 12))
1504
+ {
1505
+ // UInt64 ticks = GetCpuTicks();
1506
+ _fileLength_that_WasSet = _curSize;
1507
+ bool res = _outFileStreamSpec->File.SetLength(_curSize);
1508
+ _fileLength_WasSet = res;
1509
+
1510
+ // ticks = GetCpuTicks() - ticks;
1511
+ // printf("\nticks = %10d\n", (unsigned)ticks);
1512
+ if (!res)
1513
+ {
1514
+ RINOK(SendMessageError_with_LastError(kCantSetFileLen, fullProcessedPath))
1515
+ }
1516
+
1517
+ /*
1518
+ _outFileStreamSpec->File.Close();
1519
+ ticks = GetCpuTicks() - ticks;
1520
+ printf("\nticks = %10d\n", (unsigned)ticks);
1521
+ return S_FALSE;
1522
+ */
1523
+
1524
+ /*
1525
+ File.SetLength() on FAT (xp64): is fast, but then File.Close() can be slow,
1526
+ if we don't write any data.
1527
+ File.SetLength() for remote share file (exFAT) can be slow in some cases,
1528
+ and the Windows can return "network error" after 1 minute,
1529
+ while remote file still can grow.
1530
+ We need some way to detect such bad cases and disable PreAllocateOutFile mode.
1531
+ */
1532
+
1533
+ res = _outFileStreamSpec->SeekToBegin_bool();
1534
+ if (!res)
1535
+ {
1536
+ RINOK(SendMessageError_with_LastError("Cannot seek to begin of file", fullProcessedPath))
1537
+ }
1538
+ } // PreAllocateOutFile
1539
+
1540
+ #ifdef SUPPORT_ALT_STREAMS
1541
+ if (_isRenamed && !_item.IsAltStream)
1542
+ {
1543
+ CIndexToPathPair pair(index, fullProcessedPath);
1544
+ unsigned oldSize = _renamedFiles.Size();
1545
+ unsigned insertIndex = _renamedFiles.AddToUniqueSorted(pair);
1546
+ if (oldSize == _renamedFiles.Size())
1547
+ _renamedFiles[insertIndex].Path = fullProcessedPath;
1548
+ }
1549
+ #endif // SUPPORT_ALT_STREAMS
1550
+
1551
+ if (_isSplit)
1552
+ {
1553
+ RINOK(outFileStream_Loc->Seek((Int64)_position, STREAM_SEEK_SET, NULL))
1554
+ }
1555
+ outStreamLoc = outFileStream_Loc;
1556
+ } // if not reparse
1557
+
1558
+ _outFileStream = outFileStream_Loc;
1559
+
1560
+ needExit = false;
1561
+ return S_OK;
1562
+ }
1563
+
1564
+
1565
+
1566
+ HRESULT CArchiveExtractCallback::GetItem(UInt32 index)
1567
+ {
1568
+ #ifndef Z7_SFX
1569
+ _item._use_baseParentFolder_mode = _use_baseParentFolder_mode;
1570
+ if (_use_baseParentFolder_mode)
1571
+ {
1572
+ _item._baseParentFolder = (int)_baseParentFolder;
1573
+ if (_pathMode == NExtract::NPathMode::kFullPaths ||
1574
+ _pathMode == NExtract::NPathMode::kAbsPaths)
1575
+ _item._baseParentFolder = -1;
1576
+ }
1577
+ #endif // Z7_SFX
1578
+
1579
+ #ifdef SUPPORT_ALT_STREAMS
1580
+ _item.WriteToAltStreamIfColon = _ntOptions.WriteToAltStreamIfColon;
1581
+ #endif
1582
+
1583
+ return _arc->GetItem(index, _item);
1584
+ }
1585
+
1586
+
1587
+ Z7_COM7F_IMF(CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode))
1588
+ {
1589
+ COM_TRY_BEGIN
1590
+
1591
+ *outStream = NULL;
1592
+
1593
+ #ifndef Z7_SFX
1594
+ if (_hashStream)
1595
+ _hashStreamSpec->ReleaseStream();
1596
+ _hashStreamWasUsed = false;
1597
+ #endif
1598
+
1599
+ _outFileStream.Release();
1600
+ _bufPtrSeqOutStream.Release();
1601
+
1602
+ _encrypted = false;
1603
+ _isSplit = false;
1604
+ _curSize_Defined = false;
1605
+ _fileLength_WasSet = false;
1606
+ _isRenamed = false;
1607
+ // _fi.Clear();
1608
+ _extractMode = false;
1609
+ _is_SymLink_in_Data_Linux = false;
1610
+ _needSetAttrib = false;
1611
+ _isSymLinkCreated = false;
1612
+ _itemFailure = false;
1613
+ _some_pathParts_wereRemoved = false;
1614
+ // _op_WasReported = false;
1615
+
1616
+ _position = 0;
1617
+ _curSize = 0;
1618
+ _fileLength_that_WasSet = 0;
1619
+ _index = index;
1620
+
1621
+ #if defined(_WIN32) && !defined(UNDER_CE)
1622
+ _altStream_NeedRestore_AttribVal = 0;
1623
+ _altStream_NeedRestore_Attrib_for_parentFsPath.Empty();
1624
+ #endif
1625
+
1626
+ _diskFilePath.Empty();
1627
+
1628
+ #ifdef SUPPORT_LINKS
1629
+ // _copyFile_Path.Empty();
1630
+ _link.Clear();
1631
+ #endif
1632
+
1633
+
1634
+ switch (askExtractMode)
1635
+ {
1636
+ case NArchive::NExtract::NAskMode::kExtract:
1637
+ if (_testMode)
1638
+ {
1639
+ // askExtractMode = NArchive::NExtract::NAskMode::kTest;
1640
+ }
1641
+ else
1642
+ _extractMode = true;
1643
+ break;
1644
+ default: break;
1645
+ }
1646
+
1647
+
1648
+ IInArchive * const archive = _arc->Archive;
1649
+
1650
+ RINOK(GetItem(index))
1651
+
1652
+ {
1653
+ NCOM::CPropVariant prop;
1654
+ RINOK(archive->GetProperty(index, kpidPosition, &prop))
1655
+ if (prop.vt != VT_EMPTY)
1656
+ {
1657
+ if (prop.vt != VT_UI8)
1658
+ return E_FAIL;
1659
+ _position = prop.uhVal.QuadPart;
1660
+ _isSplit = true;
1661
+ }
1662
+ }
1663
+
1664
+ #ifdef SUPPORT_LINKS
1665
+ RINOK(ReadLink())
1666
+ #endif
1667
+
1668
+ RINOK(Archive_GetItemBoolProp(archive, index, kpidEncrypted, _encrypted))
1669
+
1670
+ RINOK(GetUnpackSize())
1671
+
1672
+ #ifdef SUPPORT_ALT_STREAMS
1673
+ if (!_ntOptions.AltStreams.Val && _item.IsAltStream)
1674
+ return S_OK;
1675
+ #endif // SUPPORT_ALT_STREAMS
1676
+
1677
+ // we can change (_item.PathParts) in this function
1678
+ UStringVector &pathParts = _item.PathParts;
1679
+
1680
+ if (_wildcardCensor)
1681
+ {
1682
+ if (!CensorNode_CheckPath(*_wildcardCensor, _item))
1683
+ return S_OK;
1684
+ }
1685
+
1686
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
1687
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract
1688
+ && !_testMode
1689
+ && _item.IsAltStream
1690
+ && ZoneBuf.Size() != 0
1691
+ && Is_ZoneId_StreamName(_item.AltStreamName))
1692
+ if (ZoneMode != NExtract::NZoneIdMode::kOffice
1693
+ || _item.PathParts.IsEmpty()
1694
+ || FindExt2(kOfficeExtensions, _item.PathParts.Back()))
1695
+ return S_OK;
1696
+ #endif
1697
+
1698
+
1699
+ #ifndef Z7_SFX
1700
+ if (_use_baseParentFolder_mode)
1701
+ {
1702
+ if (!pathParts.IsEmpty())
1703
+ {
1704
+ unsigned numRemovePathParts = 0;
1705
+
1706
+ #ifdef SUPPORT_ALT_STREAMS
1707
+ if (_pathMode == NExtract::NPathMode::kNoPathsAlt && _item.IsAltStream)
1708
+ numRemovePathParts = pathParts.Size();
1709
+ else
1710
+ #endif
1711
+ if (_pathMode == NExtract::NPathMode::kNoPaths ||
1712
+ _pathMode == NExtract::NPathMode::kNoPathsAlt)
1713
+ numRemovePathParts = pathParts.Size() - 1;
1714
+ pathParts.DeleteFrontal(numRemovePathParts);
1715
+ }
1716
+ }
1717
+ else
1718
+ #endif // Z7_SFX
1719
+ {
1720
+ if (pathParts.IsEmpty())
1721
+ {
1722
+ if (_item.IsDir)
1723
+ return S_OK;
1724
+ /*
1725
+ #ifdef SUPPORT_ALT_STREAMS
1726
+ if (!_item.IsAltStream)
1727
+ #endif
1728
+ return E_FAIL;
1729
+ */
1730
+ }
1731
+
1732
+ unsigned numRemovePathParts = 0;
1733
+
1734
+ switch ((int)_pathMode)
1735
+ {
1736
+ case NExtract::NPathMode::kFullPaths:
1737
+ case NExtract::NPathMode::kCurPaths:
1738
+ {
1739
+ if (_removePathParts.IsEmpty())
1740
+ break;
1741
+ bool badPrefix = false;
1742
+
1743
+ if (pathParts.Size() < _removePathParts.Size())
1744
+ badPrefix = true;
1745
+ else
1746
+ {
1747
+ if (pathParts.Size() == _removePathParts.Size())
1748
+ {
1749
+ if (_removePartsForAltStreams)
1750
+ {
1751
+ #ifdef SUPPORT_ALT_STREAMS
1752
+ if (!_item.IsAltStream)
1753
+ #endif
1754
+ badPrefix = true;
1755
+ }
1756
+ else
1757
+ {
1758
+ if (!_item.MainIsDir)
1759
+ badPrefix = true;
1760
+ }
1761
+ }
1762
+
1763
+ if (!badPrefix)
1764
+ FOR_VECTOR (i, _removePathParts)
1765
+ {
1766
+ if (CompareFileNames(_removePathParts[i], pathParts[i]) != 0)
1767
+ {
1768
+ badPrefix = true;
1769
+ break;
1770
+ }
1771
+ }
1772
+ }
1773
+
1774
+ if (badPrefix)
1775
+ {
1776
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
1777
+ return E_FAIL;
1778
+ }
1779
+ else
1780
+ {
1781
+ numRemovePathParts = _removePathParts.Size();
1782
+ _some_pathParts_wereRemoved = true;
1783
+ }
1784
+ break;
1785
+ }
1786
+
1787
+ case NExtract::NPathMode::kNoPaths:
1788
+ {
1789
+ if (!pathParts.IsEmpty())
1790
+ numRemovePathParts = pathParts.Size() - 1;
1791
+ break;
1792
+ }
1793
+ case NExtract::NPathMode::kNoPathsAlt:
1794
+ {
1795
+ #ifdef SUPPORT_ALT_STREAMS
1796
+ if (_item.IsAltStream)
1797
+ numRemovePathParts = pathParts.Size();
1798
+ else
1799
+ #endif
1800
+ if (!pathParts.IsEmpty())
1801
+ numRemovePathParts = pathParts.Size() - 1;
1802
+ break;
1803
+ }
1804
+ case NExtract::NPathMode::kAbsPaths:
1805
+ default:
1806
+ break;
1807
+ }
1808
+
1809
+ pathParts.DeleteFrontal(numRemovePathParts);
1810
+ }
1811
+
1812
+
1813
+ #ifndef Z7_SFX
1814
+
1815
+ if (ExtractToStreamCallback)
1816
+ {
1817
+ CMyComPtr2_Create<IGetProp, CGetProp> GetProp;
1818
+ GetProp->Arc = _arc;
1819
+ GetProp->IndexInArc = index;
1820
+ UString name (MakePathFromParts(pathParts));
1821
+ // GetProp->BaseName = name;
1822
+ #ifdef SUPPORT_ALT_STREAMS
1823
+ if (_item.IsAltStream)
1824
+ {
1825
+ if (!pathParts.IsEmpty() || (!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt))
1826
+ name.Add_Colon();
1827
+ name += _item.AltStreamName;
1828
+ }
1829
+ #endif
1830
+
1831
+ return ExtractToStreamCallback->GetStream7(name, BoolToInt(_item.IsDir), outStream, askExtractMode, GetProp);
1832
+ }
1833
+
1834
+ #endif // Z7_SFX
1835
+
1836
+
1837
+ CMyComPtr<ISequentialOutStream> outStreamLoc;
1838
+
1839
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
1840
+ {
1841
+ if (_stdOutMode)
1842
+ outStreamLoc = new CStdOutFileStream;
1843
+ else
1844
+ {
1845
+ bool needExit = true;
1846
+ RINOK(GetExtractStream(outStreamLoc, needExit))
1847
+ if (needExit)
1848
+ return S_OK;
1849
+ }
1850
+ }
1851
+
1852
+ #ifndef Z7_SFX
1853
+ if (_hashStream)
1854
+ {
1855
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract ||
1856
+ askExtractMode == NArchive::NExtract::NAskMode::kTest)
1857
+ {
1858
+ _hashStreamSpec->SetStream(outStreamLoc);
1859
+ outStreamLoc = _hashStream;
1860
+ _hashStreamSpec->Init(true);
1861
+ _hashStreamWasUsed = true;
1862
+ }
1863
+ }
1864
+ #endif // Z7_SFX
1865
+
1866
+ if (outStreamLoc)
1867
+ {
1868
+ /*
1869
+ #ifdef SUPPORT_LINKS
1870
+ if (!_copyFile_Path.IsEmpty())
1871
+ {
1872
+ RINOK(PrepareOperation(askExtractMode));
1873
+ RINOK(MyCopyFile(outStreamLoc));
1874
+ return SetOperationResult(NArchive::NExtract::NOperationResult::kOK);
1875
+ }
1876
+ if (_link.isCopyLink && _testMode)
1877
+ return S_OK;
1878
+ #endif
1879
+ */
1880
+ *outStream = outStreamLoc.Detach();
1881
+ }
1882
+
1883
+ return S_OK;
1884
+
1885
+ COM_TRY_END
1886
+ }
1887
+
1888
+
1889
+
1890
+
1891
+
1892
+
1893
+
1894
+
1895
+
1896
+
1897
+
1898
+ Z7_COM7F_IMF(CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode))
1899
+ {
1900
+ COM_TRY_BEGIN
1901
+
1902
+ #ifndef Z7_SFX
1903
+ // if (!_op_WasReported)
1904
+ if (ExtractToStreamCallback)
1905
+ return ExtractToStreamCallback->PrepareOperation7(askExtractMode);
1906
+ #endif
1907
+
1908
+ _extractMode = false;
1909
+
1910
+ switch (askExtractMode)
1911
+ {
1912
+ case NArchive::NExtract::NAskMode::kExtract:
1913
+ if (_testMode)
1914
+ askExtractMode = NArchive::NExtract::NAskMode::kTest;
1915
+ else
1916
+ _extractMode = true;
1917
+ break;
1918
+ default: break;
1919
+ }
1920
+
1921
+ // if (_op_WasReported) return S_OK;
1922
+
1923
+ return _extractCallback2->PrepareOperation(_item.Path, BoolToInt(_item.IsDir),
1924
+ askExtractMode, _isSplit ? &_position: NULL);
1925
+
1926
+ COM_TRY_END
1927
+ }
1928
+
1929
+
1930
+
1931
+
1932
+
1933
+ HRESULT CArchiveExtractCallback::CloseFile()
1934
+ {
1935
+ if (!_outFileStream)
1936
+ return S_OK;
1937
+
1938
+ HRESULT hres = S_OK;
1939
+
1940
+ const UInt64 processedSize = _outFileStreamSpec->ProcessedSize;
1941
+ if (_fileLength_WasSet && _fileLength_that_WasSet > processedSize)
1942
+ {
1943
+ const bool res = _outFileStreamSpec->File.SetLength(processedSize);
1944
+ _fileLength_WasSet = res;
1945
+ if (!res)
1946
+ {
1947
+ const HRESULT hres2 = SendMessageError_with_LastError(kCantSetFileLen, us2fs(_item.Path));
1948
+ if (hres == S_OK)
1949
+ hres = hres2;
1950
+ }
1951
+ }
1952
+
1953
+ _curSize = processedSize;
1954
+ _curSize_Defined = true;
1955
+
1956
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
1957
+ if (ZoneBuf.Size() != 0
1958
+ && !_item.IsAltStream)
1959
+ {
1960
+ // if (NFind::DoesFileExist_Raw(tempFilePath))
1961
+ if (ZoneMode != NExtract::NZoneIdMode::kOffice ||
1962
+ FindExt2(kOfficeExtensions, fs2us(_diskFilePath)))
1963
+ {
1964
+ // we must write zone file before setting of timestamps
1965
+ if (!WriteZoneFile_To_BaseFile(_diskFilePath, ZoneBuf))
1966
+ {
1967
+ // we can't write it in FAT
1968
+ // SendMessageError_with_LastError("Can't write Zone.Identifier stream", path);
1969
+ }
1970
+ }
1971
+ }
1972
+ #endif
1973
+
1974
+ CFiTimesCAM t;
1975
+ GetFiTimesCAM(_fi, t, *_arc);
1976
+
1977
+ // #ifdef _WIN32
1978
+ if (t.IsSomeTimeDefined())
1979
+ _outFileStreamSpec->SetTime(
1980
+ t.CTime_Defined ? &t.CTime : NULL,
1981
+ t.ATime_Defined ? &t.ATime : NULL,
1982
+ t.MTime_Defined ? &t.MTime : NULL);
1983
+ // #endif
1984
+
1985
+ RINOK(_outFileStreamSpec->Close())
1986
+ _outFileStream.Release();
1987
+
1988
+ #if defined(_WIN32) && !defined(UNDER_CE)
1989
+ if (!_altStream_NeedRestore_Attrib_for_parentFsPath.IsEmpty())
1990
+ {
1991
+ SetFileAttrib(_altStream_NeedRestore_Attrib_for_parentFsPath, _altStream_NeedRestore_AttribVal);
1992
+ _altStream_NeedRestore_Attrib_for_parentFsPath.Empty();
1993
+ }
1994
+ #endif
1995
+
1996
+ return hres;
1997
+ }
1998
+
1999
+
2000
+ #ifdef SUPPORT_LINKS
2001
+
2002
+ static bool CheckLinkPath_in_FS_for_pathParts(const FString &path, const UStringVector &v)
2003
+ {
2004
+ FString path2 = path;
2005
+ FOR_VECTOR (i, v)
2006
+ {
2007
+ // if (i == v.Size() - 1) path = path2; // we don't need last part in returned path
2008
+ path2 += us2fs(v[i]);
2009
+ NFind::CFileInfo fi;
2010
+ // printf("\nCheckLinkPath_in_FS_for_pathParts(): %s\n", GetOemString(path2).Ptr());
2011
+ if (fi.Find(path2) && fi.IsOsSymLink())
2012
+ return false;
2013
+ path2.Add_PathSepar();
2014
+ }
2015
+ return true;
2016
+ }
2017
+
2018
+ /*
2019
+ link.isRelative / relative_item_PathPrefix
2020
+ false / empty
2021
+ true / item path without last part
2022
+ */
2023
+ static bool CheckLinkPath_in_FS(
2024
+ const FString &pathPrefix_in_FS,
2025
+ const CPostLink &postLink,
2026
+ const UString &relative_item_PathPrefix)
2027
+ {
2028
+ const CLinkInfo &link = postLink.LinkInfo;
2029
+ if (postLink.item_PathParts.IsEmpty() || link.LinkPath.IsEmpty())
2030
+ return false;
2031
+ FString path;
2032
+ {
2033
+ const UString &s = postLink.item_PathParts[0];
2034
+ if (!s.IsEmpty() && !NName::IsAbsolutePath(s))
2035
+ path = pathPrefix_in_FS; // item_PathParts is relative. So we use absolutre prefix
2036
+ }
2037
+ if (!CheckLinkPath_in_FS_for_pathParts(path, postLink.item_PathParts))
2038
+ return false;
2039
+ path += us2fs(relative_item_PathPrefix);
2040
+ UStringVector v;
2041
+ SplitPathToParts(link.LinkPath, v);
2042
+ // we check target paths:
2043
+ return CheckLinkPath_in_FS_for_pathParts(path, v);
2044
+ }
2045
+
2046
+ static const unsigned k_DangLevel_MAX_for_Link_over_Link = 9;
2047
+
2048
+ HRESULT CArchiveExtractCallback::CreateHardLink2(
2049
+ const FString &newFilePath, const FString &existFilePath, bool &link_was_Created) const
2050
+ {
2051
+ link_was_Created = false;
2052
+ if (_ntOptions.SymLinks_DangerousLevel <= k_DangLevel_MAX_for_Link_over_Link)
2053
+ {
2054
+ NFind::CFileInfo fi;
2055
+ if (fi.Find(existFilePath) && fi.IsOsSymLink())
2056
+ return SendMessageError2(0, k_HardLink_to_SymLink_Ignored, newFilePath, existFilePath);
2057
+ }
2058
+ if (!MyCreateHardLink(newFilePath, existFilePath))
2059
+ return SendMessageError2_with_LastError(kCantCreateHardLink, newFilePath, existFilePath);
2060
+ link_was_Created = true;
2061
+ return S_OK;
2062
+ }
2063
+
2064
+
2065
+
2066
+ HRESULT CArchiveExtractCallback::SetLink(
2067
+ const FString &fullProcessedPath_from,
2068
+ const CLinkInfo &link,
2069
+ bool &linkWasSet) // placeholder was created
2070
+ {
2071
+ linkWasSet = false;
2072
+ if (link.LinkPath.IsEmpty())
2073
+ return S_OK;
2074
+ if (!_ntOptions.SymLinks.Val && link.Is_AnySymLink())
2075
+ return S_OK;
2076
+ CPostLink postLink;
2077
+ postLink.Index_in_Arc = _index;
2078
+ postLink.item_IsDir = _item.IsDir;
2079
+ postLink.item_Path = _item.Path;
2080
+ postLink.item_PathParts = _item.PathParts;
2081
+ postLink.item_FileInfo = _fi;
2082
+ postLink.fullProcessedPath_from = fullProcessedPath_from;
2083
+ postLink.LinkInfo = link;
2084
+ _postLinks.Add(postLink);
2085
+
2086
+ // file doesn't exist in most cases. So we don't check for error.
2087
+ DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, false); // checkThatFileIsEmpty = false
2088
+
2089
+ NIO::COutFile outFile;
2090
+ if (!outFile.Create_NEW(fullProcessedPath_from))
2091
+ return SendMessageError("Cannot create temporary link file", fullProcessedPath_from);
2092
+ #if 0 // 1 for debug
2093
+ // here we can write link path to temporary link file placeholder,
2094
+ // but empty placeholder is better, because we don't want to get any non-eampty data instead of link file.
2095
+ AString s;
2096
+ ConvertUnicodeToUTF8(link.LinkPath, s);
2097
+ outFile.WriteFull(s, s.Len());
2098
+ #endif
2099
+ linkWasSet = true;
2100
+ return S_OK;
2101
+ }
2102
+
2103
+
2104
+ // if file/dir is symbolic link it will remove only link itself
2105
+ HRESULT CArchiveExtractCallback::DeleteLinkFileAlways_or_RemoveEmptyDir(
2106
+ const FString &path, bool checkThatFileIsEmpty) const
2107
+ {
2108
+ NFile::NFind::CFileInfo fi;
2109
+ if (fi.Find(path)) // followLink = false
2110
+ {
2111
+ if (fi.IsDir())
2112
+ {
2113
+ if (RemoveDirAlways_if_Empty(path))
2114
+ return S_OK;
2115
+ }
2116
+ else
2117
+ {
2118
+ // link file placeholder must be empty
2119
+ if (checkThatFileIsEmpty && !fi.IsOsSymLink() && fi.Size != 0)
2120
+ return SendMessageError("Temporary link file is not empty", path);
2121
+ if (DeleteFileAlways(path))
2122
+ return S_OK;
2123
+ }
2124
+ if (GetLastError() != ERROR_FILE_NOT_FOUND)
2125
+ return SendMessageError_with_LastError(
2126
+ fi.IsDir() ?
2127
+ k_CantDelete_Dir_for_SymLink:
2128
+ k_CantDelete_File_for_SymLink,
2129
+ path);
2130
+ }
2131
+ return S_OK;
2132
+ }
2133
+
2134
+
2135
+ /*
2136
+ in:
2137
+ link.LinkPath : must be relative (non-absolute) path in any case !!!
2138
+ link.isRelative / target path that must stored as created link:
2139
+ == false / _dirPathPrefix_Full + link.LinkPath
2140
+ == true / link.LinkPath
2141
+ */
2142
+ static HRESULT SetLink2(const CArchiveExtractCallback &callback,
2143
+ const CPostLink &postLink, bool &linkWasSet)
2144
+ {
2145
+ const CLinkInfo &link = postLink.LinkInfo;
2146
+ const FString &fullProcessedPath_from = postLink.fullProcessedPath_from; // full file path in FS (fullProcessedPath_from)
2147
+
2148
+ const unsigned level = callback._ntOptions.SymLinks_DangerousLevel;
2149
+ if (level < 20)
2150
+ {
2151
+ /*
2152
+ We want to use additional check for links that can link to directory.
2153
+ - linux: all symbolic links are files.
2154
+ - windows: we can have file/directory symbolic link,
2155
+ but file symbolic link works like directory link in windows.
2156
+ So we use additional check for all relative links.
2157
+
2158
+ We don't allow decreasing of final level of link.
2159
+ So if some another extracted file will use this link,
2160
+ then number of real path parts (after link redirection) cannot be
2161
+ smaller than number of requested path parts from archive records.
2162
+
2163
+ here we check only (link.LinkPath) without (_item.PathParts).
2164
+ */
2165
+ CLinkLevelsInfo li;
2166
+ li.Parse(link.LinkPath, link.Is_WSL());
2167
+ bool isDang;
2168
+ UString relativePathPrefix;
2169
+ if (li.IsAbsolute // unexpected
2170
+ || li.ParentDirDots_after_NonParent
2171
+ || (level <= 5 && link.isRelative && li.FinalLevel < 1) // final level lower
2172
+ || (level <= 5 && link.isRelative && li.LowLevel < 0) // negative temporary levels
2173
+ )
2174
+ isDang = true;
2175
+ else // if (!isDang)
2176
+ {
2177
+ UString path;
2178
+ if (link.isRelative)
2179
+ {
2180
+ // item_PathParts : parts that will be created in output folder.
2181
+ // we want to get directory prefix of link item.
2182
+ // so we remove file name (last non-empty part) from PathParts:
2183
+ UStringVector v = postLink.item_PathParts;
2184
+ while (!v.IsEmpty())
2185
+ {
2186
+ const unsigned len = v.Back().Len();
2187
+ v.DeleteBack();
2188
+ if (len)
2189
+ break;
2190
+ }
2191
+ path = MakePathFromParts(v);
2192
+ NName::NormalizeDirPathPrefix(path);
2193
+ relativePathPrefix = path;
2194
+ }
2195
+ path += link.LinkPath;
2196
+ /*
2197
+ path is calculated virtual target path of link
2198
+ path is relative to root folder of extracted items
2199
+ if (!link.isRelative), then (path == link.LinkPath)
2200
+ */
2201
+ isDang = false;
2202
+ if (!IsSafePath(path, link.Is_WSL()))
2203
+ isDang = true;
2204
+ }
2205
+ const char *message = NULL;
2206
+ if (isDang)
2207
+ message = "Dangerous link path was ignored";
2208
+ else if (level <= k_DangLevel_MAX_for_Link_over_Link
2209
+ && !CheckLinkPath_in_FS(callback._dirPathPrefix_Full,
2210
+ postLink, relativePathPrefix))
2211
+ message = "Dangerous link via another link was ignored";
2212
+ if (message)
2213
+ return callback.SendMessageError2(0, // errorCode
2214
+ message, us2fs(postLink.item_Path), us2fs(link.LinkPath));
2215
+ }
2216
+
2217
+ FString target; // target path that will be stored to link field
2218
+ if (link.Is_HardLink() /* || link.IsCopyLink */ || !link.isRelative)
2219
+ {
2220
+ // isRelative == false
2221
+ // all hard links and absolute symbolic links
2222
+ // relatPath == link.LinkPath
2223
+ // we get absolute link path for target:
2224
+ if (!NName::GetFullPath(callback._dirPathPrefix_Full, us2fs(link.LinkPath), target))
2225
+ return callback.SendMessageError("Incorrect link path", us2fs(link.LinkPath));
2226
+ // (target) is (_dirPathPrefix_Full + relatPath)
2227
+ }
2228
+ else
2229
+ {
2230
+ // link.isRelative == true
2231
+ // relative symbolic links only
2232
+ target = us2fs(link.LinkPath);
2233
+ }
2234
+ if (target.IsEmpty())
2235
+ return callback.SendMessageError("Empty link", fullProcessedPath_from);
2236
+
2237
+ if (link.Is_HardLink() /* || link.IsCopyLink */)
2238
+ {
2239
+ // if (link.isHardLink)
2240
+ {
2241
+ RINOK(callback.DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, true)) // checkThatFileIsEmpty
2242
+ {
2243
+ // RINOK(SendMessageError_with_LastError(k_Cant_DeleteTempLinkFile, fullProcessedPath_from))
2244
+ }
2245
+ return callback.CreateHardLink2(fullProcessedPath_from, target, linkWasSet);
2246
+ /*
2247
+ RINOK(PrepareOperation(NArchive::NExtract::NAskMode::kExtract))
2248
+ _op_WasReported = true;
2249
+ RINOK(SetOperationResult(NArchive::NExtract::NOperationResult::kOK))
2250
+ linkWasSet = true;
2251
+ return S_OK;
2252
+ */
2253
+ }
2254
+ /*
2255
+ // IsCopyLink
2256
+ {
2257
+ NFind::CFileInfo fi;
2258
+ if (!fi.Find(target))
2259
+ {
2260
+ RINOK(SendMessageError2("Cannot find the file for copying", target, fullProcessedPath));
2261
+ }
2262
+ else
2263
+ {
2264
+ if (_curSize_Defined && _curSize == fi.Size)
2265
+ _copyFile_Path = target;
2266
+ else
2267
+ {
2268
+ RINOK(SendMessageError2("File size collision for file copying", target, fullProcessedPath));
2269
+ }
2270
+ // RINOK(MyCopyFile(target, fullProcessedPath));
2271
+ }
2272
+ }
2273
+ */
2274
+ }
2275
+
2276
+ // is Symbolic link
2277
+
2278
+ /*
2279
+ if (_item.IsDir && !isRelative)
2280
+ {
2281
+ // Windows before Vista doesn't support symbolic links.
2282
+ // we could convert such symbolic links to Junction Points
2283
+ // isJunction = true;
2284
+ }
2285
+ */
2286
+
2287
+ #ifdef _WIN32
2288
+ const bool isDir = (postLink.item_IsDir || link.LinkType == k_LinkType_Junction);
2289
+ #endif
2290
+
2291
+
2292
+ #ifdef _WIN32
2293
+ CByteBuffer data;
2294
+ // printf("\nFillLinkData(): %s\n", GetOemString(target).Ptr());
2295
+ if (link.Is_WSL())
2296
+ {
2297
+ Convert_WinPath_to_WslLinuxPath(target, !link.isRelative);
2298
+ FillLinkData_WslLink(data, fs2us(target));
2299
+ }
2300
+ else
2301
+ FillLinkData_WinLink(data, fs2us(target), link.LinkType != k_LinkType_Junction);
2302
+ if (data.Size() == 0)
2303
+ return callback.SendMessageError("Cannot fill link data", us2fs(postLink.item_Path));
2304
+ /*
2305
+ if (NtReparse_Size != data.Size() || memcmp(NtReparse_Data, data, data.Size()) != 0)
2306
+ SendMessageError("reconstructed Reparse is different", fs2us(target));
2307
+ */
2308
+ {
2309
+ // we check that reparse data is correct, but we ignore attr.MinorError.
2310
+ CReparseAttr attr;
2311
+ if (!attr.Parse(data, data.Size()))
2312
+ return callback.SendMessageError("Internal error for symbolic link file", us2fs(postLink.item_Path));
2313
+ }
2314
+ #endif
2315
+
2316
+ RINOK(callback.DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, true)) // checkThatFileIsEmpty
2317
+ #ifdef _WIN32
2318
+ if (!NFile::NIO::SetReparseData(fullProcessedPath_from, isDir, data, (DWORD)data.Size()))
2319
+ #else // ! _WIN32
2320
+ if (!NFile::NIO::SetSymLink(fullProcessedPath_from, target))
2321
+ #endif // ! _WIN32
2322
+ {
2323
+ return callback.SendMessageError_with_LastError(kCantCreateSymLink, fullProcessedPath_from);
2324
+ }
2325
+ linkWasSet = true;
2326
+ return S_OK;
2327
+ }
2328
+
2329
+
2330
+
2331
+ bool CLinkInfo::Parse_from_WindowsReparseData(const Byte *data, size_t dataSize)
2332
+ {
2333
+ CReparseAttr reparse;
2334
+ if (!reparse.Parse(data, dataSize))
2335
+ return false;
2336
+ // const AString s = GetAnsiString(LinkPath);
2337
+ // printf("\nlinkPath: %s\n", s.Ptr());
2338
+ LinkPath = reparse.GetPath();
2339
+ if (reparse.IsSymLink_WSL())
2340
+ {
2341
+ LinkType = k_LinkType_WSL;
2342
+ isRelative = reparse.IsRelative_WSL(); // detected from LinkPath[0]
2343
+ // LinkPath is original raw name converted to UString from AString
2344
+ // Linux separator '/' is expected here.
2345
+ REPLACE_SLASHES_from_Linux_to_Sys(LinkPath)
2346
+ }
2347
+ else
2348
+ {
2349
+ LinkType = reparse.IsMountPoint() ? k_LinkType_Junction : k_LinkType_PureSymLink;
2350
+ isRelative = reparse.IsRelative_Win(); // detected by (Flags == Z7_WIN_SYMLINK_FLAG_RELATIVE)
2351
+ isWindowsPath = true;
2352
+ // LinkPath is original windows link path from raparse data with \??\ prefix removed.
2353
+ // windows '\\' separator is expected here.
2354
+ // linux '/' separator is not expected here.
2355
+ // we translate both types of separators to system separator.
2356
+ LinkPath.Replace(
2357
+ #if WCHAR_PATH_SEPARATOR == L'\\'
2358
+ L'/'
2359
+ #else
2360
+ L'\\'
2361
+ #endif
2362
+ , WCHAR_PATH_SEPARATOR);
2363
+ }
2364
+ // (LinkPath) uses system path separator.
2365
+ // windows: (LinkPath) doesn't contain linux separator (slash).
2366
+ return true;
2367
+ }
2368
+
2369
+
2370
+ bool CLinkInfo::Parse_from_LinuxData(const Byte *data, size_t dataSize)
2371
+ {
2372
+ // Clear(); // *this object was cleared by constructor already.
2373
+ LinkType = k_LinkType_PureSymLink;
2374
+ AString utf;
2375
+ if (dataSize >= k_LinkDataSize_LIMIT)
2376
+ return false;
2377
+ utf.SetFrom_CalcLen((const char *)data, (unsigned)dataSize);
2378
+ UString u;
2379
+ if (!ConvertUTF8ToUnicode(utf, u))
2380
+ return false;
2381
+ if (u.IsEmpty())
2382
+ return false;
2383
+ const wchar_t c = u[0];
2384
+ isRelative = (c != L'/');
2385
+ // linux path separator is expected
2386
+ REPLACE_SLASHES_from_Linux_to_Sys(u)
2387
+ LinkPath = u;
2388
+ // (LinkPath) uses system path separator.
2389
+ // windows: (LinkPath) doesn't contain linux separator (slash).
2390
+ return true;
2391
+ }
2392
+
2393
+
2394
+ // in/out: (LinkPath) uses system path separator
2395
+ // in/out: windows: (LinkPath) doesn't contain linux separator (slash).
2396
+ // out: (LinkPath) is relative path, and LinkPath[0] is not path separator
2397
+ // out: isRelative changed to false, if any prefix was removed.
2398
+ // note: absolute windows links "c:\" to root will be reduced to empty string:
2399
+ void CLinkInfo::Remove_AbsPathPrefixes()
2400
+ {
2401
+ while (!LinkPath.IsEmpty())
2402
+ {
2403
+ unsigned n = 0;
2404
+ if (!Is_WSL())
2405
+ {
2406
+ n =
2407
+ #ifndef _WIN32
2408
+ isWindowsPath ?
2409
+ NName::GetRootPrefixSize_WINDOWS(LinkPath) :
2410
+ #endif
2411
+ NName::GetRootPrefixSize(LinkPath);
2412
+ /*
2413
+ // "c:path" will be ignored later as "Dangerous absolute path"
2414
+ // so check is not required
2415
+ if (n == 0
2416
+ #ifndef _WIN32
2417
+ && isWindowsPath
2418
+ #endif
2419
+ && NName::IsDrivePath2(LinkPath))
2420
+ n = 2;
2421
+ */
2422
+ }
2423
+ if (n == 0)
2424
+ {
2425
+ if (!IS_PATH_SEPAR(LinkPath[0]))
2426
+ break;
2427
+ n = 1;
2428
+ }
2429
+ isRelative = false; // (LinkPath) will be treated as relative to root folder of archive
2430
+ LinkPath.DeleteFrontal(n);
2431
+ }
2432
+ }
2433
+
2434
+
2435
+ /*
2436
+ it removes redundant separators, if there are double separators,
2437
+ but it keeps double separators at start of string //name/.
2438
+ in/out: system path separator is used
2439
+ windows: slash character (linux separator) is not treated as separator
2440
+ windows: (path) doesn't contain linux separator (slash).
2441
+ */
2442
+ static void RemoveRedundantPathSeparators(UString &path)
2443
+ {
2444
+ wchar_t *dest = path.GetBuf();
2445
+ const wchar_t * const start = dest;
2446
+ const wchar_t *src = dest;
2447
+ for (;;)
2448
+ {
2449
+ wchar_t c = *src++;
2450
+ if (c == 0)
2451
+ break;
2452
+ // if (IS_PATH_SEPAR(c)) // for Windows: we can change (/) to (\).
2453
+ if (c == WCHAR_PATH_SEPARATOR)
2454
+ {
2455
+ if (dest - start >= 2 && dest[-1] == WCHAR_PATH_SEPARATOR)
2456
+ continue;
2457
+ // c = WCHAR_PATH_SEPARATOR; // for Windows: we can change (/) to (\).
2458
+ }
2459
+ *dest++ = c;
2460
+ }
2461
+ *dest = 0;
2462
+ path.ReleaseBuf_SetLen((unsigned)(dest - path.Ptr()));
2463
+ }
2464
+
2465
+
2466
+ // in/out: (LinkPath) uses system path separator
2467
+ // in/out: windows: (LinkPath) doesn't contain linux separator (slash).
2468
+ // out: (LinkPath) is relative path, and LinkPath[0] is not path separator
2469
+ void CLinkInfo::Normalize_to_RelativeSafe(UStringVector &removePathParts)
2470
+ {
2471
+ // We WILL NOT WRITE original absolute link path from archive to filesystem.
2472
+ // So here we remove all root prefixes from (LinkPath).
2473
+ // If we see any absolute root prefix, then we suppose that this prefix is virtual prefix
2474
+ // that shows that link is relative to root folder of archive
2475
+ RemoveRedundantPathSeparators(LinkPath);
2476
+ // LinkPath = "\\\\?\\r:test\\test2"; // for debug
2477
+ Remove_AbsPathPrefixes();
2478
+ // (LinkPath) now is relative:
2479
+ // if (isRelative == false), then (LinkPath) is relative to root folder of archive
2480
+ // if (isRelative == true ), then (LinkPath) is relative to current item
2481
+ if (LinkPath.IsEmpty() || isRelative || removePathParts.Size() == 0)
2482
+ return;
2483
+
2484
+ // if LinkPath is prefixed by _removePathParts, we remove these paths
2485
+ UStringVector pathParts;
2486
+ SplitPathToParts(LinkPath, pathParts);
2487
+ bool badPrefix = false;
2488
+ {
2489
+ FOR_VECTOR (i, removePathParts)
2490
+ {
2491
+ if (i >= pathParts.Size()
2492
+ || CompareFileNames(removePathParts[i], pathParts[i]) != 0)
2493
+ {
2494
+ badPrefix = true;
2495
+ break;
2496
+ }
2497
+ }
2498
+ }
2499
+ if (!badPrefix)
2500
+ pathParts.DeleteFrontal(removePathParts.Size());
2501
+ LinkPath = MakePathFromParts(pathParts);
2502
+ Remove_AbsPathPrefixes();
2503
+ }
2504
+
2505
+ #endif // SUPPORT_LINKS
2506
+
2507
+
2508
+ HRESULT CArchiveExtractCallback::CloseReparseAndFile()
2509
+ {
2510
+ HRESULT res = S_OK;
2511
+
2512
+ #ifdef SUPPORT_LINKS
2513
+
2514
+ size_t reparseSize = 0;
2515
+ bool repraseMode = false;
2516
+ bool needSetReparse = false;
2517
+ CLinkInfo link;
2518
+
2519
+ if (_bufPtrSeqOutStream)
2520
+ {
2521
+ repraseMode = true;
2522
+ reparseSize = _bufPtrSeqOutStream_Spec->GetPos();
2523
+ if (_curSize_Defined && reparseSize == _outMemBuf.Size())
2524
+ {
2525
+ /*
2526
+ CReparseAttr reparse;
2527
+ DWORD errorCode = 0;
2528
+ needSetReparse = reparse.Parse(_outMemBuf, reparseSize, errorCode);
2529
+ if (needSetReparse)
2530
+ {
2531
+ UString LinkPath = reparse.GetPath();
2532
+ #ifndef _WIN32
2533
+ LinkPath.Replace(L'\\', WCHAR_PATH_SEPARATOR);
2534
+ #endif
2535
+ }
2536
+ */
2537
+ needSetReparse = _is_SymLink_in_Data_Linux ?
2538
+ link.Parse_from_LinuxData(_outMemBuf, reparseSize) :
2539
+ link.Parse_from_WindowsReparseData(_outMemBuf, reparseSize);
2540
+ if (!needSetReparse)
2541
+ res = SendMessageError_with_LastError("Incorrect reparse stream", us2fs(_item.Path));
2542
+ // (link.LinkPath) uses system path separator.
2543
+ // windows: (link.LinkPath) doesn't contain linux separator (slash).
2544
+ }
2545
+ else
2546
+ {
2547
+ res = SendMessageError_with_LastError("Unknown reparse stream", us2fs(_item.Path));
2548
+ }
2549
+ if (!needSetReparse && _outFileStream)
2550
+ {
2551
+ const HRESULT res2 = WriteStream(_outFileStream, _outMemBuf, reparseSize);
2552
+ if (res == S_OK)
2553
+ res = res2;
2554
+ }
2555
+ _bufPtrSeqOutStream.Release();
2556
+ }
2557
+
2558
+ #endif // SUPPORT_LINKS
2559
+
2560
+ const HRESULT res2 = CloseFile();
2561
+ if (res == S_OK)
2562
+ res = res2;
2563
+ RINOK(res)
2564
+
2565
+ #ifdef SUPPORT_LINKS
2566
+ if (repraseMode)
2567
+ {
2568
+ _curSize = reparseSize;
2569
+ _curSize_Defined = true;
2570
+ if (needSetReparse)
2571
+ {
2572
+ // empty file was created so we must delete it.
2573
+ // in Linux : we must delete empty file before symbolic link creation
2574
+ // in Windows : we can create symbolic link even without file deleting
2575
+ if (!DeleteFileAlways(_diskFilePath))
2576
+ {
2577
+ RINOK(SendMessageError_with_LastError("can't delete file", _diskFilePath))
2578
+ }
2579
+ {
2580
+ bool linkWasSet = false;
2581
+ // link.LinkPath = "r:\\1\\2"; // for debug
2582
+ // link.isJunction = true; // for debug
2583
+ link.Normalize_to_RelativeSafe(_removePathParts);
2584
+ RINOK(SetLink(_diskFilePath, link, linkWasSet))
2585
+ /*
2586
+ // we don't set attributes for placeholder.
2587
+ if (linkWasSet)
2588
+ _isSymLinkCreated = true; // link.IsSymLink();
2589
+ else
2590
+ */
2591
+ _needSetAttrib = false;
2592
+ }
2593
+ }
2594
+ }
2595
+ #endif // SUPPORT_LINKS
2596
+ return res;
2597
+ }
2598
+
2599
+
2600
+ static void SetAttrib_Base(const FString &path, const CProcessedFileInfo &fi,
2601
+ const CArchiveExtractCallback &callback)
2602
+ {
2603
+ #ifndef _WIN32
2604
+ if (fi.Owner.Id_Defined &&
2605
+ fi.Group.Id_Defined)
2606
+ {
2607
+ if (my_chown(path, fi.Owner.Id, fi.Group.Id) != 0)
2608
+ callback.SendMessageError_with_LastError("Cannot set owner", path);
2609
+ }
2610
+ #endif
2611
+
2612
+ if (fi.Attrib_Defined)
2613
+ {
2614
+ // const AString s = GetAnsiString(_diskFilePath);
2615
+ // printf("\nSetFileAttrib_PosixHighDetect: %s: hex:%x\n", s.Ptr(), _fi.Attrib);
2616
+ if (!SetFileAttrib_PosixHighDetect(path, fi.Attrib))
2617
+ {
2618
+ // do we need error message here in Windows and in posix?
2619
+ callback.SendMessageError_with_LastError("Cannot set file attribute", path);
2620
+ }
2621
+ }
2622
+ }
2623
+
2624
+ void CArchiveExtractCallback::SetAttrib() const
2625
+ {
2626
+ #ifndef _WIN32
2627
+ // Linux now doesn't support permissions for symlinks
2628
+ if (_isSymLinkCreated)
2629
+ return;
2630
+ #endif
2631
+
2632
+ if (_itemFailure
2633
+ || _diskFilePath.IsEmpty()
2634
+ || _stdOutMode
2635
+ || !_extractMode)
2636
+ return;
2637
+
2638
+ SetAttrib_Base(_diskFilePath, _fi, *this);
2639
+ }
2640
+
2641
+
2642
+ #ifdef Z7_USE_SECURITY_CODE
2643
+ HRESULT CArchiveExtractCallback::SetSecurityInfo(UInt32 indexInArc, const FString &path) const
2644
+ {
2645
+ if (!_stdOutMode && _extractMode && _ntOptions.NtSecurity.Val && _arc->GetRawProps)
2646
+ {
2647
+ const void *data;
2648
+ UInt32 dataSize;
2649
+ UInt32 propType;
2650
+ _arc->GetRawProps->GetRawProp(indexInArc, kpidNtSecure, &data, &dataSize, &propType);
2651
+ if (dataSize != 0)
2652
+ {
2653
+ if (propType != NPropDataType::kRaw)
2654
+ return E_FAIL;
2655
+ if (CheckNtSecure((const Byte *)data, dataSize))
2656
+ {
2657
+ SECURITY_INFORMATION securInfo = DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION;
2658
+ if (_saclEnabled)
2659
+ securInfo |= SACL_SECURITY_INFORMATION;
2660
+ // if (!
2661
+ ::SetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(void *)(const Byte *)(data));
2662
+ {
2663
+ // RINOK(SendMessageError_with_LastError("SetFileSecurity FAILS", path))
2664
+ }
2665
+ }
2666
+ }
2667
+ }
2668
+ return S_OK;
2669
+ }
2670
+ #endif // Z7_USE_SECURITY_CODE
2671
+
2672
+
2673
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetOperationResult(Int32 opRes))
2674
+ {
2675
+ COM_TRY_BEGIN
2676
+
2677
+ // printf("\nCArchiveExtractCallback::SetOperationResult: %d %s\n", opRes, GetAnsiString(_diskFilePath));
2678
+
2679
+ #ifndef Z7_SFX
2680
+ if (ExtractToStreamCallback)
2681
+ {
2682
+ GetUnpackSize();
2683
+ return ExtractToStreamCallback->SetOperationResult8(opRes, BoolToInt(_encrypted), _curSize);
2684
+ }
2685
+ #endif
2686
+
2687
+ #ifndef Z7_SFX
2688
+
2689
+ if (_hashStreamWasUsed)
2690
+ {
2691
+ _hashStreamSpec->_hash->Final(_item.IsDir,
2692
+ #ifdef SUPPORT_ALT_STREAMS
2693
+ _item.IsAltStream
2694
+ #else
2695
+ false
2696
+ #endif
2697
+ , _item.Path);
2698
+ _curSize = _hashStreamSpec->GetSize();
2699
+ _curSize_Defined = true;
2700
+ _hashStreamSpec->ReleaseStream();
2701
+ _hashStreamWasUsed = false;
2702
+ }
2703
+
2704
+ #endif // Z7_SFX
2705
+
2706
+ RINOK(CloseReparseAndFile())
2707
+
2708
+ #ifdef Z7_USE_SECURITY_CODE
2709
+ RINOK(SetSecurityInfo(_index, _diskFilePath))
2710
+ #endif
2711
+
2712
+ if (!_curSize_Defined)
2713
+ GetUnpackSize();
2714
+
2715
+ if (_curSize_Defined)
2716
+ {
2717
+ #ifdef SUPPORT_ALT_STREAMS
2718
+ if (_item.IsAltStream)
2719
+ AltStreams_UnpackSize += _curSize;
2720
+ else
2721
+ #endif
2722
+ UnpackSize += _curSize;
2723
+ }
2724
+
2725
+ if (_item.IsDir)
2726
+ NumFolders++;
2727
+ #ifdef SUPPORT_ALT_STREAMS
2728
+ else if (_item.IsAltStream)
2729
+ NumAltStreams++;
2730
+ #endif
2731
+ else
2732
+ NumFiles++;
2733
+
2734
+ if (_needSetAttrib)
2735
+ SetAttrib();
2736
+
2737
+ RINOK(_extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted)))
2738
+
2739
+ return S_OK;
2740
+
2741
+ COM_TRY_END
2742
+ }
2743
+
2744
+
2745
+
2746
+ Z7_COM7F_IMF(CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt32 index, Int32 opRes))
2747
+ {
2748
+ if (_folderArchiveExtractCallback2)
2749
+ {
2750
+ bool isEncrypted = false;
2751
+ UString s;
2752
+
2753
+ if (indexType == NArchive::NEventIndexType::kInArcIndex && index != (UInt32)(Int32)-1)
2754
+ {
2755
+ CReadArcItem item;
2756
+ RINOK(_arc->GetItem(index, item))
2757
+ s = item.Path;
2758
+ RINOK(Archive_GetItemBoolProp(_arc->Archive, index, kpidEncrypted, isEncrypted))
2759
+ }
2760
+ else
2761
+ {
2762
+ s = '#';
2763
+ s.Add_UInt32(index);
2764
+ // if (indexType == NArchive::NEventIndexType::kBlockIndex) {}
2765
+ }
2766
+
2767
+ return _folderArchiveExtractCallback2->ReportExtractResult(opRes, isEncrypted, s);
2768
+ }
2769
+
2770
+ return S_OK;
2771
+ }
2772
+
2773
+
2774
+ Z7_COM7F_IMF(CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password))
2775
+ {
2776
+ COM_TRY_BEGIN
2777
+ if (!_cryptoGetTextPassword)
2778
+ {
2779
+ RINOK(_extractCallback2.QueryInterface(IID_ICryptoGetTextPassword,
2780
+ &_cryptoGetTextPassword))
2781
+ }
2782
+ return _cryptoGetTextPassword->CryptoGetTextPassword(password);
2783
+ COM_TRY_END
2784
+ }
2785
+
2786
+
2787
+ #ifndef Z7_SFX
2788
+
2789
+ // ---------- HASH functions ----------
2790
+
2791
+ FString CArchiveExtractCallback::Hash_GetFullFilePath()
2792
+ {
2793
+ // this function changes _item.PathParts.
2794
+ CorrectPathParts();
2795
+ const UStringVector &pathParts = _item.PathParts;
2796
+ const UString processedPath (MakePathFromParts(pathParts));
2797
+ FString fullProcessedPath (us2fs(processedPath));
2798
+ if (_pathMode != NExtract::NPathMode::kAbsPaths
2799
+ || !NName::IsAbsolutePath(processedPath))
2800
+ {
2801
+ fullProcessedPath = MakePath_from_2_Parts(
2802
+ DirPathPrefix_for_HashFiles,
2803
+ // _dirPathPrefix,
2804
+ fullProcessedPath);
2805
+ }
2806
+ return fullProcessedPath;
2807
+ }
2808
+
2809
+
2810
+ Z7_COM7F_IMF(CArchiveExtractCallback::GetDiskProperty(UInt32 index, PROPID propID, PROPVARIANT *value))
2811
+ {
2812
+ COM_TRY_BEGIN
2813
+ NCOM::CPropVariant prop;
2814
+ if (propID == kpidSize)
2815
+ {
2816
+ RINOK(GetItem(index))
2817
+ const FString fullProcessedPath = Hash_GetFullFilePath();
2818
+ NFile::NFind::CFileInfo fi;
2819
+ if (fi.Find_FollowLink(fullProcessedPath))
2820
+ if (!fi.IsDir())
2821
+ prop = (UInt64)fi.Size;
2822
+ }
2823
+ prop.Detach(value);
2824
+ return S_OK;
2825
+ COM_TRY_END
2826
+ }
2827
+
2828
+
2829
+ Z7_COM7F_IMF(CArchiveExtractCallback::GetStream2(UInt32 index, ISequentialInStream **inStream, UInt32 mode))
2830
+ {
2831
+ COM_TRY_BEGIN
2832
+ *inStream = NULL;
2833
+ // if (index != _index) return E_FAIL;
2834
+ if (mode != NUpdateNotifyOp::kHashRead)
2835
+ return E_FAIL;
2836
+
2837
+ RINOK(GetItem(index))
2838
+ const FString fullProcessedPath = Hash_GetFullFilePath();
2839
+
2840
+ CInFileStream *inStreamSpec = new CInFileStream;
2841
+ CMyComPtr<ISequentialInStream> inStreamRef = inStreamSpec;
2842
+ inStreamSpec->Set_PreserveATime(_ntOptions.PreserveATime);
2843
+ if (!inStreamSpec->OpenShared(fullProcessedPath, _ntOptions.OpenShareForWrite))
2844
+ {
2845
+ RINOK(SendMessageError_with_LastError(kCantOpenInFile, fullProcessedPath))
2846
+ return S_OK;
2847
+ }
2848
+ *inStream = inStreamRef.Detach();
2849
+ return S_OK;
2850
+ COM_TRY_END
2851
+ }
2852
+
2853
+
2854
+ Z7_COM7F_IMF(CArchiveExtractCallback::ReportOperation(
2855
+ UInt32 /* indexType */, UInt32 /* index */, UInt32 /* op */))
2856
+ {
2857
+ // COM_TRY_BEGIN
2858
+ return S_OK;
2859
+ // COM_TRY_END
2860
+ }
2861
+
2862
+
2863
+ Z7_COM7F_IMF(CArchiveExtractCallback::RequestMemoryUse(
2864
+ UInt32 flags, UInt32 indexType, UInt32 index, const wchar_t *path,
2865
+ UInt64 requiredSize, UInt64 *allowedSize, UInt32 *answerFlags))
2866
+ {
2867
+ if ((flags & NRequestMemoryUseFlags::k_IsReport) == 0)
2868
+ {
2869
+ const UInt64 memLimit = _ntOptions.MemLimit;
2870
+ if (memLimit != (UInt64)(Int64)-1)
2871
+ {
2872
+ // we overwrite allowedSize
2873
+ *allowedSize = memLimit;
2874
+ if (requiredSize <= memLimit)
2875
+ {
2876
+ *answerFlags = NRequestMemoryAnswerFlags::k_Allow;
2877
+ return S_OK;
2878
+ }
2879
+ *answerFlags = NRequestMemoryAnswerFlags::k_Limit_Exceeded;
2880
+ if (flags & NRequestMemoryUseFlags::k_SkipArc_IsExpected)
2881
+ *answerFlags |= NRequestMemoryAnswerFlags::k_SkipArc;
2882
+ flags |= NRequestMemoryUseFlags::k_SLimit_Exceeded
2883
+ | NRequestMemoryUseFlags::k_AllowedSize_WasForced;
2884
+ }
2885
+ }
2886
+
2887
+ if (!_requestMemoryUseCallback)
2888
+ {
2889
+ _extractCallback2.QueryInterface(IID_IArchiveRequestMemoryUseCallback,
2890
+ &_requestMemoryUseCallback);
2891
+ if (!_requestMemoryUseCallback)
2892
+ {
2893
+ // keep default (answerFlags) from caller or (answerFlags) that was set in this function
2894
+ return S_OK;
2895
+ }
2896
+ }
2897
+
2898
+ #if 0
2899
+ if ((flags & NRequestMemoryUseFlags::k_IsReport) == 0)
2900
+ if (requiredSize <= *allowedSize)
2901
+ {
2902
+ // it's expected, that *answerFlags was set to NRequestMemoryAnswerFlags::k_Allow already,
2903
+ // because it's default answer for (requiredSize <= *allowedSize) case.
2904
+ *answerFlags = NRequestMemoryAnswerFlags::k_Allow; // optional code
2905
+ }
2906
+ else
2907
+ {
2908
+ // we clear *answerFlags, because we want to disable dafault "Allow", if it's set.
2909
+ // *answerFlags = 0;
2910
+ /*
2911
+ NRequestMemoryAnswerFlags::k_SkipArc |
2912
+ NRequestMemoryAnswerFlags::k_Limit_Exceeded;
2913
+ */
2914
+ }
2915
+ #endif
2916
+
2917
+ UString s;
2918
+ if (!path
2919
+ && indexType == NArchive::NEventIndexType::kInArcIndex
2920
+ && index != (UInt32)(Int32)-1
2921
+ && _arc)
2922
+ {
2923
+ RINOK(_arc->GetItem_Path(index, s))
2924
+ path = s.Ptr();
2925
+ }
2926
+
2927
+ return _requestMemoryUseCallback->RequestMemoryUse(
2928
+ flags, indexType, index, path,
2929
+ requiredSize, allowedSize, answerFlags);
2930
+ }
2931
+
2932
+ #endif // Z7_SFX
2933
+
2934
+
2935
+
2936
+ // ------------ After Extracting functions ------------
2937
+
2938
+ void CDirPathSortPair::SetNumSlashes(const FChar *s)
2939
+ {
2940
+ for (unsigned numSlashes = 0;;)
2941
+ {
2942
+ FChar c = *s++;
2943
+ if (c == 0)
2944
+ {
2945
+ Len = numSlashes;
2946
+ return;
2947
+ }
2948
+ if (IS_PATH_SEPAR(c))
2949
+ numSlashes++;
2950
+ }
2951
+ }
2952
+
2953
+
2954
+ bool CFiTimesCAM::SetDirTime_to_FS(CFSTR path) const
2955
+ {
2956
+ // it's same function for dir and for file
2957
+ return NDir::SetDirTime(path,
2958
+ CTime_Defined ? &CTime : NULL,
2959
+ ATime_Defined ? &ATime : NULL,
2960
+ MTime_Defined ? &MTime : NULL);
2961
+ }
2962
+
2963
+
2964
+ #ifdef SUPPORT_LINKS
2965
+
2966
+ bool CFiTimesCAM::SetLinkFileTime_to_FS(CFSTR path) const
2967
+ {
2968
+ // it's same function for dir and for file
2969
+ return NDir::SetLinkFileTime(path,
2970
+ CTime_Defined ? &CTime : NULL,
2971
+ ATime_Defined ? &ATime : NULL,
2972
+ MTime_Defined ? &MTime : NULL);
2973
+ }
2974
+
2975
+ HRESULT CArchiveExtractCallback::SetPostLinks() const
2976
+ {
2977
+ FOR_VECTOR (i, _postLinks)
2978
+ {
2979
+ const CPostLink &link = _postLinks[i];
2980
+ bool linkWasSet = false;
2981
+ RINOK(SetLink2(*this, link, linkWasSet))
2982
+ if (linkWasSet)
2983
+ {
2984
+ #ifdef _WIN32
2985
+ // Linux now doesn't support permissions for symlinks
2986
+ SetAttrib_Base(link.fullProcessedPath_from, link.item_FileInfo, *this);
2987
+ #endif
2988
+
2989
+ CFiTimesCAM pt;
2990
+ GetFiTimesCAM(link.item_FileInfo, pt, *_arc);
2991
+ if (pt.IsSomeTimeDefined())
2992
+ pt.SetLinkFileTime_to_FS(link.fullProcessedPath_from);
2993
+
2994
+ #ifdef Z7_USE_SECURITY_CODE
2995
+ // we set security information after timestamps setting
2996
+ RINOK(SetSecurityInfo(link.Index_in_Arc, link.fullProcessedPath_from))
2997
+ #endif
2998
+ }
2999
+ }
3000
+ return S_OK;
3001
+ }
3002
+
3003
+ #endif
3004
+
3005
+
3006
+ HRESULT CArchiveExtractCallback::SetDirsTimes()
3007
+ {
3008
+ if (!_arc)
3009
+ return S_OK;
3010
+
3011
+ CRecordVector<CDirPathSortPair> pairs;
3012
+ pairs.ClearAndSetSize(_extractedFolders.Size());
3013
+ unsigned i;
3014
+
3015
+ for (i = 0; i < _extractedFolders.Size(); i++)
3016
+ {
3017
+ CDirPathSortPair &pair = pairs[i];
3018
+ pair.Index = i;
3019
+ pair.SetNumSlashes(_extractedFolders[i].Path);
3020
+ }
3021
+
3022
+ pairs.Sort2();
3023
+
3024
+ HRESULT res = S_OK;
3025
+
3026
+ for (i = 0; i < pairs.Size(); i++)
3027
+ {
3028
+ const CDirPathTime &dpt = _extractedFolders[pairs[i].Index];
3029
+ if (!dpt.SetDirTime_to_FS_2())
3030
+ {
3031
+ // result = E_FAIL;
3032
+ // do we need error message here in Windows and in posix?
3033
+ // SendMessageError_with_LastError("Cannot set directory time", dpt.Path);
3034
+ }
3035
+ }
3036
+
3037
+ /*
3038
+ #ifndef _WIN32
3039
+ for (i = 0; i < _delayedSymLinks.Size(); i++)
3040
+ {
3041
+ const CDelayedSymLink &link = _delayedSymLinks[i];
3042
+ if (!link.Create())
3043
+ {
3044
+ if (res == S_OK)
3045
+ res = GetLastError_noZero_HRESULT();
3046
+ // res = E_FAIL;
3047
+ // do we need error message here in Windows and in posix?
3048
+ SendMessageError_with_LastError("Cannot create Symbolic Link", link._source);
3049
+ }
3050
+ }
3051
+ #endif // _WIN32
3052
+ */
3053
+
3054
+ ClearExtractedDirsInfo();
3055
+ return res;
3056
+ }
3057
+
3058
+
3059
+ HRESULT CArchiveExtractCallback::CloseArc()
3060
+ {
3061
+ // we call CloseReparseAndFile() here because we can have non-closed file in some cases?
3062
+ HRESULT res = CloseReparseAndFile();
3063
+ #ifdef SUPPORT_LINKS
3064
+ {
3065
+ const HRESULT res2 = SetPostLinks();
3066
+ if (res == S_OK)
3067
+ res = res2;
3068
+ }
3069
+ #endif
3070
+ {
3071
+ const HRESULT res2 = SetDirsTimes();
3072
+ if (res == S_OK)
3073
+ res = res2;
3074
+ }
3075
+ _arc = NULL;
3076
+ return res;
3077
+ }