﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3744	_Crypt_DestroyKey() does not increment DLL handles	KaFu		"The '''_Crypt_DestroyKey()''' contains a call to '''_Crypt_Shutdown()''', decreasing DLL handles, but no call to '''_Crypt_Startup()''' to increase it in the first place.


{{{#!autoit
#include <Crypt.au3>

Local $Res = _Crypt_DestroyKey_Ex(1)
ConsoleWrite($Res & @tab & @error & @TAB & @extended & @tab & _WinAPI_GetLastErrorMessage() & @crlf)

Local $Res = _Crypt_DestroyKey(1)

Func _Crypt_DestroyKey_Ex($hCryptKey)
	_Crypt_Startup()
	Local $aRet = DllCall(__Crypt_DllHandle(), ""bool"", ""CryptDestroyKey"", ""handle"", $hCryptKey)
	Local $iError = @error, $iExtended = @extended
	If Not $aRet[0] Then $iExtended = _WinAPI_GetLastError()
	_Crypt_Shutdown()
	If $iError Or Not $aRet[0] Then
		Return SetError($iError + 10, $iExtended, False)
	Else
		Return True
	EndIf
EndFunc   ;==>_Crypt_DestroyKey
}}}
"	Bug	new		Standard UDFs	3.3.14.5	None			
