Modify

Opened 11 years ago

Closed 11 years ago

#2917 closed Bug (Fixed)

WinAPI_AddMRUString crashes on x64

Reported by: demian.kellermann@… Owned by: J-Paul Mesnage
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 by BrewManNH, 11 years ago

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

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

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

Fixed by revision [11115] in version: 3.3.13.20

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.