pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

autoit private pastebin - collaborative debugging tool What's a private pastebin?


Posted by bjkaiser on Wed 13 May 11:05
report abuse | download | new post

  1. #cs ----------------------------------------------------------------------------
  2.        
  3.         AutoIt Version: 3.2.4.9
  4.         Author:         Björn Kaiser <kaiser.bjoern@gmx.net>
  5.        
  6.         Script Function:
  7.        
  8.        
  9. #ce ----------------------------------------------------------------------------
  10.  
  11. Opt("MustDeclareVars", 1)
  12. #include <wimgapi.au3>
  13. ;~ #include <DllCallback.au3>
  14.  
  15. Dim $fhandle, $vhandle, $imageinfo, $i, $pProgress
  16. $pProgress = DllCallBackRegister ("_Progress", "int", "dword;lparam;wparam;ptr")
  17. ConsoleWriteError("DllCallBack error: " & @error & @CRLF & "_DllCallBack rc: " & $pProgress & @CRLF)
  18. $pProgress = DllCallbackGetPtr($pProgress)
  19. ProgressOn("Wimgapi.dll","Applying image ...")
  20. Apply("c:\temp\test.wim", "C:\temp\")
  21. ;~ ProgressOn("Wimgapi.dll","Capturing image ...")
  22. ;~ Capture("c:\temp\test.wim", "C:\temp\1\")
  23. DllCallBackFree($pProgress)
  24.  
  25. Func _Progress($1,$2,$3,$4)
  26.         If $1 = 38008 Then
  27.                 ProgressSet($2,"Remaining time : " & Int($3 / 1000) & " seconds")
  28.         EndIf
  29. ;~ If $1 = 38008 Then
  30.         ConsoleWrite("_Progress: " & @CRLF & $1 & @CRLF & $2 & @CRLF & $3 & @CRLF & $4 & @CRLF)
  31. ;~ EndIf
  32.  
  33. Return $wim_msg_success
  34. ;~ Return 0
  35.  
  36. Func Apply($wim,$sPath)
  37. Local $rc_apply, $rc_close, $rc_shutdown, $lhandle, $rc_temppath
  38.         $fhandle = _wim_createfile ($wim, $wim_generic_read)
  39. ;~      ConsoleWrite("_wim_createfile : " & $fhandle & @CRLF)
  40.         $rc_temppath = _wim_settemporarypath($fhandle,@TempDir)
  41. ;~      ConsoleWrite("_wim_settemporarypath : " & $rc_temppath & @CRLF)
  42.         $lhandle = _wim_loadimage ($fhandle,1)
  43. ;~      ConsoleWrite("_wim_loadimage : " & $lhandle & @CRLF)
  44.         _wim_registermessagecallback($fhandle,$pProgress)
  45.         $rc_apply = _wim_applyimage ($lhandle, $sPath)
  46. ;~      ConsoleWrite("_wim_applyimage : " & $rc_apply & @CRLF)
  47.         _wim_unregistermessagecallback($fhandle,$pProgress)
  48.         $rc_close = _wim_closehandle ($lhandle)
  49. ;~      ConsoleWrite("_wim_closehandle : " & $rc_close & @CRLF)
  50.         $rc_close = _wim_closehandle ($fhandle)
  51. ;~      ConsoleWrite("_wim_closehandle : " & $rc_close & @CRLF)
  52.         $rc_shutdown = _wim_shutdown ()
  53. ;~      ConsoleWrite("_wim_shutdown : " & $rc_shutdown & @CRLF)
  54. EndFunc   ;==>Apply
  55.  
  56. Func Capture($wim,$sPath)
  57.         $fhandle = _wim_createfile ($wim,$wim_generic_write,$wim_create_always,$wim_flag_verify,$wim_compress_xpress)
  58.  
  59. ;~ $imageinfo = _wim_getimageinformation ($fhandle)
  60.  
  61. ;~ ConsoleWrite("-- ImageInfo createFile" & @CRLF & UBound($imageinfo) & @CRLF)
  62. ;~ For $i = 0 To UBound($imageinfo) - 1
  63. ;~      ConsoleWrite("$imageinfo[" & $i & "]: " & $imageinfo[$i] & @CRLF)
  64. ;~ Next
  65. ;~ _wim_setimageinformation ($fhandle, $imageinfo[3], $imageinfo[1])
  66.         _wim_registermessagecallback($fhandle,$pProgress)
  67.         $vhandle = _wim_captureimage ($fhandle, $sPath)
  68.         _wim_unregistermessagecallback($fhandle,$pProgress)
  69. ;~ $imageinfo = _wim_getimageinformation ($vhandle)
  70. ;~ ConsoleWrite("-- ImageInfo catureImage" & @CRLF & UBound($imageinfo) & @CRLF)
  71. ;~ For $i = 0 To UBound($imageinfo) - 1
  72. ;~      ConsoleWrite("$imageinfo[" & $i & "]: " & $imageinfo[$i] & @CRLF)
  73. ;~ Next
  74. ;~ _wim_setimageinformation ($vhandle, $imageinfo[3], $imageinfo[1])
  75.  
  76.         _wim_closehandle ($vhandle)
  77.         _wim_closehandle ($fhandle)
  78.         _wim_shutdown ()
  79. EndFunc   ;==>Capture

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post