#include-once #include Func DetermineLocation($rep, $offset, $initial_loc = 1) Local $split_string $split_string = StringSplit($rep,";") Return 1 + ($offset - 1) * $split_string[0] + $initial_loc - 1 EndFunc Func GetArchitecture($arch) If $arch = 9 Then Return "x64" If $arch = 6 Then Return "ia64" If $arch = 0 Then Return "x86" EndFunc Func GetSYSTEMTIME(ByRef $struct, $structIndex) Local $SYSTEMTIME_struct = DllStructCreate($tagSYSTEMTIME, DllStructGetPtr($struct, $structIndex)) Local $SYSTEMTIME = _Date_Time_SystemTimeToDateTimeStr($SYSTEMTIME_struct, 1) _DISM_Delete($SYSTEMTIME_struct) ; free resources Return $SYSTEMTIME EndFunc Func GetPCWSTR(ByRef $struct, $sElementName) ; avoids memory access conflicts Local $char_struct Local $anz = 0 ; counter for signs Local $ptr = DllStructGetData($struct, $sElementName) ; ptr Do $char_struct = DllStructCreate("WCHAR", $ptr + $anz) ; get memory location $anz += 2 Until DllStructGetData($char_struct, 1) = Chr(0) ; end of string Local $PCWSTR_struct = DllStructCreate("WCHAR[" & $anz / 2 & "]", $ptr) ; create struct with correct amount of bytes Local $PCWSTR = DllStructGetData($PCWSTR_struct, 1) _DISM_Delete($PCWSTR_struct) ; free resources Return $PCWSTR ; return string EndFunc