Opened 10 years ago

Closed 10 years ago

#2917 closed Bug (Fixed)

WinAPI_AddMRUString crashes on x64

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


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)

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) & '|'
GUICtrlSetData(-1, $Data)
Local $Button = GUICtrlCreateButton('OK', 125, 58, 70, 23)

While 1
	Switch GUIGetMsg()
		Case $Button
			_WinAPI_AddMRUString($hMRU, GUICtrlRead($Combo))


Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by BrewManNH

Define "crashes".

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

comment:2 Changed 10 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 10 years ago by Jpm

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

Fixed by revision [11115] 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.