Sign in to follow this  
Followers 0
drego

64bit vs 32bit

4 posts in this topic

#1 ·  Posted (edited)

During the AutoIt installer it gives the option to install 32bit or 64bit tools. Most systems these days are 64bit. Should I be creating autoit programs for both? Do autoit compiled applications really benefit from being 64 vs 32? If compiled for 64bit will there be a problem using the mass of UDFs available or does that not matter?

Under what circumstances is compiling for 64bit going to make my program run better? Are there any downsides? Any differences in how I develop, use UDFs, DLLs, anything?

Also, if I install 64bit Autoit tools can I still compile for 32bit and what about IE browser controls will they then be the 64bit IE?

Thanks.

Edited by drego

Share this post


Link to post
Share on other sites



One thing to watch out for when compiling AutoIt applications as 64Bit, is if you are COM libraries etc. your script may not work. The reason is that a lot of programs that have COM interfaces to allow functionality to be used in application like AutoIt, have not yet written 64Bit versions, even though the main program may have a 64Bit version.   


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

 

Should I be creating autoit programs for both?

Whichever your target system supports.

 

Do autoit compiled applications really benefit from being 64 vs 32?

There's no benefit in performance, however if the target OS is 64 bit, and for whatever reason lacks the 32bit comparability layer (SysWoW64), then 32 bit compiled script will not run.

 

 If compiled for 64bit will there be a problem using the mass of UDFs available or does that not matter?

No. It's worth noting though that AutoIt isn't truly compiled. The 'compilation' process is simply embedding the finished script with the interpreter. 

 

Under what circumstances is compiling for 64bit going to make my program run better?  Are there any downsides? 

See answer number 2.

 

Any differences in how I develop, use UDFs, DLLs, anything?

No.

 

Also, if I install 64bit Autoit tools can I still compile for 32bit and what about IE browser controls will they then be the 64bit IE?

Yes you can still compile for 32.

Generally, you'll want to use 32bit AutoIt for automating other 32bit processes. and 64bit AutoIt for automating 64bit process, IE included.

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

My home network consists of a single Win7 64 bit AutoIt tcp client and Win7 32 bit tcp server(s).

My (poorish) memory is that 64 bit AutoIt was installed on the 64 bit client machine.

That client machine recently suffered catastrophic hardware failure. After receipt of a Win 7 64bit replacement I created a system image (via AOEMI backupper, over the network to the server machine)  but am not totally sure if that image was before/after I had installed 32 bit AutoIt on it.

