Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3894 closed Bug (Fixed)

_WinAPI_GetProcessName returns incorrect result when process ID is invalid

Reported by: danpollak2@… Owned by: J-Paul Mesnage
Milestone: 3.3.16.1 Component: Standard UDFs
Version: 3.3.16.0 Severity: None
Keywords: Cc:

Description

_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 by mLipok, 4 years ago

Component: AutoItStandard UDFs
Version: 3.3.14.53.3.16.0

comment:2 by mLipok, 4 years ago

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 by J-Paul Mesnage, 4 years ago

Milestone: 3.3.15.6
Owner: set to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [12768] in version: 3.3.15.6

comment:4 by J-Paul Mesnage, 4 years ago

Milestone: 3.3.15.63.3.16.1

Fixed by revision [12769] in version: 3.3.16.1

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.