exiftool-vendored.exe 12.82.0 → 12.84.0

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 (270) hide show
  1. package/README.md +6 -0
  2. package/bin/exiftool.exe +0 -0
  3. package/bin/exiftool_files/Changes +37 -0
  4. package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
  5. package/bin/exiftool_files/README +3 -2
  6. package/bin/exiftool_files/build_geolocation +872 -0
  7. package/bin/exiftool_files/config_files/example.config +2 -2
  8. package/bin/exiftool_files/exiftool.pl +28 -6
  9. package/bin/exiftool_files/fmt_files/gpx.fmt +2 -1
  10. package/bin/exiftool_files/fmt_files/gpx_wpt.fmt +2 -1
  11. package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
  12. package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
  13. package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
  14. package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
  15. package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
  16. package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
  17. package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
  18. package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
  19. package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
  20. package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
  21. package/bin/exiftool_files/lib/B.pm +1 -1
  22. package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
  23. package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
  24. package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
  25. package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
  26. package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
  27. package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
  28. package/bin/exiftool_files/lib/Config.pm +9 -9
  29. package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
  30. package/bin/exiftool_files/lib/CryptX.pm +2 -82
  31. package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
  32. package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
  33. package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
  34. package/bin/exiftool_files/lib/Digest/base.pm +26 -20
  35. package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
  36. package/bin/exiftool_files/lib/Encode.pm +3 -3
  37. package/bin/exiftool_files/lib/Errno.pm +13 -13
  38. package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
  39. package/bin/exiftool_files/lib/Exporter.pm +1 -1
  40. package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
  41. package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
  42. package/bin/exiftool_files/lib/File/Find.pm +1 -1
  43. package/bin/exiftool_files/lib/File/Glob.pm +1 -8
  44. package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
  45. package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
  46. package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
  47. package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
  48. package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
  49. package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
  50. package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
  51. package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
  52. package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
  53. package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
  54. package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
  55. package/bin/exiftool_files/lib/File/Path.pm +3 -3
  56. package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
  57. package/bin/exiftool_files/lib/File/Temp.pm +70 -35
  58. package/bin/exiftool_files/lib/File/Which.pm +1 -240
  59. package/bin/exiftool_files/lib/File/stat.pm +3 -2
  60. package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
  61. package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
  62. package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
  63. package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
  64. package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
  65. package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
  66. package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
  67. package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
  68. package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
  69. package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
  70. package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
  71. package/bin/exiftool_files/lib/IO/File.pm +1 -1
  72. package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
  73. package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
  74. package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
  75. package/bin/exiftool_files/lib/IO/Select.pm +16 -2
  76. package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
  77. package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
  78. package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
  79. package/bin/exiftool_files/lib/IO/String.pm +425 -0
  80. package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
  81. package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
  82. package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
  83. package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
  84. package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
  85. package/bin/exiftool_files/lib/IO.pm +2 -2
  86. package/bin/exiftool_files/lib/Image/ExifTool/Apple.pm +51 -7
  87. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +5 -2
  88. package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +18 -5
  89. package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +29 -0
  90. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +19 -2
  91. package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +17 -8
  92. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.dat +0 -0
  93. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +163 -101
  94. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +18 -10
  95. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +7 -6
  96. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +6 -1
  97. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +5 -0
  98. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +15 -6
  99. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +18 -9
  100. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +24 -5
  101. package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +2 -1
  102. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +165 -132
  103. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +3 -0
  104. package/bin/exiftool_files/lib/Image/ExifTool.pm +45 -23
  105. package/bin/exiftool_files/lib/Image/ExifTool.pod +23 -14
  106. package/bin/exiftool_files/lib/List/Util.pm +97 -8
  107. package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
  108. package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
  109. package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
  110. package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
  111. package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
  112. package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
  113. package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
  114. package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
  115. package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
  116. package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
  117. package/bin/exiftool_files/lib/POSIX.pm +1 -1
  118. package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
  119. package/bin/exiftool_files/lib/PerlIO.pm +397 -0
  120. package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
  121. package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
  122. package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
  123. package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
  124. package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
  125. package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
  126. package/bin/exiftool_files/lib/Portable.pm +246 -320
  127. package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
  128. package/bin/exiftool_files/lib/Socket.pm +16 -12
  129. package/bin/exiftool_files/lib/Storable.pm +1444 -1441
  130. package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
  131. package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
  132. package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
  133. package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
  134. package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
  135. package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
  136. package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
  137. package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
  138. package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
  139. package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
  140. package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
  141. package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
  142. package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
  143. package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
  144. package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
  145. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
  146. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
  147. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
  148. package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
  149. package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
  150. package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
  151. package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
  152. package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
  153. package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
  154. package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
  155. package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
  156. package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
  157. package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
  158. package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
  159. package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
  160. package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
  161. package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
  162. package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
  163. package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
  164. package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
  165. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
  166. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
  167. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
  168. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
  169. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
  170. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
  171. package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
  172. package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
  173. package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
  174. package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
  175. package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
  176. package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
  177. package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
  178. package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
  179. package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
  180. package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
  181. package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
  182. package/bin/exiftool_files/lib/Test/More.pm +1997 -0
  183. package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
  184. package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
  185. package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
  186. package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
  187. package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
  188. package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
  189. package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
  190. package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
  191. package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
  192. package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
  193. package/bin/exiftool_files/lib/Time/Local.pm +82 -35
  194. package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
  195. package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
  196. package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
  197. package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
  198. package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
  199. package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
  200. package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
  201. package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
  202. package/bin/exiftool_files/lib/Win32/API.pm +1 -830
  203. package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
  204. package/bin/exiftool_files/lib/Win32.pm +213 -89
  205. package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
  206. package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
  207. package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
  208. package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
  209. package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
  210. package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
  211. package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
  212. package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
  213. package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
  214. package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
  215. package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
  216. package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
  217. package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
  218. package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
  219. package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
  220. package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
  221. package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
  222. package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
  223. package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
  224. package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
  225. package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
  226. package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
  227. package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
  228. package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
  229. package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
  230. package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
  231. package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
  232. package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
  233. package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
  234. package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
  235. package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
  236. package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
  237. package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
  238. package/bin/exiftool_files/lib/feature.pm +49 -17
  239. package/bin/exiftool_files/lib/mro.pm +4 -20
  240. package/bin/exiftool_files/lib/overload.pm +15 -15
  241. package/bin/exiftool_files/lib/parent.pm +10 -2
  242. package/bin/exiftool_files/lib/re.pm +91 -33
  243. package/bin/exiftool_files/lib/warnings.pm +17 -6
  244. package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
  245. package/bin/exiftool_files/liblzma-5__.dll +0 -0
  246. package/bin/exiftool_files/libstdc++-6.dll +0 -0
  247. package/bin/exiftool_files/libwinpthread-1.dll +0 -0
  248. package/bin/exiftool_files/perl.exe +0 -0
  249. package/bin/exiftool_files/perl532.dll +0 -0
  250. package/package.json +6 -4
  251. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/cs.pm +0 -978
  252. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/de.pm +0 -1975
  253. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/en_ca.pm +0 -44
  254. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/en_gb.pm +0 -124
  255. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/es.pm +0 -2921
  256. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/fi.pm +0 -1116
  257. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/fr.pm +0 -3171
  258. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/it.pm +0 -2750
  259. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ja.pm +0 -10256
  260. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ko.pm +0 -4499
  261. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/nl.pm +0 -1270
  262. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/pl.pm +0 -3019
  263. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ru.pm +0 -18220
  264. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/sk.pm +0 -441
  265. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/sv.pm +0 -714
  266. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/tr.pm +0 -452
  267. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/zh_cn.pm +0 -2225
  268. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/zh_tw.pm +0 -72
  269. package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
  270. package/bin/exiftool_files/perl530.dll +0 -0
