Posted by bjkaiser on Wed 13 May 11:04
report abuse | View followups from bj-kaiser | download | new post
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.2.4.9
- Author: Björn Kaiser <kaiser.bjoern@gmx.net>
- Script Function:
- wimgapi.dll wrapper
- #ce ----------------------------------------------------------------------------
- ; function list
- ;===============================================================================
- ; _WIM_ApplyImage
- ; _WIM_CaptureImage
- ; _WIM_CloseHandle
- ; _WIM_CreateFile
- ; _WIM_GetImageInformation
- ; _WIM_LoadImage
- ; _WIM_SetImageInformation
- ; _WIM_SetTemporaryPath
- ; _WIM_Shutdown
- ; _WIM_Startup
- #comments-start
- User Calltips:
- _WIM_CreateFile($sPath,[$dWIM_DesiredAccess],[$dWIM_CreationDisposition],[$dWIM_FlagsAndAttributes],[$dWIM_CompressionType],[$lWIM_CreationResult])
- _WIM_CaptureImage($hWIM,$sPath,[$dWIM_CaptureFlags])
- _WIM_ApplyImage($hImage,$sPath,[$dWIM_ApplyFlags])
- _WIM_LoadImage($hWIM,$dWIM_ImageIndex)
- _WIM_SetTemporaryPath($hWIM,$sPath)
- _WIM_CloseHandle($hObject)
- _WIM_StartUp()
- _WIM_Shutdown()
- #comments-end
- #include-once
- #region ### START $wim_... constants ###
- ;~ Ursprünglich Integer Wert
- ;~ Aufgefüllte Werte
- ;~ --
- #endregion ### END $wim_... constants ###
- ;===============================================================================
- ;
- ; Function Name: _WIM_CreateFile
- ; Parameter(s): $sPath - Path to the file to read/create
- ; $iWIM_DesiredAccess - Optional, specify read/write/query access
- ; default: $wim_generic_read
- ; $iWIM_CreationDisposition - Optional, specifies how existing files are handled
- ; default: $wim_open_always
- ; $iWIM_FlagsAndAttributes - Optional, specifies actions to be taken for the file
- ; default: $wim_flag_share_write
- ; $iWIM_CompressionType - Optional, specifies the compression level for a newly created file
- ; default: $wim_compress_xpress
- ; $iWIM_CreationResult - Optional, pointer to a variable that receives the creation result
- ; default: NULL
- ; Description: Makes a new image file or opens an existing image file.
- ; Requirement: None
- ; Return Value(s): If the function succeeds, the return value is an open handle
- ; to the specified image file. If the function fails, the
- ; return value is NULL.
- ;
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_CreateFile($sPath,[$dWIM_DesiredAccess],[$dWIM_CreationDisposition],[$dWIM_FlagsAndAttributes],[$dWIM_CompressionType],[$lWIM_CreationResult])
- ; Author(s):
- ;
- ;===============================================================================
- $WIM_FlagsAndAttributes = 0x00000040, $WIM_CompressionType = 0x00000001, $WIM_CreationResult = "NULL")
- "int", $WIM_CreationDisposition, "int", $WIM_FlagsAndAttributes, "int", $WIM_CompressionType, "int", $WIM_CreationResult)
- $hWIM = $create[0]
- Return $hWIM
- EndFunc ;==>_WIM_CreateFile
- ;===============================================================================
- ;
- ; Function Name: _WIM_CaptureImage
- ; Parameter(s): $hWIM - Handle as returned by _WIM_CreateFile
- ; $sPath - Path to capture
- ; Description: Captures an image from a directory path and stores it in an
- ; image file.
- ; Requirement: None
- ; Return Value(s): If the function succeeds, then the return value is a handle
- ; to an object representing the volume image. If the function
- ; fails, then the return value is NULL.
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_CaptureImage($hWIM,$sPath,[$dWIM_CaptureFlags])
- ; Author(s):
- ;
- ;===============================================================================
- Local $capture
- $capture = DllCall($g_wimgapi, "int", "WIMCaptureImage", "ptr", $hWIM, "wstr", $sPath, "int", $WIM_CaptureFlags)
- EndFunc ;==>_WIM_CaptureImage
- ;===============================================================================
- ;
- ; Function Name: _WIM_ApplyImage
- ; Parameter(s): $hImage - Handle as returned by _WIM_CreateFile or _WIM_CaptureImage
- ; $sPath - Path to apply the image to
- ; Requirement: None
- ; Return Value(s): If the function succeeds, then the return value is nonzero.
- ; If the function fails, then the return value is zero.
- ; Description: Applies an image to a directory path from a Windows image
- ; (.wim) file.
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_ApplyImage($hImage,$sPath,[$dWIM_ApplyFlags])
- ; Author(s):
- ;
- ;===============================================================================
- Local $apply
- $apply = DllCall($g_wimgapi, "int", "WIMApplyImage", "ptr", $hImage, "wstr", $sPath, "int", $wim_flag_index)
- EndFunc ;==>_WIM_ApplyImage
- ;===============================================================================
- ;
- ; Function Name: _WIM_LoadImage
- ; Parameter(s): $hWIM - Handle as returned by _WIM_CreateFile
- ; $dImageIndex - Index of the image to load
- ; Requirement: None
- ; Return Value(s): If the function succeeds, then the return value is a handle to
- ; an object representing the volume image. If the function fails,
- ; then the return value is NULL.
- ; Description: Loads a volume image from a Windows image (.wim) file
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_LoadImage($hWIM,$dWIM_ImageIndex)
- ; Author(s):
- ;
- ;===============================================================================
- Local $load
- EndFunc ;==>_WIM_LoadImage
- ;===============================================================================
- ;
- ; Function Name: _WIM_SetTemporaryPath
- ; Parameter(s): $hWIM - Handle as returned by _WIM_CreateFile
- ; $sPath - The path where temporary image (.wim) files are to be stored during capture or application.
- ; Requirement: None
- ; Return Value(s): Returns nonzero if successful or NULL otherwise.
- ; Description: Sets the location where temporary imaging files are to be stored.
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_SetTemporaryPath($hWIM,$sPath)
- ; Author(s):
- ;
- ;===============================================================================
- Local $load
- EndFunc ;==>_WIM_SetTemporaryPath
- ;===============================================================================
- ;
- ; Function Name: _WIM_CloseHandle
- ; Parameter(s): $hObject - Handle of a image-based object
- ; Requirement: None
- ; Return Value(s): If the function succeeds, the return value is nonzero.
- ; If the function fails, the return value is zero.
- ; Description: Closes an open Windows Imaging (.wim) file or image handle.
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_CloseHandle($hObject)
- ; Author(s):
- ;
- ;===============================================================================
- Local $close
- EndFunc ;==>_WIM_CloseHandle
- ;===============================================================================
- ;
- ; Function Name: _WIM_RegisterMessageCallback
- ; Parameter(s): $hWIM -
- ; $
- ; Requirement: None
- ; Return Value(s): If the function succeeds, the return value is nonzero.
- ; If the function fails, the return value is zero.
- ; Description: Registers a function to be called with imaging-specific data.
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_RegisterMessageCallback($hWIM,$pWIM_MessageProc)
- ; Author(s):
- ;
- ;===============================================================================
- Local $register
- $register = DllCall($g_wimgapi, "int", "WIMRegisterMessageCallback", "ptr", $hWIM, "ptr", $WIM_MessageProc, "int", "NULL")
- EndFunc ;==>_WIM_RegisterMessageCallback
- ;===============================================================================
- ;
- ; Function Name: _WIM_UnregisterMessageCallback
- ; Parameter(s): $hObject - Handle of a image-based object
- ; Requirement: None
- ; Return Value(s): If the function succeeds, the return value is nonzero.
- ; If the function fails, the return value is zero.
- ; Description: Registers a function to be called with imaging-specific data.
- ; @error Value(s): 1 - Error in DLLCall
- ;
- ; User CallTip: _WIM_UnregisterMessageCallback($hWIM,$pWIM_MessageProc)
- ; Author(s):
- ;
- ;===============================================================================
- Local $unregister
- $unregister = DllCall($g_wimgapi, "int", "WIMUnregisterMessageCallback", "ptr", $hWIM, "ptr", $WIM_MessageProc)
- EndFunc ;==>_WIM_UnregisterMessageCallback
- ;===============================================================================
- ;
- ; Function Name: _WIM_GetImageInformation
- ; Description: Returns information about an image within the .wim
- ; (Windows image) file.
- ; Return Value:
- ; !!! NOT WORKING ATM !!!
- ;===============================================================================
- ;~ DllStructSetData($size,1,DllStructGetSize($struct))
- $rc_getinfo = DllCall($g_wimgapi, "int", "WIMGetImageInformation", "ptr", $wim_handle, "ptr", DllStructGetPtr($struct), "ptr", DllStructGetPtr($size))
- ConsoleWriteError("_WIM_GetImageInformation error: " & @error & @CRLF & "_WIM_GetImageInformation rc: " & $rc_getinfo & @CRLF)
- Return 0
- $a_return[2] = $rc_getinfo
- Return $a_return
- EndFunc ;==>_WIM_GetImageInformation
- ;===============================================================================
- ;
- ; Function Name: _WIM_SetImageInformation
- ; Description: Stores information about an image in the Windows image
- ; (.wim) file.
- ; Return Value:
- ; !!! NOT WORKING ATM !!!
- ;===============================================================================
- $rc_setinfo = DllCall($g_wimgapi, "int", "WIMSetImageInformation", "ptr", $wim_handle, "ptr", $xml_pointer, "ptr", $xml_size)
- ConsoleWriteError("_WIM_GetImageInformation error: " & @error & @CRLF & "_WIM_SetImageInformation rc: " & $rc_setinfo & @CRLF)
- Return 0
- $a_return[0] = $rc_setinfo
- Return $a_return
- EndFunc ;==>_WIM_SetImageInformation
- ;===============================================================================
- ;
- ; Function Name: _WIM_Startup
- ; Description: Load wimgapi.dll
- ; Return Value:
- ;
- ;===============================================================================
- Local $wimgapi
- Return $wimgapi
- EndFunc ;==>_WIM_Startup
- ;===============================================================================
- ;
- ; Function Name: _WIM_Shutdown
- ; Description: Unload wimgapi.dll
- ; Return Value:
- ;
- ;===============================================================================
- Local $rc_close
- Return $rc_close
- EndFunc ;==>_WIM_Shutdown
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.