Opened 23 months ago

Closed 23 months ago

Last modified 23 months ago

#3894 closed Bug (Fixed)

_WinAPI_GetProcessName returns incorrect result when process ID is invalid

Reported by: danpollak2@… Owned by: Jpm
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:


_WinAPI_GetProcessName should return an error if the PID isn't valid. Instead, it returns the name of the most recently launched process, which is generally "AutoIt3.exe"

#include <WinAPIProc.au3>

Local $sDriverProcessName = _WinAPI_GetProcessName(500000)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sDriverProcessName = ' & $sDriverProcessName & @CRLF & '>Error code: ' & @error & @CRLF)

Attachments (0)

Change History (4)

comment:1 Changed 23 months ago by mLipok

  • Component changed from AutoIt to Standard UDFs
  • Version changed from to

comment:2 Changed 23 months ago by mLipok

There is a bug

        If Not $aCall[0] Then SetError(10, 0, '')

should be:

        If Not $aCall[0] Then Return SetError(10, 0, '')

        Return DllStructGetData($tPROCESSENTRY32, 'ExeFile')
EndFunc   ;==>_WinAPI_GetProcessName

comment:3 Changed 23 months ago by Jpm

  • Milestone set to
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [12768] in version:

comment:4 Changed 23 months ago by Jpm

  • Milestone changed from to

Fixed by revision [12769] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.