Opened 5 years ago

Last modified 5 years ago

#3744 closed Bug

_Crypt_DestroyKey() does not increment DLL handles — at Version 1

Reported by: KaFu Owned by:
Milestone: 3.3.15.1 Component: Standard UDFs
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description (last modified by mLipok)

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.

#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

Change History (1)

comment:1 Changed 5 years ago by mLipok

  • Description modified (diff)
Note: See TracTickets for help on using tickets.