Modify

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: 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 Changed 23 months ago by mLipok

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

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 3.3.15.6
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [12768] in version: 3.3.15.6

comment:4 Changed 23 months ago by Jpm

  • Milestone changed from 3.3.15.6 to 3.3.16.1

Fixed by revision [12769] in version: 3.3.16.1

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

Action
as closed The owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.