﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
4104	A bug in _WinAPI_RegDeleteKey()	tukangusil7@…		"According to my test, _WinAPI_RegDeleteKey() returns True if its DllCall to RegDeleteKeyExW() returns non-zero, whereas it should returns False.  I think I’ve found a bug in the implementation of _WinAPI_RegDeleteKey():

{{{#!autoit lineno=1 marks=15
Func _WinAPI_RegDeleteKey($vKey, $sSubKey = '', $iSamDesired = Default)
	If $iSamDesired = Default Then
		If @AutoItX64 Then
			$iSamDesired = $KEY_WOW64_64KEY
		Else
			$iSamDesired = $KEY_WOW64_32KEY
		EndIf
	EndIf

	$vKey = __WinAPI_RegConvHKey($vKey, $sSubKey)
	If @error Then Return SetError(@error + 10, @extended, 0)

	Local $aCall = DllCall('advapi32.dll', 'long', 'RegDeleteKeyExW', 'handle', $vKey, 'wstr', $sSubKey, 'dword', $iSamDesired, 'dword', 0)
	If @error Then Return SetError(@error, @extended, 0)
	If $aCall[0] Then Return SetError(10, $aCall[0], _WinAPI_GetLastError())

	Return 1
EndFunc   ;==>_WinAPI_RegDeleteKey
}}}


The line

{{{#!autoit lineno=15
If $aCall[0] Then Return SetError(10, $aCall[0], _WinAPI_GetLastError())
}}}

should be

{{{#!autoit lineno=15
If $aCall[0] Then Return SetError(10, $aCall[0], 0)
}}}
"	Bug	new		AutoIt	3.3.18.0	None			