@@ -641,834 +641,5 @@ __END__
641
641
  # DOCUMENTATION
642
642
  #
643
643
 
644
- =head1 NAME
645
-
646
- Win32::API - Perl Win32 API Import Facility
647
-
648
- =head1 SYNOPSIS
649
-
650
- #### Method 1: with prototype
651
-
652
- use Win32::API;
653
- $function = Win32::API::More->new(
654
- 'mydll', 'int sum_integers(int a, int b)'
655
- );
656
- #### $^E is non-Cygwin only
657
- die "Error: $^E" if ! $function;
658
- #### or on Cygwin and non-Cygwin
659
- die "Error: ".(Win32::FormatMessage(Win32::GetLastError())) if ! $function;
660
- ####
661
- $return = $function->Call(3, 2);
662
-
663
- #### Method 2: with prototype and your function pointer
664
-
665
- use Win32::API;
666
- $function = Win32::API::More->new(
667
- undef, 38123456, 'int name_ignored(int a, int b)'
668
- );
669
- die "Error: $^E" if ! $function; #$^E is non-Cygwin only
670
- $return = $function->Call(3, 2);
671
-
672
- #### Method 3: with parameter list
673
-
674
- use Win32::API;
675
- $function = Win32::API::More->new(
676
- 'mydll', 'sum_integers', 'II', 'I'
677
- );
678
- die "Error: $^E" if ! $function; #$^E is non-Cygwin only
679
- $return = $function->Call(3, 2);
680
-
681
- #### Method 4: with parameter list and your function pointer
682
-
683
- use Win32::API;
684
- $function = Win32::API::More->new(
685
- undef, 38123456, 'name_ignored', 'II', 'I'
686
- );
687
- die "Error: $^E" if ! $function; #$^E is non-Cygwin only
688
- $return = $function->Call(3, 2);
689
-
690
- #### Method 5: with Import (slightly faster than ->Call)
691
-
692
- use Win32::API;
693
- $function = Win32::API::More->Import(
694
- 'mydll', 'int sum_integers(int a, int b)'
695
- );
696
- die "Error: $^E" if ! $function; #$^E is non-Cygwin only
697
- $return = sum_integers(3, 2);
698
-
699
-
700
- =for LATER-UNIMPLEMENTED
701
- #### or
702
- use Win32::API mydll => 'int sum_integers(int a, int b)';
703
- $return = sum_integers(3, 2);
704
-
705
-
706
- =head1 ABSTRACT
707
-
708
- With this module you can import and call arbitrary functions
709
- from Win32's Dynamic Link Libraries (DLL) or arbitrary functions for
710
- which you have a pointer (MS COM, etc), without having
711
- to write an XS extension. Note, however, that this module
712
- can't do everything. In fact, parameters input and output is
713
- limited to simpler cases.
714
-
715
- A regular B<XS> extension is always safer and faster anyway.
716
-
717
- The current version of Win32::API is always available at your
718
- nearest CPAN mirror:
719
-
720
- http://search.cpan.org/dist/Win32-API/
721
-
722
- A short example of how you can use this module (it just gets the PID of
723
- the current process, eg. same as Perl's internal C<$$>):
724
-
725
- use Win32::API;
726
- Win32::API::More->Import("kernel32", "int GetCurrentProcessId()");
727
- $PID = GetCurrentProcessId();
728
-
729
- Starting with 0.69. Win32::API initiated objects are deprecated due to numerous
730
- bugs and improvements, use Win32::API::More now. The use statement remains
731
- as C<use Win32::API;>.
732
-
733
- The possibilities are nearly infinite (but not all are good :-).
734
- Enjoy it.
735
-
736
- =head1 DESCRIPTION
737
-
738
- To use this module put the following line at the beginning of your script:
739
-
740
- use Win32::API;
741
-
742
- You can now use the C<new()> function of the Win32::API module to create a
743
- new Win32::API::More object (see L<IMPORTING A FUNCTION>) and then invoke the
744
- C<Call()> method on this object to perform a call to the imported API
745
- (see L<CALLING AN IMPORTED FUNCTION>).
746
-
747
- Starting from version 0.40, you can also avoid creating a Win32::API::More object
748
- and instead automatically define a Perl sub with the same name of the API
749
- function you're importing. This 2nd way using C<Import> to create a sub instead
750
- of an object is slightly faster than doing C<-E<gt>Call()>. The details of the
751
- API definitions are the same, just the method name is different:
752
-
753
- my $GetCurrentProcessId = Win32::API::More->new(
754
- "kernel32", "int GetCurrentProcessId()"
755
- );
756
- die "Failed to import GetCurrentProcessId" if !$GetCurrentProcessId;
757
- $GetCurrentProcessId->UseMI64(1);
758
- my $PID = $GetCurrentProcessId->Call();
759
-
760
- #### vs.
761
-
762
- my $UnusedGCPI = Win32::API::More->Import("kernel32", "int GetCurrentProcessId()");
763
- die "Failed to import GetCurrentProcessId" if !$UnusedGCPI;
764
- $UnusedGCPI->UseMI64(1);
765
- $PID = GetCurrentProcessId();
766
-
767
- Note that C<Import> returns the Win32::API obj on success and false on failure
768
- (in which case you can check the content of C<$^E>). This allows some settings
769
- to be set through method calls that can't be specified as a parameter to Import,
770
- yet still have the convience of not writing C<-E<gt>Call()>. The Win32::API obj
771
- does not need to be assigned to a scalar. C<unless(Win32::API::More-E<gt>Import>
772
- is fine. Prior to v0.76_02, C<Import> returned returned 1 on success and 0 on
773
- failure.
774
-
775
- =head2 IMPORTING A FUNCTION
776
-
777
- You can import a function from a 32 bit Dynamic Link Library (DLL) file with
778
- the C<new()> function or, starting in 0.69, supply your own function pointer.
779
- This will create a Perl object that contains the reference to that function,
780
- which you can later C<Call()>.
781
-
782
- What you need to know is the prototype of the function you're going to import
783
- (eg. the definition of the function expressed in C syntax).
784
-
785
- Starting from version 0.40, there are 2 different approaches for this step:
786
- (the preferred) one uses the prototype directly, while the other (now deprecated)
787
- one uses Win32::API's internal representation for parameters.
788
-
789
- =head2 IMPORTING A FUNCTION BY PROTOTYPE
790
-
791
- You need to pass 2 or 3 parameters:
792
-
793
- =over 4
794
-
795
- =item 1.
796
-
797
- The name of the library from which you want to import the function. If the
798
- name is undef, you are requesting a object created from a function pointer,
799
- and must supply item 2.
800
-
801
- =item 2.
802
-
803
- This parameter is optional, most people should skip it, skip does not mean
804
- supplying undef. Supply a function pointer in the format of number 1234, not
805
- string "\x01\x02\x03\x04". Undef will be returned if the pointer is not
806
- readable, L<Win32::GetLastError|Win32/Win32::GetLastError()>/L<perlvar/"$^E">
807
- will be C<ERROR_NOACCESS>.
808
-
809
- =item 3.
810
-
811
- The C prototype of the function. If you are using a function pointer, the name
812
- of the function should be something "friendly" to you and no attempt is made
813
- to retrieve such a name from any DLL's export table. This name for a function
814
- pointer is also used for Import().
815
-
816
- =back
817
-
818
- When calling a function imported with a prototype, if you pass an
819
- undefined Perl scalar to one of its arguments, it will be
820
- automatically turned into a C C<NULL> value.
821
-
822
- See L<Win32::API::Type> for a list of the known parameter types and
823
- L<Win32::API::Struct> for information on how to define a structure.
824
-
825
- If a prototype type is exactly C<signed char> or C<unsigned char> for an
826
- "in" parameter or the return parameter, and for "in" parameters only
827
- C<signed char *> or C<unsigned char *> the parameters will be treated as a
828
- number, C<0x01>, not C<"\x01">. "UCHAR" is not "unsigned char". Change the
829
- C prototype if you want numeric handling for your chars.
830
-
831
- =head2 IMPORTING A FUNCTION WITH A PARAMETER LIST
832
-
833
- You need to pass at minimum 4 parameters.
834
-
835
- =over 4
836
-
837
- =item 1.
838
- The name of the library from which you want to import the function.
839
-
840
- =item 2.
841
- This parameter is optional, most people should skip it, skip does not mean
842
- supplying undef. Supply a function pointer in the format of number C<1234>,
843
- not string C<"\x01\x02\x03\x04">. Undef will be returned if the pointer is not
844
- readable, L<Win32::GetLastError|Win32/Win32::GetLastError()>/L<perlvar/"$^E">
845
- will be C<ERROR_NOACCESS>.
846
-
847
- =item 3.
848
- The name of the function (as exported by the library) or for function pointers
849
- a name that is "friendly" to you. This name for a function pointer is also used
850
- for Import(). No attempt is made to retrieve such a name from any DLL's export
851
- table in the 2nd case.
852
-
853
- =item 4.
854
- The number and types of the arguments the function expects as input.
855
-
856
- =item 5.
857
- The type of the value returned by the function.
858
-
859
- =item 6.
860
- And optionally you can specify the calling convention, this defaults to
861
- '__stdcall', alternatively you can specify '_cdecl' or '__cdecl' (API > v0.68)
862
- or (API > v0.70_02) 'WINAPI', 'NTAPI', 'CALLBACK' (__stdcall), 'WINAPIV' (__cdecl) .
863
- False is __stdcall. Vararg functions are always cdecl. MS DLLs are typically
864
- stdcall. Non-MS DLLs are typically cdecl. If API > v0.75, mixing up the calling
865
- convention on 32 bits is detected and Perl will C<croak> an error message and
866
- C<die>.
867
-
868
- =back
869
-
870
- To better explain their meaning, let's suppose that we
871
- want to import and call the Win32 API C<GetTempPath()>.
872
- This function is defined in C as:
873
-
874
- DWORD WINAPI GetTempPathA( DWORD nBufferLength, LPSTR lpBuffer );
875
-
876
- This is documented in the B<Win32 SDK Reference>; you can look
877
- for it on the Microsoft's WWW site, or in your C compiler's
878
- documentation, if you own one.
879
-
880
- =over 4
881
-
882
- =item B<1.>
883
-
884
- The first parameter is the name of the library file that
885
- exports this function; our function resides in the F<KERNEL32.DLL>
886
- system file.
887
-
888
- When specifying this name as parameter, the F<.DLL> extension
889
- is implicit, and if no path is given, the file is searched through
890
- a couple of directories, including:
891
-
892
- =over 4
893
-
894
- =item 1. The directory from which the application loaded.
895
-
896
- =item 2. The current directory.
897
-
898
- =item 3. The Windows system directory (eg. c:\windows\system or system32).
899
-
900
- =item 4. The Windows directory (eg. c:\windows).
901
-
902
- =item 5. The directories that are listed in the PATH environment variable.
903
-
904
- =back
905
-
906
- You may, but don't have to write F<C:\windows\system\kernel32.dll>; or
907
- F<kernel32.dll>, only F<kernel32> is enough:
908
-
909
- $GetTempPath = new Win32::API::More('kernel32', ...
910
-
911
- =item B<2.>
912
-
913
- Since this function is from a DLL, skip the 2nd parameter. Skip does not
914
- mean supplying undef.
915
-
916
- =item B<3.>
917
-
918
- Now for the real second parameter: the name of the function.
919
- It must be written exactly as it is exported
920
- by the library (case is significant here).
921
- If you are using Windows 95 or NT 4.0, you can use the B<Quick View>
922
- command on the DLL file to see the function it exports.
923
- Remember that you can only import functions from 32 or 64 bit DLLs:
924
- in Quick View, the file's characteristics should report
925
- somewhere "32 bit word machine"; as a rule of thumb,
926
- when you see that all the exported functions are in upper case,
927
- the DLL is a 16 bit one and you can't use it. You also can not load a 32 bit
928
- DLL into a 64 bit Perl, or vice versa. If you try, C<new>/C<Import> will fail
929
- and C<$^E> will be C<ERROR_BAD_EXE_FORMAT>.
930
- If their capitalization looks correct, then it's probably a 32 bit
931
- DLL. If you have Platform SDK or Visual Studio, you can use the Dumpbin
932
- tool. Call it as C<dumpbin /exports name_of_dll.dll> on the command line.
933
- If you have Mingw GCC, use objdump as
934
- C<objdump -x name_of_dll.dll E<gt> dlldump.txt> and search for the word exports
935
- in the very long output.
936
-
937
- Also note that many Win32 APIs are exported twice, with the addition of
938
- a final B<A> or B<W> to their name, for - respectively - the ASCII
939
- and the Unicode version.
940
- When a function name is not found, Win32::API will actually append
941
- an B<A> to the name and try again; if the extension is built on a
942
- Unicode system, then it will try with the B<W> instead.
943
- So our function name will be:
944
-
945
- $GetTempPath = new Win32::API::More('kernel32', 'GetTempPath', ...
946
-
947
- In our case C<GetTempPath> is really loaded as C<GetTempPathA>.
948
-
949
- =item B<4.>
950
-
951
- The third parameter, the input parameter list, specifies how many
952
- arguments the function wants, and their types. It can be passed as
953
- a single string, in which each character represents one parameter,
954
- or as a list reference. The following forms are valid:
955
-
956
- "abcd"
957
- [a, b, c, d]
958
- \@LIST
959
-
960
- But those are not:
961
-
962
- (a, b, c, d)
963
- @LIST
964
-
965
- The number of characters, or elements in the list, specifies the number
966
- of parameters, and each character or element specifies the type of an
967
- argument; allowed types are:
968
-
969
- =over 4
970
-
971
- =item C<I>:
972
- value is an unsigned integer (unsigned int)
973
-
974
- =item C<i>:
975
- value is an signed integer (signed int or int)
976
-
977
- =item C<N>:
978
- value is a unsigned pointer sized number (unsigned long)
979
-
980
- =item C<n>:
981
- value is a signed pointer sized number (signed long or long)
982
-
983
- =item C<Q>:
984
- value is a unsigned 64 bit integer number (unsigned long long, unsigned __int64)
985
- See next item for details.
986
-
987
- =item C<q>:
988
- value is a signed 64 bit integer number (long long, __int64)
989
- If your perl has 'Q'/'q' quads support for L<perlfunc/pack> then Win32::API's 'q'
990
- is a normal perl numeric scalar. All 64 bit Perls have quad support. Almost no
991
- 32 bit Perls have quad support. On 32 bit Perls, without quad support,
992
- Win32::API's 'q'/'Q' letter is a packed 8 byte string. So C<0x8000000050000000>
993
- from a perl with native Quad support would be written as
994
- C<"\x00\x00\x00\x50\x00\x00\x00\x80"> on a 32 bit Perl without Quad support.
995
- To improve the use of 64 bit integers with Win32::API on a 32 bit Perl without
996
- Quad support, there is a per Win32::API::* object setting called L</UseMI64>
997
- that causes all quads to be accepted as, and returned as L<Math::Int64> objects.
998
- For "in" params in Win32::API and Win32::API::More and "out" in
999
- Win32::API::Callback only, if the argument is a reference, it will automatically
1000
- be treated as a Math::Int64 object without having to previously call
1001
- L</UseMI64>.
1002
-
1003
- =item C<F>:
1004
- value is a single precision (4 bytes) floating point number (float)
1005
-
1006
- =item C<D>:
1007
- value is a double precision (8 bytes) floating point number (double)
1008
-
1009
- =item C<S>:
1010
- value is a unsigned short (unsigned short)
1011
-
1012
- =item C<s>:
1013
- value is a signed short (signed short or short)
1014
-
1015
- =item C<C>:
1016
- value is a char (char), pass as C<"a">, not C<97>, C<"abc"> will truncate to C<"a">
1017
-
1018
- =item C<P>:
1019
- value is a pointer (to a string, structure, etc...)
1020
- padding out the buffer string is required, buffer overflow detection is
1021
- performed. Pack and unpack the data yourself. If P is a return type, only
1022
- null terminated strings or NULL pointer are supported. If P is an in type, NULL
1023
- is integer C<0>. C<undef>, C<"0">, and C<""+0> are not integer C<0>, C<"0"+0> is
1024
- integer C<0>.
1025
-
1026
- It is suggested to
1027
- not use P as a return type and instead use N and read the memory yourself, and
1028
- free the pointer if applicable. This pointer is effectively undefined after the
1029
- C function returns control to Perl. The C function may not hold onto it after
1030
- the C function returns control. There are exceptions where the pointer will
1031
- remain valid after the C function returns control, but tread at your own risk,
1032
- and at your knowledge of Perl interpreter's C internals.
1033
-
1034
- =item C<T>:
1035
- value is a Win32::API::Struct object, in parameter only, pass by reference
1036
- (pointer) only, pass by copy not implemented, see other sections for more
1037
-
1038
- =item C<K>:
1039
- value is a Win32::API::Callback object, in parameter only, (see L<Win32::API::Callback>)
1040
-
1041
- =item C<V>:
1042
- no value, no parameters, stands for C<void>, may not be combined with any other
1043
- letters, equivalent to a ""
1044
-
1045
- =back
1046
-
1047
- For beginners, just skip this paragraph.
1048
- Note, all parameter types are little endian. This is probably what you want
1049
- unless the documentation for the C function you are calling explicitly says
1050
- the parameters must be big endian. If there is no documentation for your C
1051
- function or no mention of endianess in the documentation, this doesn't apply
1052
- to you and skip the rest of this paragraph. There is no inherent support
1053
- for big endian parameters. Perl's scalar numbers model is that numeric
1054
- scalars are effectively opaque and their machine representation is
1055
- irrelevant. On Windows Perl, scalar numbers are little endian
1056
- internally. So C<$number = 5; print "$number";> will put 5 on the screen.
1057
- C<$number> given to Win32::API will pass little endian integer 5 to the C
1058
- function call. This is almost surly what you want. If you really must pass
1059
- a big endian integer, do C<$number = unpack('L', pack('N', 5));>, then
1060
- C<print "$number";> will put 83886080 on the screen, but this is big endian 5,
1061
- and passing 83886080 to C<-E<gt>Call()> will make sure that
1062
- the C function is getting big endian 5. See L<perlpacktut> for more.
1063
-
1064
- Our function needs two parameters: a number (C<DWORD>) and a pointer to a
1065
- string (C<LPSTR>):
1066
-
1067
- $GetTempPath = new Win32::API('kernel32', 'GetTempPath', 'NP', ...
1068
-
1069
- =item B<4.>
1070
-
1071
- The fourth is the type of the value returned by the
1072
- function. It can be one of the types seen above, plus another type named B<V>
1073
- (for C<void>), used for functions that do not return a value.
1074
- In our example the value returned by GetTempPath() is a C<DWORD>, which is a
1075
- typedef for unsigned long, so our return type will be B<N>:
1076
-
1077
- $GetTempPath = new Win32::API::More('kernel32', 'GetTempPath', 'NP', 'N');
1078
-
1079
- Now the line is complete, and the GetTempPath() API is ready to be used
1080
- in Perl. Before calling it, you should test that $GetTempPath is
1081
- L<perlfunc/defined>, otherwise errors such as the function or the library could
1082
- not be loaded or the C prototype was unparsable happened, and no object was
1083
- created. If the return value is undefined, to get detailed error status, use
1084
- L<perlvar/"$^E"> or L<Win32::GetLastError|Win32/Win32::GetLastError()>. C<$^E>
1085
- is slower than C<Win32::GetLastError> and useless on Cygwin, but C<$^E> in
1086
- string context provides a readable description of the error. In numeric context,
1087
- C<$^E> is equivelent to C<Win32::GetLastError>. C<Win32::GetLastError> always
1088
- returns an integer error code. You may use
1089
- L<Win32::FormatMessage|Win32/Win32::FormatMessage()> to convert an integer error
1090
- code to a readable description on Cygwin and Native builds of Perl.
1091
-
1092
- Our definition, with error checking added, should then look like this:
1093
-
1094
- $GetTempPath = new Win32::API::More('kernel32', 'GetTempPath', 'NP', 'N');
1095
- if(not defined $GetTempPath) {
1096
- die "Can't import API GetTempPath: $^E\n";
1097
- }
1098
-
1099
- =back
1100
-
1101
- =head2 CALLING AN IMPORTED FUNCTION
1102
-
1103
- To effectively make a call to an imported function you must use the
1104
- Call() method on the Win32::API object you created.
1105
- Continuing with the example from the previous paragraph,
1106
- the GetTempPath() API can be called using the method:
1107
-
1108
- $GetTempPath->Call(...
1109
-
1110
- Of course, parameters have to be passed as defined in the import phase.
1111
- In particular, if the number of parameters does not match (in the example,
1112
- if GetTempPath() is called with more or less than two parameters),
1113
- Perl will C<croak> an error message and C<die>.
1114
-
1115
- The two parameters needed here are the length of the buffer
1116
- that will hold the returned temporary path, and a pointer to the
1117
- buffer itself.
1118
- For numerical parameters except for char, you can use either a constant expression
1119
- or a variable, it will be numified similar to the expression C<($var+0)>.
1120
- For pointers, also note that B<memory must be allocated before calling the function>,
1121
- just like in C.
1122
- For example, to pass a buffer of 80 characters to GetTempPath(),
1123
- it must be initialized before with:
1124
-
1125
- $lpBuffer = " " x 80;
1126
-
1127
- This allocates a string of 80 characters. If you don't do so, you'll
1128
- probably get a fatal buffer overflow error starting in 0.69.
1129
- The call should therefore include:
1130
-
1131
- $lpBuffer = " " x 80;
1132
- $GetTempPath->Call(80, $lpBuffer);
1133
-
1134
- And the result will be stored in the $lpBuffer variable.
1135
- Note that you never need to pass a reference to the variable
1136
- (eg. you B<don't need> C<\$lpBuffer>), even if its value will be set
1137
- by the function.
1138
-
1139
- A little problem here is that Perl does not trim the variable,
1140
- so $lpBuffer will still contain 80 characters in return; the exceeding
1141
- characters will be spaces, because we said C<" " x 80>.
1142
-
1143
- In this case we're lucky enough, because the value returned by
1144
- the GetTempPath() function is the length of the string, so to get
1145
- the actual temporary path we can write:
1146
-
1147
- $lpBuffer = " " x 80;
1148
- $return = $GetTempPath->Call(80, $lpBuffer);
1149
- $TempPath = substr($lpBuffer, 0, $return);
1150
-
1151
- If you don't know the length of the string, you can usually
1152
- cut it at the C<\0> (ASCII zero) character, which is the string
1153
- delimiter in C:
1154
-
1155
- $TempPath = ((split(/\0/, $lpBuffer))[0];
1156
- # or
1157
- $lpBuffer =~ s/\0.*$//;
1158
-
1159
- =head2 USING STRUCTURES
1160
-
1161
- Starting from version 0.40, Win32::API comes with a support package
1162
- named Win32::API::Struct. The package is loaded automatically with
1163
- Win32::API, so you don't need to use it explicitly.
1164
-
1165
- With this module you can conveniently define structures and use
1166
- them as parameters to Win32::API functions. A short example follows:
1167
-
1168
-
1169
- # the 'POINT' structure is defined in C as:
1170
- # typedef struct {
1171
- # LONG x;
1172
- # LONG y;
1173
- # } POINT;
1174
-
1175
-
1176
- #### define the structure
1177
- Win32::API::Struct->typedef( POINT => qw{
1178
- LONG x;
1179
- LONG y;
1180
- });
1181
-
1182
- #### import an API that uses this structure
1183
- Win32::API->Import('user32', 'BOOL GetCursorPos(LPPOINT lpPoint)');
1184
-
1185
- #### create a 'POINT' object
1186
- my $pt = Win32::API::Struct->new('POINT');
1187
-
1188
- #### call the function passing our structure object
1189
- GetCursorPos($pt);
1190
-
1191
- #### and now, access its members
1192
- print "The cursor is at: $pt->{x}, $pt->{y}\n";
1193
-
1194
- Note that this works only when the function wants a
1195
- B<pointer to a structure>, not a "pass by copy" structure. As you can see, our
1196
- structure is named 'POINT', but the API used 'LPPOINT'. Some heuristics are
1197
- done to validate the argument's type vs the parameter's type if the function
1198
- has a C prototype definition (not letter definition). First, if the parameter
1199
- type starts with the LP prefix, the LP prefix is stripped, then compared to
1200
- the argument's type. If that fails, the Win32::API::Type database
1201
- (see L<Win32::API::Type/typedef>)
1202
- will be used to convert the parameter type to the base type. If that fails,
1203
- the parameter type will be stripped of a trailing whitespace then a '*', and
1204
- then checked against the base type. L<Dies|perlfunc/die> if the parameter and
1205
- argument types do not match after 3 attempts.
1206
-
1207
- For more information, see also L<Win32::API::Struct>.
1208
-
1209
- If you don't want (or can't) use the C<Win32::API::Struct> facility,
1210
- you can still use the low-level approach to use structures:
1211
-
1212
- =over 4
1213
-
1214
- =item 1.
1215
-
1216
- you have to L<pack()|perlfunc/pack> the required elements in a variable:
1217
-
1218
- $lpPoint = pack('ll', 0, 0); # store two LONGs
1219
-
1220
- =item 2.
1221
-
1222
- to access the values stored in a structure, L<unpack()|perlfunc/unpack> it as required:
1223
-
1224
- ($x, $y) = unpack(';;', $lpPoint); # get the actual values
1225
-
1226
- =back
1227
-
1228
- The rest is left as an exercise to the reader...
1229
-
1230
- =head2 EXPORTED FUNCTIONS
1231
-
1232
- =head3 ReadMemory
1233
-
1234
- $copy_of_memblock = ReadMemory($SourcePtr, $length);
1235
-
1236
- Reads the source pointer for C<$length> number of bytes. Returns a copy of
1237
- the memory block in a scalar. No readability checking is done on C<$SourcePtr>.
1238
- C<$SourcePtr>'s format is 123456, not C<"\x01\x02\x03\x04">.
1239
-
1240
- =head3 WriteMemory
1241
-
1242
- WriteMemory($DestPtr, $sourceScalar, $length);
1243
-
1244
- Copies the string contents of the C<$sourceScalar> scalar to C<$DestPtr> for
1245
- C<$length> bytes. $length must be less than or equal to the length of
1246
- C<$sourceScalar>, otherwise the function croaks. No readability checking is
1247
- done on C<$DestPtr>. C<$DestPtr>'s format is 123456, not
1248
- C<"\x01\x02\x03\x04">. Returns nothing.
1249
-
1250
- =head3 MoveMemory
1251
-
1252
- MoveMemory($destPtr, $sourcePtr, $length);
1253
-
1254
- Copies a block of memory from one location to another. The source and
1255
- destination blocks may overlap. All pointers are in the format of 123456,
1256
- not C<"\x01\x02\x03\x04">. No readability checking is done. Returns nothing.
1257
-
1258
- =head3 IsBadReadPtr
1259
-
1260
- if(IsBadReadPtr($ptr, $length)) {die "bad ptr";}
1261
-
1262
- Probes a memory block for C<$length> bytes for readability. Returns true if
1263
- access violation occurs, otherwise false is returned. This function is useful
1264
- to avoid dereferencing pointers which will crash the perl process. This function
1265
- has many limitations, including not detecting uninitialized memory, not
1266
- detecting freed memory, and not detecting gibberish. It can not tell whether a
1267
- function pointer is valid x86 machine code. Ideally, you should never use it,
1268
- or remove it once your code is stable. C<$ptr> is in the format of 123456,
1269
- not C<"\x01\x02\x03\x04">. See MS's documentation for a lot more
1270
- on this function of the same name.
1271
-
1272
- =head3 SafeReadWideCString
1273
-
1274
- $source = Encode::encode("UTF-16LE","Just another perl h\x{00E2}cker\x00");
1275
- $string = SafeReadWideCString(unpack('J',pack('p', $source)));
1276
- die "impossible" if $source ne "Just another perl h\x{00E2}cker";
1277
-
1278
- Safely (SEH aware) reads a utf-16 wide null terminated string (the first and
1279
- only parameter), into a scalar. Returns undef, if an access violation happens
1280
- or null pointer (same thing). The string pointer is in the format of 123456,
1281
- not C<"\x01\x02\x03\x04">. The returned scalar will be UTF8 marked if the string
1282
- can not be represented in the system's ANSI codepage. Conversion is done with
1283
- WideCharToMultiByte. Returns a 0 length scalar string if WideCharToMultiByte fails.
1284
- This function was created because L<pack's|perlfunc/pack> p letter won't read UTF16
1285
- and L</ReadMemory> and L</IsBadReadPtr> require an explicit length.
1286
-
1287
- =head2 CONSTRUCTORS
1288
-
1289
- =head3 new
1290
-
1291
- $obj = Win32::API::More->new([$dllname | (undef , $funcptr)], [$c_proto | ($in, $out [, $calling_convention])]);
1292
-
1293
- See L</DESCRIPTION>.
1294
-
1295
- =head3 Import
1296
- $obj = Win32::API::More->Import([$dllname | (undef , $funcptr)], [$c_proto | ($in, $out [, $calling_convention])]);
1297
-
1298
- See L</DESCRIPTION>.
1299
-
1300
- =head2 METHODS
1301
-
1302
- =head3 Call
1303
-
1304
- The main method of a Win32::API object. Documented elsewhere in this document.
1305
-
1306
- =head3 UseMI64
1307
-
1308
- $bool = $APIObj->UseMI64();
1309
- $oldbool = $APIObj->UseMI64($newbool);
1310
-
1311
- Turns on Quads as L<Math::Int64> objects support for a particular object
1312
- instance. You must call L<perlfunc/use>/L<perlfunc/require> on Math::Int64
1313
- before calling UseMI64. Win32::API does not C<use> Math::Int64 for you.
1314
- Works on Win32::API and Win32::API::Callback objects. This method
1315
- does not exist if your Perl natively supports Quads (64 bit Perl for example).
1316
- Takes 1 optional parameter, which is a true or false value to use or don't use
1317
- Math::Int64, returns the old setting, which is a true or false value. If called
1318
- without any parameters, returns current setting, which is a true or false value,
1319
- without setting the option. As discussed in L</q>, if you are not using
1320
- Math::Int64 you must supply/will receive 8 byte scalar strings for quads.
1321
- For "in" params in Win32::API and Win32::API::More and "out" in
1322
- Win32::API::Callback only, if the argument is a reference, it will automatically
1323
- be treated as a Math::Int64 object without having to previously call this
1324
- function.
1325
-
1326
- =head2 VERBOSE DEBUGGING
1327
-
1328
- If using C<Win32::GetLastError> and C<$^E> does not reveal the problem with your
1329
- use of Win32::API, you may turn on Win32::API's very verbose debugging mode as
1330
- follows
1331
-
1332
- BEGIN {
1333
- $Win32::API::DEBUG = 1;
1334
- }
1335
- use Win32::API;
1336
- $function = Win32::API::More->new(
1337
- 'mydll', 'int sum_integers(int a, int b)'
1338
- );
1339
-
1340
- =head1 HISTORY
1341
-
1342
- =over 4
1343
-
1344
- =item UseMI64 API change
1345
-
1346
- Starting in 0.71, UseMI64 on a set returns old value, not previously
1347
- new value.
1348
-
1349
- =item fork safe
1350
-
1351
- Starting in 0.71, a Win32::API object can go through a fork and work
1352
- correctly in the child and parent psuedo-processes. Previously when either
1353
- psuedo-processes exited, the DLL would be unloaded and the other
1354
- psuedo-processes would crash if a Call() was done on the object.
1355
-
1356
- =item return value signedness
1357
-
1358
- Prior to 0.69, for numeric integer types, the return scalar was always signed.
1359
- Unsigned-ness was ignored.
1360
-
1361
- =item shorts
1362
-
1363
- Prior to 0.69, shorts were not supported. 'S' meant a sturct. To fix this
1364
- Win32::API::More class was created for 0.69. 'S'/'s' now means short, per pack's
1365
- letters. Struct has been moved to letter 'T'. Win32::API will continue to exist
1366
- for legacy code.
1367
-
1368
- =item float return types
1369
-
1370
- Prior to 0.69, if a function had a return type of float, it was silently
1371
- not called.
1372
-
1373
- =item buffer overflow protection
1374
-
1375
- Introduced in 0.69. If disabling is required, which is highly
1376
- B<not recommended>, set an environmental variable called
1377
- WIN32_API_SORRY_I_WAS_AN_IDIOT to 1.
1378
-
1379
- =item automatic un/pack
1380
-
1381
- Starting with 0.69, when using Win32::API::More, there is automatic un/packing
1382
- of pointers to numbers-ish things for in parameters when using the C
1383
- prototype interface.
1384
-
1385
- =item Quads on 32 bit
1386
-
1387
- Added in 0.70.
1388
-
1389
- =item __stdcall vs __cdecl checking on 32 bits
1390
-
1391
- Added in 0.76_01
1392
-
1393
- =item Import returns an api obj on success, undef on failure, instead of 1 or 0
1394
-
1395
- Added in 0.76_02
1396
-
1397
- =item checking C<$!> for C<new>/C<Import> failure is broken and deprecated
1398
-
1399
- Starting in 0.76_06, due to many bugs with C<new> and C<Import> not setting
1400
- L<perlvar/$!> or Win32 and C error codes overlapping and Win32 error codes being
1401
- stringified as different C error codes, checking C<$!> is deprecated and the
1402
- existing, partial setting of C<$!>, maybe removed in the future. Only check
1403
- C<Win32::GetLastError()> or C<$^E> to find out why the call failed.
1404
-
1405
- =back
1406
-
1407
- See the C<Changes> file for more details, many of which not mentioned here.
1408
-
1409
- =head1 BUGS AND LIMITATIONS
1410
-
1411
- =over 4
1412
-
1413
- =item E<nbsp> Unicode DLL paths
1414
-
1415
- Untested.
1416
-
1417
- =item E<nbsp> ithreads
1418
-
1419
- Minimally tested.
1420
-
1421
- =item E<nbsp> C functions getting utf8 scalars vs byte scalars
1422
-
1423
- Untested and undefined.
1424
-
1425
- =back
1426
-
1427
- =head1 SEE ALSO
1428
-
1429
- L<Math::Int64>
1430
-
1431
- L<Win32::API::Struct>
1432
-
1433
- L<Win32::API::Type>
1434
-
1435
- L<Win32::API::Callback>
1436
-
1437
- L<Win32::API::Callback::IATPatch>
1438
-
1439
- L<http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/function-calling-conventions.html>
1440
-
1441
- =head1 AUTHOR
1442
-
1443
- Aldo Calpini ( I<dada@perl.it> ).
1444
-
1445
- =head1 MAINTAINER
1446
-
1447
- Cosimo Streppone ( I<cosimo@cpan.org> )
1448
-
1449
- =head1 MAJOR CONTRIBUTOR
1450
-
1451
- Daniel Dragan ( I<bulkdd@cpan.org> )
1452
-
1453
- =head1 LICENSE
1454
-
1455
- To finally clarify this, C<Win32::API> is OSI-approved free software;
1456
- you can redistribute it and/or modify it under the same terms as Perl
1457
- itself.
1458
-
1459
- See L<http://dev.perl.org/licenses/artistic.html>
1460
-
1461
- =head1 CREDITS
1462
-
1463
- All the credits go to Andrea Frosini for the neat assembler trick
1464
- that makes this thing work. I've also used some work by Dave Roth
1465
- for the prototyping stuff. A big thank you also to Gurusamy Sarathy
1466
- for his invaluable help in XS development, and to all the Perl
1467
- community for being what it is.
1468
-
1469
- Cosimo also wants to personally thank everyone that contributed
1470
- to Win32::API with complaints, emails, patches, RT bug reports
1471
- and so on.
1472
-
1473
- =cut
644
+ #line 1474
1474
645