Modify

Opened 3 years ago

Closed 3 years ago

#2917 closed Bug (Fixed)

WinAPI_AddMRUString crashes on x64

Reported by: demian.kellermann@… Owned by: Jpm
Milestone: 3.3.13.20 Component: AutoIt
Version: 3.3.12.0 Severity: None
Keywords: mru winapi x64 Cc:

Description

The Function _WinAPI_AddMRUString crashes when called on the x64 version of AutoIT. Example script is the one in the help file:

#include <WinAPIReg.au3>
#include <APIRegConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>

Local $hMRU = _WinAPI_CreateMRUList($HKEY_CURRENT_USER, 'Software\MyProg\MRU', 5)

; Create MRU list in the registry (only at first start example)
RegRead('HKCU\Software\MyProg\MRU', 'MRUList')
If @error Then
	For $i = 5 To 1 Step -1
		_WinAPI_AddMRUString($hMRU, 'String' & $i)
	Next
EndIf

GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 320, 92)
Local $Combo = GUICtrlCreateCombo(_WinAPI_EnumMRUList($hMRU, 0), 10, 20, 300, 21, $CBS_DROPDOWNLIST)
Local $Count = _WinAPI_EnumMRUList($hMRU, -1)
Local $Data = ''
For $i = 1 To $Count - 1
	$Data &= _WinAPI_EnumMRUList($hMRU, $i) & '|'
Next
GUICtrlSetData(-1, $Data)
Local $Button = GUICtrlCreateButton('OK', 125, 58, 70, 23)
GUISetState(@SW_SHOW)

While 1
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			ExitLoop
		Case $Button
			_WinAPI_AddMRUString($hMRU, GUICtrlRead($Combo))
			ExitLoop
	EndSwitch
WEnd

_WinAPI_FreeMRUList($hMRU)

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by BrewManNH

Define "crashes".

I ran that script on Win7 x64 using 3.3.12.0 and 3.3.13.19 and it worked for me.

comment:2 Changed 3 years ago by Jpm

It really crash when run in X64 mode.

You will not believe the MSDN doc is wrong for the CreateMRUList API
The return is not an INT but a HANDLE
I will fix WinAPIReg.au3

comment:3 Changed 3 years ago by Jpm

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

Fixed by revision [11115] in version: 3.3.13.20

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.