In any case, my AutoIt client/server script no longer works (hope I don't have to describe that problem) and, after a lot of head scratching/testing, my guess is the 32 bit AutoIt install is/could be the problem...for example this exists in my Win7 64 bit script:

#include <WinAPIFiles.au3>
_WinAPI_Wow64EnableWow64FsRedirection(False)

(that also exists in my Win7@ 32 bit script though:>)

Anyway, since i'm:

(i) not sure whether my system image was before/after the seemingly ill judged AutoIt 32 bit install

&

(ii) I won't have an external usb drive capable to reload the image until after the Festive period (and being a little nervous of doing that for the very first time ever) 

It seems an easy fix is (or could be) to uninstall the 32 bit AutoIt  (v3.3.14.2) via Windows Control panel then install 64 bit AutoIt.

Question:

My question is whether my easy fix seems sensible or should I be concerned that Windows Control Panel 32 bit uninstall will leave a "mess" (in the registry, for example).

I'm just leaving on a short-break so thanks if there should be any replies and if there are any required clarifications i'll get back to those in a couple of days.

(...or maybe I should just describe the problem & fix the current setup?)

====================================================================================================================================================================================================================

Solved (for the record):

In the above description, psexec is used to start the remote server scripts from within the client script. For psexec to operate successfully the client script must already have set the redirection as False:

#include <WinAPIFiles.au3>
_WinAPI_Wow64EnableWow64FsRedirection(False)

However, if redirection remains False prior to TCPStartup on the client - that fails, i.e. to fix the failure include:

_WinAPI_Wow64EnableWow64FsRedirection(True)

Immediately prior to TCPStartup()

Edited by newniman
case specific solution

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • iXX
      By iXX
      Hi!
      Looking for working code to  get full path of process  - both 32 & 64 bit.
      I tryed this bellow, but it works only for 32-bit processes, even if compiled for x64...
      Thanx for suggestions!
       
      Func _ProcessGetPath($vProcess) ;get the program path done by MrCreatoR Local $iPID = ProcessExists($vProcess) If NOT $iPID Then Return SetError(1, 0, -1) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If NOT IsArray($aProc) OR NOT $aProc[0] Then Return SetError(2, 0, -1) Local $vStruct = DllStructCreate('int[1024]') Local $hPsapi_Dll = DllOpen('Psapi.dll') If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@SystemDir & '\Psapi.dll') If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@WindowsDir & '\Psapi.dll') If $hPsapi_Dll = -1 Then Return SetError(3, 0, '') DllCall($hPsapi_Dll, 'int', 'EnumProcessModules', _ 'hwnd', $aProc[0], _ 'ptr', DllStructGetPtr($vStruct), _ 'int', DllStructGetSize($vStruct), _ 'int_ptr', 0) Local $aRet = DllCall($hPsapi_Dll, 'int', 'GetModuleFileNameEx', _ 'hwnd', $aProc[0], _ 'int', DllStructGetData($vStruct, 1), _ 'str', '', _ 'int', 2048) DllClose($hPsapi_Dll) If NOT IsArray($aRet) OR StringLen($aRet[3]) = 0 Then Return SetError(4, 0, '') Return $aRet[3] EndFunc  
    • j0kky
      By j0kky
      Hi guys,
      Bitwise operations in Autoit is possible only till 32 bit integers, but sometimes WinAPI requires to process 64 bit vectors... so?
      So you can use this little UDF to handle properly those integers!
      Func _BitAND64($iValue1, $iValue2) If Not ((VarGetType($iValue1) = "Int64") Or (VarGetType($iValue2) = "Int64")) Then Return BitAND($iValue1, $iValue2) $iValue1 = __DecToBin64($iValue1) $iValue2 = __DecToBin64($iValue2) Local $aValueANDed[64], $i For $i = 0 To 63 $aValueANDed[$i] = ($iValue1[$i] And $iValue2[$i]) ? 1 : 0 Next Return __BinToDec64($aValueANDed) EndFunc ;==>_BitAND64 Func _BitOR64($iValue1, $iValue2) If Not ((VarGetType($iValue1) = "Int64") Or (VarGetType($iValue2) = "Int64")) Then Return BitOR($iValue1, $iValue2) $iValue1 = __DecToBin64($iValue1) $iValue2 = __DecToBin64($iValue2) Local $aValueORed[64], $i For $i = 0 To 63 $aValueORed[$i] = ($iValue1[$i] Or $iValue2[$i]) ? 1 : 0 Next Return __BinToDec64($aValueORed) EndFunc ;==>_BitOR64 Func _BitXOR64($iValue1, $iValue2) If Not ((VarGetType($iValue1) = "Int64") Or (VarGetType($iValue2) = "Int64")) Then Return BitXOR($iValue1, $iValue2) $iValue1 = __DecToBin64($iValue1) $iValue2 = __DecToBin64($iValue2) Local $aValueXORed[64], $i For $i = 0 To 63 $aValueXORed[$i] = (($iValue1[$i] And (Not $iValue2[$i])) Or ((Not $iValue1[$i]) And $iValue2)) ? 1 : 0 Next Return __BinToDec64($aValueXORed) EndFunc ;==>_BitXOR64 Func _BitNOT64($iValue) If Not (VarGetType($iValue) = "Int64") Then Return BitNOT($iValue) $iValue = __DecToBin64($iValue) For $i = 0 To 63 $iValue[$i] = Not $iValue[$i] Next Return __BinToDec64($iValue) EndFunc ;==>_BitNOT64 Func __DecToBin64($iDec) Local $tDec = DllStructCreate("int64 num"), $aBin[64], $bBit, $i $tDec.num = $iDec For $i = 0 To 63 $bBit = (Mod($tDec.num, 2) ? 1 : 0) $aBin[63 - $i] = $bBit $tDec.num = Floor($tDec.num / 2) Next Return $aBin EndFunc ;==>__DecToBin64 Func __BinToDec64($aBin) Local $tDec = DllStructCreate("int64 num"), $i If $aBin[0] Then $tDec.num += 0x8000000000000000 ;2^63 = 9223372036854775808, but for Autoit the world ends at 9223372036854775807 (2^63 - 1) For $i = 1 To 63 If $aBin[$i] Then $tDec.num += 2 ^ (63 - $i) Next Return $tDec.num EndFunc ;==>__BinToDec64 If you are working with unsigned 64 bit integers and these functions return a negative value, don't worry, bitwise operations come out well, but Autoit manages all numbers as signed integers.
    • algiuxas
      By algiuxas
      Hello,
      I'm making program(using AutoIt) that would connect to server.
      I need help converting numbers to VarInt.

      About VarInt:



      About VarInt: https://developers.google.com/protocol-buffers/docs/encoding#varints
      I can't understand how VarInt works, maybe somebody could help me? Thanks
    • AutID
      By AutID
      Hello,

      I will put it as simple as possible
      Why this code runs perfectly on 32bit and it fails on 64bit?
      Local $hWND = WinGetProcess("[CLASS:LSS_app]") ConsoleWrite($hWND & @LF) Local $hModuleList = _WinAPI_EnumProcessModules($hWND) If @error Then ConsoleWrite("Error: " & @error & @LF) For $i = 0 To $hModuleList[0][0] - 1 ;~ If StringInStr($hModuleList[$i][1], "sysCap64.dll") Then ConsoleWrite($hModuleList[$i][0] & @LF) ;~ EndIf Next As the title says EnumProcessModules returns error 10 which I have no clue what it is.
      It must be something with autoit or my lack of coding because a similar code in C# will work like a charm on both x86 and x64
      Process[] Processes = Process.GetProcessesByName("winLSS64Cap"); Process nProcess = Processes[0]; Handle = OpenProcess(0x10, true, (uint)nProcess.Id); for(int i = 0; i < nProcess.Modules.Count; i++) { Console.WriteLine(nProcess.Modules[i].ModuleName); }