Opened on Mar 30, 2026 at 4:18:44 PM
Last modified on Mar 30, 2026 at 11:02:00 PM
#4085 new Bug
__GUICtrl_IsWow64Process($hWnd) issue
| Reported by: | Nine | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.18.0 | Severity: | None |
| Keywords: | Cc: |
Description
If the $hWnd does not exist (because the window has not appeared yet for example), the function returns @autoitpid which can result in faulty (buggy) return.
I would suggest to return an error instead. So changing :
If Not $iPID Then $iPID = @AutoItPID
to :
If Not $iPID Then Return SetError(1)
would make the function more robust.
Attachments (0)
Change History (3)
comment:2 by , on Mar 30, 2026 at 10:52:06 PM
You are right. I shouldn't use that internal function. On the other hand, what is the use of that line ? None ! So instead of returning a valid id, it is returning a false PID. I truly believe that any (internal / external) functions should be self-secure. But that may be just me.
Anyway, just run that script and you will see what I mean :
#AutoIt3Wrapper_UseX64=n
#include <WinAPI.au3>
#include <GuiTab.au3>
_WinAPI_IsWow64Process
Local $sDir = GetAutoItPath()
If ProcessExists("Au3Info_x64.exe") Then ProcessClose("Au3Info_x64.exe")
Run($sDir & "Au3Info_x64.exe")
Local $hWnd = WinGetHandle("AutoIt v3 Window Info")
Local $sTab = _GUICtrlTab_GetItemText(ControlGetHandle($hWnd, "", "SysTabControl321"), 0)
ConsoleWrite("@error = " & @error & " Tab 0 = {" & $sTab & "}" & @CRLF)
Func GetAutoItPath()
Local $sAutoIt = RegRead("HKLM\SOFTWARE\" & (@AutoItX64 ? "\Wow6432Node" : "") & "\AutoIt v3\AutoIt", "InstallDir")
If @error Then Return SetError(1)
Return $sAutoIt & "\"
EndFunc ;==>GetAutoItPath

This is an internal function perhaps not the best naming
If you prouve That the other internal function _GUICtrl_TagOutProcess() is not doing the job
I will do something
Cheers